/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg:          #FAFAF8;
  --bg-alt:      #F4F4F2;
  --surface:     #FFFFFF;

  --ink:         #111111;
  --ink-soft:    #5F6368;
  --ink-mute:    rgba(95, 99, 104, 0.72); /* --ink-soft at reduced opacity — no new hue added */

  --accent:      #2563FF;
  --accent-hover:#0A4FFF;
  --accent-tint: #EAF2FF;
  --line:        #E5E7EB;

  --display: "Space Grotesk", "Inter", ui-sans-serif, system-ui, sans-serif;
  --sans:    "Inter", ui-sans-serif, system-ui, sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:   cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --nav-h: 84px;
  --container: 1180px;

  --shadow-sm: 0 1px 2px rgba(17,17,17,.04);
  --shadow-md: 0 1px 2px rgba(17,17,17,.03), 0 20px 40px -28px rgba(17,17,17,.14);
  --shadow-lg: 0 1px 2px rgba(17,17,17,.03), 0 30px 60px -20px rgba(17,17,17,.16);
  --shadow-accent: 0 14px 28px -12px rgba(37,99,255,.35);
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  scroll-behavior: smooth;
  background: var(--bg);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
ul, ol { list-style: none; padding: 0; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.08; letter-spacing: -0.02em; font-family: var(--display); font-weight: 600; }
::selection { background: var(--accent); color: #fff; }

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

[id] { scroll-margin-top: 104px; }

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .7rem 1.1rem; background: var(--ink); color: #fff;
  border-radius: 8px; font-weight: 600;
  transition: top .3s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: 1.5rem; }
@media (min-width: 720px)  { .container { padding-inline: 2rem; } }
@media (min-width: 1280px) { .container { padding-inline: 2.5rem; } }

.kicker {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--mono);
  font-size: .76rem; letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.kicker::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
}

.section-title {
  font-size: clamp(1.9rem, 3.4vw, 2.85rem);
  max-width: 19ch;
  margin-bottom: 1.4rem;
}
.section-title mark,
.hero-title mark,
.cta-final-title mark {
  background: var(--accent);
  color: #fff;
  font-style: normal;
  padding: 0.03em 0.22em;
  border-radius: 0.14em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.section-lede {
  color: var(--ink-soft); font-size: 1.08rem; max-width: 56ch; margin-bottom: 3.25rem;
  font-weight: 400;
}

section { position: relative; padding-block: clamp(4.5rem, 9vw, 8rem); }
.section-alt { background: var(--bg-alt); }

/* Reveal on scroll */
[data-reveal] {
  opacity: 0; transform: translateY(24px);
  transition: opacity .85s var(--ease-soft), transform .85s var(--ease-soft);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }
[data-reveal][data-split] { opacity: 1; transform: none; } /* defensive: split-text handles its own reveal */

.split-word, .split-line { display: inline-block; will-change: transform, opacity; }

/* =============================================================
   4. Buttons & links
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .95rem 1.6rem;
  border-radius: 999px;
  font-family: var(--sans); font-weight: 600; font-size: .95rem;
  white-space: nowrap;
  transition: transform .4s var(--ease-soft), box-shadow .4s var(--ease-soft), background-color .3s var(--ease-out), color .3s var(--ease-out), border-color .3s var(--ease-out);
}
.btn-primary {
  background: var(--accent); color: #fff;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 20px 36px -14px rgba(10,79,255,.45); }
.btn-primary:active { transform: translateY(0); transition-duration: .12s; }

.btn-ghost {
  background: transparent; color: var(--ink);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); transform: translateY(-2px); }

.btn-sm { padding: .65rem 1.25rem; font-size: .85rem; }

/* =============================================================
   5. Nav
   ============================================================= */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 200;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background-color .4s var(--ease-out), backdrop-filter .4s var(--ease-out), border-color .4s var(--ease-out), box-shadow .4s var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(250,250,248,0.82);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(17,17,17,.02);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  width: 100%;
}

.brand { display: inline-flex; align-items: center; gap: .6rem; }
.brand-mark { width: 22px; height: 22px; color: var(--ink); flex-shrink: 0; }
.brand-word {
  font-family: "Poppins", var(--display); font-weight: 700; font-size: 1.02rem;
  letter-spacing: .01em; color: var(--ink);
  display: inline-flex; gap: .35em;
}
.brand-word span { color: var(--accent); }

.nav-links { display: none; align-items: center; gap: 2.1rem; margin-inline: auto; }
@media (min-width: 960px) { .nav-links { display: flex; } }
.nav-link {
  position: relative; padding: .3rem 0;
  font-size: .92rem; color: var(--ink-soft);
  transition: color .3s var(--ease-out);
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: right;
  transition: transform .45s var(--ease-out);
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { transform: scaleX(1); transform-origin: left; }

.nav-cta { display: none; }
@media (min-width: 720px) { .nav-cta { display: inline-flex; } }

.nav-burger {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 0;
}
@media (min-width: 720px) { .nav-burger { display: none; } }
.nav-burger span {
  display: block; width: 22px; height: 1.5px; background: var(--ink); margin-inline: auto;
  transition: transform .35s var(--ease-soft), opacity .25s;
}
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.nav-mobile {
  position: fixed; inset: 0; z-index: 190;
  background: var(--bg);
  display: grid; place-items: center;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .6s var(--ease-soft);
}
.nav-mobile.is-open { clip-path: inset(0); }
.nav-mobile nav { display: flex; flex-direction: column; align-items: center; gap: 2rem; }
.nav-mobile-link { font-family: var(--display); font-size: 1.7rem; font-weight: 600; color: var(--ink); }
.nav-mobile-cta { margin-top: 1rem; }

/* =============================================================
   6. Hero
   ============================================================= */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding-top: var(--nav-h);
  overflow: clip;
}
.hero-inner {
  padding-block: 3.5rem;
  display: grid; gap: 3rem; align-items: center;
}
@media (min-width: 1024px) { .hero-inner { grid-template-columns: 1.05fr .95fr; gap: 2rem; } }

.hero-text { max-width: 640px; }
.hero-title {
  font-size: clamp(2.6rem, 5.6vw, 4.6rem);
  max-width: 17ch;
  margin-bottom: 1.75rem;
}
.hero-title em { font-style: normal; color: var(--accent); }
.hero-sub {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 2.5rem;
  font-weight: 400;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.hero-visual { position: relative; display: none; }
@media (min-width: 1024px) { .hero-visual { display: block; } }
.hero-illustration {
  display: block; width: 100%; height: auto; border-radius: 24px;
  opacity: 0; transform: translateY(22px) scale(0.98);
  transition: opacity 1.1s var(--ease-soft), transform 1.1s var(--ease-soft);
}
.hero-visual.is-in .hero-illustration { opacity: 1; transform: none; }

/* =============================================================
   7. Narrative (thesis + problem, merged)
   ============================================================= */
.narrative .container { max-width: 880px; }
.narrative-statement {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.6rem, 3.4vw, 2.5rem);
  line-height: 1.22; letter-spacing: -0.01em;
  text-wrap: balance;
  margin-bottom: 1.75rem;
}
.narrative-support {
  color: var(--ink-soft); font-size: 1.08rem; max-width: 62ch; margin-bottom: 2.25rem;
}
.narrative-close {
  font-family: var(--display); font-weight: 600; color: var(--ink);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  border-left: 3px solid var(--accent);
  padding-left: 1.4rem;
}

/* =============================================================
   8. Services story
   ============================================================= */
.story-list { position: relative; max-width: 760px; margin-top: 3rem; }
.story-list::before {
  content: ""; position: absolute; left: 27px; top: 8px; bottom: 8px; width: 1px;
  background: var(--line);
}
@media (min-width: 640px) { .story-list::before { left: 31px; } }

.story-node { position: relative; padding-left: 4.5rem; padding-bottom: 2.75rem; }
@media (min-width: 640px) { .story-node { padding-left: 5.25rem; } }
.story-node:last-of-type { padding-bottom: 0; }

.story-icon {
  position: absolute; left: 0; top: 0;
  width: 56px; height: 56px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.story-icon svg { width: 24px; height: 24px; }

.story-lede { color: var(--accent); font-weight: 600; font-size: .95rem; margin-bottom: .4rem; }
.story-node h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); margin-bottom: .6rem; }
.story-node p { color: var(--ink-soft); font-size: 1rem; max-width: 52ch; margin-bottom: 1rem; }

.story-media {
  display: block; width: 100%; max-width: 420px; height: auto;
  border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  margin-block: .25rem 1.25rem;
  transition: transform .5s var(--ease-soft), box-shadow .5s var(--ease-soft);
}
.story-media:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.story-toggle {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .85rem; font-weight: 600; color: var(--ink-soft);
  border-bottom: 1px solid var(--line); padding-bottom: 2px;
  transition: color .3s var(--ease-out), border-color .3s var(--ease-out);
}
.story-toggle:hover, .story-node.is-open .story-toggle { color: var(--accent); border-color: var(--accent); }
.story-toggle-icon { transition: transform .35s var(--ease-soft); }
.story-node.is-open .story-toggle-icon { transform: rotate(45deg); }

.story-detail {
  display: grid; grid-template-rows: 0fr; opacity: 0;
  transition: grid-template-rows .5s var(--ease-soft), opacity .4s var(--ease-out);
}
.story-node.is-open .story-detail { grid-template-rows: 1fr; opacity: 1; }
.story-detail > ul { overflow: hidden; }
.story-detail ul { padding-top: 1rem; display: grid; gap: .55rem; }
.story-detail li { color: var(--ink-soft); font-size: .93rem; padding-left: 1.1rem; position: relative; }
.story-detail li::before {
  content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
}

.story-connector {
  padding-left: 4.5rem; padding-bottom: 2.75rem;
  color: var(--ink-mute); font-size: .95rem; font-style: normal;
}
@media (min-width: 640px) { .story-connector { padding-left: 5.25rem; } }

.story-close {
  margin-top: 1rem; padding: clamp(2.5rem, 5vw, 3.5rem);
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
  text-align: center; box-shadow: var(--shadow-md);
}
.story-close p {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(1.3rem, 2.6vw, 1.9rem); line-height: 1.25;
}
.story-close em { font-style: normal; color: var(--accent); }

/* =============================================================
   9. Stats strip
   ============================================================= */
.stats-strip { padding-block: clamp(3rem, 6vw, 4.5rem); }
.stats-grid {
  display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 780px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--surface); padding: 2.25rem 1.5rem; text-align: center;
  transition: background-color .4s var(--ease-out);
}
.stat::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%), var(--accent-tint), transparent 70%);
  opacity: 0; transition: opacity .4s var(--ease-out);
}
.stat:hover::before { opacity: 1; }
.stat-num {
  font-family: var(--display); font-weight: 700; color: var(--accent);
  font-size: clamp(2rem, 4vw, 2.6rem); display: block; margin-bottom: .5rem;
}
.stat-label { color: var(--ink-soft); font-size: .9rem; max-width: 20ch; margin-inline: auto; }

/* =============================================================
   10. Method — named phases, zigzag
   ============================================================= */
.method-media {
  display: block; width: 100%; max-width: 880px; height: auto;
  border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow-md);
  margin-top: 2.5rem;
}

.method-list { display: flex; flex-direction: column; gap: clamp(2rem, 4vw, 0rem); margin-top: 1rem; }
.method-item {
  display: grid; gap: 1.5rem; padding-block: 2.25rem;
  border-top: 1px solid var(--line);
  align-items: center;
}
@media (min-width: 860px) {
  .method-item { grid-template-columns: 100px 1fr 1fr; gap: 2.5rem; }
  .method-item:nth-of-type(even) .method-phase { order: 2; text-align: right; }
  .method-item:nth-of-type(even) .method-body { order: 1; }
}
.method-index { font-family: var(--mono); font-size: 1rem; color: var(--accent); }
.method-phase { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.method-body p { color: var(--ink-soft); font-size: 1.02rem; max-width: 46ch; }

/* =============================================================
   11. Levels (tiers)
   ============================================================= */
.tier-list { display: grid; gap: 1.5rem; margin-top: 1rem; }
@media (min-width: 860px) { .tier-list { grid-template-columns: repeat(3, 1fr); } }
.tier {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: clamp(1.75rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-sm);
  transition: transform .5s var(--ease-soft), box-shadow .5s var(--ease-soft), border-color .4s var(--ease-out);
}
.tier::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 0%), var(--accent-tint), transparent 70%);
  opacity: 0; transition: opacity .4s var(--ease-out);
}
.tier:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--accent-tint); }
.tier:hover::before { opacity: 1; }
.tier-index { font-family: var(--mono); color: var(--accent); font-size: .95rem; margin-bottom: 1rem; display: block; }
.tier h3 { font-size: 1.35rem; margin-bottom: .75rem; }
.tier > p { color: var(--ink-soft); font-size: .98rem; margin-bottom: 1.5rem; }
.tier-tags { display: flex; flex-direction: column; gap: .6rem; }
.tier-tags li {
  font-size: .88rem; color: var(--ink-soft); padding-left: 1.2rem; position: relative;
}
.tier-tags li::before {
  content: ""; position: absolute; left: 0; top: .5em; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
}

/* =============================================================
   12. Audience pills
   ============================================================= */
.audience-pills { display: flex; flex-wrap: wrap; gap: .8rem; }
.audience-pills + .narrative-close { margin-top: 2.5rem; }
.audience-pills li {
  font-size: .96rem; color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px;
  padding: .8rem 1.4rem;
  transition: border-color .3s var(--ease-out), color .3s var(--ease-out), background-color .3s var(--ease-out), transform .3s var(--ease-soft);
}
.audience-pills li:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-tint); transform: translateY(-2px); }

/* =============================================================
   13. FAQ
   ============================================================= */
.faq-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); max-width: 760px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding-block: 1.5rem;
  font-family: var(--display); font-weight: 600; font-size: 1.05rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-family: var(--mono); font-size: 1.3rem; color: var(--accent);
  flex-shrink: 0; transition: transform .4s var(--ease-soft);
}
.faq-item[open] summary::after { transform: rotate(135deg); }
.faq-item p { color: var(--ink-soft); padding-bottom: 1.6rem; max-width: 62ch; }

/* =============================================================
   14. Final CTA
   ============================================================= */
.cta-final { text-align: center; overflow: clip; }
.cta-final-inner { display: flex; flex-direction: column; align-items: center; }
.cta-final-title { font-size: clamp(2rem, 4.4vw, 3.4rem); max-width: 17ch; margin-bottom: 1.25rem; }
.cta-final-sub { color: var(--ink-soft); font-size: 1.1rem; margin-bottom: 2.5rem; }
.cta-highlight {
  display: inline-block;
  font-family: "Poppins", var(--display); font-weight: 600;
  font-size: clamp(1.4rem, 3.4vw, 2.1rem);
  letter-spacing: .01em;
  color: transparent; -webkit-text-stroke: 1px var(--ink);
  margin-bottom: 2.5rem;
  transition: color .4s, -webkit-text-stroke .4s;
}
.cta-highlight:hover { color: var(--accent); -webkit-text-stroke: 1px var(--accent); }

/* =============================================================
   15. Footer
   ============================================================= */
.footer { border-top: 1px solid var(--line); padding-top: clamp(3.5rem, 7vw, 5rem); background: var(--bg-alt); }
.footer-inner { display: grid; gap: 3rem; padding-bottom: 3.5rem; }
@media (min-width: 780px) { .footer-inner { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.footer-brand .brand { margin-bottom: 1rem; }
.footer-tagline { color: var(--ink-mute); font-size: .92rem; max-width: 30ch; }
.footer-col h4 {
  font-family: var(--mono); font-weight: 500; font-size: .78rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-mute); margin-bottom: 1.1rem;
}
.footer-col a, .footer-col p { display: block; color: var(--ink-soft); font-size: .95rem; margin-bottom: .7rem; }
.footer-col a:hover { color: var(--accent); }
.footer-social { display: flex; gap: .8rem; margin-top: .6rem; }
.footer-social a {
  width: 36px; height: 36px; display: grid; place-items: center;
  background: var(--accent); color: #fff; margin-bottom: 0;
  border: 1px solid var(--accent); border-radius: 999px;
  box-shadow: var(--shadow-accent);
  transition: background-color .3s var(--ease-out), border-color .3s var(--ease-out), transform .3s var(--ease-soft);
}
.footer-social a svg { width: 18px; height: 18px; }
.footer-social a:hover { background: var(--accent-hover); border-color: var(--accent-hover); transform: translateY(-2px); }

.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem;
  padding-block: 1.6rem; border-top: 1px solid var(--line);
  color: var(--ink-mute); font-size: .82rem;
}

/* =============================================================
   16. Reduced motion — only intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { transition-duration: .01s; }
  .hero-illustration { transition-duration: .01s; }
}
