/*
 * CommitControl homepage, Phase 1 of the brand rebuild.
 * Consumes src/styles/tokens.css. Instantly-direction: short product-first
 * hero, one dominant CTA, whitespace-led sections, no card soup. Dual theme
 * via the token layer. All figures in IBM Plex Mono.
 */

/* ─── Reset + base ──────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--cc-font-sans);
  font-size: var(--cc-fs-body);
  line-height: var(--cc-lh-body);
  color: var(--cc-ink);
  background: var(--cc-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--cc-dur-base) var(--cc-ease-out), color var(--cc-dur-base) var(--cc-ease-out);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: transparent; color: inherit; }
img, video { max-width: 100%; display: block; }
:focus-visible { outline: none; box-shadow: var(--cc-focus-ring); border-radius: var(--cc-r-sm); }

/* Numbers: money, metrics, score params. Mono + tabular. */
.num, .metric, .kpi { font-family: var(--cc-num); font-variant-numeric: var(--cc-numeric); }

/* ─── Layout primitives ─────────────────────────────────────────────────── */
.wrap { max-width: var(--cc-container); margin-inline: auto; padding-inline: var(--cc-gutter); }
.section { padding-block: var(--cc-section-y); }
.measure { max-width: var(--cc-measure); }
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: var(--cc-z-toast);
  background: var(--cc-accent-fill); color: var(--cc-accent-on-fill);
  padding: 10px 16px; border-radius: var(--cc-r-sm); transition: top var(--cc-dur-fast);
}
.skip-link:focus { top: 8px; }

/* ─── Typography roles ──────────────────────────────────────────────────── */
h1, h2, h3, h4 { font-weight: var(--cc-w-semibold); line-height: var(--cc-lh-head); letter-spacing: var(--cc-track-head); color: var(--cc-ink); text-wrap: balance; }
.display { font-size: var(--cc-fs-display); line-height: var(--cc-lh-tight); letter-spacing: var(--cc-track-display); font-weight: var(--cc-w-bold); }
.h2 { font-size: var(--cc-fs-h2); }
.h3 { font-size: var(--cc-fs-h3); }
.lead { font-size: var(--cc-fs-lead); color: var(--cc-ink-soft); line-height: 1.5; text-wrap: pretty; }
p { text-wrap: pretty; }
.accent { color: var(--cc-accent); }

/* Eyebrow: mono label with a leading rule. Neutral ink, not green: green is
   reserved for interactive and positive elements so the accent stays meaningful.
   The leading rule keeps a faint accent tint so it still reads as a brand mark. */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--cc-font-mono); font-size: var(--cc-fs-label-code);
  font-weight: var(--cc-w-semibold); letter-spacing: var(--cc-track-label-code);
  text-transform: uppercase; color: var(--cc-ink-mute);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--cc-accent-mid); flex: 0 0 auto; }
.eyebrow.center { justify-content: center; }

/* ─── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--cc-r-sm);
  font-weight: var(--cc-w-semibold); font-size: var(--cc-fs-body);
  min-height: 44px; /* touch target */
  transition: background var(--cc-dur-base) var(--cc-ease-out),
              transform var(--cc-dur-fast) var(--cc-ease-out),
              box-shadow var(--cc-dur-base) var(--cc-ease-out),
              border-color var(--cc-dur-base) var(--cc-ease-out);
  translate: 0 0;
}
.btn .arrow { transition: transform var(--cc-dur-base) var(--cc-ease-out); }
.btn:hover .arrow { transform: translateX(3px); }
.btn:active { transform: translateY(1px); }

/* Primary: the one dominant action. Green fill, white text, glow. */
.btn-primary { background: var(--cc-accent-fill); color: var(--cc-accent-on-fill); box-shadow: var(--cc-glow-accent); }
.btn-primary:hover { background: var(--cc-accent-fill-hover); }
.btn-lg { padding: 15px 26px; font-size: 1.0625rem; min-height: 52px; }

/* Secondary: quiet, outlined. Never competes with primary. */
.btn-secondary { background: transparent; color: var(--cc-ink); border: 1px solid var(--cc-border-strong); }
.btn-secondary:hover { background: var(--cc-surface-2); border-color: var(--cc-ink-faint); }

/* Tertiary: text link with accent. */
.btn-text { color: var(--cc-accent); padding: 8px 4px; min-height: 44px; }
.btn-text:hover { color: var(--cc-ink); }

/* ─── Header / nav ──────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: var(--cc-z-nav);
  background: color-mix(in srgb, var(--cc-bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--cc-dur-base), background var(--cc-dur-base);
}
.nav.scrolled { border-bottom-color: var(--cc-border); background: color-mix(in srgb, var(--cc-bg) 92%, transparent); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 15px; }
.nav-left { display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--cc-ink-mute); font-size: var(--cc-fs-sm); transition: color var(--cc-dur-fast); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--cc-ink); }
.nav-right { display: flex; align-items: center; gap: 12px; }

.logo { display: inline-flex; align-items: center; gap: 10px; }
.logo-mark { width: 28px; height: 28px; flex: 0 0 auto; }
.logo-mark svg { width: 100%; height: 100%; display: block; }
.logo-word { font-weight: var(--cc-w-semibold); font-size: 20px; letter-spacing: -0.03em; color: var(--cc-ink); }
.logo-word b { font-weight: var(--cc-w-bold); color: var(--cc-accent); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--cc-r-pill);
  color: var(--cc-ink-mute); transition: color var(--cc-dur-fast), background var(--cc-dur-fast);
}
.theme-toggle:hover { color: var(--cc-accent); background: var(--cc-surface-2); }
.theme-toggle svg { width: 18px; height: 18px; }

/* ─── Hero ──────────────────────────────────────────────────────────────── */
.hero { position: relative; padding-top: clamp(48px, 6vw, 96px); padding-bottom: 0; text-align: center; overflow: clip; }
.hero-glow {
  position: absolute; inset-inline: 0; top: -10%; margin-inline: auto;
  width: min(760px, 80%); height: 420px; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 60% at 50% 40%, rgba(var(--cc-accent-rgb), 0.16), transparent 70%);
  filter: blur(10px);
}
/* Keep the glow barely-there on the light theme so it does not muddy white. */
:root[data-theme="light"] .hero-glow { opacity: 0.4; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .hero-glow { opacity: 0.4; }
}
.hero-inner { position: relative; z-index: 1; margin-inline: auto; display: flex; flex-direction: column; align-items: center; gap: 22px; }
/* Hero text stays in a readable column; the product frame below runs wider. */
.hero-inner > .eyebrow,
.hero-inner > h1,
.hero-inner > .lead,
.hero-inner > .hero-ctas,
.hero-inner > .hero-terms,
.hero-inner > .hero-trust { max-width: 880px; width: 100%; }
.hero h1 { font-size: var(--cc-fs-display); line-height: var(--cc-lh-tight); letter-spacing: var(--cc-track-display); font-weight: var(--cc-w-bold); }
.hero .lead { max-width: 56ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: center; }
.hero-terms { font-family: var(--cc-font-mono); font-size: var(--cc-fs-label-code); letter-spacing: 0.02em; color: var(--cc-ink-faint); max-width: 54ch; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; font-size: var(--cc-fs-sm); color: var(--cc-ink-mute); }
.hero-trust span { display: inline-flex; align-items: center; gap: 7px; }
.hero-trust svg { width: 15px; height: 15px; color: var(--cc-accent); flex: 0 0 auto; }

/* ─── Product tilt-and-settle frame ─────────────────────────────────────────
   The centerpiece. A scroll sequence: the frame settles from a 3D tilt to flat
   and the active screen cross-fades as you scroll. Built to swap screenshots
   for a looping <video> later with no layout change (.pf-media is the slot). */
/* Break the product region out of the narrower hero text column so the frame
   runs wide like a real product showcase, capped to the page container. */
.product-scroll {
  position: relative; margin-top: clamp(36px, 5vw, 72px);
  width: 100%;
  max-width: min(860px, 100%);
  margin-inline: auto;
}
.pf-stage { perspective: var(--cc-perspective); overflow-x: clip; }
.product-frame {
  /* 0 = entering (tilted), 1 = settled (flat). Default 1 so with no JS the
     frame renders flat and legible; the scroll controller sets it to 0 and
     drives it only when motion is allowed. */
  --settle: 1;
  width: 100%; margin-inline: auto; transform-origin: center top;
  transform-style: preserve-3d;
  transform:
    rotateX(calc(var(--cc-tilt-start) * (1 - var(--settle))))
    scale(calc(var(--cc-tilt-scale-start) - (var(--cc-tilt-scale-start) - var(--cc-tilt-scale-end)) * var(--settle)))
    translateY(calc(var(--cc-tilt-rise) * (1 - var(--settle)) * -1));
  will-change: transform;
}
.pf-chrome {
  border-radius: var(--cc-r-lg); overflow: hidden;
  border: 1px solid var(--cc-border-strong);
  background: var(--cc-surface);
  box-shadow: var(--cc-shadow-lg);
}
.pf-media { position: relative; aspect-ratio: 1600 / 905; background: var(--cc-bg-deep); }
.pf-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center;
  opacity: 0; transition: opacity var(--cc-dur-slow) var(--cc-ease-out);
}
.pf-media img.active { opacity: 1; }

/* Caption chips under the frame, one per screen, act as tabs + progress. */
.pf-steps { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.pf-step {
  font-family: var(--cc-font-mono); font-size: var(--cc-fs-label-code); letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--cc-ink-mute);
  padding: 11px 16px; border-radius: var(--cc-r-pill); border: 1px solid var(--cc-border);
  min-height: 44px; display: inline-flex; align-items: center;
  transition: color var(--cc-dur-fast), border-color var(--cc-dur-fast), background var(--cc-dur-fast);
}
.pf-step[aria-pressed="true"] { color: var(--cc-accent); border-color: var(--cc-accent-mid); background: var(--cc-accent-tint); }
.pf-step:hover { color: var(--cc-ink); }
.pf-note { margin-top: 12px; text-align: center; font-family: var(--cc-font-mono); font-size: var(--cc-fs-label-code); letter-spacing: 0.04em; color: var(--cc-ink-faint); }

/* ─── Generic section head ──────────────────────────────────────────────── */
.sec-head { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.sec-head.center { margin-inline: auto; align-items: center; text-align: center; }
.sec-head h2 { font-size: var(--cc-fs-h2); }

/* Playful italic accent on a headline. A deliberate italic on IBM Plex Sans,
   used sparingly for tone; distinct from the retired decorative-serif pattern. */
.h2-playful { font-style: italic; letter-spacing: -0.018em; }

/* ─── "The math" time-split section ─────────────────────────────────────── */
.math { display: grid; gap: clamp(32px, 4vw, 64px); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .math { grid-template-columns: 1.1fr 1fr; } }
.math-lede h2 { font-size: var(--cc-fs-h2); margin-bottom: 14px; }
.math-vis { display: flex; flex-direction: column; gap: 14px; }
.split-row { display: flex; flex-direction: column; gap: 6px; }
.split-row .lbl { display: flex; justify-content: space-between; font-family: var(--cc-font-mono); font-size: var(--cc-fs-sm); color: var(--cc-ink-mute); }
.split-row .lbl b { color: var(--cc-ink); font-weight: var(--cc-w-semibold); }
/* Both bars measure the SAME thing: selling time (green). The charcoal
   remainder is the reporting/admin that eats the rest of the week. Today the
   green bar is short (30% selling); the goal grows it (55%). One consistent
   metric across rows so the read is "grow the green". Block layout (not flex)
   so the inline width on the fill span is honoured exactly. */
.bar { height: 16px; border-radius: var(--cc-r-pill); background: var(--cc-surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; }
.bar .today { background: var(--cc-danger); }       /* today's cramped selling: red */
.bar .selling { background: var(--cc-accent-mid); } /* the goal, selling grown: green */
.math-note { font-family: var(--cc-font-mono); font-size: var(--cc-fs-label-code); color: var(--cc-ink-faint); margin-top: 4px; }

/* ─── Outcome columns (open text, no cards, no rules) ───────────────────── */
.outcomes { display: grid; gap: clamp(28px, 4vw, 56px); grid-template-columns: 1fr; margin-top: 48px; }
@media (min-width: 820px) { .outcomes { grid-template-columns: repeat(3, 1fr); } }
.outcome { display: flex; flex-direction: column; gap: 10px; }
.outcome .onum { font-family: var(--cc-font-mono); font-size: var(--cc-fs-label-code); letter-spacing: 0.1em; color: var(--cc-accent); font-weight: var(--cc-w-semibold); }
.outcome h3 { font-size: var(--cc-fs-h3); }
.outcome p { color: var(--cc-ink-soft); font-size: var(--cc-fs-body); }

/* Subtle hover lift on interactive regions (not text regions). */
.hoverable { transition: translate var(--cc-dur-base) var(--cc-ease-out); translate: 0 0; }
@media (hover: hover) { .hoverable:hover { translate: 0 calc(var(--cc-hover-lift) * -1); } }

/* ─── Proof strip (read-only, reps never log in, target time) ───────────── */
.proof-section { padding-block: clamp(32px, 3vw, 48px); }
.proof { display: flex; flex-wrap: wrap; gap: 14px 40px; justify-content: center; text-align: center; }
.proof .item { display: flex; flex-direction: column; gap: 4px; }
.proof .item b { font-family: var(--cc-num); font-variant-numeric: var(--cc-numeric); font-size: var(--cc-fs-metric-sm); color: var(--cc-ink); font-weight: var(--cc-w-semibold); }
.proof .item span { font-size: var(--cc-fs-sm); color: var(--cc-ink-mute); }

/* ─── Bottom CTA ────────────────────────────────────────────────────────── */
.bottom-cta { text-align: center; }
.bottom-cta .inner { max-width: 720px; margin-inline: auto; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.bottom-cta h2 { font-size: var(--cc-fs-h1); }

/* ─── Waitlist (preserved form, restyled) ───────────────────────────────── */
.waitlist { background: var(--cc-surface); border-block: 1px solid var(--cc-border); }
.waitlist .wrap { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: center; text-align: center; padding-block: 20px; }
.waitlist .note { font-size: var(--cc-fs-sm); color: var(--cc-ink-mute); max-width: 560px; }
.waitlist form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.waitlist input[type="email"] {
  padding: 11px 14px; font-size: var(--cc-fs-sm); min-width: 240px;
  background: var(--cc-bg); color: var(--cc-ink);
  border: 1px solid var(--cc-border-strong); border-radius: var(--cc-r-sm); font-family: inherit;
}
.waitlist input::placeholder { color: var(--cc-ink-faint); }
.waitlist .form-status, .waitlist .form-success { font-size: var(--cc-fs-sm); color: var(--cc-ink-mute); width: 100%; }
.wl-turnstile { width: 100%; display: flex; justify-content: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ─── Compliance band + footer ──────────────────────────────────────────── */
.compliance { background: var(--cc-surface); border-top: 1px solid var(--cc-border); }
.compliance .wrap { display: flex; flex-direction: column; gap: 16px; padding-block: 40px; }
.compliance-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.compliance-head a { color: var(--cc-accent); font-size: var(--cc-fs-sm); }
.compliance-items { display: flex; flex-wrap: wrap; gap: 14px 32px; }
.compliance-items .ci { display: inline-flex; align-items: center; gap: 10px; color: var(--cc-ink-soft); font-size: var(--cc-fs-sm); }
.compliance-items .ci svg { width: 22px; height: 22px; color: var(--cc-accent); flex: 0 0 auto; }
.compliance .fine { font-size: var(--cc-fs-sm); color: var(--cc-ink-mute); }
.compliance .fine a { color: var(--cc-accent); }

/* Footer always dark charcoal in both themes. */
.footer { background: var(--cc-bg-deep); color: #AEB8B6; padding-top: var(--cc-space-16); }
.footer a { color: #AEB8B6; transition: color var(--cc-dur-fast); }
.footer a:hover { color: #EDF1F0; }
.footer-cols { display: grid; gap: 40px; grid-template-columns: 1fr; padding-bottom: var(--cc-space-16); }
@media (min-width: 720px) { .footer-cols { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer .logo-word { color: #EDF1F0; }
.footer .logo-word b { color: var(--cc-accent); }
.footer .blurb { color: #8A938B; font-size: var(--cc-fs-sm); line-height: 1.6; max-width: 38ch; margin-top: 14px; }
.footer h4 { color: #EDF1F0; font-size: var(--cc-fs-sm); font-weight: var(--cc-w-semibold); margin-bottom: 14px; }
.footer ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer ul a { font-size: var(--cc-fs-sm); }
.footer-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 24px; border-top: 1px solid #23272E; font-size: var(--cc-fs-xs); color: #6C7480; }

/* ─── Responsive ────────────────────────────────────────────────────────── */
/* ─── Mobile nav (menu built by theme.js) ───────────────────────────────── */
.nav .btn { white-space: nowrap; }
.nav-menu-toggle { display: none; }
.nav-menu[hidden] { display: none; }
@media (max-width: 900px) {
  .nav.has-menu .nav-links { display: none; }
  .nav-inner { gap: 10px; }
  .nav-left { min-width: 0; }
  .nav-right { gap: 6px; flex: 0 0 auto; }
  .nav.has-menu .nav-right .btn-text, .nav.has-menu .nav-right .theme-toggle { display: none; }
  .nav-right .btn { padding: 10px 14px; font-size: 0.9375rem; min-height: 44px; }
  .logo-word { font-size: 18px; }
  .nav-menu-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: var(--cc-r-sm);
    color: var(--cc-ink); border: 1px solid var(--cc-border-strong); background: transparent;
  }
  .nav-menu-toggle svg { width: 20px; height: 20px; }
  .nav.menu-open { border-bottom-color: var(--cc-border); background: var(--cc-bg); }
  .nav-menu { border-top: 1px solid var(--cc-border); background: var(--cc-bg); }
  .nav-menu-links { display: flex; flex-direction: column; padding: 8px var(--cc-gutter, 20px) 16px; }
  .nav-menu-links a, .nav-menu-links button {
    display: flex; align-items: center; min-height: 48px; padding: 0 4px;
    font: inherit; font-size: var(--cc-fs-body); color: var(--cc-ink); text-align: left;
    background: none; border: 0; border-bottom: 1px solid var(--cc-border-soft); cursor: pointer;
  }
  .nav-menu-links a[aria-current="page"] { color: var(--cc-accent); }
  .nav-menu-links .nav-menu-signin { color: var(--cc-accent); }
  .nav-menu-links .nav-menu-theme { color: var(--cc-ink-mute); border-bottom: 0; }
}
.nav-menu-cta { display: none; }
@media (max-width: 420px) {
  .nav-inner { padding-inline: 16px; }
  .nav.has-menu .nav-right .btn-primary { display: none; }
  .nav-menu-links .nav-menu-cta {
    display: flex; justify-content: center; margin: 8px 0 6px; border-bottom: 0;
    color: var(--cc-accent-on-fill); background: var(--cc-accent-fill); border-radius: var(--cc-r-sm);
  }
  .nav-menu-links { padding-inline: 16px; }
  .nav:not(.has-menu) .nav-right .btn-text { display: none; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .hero { padding-top: 40px; }
  /* On small screens the product frame uses a plain rise, no 3D tilt. */
  .product-frame { transform: translateY(calc(var(--cc-tilt-rise) * (1 - var(--settle)) * -0.4)); }
}

/* Honour reduced motion: show the frame flat and settled. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .product-frame { transform: none; }
  .pf-media img { transition: none; }
}
