/* ============================================================
   Cart Source — Landing page (home.html)
   Tokens from Cart Source Website/DESIGN.md. Do not invent colors.
   ============================================================ */

:root {
  --red: #C8102E;             /* P-186C */
  --red-tint: #E4576E;        /* on-dark accent tint of P-186C — AA-passing on grey_900.
                                 NOT in DESIGN.md yet; proposed amendment pending Cristian. */
  --grey-50: #F6F7F9;
  --grey-100: #E1E4E8;
  --grey-200: #C4CAD2;
  --grey-400: #8A929D;
  --grey-600: #5C6470;
  --grey-800: #2E3540;
  --grey-900: #1A1F26;
  --white: #FFFFFF;
  --bone: #F6F7F9;

  --serif: 'EB Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --ease: cubic-bezier(0.2, 0, 0, 1);
}

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

html { scroll-behavior: auto; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--grey-900);
  background: var(--bone);
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--red); color: var(--white); padding: 8px 16px; z-index: 100;
}
.skip:focus { left: 0; }

/* ---------------- header ---------------- */

.site-head {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 48px;
  transition: background 400ms var(--ease), box-shadow 400ms var(--ease);
}
.site-head.on-light {
  background: rgba(246, 247, 249, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--grey-100);
}
.site-head .brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.site-head .brand img { height: 34px; width: auto; display: block; }
.site-head .brand span {
  font-family: var(--serif); font-weight: 600; font-size: 1.25rem;
  color: var(--grey-100); letter-spacing: 0.01em;
  transition: color 400ms var(--ease);
}
.site-head.on-light .brand span { color: var(--grey-900); }

.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a {
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.14em;
  text-transform: uppercase; text-decoration: none;
  color: var(--grey-200); transition: color 240ms var(--ease);
}
.site-head.on-light .site-nav a:not(.nav-cta) { color: var(--grey-600); }
.site-nav a:hover { color: var(--red); }
.site-nav .nav-cta {
  color: var(--white); background: var(--red);
  padding: 10px 18px; border-radius: 4px;
}
.site-nav .nav-cta:hover { color: var(--white); background: var(--grey-900); }

a:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px;
}

@media (max-width: 760px) {
  .site-head { padding: 14px 20px; }
  .site-nav a:not(.nav-cta) { display: none; }
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-block; text-decoration: none;
  font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.12em;
  text-transform: uppercase; border-radius: 4px;
  padding: 15px 28px; transition: all 240ms var(--ease);
}
.btn-red { background: var(--red); color: var(--white); }
.btn-red:hover { background: var(--grey-900); }
.btn-ghost { color: var(--grey-100); border: 1px solid var(--grey-600); }
.btn-ghost:hover { border-color: var(--red); color: var(--red); }
.btn-ghost.dark-on-light { color: var(--grey-900); border-color: var(--grey-200); }
.btn-ghost.dark-on-light:hover { border-color: var(--red); color: var(--red); }

/* ============================================================
   FOLD 1 — HERO ("Blueprint to Steel", pinned scrub)
   ============================================================ */

.hero { background: var(--grey-900); position: relative; }

.hero-stage {
  height: 100vh; height: 100svh;
  position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}

.hero-kicker {
  position: absolute; top: 96px; left: 50%; transform: translateX(-50%);
  color: var(--grey-400); white-space: nowrap;
}
.hero-kicker em { color: var(--red-tint); font-style: normal; }

.hero-title {
  font-weight: 600; text-align: center;
  font-size: clamp(3rem, 9.5vw, 8.25rem);
  line-height: 1.02; letter-spacing: -0.015em;
  color: var(--grey-50);
  position: relative; z-index: 3;
}
.hero-title .line { display: block; }
.hero-title .line em { font-style: italic; color: var(--grey-200); font-size: 0.94em; }

.hero-sub {
  position: relative; z-index: 3;
  margin-top: 28px; max-width: 560px; text-align: center;
  color: var(--grey-400); font-size: 1.125rem; line-height: 1.55;
}

/* the SVG cart sits behind/below the headline, revealed by scroll */
.cart-fig {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 2; pointer-events: none;
}
.cart-fig svg {
  width: min(78vw, 1080px); height: auto;
  overflow: visible;
}

/* stroke roles inside the SVG */
.s-body   { stroke: var(--grey-100); }
.s-plastic{ stroke: var(--grey-400); }
.s-hard   { stroke: var(--grey-200); }
.s-atb    { stroke: var(--red); }
.cart-line { fill: none; stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.cart-line.thick { stroke-width: 5; }
.cart-grid { stroke: var(--grey-600); stroke-width: 1; opacity: 0.55; }

.co-label {
  font-family: var(--mono); font-size: 15px; letter-spacing: 0.16em;
  fill: var(--grey-200);
}
.co-label.red { fill: var(--red-tint); }
.co-sub { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; fill: var(--grey-400); }
.co-line { stroke: var(--grey-600); stroke-width: 1; fill: none; }
.dim-line { stroke: var(--grey-600); stroke-width: 1; fill: none; }
.dim-text { font-family: var(--mono); font-size: 14px; letter-spacing: 0.12em; fill: var(--grey-400); }

.hero-ctas {
  position: absolute; bottom: 88px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 16px; z-index: 4;
}

/* beat rail — right edge */
.hero-rail {
  position: absolute; right: 44px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 22px; z-index: 4;
}
.hero-rail span {
  color: var(--grey-400); font-family: var(--mono); font-size: 0.66rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  border-left: 2px solid var(--grey-800); padding-left: 12px;
  transition: color 300ms var(--ease), border-color 300ms var(--ease);
}
.hero-rail span.active { color: var(--grey-100); border-color: var(--red); }

.scroll-cue {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  color: var(--grey-400); z-index: 4;
}

@media (max-width: 760px) {
  .hero-kicker { top: 76px; font-size: 0.62rem; }
  .hero-rail { display: none; }
  .hero-ctas { bottom: 64px; flex-direction: column; align-items: center; }
  .cart-fig svg { width: 96vw; }
}

/* ============================================================
   FOLD 2 — MANIFESTO (SplitText line masks)
   ============================================================ */

.manifesto { background: var(--bone); padding: 180px 8vw 150px; }
.manifesto .mono { color: var(--red); margin-bottom: 36px; }
.manifesto h2 {
  font-weight: 600; font-size: clamp(2.2rem, 5.4vw, 4.6rem);
  line-height: 1.12; letter-spacing: -0.01em; color: var(--grey-900);
  max-width: 18ch;
}
.manifesto p {
  margin-top: 44px; max-width: 58ch;
  font-size: 1.25rem; line-height: 1.65; color: var(--grey-600);
}
.manifesto .pillars {
  margin-top: 72px; display: grid; gap: 0;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  border-top: 1px solid var(--grey-100); list-style: none;
}
.manifesto .pillars li {
  padding: 28px 28px 28px 0; border-bottom: 1px solid var(--grey-100);
}
.manifesto .pillars .mono { color: var(--grey-400); margin-bottom: 10px; }
.manifesto .pillars strong { font-weight: 600; font-size: 1.15rem; color: var(--grey-900); display: block; }

/* ============================================================
   FOLD 3 — ROSTER (editorial index list)
   ============================================================ */

.roster { background: var(--white); padding: 150px 8vw; }
.roster .head-row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 56px; gap: 24px; flex-wrap: wrap;
}
.roster h2 { font-weight: 600; font-size: clamp(2rem, 4.4vw, 3.4rem); letter-spacing: -0.01em; }
.roster .head-row .mono { color: var(--grey-400); }

.roster .group-label { color: var(--grey-400); margin: 48px 0 8px; }
.roster ol { list-style: none; border-top: 1px solid var(--grey-100); }
.roster li a {
  display: grid; grid-template-columns: 64px 1fr auto auto; gap: 24px;
  align-items: baseline; text-decoration: none;
  padding: 20px 8px; border-bottom: 1px solid var(--grey-100);
  transition: background 240ms var(--ease);
}
.roster li a:hover { background: var(--grey-50); }
.roster .idx { font-family: var(--mono); font-size: 0.72rem; color: var(--grey-400); }
.roster .name { font-weight: 600; font-size: 1.35rem; color: var(--grey-900); transition: color 240ms var(--ease); }
.roster li a:hover .name { color: var(--red); }
.roster .cap { font-family: var(--mono); font-size: 0.72rem; color: var(--grey-600); letter-spacing: 0.08em; font-variant-numeric: tabular-nums; text-align: right; min-width: 130px; }
.roster .go { font-family: var(--mono); font-size: 0.72rem; color: var(--grey-400); transition: color 240ms var(--ease), transform 240ms var(--ease); }
.roster li a:hover .go { color: var(--red); transform: translateX(6px); }

@media (max-width: 760px) {
  .roster li a { grid-template-columns: 40px 1fr; }
  .roster .cap, .roster .go { display: none; }
}

/* ============================================================
   FOLD 4 — NUMBERS (scroll-scrubbed)
   ============================================================ */

.numbers { background: var(--bone); }
.numbers-stage {
  min-height: 100vh; display: flex; flex-direction: column; justify-content: center;
  padding: 0 8vw;
}
.numbers .mono { color: var(--red); margin-bottom: 48px; }
.numbers-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 48px 64px;
}
.num { border-top: 2px solid var(--grey-900); padding-top: 24px; }
.num .figure {
  font-weight: 600; font-size: clamp(3.4rem, 7vw, 6.2rem);
  line-height: 1; letter-spacing: -0.02em; color: var(--grey-900);
  font-variant-numeric: tabular-nums;
}
.num .figure sup { font-size: 0.4em; color: var(--red); font-weight: 500; }
.num .figure sup.word { font-size: 0.22em; letter-spacing: 0.04em; }
.num .caption { margin-top: 14px; color: var(--grey-600); font-size: 1rem; line-height: 1.5; max-width: 30ch; }

/* ============================================================
   FOLD 5 — ATB (dark band, clip-path wipe)
   ============================================================ */

.atb { background: var(--bone); }
.atb-band {
  background: var(--grey-900); color: var(--white);
  padding: 150px 8vw;
  clip-path: inset(0 0 0 0);
}
.atb-band .mono { color: var(--red-tint); margin-bottom: 32px; }
.atb-band h2 {
  font-weight: 600; font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.1; letter-spacing: -0.01em; max-width: 20ch;
}
.atb-band h2 em { font-style: italic; color: var(--grey-200); }
.atb-band p { margin-top: 36px; max-width: 52ch; font-size: 1.2rem; line-height: 1.6; color: var(--grey-200); }
.atb-band .atb-rule { margin-top: 56px; height: 2px; background: var(--red); width: 96px; }

/* ============================================================
   FOLD 6 — 3D TEASER (lazy Three.js)
   ============================================================ */

.teaser { background: var(--white); padding: 150px 8vw; }
.teaser .wrap {
  display: grid; grid-template-columns: minmax(280px, 5fr) minmax(320px, 6fr);
  gap: 64px; align-items: center;
}
.teaser h2 { font-weight: 600; font-size: clamp(2rem, 4.4vw, 3.6rem); line-height: 1.1; letter-spacing: -0.01em; }
.teaser .mono { color: var(--red); margin-bottom: 28px; }
.teaser p { margin-top: 28px; color: var(--grey-600); font-size: 1.15rem; max-width: 46ch; }
.teaser .cta-row { margin-top: 40px; display: flex; gap: 16px; flex-wrap: wrap; }

.viewer {
  aspect-ratio: 4 / 3; position: relative;
  background: var(--grey-50); border: 1px solid var(--grey-100); border-radius: 12px;
  overflow: hidden;
}
.viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.viewer .viewer-note {
  position: absolute; bottom: 14px; left: 18px;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--grey-600);
}
.viewer img.poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 900px) { .teaser .wrap { grid-template-columns: 1fr; } }

/* ============================================================
   FOOTER
   ============================================================ */

.site-foot { background: var(--grey-900); color: var(--grey-200); padding: 96px 8vw 56px; }
.site-foot .top {
  display: grid; grid-template-columns: minmax(280px, 1.5fr) auto; gap: 48px;
  align-items: start;
  padding-bottom: 64px; border-bottom: 1px solid var(--grey-800);
}
.site-foot .brandline { max-width: 44ch; font-size: 1.05rem; line-height: 1.6; }
.site-foot .brandline img { height: 40px; margin-bottom: 20px; display: block; }
.site-foot .cols { display: flex; gap: 72px; flex-wrap: wrap; }
.site-foot .cols { justify-self: end; }
.site-foot .cols .mono { color: var(--grey-400); margin-bottom: 16px; }
.site-foot .cols ul { list-style: none; }
.site-foot .cols li { margin-bottom: 10px; }
.site-foot a { color: var(--grey-200); text-decoration: none; transition: color 240ms var(--ease); }
.site-foot a:hover { color: var(--red); }
.site-foot .bottom {
  padding-top: 28px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--grey-400);
}

/* ============================================================
   Motion plumbing + reduced motion
   ============================================================ */

/* JS sets .js-motion on <html> only when GSAP is live AND
   prefers-reduced-motion is off. All "hidden until animated" initial
   states hang off that class, so content is never gated. */

.js-motion .cart-callouts, .js-motion .cart-dims { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Static hero layout when motion is off (reduced-motion or GSAP absent):
   dignified single composition — headline above, finished cart below. */
.no-motion .hero-stage {
  height: auto; min-height: 100vh;
  padding: 170px 0 90px;
  justify-content: flex-start;
}
.no-motion .hero-kicker { position: static; transform: none; margin-bottom: 40px; }
.no-motion .cart-fig { position: static; margin-top: 48px; }
.no-motion .cart-fig svg { width: min(58vw, 780px); }
.no-motion .hero-ctas { position: static; transform: none; margin-top: 44px; }
.no-motion .hero-rail, .no-motion .scroll-cue,
.no-motion .cart-callouts, .no-motion .cart-dims { display: none; }
