/* ===========================================================
   Canary Crest — stylesheet
   Dark-first design system. Tokens live on :root.
   =========================================================== */

:root {
  --bg: #0b0f14;
  --bg-elev: #10161e;
  --bg-alt: #0d1218;
  --surface: #141b24;
  --surface-2: #1a232e;
  --border: #223040;
  --border-strong: #2e3f52;
  --text: #e8eef5;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --canary: #ffd23f;
  --canary-deep: #f5b800;
  --canary-ink: #1a1400;
  --teal: #2dd4bf;
  --blue: #60a5fa;
  --orange: #ff9f1c;
  --danger: #fb7185;
  --ok: #34d399;

  --grad-cool: linear-gradient(135deg, var(--teal), var(--blue));
  --grad-warm: linear-gradient(135deg, #ffe066, var(--canary-deep));

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --gutter: 16px;
  --container: 1160px;
  --shadow: 0 10px 40px -12px rgb(0 0 0 / .6);
  --ring: 0 0 0 3px rgb(255 210 63 / .35);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
p { margin: 0; }
code { font-family: var(--font-mono); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

.skip {
  position: absolute; left: 8px; top: -48px; z-index: 100;
  padding: 8px 12px; background: var(--canary); color: var(--canary-ink);
  border-radius: var(--radius-sm); font-weight: 600;
}
.skip:focus { top: 8px; }

.container {
  width: min(100% - var(--gutter) * 2, var(--container));
  margin-inline: auto;
}

/* ---------- typography helpers ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--canary);
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--canary);
  box-shadow: 0 0 0 4px rgb(255 210 63 / .18);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 4px rgb(255 210 63 / .18);} 50% { box-shadow: 0 0 0 8px rgb(255 210 63 / .06);} }

h1 { font-size: clamp(2.3rem, 5.6vw, 4.2rem); font-weight: 700; }
h1 em {
  font-style: normal;
  background: var(--grad-warm);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
h2 { font-size: clamp(1.75rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.2rem; }
.lede { color: var(--text-muted); font-size: 1.08rem; max-width: 62ch; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: .96rem; line-height: 1; cursor: pointer;
  transition: transform .15s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: var(--canary); color: var(--canary-ink);
  box-shadow: 0 8px 30px -10px rgb(255 210 63 / .55);
}
.btn--primary:hover { background: #ffe066; box-shadow: 0 10px 36px -8px rgb(255 210 63 / .7); }
.btn--ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--text-muted); background: rgb(255 255 255 / .03); }
.btn--sm { padding: 10px 16px; font-size: .9rem; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgb(11 15 20 / .72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, background .25s ease;
}
.nav.is-scrolled { border-bottom-color: var(--border); background: rgb(11 15 20 / .86); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__mark { width: 36px; height: 36px; filter: drop-shadow(0 0 10px rgb(255 210 63 / .25)); }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.brand__name span { color: var(--canary); }

.nav__links { display: flex; align-items: center; gap: 28px; }
.nav__links a:not(.btn) { color: var(--text-muted); font-weight: 500; font-size: .95rem; transition: color .2s; }
.nav__links a:not(.btn):hover { color: var(--text); }

.nav__toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 9px; background: none; border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.nav__toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s, opacity .25s; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- hero ---------- */
.hero { position: relative; padding: 84px 0 72px; overflow: hidden; isolation: isolate; }
.hero__glow {
  position: absolute; inset: -30% -10% auto -10%; height: 70%; z-index: -2;
  background:
    radial-gradient(600px 400px at 20% 30%, rgb(255 210 63 / .14), transparent 60%),
    radial-gradient(700px 500px at 80% 20%, rgb(45 212 191 / .12), transparent 60%),
    radial-gradient(500px 400px at 60% 80%, rgb(96 165 250 / .10), transparent 60%);
  filter: blur(20px);
}
.hero__grid {
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(rgb(255 255 255 / .035) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / .035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 20%, #000 30%, transparent 100%);
}
.hero__inner { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.hero__copy .lede { margin-top: 22px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__proof { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-top: 36px; color: var(--text-dim); font-size: .9rem; }
.hero__proof strong { color: var(--text-muted); font-weight: 600; }

/* terminal panel */
.term {
  background: linear-gradient(180deg, var(--surface), var(--bg-elev));
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgb(255 255 255 / .04);
  overflow: hidden;
  transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
  transition: transform .5s ease;
}
.hero__panel:hover .term { transform: perspective(1200px) rotateY(0) rotateX(0); }
.term__bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--border); background: rgb(0 0 0 / .18); }
.term__bar span { width: 10px; height: 10px; border-radius: 50%; background: #2e3f52; }
.term__bar span:nth-child(1) { background: #ff5f57; } .term__bar span:nth-child(2) { background: #febc2e; } .term__bar span:nth-child(3) { background: #28c840; }
.term__title { margin-left: auto; font-size: 12px; color: var(--text-dim); }
.term__body { padding: 20px 22px 16px; display: grid; gap: 18px; }
.metric__label { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.metric__row { display: flex; align-items: baseline; gap: 12px; margin-top: 4px; font-family: var(--font-display); }
.metric__from { color: var(--text-dim); text-decoration: line-through; font-size: 1.05rem; }
.metric__arrow { color: var(--text-dim); }
.metric__to { font-size: 1.6rem; font-weight: 700; color: var(--canary); font-variant-numeric: tabular-nums; }
.bar { height: 4px; margin-top: 8px; border-radius: 4px; background: rgb(255 255 255 / .06); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad-cool); transition: width 1.6s cubic-bezier(.2,.7,.2,1); }
.is-visible .bar i { width: var(--w); }
.term__foot { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); margin-top: 4px; }
.blink { color: var(--canary); animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- marquee ---------- */
.marquee {
  border-block: 1px solid var(--border);
  background: var(--bg-alt);
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee__track { display: flex; width: max-content; animation: scroll 46s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee ul { display: flex; gap: 44px; padding: 16px 22px; }
.marquee li { font-family: var(--font-mono); font-size: 13px; color: var(--text-dim); white-space: nowrap; letter-spacing: .04em; }
.marquee li::before { content: "◆ "; color: var(--canary); opacity: .6; font-size: 9px; vertical-align: middle; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- sections ---------- */
.section { padding: 96px 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section__head { max-width: 720px; margin-bottom: 52px; }
.section__head .lede { margin-top: 16px; }

.grid { display: grid; gap: 20px; }
.services { grid-template-columns: repeat(4, 1fr); }
.outcomes { grid-template-columns: repeat(4, 1fr); }

/* ---------- cards ---------- */
.card {
  position: relative;
  padding: 26px 24px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 12px;
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}
.card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgb(255 210 63 / .6), transparent 40%, transparent 60%, rgb(45 212 191 / .5));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .3s ease;
}
.card:hover { transform: translateY(-4px); background: var(--surface-2); }
.card:hover::before { opacity: 1; }
.card__icon {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 12px; background: rgb(255 210 63 / .08); border: 1px solid rgb(255 210 63 / .18);
}
.card__icon svg { width: 22px; height: 22px; fill: none; stroke: var(--canary); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card p { color: var(--text-muted); font-size: .95rem; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tags li {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-dim);
  padding: 4px 9px; border-radius: 6px; background: rgb(255 255 255 / .04); border: 1px solid var(--border);
}

/* ---------- steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.step { position: relative; padding: 28px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.step__num { font-family: var(--font-mono); font-size: 13px; color: var(--canary); letter-spacing: .1em; }
.step h3 { margin-top: 10px; }
.step p { margin-top: 10px; color: var(--text-muted); font-size: .95rem; }
.step::after {
  content: ""; position: absolute; top: 44px; right: -20px; width: 20px; height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}
.step:last-child::after { display: none; }

/* ---------- stats ---------- */
.stat { padding: 28px 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.stat__num {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(2.2rem, 4vw, 3rem); letter-spacing: -.03em;
  background: var(--grad-warm); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat__label { margin-top: 10px; color: var(--text-muted); font-size: .93rem; }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: start; }
.about__copy p + p { margin-top: 16px; }
.about__copy p:not(.eyebrow) { color: var(--text-muted); }
.about__copy h2 { margin-bottom: 20px; }
.principles { display: grid; gap: 12px; margin-top: 54px; }
.principles li {
  padding: 18px 20px; border-left: 2px solid var(--canary); background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-muted); font-size: .95rem;
}
.principles strong { color: var(--text); }

/* ---------- intake ---------- */
.intake { position: relative; overflow: hidden; }
.intake::before {
  content: ""; position: absolute; inset: auto -20% -40% -20%; height: 60%; z-index: 0; pointer-events: none;
  background: radial-gradient(60% 60% at 50% 100%, rgb(255 210 63 / .10), transparent 70%);
}
.intake__inner { position: relative; z-index: 1; display: grid; grid-template-columns: .8fr 1.2fr; gap: 56px; align-items: start; }
.intake__copy { position: sticky; top: 96px; }
.intake__copy .lede { margin-top: 16px; }
.intake__notes { margin-top: 28px; display: grid; gap: 10px; color: var(--text-muted); font-size: .95rem; }
.intake__notes li::before { content: "— "; color: var(--canary); }
.intake__notes a { color: var(--canary); border-bottom: 1px solid rgb(255 210 63 / .35); }

.form {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; display: grid; gap: 20px; box-shadow: var(--shadow);
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend { font-size: .9rem; font-weight: 500; color: var(--text-muted); }
.field legend { padding: 0; margin-bottom: 8px; }
.req { color: var(--canary); }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--border-strong); color: var(--text);
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder, .field textarea::placeholder { color: var(--text-dim); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--canary); box-shadow: var(--ring); outline: none; }
.field textarea { resize: vertical; min-height: 140px; }
.field select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.field select option { background: var(--surface); }
.field.is-invalid input, .field.is-invalid textarea, .field.is-invalid select { border-color: var(--danger); }
.field.is-invalid label, .field.is-invalid legend { color: var(--danger); }
.field .error { font-size: .82rem; color: var(--danger); }

.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checks label {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg);
  font-size: .9rem; color: var(--text-muted); transition: border-color .2s, color .2s, background .2s;
}
.checks label:hover { border-color: var(--border-strong); color: var(--text); }
.checks label:has(:checked) { border-color: rgb(255 210 63 / .6); color: var(--text); background: rgb(255 210 63 / .06); }
.checks input { accent-color: var(--canary); width: 16px; height: 16px; margin: 0; flex: none; }

.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.form__actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.form__fine { font-size: .82rem; color: var(--text-dim); }
.form__status { font-size: .95rem; min-height: 1.4em; }
.form__status.ok { color: var(--ok); }
.form__status.err { color: var(--danger); }

.form.is-sent { position: relative; }
.form__success {
  display: grid; place-items: center; text-align: center; gap: 12px; padding: 40px 20px;
}
.form__success h3 { font-size: 1.5rem; }
.form__success p { color: var(--text-muted); max-width: 44ch; }
.form__success .check {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: rgb(52 211 153 / .12); border: 1px solid rgb(52 211 153 / .4); color: var(--ok);
}

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-alt); padding: 40px 0; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer__links { display: flex; flex-wrap: wrap; gap: 20px; font-size: .9rem; color: var(--text-muted); }
.footer__links a:hover { color: var(--text); }
.footer__copy { font-size: .85rem; color: var(--text-dim); width: 100%; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.is-visible { opacity: 1; transform: none; }
.grid .reveal:nth-child(2), .steps .reveal:nth-child(2) { transition-delay: .07s; }
.grid .reveal:nth-child(3), .steps .reveal:nth-child(3) { transition-delay: .14s; }
.grid .reveal:nth-child(4), .steps .reveal:nth-child(4) { transition-delay: .21s; }
.grid .reveal:nth-child(5) { transition-delay: .07s; }
.grid .reveal:nth-child(6) { transition-delay: .14s; }
.grid .reveal:nth-child(7) { transition-delay: .21s; }
.grid .reveal:nth-child(8) { transition-delay: .28s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .marquee__track, .eyebrow .dot, .blink { animation: none; }
  .term { transform: none; }
  .bar i { transition: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .outcomes { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .step::after { display: none; }
  .hero__inner { grid-template-columns: 1fr; gap: 44px; }
  .term { transform: none; }
  .about { grid-template-columns: 1fr; gap: 32px; }
  .principles { margin-top: 0; }
  .intake__inner { grid-template-columns: 1fr; gap: 36px; }
  .intake__copy { position: static; }
}

@media (max-width: 760px) {
  .nav__links {
    position: absolute; top: 68px; left: 0; right: 0;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-elev); border-bottom: 1px solid var(--border);
    padding: 8px var(--gutter) 16px;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a:not(.btn) { padding: 14px 4px; border-bottom: 1px solid var(--border); }
  .nav__links .btn { margin-top: 14px; }
  .nav__toggle { display: flex; }
  .hero { padding: 56px 0 48px; }
  .section { padding: 64px 0; }
  .services, .outcomes, .steps { grid-template-columns: 1fr; }
  .form { padding: 22px 18px; }
  .form__row, .checks { grid-template-columns: 1fr; }
  .hero__proof { flex-direction: column; gap: 8px; }
}
