/* ============================================================
   True Self OS — visual system
   Aligned to the product's Modern + Light baseline:
   warm paper surfaces, ember primary, 4-domain colour system,
   Space Grotesk display + Inter body, one calm motion rhythm.
   ============================================================ */

/* ---- Self-hosted fonts (work from file:// and http) ---- */
@font-face {
  font-family: "Space Grotesk";
  src: url("assets/fonts/space-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* surfaces / ink (warm paper) */
  --bg: #f7f3ea;
  --paper: #fffdf8;
  --paper-2: #f3ede2;
  --ink: #1c1a16;
  --muted: #5f5749;
  --faint: #8a8071;
  --line: rgba(40, 30, 18, .14);
  --line-strong: rgba(40, 30, 18, .26);
  --charcoal: #14120f;

  /* brand + 4-domain colour system (Work / Self / Family / Other) */
  --ember: #e25822;
  --ember-dark: #9f3415;
  --ember-soft: rgba(226, 88, 34, .12);
  --teal: #0d9488;
  --pink: #db2777;
  --violet: #7c3aed;
  --d-work: var(--ember);
  --d-self: var(--teal);
  --d-family: var(--pink);
  --d-other: var(--violet);

  /* type scale (tuned for Space Grotesk) */
  --step--1: clamp(.78rem, .74rem + .18vw, .875rem);
  --step-0:  clamp(1rem, .96rem + .2vw, 1.12rem);
  --step-1:  clamp(1.15rem, 1.04rem + .5vw, 1.45rem);
  --step-2:  clamp(1.3rem, 1.12rem + .9vw, 1.85rem);
  --step-3:  clamp(1.55rem, 1.25rem + 1.5vw, 2.3rem);
  --step-4:  clamp(1.9rem, 1.4rem + 2.6vw, 3.2rem);
  --step-5:  clamp(2.3rem, 1.55rem + 3.8vw, 4.5rem);  /* h2 */
  --step-6:  clamp(2.55rem, 1.7rem + 4.4vw, 5.5rem);  /* h1 */

  /* spacing rhythm (2/3/4/6/8/10/12/16/24 → fluid) */
  --space-2xs: .375rem;
  --space-xs: .625rem;
  --space-s: 1rem;
  --space-m: 1.5rem;
  --space-l: 2.5rem;
  --space-xl: 4rem;
  --scene-pad-block: clamp(3.5rem, 2rem + 7vw, 7rem);
  --scene-pad-inline: clamp(1.25rem, .4rem + 4.5vw, 5.5rem);
  --content-max: 1160px;

  /* radius + elevation */
  --r-sm: 8px;
  --radius: 11px;
  --r-lg: 16px;
  --pill: 999px;
  --shadow-1: 0 1px 2px rgba(40, 30, 18, .06), 0 8px 22px rgba(40, 30, 18, .07);
  --shadow-2: 0 14px 38px rgba(40, 30, 18, .14);
  --shadow-3: 0 30px 72px rgba(40, 30, 18, .22);

  /* motion (product constitution) */
  --ease: cubic-bezier(.33, 1, .68, 1);
  --t: .4s;

  /* fonts */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;

  /* subtle paper grain (inline SVG, no asset) */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");

  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
  background-image: var(--grain);
  background-size: 160px;
  opacity: .04;
  mix-blend-mode: multiply;
}
[data-grain="off"] body::after { display: none; }

button, input { font: inherit; color: inherit; }
img, svg, picture { display: block; max-width: 100%; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--t) var(--ease);
}
.skip-link:focus { transform: translateY(0); outline: 2px solid var(--ember); outline-offset: 2px; }

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------- progress bar (scaleX) ---------------- */
.progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 3px;
  z-index: 30;
  background: rgba(40, 30, 18, .1);
}
.progress span {
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--ember), #f0b55b, var(--teal));
}
html:not(.gsap) .progress span { transition: transform .12s linear; }

/* ---------------- section nav ---------------- */
.section-nav {
  position: fixed;
  right: clamp(14px, 2.4vw, 34px);
  top: 50%;
  z-index: 20;
  display: grid;
  gap: 14px;
  transform: translateY(-50%);
}
.nav-item {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.nav-dot {
  width: 12px; height: 12px;
  border-radius: var(--pill);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .6);
  transition: transform var(--t) var(--ease), background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.scene-dark ~ .section-nav .nav-dot { }
.nav-item[aria-current="true"] .nav-dot,
.nav-item.active .nav-dot {
  background: var(--ember);
  border-color: var(--ember);
  transform: scale(1.4);
}
.nav-label {
  position: absolute;
  right: 26px;
  top: 50%;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(8px, -50%);
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: rgba(255, 253, 248, .95);
  color: var(--ink);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: var(--shadow-1);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.nav-item:hover .nav-label,
.nav-item:focus-visible .nav-label,
.nav-item.active .nav-label { opacity: 1; transform: translate(0, -50%); }

/* ---------------- scenes ---------------- */
.scene {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  padding: var(--scene-pad-block) var(--scene-pad-inline);
  padding-inline: max(var(--scene-pad-inline), env(safe-area-inset-left)) max(var(--scene-pad-inline), env(safe-area-inset-right));
  overflow: hidden;
  isolation: isolate;
}
.scene::before {
  content: attr(data-label);
  position: absolute;
  left: clamp(18px, 4vw, 60px);
  bottom: clamp(14px, 3vw, 38px);
  z-index: -1;
  color: rgba(40, 30, 18, .04);
  font-family: var(--display);
  font-size: clamp(72px, 13vw, 200px);
  font-weight: 700;
  line-height: .8;
  letter-spacing: -.02em;
  text-transform: uppercase;
}
.scene-dark { background: var(--charcoal); color: #fffaf2; }
.scene-dark::before { color: rgba(255, 250, 242, .05); }

.scene-content {
  position: relative;
  z-index: 2;
  min-width: 0;
  width: min(var(--content-max), 100%);
  margin: 0 auto;
}
.narrow { width: min(760px, 100%); margin-left: 0; }

.scene-img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scale(1.12);
  will-change: transform;
}
.side-img { width: 58%; left: auto; opacity: .9; }

.shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(12, 10, 8, .9), rgba(12, 10, 8, .58) 46%, rgba(12, 10, 8, .12)),
    radial-gradient(circle at 72% 32%, rgba(226, 88, 34, .22), transparent 36%);
}
.shade.soft {
  background:
    linear-gradient(90deg, rgba(247, 243, 234, .97), rgba(247, 243, 234, .8) 48%, rgba(247, 243, 234, .24)),
    radial-gradient(circle at 74% 32%, rgba(226, 88, 34, .14), transparent 36%);
}

.hero-content, .outcome-content { max-width: 760px; margin-left: 0; }

.brand-lockup {
  --brand-mark-size: clamp(46px, 5vw, 58px);
  display: flex;
  align-items: center;
  gap: 11px;
  inline-size: fit-content;
  max-inline-size: 100%;
  margin: 0 0 clamp(14px, 2vw, 22px);
  padding: 6px 11px 6px 6px;
  border: 0;
  border-radius: 16px;
  background: rgba(20, 18, 15, .18);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .10);
}
.brand-mark {
  flex: 0 0 auto;
  inline-size: var(--brand-mark-size);
  block-size: var(--brand-mark-size);
  border-radius: 13px;
  object-fit: cover;
  background: var(--paper);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .16);
}
.brand-wordmark {
  min-width: 0;
  display: inline-flex;
  align-items: flex-end;
  gap: 7px;
  font-family: var(--display);
  line-height: .8;
  white-space: nowrap;
}
.brand-wordmark-main {
  color: #fffaf2;
  font-size: calc(var(--brand-mark-size) * 1.12);
  font-weight: 760;
}
.brand-wordmark-os {
  color: #ffb49b;
  font-size: clamp(.72rem, .66rem + .18vw, .82rem);
  font-weight: 850;
  line-height: 1;
  letter-spacing: .08em;
  margin-bottom: .02em;
  transform: none;
}

/* ---------------- typography ---------------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 var(--space-s);
  color: var(--ember-dark);
  font-size: var(--step--1);
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.scene-dark .kicker { color: #ffb49b; }
.kicker::before { content: ""; width: 30px; height: 2px; background: currentColor; }

h1, h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.02;
}
h1 { max-width: 18ch; font-size: var(--step-6); }
h2 { max-width: 20ch; font-size: var(--step-5); }

.hero-lines, h2 { overflow: visible; }
/* mask wrapper: clip room for descenders, pulled back so line spacing stays tight */
.line { display: block; overflow: hidden; padding-bottom: .18em; margin-bottom: -.12em; }
.line > span { display: block; }

.lead {
  max-width: 60ch;
  margin: var(--space-m) 0 0;
  color: rgba(255, 250, 242, .85);
  font-size: var(--step-1);
  line-height: 1.5;
}
.scene:not(.scene-dark) .lead { color: var(--muted); }

.body {
  max-width: 62ch;
  margin: var(--space-m) 0 0;
  color: var(--muted);
  font-size: var(--step-0);
  line-height: 1.65;
}
.scene-dark .body { color: rgba(255, 250, 242, .78); }
.onboarding .body { color: #443d33; }

/* ---------------- buttons ---------------- */
.hero-actions, .waitlist { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--space-l); }

.button, .waitlist button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border-radius: var(--r-sm);
  padding: 0 20px;
  font-weight: 700;
  text-decoration: none;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease),
              border-color var(--t) var(--ease), background var(--t) var(--ease);
}
.button.primary, .waitlist button {
  border: 1px solid var(--ember);
  background: var(--ember);
  color: #fff;
  box-shadow: 0 10px 30px rgba(226, 88, 34, .28);
}
.button.ghost {
  border: 1px solid rgba(255, 250, 242, .38);
  color: #fffaf2;
  background: rgba(255, 255, 255, .06);
}
.button.primary:hover, .waitlist button:hover { background: var(--ember-dark); border-color: var(--ember-dark); }
.button:hover, .button:focus-visible,
.waitlist button:hover, .waitlist button:focus-visible {
  transform: translateY(-2px);
}

.hero-proof { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--space-m); }
.hero-proof span {
  border: 1px solid rgba(255, 250, 242, .22);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, .07);
  color: rgba(255, 250, 242, .82);
  padding: 8px 13px;
  font-size: 12px;
  font-weight: 700;
}

.scroll-cue {
  position: absolute;
  left: clamp(20px, 6vw, 80px);
  bottom: 28px;
  z-index: 2;
  color: rgba(255, 250, 242, .62);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.scroll-cue::after {
  content: "";
  display: inline-block;
  width: 44px; height: 1px;
  margin-left: 10px;
  vertical-align: middle;
  background: currentColor;
  animation: cue 1.8s infinite;
}
@keyframes cue {
  0%, 100% { transform: scaleX(.35); transform-origin: left; opacity: .4; }
  50% { transform: scaleX(1); opacity: 1; }
}

/* ---------------- split layout ---------------- */
.split {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(340px, 1.1fr);
  gap: clamp(2rem, 5vw, 5.5rem);
  align-items: center;
}
.split.reversed { grid-template-columns: minmax(340px, .95fr) minmax(0, 1.05fr); }
.copy-block { min-width: 0; }

/* ---------------- principle stack ---------------- */
.principle-stack { display: grid; gap: 14px; }
.principle-stack article,
.feature-grid div,
.surface-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 253, 248, .92), rgba(255, 253, 248, .72));
  box-shadow: var(--shadow-1);
}
.principle-stack article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 18px;
  padding: 22px;
}
.principle-stack span {
  grid-row: span 2;
  color: var(--ember);
  font-family: var(--display);
  font-size: var(--step-3);
  font-weight: 700;
  line-height: .9;
}
.principle-stack h3, .principle-stack p { margin: 0; }
.principle-stack h3 { font-size: var(--step-1); font-weight: 700; }
.principle-stack p { color: var(--muted); line-height: 1.5; }

/* ---------------- system + diagram ---------------- */
.system {
  background:
    radial-gradient(circle at 18% 18%, rgba(226, 88, 34, .12), transparent 28%),
    radial-gradient(circle at 82% 74%, rgba(13, 148, 136, .12), transparent 30%),
    var(--paper-2);
}
.system-stage {
  display: grid;
  place-items: center;
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, rgba(255, 253, 248, .94), rgba(255, 253, 248, .6));
  box-shadow: var(--shadow-2);
}
.system-diagram { inline-size: min(520px, 100%); aspect-ratio: 1; margin-inline: auto; }
.sd-svg { width: 100%; height: 100%; }

.sd-link { stroke-dasharray: 240; stroke-dashoffset: 0; }
.sd-node circle {
  fill: var(--paper);
  stroke: var(--ember);
  stroke-width: 2.5;
}
.sd-node[data-accent="teal"] circle { stroke: var(--teal); }
.sd-node[data-accent="violet"] circle { stroke: var(--violet); }
.sd-node[data-accent="pink"] circle { stroke: var(--pink); }
.sd-node text {
  fill: var(--ink);
  font-family: var(--display);
  font-weight: 600;
  font-size: 21px;
  text-anchor: middle;
  letter-spacing: -.01em;
}
.sd-core-ring { stroke: rgba(226, 88, 34, .35); stroke-width: 1.5; }
.sd-core-text {
  fill: #fff;
  font-family: var(--display);
  font-weight: 700;
  font-size: 24px;
  text-anchor: middle;
  text-transform: uppercase;
  letter-spacing: .02em;
}

/* GSAP-controlled initial states (only when JS+GSAP active, below the fold → no flash) */
html.gsap .sd-link { stroke-dashoffset: 240; }
html.gsap .sd-node, html.gsap .sd-coreg { opacity: 0; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: var(--space-m);
}
.feature-grid div { padding: 18px; box-shadow: none; }
.feature-grid b, .feature-grid span { display: block; }
.feature-grid b { margin-bottom: 6px; font-size: var(--step-0); }
.feature-grid span { color: var(--muted); line-height: 1.5; font-size: var(--step--1); }

/* ---------------- onboarding ---------------- */
.onboarding-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 670px;
  margin: var(--space-m) 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.onboarding-steps li { display: contents; }
.onboarding-steps span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--pill);
  background: rgba(255, 253, 248, .8);
  color: var(--ink);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
}
.onboarding-steps span::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  color: var(--ember-dark);
  font-family: var(--display);
}

/* ---------------- flow loop ---------------- */
.flow-scene { background: #17130f; }
.flow-loop {
  position: relative;
  margin: var(--space-l) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: clamp(12px, 2vw, 26px);
  align-items: start;
}
.flow-loop::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset-block-start: 17px;
  inset-inline: 6%;
  height: 2px;
  background: linear-gradient(90deg, var(--ember), #f0b55b, var(--teal));
  transform: scaleX(var(--draw, 1));
  transform-origin: left center;
}
.flow-step {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
  padding-top: 50px;
}
.flow-step::before {
  content: "";
  position: absolute;
  inset-block-start: 5px;
  inset-inline-start: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--charcoal);
  border: 2px solid var(--ember);
  box-shadow: 0 0 0 5px rgba(226, 88, 34, .12);
}
.flow-num {
  color: var(--ember);
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--step-2);
}
.flow-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--step-2);
  color: #fffaf2;
}
.flow-desc { margin: 0; color: rgba(255, 250, 242, .74); line-height: 1.5; font-size: var(--step--1); }

/* ---------------- experience + execution rail ---------------- */
.experience {
  background: linear-gradient(180deg, rgba(255, 253, 248, .85), var(--paper-2));
}
.experience-intro { max-width: 820px; }

.exec-rail {
  margin: var(--space-l) 0 0;
  padding: clamp(16px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: linear-gradient(165deg, var(--charcoal), #1d1812);
  color: #fffaf2;
  box-shadow: var(--shadow-3);
}
.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: var(--space-s);
}
.rail-phase { font-size: var(--step--1); font-weight: 700; color: #fffaf2; }
.rail-phase em { color: rgba(255, 250, 242, .6); font-style: normal; font-weight: 600; }
.rail-clock { display: inline-flex; align-items: center; gap: 8px; }
.clock-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 0 rgba(13, 148, 136, .6);
  animation: pulse 1.4s ease-in-out infinite;
}
.clock-time {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: var(--step--1);
  color: rgba(255, 250, 242, .9);
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(13, 148, 136, .55); }
  70% { box-shadow: 0 0 0 7px rgba(13, 148, 136, 0); }
  100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0); }
}

.rail-track {
  display: flex;
  min-width: 0;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 250, 242, .25) transparent;
}
.rail-track::-webkit-scrollbar { height: 6px; }
.rail-track::-webkit-scrollbar-thumb { background: rgba(255, 250, 242, .22); border-radius: 999px; }

.rail-block {
  --ac: var(--d-other);
  flex: 0 0 auto;
  width: 148px;
  scroll-snap-align: start;
  display: grid;
  gap: 7px;
  padding: 12px 13px;
  border: 1px solid rgba(255, 250, 242, .12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .04);
}
.rail-block[data-domain="work"] { --ac: var(--d-work); }
.rail-block[data-domain="self"] { --ac: var(--d-self); }
.rail-block[data-domain="family"] { --ac: var(--d-family); }
.rail-block[data-domain="other"] { --ac: var(--d-other); }
.rail-block.is-active {
  border-color: color-mix(in oklab, var(--ember) 70%, transparent);
  box-shadow: 0 0 0 1px var(--ember), 0 12px 30px rgba(226, 88, 34, .22);
  background: rgba(226, 88, 34, .08);
}
.block-name { font-size: 13px; font-weight: 700; }
.block-time {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: rgba(255, 250, 242, .55);
}
.block-count { font-size: 11px; font-weight: 700; color: rgba(255, 250, 242, .7); justify-self: end; }
.block-bars { display: grid; gap: 4px; }
.bar {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 250, 242, .12);
  overflow: hidden;
}
.bar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-origin: left center;
  transform: scaleX(var(--p, 0));
}
.bar-time { --p: var(--p-time, 0); }
.bar-done { --p: var(--p-done, 0); }
.bar-time::after { background: linear-gradient(90deg, #f6a04a, var(--ember)); }
.bar-done::after { background: var(--teal); }
/* while animating, bars start empty and fill once the rail is in view */
html.is-animating .bar::after { transform: scaleX(0); transition: transform 1s var(--ease); }
html.is-animating .exec-rail.is-filled .bar::after { transform: scaleX(var(--p)); }
.rail-block.is-active .bar-time::after {
  background-image: linear-gradient(90deg, #f6a04a, var(--ember));
}
.rail-block.is-active .bar-time {
  background-image: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer {
  0% { background-position: -40% 0; }
  100% { background-position: 140% 0; }
}

.rail-sessions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.session-card {
  --ac: var(--d-work);
  position: relative;
  padding: 14px 14px 14px 18px;
  border: 1px solid rgba(255, 250, 242, .12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .04);
  overflow: hidden;
}
.session-card[data-domain="work"] { --ac: var(--d-work); }
.session-card[data-domain="self"] { --ac: var(--d-self); }
.session-card[data-domain="family"] { --ac: var(--d-family); }
.session-card[data-domain="other"] { --ac: var(--d-other); }
.session-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--ac);
}
.sc-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ac);
}
.sc-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ac); }
.sc-title { display: block; margin: 6px 0 10px; font-size: var(--step-0); line-height: 1.25; }
.sc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sc-status {
  border-radius: var(--pill);
  background: var(--ember-soft);
  border: 1px solid color-mix(in oklab, var(--ember) 50%, transparent);
  color: #ffb49b;
  padding: 4px 10px;
  font-size: 11px; font-weight: 700;
}
.sc-status.quiet { background: rgba(255, 250, 242, .08); border-color: rgba(255, 250, 242, .2); color: rgba(255, 250, 242, .75); }
.sc-meta { font-size: 11px; color: rgba(255, 250, 242, .55); }
.sc-progress {
  display: block;
  height: 4px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 250, 242, .12);
  position: relative;
  overflow: hidden;
}
.sc-progress::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  transform-origin: left; transform: scaleX(var(--p, 0));
  background: var(--ac);
}
html.is-animating .sc-progress::after { transform: scaleX(0); transition: transform 1s var(--ease); }
html.is-animating .exec-rail.is-filled .sc-progress::after { transform: scaleX(var(--p)); }

/* surface grid */
.surface-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: var(--space-l);
}
.surface-grid article {
  min-height: clamp(7rem, 12vw, 9rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  box-shadow: none;
  transition: transform var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.surface-grid article:hover {
  transform: translateY(-4px);
  border-color: color-mix(in oklab, var(--ember) 45%, var(--line));
  box-shadow: var(--shadow-2);
}
.surface-grid span {
  color: var(--ember-dark);
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.surface-grid b { font-size: var(--step-1); line-height: 1.12; font-family: var(--display); font-weight: 600; }

/* ---------------- waitlist ---------------- */
.waitlist { max-width: 560px; }
.waitlist input {
  flex: 1 1 260px;
  min-height: 50px;
  border: 1px solid rgba(255, 250, 242, .3);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .1);
  color: #fffaf2;
  padding: 0 16px;
  outline-offset: 2px;
}
.waitlist input::placeholder { color: rgba(255, 250, 242, .58); }
.waitlist input:focus-visible { border-color: var(--ember); }
.waitlist-status {
  margin: var(--space-s) 0 0;
  min-height: 1.2em;
  color: rgba(255, 250, 242, .82);
  font-size: var(--step-0);
}

/* ============================================================
   Reveal system + resilience guards
   Default (no .is-animating: no-JS OR reduced-motion) = visible.
   ============================================================ */
.reveal { opacity: 1; transform: none; }

html.is-animating .reveal { opacity: 0; transform: translateY(28px); }
html.is-animating .reveal.in { opacity: 1; transform: none; }
html.is-animating:not(.gsap) .reveal {
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}

/* hero/heading line masks: hidden start only while animating */
/* hide line-mask spans via OPACITY only — GSAP must own the transform (a CSS
   transform here gets baked into GSAP's baseline and breaks the yPercent reveal) */
html.is-animating .hero-lines .line > span,
html.is-animating h2 .line > span { opacity: 0; }
html.is-animating:not(.gsap) .hero-lines .line > span,
html.is-animating:not(.gsap) h2 .line > span { transition: opacity .8s var(--ease); }
html.is-animating:not(.gsap) h2.in .line > span { opacity: 1; }

/* no GSAP → reveal the masked headlines (GSAP would have animated them) */
html.no-gsap .hero-lines .line > span { opacity: 1; }
html.no-gsap .sd-link { stroke-dashoffset: 0; }
html.no-gsap .sd-node, html.no-gsap .sd-coreg { opacity: 1; }

/* watchdog escape hatch (force-show if anything stalls) */
html.anim-fallback .reveal { opacity: 1 !important; transform: none !important; }
html.anim-fallback .line > span { opacity: 1 !important; transform: none !important; }
html.anim-fallback .flow-step { opacity: 1 !important; transform: none !important; }
html.anim-fallback .scroll-cue { opacity: 1 !important; }
html.anim-fallback .sd-link { stroke-dashoffset: 0 !important; }
html.anim-fallback .sd-node, html.anim-fallback .sd-coreg { opacity: 1 !important; }

/* ============================================================
   Breakpoints
   ============================================================ */
@media (max-width: 64rem) {
  .split, .split.reversed { grid-template-columns: 1fr; }
  .system-stage { order: 2; }
  .side-img { width: 100%; opacity: .3; }

  /* flow loop → vertical timeline */
  .flow-loop { grid-auto-flow: row; grid-auto-columns: auto; gap: 0; }
  .flow-loop::before {
    inset-block: 16px auto;
    bottom: 16px;
    inset-inline: 16px auto;
    width: 2px; height: auto;
    background: linear-gradient(180deg, var(--ember), #f0b55b, var(--teal));
    transform: scaleY(var(--draw, 1)); transform-origin: top center;
  }
  .flow-step { padding: 0 0 var(--space-l) 52px; }
  .flow-step:last-child { padding-bottom: 0; }
  .flow-step::before { inset-block-start: 0; inset-inline-start: 0; }

  .surface-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 48rem) {
  /* section nav → bottom rail */
  .section-nav {
    inset: auto 0 0 0;
    top: auto;
    right: auto;
    transform: none;
    display: flex;
    justify-content: space-between;
    gap: 2px;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    background: color-mix(in oklab, var(--paper) 82%, transparent);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }
  .nav-item {
    flex: 0 0 72px;
    width: auto;
    min-width: 44px; min-height: 44px;
    gap: 4px;
    scroll-snap-align: center;
    grid-auto-flow: row;
  }
  .nav-label {
    position: static;
    opacity: 1;
    transform: none;
    border: 0;
    background: none;
    box-shadow: none;
    padding: 0;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 10px;
    font-weight: 700;
    color: var(--muted);
  }
  .nav-item[aria-current="true"] .nav-label, .nav-item.active .nav-label { color: var(--ember-dark); }
  main { padding-bottom: 72px; }

  .rail-sessions { grid-template-columns: 1fr; }
}

@media (max-width: 40rem) {
  .feature-grid, .surface-grid { grid-template-columns: 1fr; }
  .principle-stack article { grid-template-columns: 1fr; }
  .principle-stack span { grid-row: auto; }
  .hero-actions, .waitlist { flex-direction: column; align-items: stretch; }
  .sd-node text { font-size: 24px; }
}

/* ============================================================
   Reduced motion — content instant & static
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
  .line > span { opacity: 1 !important; transform: none !important; }
  .sd-link { stroke-dashoffset: 0 !important; }
  .sd-node, .sd-coreg { opacity: 1 !important; }
  .clock-dot { box-shadow: none !important; }
}
