/* Cartekks landing page styles. Tokens follow BRIEF.md: 8px grid, 12px card radius. */

:root {
  --ink: #0B0D10;
  --surface: #13161B;
  --raised: #1A1E24;
  --paper: #F2EFE8;
  --muted: #A9A49A;
  --line: #262A31;
  --line-strong: #6B717C;
  --amber: #F5A524;
  --amber-hover: #FFB84A;
  --signal: #7FB4FF;
  --error: #FF9C8F;

  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Archivo", "Inter", system-ui, sans-serif;

  --radius: 12px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease-out: cubic-bezier(.2, .7, .2, 1);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
address { font-style: normal; }
[hidden] { display: none !important; }

a { color: var(--paper); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--amber); }

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

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 50;
  background: var(--amber); color: var(--ink); padding: 8px 16px; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 16px; color: var(--ink); }

.wrap { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }

/* Type */
.display, .h2, .step-num {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -0.015em;
}
.h2 { font-size: clamp(1.75rem, 1rem + 2.4vw, 2.75rem); line-height: 1.05; }
.section-intro { color: var(--muted); font-size: 1.125rem; margin-top: 16px; max-width: 34em; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px; border-radius: var(--radius);
  font: 600 1rem/1 var(--font-ui); text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary { background: var(--amber); color: var(--ink); }
.btn-primary:hover { background: var(--amber-hover); color: var(--ink); }
.btn-quiet { color: var(--paper); border-color: var(--line-strong); background: transparent; }
.btn-quiet:hover { color: var(--paper); border-color: var(--paper); }

/* Header */
.site-header { position: relative; z-index: 2; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--paper); }
.brand:hover { color: var(--paper); }
.brand-mark { width: 24px; height: 24px; }
.brand-word { font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: clamp(16px, 3vw, 32px); }
.nav-links a { text-decoration: none; color: var(--muted); font-weight: 500; font-size: .9375rem; padding: 8px 0; }
.nav-links a:hover { color: var(--paper); }

/* Hero */
.hero { position: relative; padding-block: clamp(24px, 5vw, 64px) clamp(72px, 9vw, 120px); overflow: hidden; }
.hero-grid { position: relative; display: grid; gap: 56px; align-items: center; }
.hero-copy { max-width: 46rem; }
.display { font-size: clamp(2.4rem, 1rem + 4.4vw, 5rem); line-height: .95; }
.display span { display: block; }
.display span + span { color: var(--muted); }
.hero-sub { margin-top: 24px; font-size: clamp(1.0625rem, 1rem + .4vw, 1.25rem); color: var(--paper); max-width: 30em; line-height: 1.5; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }

/* Three light streaks behind the phone: the ranked results motif. Static. */
.hero-streaks { position: absolute; inset: 0; pointer-events: none; }
.hero-streaks span {
  position: absolute; right: -10%; height: 3px; border-radius: 3px; width: 80%;
  background: linear-gradient(90deg, transparent, var(--c) 55%, transparent);
  opacity: var(--o);
}
.hero-streaks span:nth-child(1) { --c: var(--amber); --o: .55; top: 46%; }
.hero-streaks span:nth-child(2) { --c: var(--paper); --o: .22; top: 54%; width: 64%; right: -4%; }
.hero-streaks span:nth-child(3) { --c: var(--paper); --o: .12; top: 62%; width: 46%; right: 2%; }

@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) auto; gap: 64px; }
}

/* Demo */
.demo { display: flex; flex-direction: column; align-items: center; gap: 16px; justify-self: center; width: 100%; max-width: 360px; }
.demo-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: .8125rem; text-align: center; }
.demo-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px;
  background: transparent; color: var(--paper); border: 1px solid var(--line-strong); border-radius: 999px;
  font: 500 .875rem/1 var(--font-ui); cursor: pointer;
}
.demo-toggle[hidden] { display: none; }
.demo-toggle:hover { border-color: var(--paper); }
.demo-toggle svg { width: 16px; height: 16px; }
.demo-toggle .i-play { display: none; }
.demo-toggle[data-paused="true"] .i-pause { display: none; }
.demo-toggle[data-paused="true"] .i-play { display: block; }

.phone {
  position: relative; width: 100%; max-width: 340px; height: 700px;
  padding: 10px; border-radius: 48px;
  background: #050608;
  box-shadow: 0 0 0 1px #2C3038, 0 0 0 2px #0E1014, 0 40px 80px -24px rgba(0, 0, 0, .8), 0 0 120px -40px rgba(245, 165, 36, .25);
}
.phone-screen {
  height: 100%; border-radius: 38px; overflow: hidden;
  background: var(--ink); display: flex; flex-direction: column;
  font-size: 13px; line-height: 1.4; color: var(--paper);
}
.phone-status { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px 4px; font-size: 12px; font-weight: 600; height: 40px; }
.phone-island { width: 84px; height: 24px; border-radius: 12px; background: #000; }
.phone-signal { display: flex; align-items: flex-end; gap: 2px; width: 28px; justify-content: flex-end; }
.phone-signal i { display: block; width: 3px; border-radius: 1px; background: var(--paper); }
.phone-signal i:nth-child(1) { height: 5px; }
.phone-signal i:nth-child(2) { height: 8px; }
.phone-signal i:nth-child(3) { height: 11px; }

.app-bar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.app-avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--raised); color: var(--amber); }
.app-avatar svg { width: 18px; height: 18px; }
.app-title { font-weight: 600; font-size: 14px; }
.app-state { margin-left: auto; font-size: 11px; color: var(--muted); }
.app-state.is-thinking { color: var(--signal); }

.thread {
  flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 40px);
  mask-image: linear-gradient(to bottom, transparent 0, #000 40px);
  transition: opacity .6s ease;
}
.thread.is-fading { opacity: 0; }
.thread-inner { display: flex; flex-direction: column; gap: 8px; padding: 12px; will-change: transform; }
.thread-inner.is-flipping { transition: transform .5s var(--ease-out); }

.msg { max-width: 86%; padding: 8px 12px; border-radius: 16px; }
.msg-user { align-self: flex-end; background: var(--paper); color: var(--ink); border-bottom-right-radius: 4px; font-weight: 500; }
.msg-auto { align-self: flex-start; background: var(--raised); border-bottom-left-radius: 4px; }
.msg-saved { color: var(--paper); box-shadow: inset 2px 0 0 var(--amber); }

.typing { display: flex; gap: 4px; padding: 12px 14px; }
.typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--signal); animation: dot 1.1s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

/* Working state */
.work { padding: 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid #1F2E44; }
.work-bar { height: 2px; border-radius: 2px; background: #1E2836; overflow: hidden; margin-bottom: 12px; }
.work-bar span { display: block; height: 100%; background: var(--signal); transform-origin: left center; transform: scaleX(0); }
.work-lines { display: grid; gap: 8px; }
.work-lines li { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: start; font-size: 12px; color: var(--paper); transition: opacity .3s ease; }
.work-lines li.is-wait { opacity: .3; }
.work-lines li b { font-weight: 600; color: var(--signal); font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0; transition: opacity .3s ease; }
.work-lines li.is-active b, .work-lines li.is-done b { opacity: 1; }
.work-lines li.is-done b { color: var(--muted); }
.tick { position: relative; width: 14px; height: 14px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--line-strong); }
.is-active .tick { border-color: var(--signal); border-top-color: transparent; animation: spin .8s linear infinite; }
.is-done .tick { border-color: var(--signal); background: var(--signal); }
.is-done .tick::after {
  content: ""; position: absolute; left: 3.5px; top: 1.5px; width: 3px; height: 6px;
  border: solid var(--ink); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
@keyframes spin { to { transform: rotate(360deg); } }

.work-summary { font-size: 12px; color: var(--muted); padding: 0 4px; }

/* Result cards */
.results { display: grid; gap: 8px; }
.car { padding: 10px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: opacity .45s ease, transform .5s var(--ease-out); }
.car-top { border-color: rgba(245, 165, 36, .55); }
.car-head { display: flex; align-items: center; gap: 8px; }
.car-rank { font-family: var(--font-display); font-stretch: 112%; font-weight: 800; font-size: 14px; color: var(--muted); min-width: 22px; }
.car-top .car-rank { color: var(--amber); }
.car-art { width: 54px; height: 18px; color: var(--muted); }
.car-top .car-art { color: var(--paper); }
.car-score { margin-left: auto; font-size: 11px; color: var(--muted); }
.car-score b { font-size: 15px; color: var(--paper); font-variant-numeric: tabular-nums; margin-right: 2px; }
.car-name { margin-top: 4px; font-weight: 600; font-size: 13px; }
.car-meta { display: flex; flex-wrap: wrap; gap: 0 10px; font-size: 11.5px; color: var(--muted); }
.car-meta span:first-child { color: var(--paper); font-weight: 600; }
.car-why, .car-watch { margin-top: 6px; font-size: 11.5px; line-height: 1.4; }
.car-why b { color: var(--paper); }
.car-watch { color: var(--muted); }
.car-watch b { color: var(--amber); font-weight: 600; }

.btn-reserve {
  position: relative; display: flex; align-items: center; justify-content: center;
  margin-top: 10px; height: 34px; border-radius: 10px;
  background: var(--amber); color: var(--ink); font-weight: 700; font-size: 13px;
  transition: transform .15s ease;
}
.btn-reserve::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: 0 0 0 2px var(--amber); opacity: 0;
}
.btn-reserve.is-pulsing::after { animation: ring 1.2s var(--ease-out) infinite; }
.btn-reserve.is-pressed { transform: scale(.95); }
.btn-reserve.is-saved { background: var(--raised); color: var(--amber); box-shadow: inset 0 0 0 1px var(--amber); }
@keyframes ring { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.12, 1.5); } }

/* Composer */
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 18px; border-top: 1px solid var(--line); }
.composer-field {
  flex: 1; min-height: 72px; padding: 8px 12px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; line-height: 1.4;
}
.composer-placeholder { color: var(--muted); }
.caret { display: inline-block; width: 1.5px; height: 1.1em; margin-left: 1px; vertical-align: -2px; background: var(--amber); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.composer-send {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: var(--raised); color: var(--muted); transition: transform .15s ease;
}
.composer-send svg { width: 18px; height: 18px; }
.composer-send.is-ready { background: var(--amber); color: var(--ink); }
.composer-send.is-pressed { transform: scale(.88); }

/* Scripted states (set by demo.js) */
.is-off { display: none !important; }
.pre { opacity: 0; transform: translateY(10px); }
.car.pre { transform: translateX(32px); }
[data-step] { transition: opacity .45s ease, transform .5s var(--ease-out); }
.demo.is-paused *, .demo.is-paused *::before, .demo.is-paused *::after { animation-play-state: paused !important; }

@media (max-width: 380px) {
  .phone { height: 660px; border-radius: 44px; }
  .phone-screen { border-radius: 34px; }
}

/* Sections */
.section { padding-block: clamp(72px, 10vw, 128px); }
.how { border-top: 1px solid var(--line); }

.steps { margin-top: 48px; display: grid; gap: 40px; }
.step { border-top: 1px solid var(--line-strong); padding-top: 24px; }
.step-num { display: block; font-size: 3rem; line-height: 1; color: var(--paper); }
.step:first-child .step-num { color: var(--amber); }
.step h3 { margin-top: 24px; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.step p { margin-top: 8px; color: var(--muted); max-width: 28em; }
@media (min-width: 800px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 32px; }
}

.why { background: var(--surface); }
.why-grid { display: grid; gap: 48px; }
.why-lead { margin-top: 24px; font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); line-height: 1.35; max-width: 20em; }
.props { display: grid; }
.prop { padding-block: 24px; border-top: 1px solid var(--line); }
.prop:last-child { border-bottom: 1px solid var(--line); }
.prop dt { font-weight: 600; font-size: 1.125rem; }
.prop dd { margin-top: 8px; color: var(--muted); max-width: 34em; }
@media (min-width: 960px) {
  .why-grid { grid-template-columns: 5fr 6fr; gap: 80px; align-items: start; }
}

.roadmap { position: relative; margin-top: 48px; display: grid; gap: 32px; padding-left: 32px; }
.roadmap::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 1px; background: var(--line-strong); }
.road { position: relative; }
.road::before {
  content: ""; position: absolute; left: -32px; top: 5px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--ink); border: 1.5px solid var(--line-strong);
}
.road-now::before { background: var(--amber); border-color: var(--amber); }
.road-tag { display: block; font-size: .875rem; color: var(--muted); }
.road-now .road-tag { color: var(--amber); }
.road h3 { margin-top: 4px; font-size: 1.125rem; font-weight: 600; }
.road p { margin-top: 8px; color: var(--muted); max-width: 30em; }
@media (min-width: 960px) {
  .roadmap { grid-template-columns: repeat(4, 1fr); padding-left: 0; padding-top: 40px; gap: 32px; }
  .roadmap::before { left: 6px; right: 0; top: 6px; bottom: auto; width: auto; height: 1px; }
  .road::before { left: 0; top: -40px; }
}

/* Waitlist */
.waitlist { border-top: 1px solid var(--line); }
.waitlist-grid { display: grid; gap: 48px; }
.info-block { margin-top: 32px; max-width: 30em; }
.info-block h3 { font-size: 1rem; font-weight: 600; }
.info-block p { margin-top: 4px; color: var(--muted); }
.identity p { color: var(--paper); }
@media (min-width: 960px) {
  .waitlist-grid { grid-template-columns: 5fr 7fr; gap: 80px; align-items: start; }
}

.form { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: clamp(20px, 4vw, 40px); display: grid; gap: 20px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field-row { display: grid; gap: 20px; }
@media (min-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; align-content: start; }
.field label { font-weight: 500; font-size: .9375rem; }
.opt { color: var(--muted); font-weight: 400; }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 10px;
  background: var(--ink); color: var(--paper); border: 1px solid var(--line-strong);
  font: 400 1rem/1.4 var(--font-ui);
}
.field input::placeholder { color: #8C8880; }
.field select {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23A9A49A' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center;
}
.field input:focus-visible, .field select:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; border-color: var(--amber); border-radius: 10px; }
.field input[aria-invalid="true"] { border-color: var(--error); }
.field-hint { font-size: .875rem; color: var(--muted); }
.field-error, .consent .field-error { font-size: .875rem; color: var(--error); font-weight: 500; }
.field-error[hidden] { display: none; }

.consent {
  display: grid; grid-template-columns: 24px 1fr; gap: 6px 12px; align-items: start;
  padding: 16px; border-radius: var(--radius); border: 1px solid var(--line-strong); background: var(--ink);
}
.consent input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--amber); cursor: pointer; }
.consent label { font-weight: 500; cursor: pointer; }
.consent.is-invalid { border-color: var(--error); }
.consent .field-error { grid-column: 2; }

.form-error-summary { padding: 12px 16px; border-radius: 10px; border: 1px solid var(--error); color: var(--paper); font-size: .9375rem; }
.form-error-summary[hidden] { display: none; }
.btn-submit { width: 100%; }
@media (min-width: 600px) { .btn-submit { width: auto; justify-self: start; } }
.form-legal { font-size: .875rem; color: var(--muted); }
.form-status { font-size: .9375rem; }
.form-status.is-error { color: var(--error); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding-block: 48px; color: var(--muted); font-size: .9375rem; }
.footer-grid { display: grid; gap: 32px; }
.brand-footer { color: var(--paper); margin-bottom: 12px; }
.footer-id a, .footer-links a { color: var(--paper); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-fine { font-size: .8125rem; max-width: 60em; }
@media (min-width: 800px) {
  .footer-grid { grid-template-columns: 1fr auto; }
  .footer-fine { grid-column: 1 / -1; }
}

/* Secondary pages: thanks, privacy, unsubscribe */
.page { max-width: 760px; padding-block: clamp(32px, 6vw, 72px) clamp(72px, 10vw, 120px); }
.page-title { font-family: var(--font-display); font-stretch: 125%; font-weight: 800; font-size: clamp(2rem, 1rem + 3.5vw, 3.25rem); line-height: 1.02; letter-spacing: -0.015em; }
.page-lead { margin-top: 16px; font-size: 1.125rem; color: var(--muted); max-width: 34em; }
.prose { margin-top: 40px; }
.prose h2 { margin-top: 40px; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.prose p, .prose ul { margin-top: 12px; max-width: 40em; }
.prose ul { list-style: disc; padding-left: 1.25em; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--muted); }
.prose .muted { color: var(--muted); }
.next-steps { margin-top: 40px; display: grid; gap: 24px; counter-reset: s; }
.next-steps li { display: grid; grid-template-columns: 40px 1fr; gap: 16px; }
.next-steps li::before {
  counter-increment: s; content: counter(s);
  font-family: var(--font-display); font-stretch: 125%; font-weight: 800; font-size: 1.75rem; line-height: 1; color: var(--paper);
}
.next-steps li:first-child::before { color: var(--amber); }
.next-steps h2 { font-size: 1.0625rem; font-weight: 600; }
.next-steps p { color: var(--muted); margin-top: 4px; }
.page-actions { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 12px; }
.page .form { margin-top: 40px; max-width: 520px; }
.done-panel { margin-top: 40px; padding: 24px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); max-width: 520px; }
.done-panel[hidden] { display: none; }
.done-panel h2 { font-size: 1.25rem; font-weight: 600; }
.done-panel p { margin-top: 8px; color: var(--muted); }

/* Reduced motion: no ambient animation unless the visitor presses Play on the demo. */
@media (prefers-reduced-motion: reduce) {
  html:not(.motion-ok) *, html:not(.motion-ok) *::before, html:not(.motion-ok) *::after {
    animation: none !important; transition: none !important;
  }
}
