/* ==========================================================================
   Digital Age — design tokens
   Two brand anchors: accent #05CBB4, base #212121.
   Every other surface/text tone below is derived from those two.
   ========================================================================== */

:root {
  --base: #212121;
  --surface: #282B2B;
  --surface-2: #2F3333;
  --accent: #05CBB4;
  --accent-ink: #062B27;

  --text: #F2F5F4;      /* 14.7:1 on --base */
  --muted: #A0AAA9;     /*  6.8:1 on --base */
  --muted-dim: #8A9694; /*  5.3:1 on --base */

  --line: rgba(242, 245, 244, .13);
  /* Form-control boundaries need 3:1 against the page (WCAG 1.4.11);
     the decorative container borders above do not. */
  --line-control: rgba(242, 245, 244, .38);
  --line-accent: rgba(5, 203, 180, .34);

  --shell: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --header-h: 60px;

  --h1: clamp(2.3rem, 6vw, 5.1rem);
  --h2: clamp(1.7rem, 3.5vw, 3rem);
  --h3: clamp(1.3rem, 2.1vw, 1.9rem);
  --body: clamp(1rem, .96rem + .25vw, 1.15rem);
  --small: clamp(.8125rem, .79rem + .12vw, .9rem);

  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* Registered so it can be interpolated by an animation (CSS) or set per
   frame (JS). Default 1 = resolved state, so the stage is never stuck in
   its scattered form if neither driver runs. */
@property --p {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}

/* ==========================================================================
   Base
   ========================================================================== */

* { box-sizing: border-box; }

html {
  background: var(--base);
  /* No webfonts: the LCP element is text, so it paints on first frame with
     zero font requests and no FOIT/FOUT. */
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--base);
  font-size: var(--body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; line-height: 1.04; letter-spacing: -.035em; font-weight: 750; }
h1 { font-size: var(--h1); letter-spacing: -.045em; }
h2 { font-size: var(--h2); }
h3 { font-size: var(--h3); letter-spacing: -.03em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
::selection { color: var(--accent-ink); background: var(--accent); }

h1, h2, .turning-intro, .proof-primary { text-wrap: balance; }
p { text-wrap: pretty; }

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

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

.skip-link {
  position: fixed; z-index: 200; top: 10px; left: 10px;
  padding: 12px 18px; color: var(--accent-ink); background: var(--accent);
  font-size: var(--small); font-weight: 700; text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.eyebrow {
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.shell,
main > section,
.site-footer {
  width: min(100%, calc(var(--shell) + var(--gutter) * 2));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main [id] { scroll-margin-top: calc(var(--header-h) + 16px); }

/* ==========================================================================
   Header — TIME TOUCHPOINT 1 (small, quiet, informational)
   ========================================================================== */

.site-header {
  position: sticky; z-index: 100; top: 0;
  background: color-mix(in srgb, var(--base) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.header-inner {
  width: min(100%, calc(var(--shell) + var(--gutter) * 2));
  min-height: var(--header-h);
  margin-inline: auto;
  padding: 10px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}

.brand {
  display: flex; align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.brand img {
  width: 128px; height: auto;
  filter: brightness(0) invert(1);
}

.nav-clock {
  display: flex; align-items: baseline; gap: 8px;
  color: var(--muted);
  font-size: .8125rem;
  letter-spacing: .04em;
}
.nav-clock-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Fixed-width digits: the value changes every second and must not
     reflow the header (CLS). */
  font-variant-numeric: tabular-nums;
}
.nav-clock-zone {
  color: var(--muted-dim);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .8125rem;
}

/* ==========================================================================
   Hero — TIME TOUCHPOINT 2 (large, dramatic) + friction chips
   ========================================================================== */

.hero {
  min-height: calc(100svh - var(--header-h));
  padding-block: clamp(32px, 6vh, 72px) clamp(24px, 4vh, 48px);
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  grid-template-areas:
    "copy  clock"
    "chips chips"
    "cue   cue";
  align-content: center;
  gap: clamp(28px, 5vh, 56px) clamp(32px, 5vw, 80px);
}

.hero-copy { grid-area: copy; align-self: center; }
.hero-copy .eyebrow { margin-bottom: clamp(16px, 2.5vh, 26px); }

.hero-sub {
  margin-top: clamp(16px, 2.5vh, 28px);
  max-width: 34ch;
  color: var(--muted);
  font-size: clamp(1.1rem, 1.6vw, 1.5rem);
  line-height: 1.4;
}
/* Accent moment 1 of 4: the realization the whole page turns on. */
.hero-sub em {
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
}

.hero-clock {
  grid-area: clock;
  align-self: center;
  display: flex; flex-direction: column; gap: 6px;
  padding: clamp(20px, 2.4vw, 32px);
  border: 1px solid var(--line);
  border-left: 2px solid var(--line-accent);
  background: var(--surface);
}
.hero-clock-digits {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.4rem, 6.4vw, 4.6rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -.04em;
}
.hero-clock-caption {
  color: var(--muted);
  font-size: var(--small);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.chips {
  grid-area: chips;
  display: flex; flex-wrap: wrap; gap: 10px clamp(10px, 1.6vw, 18px);
  perspective: 800px;
}
.chip {
  padding: 11px 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--small);
  white-space: nowrap;
  transform-style: preserve-3d;
  will-change: transform;
}
/* Staggered vertical offsets read as "floating" without absolute
   positioning, so the chips can never overlap the copy at any width. */
.chip-2 { margin-top: clamp(6px, 1.4vh, 14px); }
.chip-3 { margin-top: clamp(3px, .8vh, 8px); }
.chip-4 { margin-top: clamp(9px, 2vh, 20px); }

@media (prefers-reduced-motion: no-preference) {
  .chip { animation: chip-wobble 7.5s var(--ease) infinite; }
  .chip-1 { animation-duration: 7.5s; animation-delay: -.4s; }
  .chip-2 { animation-duration: 9.1s; animation-delay: -2.6s; }
  .chip-3 { animation-duration: 8.3s; animation-delay: -5.1s; }
  .chip-4 { animation-duration: 10.2s; animation-delay: -1.5s; }
}

@keyframes chip-wobble {
  0%, 100% { transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg); }
  25%  { transform: translate3d(2px, -5px, 16px) rotateX(7deg) rotateY(-8deg); }
  50%  { transform: translate3d(-3px, 4px, -14px) rotateX(-6deg) rotateY(6deg); }
  75%  { transform: translate3d(4px, -2px, 9px) rotateX(4deg) rotateY(9deg); }
}

.scroll-cue {
  grid-area: cue;
  justify-self: start;
  display: flex; align-items: center; gap: 14px;
  min-height: 44px;
  color: var(--muted);
  font-size: var(--small);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
}
.scroll-cue:hover { color: var(--accent); }
.scroll-cue-line {
  position: relative;
  width: 1px; height: 44px;
  overflow: hidden;
  background: var(--line);
}
.scroll-cue-line::after {
  content: "";
  position: absolute; inset-inline: 0; top: -60%;
  height: 60%;
  background: linear-gradient(to bottom, transparent, var(--accent));
}
@media (prefers-reduced-motion: no-preference) {
  .scroll-cue-line::after { animation: cue-travel 2.4s ease-in-out infinite; }
}
@keyframes cue-travel {
  0%   { transform: translateY(0); }
  100% { transform: translateY(267%); }
}

/* ==========================================================================
   Turning point — scroll-driven 3D stage
   Single source of truth for card position: --p (0 = scattered, 1 = stacked).
   Driven by a CSS scroll-progress timeline where supported, by rAF in JS
   where not, and left at its resolved default when neither runs.
   ========================================================================== */

.turning {
  padding-block: clamp(72px, 12vh, 150px);
  display: grid;
  justify-items: center;
  gap: clamp(28px, 5vh, 56px);
}

.turning-intro {
  max-width: 22ch;
  font-size: var(--h2);
  text-align: center;
}

.turning-resolve {
  max-width: 30ch;
  color: var(--muted);
  font-size: clamp(1.05rem, 1.5vw, 1.35rem);
  text-align: center;
}

.stage {
  --mag: 1;     /* scatter magnitude, scaled down on narrow viewports */
  --stack: 1;   /* settled fan spacing */
  width: 100%;
  height: clamp(360px, 52vh, 480px);
  perspective: 1100px;
}

.stage-cards {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
}

.stage-card {
  position: absolute; inset: 0; margin: auto;
  width: min(300px, 76%); height: 58px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: var(--small);
  text-align: center;
  /* Floored at .9: a deeper fade drops the label below 4.5:1 while the
     cards are scattered, and they are readable throughout the scroll. */
  opacity: calc(.9 + .1 * var(--p));
  transform:
    translate3d(
      calc(var(--dx) * var(--mag) * (1 - var(--p))),
      calc(var(--dy) * var(--mag) * (1 - var(--p)) + var(--sy) * var(--stack) * var(--p)),
      calc(var(--dz) * var(--mag) * (1 - var(--p)))
    )
    rotateX(calc(var(--rx) * (1 - var(--p))))
    rotateY(calc(var(--ry) * (1 - var(--p))))
    rotateZ(calc(var(--rz) * (1 - var(--p)) + var(--sr) * var(--p)));
  will-change: transform, opacity;
}

/* Accent moment 2 of 4: appears only as the stack resolves. */
.stage-card::before {
  content: "";
  position: absolute; inset: 0 auto 0 0;
  width: 2px;
  background: var(--accent);
  opacity: var(--p);
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .stage {
      animation: stage-settle linear both;
      animation-timeline: view();
      animation-range: entry 22% cover 58%;
    }
  }
}

@keyframes stage-settle {
  from { --p: 0; }
  to   { --p: 1; }
}

/* ==========================================================================
   Chapters
   ========================================================================== */

.chapters { padding-block: clamp(56px, 9vh, 110px); }

.chapter-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(16px, 2vw, 24px);
}

.chapter {
  display: flex; flex-direction: column;
  padding: clamp(24px, 2.6vw, 40px);
  border: 1px solid var(--line);
  background: var(--surface);
}

.chapter-num {
  margin-bottom: 20px;
  color: var(--muted-dim);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .8125rem;
  letter-spacing: .1em;
}

.chapter-line {
  margin-top: 14px;
  color: var(--muted);
  font-size: var(--body);
}

.chapter-services {
  margin-top: clamp(22px, 3vh, 34px);
  padding-top: clamp(16px, 2vh, 22px);
  border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 9px;
}
.chapter-services li {
  color: var(--muted-dim);
  font-size: var(--small);
  letter-spacing: .01em;
}

/* ==========================================================================
   Proof
   ========================================================================== */

.proof {
  padding-block: clamp(56px, 9vh, 110px);
  display: grid;
  gap: 16px;
  justify-items: start;
}
.proof-primary {
  max-width: 24ch;
  font-size: var(--h2);
}
.proof-secondary {
  max-width: 52ch;
  color: var(--muted);
  font-size: var(--body);
}

/* ==========================================================================
   Time-leak calculator — TIME TOUCHPOINT 4
   ========================================================================== */

.calc { padding-block: clamp(64px, 10vh, 130px); }

.calc-intro { display: grid; gap: 16px; margin-bottom: clamp(32px, 5vh, 56px); }

.calc-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(24px, 3vw, 40px);
  align-items: start;
}

.calc-field {
  min-width: 0;
  margin: 0; padding: 0; border: 0;
}

.calc-label {
  display: block;
  margin-bottom: 14px;
  max-width: 42ch;
  color: var(--text);
  font-size: var(--small);
  font-weight: 650;
  line-height: 1.5;
}

.calc-input {
  width: min(220px, 100%);
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--line-control);
  border-radius: 0;
  background: var(--surface);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.calc-input:hover { border-color: var(--line-accent); }
.calc-input:focus-visible { border-color: var(--accent); }

.calc-hint {
  margin-top: 10px;
  color: var(--muted-dim);
  font-size: .8125rem;
}

.calc-options { display: grid; gap: 8px; }

.calc-option {
  display: flex; align-items: center; gap: 12px;
  min-height: 52px;
  padding: 10px 16px;
  border: 1px solid var(--line-control);
  background: var(--surface);
  color: var(--muted);
  font-size: var(--small);
  cursor: pointer;
}
.calc-option:hover { border-color: var(--line-accent); color: var(--text); }
.calc-option:has(:checked) {
  border-color: var(--accent);
  color: var(--text);
}
.calc-option:has(:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.calc-option input {
  flex: none;
  width: 18px; height: 18px;
  margin: 0;
  accent-color: var(--accent);
}
/* The ring moves to the whole option only where :has() can draw it.
   Without :has() the radio keeps its own ring rather than losing it. */
@supports selector(:has(*)) {
  .calc-option input:focus-visible { outline: none; }
}

.calc-results {
  margin-top: clamp(32px, 5vh, 56px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(16px, 2vw, 24px);
}

.result {
  display: grid; align-content: start; gap: 12px;
  padding: clamp(22px, 2.6vw, 34px);
  border: 1px solid var(--line);
  background: var(--surface);
}

.result-label {
  color: var(--muted);
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.result-value {
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.15;
}

/* Accent moment 3 of 4: the visitor's own number. */
.result-number {
  color: var(--accent);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.05em;
}

.result-band { color: var(--text); }

.result-note {
  color: var(--muted);
  font-size: .8125rem;
  line-height: 1.6;
}

.calc-framing {
  margin-top: clamp(24px, 4vh, 40px);
  max-width: 62ch;
  color: var(--muted);
  font-size: var(--body);
}

/* ==========================================================================
   CTA — TIME TOUCHPOINT 3 (personal, quiet) + the page's single action
   ========================================================================== */

.cta {
  padding-block: clamp(64px, 10vh, 130px);
  display: grid;
  justify-items: start;
  gap: clamp(18px, 3vh, 28px);
  border-top: 1px solid var(--line);
}

.cta h2 { max-width: 18ch; }

.cta-elapsed {
  max-width: 46ch;
  color: var(--muted);
  font-size: var(--body);
}
.cta-elapsed-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* Accent moment 4 of 4: the one thing to do on this page. */
.cta-button {
  display: inline-flex; align-items: center; gap: 16px;
  min-height: 56px;
  margin-top: 8px;
  padding: 14px 28px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  font-size: 1rem;
  font-weight: 750;
  text-decoration: none;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.cta-button:hover {
  background: transparent;
  color: var(--accent);
}

.cta-note {
  color: var(--muted-dim);
  font-size: var(--small);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding-block: clamp(36px, 6vh, 56px);
  display: grid;
  gap: 18px;
  border-top: 1px solid var(--line);
}
.footer-line {
  max-width: 52ch;
  color: var(--muted);
  font-size: var(--small);
}
.footer-meta { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.footer-meta a {
  display: inline-flex; align-items: center;
  min-width: 44px; min-height: 44px;
  color: var(--muted);
  font-size: var(--small);
  font-weight: 650;
  text-decoration: none;
}
.footer-meta a:hover { color: var(--accent); }
.footer-copy { color: var(--muted-dim); font-size: .8125rem; }

/* ==========================================================================
   Legal pages (privacy.html / terms.html reuse these class names)
   ========================================================================== */

.legal-page .header-cta {
  display: inline-flex; align-items: center;
  min-height: 44px;
  color: var(--accent);
  font-size: var(--small);
  font-weight: 700;
  text-decoration: none;
}
.legal-page main {
  width: min(100%, calc(820px + var(--gutter) * 2));
  min-height: 70vh;
  margin-inline: auto;
  padding: clamp(48px, 8vh, 88px) var(--gutter) clamp(56px, 9vh, 96px);
}
.legal-page h1 { margin: 18px 0 40px; font-size: var(--h2); }
.legal-content { max-width: 68ch; display: grid; gap: 16px; }
.legal-content h2 { margin-top: 28px; font-size: var(--h3); }
.legal-content p, .legal-content li { color: var(--muted); }
.legal-content a { color: var(--accent); }

.legal-page .site-footer { display: grid; gap: 14px; }
.legal-page .footer-brand strong { font-size: 1.05rem; }
.legal-page .footer-brand p,
.legal-page .footer-contact a { color: var(--muted); font-size: var(--small); }
.legal-page .footer-contact a {
  display: inline-flex; align-items: center; min-height: 44px;
  text-decoration: none;
}
.legal-page .footer-contact a:hover { color: var(--accent); }
.legal-page .footer-contact span { color: var(--muted-dim); }
.legal-page .footer-meta { color: var(--muted-dim); font-size: .8125rem; }
.legal-page .footer-meta a { color: var(--muted); }

/* ==========================================================================
   Responsive
   The 3D magnitudes scale down independently of the layout so the effect
   stays legible (and inside the viewport) on small screens.
   ========================================================================== */

@media (max-width: 1024px) {
  .stage { --mag: .74; --stack: .86; }
  .hero { gap: clamp(24px, 4vh, 40px) clamp(24px, 4vw, 48px); }
  .chapter-list { grid-template-columns: 1fr 1fr; }
  .chapter:last-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  :root { --header-h: 56px; }

  .hero {
    grid-template-columns: 1fr;
    grid-template-areas:
      "copy"
      "clock"
      "chips"
      "cue";
    align-content: start;
    padding-block: clamp(24px, 4vh, 40px) 32px;
  }
  .hero-sub { max-width: none; }
  .hero-clock { padding: 18px 20px; }
  .chips { gap: 8px; }
  .chip {
    padding: 9px 13px;
    white-space: normal;
  }
  .chip-2, .chip-3, .chip-4 { margin-top: 0; }

  .stage {
    --mag: .5;
    --stack: .66;
    height: clamp(300px, 46vh, 360px);
    perspective: 760px;
  }
  .stage-card { width: min(250px, 84%); height: 50px; }

  .chapter-list { grid-template-columns: 1fr; }
  .chapter:last-child { grid-column: auto; }

  .calc-form { grid-template-columns: 1fr; }
  .calc-results { grid-template-columns: 1fr; }
  .calc-input { width: 100%; }

  .cta-button { width: 100%; justify-content: space-between; }
}

@media (max-width: 400px) {
  .stage { --mag: .42; --stack: .58; }
  .chip { font-size: .8125rem; }
  .hero-clock-digits { font-size: clamp(2.1rem, 11vw, 2.8rem); }
}

/* ==========================================================================
   Reduced motion — every animated surface resolves to its end state
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  /* !important so it also overrides an inline --p the JS driver may have
     written before the user turned reduced motion on. */
  .stage { --p: 1 !important; }
  .chip { transform: none; }
  .scroll-cue-line::after { display: none; }
}
