/* ============================================================================
   ELSEWHERE — styles.css
   ----------------------------------------------------------------------------
   SECTIONS
     01. Design tokens & reset
     02. Typography helpers / utility
     03. Splash intro animation
     04. Top bar (brand, category nav, search, avatar dropdown)
     05. Mobile drawer
     06. Hero banner
     07. Rows + cards (the Netflix-style rails)
     08. Search results grid
     09. Modals (generic), site detail + rating UI
     10. Auth modal
     11. Admin studio (table, forms, import)
     12. Toasts, confirm, footer
     13. Responsive breakpoints
     14. Reduced motion
   Palette: near-black surfaces + orange accent. Depth comes from layered
   gradients and soft, wide shadows — crisp edges, no glossy bevels, no flat
   grey boxes.
   ========================================================================== */

/* ==========================================================================
   01. DESIGN TOKENS & RESET
   ========================================================================== */
:root {
  /* Surfaces */
  --bg:          #07070a;
  --bg-deep:     #050507;
  --panel:       #111117;
  --panel-2:     #191922;
  --panel-3:     #23232f;
  --line:        rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);

  /* Ink */
  --ink:    #f6f3ef;
  --ink-2:  #cfc9c3;
  --muted:  #9a938d;
  --dim:    #6e6862;

  /* Accent */
  --orange:      #ff6a00;
  --orange-lit:  #ff8f3f;
  --orange-deep: #d94f00;
  --orange-soft: rgba(255, 106, 0, 0.13);
  --orange-line: rgba(255, 106, 0, 0.34);
  --good:        #4ade80;
  --bad:         #ff5a5a;

  /* Geometry */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --gutter: clamp(16px, 3.2vw, 48px);
  --topbar-h: 70px;

  /* Depth */
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 1px 0 rgba(255, 255, 255, 0.05) inset,
                 0 16px 34px -20px rgba(0, 0, 0, 0.95);
  --shadow-lift: 0 30px 60px -26px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 106, 0, 0.28),
                 0 0 46px -16px rgba(255, 106, 0, 0.35);
  --shadow-modal: 0 50px 120px -40px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.08);

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Fonts — Sora for headings, Inter for body (see <link> in index.html) */
  --font-head: "Sora", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px;   /* anchor jumps clear the sticky bar */
}

body {
  margin: 0;
  min-height: 100vh;
  /* The colour lives in .ambient (a fixed layer behind the page) so it can
     drift slowly without repainting anything above it. */
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Splash locks scrolling until it finishes.
   :has() extends the lock to <html>, which is the real scroll container in
   most browsers; older engines simply fall back to the body-only lock. */
body.is-booting,
body.is-locked { overflow: hidden; }
html:has(body.is-booting),
html:has(body.is-locked) { overflow: hidden; }

h1, h2, h3, h4 { font-family: var(--font-head); margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection { background: var(--orange); color: #140800; }

/* Custom scrollbar (desktop only, rows hide theirs separately) */
* { scrollbar-width: thin; scrollbar-color: #2a2a34 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #26262f; border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #35353f; background-clip: content-box; }

/* ==========================================================================
   02. UTILITIES
   ========================================================================== */
.muted { color: var(--muted); }
.tiny { font-size: 12px; line-height: 1.55; color: var(--dim); }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
.sep { color: #3a3a44; }
code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  color: var(--ink-2);
}
.link-btn {
  color: var(--orange-lit);
  font-size: 13px;
  padding: 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.link-btn:hover { border-color: currentColor; }

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 11px 20px;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.28s var(--ease), background 0.28s var(--ease),
              box-shadow 0.28s var(--ease), color 0.28s var(--ease), border-color 0.28s var(--ease);
}
.btn:active { transform: scale(0.975); }

.btn-primary {
  color: #180800;
  background: linear-gradient(180deg, var(--orange-lit), var(--orange));
  box-shadow: 0 10px 26px -12px rgba(255, 106, 0, 0.85), 0 1px 0 rgba(255, 255, 255, 0.35) inset;
}
.btn-primary:hover {
  background: linear-gradient(180deg, #ffa25c, var(--orange-lit));
  box-shadow: 0 16px 34px -12px rgba(255, 106, 0, 0.95), 0 1px 0 rgba(255, 255, 255, 0.45) inset;
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.26); transform: translateY(-1px); }

.btn-danger {
  color: #fff;
  background: linear-gradient(180deg, #ff6b5a, #e0361f);
  box-shadow: 0 12px 28px -14px rgba(224, 54, 31, 0.9);
}
.btn-danger:hover { filter: brightness(1.07); }

/* Everything that moves uses the same short, decelerating curve so the whole
   page feels like one hand animated it. */
.btn, .btn-mini, .seg-btn, .row-arrow, .icon-action, .chip, .pill-cat {
  transition-timing-function: var(--ease-out);
}

.btn-mini { padding: 8px 15px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ==========================================================================
   03. SPLASH INTRO
   ========================================================================== */
.splash {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  /* Transparent on purpose: the five curtain panels below provide the black
     backdrop, so when they wipe upward they genuinely reveal the app. */
  background: transparent;
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
}
.splash.is-gone { display: none; }

.splash-glow {
  position: absolute;
  z-index: 1;                 /* above the curtain panels, below the wordmark */
  inset: auto 0 -40% 0;
  height: 90%;
  background: radial-gradient(60% 70% at 50% 100%, rgba(255, 106, 0, 0.30), transparent 70%);
  filter: blur(10px);
  animation: splashGlow 2.6s var(--ease-out) both;
}
@keyframes splashGlow {
  from { opacity: 0; transform: translateY(40px) scale(0.9); }
  to   { opacity: 1; transform: none; }
}

.splash-core {
  position: relative;
  z-index: 2;
  width: min(760px, 88vw);
  text-align: center;
  padding-bottom: 8px;
}

.splash-kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 22px;
  animation: fadeUp 0.9s var(--ease-out) 0.1s both;
}

/* The wordmark: each letter is clipped and slides up from its own mask */
.splash-word {
  display: flex;
  justify-content: center;
  gap: clamp(1px, 0.7vw, 8px);
  font-size: clamp(38px, 11vw, 108px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--ink);
}
.splash-word span {
  display: inline-block;
  animation: letterRise 0.95s var(--ease-out) both;
  animation-delay: calc(0.12s + var(--i) * 0.058s);
  will-change: transform, opacity;
}
.splash-word span:nth-child(5) { color: var(--orange); } /* the W glows */
@keyframes letterRise {
  from { opacity: 0; transform: translateY(0.85em) rotate(3deg); filter: blur(6px); }
  to   { opacity: 1; transform: none; filter: blur(0); }
}

.splash-meter {
  position: relative;
  height: 2px;
  margin: 34px auto 12px;
  width: min(420px, 70%);
  background: rgba(255, 255, 255, 0.10);
  border-radius: 99px;
  overflow: hidden;
  animation: fadeUp 0.8s var(--ease-out) 0.55s both;
}
.splash-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, var(--orange-deep), var(--orange-lit));
  box-shadow: 0 0 18px rgba(255, 106, 0, 0.7);
  transition: width 0.12s linear;
}

.splash-foot {
  display: flex;
  justify-content: space-between;
  width: min(420px, 70%);
  margin: 0 auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
  animation: fadeUp 0.8s var(--ease-out) 0.65s both;
}
#splashCount { color: var(--orange-lit); font-variant-numeric: tabular-nums; }

.splash-skip {
  position: absolute;
  z-index: 2;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #55505a;
  animation: pulseSoft 2.4s ease-in-out infinite;
}
@keyframes pulseSoft { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Exit curtain */
.splash-panels { position: absolute; z-index: 0; inset: 0; display: flex; pointer-events: none; }
.splash-panels i {
  flex: 1;
  background: #050507;
  transform: translateY(0);
  transition: transform 0.72s cubic-bezier(0.76, 0, 0.24, 1);
}
.splash.is-exiting .splash-core,
.splash.is-exiting .splash-skip {
  opacity: 0;
  animation: none;               /* the pulse animation would otherwise win */
  transition: opacity 0.28s linear;
}
.splash.is-exiting .splash-panels i { transform: translateY(-101%); }
.splash.is-exiting .splash-panels i:nth-child(1) { transition-delay: 0.00s; }
.splash.is-exiting .splash-panels i:nth-child(2) { transition-delay: 0.06s; }
.splash.is-exiting .splash-panels i:nth-child(3) { transition-delay: 0.12s; }
.splash.is-exiting .splash-panels i:nth-child(4) { transition-delay: 0.18s; }
.splash.is-exiting .splash-panels i:nth-child(5) { transition-delay: 0.24s; }

/* App entrance choreography (plays once the splash lifts) */
body.is-booting .topbar { opacity: 0; }
body.is-booting main { opacity: 0; }
body.is-ready .topbar { animation: barDrop 0.7s var(--ease-out) both; }
body.is-ready main { animation: mainRise 0.9s var(--ease-out) 0.08s both; }
@keyframes barDrop { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
/* Opacity only. Sliding the whole <main> would promote a page-height layer
   to the GPU just for a 0.9s entrance, which is exactly the kind of thing
   that makes the first scroll after load feel sticky. */
@keyframes mainRise { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================================================
   04. TOP BAR
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "brand nav search actions";
  align-items: center;
  gap: clamp(10px, 1.8vw, 26px);
  padding: 12px var(--gutter);
  /* No backdrop-filter here on purpose: a sticky bar that re-blurs the whole
     page width on every scroll frame is the single biggest source of scroll
     jank. A near-opaque gradient looks the same and costs nothing. */
  background: linear-gradient(180deg, #08080b 0%, #08080b 74%, #08080bfb 100%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 40px -30px rgba(0, 0, 0, 1);
}

.brand { grid-area: brand; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #180800;
  background: linear-gradient(150deg, var(--orange-lit), var(--orange-deep));
  box-shadow: 0 8px 20px -8px rgba(255, 106, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.4) inset;
}
.brand-mark.small { width: 22px; height: 22px; border-radius: 7px; }
.brand-text {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.03em;
}
.brand-text em { font-style: normal; color: var(--orange); }

/* Category nav ---------------------------------------------------------- */
.nav-cats {
  grid-area: nav;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent 100%);
}
.nav-cats::-webkit-scrollbar { display: none; }

.nav-link {
  position: relative;
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
  transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.32s var(--ease-out);
}
.nav-link:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.nav-link:hover::after,
.nav-link.is-active::after { transform: scaleX(1); }
.nav-link.is-active { color: var(--ink); }

/* Search ---------------------------------------------------------------- */
.topbar-actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-self: end;
  min-width: 0;
}

.search {
  grid-area: search;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
  width: clamp(190px, 24vw, 320px);
  min-width: 0;
  padding: 8px 12px 8px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
.search:focus-within {
  border-color: var(--orange-line);
  background: rgba(255, 106, 0, 0.06);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.10), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}
.search-icon { color: var(--dim); flex: 0 0 auto; }
.search:focus-within .search-icon { color: var(--orange-lit); }

.search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 13.5px;
  color: var(--ink);
}
.search-input::placeholder { color: var(--dim); }
.search-input::-webkit-search-cancel-button { display: none; }

.search-clear {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.search-clear:hover { background: var(--orange); color: #160700; }

.search--flat { width: 100%; background: rgba(255, 255, 255, 0.035); }

/* Icon button (hamburger) ---------------------------------------------- */
.icon-btn {
  display: none;               /* shown at ≤1080px */
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
  place-items: center;
  gap: 4px;
  transition: background 0.25s var(--ease), border-color 0.25s var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--line-strong); }
.icon-btn > span {
  display: block;
  width: 16px;
  height: 1.6px;
  border-radius: 2px;
  background: var(--ink-2);
  transition: transform 0.3s var(--ease), opacity 0.2s linear;
}
.icon-btn.is-open > span:nth-child(1) { transform: translateY(5.6px) rotate(45deg); }
.icon-btn.is-open > span:nth-child(2) { opacity: 0; }
.icon-btn.is-open > span:nth-child(3) { transform: translateY(-5.6px) rotate(-45deg); }

/* Avatar + dropdown ---------------------------------------------------- */
.profile { position: relative; }

.avatar {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  padding: 0;
  color: #1a0900;
  background: conic-gradient(from 210deg, var(--orange), #ffb066, var(--orange-deep), var(--orange));
  box-shadow: 0 10px 24px -12px rgba(255, 106, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.4) inset;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.avatar:hover { transform: translateY(-1px) scale(1.04); box-shadow: 0 16px 30px -12px rgba(255, 106, 0, 0.95); }
.avatar-initials {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  z-index: 1;
}
.avatar-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.avatar[aria-expanded="true"] .avatar-ring,
.avatar:hover .avatar-ring { opacity: 1; transform: scale(1); }

.dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 268px;
  padding: 8px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-modal);
  transform-origin: top right;
  z-index: 70;
  animation: dropIn 0.24s var(--ease-out) both;
}
@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.dropdown-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 10px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.dropdown-avatar {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  color: #1a0900;
  background: conic-gradient(from 210deg, var(--orange), #ffb066, var(--orange-deep), var(--orange));
}
.dropdown-id { min-width: 0; }
.dropdown-id strong {
  display: block;
  font-family: var(--font-head);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dropdown-id span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink-2);
  text-align: left;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.menu-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--ink); }
.menu-item.is-accent { color: var(--orange-lit); }
.menu-item.is-accent:hover { background: var(--orange-soft); color: var(--orange-lit); }
.menu-item .role {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
  color: var(--orange-lit);
  background: var(--orange-soft);
  border: 1px solid var(--orange-line);
}
.menu-sep { height: 1px; background: var(--line); margin: 6px 4px; }

/* ==========================================================================
   05. MOBILE DRAWER
   ========================================================================== */
.drawer-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 4, 6, 0.7);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.25s linear both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  width: min(330px, 88vw);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 16px 22px;
  background: linear-gradient(195deg, var(--panel-2), var(--bg-deep) 65%);
  border-left: 1px solid var(--line-strong);
  box-shadow: -40px 0 80px -40px rgba(0, 0, 0, 0.9);
  animation: drawerIn 0.34s var(--ease-out) both;
  overflow-y: auto;
}
@keyframes drawerIn { from { transform: translateX(102%); } to { transform: none; } }

.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 12px; }
.drawer-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--dim);
}
.drawer-nav { display: flex; flex-direction: column; gap: 2px; }
.drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  border-radius: 12px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-2);
  text-align: left;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), padding-left 0.25s var(--ease);
}
.drawer-link:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink); padding-left: 16px; }
.drawer-link small { font-family: var(--font-mono); font-size: 11px; color: var(--dim); }
.drawer-foot {
  margin-top: auto;
  padding: 16px 12px 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

/* ==========================================================================
   06. HERO
   ========================================================================== */
.hero {
  position: relative;
  isolation: isolate;
  margin: 18px var(--gutter) 0;
  min-height: clamp(430px, 58vh, 610px);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 40px 90px -50px rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: flex-end;
}

.hero-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  contain: paint;              /* nothing inside can force the hero to repaint */
}
/* Two identical layers, cross-faded. Opacity + transform only, so the browser
   hands both to the GPU and a slide change costs zero paint work. */
.hero-layer {
  position: absolute;
  transform-origin: 50% 50%;
  inset: 0;                    /* the scale in heroPan keeps the edges covered */
  background-position: center;
  background-size: cover;
  opacity: 0;
  transform: scale(1.02);
  animation: heroPan 34s ease-in-out infinite alternate;
  animation-play-state: paused;
  transition: opacity 0.9s var(--ease);
  will-change: opacity, transform;
  backface-visibility: hidden;
}
.hero-layer.is-on {
  opacity: 1;
  animation-play-state: running;
}
/* Pause the pan the moment nobody is looking at it: off-screen, hidden tab,
   or a dialog on top. Saves the compositor a full-frame redraw every tick. */
.hero.is-idle .hero-layer,
body.is-hidden .hero-layer,
body.is-locked .hero-layer { animation-play-state: paused; }

@keyframes heroPan {
  from { transform: scale(1.04) translate3d(0, 0, 0); }
  to   { transform: scale(1.105) translate3d(-1%, -0.9%, 0); }
}

.hero-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 5, 7, 0.96) 0%, rgba(5, 5, 7, 0.80) 30%, rgba(5, 5, 7, 0.12) 58%, rgba(5, 5, 7, 0.34) 100%),
    linear-gradient(0deg, rgba(5, 5, 7, 0.94) 2%, rgba(5, 5, 7, 0.06) 50%, rgba(5, 5, 7, 0.45) 100%);
}
.hero-grain {
  position: absolute;
  inset: 0;
  opacity: 0.09;               /* plain alpha: no per-frame blending cost */
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 620px;
  padding: clamp(22px, 4vw, 54px);
  padding-bottom: clamp(60px, 7vw, 74px);
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}
/* Semi-transparent while the copy swaps, so the words never pop. */
.hero-content.is-swapping { opacity: 0.35; transform: translateY(5px); }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 5px 12px 5px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--orange-lit);
  background: rgba(255, 106, 0, 0.14);
  border: 1px solid var(--orange-line);
}
.hero-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.22);
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero-title {
  font-size: clamp(34px, 5.4vw, 64px);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: #fff;
  text-shadow: 0 18px 44px rgba(0, 0, 0, 0.6);
}
.hero-desc {
  margin-top: 14px;
  font-size: clamp(14px, 1.15vw, 16.5px);
  color: var(--ink-2);
  max-width: 46ch;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.7);
}
.hero-note {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
  max-width: 46ch;
}
.hero-note::before { content: "⚠ "; color: var(--orange-lit); }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--muted);
}
.hero-meta .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 11.5px;
}
.hero-meta .chip.score { color: #fff; background: rgba(255, 106, 0, 0.16); border-color: var(--orange-line); font-family: var(--font-head); font-weight: 600; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.hero-dots {
  position: absolute;
  right: clamp(16px, 3vw, 40px);
  bottom: clamp(16px, 3vw, 28px);
  z-index: 3;
  display: flex;
  gap: 7px;
}
.hero-dot {
  width: 22px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.22);
  transition: background 0.3s var(--ease), width 0.35s var(--ease-out);
  padding: 0;
}
.hero-dot:hover { background: rgba(255, 255, 255, 0.5); }
.hero-dot.is-active { width: 40px; background: var(--orange); box-shadow: 0 0 14px rgba(255, 106, 0, 0.7); }

/* ==========================================================================
   07. ROWS + CARDS
   ========================================================================== */
.rows { display: flex; flex-direction: column; gap: clamp(10px, 1.6vw, 22px); padding: 8px 0 10px; }

.row { position: relative; }
/* Off-screen rails are skipped entirely by the renderer. On a 28-category
   catalogue that is the difference between a 200-image page and a 20-image
   page while you scroll. `auto` remembers the last measured height so the
   scrollbar does not jump when a row wakes up. */
.row {
  content-visibility: auto;
  contain-intrinsic-size: auto 360px;
}

.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--gutter);
  margin-bottom: 10px;
}
.row-title-wrap { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.row-title {
  font-size: clamp(16px, 1.45vw, 20.5px);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.row-title::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--orange-lit), var(--orange-deep));
  box-shadow: 0 0 12px rgba(255, 106, 0, 0.6);
}
.row-count { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--dim); text-transform: uppercase; }

.row-nav { display: flex; gap: 6px; }
.row-arrow {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease), opacity 0.25s linear;
}
.row-arrow:hover { background: var(--orange); color: #170800; border-color: transparent; transform: scale(1.08); }
.row-arrow:disabled { opacity: 0.28; cursor: default; transform: none; background: rgba(255, 255, 255, 0.04); color: var(--ink-2); border-color: var(--line); }

.rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  /* Scroll snapping only on touch, where it feels premium. With a mouse it
     fights the drag-to-scroll and makes the rail stutter. */
  scroll-snap-type: none;
  overscroll-behavior-x: contain;       /* never yanks the page sideways */
  scroll-padding-left: var(--gutter);   /* keeps the first tile flush with the gutter */
  scroll-behavior: smooth;
  padding: 14px var(--gutter) 22px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
@media (hover: none) {
  .rail { scroll-snap-type: x proximity; }
}
.rail::-webkit-scrollbar { display: none; }
/* While dragging we only change the cursor and kill selection.
   NOTE: never set `pointer-events: none` on children here — doing so retargets
   the click event to the rail itself and tiles stop opening. */
.rail.is-dragging { scroll-behavior: auto; cursor: grabbing; user-select: none; }
.rail.is-dragging .card-open,
.rail.is-dragging .card-info { cursor: grabbing; }

/* Card ------------------------------------------------------------------ */
.card {
  position: relative;
  flex: 0 0 auto;
  width: clamp(140px, 14vw, 192px);
  border-radius: var(--r-md);
  background: var(--panel-2);
  box-shadow: var(--shadow-card);
  scroll-snap-align: start;
  /* contain keeps each tile's paint isolated; no will-change here because
     promoting 90+ tiles at once costs more GPU memory than it saves. */
  contain: layout paint style;
  transition: transform 0.42s var(--ease-out), box-shadow 0.42s var(--ease-out);
}
.card:hover,
.card:focus-within {
  transform: translateY(-8px) scale(1.035);
  box-shadow: var(--shadow-lift);
  z-index: 5;
  will-change: transform;
}

.card-open {
  display: block;
  width: 100%;
  padding: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  text-align: left;
  color: inherit;
  background: none;
}

.card-art {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(160deg, #191922, #0c0c11);
}
.card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
  /* transform only — animating `filter` here repainted every hovered poster */
  transition: transform 0.65s var(--ease-out);
  transform: scale(1.005);
  backface-visibility: hidden;
}
.card:hover .card-art img { transform: scale(1.065); }

.card-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 5, 7, 0) 38%, rgba(5, 5, 7, 0.82) 88%, rgba(5, 5, 7, 0.96) 100%);
  pointer-events: none;
}

.card-meta {
  position: absolute;
  left: 11px;
  right: 40px;      /* keeps the title clear of the ⓘ button in the corner */
  bottom: 10px;
  z-index: 2;
  pointer-events: none;
}
.card-cat {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-mono);
  font-size: 8.6px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange-lit);
  margin-bottom: 3px;
  opacity: 0.9;
}
.card-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.25;
  color: #fff;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.card-score {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 7px;
  font-family: var(--font-head);
  font-size: 10.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(8, 8, 12, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
}
.card-score i { width: 4px; height: 4px; border-radius: 50%; background: var(--orange); }

.card-cta {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 3;
  padding: 3px 8px;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #180800;
  background: linear-gradient(180deg, var(--orange-lit), var(--orange));
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  pointer-events: none;
}
.card:hover .card-cta,
.card:focus-within .card-cta { opacity: 1; transform: none; }

.card-info {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 4;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  font-style: italic;
  color: var(--ink);
  background: rgba(8, 8, 12, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), background 0.28s var(--ease), color 0.28s var(--ease);
}
.card:hover .card-info,
.card:focus-within .card-info { opacity: 1; transform: none; }
.card-info:hover { background: var(--orange); color: #180800; border-color: transparent; }

/* On touch devices the info button is always visible (no hover state) */
@media (hover: none) {
  .card-info { opacity: 1; transform: none; }
  .card-cta { display: none; }
}

/* ==========================================================================
   08. SEARCH RESULTS
   ========================================================================== */
.results { padding: clamp(20px, 3vw, 38px) var(--gutter) 10px; animation: fadeIn 0.3s linear both; }
.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.results-head h2 { font-size: clamp(18px, 2vw, 24px); font-weight: 700; }
.results-head h2 span { color: var(--orange); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(154px, 1fr));
  gap: clamp(12px, 1.4vw, 18px);
}
.grid .card { width: auto; }
.grid .card-info { opacity: 1; transform: none; }

.empty {
  padding: 40px 4px 60px;
  color: var(--muted);
  font-size: 14.5px;
  max-width: 46ch;
}

/* ==========================================================================
   09. MODALS + SITE DETAIL
   ========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 36px);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.26s var(--ease), visibility 0.26s linear;
}
.modal.is-open { visibility: visible; opacity: 1; }

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 3, 5, 0.76);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: min(88vh, 860px);
  overflow-y: auto;
  padding: clamp(18px, 2.6vw, 30px);
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, var(--panel-2), var(--panel) 42%, var(--bg-deep));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-modal);
  transform: translateY(14px) scale(0.985);
  opacity: 0;
  transition: transform 0.34s var(--ease-out), opacity 0.28s linear;
}
.modal.is-open .modal-card { transform: none; opacity: 1; }

.modal-card:focus { outline: none; }   /* dialog receives focus on open */

.modal-card--xs  { max-width: 400px; }
.modal-card--slim { max-width: 460px; }
.modal-card--wide { max-width: 900px; }
.modal-card--xl { max-width: 1080px; max-height: 90vh; }

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 19px;
  line-height: 1;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  transition: background 0.22s var(--ease), color 0.22s var(--ease), transform 0.22s var(--ease);
}
.modal-close:hover { background: var(--orange); color: #180800; transform: rotate(90deg); border-color: transparent; }

/* Detail layout -------------------------------------------------------- */
.detail { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: clamp(16px, 2.4vw, 30px); }

/* The poster is a normal grid item: no sticky, no absolute children. That way
   it can never escape the modal's rounded edge or collide with the buttons. */
.detail-art {
  align-self: start;        /* hug the poster instead of stretching to the row height */
  min-width: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--panel-3);
  box-shadow: 0 26px 60px -30px rgba(0, 0, 0, 0.95);
}
.detail-art img {
  width: 100%;
  aspect-ratio: 2 / 3;
  max-height: min(420px, 52vh);   /* never taller than the visible modal */
  object-fit: cover;
  background: var(--panel-3);
}

.detail-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.detail-score {
  flex: 0 0 auto;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  color: #180800;
  background: linear-gradient(180deg, var(--orange-lit), var(--orange));
  box-shadow: 0 10px 28px -12px rgba(255, 106, 0, 0.95);
}

.detail-body { min-width: 0; padding-right: 26px; }
.detail-cat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange-lit);
  margin-bottom: 8px;
}
.detail-title { font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -0.035em; }
.detail-desc { margin-top: 12px; color: var(--ink-2); font-size: 14.5px; }

.note-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 106, 0, 0.055);
  border: 1px solid rgba(255, 106, 0, 0.18);
  border-left: 2px solid var(--orange);
}
.note-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--orange-lit);
  margin-bottom: 4px;
}
.note-box p { font-size: 13.5px; color: var(--ink-2); }

.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; }
.detail-visited { font-size: 12px; color: var(--dim); }

/* Rating block --------------------------------------------------------- */
.rate-block { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.rate-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.rate-head h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.rate-hint { font-size: 11.5px; color: var(--dim); }

/* Inline "Saved ✓" confirmation */
.rate-saved {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #04170d;
  background: linear-gradient(180deg, #4ade80, #16a34a);
  opacity: 0;
  transform: translateY(3px) scale(0.94);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}
.rate-saved.is-on { opacity: 1; transform: none; }

.crit { padding: 12px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.06); }
.crit:last-of-type { border-bottom: 0; }
.crit-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.crit-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
/* Plain-language explainer under each criterion name */
.crit-hint {
  font-style: normal;
  font-weight: 400;
  font-size: 11px;
  line-height: 1.4;
  color: var(--dim);
}
.crit-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--muted);
  white-space: nowrap;
}
.crit-top i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.crit-top.tone-best  { color: #4ade80; }
.crit-top.tone-okay  { color: #fbbf24; }
.crit-top.tone-worst { color: #f87171; }

.bar { position: relative; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.075); overflow: hidden; margin-bottom: 9px; }
.bar > i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--orange-deep), var(--orange-lit));
  box-shadow: 0 0 12px rgba(255, 106, 0, 0.5);
  transition: width 0.6s var(--ease-out);
}

.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.seg-btn {
  padding: 7px 6px;
  border-radius: 9px;
  font-size: 11.8px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  transition: background 0.22s var(--ease), color 0.22s var(--ease), border-color 0.22s var(--ease), transform 0.22s var(--ease);
  overflow: hidden;
  text-overflow: ellipsis;
}
.seg-btn:hover { background: rgba(255, 255, 255, 0.09); color: var(--ink); border-color: var(--line-strong); transform: translateY(-1px); }
/* Selected state is colour-coded like a traffic light, so the meaning of each
   column is obvious at a glance: left = good, middle = okay, right = bad. */
.seg-btn.is-on { font-weight: 600; border-color: transparent; }
.seg-btn--best.is-on {
  color: #04170d;
  background: linear-gradient(180deg, #4ade80, #16a34a);
  box-shadow: 0 8px 20px -10px rgba(34, 197, 94, 0.85);
}
.seg-btn--okay.is-on {
  color: #1c1300;
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  box-shadow: 0 8px 20px -10px rgba(245, 158, 11, 0.8);
}
.seg-btn--worst.is-on {
  color: #fff;
  background: linear-gradient(180deg, #f87171, #dc2626);
  box-shadow: 0 8px 20px -10px rgba(220, 38, 38, 0.8);
}
/* Hover feedback hints at the same meaning before you commit */
.seg-btn--best:hover  { border-color: rgba(74, 222, 128, 0.5); }
.seg-btn--okay:hover  { border-color: rgba(251, 191, 36, 0.5); }
.seg-btn--worst:hover { border-color: rgba(248, 113, 113, 0.5); }

.rate-summary { margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.rate-summary strong { color: var(--orange-lit); font-weight: 600; }

/* ==========================================================================
   09b. FEEDBACK (written notes on a site)
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.fb-block { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.fb-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.fb-head h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.fb-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 19px;
  padding: 0 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--orange-lit);
  background: var(--orange-soft);
  border: 1px solid var(--orange-line);
}

.fb-form { display: flex; flex-direction: column; gap: 8px; }
.fb-form textarea {
  width: 100%;
  min-height: 60px;
  padding: 11px 13px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.55;
  resize: vertical;
  outline: none;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.fb-form textarea::placeholder { color: var(--dim); }
.fb-form textarea:focus {
  border-color: var(--orange-line);
  background: rgba(255, 106, 0, 0.05);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.1);
}
.fb-form-foot { display: flex; align-items: center; gap: 10px; }
.fb-who { font-size: 11.5px; color: var(--dim); }
.fb-left {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.fb-list { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.fb-item {
  display: flex;
  gap: 11px;
  padding: 11px 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid var(--line);
  animation: fadeUp 0.35s var(--ease-out) both;
}
.fb-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12px;
  color: #180800;
  background: conic-gradient(from 210deg, var(--orange), #ffb066, var(--orange-deep), var(--orange));
}
.fb-main { flex: 1 1 auto; min-width: 0; }
.fb-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 11px; color: var(--dim); }
.fb-meta strong { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.fb-you {
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange-lit);
  background: var(--orange-soft);
  border: 1px solid var(--orange-line);
}
.fb-text { margin-top: 4px; font-size: 13px; line-height: 1.55; color: var(--ink-2); overflow-wrap: anywhere; }
.fb-del {
  flex: 0 0 auto;
  align-self: flex-start;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 13px;
  line-height: 1;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.fb-del:hover { background: rgba(220, 38, 38, 0.9); color: #fff; }
.fb-empty, .fb-more { font-size: 12.5px; color: var(--dim); }

/* feedback count pill inside the admin table */
.fb-pill.has-fb { color: var(--orange-lit); border-color: var(--orange-line); background: var(--orange-soft); }

/* ==========================================================================
   09c. ADMIN POP-UP MANAGER + THE POP-UP ITSELF
   ========================================================================== */
.pop-list { display: flex; flex-direction: column; gap: 9px; margin-top: 6px; }
.pop-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}
.pop-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pop-row-main strong { font-size: 13px; color: var(--ink); }
.pop-row-body {
  font-size: 12px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pop-status {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line);
}
.pop-status.is-live { color: #4ade80; border-color: rgba(74, 222, 128, 0.4); background: rgba(74, 222, 128, 0.08); }
.pop-row-actions { flex: 0 0 auto; display: flex; align-items: center; }
.pop-empty { font-size: 12.5px; color: var(--dim); padding: 6px 0; }

.announce-card { text-align: left; }
.announce-badge {
  display: inline-block;
  margin-bottom: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--orange-lit);
  background: var(--orange-soft);
  border: 1px solid var(--orange-line);
}
.announce-badge.tone-info { color: #7dd3fc; background: rgba(125, 211, 252, 0.1); border-color: rgba(125, 211, 252, 0.35); }
.announce-badge.tone-warn { color: #fbbf24; background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.35); }
#announceTitle { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; padding-right: 26px; }
#announceBody { margin-top: 9px; font-size: 13.5px; line-height: 1.62; color: var(--ink-2); }

/* ==========================================================================
   10. AUTH MODAL
   ========================================================================== */
.auth-title { font-size: 22px; font-weight: 700; letter-spacing: -0.03em; padding-right: 30px; }
.auth-sub { margin-top: 6px; font-size: 13px; color: var(--muted); }

.tabs {
  display: inline-flex;
  gap: 4px;
  margin: 18px 0 16px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
}
.tab {
  padding: 8px 18px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.25s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.tab:hover { color: var(--ink); }
.tab.is-active {
  color: #180800;
  background: linear-gradient(180deg, var(--orange-lit), var(--orange));
  box-shadow: 0 8px 20px -10px rgba(255, 106, 0, 0.9);
}
.tabs--sm { margin: 0; }
.tabs--sm .tab { padding: 7px 14px; font-size: 12px; }

.auth-form { display: flex; flex-direction: column; gap: 12px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > span {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.field > span em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--dim); font-family: var(--font-body); font-size: 11px; }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 13px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.field textarea { resize: vertical; min-height: 62px; line-height: 1.5; }
.field input::placeholder,
.field textarea::placeholder { color: var(--dim); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--orange-line);
  background: rgba(255, 106, 0, 0.05);
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.1);
}
.field select { appearance: none; background-image: none; cursor: pointer; }
.field select option { background: var(--panel-2); color: var(--ink); }
.field input[type="checkbox"] { width: auto; }

.check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { accent-color: var(--orange); width: 15px; height: 15px; cursor: pointer; }

.form-error {
  margin-top: 2px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  color: #ffb4a8;
  background: rgba(255, 90, 90, 0.1);
  border: 1px solid rgba(255, 90, 90, 0.3);
}

.auth-note { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.auth-note p { font-size: 12px; color: var(--muted); line-height: 1.65; }
.auth-note strong { color: var(--ink-2); font-weight: 600; }

/* ==========================================================================
   11. ADMIN STUDIO
   ========================================================================== */
.admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-right: 42px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.admin-head h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.03em; }
.admin-head p { margin-top: 5px; font-size: 12.5px; color: var(--muted); max-width: 46ch; }

.admin-panel { animation: fadeIn 0.25s linear both; }

.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.admin-toolbar .search { flex: 1 1 220px; width: auto; max-width: 340px; }
.count-chip {
  padding: 6px 11px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}
.admin-toolbar .btn-primary { margin-left: auto; }

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: auto;
  max-height: min(52vh, 520px);
  background: rgba(0, 0, 0, 0.18);
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--dim);
  background: #14141a;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.admin-table th.right, .admin-table td.right { text-align: right; }
.admin-table tbody tr { border-bottom: 1px solid rgba(255, 255, 255, 0.045); transition: background 0.2s var(--ease); }
.admin-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.admin-table td { padding: 9px 14px; vertical-align: middle; color: var(--ink-2); }
.admin-table td.right { white-space: nowrap; }

.cell-site { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-thumb {
  flex: 0 0 auto;
  width: 30px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--panel-3);
  box-shadow: 0 4px 10px -6px #000;
}
.cell-name { font-weight: 600; color: var(--ink); font-size: 13px; }
.cell-sub { font-size: 11px; color: var(--dim); display: block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill-cat {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill-lock {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--dim);
}
.pill-lock svg { opacity: 0.7; }

.icon-action {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  margin-left: 5px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.icon-action:hover { background: var(--orange); color: #180800; border-color: transparent; }
.icon-action.danger:hover { background: #e0361f; color: #fff; }

.admin-form { display: flex; flex-direction: column; gap: 13px; padding-bottom: 6px; }
.admin-form h3 { font-size: 15px; font-weight: 600; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.import-report {
  margin: 4px 0 0;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink-2);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--line);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 190px;
  overflow: auto;
}

/* ==========================================================================
   12. TOASTS, CONFIRM, FOOTER
   ========================================================================== */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 200;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: min(440px, calc(100vw - 32px));
}
.toast {
  width: 100%;
  padding: 11px 16px;
  border-radius: 999px;
  font-size: 13px;
  text-align: center;
  color: var(--ink);
  background: rgba(22, 22, 29, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: 0 22px 40px -20px rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(14px);
  animation: toastIn 0.34s var(--ease-out) both;
}
.toast.is-out { animation: toastOut 0.3s var(--ease) forwards; }
.toast.is-good { border-color: rgba(255, 106, 0, 0.5); box-shadow: 0 22px 40px -20px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 106, 0, 0.2); }
.toast.is-bad { border-color: rgba(255, 90, 90, 0.5); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(0.98); } }

.modal--confirm .modal-card { max-width: 400px; }
.modal--confirm h2 { font-size: 17px; font-weight: 700; }
.modal--confirm p { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* Keep the footer at the bottom of the viewport even when a filtered view
   leaves the page short (flex column + auto margin on the footer). */
main {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 96px);
}
main > .foot { margin-top: auto; }

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: clamp(20px, 3vw, 40px) var(--gutter) 0;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.foot-brand { display: flex; align-items: center; gap: 10px; max-width: 60ch; }
.foot-brand strong { color: var(--ink-2); font-family: var(--font-head); letter-spacing: -0.01em; }
.foot-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }

.noscript { padding: 40px; text-align: center; color: var(--ink); }

/* ==========================================================================
   12b. HEAT LAYER — colour, light and hover personality
   --------------------------------------------------------------------------
   The base build was correct but cold: near-black surfaces, a small orange
   accent, and hover states that only nudged things by a pixel. This section
   turns the temperature up without touching the layout:

     • three drifting colour fields behind the page (transform only)
     • a cursor-tracking spotlight on every tile and on the hero
     • a light sweep across the poster on hover
     • buttons that glow, lift and sheen instead of just changing shade
     • a score chip that flips solid orange when you point at a tile

   Everything here animates `transform`, `opacity` or `background-position`
   — nothing that forces a layout pass.
   ========================================================================== */

/* --- A. Ambient light ---------------------------------------------------- */
.ambient {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  contain: strict;
}
.ambient i {
  position: absolute;
  width: 74vmax;
  height: 74vmax;
  border-radius: 50%;
  opacity: 0.9;
  will-change: transform;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}
.ambient i:nth-child(1) {
  top: -34vmax;
  left: -16vmax;
  background: radial-gradient(circle at 50% 50%, rgba(255, 106, 0, 0.30), rgba(255, 106, 0, 0.06) 42%, transparent 64%);
  animation-name: driftA;
  animation-duration: 34s;
}
.ambient i:nth-child(2) {
  top: -40vmax;
  right: -26vmax;
  width: 62vmax;
  height: 62vmax;
  background: radial-gradient(circle at 50% 50%, rgba(255, 45, 107, 0.20), transparent 62%);
  animation-name: driftB;
  animation-duration: 44s;
}
.ambient i:nth-child(3) {
  bottom: -42vmax;
  left: 24vmax;
  width: 66vmax;
  height: 66vmax;
  background: radial-gradient(circle at 50% 50%, rgba(124, 92, 255, 0.17), transparent 62%);
  animation-name: driftC;
  animation-duration: 52s;
}
@keyframes driftA { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(6vmax, 4vmax, 0) scale(1.12); } }
@keyframes driftB { from { transform: translate3d(0, 0, 0) scale(1.06); } to { transform: translate3d(-5vmax, 6vmax, 0) scale(1); } }
@keyframes driftC { from { transform: translate3d(0, 0, 0) scale(1); } to { transform: translate3d(-7vmax, -5vmax, 0) scale(1.1); } }

/* Never animate what nobody can see. */
body.is-hidden .ambient i,
body.is-booting .ambient i { animation-play-state: paused; }

/* --- B. Tiles: spotlight, sheen, a live score chip ----------------------- */
.card-glow,
.card-sheen {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  pointer-events: none;
}
/* The spotlight follows the pointer. --mx/--my are written by initSpotlight()
   as pixel offsets inside the tile, so the light lands exactly under the
   cursor instead of in the middle of a canned gradient. */
.card-glow {
  background: radial-gradient(
    220px circle at var(--mx, 50%) var(--my, 40%),
    rgba(255, 176, 96, 0.34),
    rgba(255, 106, 0, 0.12) 38%,
    transparent 66%);
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}
.card-sheen {
  background: linear-gradient(112deg,
    transparent 32%,
    rgba(255, 255, 255, 0.16) 46%,
    rgba(255, 255, 255, 0.03) 54%,
    transparent 66%);
  opacity: 0;
  transform: translate3d(-120%, 0, 0);
  transition: transform 0.85s var(--ease-out), opacity 0.25s linear;
}
.card:hover .card-glow,
.card:focus-within .card-glow { opacity: 1; }
.card:hover .card-sheen,
.card:focus-within .card-sheen { opacity: 1; transform: translate3d(120%, 0, 0); }

/* Warm rim + deeper lift on hover */
.card:hover,
.card:focus-within {
  box-shadow:
    0 34px 60px -26px rgba(0, 0, 0, 0.96),
    0 0 0 1px rgba(255, 140, 60, 0.55),
    0 0 52px -12px rgba(255, 106, 0, 0.45);
}

/* The score chip flips solid orange — the single loudest hover cue on a tile */
.card-score {
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out),
              border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out),
              transform 0.3s var(--ease-out);
}
.card:hover .card-score,
.card:focus-within .card-score {
  background: linear-gradient(180deg, var(--orange-lit), var(--orange));
  border-color: transparent;
  color: #180800;
  transform: scale(1.06);
  box-shadow: 0 6px 20px -6px rgba(255, 106, 0, 0.9);
}
.card:hover .card-score i { background: #180800; }

.card-cat { transition: color 0.3s var(--ease-out), transform 0.3s var(--ease-out); }
.card:hover .card-cat { color: var(--orange-lit); transform: translateY(-2px); }
.card-title { transition: text-shadow 0.3s var(--ease-out); }
.card:hover .card-title { text-shadow: 0 2px 22px rgba(0, 0, 0, 0.9); }

/* The ⓘ button gets a real personality: fills, grows, glows */
.card-info {
  font-style: normal;
  font-size: 13px;
  letter-spacing: 0;
  transition: opacity 0.28s var(--ease-out), transform 0.28s var(--ease-out),
              background 0.24s var(--ease-out), color 0.24s var(--ease-out),
              border-color 0.24s var(--ease-out), box-shadow 0.24s var(--ease-out);
}
.card:hover .card-info { transform: scale(1.12); border-color: var(--orange-line); }
.card-info:hover,
.card-info:focus-visible {
  background: linear-gradient(180deg, var(--orange-lit), var(--orange));
  color: #180800;
  border-color: transparent;
  transform: scale(1.22);
  box-shadow: 0 10px 26px -8px rgba(255, 106, 0, 0.95);
}

/* "Open ↗" tag slides in with a glow */
.card-cta {
  background: linear-gradient(180deg, #fff, var(--orange-lit));
  box-shadow: 0 8px 20px -8px rgba(255, 106, 0, 0.9);
}
.card:hover .card-cta,
.card:focus-within .card-cta { transform: translateY(0) rotate(-2deg); }

/* --- C. Buttons ---------------------------------------------------------- */
.btn { position: relative; overflow: hidden; }
.btn-primary {
  background: linear-gradient(135deg, #ffa03f 0%, var(--orange) 52%, #ff5326 100%);
  box-shadow: 0 12px 28px -12px rgba(255, 106, 0, 0.95),
              0 1px 0 rgba(255, 255, 255, 0.45) inset;
}
/* A light bar that sweeps across the face of the button on hover. */
.btn-primary::after {
  content: "";
  position: absolute;
  inset: -40% -10%;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.62) 50%, transparent 62%);
  transform: translate3d(-140%, 0, 0);
  transition: transform 0.75s var(--ease-out);
  pointer-events: none;
}
.btn-primary:hover::after,
.btn-primary:focus-visible::after { transform: translate3d(140%, 0, 0); }
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px -14px rgba(255, 106, 0, 1),
              0 0 0 1px rgba(255, 190, 140, 0.45) inset;
}
.btn-primary:active { transform: translateY(0) scale(0.975); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
}
.btn-ghost:hover {
  background: rgba(255, 106, 0, 0.16);
  border-color: var(--orange-line);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -18px rgba(255, 106, 0, 0.85);
}
.btn-ghost:active { transform: translateY(0) scale(0.975); }
.btn-ghost svg { transition: transform 0.3s var(--ease-out); }
.btn-ghost:hover svg { transform: scale(1.12); }

/* Small square actions (admin rows, preview, delete) */
.icon-action { transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out), transform 0.2s var(--ease-out); }
.icon-action:hover { transform: translateY(-1px) scale(1.08); }

/* --- D. Chrome: nav, search, avatar, row arrows -------------------------- */
.nav-link:hover {
  color: #fff;
  background: rgba(255, 106, 0, 0.12);
  text-shadow: 0 0 20px rgba(255, 106, 0, 0.55);
}
.nav-link::after { box-shadow: 0 0 12px rgba(255, 106, 0, 0.8); }

.search:hover { border-color: rgba(255, 255, 255, 0.2); }
.search:focus-within {
  box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.14),
              0 0 34px -12px rgba(255, 106, 0, 0.65);
}

.avatar:hover {
  box-shadow: 0 18px 34px -12px rgba(255, 106, 0, 1), 0 0 0 1px rgba(255, 180, 120, 0.5);
  transform: translateY(-1px) scale(1.06);
}

.row-arrow:hover {
  box-shadow: 0 10px 24px -10px rgba(255, 106, 0, 0.9);
  transform: scale(1.12);
}
.row-arrow:active { transform: scale(0.96); }

.row-title::before { box-shadow: 0 0 16px rgba(255, 106, 0, 0.85); }

/* --- E. Hero ------------------------------------------------------------- */
/* A soft warm light that follows the pointer across the banner. */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    560px circle at var(--mx, 30%) var(--my, 40%),
    rgba(255, 150, 60, 0.18),
    rgba(255, 106, 0, 0.05) 42%,
    transparent 68%);
  opacity: 0;
  transition: opacity 0.55s var(--ease-out);
}
.hero:hover::after { opacity: 1; }

.hero {
  box-shadow: 0 40px 90px -50px rgba(0, 0, 0, 0.95),
              0 0 120px -70px rgba(255, 106, 0, 0.75);
}

/* Title picks up a touch of heat at the end of the line instead of flat white */
.hero-title {
  background: linear-gradient(96deg, #ffffff 0%, #fff4ea 46%, #ffcda3 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

.hero-eyebrow {
  box-shadow: 0 0 26px -10px rgba(255, 106, 0, 0.9);
}
.hero-meta .chip { transition: background 0.25s var(--ease-out), border-color 0.25s var(--ease-out), color 0.25s var(--ease-out); }
.hero-meta .chip:hover { background: rgba(255, 106, 0, 0.18); border-color: var(--orange-line); color: #fff; }

.hero-dot:hover { background: rgba(255, 160, 90, 0.8); }

/* --- F. Warmth in the surfaces ------------------------------------------ */
.hero-meta .chip.score,
.pill-cat.has-fb { box-shadow: 0 0 22px -12px rgba(255, 106, 0, 0.9); }

/* Modal cards get the same warm rim as the tiles */
.modal-card { box-shadow: 0 50px 120px -40px rgba(0, 0, 0, 0.96), 0 0 0 1px rgba(255, 255, 255, 0.09), 0 0 90px -60px rgba(255, 106, 0, 0.8); }

/* Segmented rating buttons glow when selected */
/* The chosen answer keeps a visible glow so the row reads at a glance */
.seg-btn.is-on { box-shadow: 0 10px 26px -10px currentColor, 0 1px 0 rgba(255, 255, 255, 0.35) inset; }
.seg-btn:active { transform: translateY(0) scale(0.97); }

/* ==========================================================================
   12c. PUBLISHING + EMPTY STATE
   ========================================================================== */

/* A tile with no votes yet simply has no score chip — no fake "—" badge. */
.card-score.is-empty { display: none; }

#detailScore.is-empty {
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: 0.01em;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line);
}

.publish-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.publish-status {
  margin: 10px 0 14px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.publish-status.is-draft {
  color: #ffcf8a;
  background: rgba(255, 176, 32, 0.10);
  border-color: rgba(255, 176, 32, 0.32);
}
.publish-status.is-live {
  color: #86efac;
  background: rgba(74, 222, 128, 0.09);
  border-color: rgba(74, 222, 128, 0.3);
}

.empty-catalogue {
  margin: 18px var(--gutter) 0;
  padding: clamp(28px, 5vw, 64px) clamp(20px, 4vw, 48px);
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 140% at 12% 0%, rgba(255, 106, 0, 0.16), transparent 62%),
    linear-gradient(180deg, var(--panel-2), var(--bg-deep));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-card);
  max-width: 760px;
}
.empty-catalogue .eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--orange-lit);
}
.empty-catalogue h2 {
  margin: 10px 0 12px;
  font-size: clamp(24px, 3.4vw, 36px);
  letter-spacing: -0.03em;
}
.empty-catalogue .muted { max-width: 56ch; }
.empty-catalogue .btn { margin-top: 20px; }
.empty-catalogue .tiny { margin-top: 12px; }

/* ==========================================================================
   13. RESPONSIVE
   ========================================================================== */

/* Tablet / small desktop: collapse the inline category nav into the drawer */
@media (max-width: 1180px) {
  .nav-cats { display: none; }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand search actions"; }
  .icon-btn.menu-btn { display: grid; }
  .search { width: clamp(180px, 40vw, 320px); justify-self: stretch; max-width: 420px; margin-left: auto; }
}

@media (max-width: 860px) {
  :root { --topbar-h: 64px; }
  .hero { min-height: clamp(420px, 66vh, 520px); }
  .hero-vignette {
    background:
      linear-gradient(0deg, rgba(5, 5, 7, 0.97) 8%, rgba(5, 5, 7, 0.55) 52%, rgba(5, 5, 7, 0.42) 100%),
      linear-gradient(90deg, rgba(5, 5, 7, 0.6), rgba(5, 5, 7, 0.2));
  }
  .hero-content { max-width: none; }
  .hero-dots { right: 50%; transform: translateX(50%); bottom: 16px; }

  .detail { grid-template-columns: 1fr; }
  .detail-art { max-width: 220px; }
  .detail-body { padding-right: 0; }
  .modal-card--wide { max-height: 92vh; }

  .field-row { grid-template-columns: 1fr; }
  .admin-table td .pill-cat { font-size: 10px; }
  /* the library table keeps its six columns and scrolls sideways instead of
     crushing the text into unreadable slivers */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .admin-table { min-width: 620px; }
}

/* Phones: two-row header, search gets its own line */
@media (max-width: 620px) {
  .topbar {
    grid-template-columns: auto auto;
    grid-template-areas:
      "brand actions"
      "search search";
    row-gap: 10px;
    padding: 10px var(--gutter) 12px;
  }
  .topbar-actions { gap: 8px; }
  .search { grid-area: search; width: 100%; max-width: none; margin-left: 0; background: rgba(255, 255, 255, 0.05); }

  .brand-text { font-size: 16px; }

  .hero { margin: 12px var(--gutter) 0; border-radius: var(--r-lg); min-height: 440px; }
  .hero-content { padding: 20px 18px 66px; }
  .hero-desc { font-size: 13.5px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .hero-note { display: none; }   /* issue notes stay in the detail modal */

  .row-count { display: none; }   /* the header stays on one line on phones */
  .rail { gap: 11px; padding: 12px var(--gutter) 18px; }
  .card { width: 138px; }
  .card:hover { transform: none; box-shadow: var(--shadow-card); }  /* no hover jitter on touch */

  .grid { grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: 12px; }

  .results-head { flex-direction: column; align-items: flex-start; gap: 10px; }

  .modal { padding: 0; }
  .modal-card {
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
    border: 0;
    /* top padding clears the floating close button so it never sits on the art */
    padding: 58px 16px 28px;
  }
  .modal-card--xs, .modal-card--slim, .modal-card--wide, .modal-card--xl { max-width: none; max-height: none; }
  .modal--confirm .modal-card { height: auto; margin: 16px; border-radius: var(--r-lg); border: 1px solid var(--line-strong); }
  .modal--confirm { padding: 16px; }

  .detail-art { max-width: none; }
  .detail-art img { aspect-ratio: 16 / 9; max-height: none; }
  .seg { grid-template-columns: 1fr; }
  .seg-btn { text-align: center; padding: 9px 8px; }

  .pop-row { flex-wrap: wrap; }
  .pop-row-actions { margin-left: auto; }
  .fb-form-foot { flex-wrap: wrap; }
  .admin-head { padding-right: 34px; }
  .admin-toolbar .btn-primary { margin-left: 0; width: 100%; }
  .table-wrap { max-height: none; }

  .foot { flex-direction: column; align-items: flex-start; }

  .splash-word { font-size: clamp(30px, 13vw, 60px); }
  .splash-foot { width: 78%; }
  .splash-meter { width: 78%; }
}

@media (max-width: 380px) {
  .card { width: 126px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==========================================================================
   14. REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .hero-art { animation: none; transform: none; }
}

/* ---------------------------------------------------------------------------
   Quick add + undo (13d)
   The paste-a-link box and the Undo button inside a toast.
   ------------------------------------------------------------------------ */
.quick-add {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, rgba(255, 106, 0, 0.06), transparent 60%);
  margin-bottom: 22px;
}
.quick-add h3 { margin-bottom: 4px; }
.quick-add .mono,
#qLinks {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}
#qHint { color: var(--muted); margin-left: 12px; }

.toast.is-action {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  padding-right: 12px;
}
.toast-action {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.toast-action:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.34); }
.toast-action:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

/* Remove control on a tile — owner only, so it never appears for visitors. */
.card-del {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(10, 10, 12, 0.72);
  color: #ffd9d0;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}
.card:hover .card-del,
.card:focus-within .card-del { opacity: 1; transform: none; }
.card-del:hover { background: var(--danger, #e5484d); border-color: var(--danger, #e5484d); color: #fff; }
.card-del:focus-visible { opacity: 1; outline: 2px solid var(--orange); outline-offset: 2px; }

@media (hover: none) {
  /* Touch devices have no hover, so the control has to be visible. */
  .card-del { opacity: 1; transform: none; }
}

/* Inline hint under a field (logo helper) */
.field-hint {
  display: block;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--dim, #8b8b95);
  line-height: 1.5;
}
.field-hint .link-btn {
  color: var(--orange);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
