/* Clozely public site — calm, crafted, focused.
   Visual system mirrors the app's design language (PRODUCT.md / DESIGN.md):
   ink + sage accent + violet-for-AI, soft depth (elevation, not hard
   borders), neutrals that stay neutral. Token names/values are lifted from
   the app's App.css :root so the site and the product feel like one thing.
   No external fonts or trackers — system stack, self-hosted everything.
   Light and dark themes are both first-class. */

:root {
  /* Ink (text) — never light-gray-on-tint for body copy */
  --text-primary: #1a1a1a;
  --text-secondary: #2a2d32;
  --text-muted: #4a4f57;     /* AA-safe secondary/lede text on white */
  --text-subtle: #6b7280;    /* AA-safe small/meta text */
  --text-hint: #9ca3af;      /* decorative only (markers, skeletons) */

  /* Sage (accent — intent only, never decoration) */
  --accent: #5e8e78;
  --accent-hover: #4f7a66;
  --accent-wash: #e7eeeb;    /* soft sage fill (app --bg-active) */
  --accent-ink: #33503f;     /* text on sage wash (app --text-active-mode) */

  /* Sage label-button fill — deepened so cream text clears AA (~4.7:1). */
  --accent-btn-bg: #4f7a66;
  --accent-btn-bg-hover: #446a58;
  --accent-btn-fg: #fafcf7;

  /* Violet (AI — reserved app-wide for AI surfaces) */
  --ai-accent: #7a5bff;
  --ai-wash: rgba(122, 91, 255, 0.12);
  --ai-ink: #5b3aa8;

  /* Surfaces (elevation ladder, separated by light not boxes) */
  --surface-base: #ffffff;
  --surface-sunken: #f4f5f7;
  --surface-chrome: #fcfcfd;
  --surface-raised: #ffffff;

  /* Soft depth replaces hard borders */
  --hairline: rgba(20, 24, 32, 0.06);
  --hairline-strong: rgba(20, 24, 32, 0.12);
  --elev-1: 0 1px 0 rgba(20, 24, 32, 0.05);
  --elev-2: 0 1px 2px rgba(20, 24, 32, 0.10), 0 0 0 1px rgba(20, 24, 32, 0.04);
  --elev-3: 0 8px 24px rgba(20, 24, 32, 0.12);
  --elev-4: 0 20px 60px rgba(20, 24, 32, 0.18);

  /* One radius scale (no ad-hoc px) */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 22px;
  --radius-pill: 999px;
  --radius-round: 50%;

  /* Document-highlight palette — the product's core metaphor, kept
     verbatim from the app so the hero reads like a real screenshot. */
  --hl-card-wash: rgba(255, 214, 10, 0.16);
  --hl-card-line: rgba(228, 178, 10, 0.55);
  --hl-c1-wash: rgba(74, 143, 222, 0.15);
  --hl-c1-line: rgba(74, 143, 222, 0.65);
  --hl-c1-ink: #2b5d99;
  --hl-c2-wash: rgba(38, 166, 154, 0.15);
  --hl-c2-line: rgba(38, 166, 154, 0.65);
  --hl-c2-ink: #147d77;

  --focus-ring: rgba(94, 142, 120, 0.45);

  --max: 1080px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* Back-compat aliases — older inline styles in the page HTML reference
     these names; mapped onto the new design-language tokens so they stay
     on-brand (and follow dark mode) without touching the markup. */
  --ink: var(--text-primary);
  --ink-soft: var(--text-muted);
  --ink-faint: var(--text-subtle);
  --paper: var(--surface-base);
  --paper-warm: var(--surface-sunken);
  --line: var(--hairline-strong);
  --sage: var(--accent);
  --sage-soft: var(--accent-wash);
  --sage-ink: var(--accent-ink);
  --radius: var(--radius-md);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #e7e8eb;
    --text-secondary: #d0d1d5;
    --text-muted: #a8abb2;
    --text-subtle: #888c96;
    --text-hint: #606470;

    --accent: #6b9c86;
    --accent-hover: #5e8e78;
    --accent-wash: #22302a;
    --accent-ink: #9dc4b2;

    --accent-btn-bg: #4f7a66;
    --accent-btn-bg-hover: #446a58;
    --accent-btn-fg: #fafcf7;

    --ai-accent: #967dff;
    --ai-wash: rgba(150, 125, 255, 0.16);
    --ai-ink: #c4b6ff;

    --surface-base: #1a1b1e;
    --surface-sunken: #232427;
    --surface-chrome: #202124;
    --surface-raised: #2a2b2f;

    --hairline: rgba(255, 255, 255, 0.07);
    --hairline-strong: rgba(255, 255, 255, 0.12);
    --elev-1: 0 1px 0 rgba(0, 0, 0, 0.4);
    --elev-2: 0 1px 2px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.05);
    --elev-3: 0 10px 30px rgba(0, 0, 0, 0.55);
    --elev-4: 0 24px 64px rgba(0, 0, 0, 0.6);

    --hl-card-wash: rgba(255, 224, 90, 0.14);
    --hl-card-line: rgba(255, 224, 90, 0.45);
    --hl-c1-wash: rgba(96, 165, 250, 0.22);
    --hl-c1-line: rgba(96, 165, 250, 0.55);
    --hl-c1-ink: #bcd6f5;
    --hl-c2-wash: rgba(45, 212, 191, 0.20);
    --hl-c2-line: rgba(45, 212, 191, 0.5);
    --hl-c2-ink: #a7f3e0;

    --focus-ring: rgba(107, 156, 134, 0.5);

    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--text-secondary);
  background: var(--surface-base);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

h1, h2, h3 { color: var(--text-primary); }

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

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header — solid chrome "a whisper off base", set apart by elevation ── */

header {
  background: var(--surface-chrome);
  box-shadow: var(--elev-1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 64px;
}

.nav .logo {
  display: flex;
  align-items: center;
  margin-right: auto;
  border-radius: var(--radius-sm);
}

.nav .logo img { height: 28px; width: auto; display: block; }

.nav a.navlink {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color 150ms var(--ease), background 150ms var(--ease);
}

.nav a.navlink:hover { color: var(--text-primary); background: var(--surface-sunken); }

.nav a.navlink[aria-current="page"] { color: var(--text-primary); font-weight: 600; }

@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .nav { gap: 10px; }
  .nav .logo img { height: 23px; }
  .nav a.navlink { padding: 6px 6px; font-size: 14px; }
  .nav .btn { padding: 8px 14px; font-size: 14px; }
}

/* Small phones: logo + primary CTA only; secondary links live in the footer. */
@media (max-width: 480px) {
  .nav a.navlink { display: none; }
}

/* ── Buttons ────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 150ms var(--ease), border-color 150ms var(--ease),
    box-shadow 150ms var(--ease), transform 150ms var(--ease), color 150ms var(--ease);
}

/* Primary = the brand sage, the one "intent" moment. Cream text on a
   deepened sage fill clears AA (~4.7:1); cream on the lighter brand sage
   would not, so labeled buttons sit on --accent-btn-bg. */
.btn-primary {
  background: var(--accent-btn-bg);
  color: var(--accent-btn-fg);
  box-shadow: var(--elev-2);
}

.btn-primary:hover {
  background: var(--accent-btn-bg-hover);
  transform: translateY(-1px);
  box-shadow: var(--elev-3);
}

.btn-primary:active { transform: translateY(0); box-shadow: var(--elev-2); }

.btn-ghost {
  border-color: var(--hairline-strong);
  color: var(--text-primary);
  background: transparent;
}

.btn-ghost:hover { background: var(--surface-sunken); border-color: transparent; }

/* ── Hero ───────────────────────────────────────────────── */

.hero {
  padding: clamp(64px, 9vw, 104px) 0 clamp(48px, 7vw, 72px);
  text-align: center;
}

.hero h1 {
  font-size: clamp(36px, 5.4vw, 58px);
  /* Roomy line-height so the wrapping highlight band on one line can't
     collide with the band on the next (founder-reported 2026-06-21). */
  line-height: 1.42;
  margin: 0 auto 22px;
  max-width: 16em;
  letter-spacing: -0.022em;
  font-weight: 760;
  text-wrap: balance;
}

.hero p.sub {
  font-size: clamp(17px, 2.1vw, 21px);
  color: var(--text-muted);
  max-width: 34em;
  margin: 0 auto 32px;
  text-wrap: pretty;
}

.hero .cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero .platforms {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-subtle);
}

/* Card-anatomy highlights — the product's whole metaphor. A light wash +
   a hairline inset outline in the same hue, exactly like the app's real
   document highlights, so the headline reads as a screenshot in type. */
.hl-card {
  background: var(--hl-card-wash);
  box-shadow: inset 0 0 0 1px var(--hl-card-line);
  border-radius: var(--radius-xs);
  padding: 0 7px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.hl-c1, .hl-c2 {
  border-radius: 5px;
  padding: 0 6px;
  font-weight: 760;
  /* Horizontal-only padding so the cloze pill covers the same line-box as
     the surrounding wash, matching the app's shared highlight height. */
}

.hl-c1 {
  background: var(--hl-c1-wash);
  box-shadow: inset 0 0 0 1px var(--hl-c1-line);
  color: var(--hl-c1-ink);
}
.hl-c2 {
  background: var(--hl-c2-wash);
  box-shadow: inset 0 0 0 1px var(--hl-c2-line);
  color: var(--hl-c2-ink);
}

/* ── Product vignette — floating app surfaces, soft depth ── */

.vignette {
  margin: clamp(44px, 6vw, 64px) auto 0;
  max-width: 900px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 22px;
  align-items: center;
  text-align: left;
}

.doc-card, .flash-card {
  background: var(--surface-raised);
  border-radius: var(--radius-lg);
  box-shadow: var(--elev-3);
  padding: 26px;
}

.doc-card .doc-line {
  height: 9px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  margin: 12px 0;
}
@media (prefers-color-scheme: dark) {
  .doc-card .doc-line { background: rgba(255, 255, 255, 0.08); }
}

.doc-card .doc-line.w80 { width: 80%; }
.doc-card .doc-line.w60 { width: 60%; }
.doc-card .doc-line.w90 { width: 90%; }

.doc-card .doc-text {
  font-size: 15px;
  color: var(--text-muted);
  margin: 14px 0;
  line-height: 1.7;
}

.arrow {
  font-size: 26px;
  color: var(--text-hint);
  text-align: center;
}

.flash-card .fc-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-ink);
  margin-bottom: 12px;
}

.flash-card .fc-text { font-size: 16px; color: var(--text-secondary); line-height: 1.7; }

.flash-card .fc-blank {
  display: inline-block;
  background: var(--hl-c1-wash);
  box-shadow: inset 0 0 0 1px var(--hl-c1-line);
  color: var(--hl-c1-ink);
  font-weight: 700;
  border-radius: 5px;
  padding: 0 10px;
}

@media (max-width: 720px) {
  .vignette { grid-template-columns: 1fr; gap: 14px; }
  .arrow { transform: rotate(90deg); }
}

/* ── Sections ───────────────────────────────────────────── */

section.band { padding: clamp(56px, 8vw, 80px) 0; }

/* Rhythm from a tonal step, not a drawn line. Neutrals stay neutral. */
section.band.warm { background: var(--surface-sunken); }

.band h2 {
  font-size: clamp(27px, 3.4vw, 37px);
  letter-spacing: -0.018em;
  line-height: 1.2;
  margin: 0 0 10px;
  text-align: center;
  text-wrap: balance;
}

.band p.lede {
  text-align: center;
  color: var(--text-muted);
  max-width: 38em;
  margin: 0 auto 52px;
  font-size: 18px;
  text-wrap: pretty;
}

/* Steps — a real 3-step sequence, so the numbers carry meaning. */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 40px);
}

.step .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-round);
  background: var(--accent-wash);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 16px;
}

.step h3 { margin: 0 0 7px; font-size: 19px; letter-spacing: -0.01em; }
.step p { margin: 0; color: var(--text-muted); font-size: 15.5px; }

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

/* Feature grid — borderless blocks, separated by space and soft depth,
   not boxed cards. Hover lifts each to a raised surface. */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.feature {
  background: transparent;
  border-radius: var(--radius-lg);
  padding: 22px 22px 24px;
  transition: background 160ms var(--ease), box-shadow 160ms var(--ease),
    transform 160ms var(--ease);
}

.feature:hover {
  background: var(--surface-raised);
  box-shadow: var(--elev-2);
  transform: translateY(-2px);
}
section.band.warm .feature:hover { background: var(--surface-base); }

.feature h3 {
  margin: 0 0 8px;
  font-size: 17.5px;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.feature p { margin: 0; color: var(--text-muted); font-size: 15px; line-height: 1.62; }

/* Violet AI marker — the reserved AI color, used only where AI is the point. */
.chip-ai {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ai-ink);
  background: var(--ai-wash);
  border-radius: var(--radius-xs);
  padding: 2px 7px;
  line-height: 1.4;
}

/* FAQ — genuine dividers (hairlines) are allowed; smooth, quiet open. */
.faq { max-width: 720px; margin: 0 auto; }

.faq details {
  border-bottom: 1px solid var(--hairline);
  padding: 0;
}
.faq details:first-of-type { border-top: 1px solid var(--hairline); }

.faq summary {
  font-weight: 600;
  cursor: pointer;
  font-size: 17px;
  color: var(--text-primary);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  transition: color 150ms var(--ease);
}

.faq summary:hover { color: var(--accent); }

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "";
  flex: none;
  width: 11px;
  height: 11px;
  background:
    linear-gradient(var(--text-hint), var(--text-hint)) center/100% 1.5px no-repeat,
    linear-gradient(var(--text-hint), var(--text-hint)) center/1.5px 100% no-repeat;
  transition: transform 200ms var(--ease);
}

.faq details[open] summary::after { transform: rotate(90deg); }
.faq details[open] summary { color: var(--text-primary); }

.faq details p {
  color: var(--text-muted);
  margin: 0;
  padding: 0 0 20px;
  font-size: 15.5px;
  max-width: 64ch;
}

/* ── Waitlist form ──────────────────────────────────────── */

.waitlist {
  max-width: 480px;
  margin: 0 auto;
  text-align: center;
}

.waitlist form {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.waitlist input[type="email"] {
  flex: 1;
  font: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-base);
  color: var(--text-primary);
  min-width: 0;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}

.waitlist input[type="email"]::placeholder { color: var(--text-subtle); }

.waitlist input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* Honeypot — visually gone, present in DOM for bots */
.waitlist .hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.waitlist .form-msg {
  margin-top: 14px;
  font-size: 14.5px;
  min-height: 1.4em;
}

.waitlist .form-msg.ok { color: #1a7f37; }
.waitlist .form-msg.err { color: #d4351c; }
@media (prefers-color-scheme: dark) {
  .waitlist .form-msg.ok { color: #4ade80; }
  .waitlist .form-msg.err { color: #f87171; }
}

@media (max-width: 480px) {
  .waitlist form { flex-direction: column; }
}

/* ── Page (pricing / download / changelog) layout ───────── */

.page {
  padding: clamp(56px, 8vw, 80px) 0 96px;
  max-width: 760px;
  margin: 0 auto;
}

.page h1 {
  font-size: clamp(30px, 4.5vw, 44px);
  letter-spacing: -0.022em;
  line-height: 1.14;
  margin: 0 0 14px;
  text-wrap: balance;
}

.page p.lede { color: var(--text-muted); font-size: 18px; margin: 0 0 40px; max-width: 40em; text-wrap: pretty; }

/* Soft tonal panel, no border, no banned side-stripe. */
.notice {
  background: var(--surface-sunken);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  font-size: 15.5px;
  color: var(--text-muted);
  line-height: 1.65;
}

.notice strong { color: var(--text-primary); }
.notice a { color: var(--accent-ink); text-underline-offset: 2px; }
@media (prefers-color-scheme: dark) { .notice a { color: var(--accent); } }

/* ── Long-form legal / prose (privacy, terms) ── */
.legal { color: var(--text-primary); font-size: 16px; line-height: 1.7; }
.legal .meta { color: var(--text-muted); font-size: 14.5px; margin: 0 0 32px; }
.legal h2 {
  font-size: 20px;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
  padding-top: 8px;
}
.legal h3 { font-size: 16.5px; margin: 26px 0 8px; }
.legal p { margin: 0 0 14px; max-width: 64ch; text-wrap: pretty; }
.legal ul { margin: 0 0 14px; padding-left: 22px; max-width: 64ch; }
.legal li { margin: 0 0 7px; }
.legal a { color: var(--accent-ink); text-underline-offset: 2px; }
@media (prefers-color-scheme: dark) { .legal a { color: var(--accent); } }
.legal strong { color: var(--text-primary); }
.legal .table-wrap { overflow-x: auto; margin: 0 0 20px; }
.legal table { border-collapse: collapse; width: 100%; font-size: 14.5px; min-width: 32em; }
.legal th, .legal td {
  text-align: left;
  padding: 9px 14px;
  border-bottom: 1px solid var(--hairline, rgba(0,0,0,0.08));
  vertical-align: top;
}
.legal th { color: var(--text-muted); font-weight: 600; }

/* Pricing tiles — tonal tiles; the core paid plan sits one step raised.
   Flexes from the 4-plan set (Free / App / AI Lite / AI Pro) down to 1-up. */
.tease-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 44px 0;
}

.tease {
  background: var(--surface-sunken);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
}

/* The Clozely App tile (the one-time purchase) = the hero plan, quietly raised. */
.tease:nth-child(2) {
  background: var(--surface-raised);
  box-shadow: var(--elev-2);
}

.tease .t-name { font-weight: 700; font-size: 16px; color: var(--text-primary); }
.tease .t-desc { color: var(--text-muted); font-size: 14px; margin-top: 8px; line-height: 1.55; }
.tease .t-price {
  margin-top: 16px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

@media (max-width: 760px) { .tease-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 440px) { .tease-grid { grid-template-columns: 1fr; } }

/* Changelog */
.release { margin-bottom: 48px; }

.release h2 {
  font-size: 22px;
  margin: 0 0 4px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  letter-spacing: -0.01em;
}

.release .date { font-size: 14px; color: var(--text-subtle); font-weight: 400; }

.release .tag {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent-wash);
  color: var(--accent-ink);
  border-radius: var(--radius-xs);
  padding: 3px 9px;
}

.release ul { margin: 14px 0 0; padding-left: 22px; color: var(--text-muted); }
.release li { margin: 8px 0; font-size: 15.5px; line-height: 1.6; }
.release li strong { color: var(--text-secondary); }

/* ── Footer ─────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--hairline);
  padding: 44px 0 56px;
  color: var(--text-subtle);
  font-size: 14px;
  margin-top: 24px;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  align-items: center;
}

.foot .spacer { margin-right: auto; }

.foot-legal { margin-top: 16px; font-size: 12.5px; color: var(--text-subtle); line-height: 1.55; max-width: 70ch; }

footer a {
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-xs);
  transition: color 150ms var(--ease);
}
footer a:hover { color: var(--text-primary); }

/* ── Motion — conveys state, never decoration. No load choreography. ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
