﻿* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

a,
a:visited {
  color: inherit;
}

html {
  scroll-padding: 2rem;
  width: 100%;
  max-width: 100vw;
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  animation: page-in 0.6s ease both;
}

@keyframes page-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

:root {
  /* Onyx palette — dark page bg, all UI surfaces flat #1a1a1f */
  --bg: #101013;
  --surface: #1a1a1f;
  --surface-2: #1a1a1f;
  --surface-hover: #2b2b35;
  --hairline: #33333d;
  --cover-bg: #1a1a1f;
  --text: #f2f1f5;
  --text-bright: #ffffff;
  --dim: #c8c9d1;
  --muted: #9a9ba6;
  --overlay: rgba(255, 255, 255, 0.08);
  --overlay-strong: rgba(255, 255, 255, 0.13);
  --chip-bg: rgba(255, 255, 255, 0.07);
  --faint: rgba(242, 241, 245, 0.6);
  --accent: #f59e0b;
  --selection: rgba(245, 158, 11, 0.25);
  --scroll-thumb: rgba(255, 255, 255, 0.18);
  --scroll-thumb-hover: rgba(255, 255, 255, 0.28);
  --scroll-track: rgba(255, 255, 255, 0.05);
  --focus: rgba(245, 158, 11, 0.5);
  --glass: rgba(26, 26, 31, 0.55);
  color-scheme: dark;
}

::selection {
  background: var(--selection);
  color: var(--text-bright);
}

::-webkit-scrollbar {
  width: 12px;
}
::-webkit-scrollbar-track {
  background: var(--scroll-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 10px;
  border: 1px solid var(--hairline);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scroll-thumb-hover);
}

.accent {
  color: var(--accent);
}

/* Navbar — floating glass pill */
.navbar {
  position: fixed;
  top: 12px;
  left: 0;
  right: 0;
  z-index: 1000;
  width: 100%;
  padding: 0 18px;
  background: transparent;
  border: none;
  transition: top 0.3s ease;
}

.navbar-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  max-width: 700px;
  margin: 0 auto;
  padding: 8px 10px 8px 10px;
  /* Same solid color as the rest of the UI */
  background: var(--surface);
  border: none;
  border-radius: 14px;
  transition: padding 0.3s ease, background 0.3s ease;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin-left: 0;
}

/* Scrolled — slimmer, quieter, content shows through */
.navbar.scrolled {
  top: 8px;
}

.navbar.scrolled .navbar-inner {
  padding: 5px 8px;
  background: var(--surface);
}

.navbar.scrolled .nav-link {
  padding: 5px 12px;
  font-size: 0.82rem;
}

.navbar.scrolled .navbar-toggle {
  background: transparent;
}

/* Site wordmark — left side of the pill, same type as nav */
.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  user-select: none;
  transition: color 0.2s ease;
}

.navbar-brand:hover {
  color: var(--text-bright);
}

.navbar-brand-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Hamburger — mobile only */
.navbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  color: var(--muted);
  background: var(--surface);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.navbar-toggle i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 14px;
  line-height: 1;
}

.navbar-toggle:hover {
  background: var(--surface-hover);
  color: var(--text-bright);
}

.navbar-toggle svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 560px) {
  .navbar-toggle {
    display: inline-flex;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    transform: none;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    min-width: 190px;
    padding: 6px;
    background: var(--surface);
    border: none;
    border-radius: 16px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links .nav-link {
    width: 100%;
    padding: 10px 14px;
  }
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--dim);
  text-decoration: none;
  border: none;
  border-radius: 10px;
  transition: color 0.2s ease, background 0.2s ease, padding 0.3s ease;
}

.nav-link i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
  vertical-align: middle;
  color: var(--dim);
  transition: color 0.2s ease;
}

.nav-link-icon,
.nav-link svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Font Awesome solid (filled) nav icons — fixed box so icon + text stay centered */
.nav-link .fa-solid,
.nav-link .fa-brands {
  font-size: 12px;
  line-height: 1;
  width: 20px;
  height: 20px;
}

.nav-link:hover {
  color: var(--text-bright);
  background: var(--overlay);
}

.nav-link:hover i,
.nav-link:hover .fa-solid,
.nav-link:hover .fa-brands {
  color: var(--text-bright);
}

.nav-link.active {
  color: var(--text-bright);
  background: var(--overlay-strong);
}

.nav-link.active i,
.nav-link.active .fa-solid,
.nav-link.active .fa-brands {
  color: var(--dim);
}

/* Layout */
.standard-container {
  max-width: 700px;
  margin: 0 auto;
  width: 100%;
  padding-top: 104px;
  padding-left: 18px;
  padding-right: 18px;
  flex: 1;
}

/* Small section eyebrow, same voice as the Socials header */
.section-label {
  padding: 40px 0 14px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--muted);
}

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0 0 16px;
}

.hero-top {
  display: flex;
  align-items: center;
  gap: 20px;
}

@media (max-width: 480px) {
  .hero-top {
    gap: 14px;
  }
  .username {
    font-size: 1.35rem;
  }
  .now-line {
    max-width: 100%;
  }
  /* Keep status + time on one line — shrink pills instead of wrapping */
  .meta-row {
    flex-wrap: nowrap;
    gap: 6px;
  }
  .chips {
    flex-wrap: nowrap;
    gap: 6px;
  }
  .presence-pill {
    min-height: 28px;
    padding: 5px 10px;
    font-size: 0.72rem;
    gap: 6px;
    line-height: 1;
  }
  .chip {
    min-height: 28px;
    padding: 5px 10px;
    font-size: 0.72rem;
    gap: 6px;
    line-height: 1;
  }
  .avatar {
    width: 96px;
    height: 96px;
  }
  .avatar-skeleton {
    width: 96px;
    height: 96px;
  }
  .avatar-decor {
    width: 115px;
    height: 115px;
  }
}

@media (max-width: 360px) {
  .hero-top {
    gap: 12px;
  }
  .meta-row {
    gap: 5px;
  }
  .presence-pill,
  .chip {
    font-size: 0.68rem;
    padding: 4px 8px;
    min-height: 26px;
    gap: 5px;
    line-height: 1;
  }
  .avatar {
    width: 84px;
    height: 84px;
  }
  .avatar-skeleton {
    width: 84px;
    height: 84px;
  }
  .avatar-decor {
    width: 101px;
    height: 101px;
  }
}

.avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.avatar {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  background: var(--surface);
  border: none;
  box-shadow: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.avatar-wrap:hover .avatar.is-ready {
  transform: none;
}

/* Never show a broken / unknown-image icon: hide until a real src loads */
.avatar:not([src]),
.avatar[src=""] {
  opacity: 0;
  visibility: hidden;
}

.avatar.is-ready {
  opacity: 1;
}

.avatar-decor {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 144px;
  height: 144px;
  pointer-events: none;
  z-index: 2;
}

/* Empty decor must not render a broken-image box */
.avatar-decor:not([src]),
.avatar-decor[src=""] {
  display: none;
}

/* Blank shimmer placeholder shown while the avatar loads */
.avatar-skeleton {
  position: absolute;
  inset: 0;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--surface);
  background-size: 200% 100%;
  transition: opacity 0.4s ease;
}

.avatar-wrap.is-loading .avatar-skeleton {
  opacity: 1;
}

.avatar-wrap:not(.is-loading) .avatar-skeleton {
  opacity: 0;
  pointer-events: none;
}

@keyframes skeleton-sheen {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes content-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Description / status skeleton — blank shimmer bars, no placeholder text */
.status.is-loading {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
  max-width: 280px;
  pointer-events: none;
}

.skeleton-bar {
  display: block;
  height: 10px;
  width: 100%;
  border-radius: 6px;
  background: var(--surface);
  background-size: 200% 100%;
}

.skeleton-bar.short {
  width: 62%;
}

.status:not(.is-loading) .skeleton-bar {
  display: none;
}

/* AniList select + grid skeletons */
.anilist-select.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

.anilist-select.is-loading #anilist-select-label,
.anilist-select.is-loading #anilist-sort-label {
  display: inline-block;
  min-width: 70px;
  color: transparent;
  border-radius: 6px;
  background: var(--surface);
  background-size: 200% 100%;
  user-select: none;
}

.anilist-select.is-loading #anilist-sort-label {
  min-width: 44px;
}

/* Sort dropdown opens left-aligned like the filter; guard the right edge */
.anilist-sort .anilist-menu {
  left: 0;
  right: auto;
}

.skeleton-grid {
  animation: none;
}

.skeleton-card {
  animation: none;
  pointer-events: none;
}

.skeleton-cover {
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  background: var(--surface);
  background-size: 200% 100%;
}

.skeleton-line {
  height: 8px;
  margin-top: 8px;
  border-radius: 6px;
  background: var(--surface);
  background-size: 200% 100%;
}

.anilist-list:not(.is-loading) .skeleton-grid {
  display: none;
}

/* Smooth skeleton system: flat base + transform-only sheen sweep.
   translateX runs on the compositor, unlike background-position,
   so it stays fluid even with many placeholders on screen. */
.skeleton-bar,
.skeleton-cover,
.skeleton-line,
.anilist-select.is-loading #anilist-select-label,
.anilist-select.is-loading #anilist-sort-label,
.anilist-stats.is-loading .stat-value {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--surface);
  animation: none;
}

/* Keeps its absolute overlay positioning from above */
.avatar-skeleton {
  overflow: hidden;
  isolation: isolate;
  background: var(--surface);
  animation: none;
}

.anilist-stats.is-loading .stat-value {
  display: inline-block;
  max-width: 100%;
}

.avatar-skeleton::after,
.skeleton-bar::after,
.skeleton-cover::after,
.skeleton-line::after,
.anilist-select.is-loading #anilist-select-label::after,
.anilist-select.is-loading #anilist-sort-label::after,
.anilist-stats.is-loading .stat-value::after {
  display: none;
}

/* Gentle fade when real content replaces a skeleton */
.status:not(.is-loading),
.now-line:not(.is-loading),
.anilist-stats:not(.is-loading),
.anilist-list:not(.is-loading) {
  animation: content-fade 0.4s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .avatar-skeleton::after,
  .skeleton-bar::after,
  .skeleton-cover::after,
  .skeleton-line::after,
  .anilist-select.is-loading #anilist-select-label::after,
  .anilist-select.is-loading #anilist-sort-label::after,
  .anilist-stats.is-loading .stat-value::after,
  .status:not(.is-loading),
  .now-line:not(.is-loading),
  .anilist-stats:not(.is-loading),
  .anilist-list:not(.is-loading),
  .media-card {
    animation: none;
  }

  .media-cover img {
    transition: none;
    opacity: 1;
  }

  .anime-modal-overlay,
  .anime-modal {
    animation: none;
  }
}

.presence-dot {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8a8378;
  flex-shrink: 0;
  cursor: default;
  z-index: 3;
}

.presence-dot::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s, visibility 0.15s;
  pointer-events: none;
  z-index: 100;
}

.presence-dot:hover::after {
  opacity: 1;
  visibility: visible;
}

.hero-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
  padding: 2px 0;
}

.name-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.username {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  word-break: break-word;
  /* Subtle top-lit sheen for the onyx hero */
  background: linear-gradient(180deg, #f2eee5 0%, #c4bdb0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.handle {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role {
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1;
}

.presence-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 11px;
  line-height: 1;
  color: var(--text);
  background: var(--surface-2);
  border: none;
  border-radius: 8px;
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.presence-pill #presence-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  line-height: 1;
}

.status {
  color: var(--dim);
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.5;
}

.meta-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 2px;
  max-width: 100%;
  min-width: 0;
}

.chips {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  flex: 0 1 auto;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 6px 11px;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1;
  color: var(--dim);
  white-space: nowrap;
  background: var(--surface-2);
  border: none;
  border-radius: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

#local-time-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.chip-mono {
  font-family: inherit;
  font-weight: 400;
}

.chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 11px;
  line-height: 1;
  color: var(--muted);
  flex-shrink: 0;
}

.chip-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #453e36;
  flex-shrink: 0;
}

/* Lanyard "now" line — activity pill, hugs content below the profile */
.now-line {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  margin-top: 10px;
  width: auto;
  min-width: 0;
  max-width: 100%;
  padding: 9px 12px;
  color: var(--dim);
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--surface);
  border: none;
  border-radius: 12px;
  overflow: hidden;
}

.now-line span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
  flex: 0 1 auto;
}

.now-line svg,
.now-icon {
  width: 14px;
  height: 14px;
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.now-line.is-loading {
  pointer-events: none;
}

.now-line.is-loading .skeleton-bar {
  max-width: 200px;
}

.now-line:not(.is-loading) .skeleton-bar {
  display: none;
}

@media (max-width: 480px) {
  .now-line {
    font-size: 0.75rem;
  }
}

/* Stats — sections separated by spacing, no divider lines */
.stats {
  padding-top: 8px;
  padding-bottom: 20px;
}

.stats-header {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.015em;
  margin-bottom: 12px;
}

.capture-box {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.capture-frame {
  display: none;
}

.capture-text {
  position: relative;
  z-index: 1;
}

.stats-header.has-count {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stats-header .count {
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--dim);
  background: var(--surface-2);
  border: none;
  border-radius: 6px;
  padding: 2px 9px;
}

/* Socials — plain icon links under the hero description */
.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.social-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--muted);
  background: none;
  border: none;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-card i {
  font-size: 17px;
}

.social-card .fa-instagram {
  font-size: 19px;
}

@media (hover: hover) {
  .social-card:hover {
    transform: translateY(-1px);
  }
}

.social-card:active {
  transform: translateY(0) scale(0.94);
}

.wip-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--dim);
  background: var(--overlay-strong);
  border-radius: 6px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: middle;
  white-space: nowrap;
}

/* AniList */
#anilist {
  font-family: "Inter", system-ui, sans-serif;
  padding-top: 0;
}

.media-note {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 8px 0;
}

.media-section {
  margin-bottom: 20px;
  scroll-margin-top: 90px;
}

.media-section:last-child {
  margin-bottom: 0;
}

.media-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--muted);
}

.media-section-title svg,
.media-section-title .fa-solid,
.media-section-icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

.media-section-title .fa-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
}

.media-section-title .count {
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--dim);
  background: var(--surface-2);
  border: none;
  border-radius: 6px;
  padding: 2px 9px;
}

.anilist-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  margin-bottom: 16px;
}

/* Search leads the row but stays compact on desktop */
.anilist-controls .anilist-search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 300px;
}

.anilist-filter {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

.anilist-filter::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 12px;
  width: 6px;
  height: 6px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.anilist-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  height: 40px;
  white-space: nowrap;
  background: var(--surface);
  color: var(--text);
  border: none;
  border-radius: 14px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0 32px 0 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.anilist-select svg,
.anilist-select .fa-solid,
.anilist-select-icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

.anilist-select .fa-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
}

#anilist-select-label {
  white-space: nowrap;
}

.anilist-select:hover {
  background: var(--surface-hover);
}

.anilist-select:focus {
  outline: none;
}

.anilist-select:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 1px;
}

.anilist-filter.open::after {
  transform: translateY(-40%) rotate(225deg);
  border-color: var(--text);
}

.anilist-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 240px;
  background: var(--surface);
  border: none;
  border-radius: 12px;
  padding: 5px;
  margin: 0;
  display: none;
  z-index: 60;
  box-shadow: none;
}

.anilist-menu.open {
  display: block;
  animation: anilist-menu-in 0.15s ease;
}

@keyframes anilist-menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.anilist-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 9px 12px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.anilist-menu-item svg,
.anilist-menu-item .fa-solid {
  width: 14px;
  height: 14px;
  color: var(--muted);
  flex-shrink: 0;
}

.anilist-menu-item .fa-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
}

.anilist-menu-item.active svg,
.anilist-menu-item.active .fa-solid {
  color: var(--text);
}

.anilist-menu-item:hover {
  background: var(--overlay);
}

.anilist-menu-item.active {
  background: var(--overlay-strong);
}

.anilist-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: var(--surface);
  color: var(--dim);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.anilist-view:hover {
  background: var(--surface-hover);
  color: var(--text-bright);
}

.anilist-view svg,
.anilist-view i {
  width: 16px;
  height: 16px;
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.anilist-search {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.anilist-search svg,
.anilist-search i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  font-size: 12px;
  line-height: 1;
  color: var(--muted);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.anilist-search input {
  width: 100%;
  height: 40px;
  background: var(--surface);
  color: var(--text);
  border: none;
  border-radius: 14px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0 12px 0 36px;
  transition: background 0.2s ease;
}

.anilist-search input::placeholder {
  color: var(--muted);
}

.anilist-search input:hover {
  background: var(--surface-2);
}

.anilist-search input:focus {
  outline: none;
  background: var(--surface-2);
}

@media (max-width: 480px) {
  .anilist-controls {
    gap: 8px;
    flex-wrap: wrap;
  }

  /* Row 1: view button first + search next to it, Row 2: filter + sort */
  .anilist-controls .anilist-view {
    order: 0;
    flex: 0 0 auto;
  }

  .anilist-controls .anilist-search {
    flex: 1 1 calc(100% - 48px);
    min-width: 0;
    max-width: none;
    order: 1;
  }

  .anilist-controls .anilist-filter {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    max-width: calc(50% - 4px);
    order: 2;
  }

  .anilist-controls .anilist-sort {
    order: 3;
  }

  .anilist-controls .anilist-filter .anilist-select {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }

  .anilist-select {
    font-size: 0.75rem;
    padding: 8px 28px 8px 10px;
  }

  .anilist-filter::after {
    right: 10px;
  }

  .anilist-search input {
    font-size: 0.75rem;
    padding: 8px 8px 8px 30px;
  }
}

/* AniList stats strip — 6 stats, 3x2 */
.anilist-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  min-width: 0;
  background: var(--surface);
  border: none;
  border-radius: 14px;
  padding: 12px 12px;
}

.stat-value {
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-label {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anilist-stats.is-loading .stat-value {
  color: transparent;
  border-radius: 6px;
  background: var(--surface);
  background-size: 200% 100%;
  user-select: none;
  max-width: 64px;
}

@media (max-width: 480px) {
  .anilist-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat {
    padding: 8px 4px;
  }

  .stat-value {
    font-size: 0.85rem;
  }

  .stat-label {
    font-size: 0.58rem;
  }
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  align-items: start;
}

@media (max-width: 600px) {
  .media-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

.media-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: none;
  text-decoration: none;
  color: inherit;
  animation: media-card-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  transition: transform 0.15s ease;
}

@keyframes media-card-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.media-card:hover {
  transform: translateY(-3px);
}

.media-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 10px;
  background: var(--cover-bg);
  isolation: isolate;
  border: none;
}

.media-card:hover .media-cover {
  background: var(--surface-hover);
}

.media-cover img {
  position: absolute;
  top: -2px;
  left: -2px;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  object-fit: cover;
  display: block;
  border-radius: 10px;
  background: var(--cover-bg);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.media-cover img.is-loaded {
  opacity: 1;
}

.media-cover::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 10px;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.42) 25%, transparent 50%);
}

[hidden] {
  display: none !important;
}

.media-title {
  font-weight: 600;
  color: #f2eee5;
  word-break: break-word;
}

.media-title-over {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7px;
  z-index: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: calc(0.68rem * 1.3 * 3 + 27px);
  padding: 28px 7px 0;
  font-size: 0.68rem;
  line-height: 1.3;
  pointer-events: none;
}

/* Favorite Games — same sizing as anime cards */
#favorite-games .games-grid {
  margin-bottom: 0;
}

#favorite-games .media-cover img {
  opacity: 1;
}

.game-card {
  position: relative;
  cursor: default;
}

.game-card:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 2px;
}

.media-title-row {
  display: none;
}

.media-meta {
  position: static;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
  margin: 0;
  padding: 6px 2px 0;
  background: none;
}

.media-text {
  display: none;
}

.media-sub {
  display: none;
}

.media-desc {
  display: none;
}

.media-progress {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--faint);
}

.media-progress svg,
.media-progress .fa-solid {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  opacity: 0.85;
}

.media-progress .fa-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
}

.media-format {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--faint);
  white-space: nowrap;
}

.media-format svg,
.media-format .fa-solid {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  opacity: 0.85;
}

.media-format .fa-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
}

/* List view */
.media-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.media-list .media-card {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  aspect-ratio: auto;
  background: var(--surface);
  border: none;
  border-radius: 12px;
  padding: 8px 12px;
}

.media-list .media-card:hover {
  transform: translateX(2px);
  background: var(--surface-hover);
}

.media-list .media-cover {
  position: relative;
  width: 60px;
  height: 88px;
  aspect-ratio: auto;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  align-self: flex-start;
}

.media-list .media-cover img {
  position: static;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.media-list .media-cover::after {
  display: none;
}

.media-list .media-meta {
  position: static;
  min-height: 88px;
  padding: 2px 0;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 12px;
  background: none;
}

.media-list .media-title-over {
  display: none;
}

/* Fixed single-line title — never wraps to a new line */
.media-list .media-title-row {
  display: block;
  min-height: calc(0.88rem * 1.35);
  max-height: calc(0.88rem * 1.35);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-list .media-text {
  flex: 1;
  min-width: 0;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 3px;
}

.media-list .media-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(0.74rem * 1.4 * 2);
  max-height: calc(0.74rem * 1.4 * 2);
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--muted);
}

/* Meta info pinned to the bottom of the text column */
.media-list .media-sub {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 3px;
  min-height: calc(0.72rem * 1.4);
  max-height: calc(0.72rem * 1.4);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}

.media-sub-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  min-width: 0;
}

.media-sub-item .fa-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  font-size: 9px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.85;
}

/* Score leads the sub row — brighter text, amber star */
.media-sub-item.is-score {
  color: var(--text);
}

.media-sub-item.is-score .fa-solid {
  color: var(--accent);
  opacity: 1;
}

.media-sub-dot {
  flex-shrink: 0;
  opacity: 0.4;
  font-size: 0.65rem;
}

.media-list .media-progress {
  display: none;
}

.media-list .media-progress svg,
.media-list .media-progress .fa-solid {
  width: 12px;
  height: 12px;
}

.media-list .media-progress .fa-solid {
  font-size: 10px;
}

.media-list .media-format {
  display: none;
}

/* Desktop — use the full screen width, navbar pill stays narrow.
   Mobile / small screens are untouched (max-width queries above still apply). */
@media (min-width: 1024px) {
  .standard-container {
    max-width: 1200px;
    padding-left: 32px;
    padding-right: 32px;
  }

  .anilist-stats {
    grid-template-columns: repeat(6, 1fr);
  }

  .media-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
  }

  .media-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

@media (min-width: 1360px) {
  .standard-container {
    max-width: 1280px;
  }

  .media-grid {
    grid-template-columns: repeat(8, 1fr);
  }
}

/* Premium touches — subtle, keeps original feel */
.social-card:focus-visible,
.anilist-select:focus-visible,
.anilist-view:focus-visible,
.nav-link:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 2px;
}

.username {
  letter-spacing: -0.025em;
}

.role,
.status,
.now-line {
  letter-spacing: 0.01em;
}

/* --- Anime detail menu: centered, dimmed + blurred page behind it --- */
.anime-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  /* Clean dim — page behind visible but subdued, no glow, no blur */
  background: rgba(18, 16, 14, 0.65);
  overflow: hidden;
  animation: overlay-in 0.2s ease both;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Freeze page scroll while the menu is open */
body:has(.anime-modal-overlay:not([hidden])) {
  overflow: hidden;
}

.anime-modal-overlay[hidden] {
  display: none !important;
}

.anime-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: auto;
  max-height: calc(100dvh - 48px);
  /* Solid, uniform surface — same #1a1714 as the rest of the UI */
  background: var(--surface);
  border: none;
  border-radius: 16px;
  overflow: hidden;
  z-index: 1;
  animation: modal-in 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

/* Cover-blur layer unused — the page itself gets the blur */
.anime-menu-blur {
  display: none;
}

.anime-modal-body {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: flex;
}

.anime-page-info {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  overflow: hidden;
}

.anime-info-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-bright);
}

.anime-info-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.anime-info-thumb {
  width: 72px;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: var(--cover-bg);
  flex-shrink: 0;
}

.anime-info-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Stats — one per line, no box, directly on the page */
.anime-info-rows {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: none;
  border: none;
  border-radius: 0;
  overflow: hidden;
}

.anime-info-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  text-align: left;
  gap: 10px;
  min-width: 0;
  padding: 7px 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.anime-info-row .fa-solid {
  width: 16px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--faint);
  flex-shrink: 0;
}

.anime-info-row span {
  font-size: 0.82rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

.anime-info-row strong {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Description: 6 lines tall by default, the only scrollable part */
.anime-info-desc {
  flex: 1 1 auto;
  min-height: 64px;
  max-height: calc(0.85rem * 1.6 * 6);
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--dim);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--surface-hover) transparent;
}

.anime-info-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.anime-info-link:hover {
  color: var(--text-bright);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .anime-modal {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 40px);
  }
  .anime-page-info {
    padding: 16px;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   WoofyBark colour scheme
   Only colours differ from the original file: layout, type, spacing, sizes
   and behaviour are untouched. Every value maps onto the portfolio palette.
   ───────────────────────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;
  --bg: #12100e;
  --surface: #1a1714;
  --surface-2: #1a1714;
  --surface-hover: #241f1a;
  --hairline: #2a2521;
  --cover-bg: #1a1714;
  --text: #f2eee5;
  --text-bright: #fbf8f1;
  --dim: #c4bdb0;
  --muted: #8a8378;
  --overlay: rgba(242, 238, 229, 0.08);
  --overlay-strong: rgba(242, 238, 229, 0.14);
  --chip-bg: rgba(242, 238, 229, 0.07);
  --faint: rgba(242, 238, 229, 0.6);
  --accent: #d9714c;
  --selection: rgba(217, 113, 76, 0.28);
  --scroll-thumb: rgba(242, 238, 229, 0.18);
  --scroll-thumb-hover: rgba(242, 238, 229, 0.28);
  --scroll-track: rgba(242, 238, 229, 0.05);
  --focus: rgba(217, 113, 76, 0.5);
  --glass: rgba(18, 16, 14, 0.6);
}
