/* Hallmark · macrostructure: Workbench · tone: discreet media index · anchor hue: violet */
@import url("/static/tokens.css?v=20261002");
/* ============================================================================
   Scenedex — design.md token system
   dark neutral canvas · sharp white type · restrained violet accents
   ========================================================================== */

:root {
  /* palette (design.md) */
  --primary: #702afc;
  --primary-strong: #5b0fd3;
  --accent: #9c83ff;
  --grad: linear-gradient(90deg, #9c83ff 0%, #702afc 55%, #5b0fd3 100%);

  --bg: #08080f;
  --bg-secondary: #0d0d14;
  --surface: #16161d;
  --surface-elevated: #1c1c25;
  --input-bg: #111118;

  --border: #2a2a35;
  --border-subtle: #202029;

  --text-primary: #f9fafb;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  /* functional */
  --danger: #f87171;
  --overlay: rgba(8, 8, 15, 0.72);
  --bg-veil: rgba(13, 13, 20, 0.6);
  --bg-veil-card: rgba(22, 22, 29, 0.72);
  --shadow-deep: 0 24px 64px rgba(0, 0, 0, 0.55);
  --ring: rgba(112, 42, 252, 0.35);

  /* timeline heat ramp — violet anchor */
  --heat-0: #16161d;
  --heat-1: #2a2146;
  --heat-2: #483487;
  --heat-3: #6838cf;
  --heat-4: #9c83ff;
  --ph-a: #1c1c25;
  --ph-b: #16161d;

  /* spacing scale (4pt) */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 20px;
  --s6: 24px;
  --s7: 32px;
  --s8: 40px;
  --s9: 48px;
  --s10: 64px;

  /* type scale (1.25) */
  --t-1: 0.64rem;
  --t0: 0.8rem;
  --t1: 1rem;
  --t2: 1.25rem;
  --t3: 1.56rem;
  --t4: 1.95rem;
  --t5: 2.44rem;

  /* radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* motion */
  --dur-micro: 0.12s;
  --dur-short: 0.2s;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* z-index levels */
  --z-sticky: 40;
  --z-sheet: 80;
  --z-overlay: 90;
  --z-toast: 100;
}

/* ---------- reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Noto Sans KR", sans-serif;
  font-size: var(--t1);
  line-height: 1.55;
  letter-spacing: -0.01em;
  overflow-x: clip;
}
img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text-primary); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
::placeholder { color: var(--text-muted); opacity: 0.8; }
::selection { background: rgba(112, 42, 252, 0.35); color: var(--text-primary); }
main { max-width: 1440px; margin: 0 auto; padding: var(--s6) var(--s5) var(--s10); }
h1 { font-size: var(--t4); line-height: 1.15; margin: 0 0 var(--s3); letter-spacing: -0.02em; }
h2 { font-size: var(--t2); margin: 0; letter-spacing: -0.015em; }
section { margin-top: var(--s8); }
.muted { color: var(--text-muted); }
.small { font-size: var(--t0); }
.d-none { display: none !important; }
[hidden] { display: none !important; }
.mono, .code, .tl-count, .result-count { font-family: "Geist Mono", ui-monospace, monospace; }

@font-face {
  font-family: "Pretendard Variable";
  src: url("/static/fonts/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 45 920;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/GeistMono-Variable.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-display: swap;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: var(--s4);
  padding: var(--s3) var(--s5);
  background: rgba(8, 8, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}
.brand {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  white-space: nowrap;
  flex: none;
}
.brand:hover { color: var(--text-primary); }
.brand span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.searchbox {
  position: relative;
  flex: 1;
  max-width: 460px;
  margin-left: auto;
  display: flex;
  align-items: center;
}
.searchbox input[type="search"] {
  width: 100%;
  height: 42px;
  padding: 0 44px 0 44px;
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: var(--t1);
  transition: border-color var(--dur-micro) var(--ease), box-shadow var(--dur-short) var(--ease);
}
.searchbox input[type="search"]:focus {
  border-color: oklch(53% .275 288 / 70%);
  box-shadow: 0 0 0 3px oklch(53% .275 288 / 14%);
}
.search-cta {
  position: absolute;
  right: 6px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--grad);
  border: 0;
  border-radius: 999px;
  color: var(--color-on-accent);
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.search-cta:hover { transform: translateX(1px); box-shadow: 0 4px 14px oklch(53% .275 288 / 40%); }
.search-cta:active { transform: translateX(1px) scale(.94); }
.site-nav {
  display: flex;
  gap: var(--s5);
  flex: none;
  align-items: center;
}
.site-nav a {
  color: var(--text-secondary);
  font-size: var(--t0);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  white-space: nowrap;
}
.site-nav a:hover { color: var(--text-primary); }
.nav-saved { color: var(--text-primary) !important; }
.icon-btn {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  color: var(--text-secondary);
}

/* ---------- autocomplete ---------- */
.suggest-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: var(--s2);
  list-style: none;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-deep);
  max-height: min(60vh, 480px);
  overflow-y: auto;
  z-index: var(--z-overlay);
}
.suggest-head {
  padding: var(--s2) var(--s3) var(--s1);
  font-size: var(--t-1);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.suggest-list a {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-sm);
  color: var(--text-primary);
  font-size: var(--t0);
}
.suggest-list a .secondary {
  margin-left: auto;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: var(--t-1);
  color: var(--text-muted);
}
.suggest-list a.active, .suggest-list a:hover {
  background: var(--surface);
  color: var(--text-primary);
}
.suggest-list a.suggest-all {
  justify-content: center;
  margin-top: var(--s1);
  padding-top: var(--s3);
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
  color: var(--accent);
  font-weight: 500;
}

/* ---------- hero (home) ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: var(--s8);
  align-items: center;
  padding: var(--s9) 0 var(--s7);
  border-bottom: 1px solid var(--border-subtle);
}
.hero-kicker {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: var(--t-1);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--s3);
}
.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0 0 var(--s4);
}
.hero-sub { color: var(--text-secondary); margin: 0 0 var(--s6); }
.hero-pop { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: var(--s4) 0 0; }
.hero-stats { font-size: var(--t0); margin: var(--s5) 0 0; }

.omnibox { position: relative; }
.omni-ico, .sb-ico {
  position: absolute; left: 21px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--text-muted);
  pointer-events: none; transition: color .2s var(--ease-out);
}
.omnibox:focus-within .omni-ico, .searchbox:focus-within .sb-ico { color: var(--accent); }
.omnibox input[type="search"] {
  width: 100%;
  height: 62px;
  padding: 0 70px 0 54px;
  font-size: 1.05rem;
  background: oklch(21% .015 288);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: inset 0 1px oklch(100% 0 0 / 3%);
  transition: border-color var(--dur-micro) var(--ease), box-shadow var(--dur-short) var(--ease);
}
.omnibox input[type="search"]:focus {
  border-color: oklch(53% .275 288 / 72%);
  box-shadow: 0 0 0 4px oklch(53% .275 288 / 14%),
              0 12px 36px oklch(53% .275 288 / 16%),
              inset 0 1px oklch(100% 0 0 / 3%);
}
.omnibox .suggest-list { top: calc(100% + 10px); border-radius: 14px; }

.domain-tabs { display: flex; gap: var(--s2); margin-top: var(--s3); flex-wrap: wrap; }
.domain-tabs label {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: 6px 14px;
  font-size: var(--t0);
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all var(--dur-micro) var(--ease);
}
.domain-tabs label:has(input:checked), .domain-tabs label.on {
  color: var(--text-primary);
  border-color: var(--primary);
  background: rgba(112, 42, 252, 0.12);
}
.domain-tabs input[type="radio"] { accent-color: var(--primary); width: 0; height: 0; opacity: 0; position: absolute; }
nav.domain-tabs a {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: 6px 14px;
  font-size: var(--t0);
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
}
nav.domain-tabs a.on {
  color: var(--text-primary);
  border-color: var(--primary);
  background: rgba(112, 42, 252, 0.12);
}

/* hero cover collage — infinite marquee of front covers, blurred */
.hero-visual { position: relative; }
.hv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s2);
  height: min(64vh, 540px);
  overflow: hidden;
  transform: perspective(1200px) rotateY(-8deg) rotateX(2deg);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}
.hv-col { overflow: hidden; }
.hv-track {
  display: flex; flex-direction: column; gap: var(--s2);
  animation: hv-up 36s linear infinite;
}
.hv-col:nth-child(2) .hv-track { animation-name: hv-down; animation-duration: 44s; }
.hv-col:nth-child(3) .hv-track { animation-duration: 40s; }
@keyframes hv-up   { to   { transform: translateY(-50%); } }
@keyframes hv-down { from { transform: translateY(-50%); } to { transform: translateY(0); } }
.hv-grid:hover .hv-track, .hv-grid:focus-within .hv-track { animation-play-state: paused; }
.hv-cell {
  display: block;
  position: relative;
  aspect-ratio: 3 / 4;
  flex: none;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
}
.hv-cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;   /* img arrives pre-cropped to the front cover via /thumb?part=front */

  transform: scale(1.06);                    /* hide blur edge bleed */
  filter: blur(2.5px) saturate(0.9) brightness(0.95);
  transition: filter .28s var(--ease-out), transform .28s var(--ease-out);
}
.hv-cell:hover img, .hv-cell:focus-visible img {
  filter: none;
  transform: scale(1.02);
}
@media (prefers-reduced-motion: reduce) {
  .hv-track { animation: none; }
  .jv-img { transition: none; }
}

/* ---------- sections / headers ---------- */
.section-head {
  display: flex;
  align-items: center;
  gap: var(--s4);
  margin-bottom: var(--s4);
}
.section-head h2 { flex: none; }
.section-head .more { margin-left: auto; font-size: var(--t0); flex: none; }
.rail-tabs { display: inline-flex; gap: 2px; background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--r-md); padding: 2px; }
.rtab {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--t0);
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 7px;
  transition: all var(--dur-micro) var(--ease);
}
.rtab.on { background: var(--surface-elevated); color: var(--text-primary); }
.rtab:hover { color: var(--text-primary); }

/* ---------- badges / tags / chips ---------- */
.badge {
  display: inline-block;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
  line-height: 1.3;
}
.badge-j { background: rgba(112, 42, 252, 0.16); color: var(--accent); }
.badge-w { background: rgba(56, 189, 248, 0.14); color: #7dd3fc; }
.badge-ov { position: absolute; left: var(--s2); top: var(--s2); z-index: 1; }

.tag {
  display: inline-block;
  padding: 4px 10px;
  margin: 2px 4px 2px 0;
  font-size: var(--t0);
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-pill);
  transition: all var(--dur-micro) var(--ease);
}
.tag:hover { color: var(--text-primary); border-color: var(--border); }
.tag-row { margin: var(--s2) 0; }

.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0 0 var(--s4); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 5px 12px;
  font-size: var(--t0);
  font-weight: 500;
  color: var(--text-primary);
  background: rgba(112, 42, 252, 0.12);
  border: 1px solid rgba(112, 42, 252, 0.4);
  border-radius: var(--r-pill);
}
.chip:hover { background: rgba(112, 42, 252, 0.2); color: var(--text-primary); }
.chip span { color: var(--accent); font-weight: 700; }

/* ---------- browse layout (facets + results) ---------- */
.browse {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: var(--s6);
  align-items: start;
}
.facets {
  position: sticky;
  top: 72px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  padding-right: var(--s2);
  scrollbar-width: thin;
}
.facets-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: var(--s4);
}
.facets-head strong { font-size: var(--t0); letter-spacing: 0.04em; }
.facet-reset { font-size: var(--t-1); color: var(--text-muted); }
.facet-reset:hover { color: var(--danger); }
.facet-close, .sheet-foot { display: none; }

.facet-group { margin-bottom: var(--s5); }
.facet-group h3 {
  font-size: var(--t-1);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 var(--s2);
}
.facet-search {
  width: 100%;
  height: 30px;
  padding: 0 var(--s2);
  margin-bottom: var(--s2);
  font-size: var(--t0);
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
}
.facet-list { display: flex; flex-direction: column; gap: 1px; }
.facet {
  display: flex;
  align-items: center;
  gap: var(--s2);
  padding: 5px var(--s2);
  font-size: var(--t0);
  color: var(--text-secondary);
  border-radius: var(--r-sm);
  transition: background var(--dur-micro) var(--ease);
}
.facet:hover { background: var(--surface); color: var(--text-primary); }
.facet .fbox {
  flex: none;
  width: 14px;
  height: 14px;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: all var(--dur-micro) var(--ease);
}
.facet .fname {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.facet .fcount {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: var(--t-1);
  color: var(--text-muted);
}
.facet.on { color: var(--text-primary); }
.facet.on .fbox {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: inset 0 0 0 2px var(--surface);
}
.facet.on .fcount { color: var(--accent); }
.facet-more {
  margin-top: var(--s1);
  padding: 4px var(--s2);
  background: none;
  border: 0;
  font-size: var(--t-1);
  font-weight: 600;
  color: var(--accent);
}
.facet-more:hover { color: var(--text-primary); }

/* ---------- toolbar ---------- */
.results-bar {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin-bottom: var(--s4);
  flex-wrap: wrap;
}
.result-count { font-size: var(--t0); }
.bar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s2);
  flex-wrap: wrap;
}
.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: 6px 12px;
  font-size: var(--t0);
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  white-space: nowrap;
  transition: all var(--dur-micro) var(--ease);
}
.mini-btn:hover { color: var(--text-primary); border-color: var(--border); }
.mini-btn.on { color: var(--accent); border-color: rgba(112, 42, 252, 0.5); background: rgba(112, 42, 252, 0.1); }
.mini-btn input[type="checkbox"] { accent-color: var(--primary); margin: 0; }
.sort-sel {
  height: 32px;
  padding: 0 var(--s2);
  font-size: var(--t0);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  color: var(--text-secondary);
}
.view-toggle .ic-list { display: none; }
.grid.list ~ * .view-toggle .ic-list, .view-toggle.list .ic-grid { display: none; }
.view-toggle.list .ic-list { display: block; }
.filter-btn { display: none; }

/* ---------- card grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--s3);
}
.card-wrap { position: relative; min-width: 0; }
.card {
  display: block;
  color: var(--text-primary);
  border-radius: var(--r-md);
}
.thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: transform var(--dur-short) var(--ease), border-color var(--dur-micro) var(--ease);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-short) var(--ease);
}
@media (hover: hover) {
  .card:hover .thumb { border-color: var(--border); transform: translateY(-2px); }
  .card:hover .thumb img { transform: scale(1.03); }
}
.thumb-ph {
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--ph-a), var(--ph-b));
}
.thumb-ph span {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: var(--t0);
  color: var(--text-muted);
}
.card-body { padding: var(--s2) 2px 0; min-width: 0; }
.card-body .code {
  display: block;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: var(--t0);
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-body .cname {
  display: block;
  font-size: var(--t-1);
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-body .date {
  display: block;
  font-size: var(--t-1);
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-fav, .qv-btn {
  position: absolute;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: var(--bg-veil-card);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity var(--dur-micro) var(--ease), color var(--dur-micro) var(--ease);
}
.card-fav { top: var(--s2); right: var(--s2); }
.qv-btn { top: var(--s2); right: calc(var(--s2) + 34px); font-weight: 700; }
@media (hover: hover) {
  .card-wrap:hover .card-fav, .card-wrap:hover .qv-btn { opacity: 1; }
  .card-fav:hover, .qv-btn:hover { color: var(--accent); }
}
.card-fav.on { opacity: 1; color: var(--accent); border-color: rgba(112, 42, 252, 0.5); }
@media (hover: none) {
  .card-fav, .qv-btn { opacity: 1; }
}

/* list view */
.grid.list { grid-template-columns: 1fr; gap: var(--s2); }
.grid.list .card { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--s3); align-items: center; background: var(--surface); border: 1px solid var(--border-subtle); border-radius: var(--r-md); padding: var(--s2); }
.grid.list .thumb { aspect-ratio: 3 / 4; }
.grid.list .card-body { padding: 0; }
.grid.list .card-fav { top: var(--s2); }
.grid.list .qv-btn { top: var(--s2); }

/* ---------- pager / load more ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s4);
  margin-top: var(--s6);
}
.pager a, .pager span {
  font-size: var(--t0);
  color: var(--text-secondary);
}
.pager a:hover { color: var(--text-primary); }
.load-more {
  padding: 10px 28px;
  font-size: var(--t0);
  font-weight: 600;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  transition: all var(--dur-micro) var(--ease);
}
.load-more:hover { border-color: var(--primary); color: var(--accent); }
.load-more:disabled { opacity: 0.5; }

/* instant refresh state — dim the grid, don't blank it */
#results.loading .browse-main { opacity: 0.45; pointer-events: none; transition: opacity var(--dur-micro); }
.browse-main { transition: opacity var(--dur-short) var(--ease); }

/* ---------- detail pages ---------- */
.d-hero {
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(0, 1fr);
  gap: var(--s7);
  padding-bottom: var(--s7);
  border-bottom: 1px solid var(--border-subtle);
}
.d-cover {
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--surface);
}
.d-cover img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; }

/* jacket viewer — buttons swap front/spine/back/full images, no 3D */
.d-cover.jacket { overflow: visible; border: 0; background: transparent; }
.jv-stage {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 320px;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  touch-action: pan-y;
  user-select: none;
}
.jv-img {
  display: block; max-width: 100%; max-height: 560px;
  object-fit: contain;
  transition: transform .25s var(--ease-out), opacity .18s ease;
}
.jv-stage.flat .jv-img { max-height: none; width: 100%; }
.jv-stage.flat { cursor: zoom-in; overflow: hidden; min-height: 0; }
.jv-stage.flat.zoomed { cursor: grab; }
.jv-stage.flat.zoomed:active { cursor: grabbing; }
.jv-stage.flat.no-anim .jv-img { transition: none; }
.jv-zoom { position: absolute; top: 10px; right: 10px; display: none; gap: 6px; z-index: 2; }
.jv-stage.flat .jv-zoom { display: flex; }
.jv-zoom button {
  width: 34px; height: 34px; border-radius: 999px;
  background: oklch(20% .02 288 / 85%); color: var(--text-primary);
  border: 1px solid var(--border); font-size: 18px; line-height: 1;
  cursor: pointer; backdrop-filter: blur(6px);
}
.jv-zoom button:hover { border-color: var(--primary); color: var(--accent); }
.jv-ctl { display: flex; gap: 6px; justify-content: center; margin-top: 14px; }
.jv-ctl[hidden], .jv-hint[hidden] { display: none; }
.jv-ctl button {
  padding: 7px 14px; font-size: var(--t0); color: var(--text-secondary);
  background: var(--surface); border: 1px solid var(--border-subtle);
  border-radius: 999px; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.jv-ctl button:hover { color: var(--text-primary); border-color: var(--border); }
.jv-ctl button.on { color: var(--accent); border-color: var(--primary); background: rgba(112, 42, 252, 0.12); }
.jv-hint { display: block; text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.cover-ph { aspect-ratio: 3 / 4; display: grid; place-items: center; background: linear-gradient(160deg, var(--ph-a), var(--ph-b)); }
.cover-ph span { font-family: "Geist Mono", ui-monospace, monospace; color: var(--text-muted); }
.d-code {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: var(--t0);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin-top: var(--s2);
}
.d-info h1 { font-size: var(--t3); margin: var(--s1) 0 var(--s3); }
.d-quick { font-size: var(--t0); margin: 0 0 var(--s4); }
.d-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); }
.external-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 8px 16px;
  font-size: var(--t0);
  font-weight: 700;
  color: var(--text-primary);
  background: var(--primary);
  border: 0;
  border-radius: var(--r-md);
  transition: background var(--dur-micro) var(--ease);
}
.external-btn:hover { background: var(--primary-strong); color: var(--text-primary); }

.meta-table {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: var(--s2) var(--s4);
  margin: 0 0 var(--s4);
  font-size: var(--t0);
}
.meta-table dt { color: var(--text-muted); font-weight: 600; }
.meta-table dd { margin: 0; min-width: 0; }

/* detail tabs (JS builds the tab bar; no-JS shows all) */
.dtabs {
  display: flex;
  gap: 2px;
  margin-top: var(--s7);
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
}
.dtab {
  padding: 10px 16px;
  font-size: var(--t0);
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.dtab:hover { color: var(--text-secondary); }
.dtab.on { color: var(--text-primary); border-bottom-color: var(--primary); }
.detail section[data-tab] { margin-top: var(--s6); }
.detail section[data-tab] h2 { font-size: var(--t1); margin-bottom: var(--s3); color: var(--text-secondary); font-weight: 700; }

.samples {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--s2);
}
.samples img { width: 100%; border-radius: var(--r-sm); border: 1px solid var(--border-subtle); }

/* ---------- performer hero ---------- */
.p-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  background: var(--bg-secondary);
}
.p-hero-img {
  position: absolute;
  inset: -20px;
  width: calc(100% + 40px);
  height: calc(100% + 40px);
  object-fit: cover;
  filter: blur(28px) brightness(0.4) saturate(1.1);
  pointer-events: none;
}
.p-hero-in {
  position: relative;
  display: flex;
  gap: var(--s6);
  padding: var(--s7);
  align-items: flex-start;
}
.rep-cover {
  width: 147px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  flex: none;
}
.p-info { min-width: 0; }
.p-info h1 { margin-bottom: var(--s1); }
.d-stats { display: flex; gap: var(--s6); flex-wrap: wrap; margin: var(--s4) 0; }
.d-stat strong { display: block; font-size: var(--t2); font-family: "Geist Mono", ui-monospace, monospace; }
.d-stat span { font-size: var(--t-1); color: var(--text-muted); }
.new-since {
  display: inline-block;
  padding: 4px 12px;
  font-size: var(--t0);
  font-weight: 600;
  color: var(--accent);
  background: rgba(112, 42, 252, 0.12);
  border: 1px solid rgba(112, 42, 252, 0.4);
  border-radius: var(--r-pill);
}

/* ---------- timeline ---------- */
.timeline { display: flex; flex-direction: column; gap: 3px; }
.tl-row { display: flex; align-items: center; gap: var(--s3); }
.tl-year {
  flex: none;
  width: 44px;
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: var(--t0);
  color: var(--text-secondary);
}
.tl-year.on, .tl-year:hover { color: var(--accent); }
.tl-months { display: flex; gap: 2px; flex: 1; }
.tl-cell { flex: 1; height: 16px; border-radius: 3px; background: var(--heat-0); }
.tl-cell.h1 { background: var(--heat-1); }
.tl-cell.h2 { background: var(--heat-2); }
.tl-cell.h3 { background: var(--heat-3); }
.tl-cell.h4 { background: var(--heat-4); }
.tl-count { flex: none; width: 32px; text-align: right; font-size: var(--t-1); }

/* ---------- lists ---------- */
.performer-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s2); }
.performer-chip {
  display: flex;
  align-items: baseline;
  gap: var(--s2);
  padding: var(--s3) var(--s4);
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  color: var(--text-primary);
  transition: border-color var(--dur-micro) var(--ease);
}
.performer-chip:hover { border-color: var(--border); }
.performer-chip .muted { font-size: var(--t-1); }
.performer-head { margin-bottom: var(--s6); }
.performer-chip .av, .tag .av {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  background: var(--surface-elevated);
  flex: none;
}
.tag .av { width: 22px; height: 22px; margin-right: -2px; }
.suggest-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  background: var(--surface);
  flex: none;
}
.rep-cover.photo {
  width: 140px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
}
.performer-head .stats { display: flex; gap: var(--s4); flex-wrap: wrap; margin: var(--s3) 0; font-size: var(--t0); color: var(--text-secondary); }

/* ---------- filters (legacy inline forms) ---------- */
.filters { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.filters select, .filters input[type="search"] {
  height: 34px;
  padding: 0 var(--s2);
  font-size: var(--t0);
  background: var(--input-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
}

/* ---------- page furniture ---------- */
.page-title { margin-bottom: var(--s2); }
.norm-hint code { font-family: "Geist Mono", ui-monospace, monospace; color: var(--accent); }
.empty {
  padding: var(--s10) var(--s5);
  text-align: center;
  color: var(--text-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--r-lg);
}
.empty p { margin: var(--s1) 0; }
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--s6) var(--s5) var(--s8);
  font-size: var(--t0);
  color: var(--text-muted);
  text-align: center;
}
.site-footer p { margin: var(--s1) 0; }

/* ---------- quick view ---------- */
.qv-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: var(--overlay);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
}
.qv-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  animation: qv-in var(--dur-short) var(--ease);
}
@keyframes qv-in { from { transform: translateX(24px); opacity: 0; } }
.qv-media { background: var(--bg-secondary); }
.qv-media img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.qv-body { padding: var(--s5); }
.qv-title {
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: var(--t1);
  font-weight: 700;
  margin-bottom: var(--s1);
}
.qv-sub { font-size: var(--t0); margin-bottom: var(--s2); }
.qv-meta { font-size: var(--t0); margin-bottom: var(--s4); }
.qv-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.qv-actions .qv-open { flex: 1 1 100%; justify-content: center; }
.qv-actions button {
  padding: 8px 12px;
  font-size: var(--t0);
  color: var(--text-secondary);
  background: var(--surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.qv-actions button:hover { color: var(--text-primary); border-color: var(--border); }
.qv-actions button.on { color: var(--accent); border-color: rgba(112, 42, 252, 0.5); }
.qv-close {
  position: absolute;
  top: var(--s2);
  right: var(--s2);
  width: 34px;
  height: 34px;
  font-size: 1.2rem;
  color: var(--text-primary);
  background: var(--bg-veil-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: var(--s6);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: var(--z-toast);
  padding: 10px 18px;
  font-size: var(--t0);
  color: var(--text-primary);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-deep);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-short) var(--ease), transform var(--dur-short) var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- recent rail markers ---------- */
.recents-note { font-size: var(--t-1); }

/* ============================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1023px) {
  .browse { grid-template-columns: 1fr; }
  .facets {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    z-index: var(--z-sheet);
    max-height: 78vh;
    background: var(--surface);
    border: 1px solid var(--border);
    border-bottom: 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    padding: var(--s4);
    transform: translateY(102%);
    transition: transform var(--dur-short) var(--ease);
    box-shadow: var(--shadow-deep);
  }
  body.filters-open .facets { transform: translateY(0); }
  body.filters-open::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 70;
    background: var(--overlay);
  }
  .facet-close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    background: none;
    border: 0;
    font-size: 1.3rem;
    color: var(--text-secondary);
  }
  .sheet-foot {
    display: block;
    position: sticky;
    bottom: calc(-1 * var(--s4));
    margin: var(--s4) calc(-1 * var(--s4)) calc(-1 * var(--s4));
    padding: var(--s3) var(--s4);
    background: var(--surface);
    border-top: 1px solid var(--border-subtle);
  }
  .sheet-apply {
    width: 100%;
    padding: 12px;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--primary);
    border: 0;
    border-radius: var(--r-md);
  }
  .sheet-apply:hover { background: var(--primary-strong); }
  .filter-btn { display: inline-flex; }
}

@media (max-width: 899px) {
  .hero { grid-template-columns: 1fr; gap: var(--s6); padding: var(--s7) 0 var(--s6); }
  .hero-visual { display: none; }
  .d-hero { grid-template-columns: 1fr; gap: var(--s4); }
  .d-cover { max-width: 300px; }
  .p-hero-in { flex-direction: column; }
}

@media (max-width: 639px) {
  main { padding: var(--s4) var(--s4) var(--s9); }
  .site-header { gap: var(--s2); padding: var(--s2) var(--s3); }
  .searchbox { display: none; }
  body.search-open .searchbox {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: var(--s2) var(--s3);
    background: var(--bg);
    border-bottom: 1px solid var(--border-subtle);
  }
  .icon-btn { display: grid; }
  .site-nav { gap: var(--s3); }
  .site-nav a { font-size: var(--t-1); }
  .nav-saved svg { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: var(--s2); }
  .qv-overlay { align-items: flex-end; justify-content: stretch; }
  .qv-sheet {
    width: 100%;
    max-height: 82vh;
    border-left: 0;
    border-top: 1px solid var(--border);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
  }
  .qv-media img { aspect-ratio: 16 / 9; }
  .meta-table { grid-template-columns: 72px minmax(0, 1fr); }
  .samples { grid-template-columns: repeat(3, 1fr); }
  .performer-list { grid-template-columns: 1fr; }
}

/* ---------- coarse pointers ---------- */
@media (pointer: coarse) {
  .mini-btn, .facet, .sort-sel { min-height: 40px; }
  .domain-tabs label, .rtab { min-height: 40px; padding-top: 9px; padding-bottom: 9px; }
  .chip { padding: 8px 14px; }
  .card-fav, .qv-btn { width: 36px; height: 36px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .hv-grid { transform: none; }
}

/* ---------- reserved ad placements (design.md §61) ----------
   Empty hidden slots — a provider wiring step unhides them. */
.ad-slot { display: none; margin: var(--s8) 0; min-height: 90px;
  border-radius: var(--r-md); }
.ad-slot.filled { display: block; }

/* ---------- error page ---------- */
.error-page { text-align: center; padding: var(--s10) var(--s4); }
.error-page h1 { font-size: var(--t4); margin: 0 0 var(--s2); }
.error-page .btn { display: inline-block; margin-top: var(--s4); }

/* Hallmark · genre: modern-minimal · macrostructure: Workbench · design-system: design.md · designed-as-app */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R5 V4 */
@font-face { font-family: 'Geist'; src: url('/static/fonts/Geist-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Noto Sans JP'; src: url('/static/fonts/NotoSansJP-Variable.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
:root {
  --bg: var(--color-canvas); --bg-secondary: var(--color-panel);
  --surface: var(--color-panel); --surface-elevated: var(--color-raised);
  --input-bg: var(--color-panel); --text-primary: var(--color-ink);
  --text-secondary: var(--color-secondary); --text-muted: var(--color-muted);
  --border: var(--color-rule); --border-subtle: var(--color-soft-rule);
  --primary: var(--color-violet); --accent: var(--color-lilac); --ring: var(--color-lilac);
  --t-1: .75rem; --t0: .875rem;
}
body { font-family: var(--font-body); }
h1, h2, h3, .brand { font-family: var(--font-display); font-style: normal; overflow-wrap: anywhere; min-width: 0; }
:focus-visible { outline: 2px solid var(--color-lilac); outline-offset: 4px; }
button, .site-nav a, .more, .pager a, .browse-switch { white-space: nowrap; }
main { padding: 32px 40px 80px; }
section { margin-top: 48px; }
.site-header { padding: 12px max(24px, calc((100vw - 1360px) / 2)); gap: 32px; min-height: 76px; background: var(--color-header); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 23px; font-weight: 650; letter-spacing: -.9px; }
.brand span { color: var(--text-primary); background: none; margin-left: -10px; }
.site-nav { gap: 24px; }
.site-nav a { min-height: 44px; font-size: 14px; }
.site-nav a[aria-current='page'] { color: var(--accent); }
.nav-saved { border-left: 1px solid var(--border); padding-left: 24px; gap: 8px !important; }
.searchbox { max-width: 460px; }
.searchbox input[type='search'] { height: 44px; font-size: 14px; border-color: var(--border); }
.skip-link { position: fixed; top: -100px; left: 16px; padding: 12px 20px; background: var(--surface-elevated); z-index: 200; }
.skip-link:focus { top: 8px; }
.hero { margin-top: 0; padding: 48px 0 56px; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 80px; }
.hero h1 { word-break: keep-all; overflow-wrap: normal; font-size: var(--text-display); font-weight: 600; line-height: 1.04; letter-spacing: -.055em; margin-bottom: 24px; }
.hero-sub { font-size: 16px; line-height: 1.8; margin-bottom: 28px; }
.omnibox input[type='search'] { height: 64px; border-color: var(--border); font-size: 16px; }
.hero-search-btn { position: absolute; top: 9px; right: 9px; width: 46px; height: 46px; display: grid; place-items: center; background: var(--grad); color: var(--color-on-accent); border: 0; border-radius: 999px; transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out); }
.hero-search-btn:hover { transform: translateX(2px); box-shadow: 0 6px 22px oklch(53% .275 288 / 45%); }
.hero-search-btn:active { transform: translateX(2px) scale(.96); }
.domain-tabs { gap: 4px; }
.domain-tabs label { background: transparent; border-color: transparent; border-radius: 6px; min-height: 40px; padding: 8px 16px; }
.domain-tabs label:has(input:checked), .domain-tabs label.on { background: var(--color-selected); color: var(--accent); border-color: transparent; }
.domain-tabs label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.hero-pop { gap: 6px; margin-top: 16px; }
.hero-pop > .muted { flex-basis: 100%; font-size: 12px; margin-bottom: 4px; }
.hero-pop .tag { background: transparent; border: 0; padding: 4px 0; margin-right: 12px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.hero-pop .av { width: 22px; height: 22px; }
.search-hint { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); margin: 20px 0 0; }
kbd { border: 1px solid var(--border); border-radius: 4px; padding: 0 6px; font-family: var(--font-body); margin-left: auto; }
.index-panel { padding: 32px; background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: 20px; }
.index-panel-head { display: flex; align-items: center; gap: 16px; padding-bottom: 36px; color: var(--text-secondary); font-size: 17px; line-height: 1.5; }
.index-row { display: flex; align-items: center; gap: 16px; padding: 24px 0; border-top: 1px solid var(--border); color: var(--text-primary); }
.index-row small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 6px; }
.index-row strong { margin-left: auto; font-size: 25px; font-weight: 500; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.index-row > span:last-child { color: var(--accent); }
.index-row:hover { color: var(--accent); }
.index-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; border-top: 1px solid var(--border); padding-top: 20px; font-size: 12px; color: var(--text-muted); }
.index-foot strong { color: var(--text-secondary); font-weight: 500; }
.section-head { margin-bottom: 24px; align-items: center; gap: 24px; }
h2 { font-size: 22px; font-weight: 600; }
.section-title p { color: var(--text-muted); font-size: 13px; margin: 6px 0 0; }
.rail-tabs { margin-left: auto; padding: 4px; border: 0; }
.rtab { min-height: 36px; padding: 6px 16px; }
.rtab.on { background: var(--color-selected); color: var(--accent); }
.section-head:has(.rail-tabs) .more { margin-left: 0; }
.grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 28px 18px; }
.browse .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.thumb { aspect-ratio: 3 / 4; border: 0; border-radius: 10px; }
.card:hover .thumb img { transform: none; }
.card-body { padding: 12px 0 0; }
.card-body .code { font-family: var(--font-body); font-size: 14px; font-weight: 600; }
.card-body .cname { font-size: 13px; margin-top: 4px; }
.card-body .date { font-size: 12px; margin-top: 3px; }
.badge { font-family: var(--font-body); letter-spacing: 0; }
.badge-ov { top: auto; bottom: 8px; background: var(--color-header); padding: 4px 7px; font-size: 10px; }
.badge-w { color: var(--text-secondary); }
.card-fav, .qv-btn { width: 40px; height: 40px; color: var(--text-primary); }
.card-fav svg { width: 17px; height: 17px; }
.qv-btn { right: 52px; font-size: 20px; }
.card-wrap:focus-within .card-fav, .card-wrap:focus-within .qv-btn { opacity: 1; }
.grid.list { grid-template-columns: minmax(0, 1fr); }
.grid.list .card-body { padding-right: 92px; }
.browse-heading { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 12px 0 32px; }
.browse-heading h1, .page-title { font-size: 32px; font-weight: 600; }
.browse-heading p { margin: 8px 0 0; font-size: 14px; }
.browse-switch { font-size: 13px; }
.facets { padding-right: 20px; top: 96px; }
.facets-head strong, .facet-group h3 { font-size: 13px; letter-spacing: 0; text-transform: none; }
.facet-group { margin-top: 24px; }
.facet { padding: 8px; }
.facet-search, .sort-sel { height: 40px; }
.mini-btn { min-height: 40px; }
.result-count, .code, .qv-title { font-family: var(--font-body); }
.d-hero { gap: 48px; }
.d-info h1 { font-size: 28px; line-height: 1.45; }
.meta-table { line-height: 1.8; gap: 12px 24px; }
.external-btn, .qv-actions button, .dtab, .qv-close, .pager a { min-height: 44px; }
.pager a { display: inline-flex; align-items: center; }
.qv-close { width: 44px; }
.suggest-head { letter-spacing: 0; text-transform: none; font-size: 12px; }
.suggest-list a { min-height: 44px; align-items: center; }
.suggest-list a.active { background: var(--color-selected); }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text-primary); font-weight: 600; font-size: 18px; }
.site-footer { padding: 36px 24px; }
.site-footer p { margin: 10px 0; font-size: 13px; }
@media (max-width: 1199px) {
  .site-header { gap: 20px; } .site-nav { gap: 16px; }
  .hero { gap: 40px; } .index-panel { padding: 24px; }
  .index-row strong { font-size: 22px; }
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .browse .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  main { padding: 24px 24px 64px; }
  .hero { gap: 32px; } .hero h1 { font-size: 52px; }
  .index-panel { padding: 20px; } .index-row { gap: 8px; }
  .index-row strong { font-size: 20px; }
  .grid, .browse .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .site-header { gap: 20px; } .site-nav { gap: 16px; }
  .site-nav a { font-size: 13px; } .nav-saved { padding-left: 16px; }
}
@media (max-width: 767px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 32px 0; }
  .index-panel { display: none; }
  .hero-copy { max-width: 600px; }
  .hero h1 { font-size: 52px; }
  .section-head { flex-wrap: wrap; gap: 16px; }
  .section-title { flex-basis: 100%; }
  .rail-tabs { margin-left: 0; }
  .section-head:has(.rail-tabs) .more { margin-left: auto; }
  .browse-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
}
@media (max-width: 639px) {
  main { padding: 20px 16px 48px; }
  .site-header { padding: 8px 16px; min-height: 64px; gap: 12px; flex-wrap: wrap; }
  .brand { font-size: 21px; } .brand img { width: 28px; height: 28px; }
  .search-toggle { display: grid; margin-left: auto; width: 44px; height: 44px; background: var(--grad); border: 0; border-radius: 999px; color: var(--color-on-accent); }
  .site-nav { width: 100%; order: 4; margin: 0; justify-content: space-between; border-top: 1px solid var(--border-subtle); gap: 12px; }
  .site-nav a { font-size: 13px; min-height: 40px; }
  .nav-saved { border: 0; padding: 0; } .nav-saved svg { display: block; }
  body.search-open .searchbox { position: relative; top: auto; left: auto; right: auto; order: 3; flex-basis: 100%; max-width: none; padding: 0 0 8px; background: transparent; border: 0; }
  .hero { padding: 20px 0 28px; }
  .hero h1 { font-size: 46px; margin-bottom: 20px; }
  .hero-sub { font-size: 14px; margin-bottom: 24px; }
  .omnibox input[type='search'] { height: 58px; padding-left: 48px; font-size: 16px; }
  .omni-ico { left: 17px; width: 18px; height: 18px; }
  .hero-search-btn { width: 44px; height: 44px; }
  .search-hint { display: none; }
  .hero-pop { margin-top: 12px; }
  .grid, .browse .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
  .grid.list { grid-template-columns: minmax(0, 1fr); }
  .card-fav, .qv-btn { width: 44px; height: 44px; }
  .qv-btn { right: 56px; }
  .section-head { align-items: flex-start; }
  .section-head h2 { flex-basis: 100%; }
  section { margin-top: 32px; } h2 { font-size: 21px; }
  .rtab { min-height: 40px; padding: 6px 14px; }
  .section-head .more { min-height: 44px; display: inline-flex; align-items: center; font-size: 13px; }
  .bar-actions { gap: 6px; margin-left: 0; }
  .results-bar { gap: 12px; }
  .mini-btn { padding: 8px 10px; font-size: 12px; }
  .sort-sel { max-width: 140px; }
  .browse-heading h1, .page-title { font-size: 28px; }
  .d-hero { gap: 24px; } .d-cover { margin: 0 auto; }
  .d-info h1 { font-size: 23px; }
  .p-hero-in { padding: 20px; gap: 16px; }
  .rep-cover { width: 88px; }
}
@media (hover: none) { .card-fav, .qv-btn { opacity: 1; } }
@media (max-width: 1023px) { .facets { top: auto; padding: 16px; } }
.domain-tabs label:not(:has(input:checked)) { color: var(--text-secondary); background: transparent; border-color: transparent; }
.card-wrap[data-domain='western'] .thumb img { object-fit: contain; }
.browse:has(.card-wrap[data-domain='western']):not(:has(.card-wrap[data-domain='jav'])) .thumb { aspect-ratio: 16 / 10; }

/* The Scenedex index: quiet ink, luminous violet, one consistent icon hand. */
:root { --bg: var(--color-canvas); --bg-secondary: var(--color-panel); --surface: var(--color-panel); --surface-elevated: var(--color-raised); --input-bg: var(--color-panel); --text-primary: var(--color-ink); --text-secondary: var(--color-secondary); --text-muted: var(--color-muted); --border: var(--color-rule); --border-subtle: var(--color-soft-rule); --primary: var(--color-violet); --accent: var(--color-lilac); --ring: var(--color-lilac); }
.ui-icon { width: 18px; height: 18px; display: block; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.brand { gap: 11px; font-family: var(--font-display); font-size: 22px; font-weight: 650; letter-spacing: -1.1px; }
.brand img { width: 36px; height: 36px; filter: drop-shadow(0 4px 10px oklch(53% .275 288 / 24%)); }
.brand .brand-name { color: var(--text-primary); margin: 0; font-size: inherit; }
.brand-name b { color: var(--accent); font-weight: 600; }
.search-cta .ui-icon, .search-toggle .ui-icon { width: 19px; height: 19px; }
.search-toggle:hover { box-shadow: 0 4px 14px oklch(53% .275 288 / 40%); }
.site-nav a { transition: color .16s var(--ease-out); }
.site-nav a[aria-current='page'] { color: var(--text-primary); }
.nav-saved .ui-icon { width: 17px; height: 17px; }
.hero { padding-top: 52px; padding-bottom: 58px; gap: clamp(40px, 7vw, 104px); }
.hero h1 { max-width: 690px; font-size: clamp(3rem, 5.8vw, 5rem); line-height: .99; letter-spacing: -.068em; font-weight: 590; }
.hero-sub { font-size: 15px; }
.omnibox input[type='search'] { background: oklch(20% .015 286); }
.omnibox:focus-within input[type='search'] { border-color: oklch(53% .275 288 / 70%); }
.domain-tabs { gap: 5px; }
.domain-tabs label { border-radius: 7px; font-weight: 550; }
.domain-tabs label:has(input:checked) { background: oklch(53% .275 288 / 13%); color: var(--accent); }
.index-panel { position: relative; padding: 28px 30px; border: 1px solid oklch(79% .105 288 / 12%); border-radius: 14px; background: linear-gradient(142deg, oklch(25% .025 288 / 55%), var(--bg-secondary) 58%); box-shadow: 0 24px 72px oklch(0% 0 0 / 18%), inset 0 1px oklch(100% 0 0 / 3%); }
.index-panel::before { content: ''; position: absolute; top: 0; left: 30px; width: 58px; height: 2px; background: var(--accent); }
.index-panel-head { padding-bottom: 29px; font-size: 15px; letter-spacing: -.2px; }
.index-panel-head img { width: 42px; height: 42px; }
.index-row { padding: 21px 0; transition: color .16s var(--ease-out), padding .16s var(--ease-out); }
.index-row:hover { padding-left: 4px; }
.index-row strong { font-size: 27px; font-weight: 550; letter-spacing: -1.2px; }
.index-row .index-arrow { color: var(--text-muted); width: 18px; height: 18px; transition: color .16s var(--ease-out), transform .16s var(--ease-out); }
.index-row:hover .index-arrow { color: var(--accent); transform: translate(2px,-2px); }
.index-foot { font-size: 12px; }
.index-foot strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.section-title h2 { font-size: 23px; letter-spacing: -.7px; }
.section-title p { margin-top: 5px; }
.rtab { border-radius: 6px; font-size: 13px; }
.rail-tabs { background: transparent; }
.rtab.on { background: var(--color-selected); color: var(--accent); }
.thumb { border-radius: 8px; background: oklch(21% .017 285); }
.card:hover .thumb { outline: 1px solid oklch(79% .105 288 / 28%); outline-offset: 2px; }
.card-body .code { letter-spacing: -.15px; }
.badge-ov { border-radius: 5px; padding: 4px 8px; backdrop-filter: blur(10px); }
.badge-j { background: oklch(53% .275 288 / 76%); color: #fff; }
.badge-w { background: oklch(17% .014 285 / 88%); color: oklch(92% .035 235); }
.card-fav, .qv-btn { border: 1px solid oklch(100% 0 0 / 12%); border-radius: 10px; background: oklch(12% .012 285 / 78%); backdrop-filter: blur(12px); }
.card-fav .ui-icon, .qv-btn .ui-icon { width: 17px; height: 17px; }
.card-fav.on { background: var(--primary); color: white; border-color: transparent; }
.browse-heading { border-bottom: 1px solid var(--border-subtle); margin-bottom: 24px; }
.browse-heading h1, .page-title { letter-spacing: -1.1px; }
.browse-switch { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 13px; border: 1px solid var(--border); border-radius: 8px; color: var(--text-secondary); }
.browse-switch .ui-icon { width: 15px; height: 15px; }
.browse-switch:hover { color: var(--accent); border-color: var(--accent); }
.mini-btn { border-radius: 8px; }
.view-toggle { width: 40px; height: 40px; justify-content: center; padding: 0; }
.view-toggle .ui-icon { width: 17px; height: 17px; }
.sort-sel { border-radius: 8px; }
.facet .fbox { border-radius: 5px; }
.qv-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding-inline: 14px; border-radius: 8px; }
.qv-actions button .ui-icon { width: 16px; height: 16px; }
.qv-open { border-radius: 8px; }
.qv-close { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; }
.qv-close .ui-icon, .facet-close .ui-icon { width: 19px; height: 19px; }
.pager .load-more { border-radius: 8px; }
.footer-brand img { width: 27px; height: 27px; }
.site-footer { border-top-color: var(--border-subtle); }
@media (max-width: 767px) {
  .hero { padding-top: 30px; padding-bottom: 38px; }
  .hero h1 { font-size: clamp(2.75rem, 10vw, 3.45rem); line-height: 1.02; }
  .index-panel { display: block; padding: 16px 20px; }
  .index-panel-head { padding-bottom: 14px; }
  .index-panel-head img { width: 34px; height: 34px; }
  .index-panel-head br { display: none; }
  .index-row { padding: 12px 0; }
  .index-row small { display: none; }
  .index-row strong { font-size: 19px; }
  .index-foot { padding-top: 12px; }
  .search-hint { display: none; }
}
@media (max-width: 639px) {
  .site-header { min-height: 62px; }
  .brand { font-size: 21px; }
  .brand img { width: 34px; height: 34px; }
  .hero { padding-top: 22px; padding-bottom: 30px; }
  .hero h1 { font-size: clamp(2.55rem, 10vw, 3.2rem); margin-bottom: 15px; }
  .hero-sub { font-size: 13px; line-height: 1.7; margin-bottom: 19px; }
  .hero-pop { gap: 7px; }
  .hero-pop .tag { margin-right: 4px; font-size: 12px; }
  .hero-pop .av { width: 20px; height: 20px; }
  .index-panel { margin-top: 24px; border-radius: 11px; }
  .index-panel::before { left: 20px; }
  .index-foot { gap: 6px 16px; }
  .grid, .browse .grid { gap: 22px 12px; }
  .card-body { padding-top: 9px; }
  .card-body .code { font-size: 13px; }
  .card-body .cname { font-size: 12px; }
  .card-body .date { font-size: 11px; }
  .section-title h2 { font-size: 20px; }
  .section-title p { font-size: 12px; }
  .card-fav, .qv-btn { width: 40px; height: 40px; }
  .qv-btn { right: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  .index-row, .index-row .index-arrow, .hero-search-btn { transition: none; }
}
@media (max-width: 767px) {
  .hero { row-gap: 20px; }
  .index-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 14px; padding: 12px 16px; }
  .index-panel-head { display: none; }
  .index-row { min-width: 0; padding: 5px 0; gap: 5px; border-top: 0; }
  .index-row:hover { padding-left: 0; }
  .index-row > span:first-child { font-size: 12px; }
  .index-row strong { margin-left: auto; font-size: 17px; letter-spacing: -.6px; }
  .index-row .index-arrow { width: 15px; height: 15px; }
  .index-foot { grid-column: 1 / -1; padding-top: 8px; gap: 6px 16px; }
}
@media (max-width: 639px) {
  .hero { row-gap: 16px; }
  .index-panel { margin-top: 16px; }
}

/* language switcher */
.lang-switch { display: inline-flex; gap: 14px; margin: 10px 0; }
.lang-switch a { font-size: 12px; color: var(--text-muted); text-decoration: none; padding: 4px 0; }
.lang-switch a:hover { color: var(--text-primary); }
.lang-switch a.on { color: var(--accent); font-weight: 600; }

/* header language menu */
.lang-menu { position: relative; display: flex; align-items: center; }
.lang-menu summary {
  list-style: none; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: var(--r-sm);
  color: var(--text-secondary); cursor: pointer;
  transition: color .16s var(--ease-out), background .16s var(--ease-out);
}
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { color: var(--text-primary); background: var(--color-selected); }
.lang-menu[open] summary { color: var(--accent); }
.lang-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 120px; padding: 6px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 16px 48px oklch(0% 0 0 / 35%);
  display: flex; flex-direction: column;
}
.lang-pop a {
  padding: 8px 12px; border-radius: var(--r-sm);
  font-size: 13px; color: var(--text-secondary); text-decoration: none;
}
.lang-pop a:hover { color: var(--text-primary); background: var(--color-selected); }
.lang-pop a.on { color: var(--accent); font-weight: 600; }

/* hero slogan accent */
.hero h1 em { color: var(--accent); font-style: normal; }
.hero h1 br { display: block; }

/* solo hero — search-only landing, footer visible without scrolling */
.hero-solo {
  align-items: center; align-content: center;
  min-height: calc(100dvh - 76px - 220px);
  padding: 24px 0 32px; margin-top: 0;
}
.hero-solo .hero-copy { max-width: 640px; }
.hero-solo h1 { margin-bottom: 36px; }
.hero-solo .omnibox { position: relative; max-width: 560px; }
@media (max-width: 1023px) {
  .hero-solo { min-height: 60vh; }
}

/* ---------- breadcrumbs ---------- */
.crumbs { margin-bottom: var(--s2); font-size: var(--t0); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; align-items: center; }
.crumbs li { display: flex; align-items: center; gap: 6px; min-width: 0; }
.crumbs li + li::before { content: "›"; color: var(--text-muted); flex: none; }
.crumbs a { color: var(--text-secondary); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs [aria-current] { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
