/* ============================================================
   Cardboard marketing site — design system
   Light-first, automatic dark. Satoshi (sans) + Instrument Serif
   (italic display accents) + native mono for labels/numbers.
   App-faithful accents: blue #0a84ff, profit green #1f9e46.
   ============================================================ */

/* ---- Fonts (self-hosted, /assets/fonts) ---- */
@font-face {
  font-family: 'Satoshi';
  src: url('/assets/fonts/satoshi-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('/assets/fonts/satoshi-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('/assets/fonts/satoshi-900.woff2') format('woff2');
  font-weight: 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/assets/fonts/instrument-serif.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Instrument Serif';
  src: url('/assets/fonts/instrument-serif-italic.woff2') format('woff2');
  font-weight: 400; font-style: italic; font-display: swap;
}

/* ---- Tokens ---- */
:root {
  --ink: #1d1d1f;
  --ink-2: #55555c;
  --ink-3: #86868b;
  --canvas: #f5f5f7;
  --canvas-2: #fbfbfd;
  --card: #ffffff;
  --hair: rgba(29, 29, 31, 0.09);
  --hair-strong: rgba(29, 29, 31, 0.16);

  --blue: #0a84ff;
  --blue-deep: #0670e0;
  --blue-tint: rgba(10, 132, 255, 0.09);
  --green: #30d158;
  --green-ink: #1f9e46;
  --green-tint: rgba(48, 209, 88, 0.11);
  --red: #ff453a;
  --amber-ink: #c47700;

  --font-sans: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;
  /* Phone mockups render the real app, which ships the SF stack. */
  --font-app: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;

  --shadow-card: 0 1px 2px rgba(20, 22, 35, 0.04), 0 20px 44px -18px rgba(20, 22, 35, 0.1);
  --shadow-float: 0 30px 80px rgba(20, 22, 35, 0.16), 0 8px 24px rgba(20, 22, 35, 0.08);
  --shadow-slab: 0 24px 50px rgba(20, 24, 40, 0.22);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 32px;

  --nav-bg: rgba(16, 18, 24, 0.86);
  --nav-ink: #f5f5f7;

  --wrap: 1200px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5f5f7;
    --ink-2: #b9b9c0;
    --ink-3: #8e8e93;
    --canvas: #0b0d12;
    --canvas-2: #101319;
    --card: #171a21;
    --hair: rgba(245, 245, 247, 0.1);
    --hair-strong: rgba(245, 245, 247, 0.18);
    --blue-tint: rgba(10, 132, 255, 0.16);
    --green-tint: rgba(48, 209, 88, 0.14);
    --green-ink: #4cd471;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 20px 44px -18px rgba(0, 0, 0, 0.55);
    --shadow-float: 0 30px 80px rgba(0, 0, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.4);
    --nav-bg: rgba(20, 23, 30, 0.82);
  }
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p a, .prose a { color: var(--blue); text-underline-offset: 3px; }
p a:hover, .prose a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--blue); color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.06;
  text-wrap: balance;
}
p { margin: 0; }

/* Serif italic accent inside display headlines */
.serif-i {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* ---- Primitives ---- */
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(20px, 5vw, 44px); }

.kicker {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--blue);
}
.kicker--muted { color: var(--ink-3); }

.h-display {
  font-size: clamp(2.5rem, 5.6vw, 4.35rem);
  font-weight: 900;
  letter-spacing: -0.032em;
  line-height: 1.005;
}
.h-section {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 900;
  letter-spacing: -0.03em;
}
.h-sub {
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.lede {
  font-size: clamp(1.06rem, 1.5vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
  text-wrap: pretty;
}

.num { font-variant-numeric: tabular-nums; }
.money-green { color: var(--green-ink); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  border-radius: 14px;
  padding: 15px 26px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.18s var(--ease-out), background 0.18s, box-shadow 0.18s, border-color 0.18s;
  will-change: transform;
}
.btn:active { transform: scale(0.97); }
.btn--primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(10, 132, 255, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn--primary:hover { background: var(--blue-deep); }
.btn--ghost {
  border: 1.5px solid var(--hair-strong);
  color: var(--ink);
  background: transparent;
}
.btn--ghost:hover { border-color: var(--ink-3); }
.btn--ink {
  background: var(--ink);
  color: var(--canvas);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn--sm { padding: 10px 18px; font-size: 0.92rem; border-radius: 11px; }

/* ---- Nav (floating dark glass bar) ---- */
.nav-shell {
  position: sticky;
  top: 12px;
  z-index: 60;
  padding: 0 clamp(12px, 3vw, 24px);
}
.nav {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: clamp(10px, 2.5vw, 28px);
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 40px -12px rgba(8, 10, 16, 0.5);
  border-radius: 20px;
  padding: 10px 12px 10px 18px;
  color: var(--nav-ink);
}
.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.06rem;
  letter-spacing: -0.02em;
  margin-right: auto;
}
.nav__brand img, .nav__brand svg { height: 22px; width: auto; }
.nav__links { display: flex; align-items: center; gap: clamp(8px, 1.8vw, 22px); }
.nav__links a {
  font-size: 0.94rem;
  font-weight: 700;
  color: rgba(245, 245, 247, 0.78);
  padding: 6px 4px;
  transition: color 0.15s;
}
.nav__links a:hover, .nav__links a[aria-current='page'] { color: #fff; }
.nav__cta {
  background: #fff;
  color: #101218;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.94rem;
  transition: transform 0.18s var(--ease-out), opacity 0.15s;
}
.nav__cta:hover { opacity: 0.92; }
.nav__cta:active { transform: scale(0.97); }
.nav__burger { display: none; }

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__burger {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    color: #fff;
  }
  .nav--open .nav__links {
    display: flex;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--nav-bg);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 24px 60px -12px rgba(8, 10, 16, 0.6);
  }
  .nav--open .nav__links a { padding: 12px 14px; border-radius: 10px; }
  .nav--open .nav__links a:hover { background: rgba(255, 255, 255, 0.07); }
  .nav { position: relative; }
}

/* ---- Sections ---- */
.section { padding: clamp(64px, 10vw, 128px) 0; }
.section--tight { padding: clamp(44px, 7vw, 84px) 0; }
.section-head { max-width: 720px; margin-bottom: clamp(32px, 5vw, 64px); }
.section-head .kicker { display: block; margin-bottom: 14px; }
.section-head .h-section { margin-bottom: 16px; }

/* ---- Cards & panels ---- */
.panel {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.panel--pad { padding: clamp(22px, 3vw, 36px); }

/* iOS-glass surface (modals, overlays) */
.glass {
  background: color-mix(in srgb, var(--card) 62%, transparent);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 30px 80px rgba(10, 12, 20, 0.35);
  border-radius: 28px;
}
@media (prefers-color-scheme: dark) {
  .glass {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 30px 80px rgba(0, 0, 0, 0.6);
  }
}

/* Modal scaffold */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 18, 0.38);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal__panel {
  position: relative;
  width: min(440px, 100%);
  padding: clamp(24px, 4vw, 36px);
  animation: modal-in 0.42s var(--ease-out) both;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* ---- Forms ---- */
.field { display: grid; gap: 8px; }
.field label { font-size: 0.86rem; font-weight: 700; color: var(--ink-2); }
.input {
  width: 100%;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--hair-strong);
  border-radius: 13px;
  padding: 13px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-tint); }
.field .err { font-size: 0.84rem; color: var(--red); display: none; }
.field.is-bad .input { border-color: var(--red); }
.field.is-bad .err { display: block; }

/* Inline waitlist form (input + button in one shell) */
.wl {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--card);
  border: 1.5px solid var(--hair-strong);
  border-radius: 16px;
  max-width: 460px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wl:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-tint); }
.wl input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  padding: 10px 12px;
}
.wl input:focus { outline: none; }
.wl .btn { padding: 12px 20px; border-radius: 11px; }
.wl-note { margin-top: 10px; font-size: 0.86rem; color: var(--ink-3); }
.wl-done {
  display: none;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--green-ink);
}
form.is-done .wl, form.is-done .wl-note { display: none; }
form.is-done .wl-done { display: flex; }
.hp { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

/* ---- Scroll reveals ---- */
.rv {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
.rv.is-in { opacity: 1; transform: none; }

/* ---- Scan beam (faithful to the app's ScanBeam) ---- */
@keyframes cs-scan {
  from { transform: translateY(0); }
  50% { transform: translateY(730%); }
  to { transform: translateY(0); }
}
.scanbeam {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
}
.scanbeam__band {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 12%;
  animation: cs-scan 2.6s ease-in-out infinite;
  background: linear-gradient(to bottom, transparent, rgba(10, 132, 255, 0.25), rgba(10, 132, 255, 0.4));
}
.scanbeam__edge {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--blue);
  box-shadow: 0 0 14px 3px rgba(10, 132, 255, 0.85);
}
.corner {
  position: absolute;
  width: 26px; height: 26px;
  border: 2.5px solid var(--blue);
  pointer-events: none;
}
.corner--tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.corner--tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.corner--bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.corner--br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }

/* ---- Slabs ---- */
.slab {
  border-radius: 12px;
  box-shadow: var(--shadow-slab);
}
@keyframes slab-float {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(-9px) rotate(var(--rot, 0deg)); }
}
.slab--float { animation: slab-float 7s ease-in-out infinite; animation-delay: var(--d, 0s); }

/* ---- Comparison tables ---- */
.cmp-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-card);
}
table.cmp {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.cmp th {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--hair);
  background: var(--canvas-2);
  white-space: nowrap;
}
.cmp td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--hair);
  vertical-align: top;
}
.cmp tr:last-child td { border-bottom: 0; }
.cmp td.c, .cmp th.c { text-align: center; }
.cmp .yes { color: var(--green-ink); font-weight: 900; }
.cmp .no { color: var(--ink-3); }
.cmp tr.us td { background: var(--blue-tint); font-weight: 700; }

/* ---- Footer ---- */
.footer {
  border-top: 1px solid var(--hair);
  padding: clamp(48px, 7vw, 80px) 0 40px;
  background: var(--canvas-2);
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(24px, 4vw, 48px);
}
@media (max-width: 860px) { .footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer__grid { grid-template-columns: 1fr; } }
.footer h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 14px;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer ul a { font-size: 0.95rem; font-weight: 500; color: var(--ink-2); }
.footer ul a:hover { color: var(--ink); }
.footer__base {
  margin-top: clamp(36px, 5vw, 56px);
  padding-top: 24px;
  border-top: 1px solid var(--hair);
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.86rem;
  color: var(--ink-3);
}

/* ---- Article / prose ---- */
.prose {
  max-width: 70ch;
  font-size: 1.06rem;
  line-height: 1.75;
  color: var(--ink-2);
}
.prose h2 {
  font-size: clamp(1.5rem, 2.6vw, 1.95rem);
  color: var(--ink);
  margin: 2.4em 0 0.7em;
}
.prose h3 {
  font-size: 1.22rem;
  color: var(--ink);
  margin: 2em 0 0.6em;
}
.prose p { margin: 0 0 1.15em; }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 1.3em; display: grid; gap: 0.5em; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose blockquote {
  margin: 1.6em 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--blue);
  color: var(--ink);
  font-weight: 700;
}
.prose .cmp-wrap { margin: 1.8em 0; }
.prose figure { margin: 2em 0; }
.prose figcaption { font-size: 0.86rem; color: var(--ink-3); margin-top: 10px; }
.prose hr { border: 0; border-top: 1px solid var(--hair); margin: 2.5em 0; }

/* The liftable AEO answer box — one per competitive page, near the top */
.answer {
  background: var(--blue-tint);
  border: 1px solid color-mix(in srgb, var(--blue) 24%, transparent);
  border-radius: var(--r-md);
  padding: 20px 24px;
  margin: 1.6em 0 2em;
  color: var(--ink);
  font-size: 1.04rem;
  line-height: 1.65;
}
.answer .tag {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
}

.byline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-3);
  margin: 18px 0 8px;
}

/* ---- Utility ---- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 3.5vw, 44px); align-items: center; }
.grid2--wideleft { grid-template-columns: 1.25fr 1fr; }
.grid2--wideright { grid-template-columns: 1fr 1.25fr; }
@media (max-width: 860px) {
  .grid2, .grid2--wideleft, .grid2--wideright { grid-template-columns: 1fr; }
}
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Skip link */
.skip {
  position: fixed; top: -60px; left: 16px; z-index: 200;
  background: var(--ink); color: var(--canvas);
  padding: 10px 16px; border-radius: 10px; font-weight: 700;
  transition: top 0.2s;
}
.skip:focus { top: 16px; }

/* ---- Motion discipline ---- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .rv { opacity: 1; transform: none; }
}
