/* ============================================================================
   BBX VAULT — design system v3 "Industrial Manga"
   Reference: Teraoka (Kure) — cobalt #295ECE, giant Montserrat caps, halftone,
   numbered ghost sections, diagonal cuts, circular arrow buttons, black footer.
   One accent: vermilion. No purple anywhere.
   ============================================================================ */

:root {
  /* Foundations */
  --blue:       #295ECE;   /* brand ground (from reference) */
  --blue-deep:  #1C46A3;   /* derived shade for depth on blue */
  --paper:      #EEF1F6;   /* cool light ground */
  --surface:    #FFFFFF;
  --ink:        #14181F;
  --muted:      #59637A;
  --line:       #D9DFEA;

  /* Accent — one, used sparingly (AA: white text ≥ 4.5:1) */
  --accent:     #C93318;

  /* Status (semantic, not accent) */
  --ok:         #178A50;
  --warn:       #9A5B00;

  /* Type */
  --font-display: 'Montserrat', 'Arial Black', sans-serif;
  --font-body:    'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.5rem;
  --text-2xl:  2rem;
  --text-3xl:  clamp(2.25rem, 4.5vw, 3rem);
  --text-4xl:  clamp(3rem, 8vw, 6rem);

  /* 8px scale */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px;
  --s5: 48px; --s6: 64px; --s7: 96px; --s8: 128px;

  --radius: 6px;
  --container: 1200px;
  --cut: clamp(32px, 6vw, 88px);   /* diagonal section cut depth */

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 160ms;
  --base: 240ms;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  line-height: 1.02;
  text-wrap: balance;
}
h4 { margin: 0; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: 0; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; }
button { font-family: inherit; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[id] { scroll-margin-top: 120px; }

.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--s3); }

.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }

/* ---------- Textures ---------- */
.halftone::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgb(255 255 255 / 0.14) 1px, transparent 1px);
  background-size: 12px 12px;
}
.halftone-ink::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgb(20 24 31 / 0.07) 1px, transparent 1px);
  background-size: 12px 12px;
}
/* Manga speed-line burst (radial rays) */
.burst {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg,
    transparent 0deg 5deg,
    rgb(255 255 255 / 0.10) 5deg 6.5deg);
  -webkit-mask-image: radial-gradient(circle, transparent 34%, #000 35%, #000 68%, transparent 69%);
  mask-image: radial-gradient(circle, transparent 34%, #000 35%, #000 68%, transparent 69%);
}

/* Ghost display text (outline, like STRENGTH in reference) */
.ghost {
  color: transparent;
  -webkit-text-stroke: 1.5px rgb(255 255 255 / 0.38);
  user-select: none;
}
.ghost-ink { color: transparent; -webkit-text-stroke: 1.5px rgb(20 24 31 / 0.16); user-select: none; }

/* Diagonal cuts */
.cut-bottom { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - var(--cut))); }
.cut-bottom-r { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), 0 100%); }

/* ---------- Labels ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-weight: 600;
  font-size: var(--text-sm); letter-spacing: 0.14em; text-transform: uppercase;
}
.eyebrow .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; }
.eyebrow .num { color: var(--accent); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 14px 30px;
  font-family: var(--font-display); font-weight: 800; font-size: var(--text-sm);
  text-transform: uppercase; letter-spacing: 0.06em;
  border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease),
              background-color var(--fast) var(--ease), border-color var(--fast) var(--ease),
              color var(--fast) var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgb(0 0 0 / 0.35); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn .arr { transition: transform var(--fast) var(--ease); }
.btn:hover .arr { transform: translateX(4px); }

.btn-ink    { background: var(--ink); color: #fff; }
.btn-white  { background: #fff; color: var(--ink); }
.btn-blue   { background: var(--blue); color: #fff; }
.btn-ghost-w { background: transparent; color: #fff; border-color: rgb(255 255 255 / 0.55); }
.btn-ghost-w:hover { border-color: #fff; box-shadow: none; }
.btn-sm { min-height: 44px; padding: 10px 20px; }

/* Circular arrow button (reference) */
.btn-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  cursor: pointer; text-decoration: none;
  transition: transform var(--fast) var(--ease), border-color var(--fast) var(--ease),
              background-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.btn-circle:hover { transform: translateY(-2px); border-color: var(--ink); }
.btn-circle svg { transition: transform var(--fast) var(--ease); }
.btn-circle:hover svg { transform: translateX(3px); }

/* ---------- Top bar + header ---------- */
.topbar {
  background: var(--ink); color: rgb(255 255 255 / 0.72);
  font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: 0.1em;
  text-transform: uppercase;
}
.topbar .wrap { display: flex; justify-content: space-between; gap: var(--s2); padding-top: 7px; padding-bottom: 7px; }
.topbar .jp { color: rgb(255 255 255 / 0.45); }
@media (max-width: 640px) { .topbar .jp { display: none; } }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-bar { max-width: var(--container); margin: 0 auto; padding: 0 var(--s3); display: flex; align-items: center; gap: var(--s3); min-height: 72px; }

.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; flex: none; }
.logo-img { display: block; height: 42px; width: auto; }
@media (max-width: 480px) { .logo-img { height: 34px; } }
.logo-mark { display: block; flex: none; }
.logo-word { display: flex; flex-direction: column; line-height: 1; }
.logo-word .l1 { font-family: var(--font-display); font-weight: 900; font-size: 1.25rem; letter-spacing: -0.01em; }
.logo-word .l1 .x { color: var(--accent); }
.logo-word .l2 { font-family: var(--font-mono); font-weight: 600; font-size: 0.6875rem; letter-spacing: 0.32em; color: var(--muted); margin-top: 4px; text-transform: uppercase; }

.main-nav { display: flex; align-items: center; gap: 4px; margin-left: var(--s2); }
.main-nav a {
  position: relative; padding: 10px 14px;
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm);
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); text-decoration: none; border-radius: var(--radius);
  transition: color var(--fast) var(--ease);
}
.main-nav a:hover { color: var(--ink); }
.main-nav a[aria-current="page"] { color: var(--blue); }
.main-nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 3px; background: var(--blue);
}

.header-tools { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.vault-chip {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-weight: 600; font-size: var(--text-sm);
  color: var(--muted); text-decoration: none;
  border: 1px solid var(--line); background: var(--paper);
  padding: 9px 16px; border-radius: var(--radius);
  transition: border-color var(--fast) var(--ease);
}
.vault-chip:hover { border-color: var(--ink); }
.vault-chip b { color: var(--blue); font-weight: 600; }
.profile-chip {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--blue); color: #fff; text-decoration: none;
  font-family: var(--font-display); font-weight: 800; font-size: var(--text-sm);
  border: 1px solid transparent;
  transition: transform var(--fast) var(--ease);
}
.profile-chip:hover { transform: translateY(-1px); }
.profile-chip.empty { background: var(--surface); color: var(--muted); border-color: var(--line); }

.nav-toggle {
  display: none; width: 44px; height: 44px; padding: 0;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; align-items: center; justify-content: center; color: var(--ink);
}
@media (max-width: 960px) {
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: var(--s1) var(--s3) var(--s2);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px 12px; font-size: var(--text-base); }
  .main-nav a[aria-current="page"]::after { left: 12px; right: auto; width: 28px; bottom: 8px; }
  .nav-toggle { display: inline-flex; }
  .vault-chip { display: none; }
}

/* ---------- HERO (home) ---------- */
.hero {
  position: relative; background: var(--blue); color: #fff; overflow: hidden;
}
.hero-canvas { position: absolute; inset: 0; pointer-events: none; opacity: 0.55; }
.hero-inner {
  position: relative; z-index: 2;
  max-width: var(--container); margin: 0 auto;
  padding: var(--s7) var(--s3) calc(var(--s7) + var(--cut));
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: var(--s5); align-items: center;
}
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; padding-top: var(--s6); } }

.hero-title { font-size: var(--text-4xl); }
.hero-title .row { display: block; }
.hero-title .ghost { display: block; }
.hero-lead { margin-top: var(--s3); max-width: 52ch; font-size: var(--text-lg); line-height: 1.65; color: rgb(255 255 255 / 0.88); }
.hero-cta { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s4); flex-wrap: wrap; }

.hero-stage { position: relative; display: grid; place-items: center; min-height: 320px; }
.hero-stage .burst { width: 120%; aspect-ratio: 1; }
.hero-3d {
  position: relative; z-index: 1; display: block;
  width: 100%; height: clamp(360px, 44vw, 600px);
  border: 0; background: transparent;
}
.hero-hint {
  position: absolute; z-index: 1; bottom: 0; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: 0.12em;
  text-transform: uppercase; color: rgb(255 255 255 / 0.6); white-space: nowrap;
}
@media (max-width: 900px) {
  .hero-stage { min-height: 0; }
  .hero-3d { height: 380px; }
}

/* Vertical JP deco (reference nod) */
.jp-vert {
  position: absolute; z-index: 2; top: var(--s6); right: var(--s3);
  writing-mode: vertical-rl; font-family: var(--font-mono); font-size: var(--text-sm);
  letter-spacing: 0.42em; color: rgb(255 255 255 / 0.5); text-transform: none;
}
@media (max-width: 1100px) { .jp-vert { display: none; } }

/* Info ticker (reference INFORMATION bar) */
.ticker { position: relative; z-index: 3; margin-top: calc(-1 * (var(--cut) + 34px)); padding-bottom: var(--s5); }
.ticker-bar {
  display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 13px 24px; box-shadow: 0 16px 40px -20px rgb(0 0 0 / 0.25);
  font-family: var(--font-mono); font-size: var(--text-sm);
}
.ticker-bar .tag {
  font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--blue);
  display: inline-flex; align-items: center; gap: 8px;
}
.ticker-bar .tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ticker-bar .sep { color: var(--line); }
.ticker-bar .txt { color: var(--muted); }

/* ---------- Stats band ---------- */
.stat-band { background: var(--surface); border-block: 1px solid var(--line); }
.stat-grid { max-width: var(--container); margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); }
.stat-cell { padding: var(--s4) var(--s2); text-align: center; border-left: 1px solid var(--line); }
.stat-cell:first-child { border-left: 0; }
.stat-cell .n {
  font-family: var(--font-display); font-weight: 900; font-size: var(--text-3xl); line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-cell .l { margin-top: 10px; font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 720px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-cell:nth-child(3) { border-left: 0; }
  .stat-cell:nth-child(n+3) { border-top: 1px solid var(--line); }
}

/* ---------- Sections ---------- */
.section { position: relative; padding: var(--s7) 0; }
.section-blue { background: var(--blue); color: #fff; }
.section-ink { background: var(--ink); color: #fff; }

.sec-head { max-width: 760px; }
.sec-head h2 { margin-top: var(--s2); font-size: var(--text-3xl); }
.sec-head p { margin-top: var(--s2); color: var(--muted); max-width: 62ch; }
.section-blue .sec-head p { color: rgb(255 255 255 / 0.85); }

/* Numbered feature (reference 01/02 blocks) */
.feature { position: relative; padding: var(--s7) 0; overflow: hidden; }
.feature .big-ghost {
  position: absolute; top: 8px; left: 0; right: 0; z-index: 0;
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(4rem, 14vw, 11rem); line-height: 1; white-space: nowrap;
  text-align: center; pointer-events: none;
}
.feature-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s6); align-items: center;
  padding-top: clamp(2rem, 6vw, 4.5rem);
}
@media (max-width: 900px) { .feature-grid { grid-template-columns: 1fr; gap: var(--s4); } }
.feature h3 { font-size: var(--text-2xl); margin-top: var(--s2); }
.feature .body { margin-top: var(--s2); max-width: 52ch; line-height: 1.7; }
.feature .go { display: inline-flex; align-items: center; gap: var(--s2); margin-top: var(--s4); text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.08em; }
.feature .go:hover .btn-circle { transform: translateY(-2px); border-color: currentColor; }

/* Media panels inside features */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s3); box-shadow: 0 24px 48px -28px rgb(0 0 0 / 0.28);
  color: var(--ink);
}
.panel-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: var(--s2);
  font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.panel-head::before { content: ""; width: 10px; height: 10px; background: var(--blue); }

/* ---------- Bar chart ---------- */
.bar-chart { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 44px minmax(96px, 132px) 1fr 44px; align-items: center; gap: 12px; }
.bar-row.no-thumb { grid-template-columns: minmax(96px, 132px) 1fr 44px; }
.bar-row .thumb { width: 44px; height: 44px; object-fit: contain; }
.bar-row .name { font-weight: 600; font-size: var(--text-sm); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .track { display: block; height: 12px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.bar-row .fill { display: block; height: 100%; background: var(--blue); transform-origin: left; transform: scaleX(0); transition: transform 700ms var(--ease); }
.bar-row.is-visible .fill { transform: scaleX(1); }
.bar-row .val { font-family: var(--font-mono); font-weight: 600; font-size: var(--text-sm); color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .bar-row { grid-template-columns: 36px minmax(80px, 100px) 1fr 40px; } .bar-row .thumb { width: 36px; height: 36px; } }

/* ---------- Roster strip (blade showcase) ---------- */
.roster { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
@media (max-width: 900px) { .roster { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .roster { grid-template-columns: 1fr; } }
.roster-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s3); display: flex; align-items: center; gap: var(--s2);
  transition: transform var(--base) var(--ease), box-shadow var(--base) var(--ease), border-color var(--base) var(--ease);
}
.roster-card:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: 0 14px 32px -16px rgb(0 0 0 / 0.25); }
.roster-card img { width: 88px; height: 88px; object-fit: contain; flex: none; transition: transform var(--base) var(--ease); }
.roster-card:hover img { transform: rotate(8deg) scale(1.04); }
.roster-card .meta { min-width: 0; }
.roster-card .nm { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: var(--text-base); line-height: 1.15; }
.roster-card .sub { margin-top: 6px; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted); }
.roster-card .score { margin-left: auto; text-align: right; flex: none; }
.roster-card .score b { display: block; font-family: var(--font-display); font-weight: 900; font-size: var(--text-xl); font-variant-numeric: tabular-nums; }
.roster-card .score span { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; }

/* ---------- Chips ---------- */
.tier-chip {
  display: inline-flex; align-items: center;
  font-family: var(--font-mono); font-weight: 600; font-size: var(--text-sm);
  padding: 2px 10px; letter-spacing: 0.06em;
  border: 1px solid var(--ink); color: var(--ink); background: var(--surface);
}
.tier-chip.t-s { background: var(--accent); border-color: var(--accent); color: #fff; }
.tier-chip.t-a { background: var(--blue); border-color: var(--blue); color: #fff; }
.tier-chip.t-b { background: var(--ink); color: #fff; }
.tier-chip.t-c { background: var(--surface); border-color: var(--line); color: var(--muted); }

.cat-chip { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.cat-chip .dot { width: 8px; height: 8px; flex: none; }

.flag {
  position: absolute; top: 0; right: 0;
  font-family: var(--font-mono); font-weight: 600; font-size: 0.75rem; letter-spacing: 0.1em;
  padding: 5px 12px; text-transform: uppercase;
}
.flag.ok { background: var(--ok); color: #fff; }
.flag.one { background: var(--warn); color: #fff; }

/* ---------- Combo cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s3); }
@media (max-width: 480px) { .card-grid { grid-template-columns: 1fr; } }

.combo-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s3); display: flex; flex-direction: column; gap: 14px;
  transition: transform var(--base) var(--ease), box-shadow var(--base) var(--ease), border-color var(--base) var(--ease);
}
.combo-card:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: 0 14px 32px -16px rgb(0 0 0 / 0.22); }
.combo-head { display: flex; align-items: flex-start; gap: var(--s2); }
.combo-head .thumb { width: 64px; height: 64px; object-fit: contain; flex: none; }
.combo-head .rank { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted); }
.combo-title { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: var(--text-lg); line-height: 1.1; }
.combo-sub { margin-top: 6px; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted); }
.combo-score { margin-left: auto; text-align: right; flex: none; }
.combo-score b { display: block; font-family: var(--font-display); font-weight: 900; font-size: var(--text-2xl); line-height: 1; font-variant-numeric: tabular-nums; color: var(--blue); }
.combo-score span { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em; color: var(--muted); text-transform: uppercase; }
.chip-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.note { font-size: var(--text-sm); line-height: 1.6; color: var(--muted); }
.note b { color: var(--ink); }
.note .up { color: var(--ok); font-family: var(--font-mono); }
.note .down { color: var(--accent); font-family: var(--font-mono); }
.src-line { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted); }
.concept { font-size: var(--text-sm); font-weight: 600; color: var(--ink); }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { position: relative; background: var(--blue); color: #fff; overflow: hidden; }
.page-hero .wrap { position: relative; z-index: 1; padding-top: var(--s6); padding-bottom: calc(var(--s6) + var(--cut)); }
.page-hero h1 { margin-top: var(--s2); font-size: clamp(2.5rem, 6vw, 4.5rem); }
.page-hero .lead { margin-top: var(--s2); max-width: 60ch; color: rgb(255 255 255 / 0.88); font-size: var(--text-lg); }
.page-hero .eyebrow { color: rgb(255 255 255 / 0.85); }
.page-hero .page-ghost {
  position: absolute; right: 0; bottom: calc(var(--cut) - 24px); z-index: 0;
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase;
  font-size: clamp(4rem, 12vw, 9rem); line-height: 1; white-space: nowrap; pointer-events: none;
}
.page-body { padding: var(--s6) 0 var(--s7); }
.page-body.tight { padding-top: 0; }
.pull-up { position: relative; z-index: 2; margin-top: calc(-1 * var(--cut) - var(--s4)); }

/* ---------- KPI ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
@media (max-width: 720px) { .kpi-row { grid-template-columns: 1fr 1fr; } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); box-shadow: 0 16px 36px -24px rgb(0 0 0 / 0.25); }
.kpi .n { font-family: var(--font-display); font-weight: 900; font-size: var(--text-2xl); line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .l { margin-top: 8px; font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* ---------- Controls ---------- */
.controls { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin: var(--s4) 0; }
.search-box { position: relative; flex: 1; min-width: 240px; }
.search-box input {
  width: 100%; min-height: 52px; padding: 12px 18px 12px 48px;
  font-family: var(--font-body); font-size: var(--text-base); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.search-box input:focus { outline: none; border-color: var(--blue); }
.search-box svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.count-note { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted); }

.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-chip {
  min-height: 44px; padding: 10px 18px;
  font-family: var(--font-body); font-weight: 500; font-size: var(--text-sm); color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.filter-chip:hover { color: var(--ink); border-color: var(--ink); }
.filter-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 4px; gap: 4px; }
.seg button {
  min-height: 44px; padding: 8px 22px; border: 0; background: transparent; border-radius: 4px;
  font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); cursor: pointer;
  transition: color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.seg button[aria-pressed="true"] { background: var(--blue); color: #fff; }

/* ---------- Tier blocks ---------- */
.tier-block { margin-top: var(--s6); }
.tier-block-head { display: flex; align-items: center; gap: var(--s2); padding-bottom: var(--s2); border-bottom: 2px solid var(--ink); margin-bottom: var(--s3); }
.tier-block-head .tier-chip { font-size: var(--text-base); padding: 4px 14px; }
.tier-block-head h3 { font-size: var(--text-xl); }
.tier-block-head .count-note { margin-left: auto; }

/* ---------- Collection ---------- */
.profile-card {
  display: grid; grid-template-columns: auto 1fr; gap: var(--s3); align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3);
  box-shadow: 0 16px 36px -24px rgb(0 0 0 / 0.25);
}
@media (max-width: 640px) { .profile-card { grid-template-columns: 1fr; } }
.avatar { width: 76px; height: 76px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 900; font-size: var(--text-xl); }
.profile-form { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-mono); font-size: var(--text-sm); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.field input, .field select {
  min-height: 48px; padding: 10px 14px; font-family: var(--font-body); font-size: var(--text-base);
  color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--blue); }

.col-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); margin-top: var(--s4); }
@media (max-width: 900px) { .col-grid { grid-template-columns: 1fr; } }
.part-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); }
.part-box-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: var(--s2); }
.part-box-head h3 { font-size: var(--text-lg); display: inline-flex; align-items: center; gap: 10px; }
.part-box-head .swatch { width: 12px; height: 12px; flex: none; }
.part-box-head .count-note { margin-left: auto; }
.part-search {
  width: 100%; min-height: 46px; padding: 10px 14px; margin-bottom: var(--s2);
  font-family: var(--font-body); font-size: var(--text-sm); color: var(--ink);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
}
.part-search:focus { outline: none; border-color: var(--blue); }
.part-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.part-chip {
  min-height: 40px; padding: 8px 16px;
  font-size: var(--text-sm); font-weight: 500; color: var(--muted);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease), background-color var(--fast) var(--ease);
}
.part-chip:hover { color: var(--ink); border-color: var(--ink); }
.part-chip[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }

/* ---------- Shop ---------- */
.unlock-card { display: flex; gap: var(--s2); }
.unlock-n { flex: none; min-width: 72px; font-family: var(--font-display); font-weight: 900; font-size: var(--text-3xl); line-height: 1; color: var(--blue); font-variant-numeric: tabular-nums; }
.unlock-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.part-type { align-self: flex-start; font-family: var(--font-mono); font-size: var(--text-sm); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 3px 10px; }
.product-line { font-family: var(--font-mono); font-size: var(--text-sm); line-height: 1.7; background: var(--paper); border: 1px solid var(--line); padding: 12px 14px; }
.product-line b { color: var(--blue); }

/* ---------- Empty state ---------- */
.empty-state {
  grid-column: 1 / -1; border: 1px dashed var(--line); border-radius: var(--radius);
  padding: var(--s6) var(--s3); text-align: center; color: var(--muted); background: var(--surface);
}
.empty-state strong { color: var(--ink); }
.empty-state .btn { margin-top: var(--s3); }

/* ---------- CTA section ---------- */
.cta-section { position: relative; background: var(--blue); color: #fff; overflow: hidden; }
.cta-inner { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; text-align: center; padding: var(--s8) var(--s3); }
.cta-inner h2 { font-size: var(--text-4xl); }
.cta-inner p { margin: var(--s3) auto 0; max-width: 48ch; color: rgb(255 255 255 / 0.88); font-size: var(--text-lg); }
.cta-inner .hero-cta { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: rgb(255 255 255 / 0.64); }
.footer-mark { border-bottom: 1px solid rgb(255 255 255 / 0.12); overflow: hidden; }
.footer-mark .word {
  font-family: var(--font-display); font-weight: 900; text-transform: uppercase; line-height: 0.9;
  font-size: clamp(3.5rem, 12vw, 9rem); color: transparent; -webkit-text-stroke: 1.5px rgb(255 255 255 / 0.24);
  white-space: nowrap; text-align: center; transform: translateY(0.12em);
}
.footer-inner { max-width: var(--container); margin: 0 auto; padding: var(--s6) var(--s3) var(--s4); }
.footer-top { display: flex; justify-content: space-between; gap: var(--s5); flex-wrap: wrap; }
.footer-logo { display: block; height: 40px; width: auto; }
.footer-brand p { margin-top: var(--s3); font-size: var(--text-sm); max-width: 38ch; line-height: 1.7; }
.footer-nav { display: flex; gap: var(--s6); flex-wrap: wrap; }
.footer-nav h3 { font-family: var(--font-mono); font-weight: 600; font-size: var(--text-sm); letter-spacing: 0.14em; text-transform: uppercase; color: #fff; margin-bottom: var(--s2); }
.footer-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-nav a { color: rgb(255 255 255 / 0.64); text-decoration: none; font-size: var(--text-sm); transition: color var(--fast) var(--ease); }
.footer-nav a:hover { color: #fff; }
.footer-legal { margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid rgb(255 255 255 / 0.12); font-family: var(--font-mono); font-size: var(--text-sm); line-height: 1.8; color: rgb(255 255 255 / 0.45); }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 600ms var(--ease), transform 600ms var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--muted); border-radius: 5px; }
::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .bar-row .fill { transform: scaleX(1); }
}

/* ---------- Auth (sign-in modal + account menu) ---------- */
.profile-chip.is-signin {
  width: auto; height: 44px; border-radius: var(--radius);
  padding: 0 18px; background: var(--ink); color: #fff; border-color: var(--ink);
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.04em; font-size: var(--text-sm);
}
.profile-chip.is-signin:hover { transform: translateY(-1px); }

.auth-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: var(--s3);
  background: rgb(20 24 31 / 0.55);
}
.auth-modal[hidden] { display: none; }
.auth-box {
  position: relative; width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: var(--s5) var(--s4) var(--s4); box-shadow: 0 30px 60px -24px rgb(0 0 0 / 0.5);
}
.auth-close {
  position: absolute; top: 12px; right: 14px; width: 32px; height: 32px;
  border: 0; background: none; font-size: 24px; line-height: 1; color: var(--muted);
  cursor: pointer; border-radius: var(--radius);
}
.auth-close:hover { color: var(--ink); }
.auth-title { font-size: var(--text-2xl); }
.auth-sub { margin-top: 8px; color: var(--muted); font-size: var(--text-sm); }
.auth-provider { width: 100%; margin-top: var(--s4); }
.auth-or { display: flex; align-items: center; gap: 12px; margin: var(--s3) 0; color: var(--muted); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-or span { font-family: var(--font-mono); font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.1em; }
.auth-email { display: flex; flex-direction: column; gap: 10px; }
.auth-email input {
  min-height: 48px; padding: 12px 16px; font-family: var(--font-body); font-size: var(--text-base);
  color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
}
.auth-email input:focus { outline: none; border-color: var(--blue); }
.auth-email .btn { width: 100%; }
.auth-msg { margin-top: 12px; font-size: var(--text-sm); color: var(--muted); min-height: 1.2em; text-align: center; }

.auth-menu {
  position: fixed; z-index: 200; min-width: 200px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 20px 40px -18px rgb(0 0 0 / 0.35); padding: 8px; display: flex; flex-direction: column; gap: 2px;
}
.auth-menu[hidden] { display: none; }
.auth-menu-email {
  padding: 8px 10px; font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.auth-menu-link, .auth-signout {
  display: block; width: 100%; text-align: left; padding: 10px; border: 0; background: none;
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: 500; color: var(--ink);
  text-decoration: none; border-radius: 6px; cursor: pointer;
}
.auth-menu-link:hover, .auth-signout:hover { background: var(--paper); }
.auth-signout { color: var(--accent); }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
  display: flex; align-items: center; justify-content: center; gap: var(--s3); flex-wrap: wrap;
  background: var(--surface); border-top: 2px solid var(--ink);
  padding: 14px var(--s4); box-shadow: 0 -8px 24px -16px rgb(0 0 0 / 0.3);
}
.cookie-text { font-size: var(--text-sm); line-height: 1.5; color: var(--ink); max-width: 72ch; }
.cookie-text a { color: var(--blue); }
.cookie-banner .cookie-ok { flex: none; }
@media (max-width: 560px) { .cookie-banner { justify-content: flex-start; } }

/* ---------- Legal pages (privacy) ---------- */
.legal { max-width: 760px; }
.legal h2 { font-size: var(--text-xl); margin-top: var(--s6); }
.legal h2:first-of-type { margin-top: 0; }
.legal p { margin-top: var(--s3); font-size: var(--text-base); line-height: 1.7; }
.legal ul { margin-top: var(--s3); padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; }
.legal li { font-size: var(--text-base); line-height: 1.6; }
.legal a { color: var(--blue); }
.legal .updated { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--muted); }
.legal .note-box { margin-top: var(--s4); padding: var(--s3); border: 1px solid var(--line); border-left: 4px solid var(--blue); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
.footer-legal a { color: #fff; text-decoration: underline; }
