/* =========================================================================
   AB Capital — styles.css
   Azure & Amber palette · Fraunces (serif) + Inter · refined / editorial.
   Light (#F5F7FB) / deep-navy (#0E1F3D) section rhythm. Accent used sparingly.
   ========================================================================= */

/* ---------- Design tokens ---------- */
:root {
  /* Light surfaces */
  --bg: #F5F7FB;            /* page background (cool off-white) */
  --panel: #E8EDF7;         /* tinted panels */
  --white: #FFFFFF;         /* cards */
  --border: #DDE3EE;        /* hairlines / dividers */

  /* Navy + azure */
  --ink: #0E1F3D;           /* primary text + dark sections (deep navy) */
  --muted: #5A6577;         /* secondary text */
  --accent: #2563EB;        /* azure — marks, icons, large accents, borders */
  --accent-strong: #1D4ED8; /* AA-safe azure — links, buttons, small accents */
  --accent-hover: #1A43B8;  /* hover / deeper */

  /* Detail accent — Google amber. Used VERY sparingly for small touches
     (eyebrow ticks, numerals, stat units, marks), never large areas. */
  --detail: #F5A623;
  --detail-deep: #B5740C;   /* darker amber for small text on light surfaces */

  /* Dark (navy) section tones */
  --d-bg: #0E1F3D;
  --d-text: #EAF0FA;
  --d-muted: #9FB0C9;
  --d-border: rgba(255, 255, 255, 0.13);
  --d-card: #16294A;
  --d-accent: #8FB4FF;      /* light blue — accents/stats on navy */

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Layout */
  --nav-h: 72px;
  --container: 1120px;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --section-y: clamp(4.5rem, 9vw, 8rem);
  --radius: 16px;
  --radius-sm: 11px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 0.18s;
  --t: 0.34s;

  /* Shadows (soft, neutral) */
  --shadow-sm: 0 1px 2px rgba(14, 31, 61, 0.05), 0 2px 10px rgba(14, 31, 61, 0.05);
  --shadow-md: 0 14px 40px -18px rgba(14, 31, 61, 0.28);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 1.0625rem;
  font-weight: 400;
  letter-spacing: -0.006em;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
ul, ol { list-style: none; padding: 0; }

/* The [hidden] attribute must always win, even over components that set
   their own display (e.g. .btn { display: inline-flex }). */
[hidden] { display: none !important; }

::selection { background: var(--accent); color: #fff; }

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

.skip-link {
  position: absolute; left: 0; top: -100%;
  background: var(--ink); color: #fff;
  padding: 0.75rem 1.25rem; z-index: 200;
  border-radius: 0 0 8px 0;
  transition: top var(--t-fast);
}
.skip-link:focus { top: 0; }

/* ---------- Layout ---------- */
.container {
  width: 100%; max-width: var(--container);
  margin-inline: auto; padding-inline: var(--gutter);
}
.section {
  padding-block: var(--section-y);
  scroll-margin-top: var(--nav-h);
  position: relative;
}
.section--dark { background: var(--d-bg); color: var(--d-text); }
.section--tint { background: var(--panel); }

.section__head { max-width: 720px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section__head--center { margin-inline: auto; text-align: center; }

/* ---------- Typography ---------- */
.eyebrow {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-strong);
  display: inline-flex; align-items: center; gap: 0.65rem;
  margin-bottom: 1.2rem;
}
.eyebrow::before { content: ""; width: 22px; height: 1.5px; background: var(--detail); }
.section--dark .eyebrow { color: var(--d-accent); }
.section--dark .eyebrow::before { background: var(--detail); }
.section__head--center .eyebrow::before { display: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.012em;
}

.section__title { font-size: clamp(1.8rem, 3.8vw, 2.7rem); line-height: 1.12; font-weight: 500; }
.section__intro { margin-top: 1.25rem; color: var(--muted); }
.section--dark .section__intro { color: var(--d-muted); }
.section__head--center .section__intro { margin-inline: auto; max-width: 600px; }

.lead { font-size: clamp(1.05rem, 1.5vw, 1.18rem); line-height: 1.6; }

/* italic accent (replaces highlight bar) */
.mark { color: var(--accent-strong); font-style: italic; font-weight: 500; }
.section--dark .mark { color: var(--d-accent); }

/* ---------- Buttons ---------- */
.btn {
  --pad-y: 0.85rem; --pad-x: 1.5rem;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: var(--pad-y) var(--pad-x);
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.98rem;
  letter-spacing: -0.005em;
  line-height: 1;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast),
              color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

/* primary (azure) */
.btn--gold {
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 10px 24px -12px rgba(14, 31, 61, 0.5);
}
.btn--gold:hover { background: var(--accent-hover); }
.section--dark .btn--gold { background: var(--d-accent); color: var(--ink); }
.section--dark .btn--gold:hover { background: #B3CCFF; }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--ink); background: var(--white); }
.section--dark .btn--ghost { color: var(--d-text); border-color: var(--d-border); }
.section--dark .btn--ghost:hover { border-color: var(--d-text); background: rgba(255,255,255,0.05); }

.btn--lg { --pad-y: 1.05rem; --pad-x: 2rem; font-size: 1.05rem; }
.btn--sm { --pad-y: 0.6rem; --pad-x: 1.15rem; font-size: 0.9rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

.link { color: var(--accent-strong); border-bottom: 1.5px solid var(--accent); padding-bottom: 1px; transition: color var(--t-fast); }
.link:hover { color: var(--accent-hover); }
.section--dark .link, .footer .link { color: var(--d-text); border-bottom-color: var(--d-accent); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(245, 247, 251, 0.82);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), box-shadow var(--t);
}
.nav.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.nav__inner { height: var(--nav-h); display: flex; align-items: center; justify-content: space-between; }

.brand {
  display: inline-flex; align-items: center; gap: 0.65rem;
  font-family: var(--font-display); font-weight: 500; font-size: 1.2rem; letter-spacing: -0.01em;
}
.brand__mark {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--ink);
}
.brand__mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.footer__brand .brand__mark { width: 42px; height: 42px; }

.nav__links { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.1rem); }
.nav__link {
  font-size: 0.95rem; font-weight: 500; color: var(--muted);
  position: relative; padding: 0.4rem 0; transition: color var(--t-fast);
}
.nav__link::after {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1.5px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t) var(--ease);
}
.nav__link:hover, .nav__link.is-active { color: var(--ink); }
.nav__link.is-active::after { transform: scaleX(1); }
.nav__cta { margin-left: 0.4rem; }

.nav__toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; background: transparent;
  border: 1px solid var(--border); border-radius: 10px;
}
.nav__toggle-bar { width: 20px; height: 1.5px; background: var(--ink); margin-inline: auto; transition: transform var(--t-fast), opacity var(--t-fast); }
.nav.is-open .nav__toggle-bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav.is-open .nav__toggle-bar:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle-bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(2.5rem, 6vw, 5rem); padding-bottom: clamp(3rem, 7vw, 5.5rem); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -22%; right: -8%;
  width: 46vw; height: 46vw; max-width: 580px; max-height: 580px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.16), transparent 64%);
  pointer-events: none; z-index: 0;
}
.hero__inner {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
.hero__title {
  font-size: clamp(2.3rem, 4.4vw, 3.7rem);
  line-height: 1.07; letter-spacing: -0.02em; font-weight: 500;
}
.hero__sub { margin-top: 1.5rem; max-width: 540px; color: var(--muted); }
.hero__cta { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }
.hero__note { margin-top: 1.7rem; font-size: 0.9rem; color: var(--muted); display: inline-flex; align-items: center; gap: 0.5rem; }
.hero__note::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--detail); }

/* hero track-record panel */
.hero__aside { background: var(--white); border: 1px solid var(--border); border-radius: 18px; padding: clamp(1.5rem, 2.4vw, 2.1rem); box-shadow: var(--shadow-sm); }
.hero__proof-label { display: inline-flex; align-items: center; gap: 0.55rem; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600; color: var(--muted); margin-bottom: 1.6rem; }
.hero__proof-label::before { content: ""; width: 18px; height: 1.5px; background: var(--detail); }
.hero__stats { display: flex; flex-direction: column; gap: 1.5rem; }
.hero__stats .hstat + .hstat { border-top: 1px solid var(--border); padding-top: 1.5rem; }
.hstat__value { font-family: var(--font-display); font-weight: 500; font-size: clamp(2rem, 2.6vw, 2.5rem); line-height: 1; color: var(--ink); letter-spacing: -0.02em; display: inline-flex; align-items: baseline; }
.hstat__pre { color: var(--muted); opacity: 0.55; }
.hstat__unit { font-size: 0.5em; font-style: italic; color: var(--detail-deep); margin-left: 1px; }
.hstat__label { display: block; margin-top: 0.45rem; color: var(--muted); font-size: 0.84rem; max-width: 26ch; }

/* ---------- Cards ---------- */
.cards { display: grid; gap: clamp(1rem, 2vw, 1.4rem); }
.cards--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: clamp(1.5rem, 2.4vw, 2rem);
  transition: transform var(--t) var(--ease), box-shadow var(--t), border-color var(--t);
  height: 100%;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.card--dark { background: var(--d-card); border-color: var(--d-border); color: var(--d-text); }
.card--dark:hover { border-color: rgba(143, 180, 255, 0.5); box-shadow: none; }
.card--accent { border-color: rgba(143, 180, 255, 0.5); }

.card__index { font-family: var(--font-display); font-weight: 500; font-style: italic; font-size: 0.95rem; color: var(--detail-deep); }
.card--dark .card__index { color: var(--detail); }

/* icon tile on cards */
.card__icon {
  display: inline-grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 13px;
  background: rgba(37, 99, 235, 0.10);
  color: var(--accent-strong);
  margin-bottom: 1.1rem;
}
.card--dark .card__icon { background: rgba(143, 180, 255, 0.14); color: var(--d-accent); }
.card__icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.card__title { font-size: 1.24rem; margin-top: 0.7rem; margin-bottom: 0.5rem; font-weight: 500; }
.card__body { color: var(--muted); font-size: 0.98rem; }
.card--dark .card__body { color: var(--d-muted); }

/* ---------- Compounding loop ---------- */
.compound {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center;
  border-top: 1px solid var(--d-border); padding-top: clamp(2.5rem, 5vw, 4rem);
}
.compound__title { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 500; }
.compound__body { margin-top: 1rem; color: var(--d-muted); }

.loop { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(0.5rem, 2vw, 1rem); }
.loop__node { text-align: center; padding: 1.4rem 1rem; border-radius: var(--radius); border: 1px solid var(--d-border); background: var(--d-card); }
.loop__node--google { border-color: rgba(143, 180, 255, 0.5); }
.loop__label { display: block; font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; }
.loop__node--google .loop__label { color: var(--d-accent); }
.loop__desc { font-size: 0.85rem; color: var(--d-muted); }
.loop__arrows { position: relative; width: clamp(80px, 18vw, 140px); }
.loop__svg { width: 100%; height: auto; overflow: visible; }
.loop__caption { position: absolute; left: 50%; transform: translateX(-50%); font-size: 0.64rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--d-muted); white-space: nowrap; }
.loop__caption--top { top: -6px; color: var(--d-accent); }
.loop__caption--bottom { bottom: -6px; }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.2rem, 3vw, 2.2rem) clamp(2rem, 5vw, 4rem); }
.step-item { display: flex; gap: 1.2rem; align-items: flex-start; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); }
.step-item__num { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent-strong); font-family: var(--font-display); font-weight: 500; font-size: 1.05rem; }
.step-item__title { font-size: 1.22rem; margin-bottom: 0.4rem; font-weight: 500; }
.step-item__body p { color: var(--muted); font-size: 0.98rem; }
.step-item__body strong { color: var(--ink); font-weight: 600; }
.how__note {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: clamp(1.3rem, 2.5vw, 1.8rem) clamp(1.5rem, 3vw, 2rem);
  background: var(--white); border: 1px solid var(--border);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  color: var(--muted); font-size: 0.98rem;
}

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 3vw, 2rem);
  margin-bottom: clamp(2.5rem, 5vw, 4rem); padding-bottom: clamp(2.5rem, 5vw, 4rem);
  border-bottom: 1px solid var(--d-border);
}
.stat__value { font-family: var(--font-display); font-weight: 500; font-size: clamp(2.5rem, 5.6vw, 3.8rem); line-height: 1; color: var(--d-accent); letter-spacing: -0.02em; display: inline-flex; align-items: baseline; }
.stat__pre { color: var(--d-text); opacity: 0.5; }
.stat__unit { font-size: 0.5em; font-style: italic; color: var(--detail); }
.stat__label { display: block; margin-top: 0.8rem; color: var(--d-muted); font-size: 0.95rem; max-width: 22ch; }

/* ---------- Team ---------- */
.team__grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
.team__copy p { margin-top: 1.1rem; color: var(--muted); }
.team__copy .lead { color: var(--ink); }
.team__copy strong { color: var(--ink); }

.principles { display: grid; gap: 1.1rem; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.5rem, 3vw, 2.2rem); }
.principle { display: flex; gap: 0.9rem; align-items: flex-start; font-size: 0.98rem; color: var(--muted); }
.principle strong { color: var(--ink); font-weight: 600; }
.principle__mark { flex: none; margin-top: 0.5rem; width: 8px; height: 8px; border-radius: 2px; background: var(--detail); transform: rotate(45deg); }

/* revenue-proof screenshot (team section): a browser window floating on a forest backdrop */
.proof { margin: 0; }
.proof__stage {
  position: relative;
  border-radius: 20px;
  padding: clamp(1rem, 3vw, 2.1rem);
  background: linear-gradient(152deg, #0E1F3D 0%, #16294A 100%);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.proof__stage::before {
  content: "";
  position: absolute; top: -28%; right: -12%;
  width: 62%; height: 80%;
  background: radial-gradient(circle, rgba(143, 180, 255, 0.30), transparent 70%);
  pointer-events: none;
}
.proof__stage::after {
  content: "";
  position: absolute; bottom: -30%; left: -14%;
  width: 55%; height: 70%;
  background: radial-gradient(circle, rgba(245, 166, 35, 0.16), transparent 70%);
  pointer-events: none;
}
.proof__window {
  position: relative;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 26px 50px -18px rgba(0, 0, 0, 0.5);
}
.proof__bar {
  display: flex; align-items: center; gap: 7px;
  padding: 11px 14px;
  background: #F4F6F2;
  border-bottom: 1px solid #E4E4E4;
}
.proof__bar span { width: 9px; height: 9px; border-radius: 50%; background: #D3DAE8; }
.proof__url { margin-left: 12px; flex: 1; max-width: 230px; height: 18px; border-radius: 9px; background: #E7EDE6; }
.proof__shot img { display: block; width: 100%; height: auto; }
.proof__cap { margin-top: 1rem; font-size: 0.88rem; color: var(--muted); text-align: center; }

/* ---------- Gates / work-with ---------- */
.gates { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2vw, 1.4rem); }
.gate { background: var(--d-card); border: 1px solid var(--d-border); border-radius: var(--radius); padding: clamp(1.5rem, 2.5vw, 2rem); }
.gate__tag { display: inline-block; font-size: 0.68rem; letter-spacing: 0.13em; text-transform: uppercase; font-weight: 600; color: var(--ink); background: var(--d-accent); padding: 0.28rem 0.65rem; border-radius: 999px; margin-bottom: 1rem; }
.gate--muted .gate__tag { background: transparent; color: var(--d-muted); border: 1px solid var(--d-border); }
.gate__title { font-size: 1.2rem; margin-bottom: 0.4rem; font-weight: 500; }
.gate p { color: var(--d-muted); font-size: 0.95rem; }

.work-with__cta { margin-top: clamp(2.5rem, 5vw, 4rem); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding-top: clamp(2rem, 4vw, 3rem); border-top: 1px solid var(--d-border); }
.work-with__cta p { font-family: var(--font-display); font-size: clamp(1.3rem, 2.6vw, 1.8rem); font-weight: 500; }

/* ---------- FAQ ---------- */
.faq { max-width: 760px; margin-inline: auto; }
.faq__item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.8rem;
  overflow: hidden;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.faq__item[open] { border-color: #C8D0E2; box-shadow: var(--shadow-sm); }
.faq__q {
  display: block; position: relative;
  padding: 1.15rem 3.1rem 1.15rem 1.35rem;
  font-family: var(--font-display); font-weight: 500; font-size: 1.1rem; letter-spacing: -0.01em;
  line-height: 1.35;
  cursor: pointer; list-style: none; color: var(--ink);
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q:focus-visible { outline: 2.5px solid var(--accent-strong); outline-offset: -3px; border-radius: var(--radius-sm); }
.faq__item:hover .faq__q { color: var(--accent-hover); }
.faq__chev {
  position: absolute; right: 1.35rem; top: 1.45rem;
  width: 9px; height: 9px;
  border-right: 2px solid var(--accent-strong);
  border-bottom: 2px solid var(--accent-strong);
  transform: rotate(45deg);
  transition: transform var(--t) var(--ease);
}
.faq__item[open] .faq__chev { transform: rotate(-135deg); top: 1.55rem; }
.faq__a { padding: 0 1.35rem 1.25rem; color: var(--muted); }
.faq__a p { max-width: 62ch; }
.faq__a strong { color: var(--ink); font-weight: 600; }
.faq__item[open] .faq__a { animation: slideDown var(--t) var(--ease); }

/* =========================================================================
   FORM — Typeform-style, one question per screen
   ========================================================================= */
.apply__inner { max-width: 720px; }

.form-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: clamp(16px, 2.5vw, 22px);
  box-shadow: var(--shadow-md);
  padding: clamp(1.5rem, 4vw, 2.75rem);
  margin-top: 0.5rem;
  position: relative;
  overflow: hidden;
  scroll-margin-top: 90px;
}

/* progress (top hairline bar) */
.form-progress { position: absolute; inset: 0 0 auto 0; }
.form-progress__track { height: 4px; background: var(--border); }
.form-progress__bar { height: 100%; width: 0; background: var(--accent); transition: width var(--t) var(--ease); }
.form-counter { display: flex; justify-content: space-between; align-items: baseline; margin: 1.4rem 0 1.75rem; font-size: 0.82rem; }
.form-counter__step { color: var(--accent-strong); font-weight: 600; letter-spacing: 0.02em; }
.form-counter__name { color: var(--muted); }

/* screens */
.form-screens { position: relative; min-height: 260px; }
.screen {
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.screen.is-active { opacity: 1; transform: none; }
.screen.is-leaving { opacity: 0; transform: translateY(-10px); }
.screen[hidden] { display: none; }

.q__eyebrow { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-strong); font-weight: 600; margin-bottom: 0.7rem; }
.q__title { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.35rem, 3vw, 1.9rem); line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 0.5rem; }
.q__title .req { color: var(--accent-strong); font-size: 0.6em; vertical-align: super; margin-left: 0.1rem; }
.q__help { color: var(--muted); font-size: 0.96rem; margin-bottom: 1.4rem; }
.q__optional { color: var(--accent-strong); font-weight: 600; font-style: italic; }

/* fields */
.field { margin-bottom: 1.2rem; }
.field:last-child { margin-bottom: 0; }
.field__sublabel { display: block; font-weight: 500; font-size: 0.92rem; margin-bottom: 0.5rem; color: var(--ink); }

.input {
  width: 100%;
  padding: 0.95rem 1.05rem;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input::placeholder { color: #9AA3B5; }
.input:hover { border-color: #C2CADD; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16); }

.input-affix { position: relative; display: flex; align-items: center; }
.input-affix__lead { position: absolute; left: 1.05rem; color: var(--muted); font-weight: 500; pointer-events: none; }
.input--affixed { padding-left: 2.1rem; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field-row--3 { grid-template-columns: repeat(3, 1fr); }

/* error states */
.field__error { font-size: 0.85rem; color: #b3392b; margin-top: 0.45rem; display: none; }
.field.has-error .input { border-color: #b3392b; background: #fcf3f1; }
.field.has-error .field__error { display: block; }
.choices.has-error { outline: 1.5px dashed #b3392b; outline-offset: 6px; border-radius: 12px; }

.form-error-banner { margin-top: 1rem; padding: 0.8rem 1rem; background: #fcf3f1; border: 1px solid #eec4bd; color: #b3392b; border-radius: var(--radius-sm); font-size: 0.92rem; }

/* choices (radio cards) */
.choices { display: grid; gap: 0.65rem; }
.choices--inline { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice__box {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.95rem 1.15rem;
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--t-fast), background var(--t-fast);
  min-height: 54px;
}
.choice__box::before { content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #B7C0D4; transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast); }
.choice:hover .choice__box { border-color: #B7C0D4; background: var(--bg); }
.choice input:focus-visible + .choice__box { outline: 2.5px solid var(--accent-strong); outline-offset: 2px; }
.choice input:checked + .choice__box { border-color: var(--accent); background: #E7EEFD; }
.choice input:checked + .choice__box::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 4px #fff; }
.choice__title { font-weight: 500; font-size: 0.98rem; }

/* conditional block */
.conditional { margin-top: 1.2rem; padding: 1.3rem 1.3rem 1.4rem; background: var(--bg); border: 1px dashed var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); animation: slideDown var(--t) var(--ease); }
.conditional .field:last-child { margin-bottom: 0; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* consent */
.consent { display: flex; gap: 0.85rem; align-items: flex-start; cursor: pointer; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 1.1rem 1.2rem; }
.consent input { position: absolute; opacity: 0; width: 0; height: 0; }
.consent__box { flex: none; margin-top: 1px; width: 22px; height: 22px; border-radius: 6px; border: 2px solid #B7C0D4; background: var(--white); display: grid; place-items: center; transition: border-color var(--t-fast), background var(--t-fast); }
.consent__box::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) scale(0); margin-top: -2px; transition: transform var(--t-fast) var(--ease); }
.consent input:checked + .consent__box { background: var(--accent-strong); border-color: var(--accent-strong); }
.consent input:checked + .consent__box::after { transform: rotate(45deg) scale(1); }
.consent input:focus-visible + .consent__box { outline: 2.5px solid var(--accent-strong); outline-offset: 2px; }
.consent__text { font-size: 0.94rem; color: var(--muted); line-height: 1.55; }

/* form nav */
.form-nav { display: flex; align-items: center; gap: 0.9rem; margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
#btn-back { margin-right: auto; }
.form-hint { margin-left: auto; font-size: 0.82rem; color: var(--muted); display: inline-flex; align-items: center; gap: 0.4rem; }
.form-hint kbd { font-family: var(--font-body); font-size: 0.72rem; background: var(--panel); border: 1px solid var(--border); border-radius: 5px; padding: 0.12rem 0.4rem; color: var(--ink); }
#btn-next, #btn-submit { flex: none; }

/* submit spinner */
.btn__spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; display: none; }
.btn.is-loading { pointer-events: none; opacity: 0.85; }
.btn.is-loading .btn__spinner { display: inline-block; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ending screens */
.ending { text-align: center; padding: clamp(1.5rem, 4vw, 3rem) 0.5rem; }
.ending__icon { width: 64px; height: 64px; margin: 0 auto 1.5rem; border-radius: 50%; display: grid; place-items: center; background: #E7EEFD; border: 1.5px solid var(--accent); }
.ending__icon::after { content: ""; width: 17px; height: 30px; border: solid var(--accent-strong); border-width: 0 3px 3px 0; transform: rotate(45deg); margin-top: -6px; }
.ending--neutral .ending__icon { background: var(--bg); border-color: var(--border); }
.ending--neutral .ending__icon::after { width: 22px; height: 22px; border: none; border-radius: 50%; background: var(--muted); transform: none; margin: 0; }
.ending__title { font-family: var(--font-display); font-size: clamp(1.5rem, 3.2vw, 2rem); margin-bottom: 0.8rem; font-weight: 500; }
.ending__body { color: var(--muted); max-width: 46ch; margin-inline: auto; font-size: 1.05rem; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--d-text); padding-block: clamp(3rem, 6vw, 4.5rem); }
.footer__inner { display: grid; gap: 1.2rem; }
.footer__brand { display: flex; align-items: center; gap: 0.7rem; font-family: var(--font-display); font-weight: 500; font-size: 1.35rem; }
.footer__tag { font-family: var(--font-display); font-weight: 500; font-size: clamp(1.3rem, 3vw, 1.9rem); max-width: 18ch; }
.footer__meta { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; margin-top: 1rem; padding-top: 1.5rem; border-top: 1px solid var(--d-border); font-size: 0.92rem; color: var(--d-muted); }
.footer__copy { margin-left: auto; }

/* =========================================================================
   Modal (privacy policy) — native <dialog>
   ========================================================================= */
.modal {
  width: min(680px, 92vw);
  max-height: 86vh;
  padding: 0;
  border: none;
  border-radius: 18px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 30px 70px -24px rgba(8, 18, 38, 0.5);
  overflow: hidden;
}
.modal::backdrop { background: rgba(8, 18, 38, 0.55); backdrop-filter: blur(3px); }
.modal[open] { animation: modalIn 0.26s var(--ease); }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }

.modal__head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border-bottom: 1px solid var(--border);
}
.modal__title { font-family: var(--font-display); font-weight: 500; font-size: 1.4rem; letter-spacing: -0.01em; }
.modal__close {
  flex: none; width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--muted); font-size: 1.4rem; line-height: 1;
  transition: border-color var(--t-fast), color var(--t-fast);
}
.modal__close:hover { border-color: var(--ink); color: var(--ink); }
.modal__body { padding: 1.5rem; overflow-y: auto; max-height: calc(86vh - 74px); }

.policy__updated { color: var(--muted); font-size: 0.85rem; margin-bottom: 1.3rem; }
.policy h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; margin: 1.5rem 0 0.45rem; }
.policy p, .policy li { color: var(--muted); font-size: 0.95rem; }
.policy p { margin-bottom: 0.7rem; }
.policy ul { padding-left: 1.15rem; list-style: disc; margin-bottom: 0.7rem; }
.policy li { margin-bottom: 0.4rem; }
.policy strong { color: var(--ink); font-weight: 600; }

/* =========================================================================
   Scroll reveal
   ========================================================================= */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); will-change: opacity, transform; }
.reveal.is-visible { opacity: 1; transform: none; }
.cards .reveal.is-visible, .steps .reveal.is-visible { transition-delay: var(--reveal-delay, 0s); }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; gap: clamp(2rem, 5vw, 3rem); }
  .hero__aside { background: transparent; border: 0; box-shadow: none; padding: 0; border-top: 1px solid var(--border); padding-top: 1.9rem; }
  .hero__stats { flex-direction: row; flex-wrap: wrap; gap: clamp(1.5rem, 5vw, 2.5rem); }
  .hero__stats .hstat + .hstat { border-top: 0; padding-top: 0; }
  .hstat__label { max-width: 18ch; }
  .cards--3 { grid-template-columns: 1fr 1fr; }
  .gates { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; gap: 1.8rem; }
  .stat__label { max-width: none; }
  .compound { grid-template-columns: 1fr; }
  .team__grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --nav-h: 64px; }
  .nav__toggle { display: flex; }
  .nav__links {
    position: fixed; inset: var(--nav-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0.25rem;
    background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-md);
    padding: 1rem var(--gutter) 1.5rem;
    transform: translateY(-120%); transition: transform var(--t) var(--ease); visibility: hidden;
  }
  .nav.is-open .nav__links { transform: translateY(0); visibility: visible; }
  .nav__link { padding: 0.85rem 0; font-size: 1.05rem; border-bottom: 1px solid var(--border); }
  .nav__link::after { display: none; }
  .nav__link.is-active { color: var(--accent-strong); }
  .nav__cta { margin: 0.8rem 0 0; text-align: center; }

  .cards--3 { grid-template-columns: 1fr; }
  .field-row, .field-row--3 { grid-template-columns: 1fr; }
  /* mobile hero (left-aligned) */
  .hero { padding-top: 1.5rem; padding-bottom: 2.5rem; }
  .hero__title { font-size: clamp(1.95rem, 8.4vw, 2.35rem); line-height: 1.1; }
  .hero__sub { margin-top: 1.1rem; font-size: 1.02rem; line-height: 1.55; }
  .hero__cta { margin-top: 1.6rem; }
  .hero__cta .btn { flex: 1 1 auto; --pad-y: 0.95rem; --pad-x: 1.35rem; font-size: 1rem; }
  .hero__note { margin-top: 1.15rem; }
  .hero__aside { margin-top: 1.8rem; padding-top: 1.6rem; }
  .hstat__value { font-size: 1.7rem; }
  .hstat__label { font-size: 0.8rem; }
  .form-nav { flex-wrap: wrap; }
  .form-hint { display: none; }
  #btn-next, #btn-submit { flex: 1 1 auto; }
  .work-with__cta { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .loop { grid-template-columns: 1fr; gap: 0.75rem; }
  .loop__arrows { transform: rotate(90deg); margin: 0.5rem auto; }
}

/* =========================================================================
   Reduced motion
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .reveal, .screen { opacity: 1; transform: none; }
  .btn:hover, .card:hover { transform: none; }
}
