/*
 * Snap AI public site: the landing page and the legal pages share this one
 * stylesheet (resources/views/public/*). No web fonts, no framework.
 *
 * Theme: light by default, dark under prefers-color-scheme, and an explicit
 * choice from the header toggle wins over both (html[data-theme]). The hero,
 * the download band and the footer are dark in both themes by design.
 *
 * Contrast: body and muted text clear WCAG AA (4.5:1) on their surfaces in
 * both themes; buttons carry white on #2563eb (5.2:1).
 */

:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #eef2fa;
  --text: #0f172a;
  --muted: #475569;
  --border: #dde3ee;
  --link: #1d4ed8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --on-primary: #ffffff;
  --focus: #2563eb;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --header-bg: rgba(255, 255, 255, 0.86);

  /* Pastel tool tiles: background / icon colour. */
  --tone-1-bg: #e3edff; --tone-1-fg: #1d4ed8;
  --tone-2-bg: #efe6ff; --tone-2-fg: #6d28d9;
  --tone-3-bg: #dcf7ea; --tone-3-fg: #047857;
  --tone-4-bg: #fff1d6; --tone-4-fg: #b45309;
  --tone-5-bg: #ffe4ec; --tone-5-fg: #be123c;
  --tone-6-bg: #d9f4f7; --tone-6-fg: #0e7490;

  /* Always-dark sections. */
  --night: #070d1f;
  --night-2: #0c1530;
  --night-text: #e8eeff;
  --night-muted: #aab6d3;
  --night-border: rgba(148, 170, 230, 0.22);

  --radius: 16px;
  --radius-sm: 10px;
  --container: 1160px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --hand: "Segoe Print", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", cursive;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1e;
    --surface: #111a2e;
    --surface-2: #17223a;
    --text: #e8edf8;
    --muted: #a7b2c8;
    --border: #25314b;
    --link: #93b4ff;
    --focus: #93b4ff;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --header-bg: rgba(10, 15, 30, 0.86);
    --tone-1-bg: #16274a; --tone-1-fg: #9cc0ff;
    --tone-2-bg: #251d48; --tone-2-fg: #c4b1ff;
    --tone-3-bg: #11332a; --tone-3-fg: #7fe0b5;
    --tone-4-bg: #3a2b12; --tone-4-fg: #fcc97a;
    --tone-5-bg: #3d1a28; --tone-5-fg: #ffa7c0;
    --tone-6-bg: #0f3139; --tone-6-fg: #7fdbe8;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0f1e;
  --surface: #111a2e;
  --surface-2: #17223a;
  --text: #e8edf8;
  --muted: #a7b2c8;
  --border: #25314b;
  --link: #93b4ff;
  --focus: #93b4ff;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --header-bg: rgba(10, 15, 30, 0.86);
  --tone-1-bg: #16274a; --tone-1-fg: #9cc0ff;
  --tone-2-bg: #251d48; --tone-2-fg: #c4b1ff;
  --tone-3-bg: #11332a; --tone-3-fg: #7fe0b5;
  --tone-4-bg: #3a2b12; --tone-4-fg: #fcc97a;
  --tone-5-bg: #3d1a28; --tone-5-fg: #ffa7c0;
  --tone-6-bg: #0f3139; --tone-6-fg: #7fdbe8;
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base -- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

[hidden] { display: none !important; }

img, svg { display: block; max-width: 100%; }
.icon { flex: none; }

a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .container { padding: 0 24px; } }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* --------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px; border-radius: 999px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent; transition: background-color .15s, border-color .15s, transform .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--muted); }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 0.95rem; }
.btn[aria-disabled="true"] { cursor: default; opacity: 0.8; }

.on-night .btn-outline { color: var(--night-text); border-color: rgba(200, 214, 255, 0.45); }
.on-night .btn-outline:hover { border-color: #fff; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--text); border: 1.5px solid var(--border);
}
.icon-btn:hover { border-color: var(--muted); }

/* ---------------------------------------------------------------- header -- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 68px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; margin-right: auto; min-width: 0; }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 800; font-size: 1.15rem; }
.brand-tag { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  color: var(--text); text-decoration: none; font-weight: 500;
  padding: 8px 12px; border-radius: 999px;
}
.main-nav a:hover { background: var(--surface-2); }

.header-actions { display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; }

/* The theme toggle shows the theme you would switch TO. */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

@media (max-width: 900px) {
  .brand-tag { display: none; }
  .js .menu-toggle { display: inline-flex; }
  .main-nav { flex-wrap: wrap; }
  .js .main-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0; padding: 8px 16px 16px;
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
  }
  .js .main-nav.is-open { display: flex; }
  .js .main-nav a { padding: 12px; border-radius: var(--radius-sm); }
  .header-inner { position: relative; flex-wrap: wrap; }
  .no-js-nav-row { width: 100%; }
}
@media (max-width: 480px) {
  .header-cta { display: none; }
}

/* ------------------------------------------------------------------ hero -- */

.on-night { background: var(--night); color: var(--night-text); }
.on-night a:not(.btn) { color: #a9c4ff; }

.hero {
  position: relative; overflow: hidden;
  background:
    radial-gradient(60% 55% at 78% 30%, rgba(59, 130, 246, 0.35), transparent 70%),
    radial-gradient(45% 45% at 10% 90%, rgba(124, 58, 237, 0.22), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%);
  padding: 56px 0 72px;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }

.eyebrow {
  display: inline-block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em;
  color: #9cc0ff; margin-bottom: 14px;
}
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); font-weight: 800; margin-bottom: 18px; }
.hero h1 .line { display: block; }
.gradient-text {
  background: linear-gradient(90deg, #60a5fa 0%, #a78bfa 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { font-size: 1.15rem; color: var(--night-muted); max-width: 34em; margin-bottom: 22px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0 0 28px; }
.chips li {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--night-border); color: var(--night-text);
}
.chips .icon { color: #9cc0ff; }

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.store-cta { display: flex; flex-direction: column; gap: 6px; }
.soon { font-size: 0.78rem; color: var(--night-muted); padding-left: 8px; }
.hero-note { margin: 20px 0 0; font-size: 0.92rem; color: var(--night-muted); }

/* Phone mockup ------------------------------------------------------------ */

.hero-visual { position: relative; display: flex; justify-content: center; padding: 44px 0 24px; }

.phone {
  position: relative; width: 262px; flex: none;
  border-radius: 40px; padding: 10px;
  background: linear-gradient(160deg, #26324f, #0b1120);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}
.phone-screen {
  position: relative; overflow: hidden; border-radius: 31px;
  background: #0f172a; color: #e2e8f0; min-height: 450px; padding: 34px 14px 16px;
}
.phone-notch {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 84px; height: 20px; border-radius: 999px; background: #05080f;
}
.phone-bar { display: flex; align-items: center; justify-content: space-between; font-size: 0.78rem; margin-bottom: 12px; }
.phone-bar strong { font-size: 0.95rem; }
.pill-live { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; color: #9cc0ff; }
.pill-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #60a5fa; }

.scan-frame { position: relative; border-radius: 16px; padding: 10px; background: rgba(96, 165, 250, 0.08); }
.scan-frame::before, .scan-frame::after {
  content: ""; position: absolute; width: 22px; height: 22px; border-color: #60a5fa; border-style: solid;
}
.scan-frame::before { top: 4px; left: 4px; border-width: 3px 0 0 3px; border-radius: 8px 0 0 0; }
.scan-frame::after { bottom: 4px; right: 4px; border-width: 0 3px 3px 0; border-radius: 0 0 8px 0; }

.receipt {
  background: #fdfcf8; color: #1f2937; border-radius: 8px; padding: 12px 12px 10px;
  font-size: 0.72rem; line-height: 1.45; font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
}
.receipt-head { text-align: center; margin-bottom: 8px; }
.receipt-head strong { display: block; font-size: 0.8rem; }
.receipt-row { display: flex; justify-content: space-between; gap: 8px; }
.receipt-rule { border: 0; border-top: 1px dashed #9ca3af; margin: 6px 0; }
.receipt-total { font-weight: 700; font-size: 0.8rem; }

.scan-line {
  position: absolute; left: 8px; right: 8px; top: 12%; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, #60a5fa, #a78bfa, transparent);
  box-shadow: 0 0 16px rgba(96, 165, 250, 0.9);
  animation: scan 3.2s ease-in-out infinite alternate;
}
@keyframes scan { from { top: 10%; } to { top: 86%; } }

.phone-status { margin-top: 12px; font-size: 0.78rem; color: #a5b4cf; display: flex; align-items: center; gap: 8px; }
.progress { flex: 1; height: 5px; border-radius: 5px; background: rgba(148, 163, 184, 0.25); overflow: hidden; }
.progress span { display: block; width: 72%; height: 100%; background: linear-gradient(90deg, #60a5fa, #a78bfa); }

/* Floating glass cards */
.glass {
  background: rgba(17, 26, 51, 0.72); color: var(--night-text);
  border: 1px solid rgba(160, 185, 255, 0.28); border-radius: 14px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  padding: 12px 14px; font-size: 0.82rem; line-height: 1.4;
}
.glass h3 { font-size: 0.85rem; margin: 0 0 6px; display: flex; align-items: center; gap: 6px; }
.glass ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.glass li { display: flex; gap: 6px; align-items: flex-start; }
.glass li .icon { color: #6ee7b7; margin-top: 1px; }
.glass .tag { color: #c4b5fd; }
.glass .tag-blue { color: #93c5fd; }

.float-cards { position: absolute; inset: 0; pointer-events: none; }
.float-cards .glass { position: absolute; width: 200px; pointer-events: auto; }
.card-summary { top: 60px; left: 0; }
.card-insight { top: 372px; right: 0; }
.card-suggest { bottom: 0; left: 8px; }

.hand-note {
  position: absolute; right: 8px; top: 0; margin: 0; z-index: 2;
  font-family: var(--hand); font-size: 1.05rem; color: #c7d7ff; transform: rotate(-6deg);
  display: flex; align-items: flex-end; gap: 4px;
}
.hand-note svg { color: #9cc0ff; }

@media (max-width: 1080px) {
  .card-summary { left: -24px; }
  .card-insight { right: -24px; }
}

@media (max-width: 920px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { flex-direction: column; align-items: center; gap: 14px; }
  .float-cards { position: static; display: grid; gap: 12px; width: 100%; max-width: 420px; }
  .float-cards .glass { position: static; width: auto; }
  .hand-note { position: static; order: -1; transform: rotate(-3deg); }
}

@media (max-width: 380px) {
  .phone { width: 236px; }
  .phone-screen { min-height: 420px; }
}

/* -------------------------------------------------------------- sections -- */

.section { padding: 72px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.section-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); font-weight: 800; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.kicker { display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.14em; color: var(--link); margin-bottom: 8px; text-transform: uppercase; }

/* Tool grid */
.tool-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tool {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; min-height: 128px; padding: 18px 10px; border-radius: var(--radius);
  font-weight: 600; font-size: 0.95rem; line-height: 1.3;
  background: var(--tile-bg); color: var(--text);
}
.tool .icon-wrap {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 14px; background: var(--surface); color: var(--tile-fg);
}
.tone-1 { --tile-bg: var(--tone-1-bg); --tile-fg: var(--tone-1-fg); }
.tone-2 { --tile-bg: var(--tone-2-bg); --tile-fg: var(--tone-2-fg); }
.tone-3 { --tile-bg: var(--tone-3-bg); --tile-fg: var(--tone-3-fg); }
.tone-4 { --tile-bg: var(--tone-4-bg); --tile-fg: var(--tone-4-fg); }
.tone-5 { --tile-bg: var(--tone-5-bg); --tile-fg: var(--tone-5-fg); }
.tone-6 { --tile-bg: var(--tone-6-bg); --tile-fg: var(--tone-6-fg); }
.tool-more { background: transparent; border: 2px dashed var(--border); color: var(--muted); }
.tool-more .icon-wrap { background: var(--surface-2); color: var(--link); }

@media (max-width: 1000px) { .tool-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 680px) { .tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 440px) { .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .tool { min-height: 112px; } }

/* Use cases */
.cases { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.case {
  display: flex; gap: 16px; padding: 22px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--border);
}
.case h3 { font-size: 1.1rem; margin-bottom: 6px; }
.case p { margin: 0; color: var(--muted); }
.case .tool-name { display: inline-block; margin-top: 10px; font-size: 0.85rem; font-weight: 700; color: var(--link); }
.case-icon {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 14px; background: var(--tile-bg); color: var(--tile-fg);
}
@media (max-width: 760px) { .cases { grid-template-columns: 1fr; } }

/* Steps */
.steps { list-style: none; margin: 0 0 40px; padding: 0; display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); counter-reset: step; }
.step {
  position: relative; padding: 26px 22px 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.step-num {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border-radius: 999px; background: #2563eb; color: #fff; font-weight: 800; margin-bottom: 14px;
}
.step .icon { color: var(--link); position: absolute; top: 26px; right: 22px; }
.step h3 { font-size: 1.15rem; }
.step p { margin: 0; color: var(--muted); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.feature-row { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.feature-row li {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.feature-row .icon { color: var(--link); margin-top: 2px; }
.feature-row strong { display: block; }
.feature-row span { color: var(--muted); font-size: 0.92rem; }
@media (max-width: 1000px) { .feature-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .feature-row { grid-template-columns: 1fr; } }

/* Download band */
.band {
  position: relative; overflow: hidden; padding: 64px 0;
  background:
    radial-gradient(50% 70% at 85% 50%, rgba(59, 130, 246, 0.35), transparent 70%),
    linear-gradient(120deg, var(--night) 0%, #111c42 100%);
}
.band-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; }
.band h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
.band p { color: var(--night-muted); }
.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.store-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 18px 8px 14px;
  border-radius: 12px; background: #000; color: #fff; text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
}
.store-btn:hover { border-color: #fff; }
.store-btn .small { display: block; font-size: 0.7rem; line-height: 1.1; opacity: 0.85; }
.store-btn .big { display: block; font-size: 1.1rem; font-weight: 700; line-height: 1.15; }
.store-btn[aria-disabled="true"] { opacity: 0.75; }
.on-night a.store-btn { color: #fff; }

.mini-phone {
  width: 220px; margin: 0 auto; border-radius: 34px; padding: 9px;
  background: linear-gradient(160deg, #26324f, #0b1120); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.mini-screen { border-radius: 26px; background: #0f172a; padding: 26px 12px 14px; display: grid; gap: 8px; }
.mini-title { font-size: 0.8rem; color: #a5b4cf; margin: 0 0 2px 4px; }
.mini-tile { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.06); color: #e2e8f0; font-size: 0.82rem; font-weight: 600; }
.mini-tile .icon-wrap { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border-radius: 9px; background: var(--tone-1-bg); color: var(--tone-1-fg); }
.mini-tile.tone-2 .icon-wrap { background: #ece4ff; color: #6d28d9; }
.mini-tile.tone-3 .icon-wrap { background: #d9f6e8; color: #047857; }
.mini-tile.tone-4 .icon-wrap { background: #fff0d1; color: #b45309; }
.mini-tile.tone-1 .icon-wrap { background: #e0ebff; color: #1d4ed8; }
@media (max-width: 820px) { .band-grid { grid-template-columns: 1fr; } }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; display: grid; gap: 12px; }
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 18px;
}
.faq summary {
  cursor: pointer; list-style: none; padding: 16px 28px 16px 0; font-weight: 700; position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 12px; font-size: 1.4rem; font-weight: 400; color: var(--muted);
}
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 0 16px; color: var(--muted); }
.faq details > div p:last-child { margin-bottom: 0; }
.faq-more { margin-top: 24px; margin-bottom: 0; }
.section-last { padding-top: 8px; }

/* Bottom CTA card */
.cta-card {
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
  padding: 36px; border-radius: 24px;
  background: linear-gradient(120deg, #2563eb 0%, #7c3aed 100%); color: #fff;
}
.cta-card h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); font-weight: 800; margin-bottom: 8px; }
.cta-card p { margin: 0; color: #fff; }
.cta-card .btn { background: #fff; color: #1e3a8a; }
.cta-card .btn:hover { background: #e8eeff; }
.cta-art { display: flex; align-items: center; gap: 24px; }
.robot { width: 120px; height: 120px; }
@media (max-width: 760px) {
  .cta-card { grid-template-columns: 1fr; padding: 28px 22px; }
  .robot { display: none; }
}

/* ---------------------------------------------------------------- footer -- */

.site-footer { padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
.footer-brand .brand { color: var(--night-text); margin-bottom: 12px; }
.footer-brand .brand-tag { color: var(--night-muted); }
.footer-brand p { color: var(--night-muted); margin: 0; max-width: 22em; }
.site-footer h2 { font-size: 0.95rem; margin-bottom: 12px; color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer ul a { color: var(--night-muted); text-decoration: none; }
.site-footer ul a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--night-border);
  color: var(--night-muted); font-size: 0.9rem;
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 420px) { .footer-grid { grid-template-columns: 1fr; } }

/* ----------------------------------------------------------- legal pages -- */

.legal-hero { padding: 44px 0 28px; border-bottom: 1px solid var(--border); background: var(--surface); }
.legal-hero h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); font-weight: 800; }
.legal-hero .meta { color: var(--muted); margin: 0; }

.legal-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; padding-top: 36px; padding-bottom: 72px; }
.legal-nav { position: sticky; top: 92px; align-self: start; }
.legal-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.legal-nav a { display: block; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.legal-nav a:hover { background: var(--surface-2); }
.legal-nav a[aria-current="page"] { background: var(--surface-2); color: var(--link); font-weight: 700; }
@media (max-width: 860px) {
  .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .legal-nav { position: static; }
  .legal-nav ul { display: flex; flex-wrap: wrap; gap: 8px; }
  .legal-nav a { border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; }
}

.prose { max-width: 760px; min-width: 0; overflow-wrap: break-word; }
.prose h2 { font-size: 1.4rem; margin-top: 2em; padding-top: 0.2em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.1rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.2em; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border: 1px solid var(--border); }
.prose th { background: var(--surface-2); }
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; }
.table-wrap table { margin: 0; min-width: 540px; }
.callout {
  padding: 16px 18px; border-radius: var(--radius-sm); margin: 0 0 1.4em;
  background: var(--surface-2); border-left: 4px solid var(--primary);
}
.callout p:last-child { margin-bottom: 0; }
.steps-list { counter-reset: s; list-style: none; padding: 0 !important; }
.steps-list li { counter-increment: s; position: relative; padding-left: 44px; min-height: 32px; margin-bottom: 12px; }
.steps-list li::before {
  content: counter(s); position: absolute; left: 0; top: -2px;
  width: 30px; height: 30px; border-radius: 999px; background: #2563eb; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem;
}
.prose .btn { margin: 4px 0 12px; }
.toc { padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 1.6em; background: var(--surface); }
.toc h2 { font-size: 1rem; margin: 0 0 8px; padding: 0; }
.toc ol { margin: 0; columns: 2; column-gap: 28px; }
@media (max-width: 560px) { .toc ol { columns: 1; } }

/* -------------------------------------------------------------- motion ---- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .scan-line { top: 48%; }
}

/* ------------------------------------------------------- developer docs ---- */
/*
  Code samples on /developer-api. Inline styles are impossible here (the
  public pages ship `style-src 'self'`), so the one page that needs monospace
  blocks brings its rules with it.
*/
.prose pre {
  margin: 0 0 1.2em; padding: 14px 16px; overflow-x: auto;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.86rem; line-height: 1.55;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; font-size: 0.88em;
}
.prose .lang-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.prose .lang-tabs span {
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
  text-transform: uppercase; color: var(--muted);
}
.api-verb {
  display: inline-block; min-width: 54px; padding: 1px 8px; margin-right: 8px;
  border-radius: 4px; background: #2563eb; color: #fff;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.03em;
}
.api-verb.get { background: #0f766e; }
.api-verb.delete { background: #b91c1c; }
.prose .callout {
  padding: 14px 16px; margin: 0 0 1.4em; border-radius: var(--radius-sm);
  border: 1px solid var(--border); border-left: 4px solid #d97706;
  background: var(--surface);
}
.prose .callout p:last-child { margin-bottom: 0; }

/* =========================================================================
   Refer & earn: the invite landing page (/r/<CODE>) and somebody's opt-in
   public page (/u/<handle>). Both reuse the site's night hero, its buttons
   and its chips - a person who lands here from WhatsApp should recognise
   the same product they are about to install.
   ========================================================================= */

.invite-hero, .profile-hero {
  background:
    radial-gradient(60% 70% at 12% 20%, rgba(124, 108, 255, 0.34), transparent 72%),
    linear-gradient(140deg, var(--night) 0%, var(--night-2) 60%, #111c42 100%);
  padding: 64px 0 72px;
}

.invite-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 40px; align-items: start; }
.invite-hero h1 { font-size: clamp(2.1rem, 4.8vw, 3.3rem); font-weight: 800; margin-bottom: 16px; }
.invite-hero h1 .line { display: block; }

.invite-code {
  display: flex; flex-direction: column; gap: 6px;
  margin: 0 0 24px; padding: 18px 22px;
  border-radius: var(--radius); border: 1px dashed rgba(166, 156, 255, 0.55);
  background: rgba(255, 255, 255, 0.06); max-width: 24em;
}
.invite-code-label, .invite-code-note { font-size: 0.82rem; color: var(--night-muted); }
/* The inviter's own line about themselves, on /r/<CODE>. Quiet, and quoted,
   so it reads as somebody speaking rather than as our copy. */
.invite-bio { margin: 0 0 0.9rem; max-width: 34em; font-size: 1.02rem; line-height: 1.6; font-style: italic; color: var(--night-muted); overflow-wrap: anywhere; }
.invite-code-label { font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.invite-code-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem); font-weight: 800; letter-spacing: 0.22em;
  color: #fff; word-break: break-all;
}

.invite-panel { padding: 22px 24px; }
.invite-panel h2 { font-size: 1.05rem; margin: 0 0 14px; }
.invite-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.invite-steps li { display: flex; gap: 10px; align-items: flex-start; font-size: 0.95rem; line-height: 1.45; }
.invite-steps .step-num {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 999px;
  background: rgba(124, 108, 255, 0.28); color: #dcd8ff; font-weight: 700; font-size: 0.85rem;
}
.invite-fine { margin: 0; font-size: 0.82rem; line-height: 1.55; color: var(--night-muted); }
.invite-footnote { text-align: center; color: var(--muted); font-size: 0.95rem; margin: 0; }

/* The public profile card ------------------------------------------------- */

.profile-card {
  max-width: 640px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.profile-identity { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.profile-photo {
  width: 132px; height: 132px; border-radius: 999px; object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  background: #1a2244;
}
.profile-photo-initial {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 3.2rem; font-weight: 800; color: #fff;
  background: linear-gradient(140deg, #4c4a9e 0%, #7c6cff 100%);
}
.profile-identity-text h1 { font-size: clamp(1.8rem, 4.4vw, 2.6rem); font-weight: 800; margin: 0; }
.profile-subtitle { margin: 6px 0 0; font-size: 1.02rem; color: var(--night-text); opacity: 0.92; }
.profile-handle { margin: 4px 0 0; font-size: 0.9rem; color: var(--night-muted); letter-spacing: 0.02em; }
.profile-bio { margin: 0; max-width: 34em; font-size: 1.05rem; line-height: 1.6; color: var(--night-muted); }

.profile-cta {
  width: 100%; padding: 24px; border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--night-border);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.profile-cta-line { margin: 0; font-size: 1.12rem; line-height: 1.5; color: var(--night-text); }
.profile-cta-line strong { color: #c7bfff; }
.profile-cta-button { min-width: 15em; justify-content: center; }
.profile-cta-code { margin: 0; font-size: 0.86rem; color: var(--night-muted); }
.profile-cta-code strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.16em; color: var(--night-text);
}

.profile-chips { justify-content: center; margin: 0; }
.profile-foot { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.profile-fine { margin: 0; max-width: 46em; font-size: 0.85rem; line-height: 1.6; color: var(--muted); }

@media (max-width: 900px) {
  .invite-grid { grid-template-columns: 1fr; gap: 28px; }
}
