/* Cover Letter Creator — site styles.
 *
 * One light world. The app's store presence is a warm cream sheet with indigo headlines,
 * periwinkle accents and a purple CTA gradient, and a job-seeker reading 1,200 words about
 * resignation etiquette wants paper, not a dashboard — so the whole site, builder included,
 * stays light. The one dark moment is the ink-navy footer/CTA band, which is the brand navy
 * doing what it does on the store screenshots' wave motif.
 *
 * Tokens come from app.md's brand section: #FAF9F6 cream, #2A22B5 indigo, #4A55E8 periwinkle,
 * #2D7FF0 app-icon blue, #7C5CFC→#5C55F5 CTA gradient, layered blue waves.
 *
 * Every colour pairing below was measured (WCAG 2.x relative luminance), not eyeballed:
 *   ink #17153A on cream ............ 16.6:1   indigo #2A22B5 on cream ......... 10.0:1
 *   peri #4A55E8 on cream ........... 5.3:1    muted #5A5878 on cream .......... 6.4:1
 *   white on grad light #7C5CFC ..... 4.38:1   white on grad dark #5C55F5 ...... 5.16:1
 * The brand gradient's light end misses AA for normal white text by a hair (4.38 < 4.5), so
 * buttons that carry white text deepen that end one step to #6C59F8 (white 4.75:1 — the
 * button's worst-case point) while decoration (icon tiles, hero glow, the paper's top rule)
 * keeps the pure #7C5CFC→#5C55F5. App blue #2D7FF0 is 3.69:1 on cream: graphics only, never
 * body text — its text-carrying variant is #1B5AC8 (5.97:1 on cream).
 */

:root {
  --cream: #faf9f6;
  --cream-2: #f2f0ea;        /* section-alt; indigo still 9.2:1 here */
  --white: #ffffff;

  --ink: #17153a;            /* 16.6:1 on cream, 17.4:1 on white */
  --indigo: #2a22b5;         /* headlines; 10.0:1 on cream, white on it 10.5:1 */
  --peri: #4a55e8;           /* links/accents; 5.3:1 on cream, 5.6:1 on white */
  --app-blue: #2d7ff0;       /* 3.69:1 on cream — decoration/graphics only */
  --muted: #5a5878;          /* 6.4:1 on cream, 6.8:1 on white */

  --grad-a: #7c5cfc;         /* brand gradient, light end (white text: 4.38:1 — decor only) */
  --grad-b: #5c55f5;         /* brand gradient, dark end (white text: 5.16:1) */
  --grad-a-btn: #6c59f8;     /* deepened light end for white-text buttons: 4.75:1 */

  --violet-text: #6d28d9;    /* 6.8:1 on cream, 7.1:1 on white */
  --blue-text: #1b5ac8;      /* 6.0:1 on cream, 6.3:1 on white */
  --teal: #14b8a6;
  --teal-text: #0e6b64;      /* 6.0:1 on cream, 6.4:1 on white */
  --amber: #f5a623;
  --amber-text: #a14d07;     /* 5.6:1 on cream, 5.9:1 on white */
  --coral: #ff7a59;
  --coral-text: #b93a15;     /* 5.4:1 on cream, 5.7:1 on white */
  --red-text: #b91c1c;

  /* On the ink-navy footer/CTA band */
  --on-dark: #aba8cc;        /* 7.6:1 on ink */
  --on-dark-link: #c9c7e6;   /* 10.6:1 on ink */
  --on-dark-dim: #9d9ac2;    /* 6.5:1 on ink */

  --line: #e5e3f2;
  --line-2: #d6d3e8;

  --radius: 16px;
  --radius-lg: 24px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(23, 21, 58, 0.05), 0 8px 24px rgba(23, 21, 58, 0.07);
  --shadow-lg: 0 24px 60px rgba(23, 21, 58, 0.14);
  --wrap: 1120px;

  /* No webfonts (font-src 'self', zero external requests): system UI stack, serif for letters. */
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --serif: Georgia, 'Times New Roman', Times, serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

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

/* The UA rule for [hidden] is display:none, but any author rule that sets display wins on cascade
   origin regardless of specificity — .btn{display:inline-flex} would keep an element the builder
   had hidden on screen. This is why normalize.css ships the same rule. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--indigo); line-height: 1.18; margin: 0 0 0.5em; font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1.1em; }
a { color: var(--peri); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--indigo); }
img { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
small { font-size: 0.85rem; }
code { font-family: var(--mono); font-size: 0.88em; background: var(--cream-2); padding: 0.15em 0.4em; border-radius: 5px; color: var(--ink); }
pre { background: var(--cream-2); color: var(--ink); border: 1px solid var(--line); padding: 1rem 1.1rem; border-radius: var(--radius-sm); overflow-x: auto; font-size: 0.85rem; line-height: 1.55; }
pre code { background: none; padding: 0; color: inherit; }

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap-narrow { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.section { padding: 4.5rem 0; }
.section-tight { padding: 3rem 0; }
.section-alt { background: var(--cream-2); }
.center { text-align: center; }
.lede { font-size: 1.15rem; color: var(--muted); }
.muted { color: var(--muted); }
.tiny { font-size: 0.82rem; line-height: 1.5; }

.kicker { font-size: 0.73rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--violet-text); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 0.7rem 1.1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

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

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250, 249, 246, 0.92);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 1.4rem; height: 66px; }
.brand { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--indigo); text-decoration: none; letter-spacing: -0.02em; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand span { font-size: 1.02rem; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 1.35rem; }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.94rem; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--peri); }
.nav .btn { color: #fff; }
.nav-cta-short { display: none; }
@media (max-width: 480px) {
  .nav-cta-long { display: none; }
  .nav-cta-short { display: inline; }
}
@media (max-width: 860px) {
  .nav { gap: 0.9rem; }
  .nav a.nav-hide { display: none; }
}
@media (max-width: 480px) {
  /* Below this the brand and the CTA both wrap onto two lines and collide. */
  .site-header .wrap { gap: 0.6rem; padding: 0 14px; }
  .brand span { font-size: 0.95rem; white-space: nowrap; }
  .nav { gap: 0.7rem; }
  .nav .btn { padding: 0.45rem 0.85rem; font-size: 0.85rem; white-space: nowrap; }
}

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.78rem 1.4rem; border-radius: 999px; border: 0;
  font: inherit; font-weight: 600; font-size: 0.97rem;
  cursor: pointer; text-decoration: none; transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease, border-color 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Brand CTA gradient, light end deepened #7C5CFC→#6C59F8 so white clears AA at every point
   (worst case 4.75:1; the pure light end is 4.38:1 — see header note). */
.btn-primary { background: linear-gradient(100deg, var(--grad-a-btn), var(--grad-b)); color: #fff; box-shadow: 0 6px 18px rgba(92, 85, 245, 0.28); }
.btn-primary:hover { color: #fff; box-shadow: 0 10px 26px rgba(92, 85, 245, 0.34); }
.btn-ghost { background: var(--white); color: var(--ink); border: 1.5px solid var(--line-2); }
.btn-ghost:hover { color: var(--indigo); border-color: var(--peri); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.88rem; }
.btn-lg { padding: 0.95rem 1.9rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- store badges ---------- */

/* The badge *is* the SVG — Apple's and Google's artwork at their own aspect ratios. The anchor is
   only a hit target, so it must not paint a background of its own behind them. */
.stores { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.store-badge {
  display: inline-block; line-height: 0; border-radius: 8px; text-decoration: none;
  transition: transform 0.12s ease, opacity 0.12s ease;
}
.store-badge:hover { transform: translateY(-1px); opacity: 0.88; }
.store-badge svg { height: 44px; width: auto; display: block; }
.site-footer .store-badge svg { height: 40px; }
.stores-compact .store-badge svg { height: 36px; } /* inside inline-ctas, beside a button */

/* ---------- get-the-app blocks ---------- */

.get-app { margin-top: 1.6rem; }
.get-app .stores { gap: 0.7rem; }
.get-app-line { margin: 0.7rem 0 0; font-size: 0.88rem; color: var(--muted); max-width: 56ch; }
.get-app-inline {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 1.1rem 0; margin: 1.6rem 0 0;
}
.get-app-inline .get-app-line { margin-top: 0.6rem; }

.hero-cta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero-cta-or { color: var(--muted); font-size: 0.92rem; }
.hero-cta-line { margin: 0.9rem 0 0; font-size: 0.9rem; color: var(--muted); max-width: 54ch; }
.stores-hero .store-badge svg { height: 52px; }
@media (max-width: 560px) {
  .hero-cta { gap: 0.7rem; }
  .hero-cta-or { width: 100%; }
  .stores-hero .store-badge svg { height: 46px; }
}

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

.hero { position: relative; overflow: hidden; padding: 2.6rem 0 2.5rem; }
.hero::before {
  content: ''; position: absolute; inset: -40% -20% auto -20%; height: 620px; z-index: 0;
  background:
    radial-gradient(closest-side, rgba(74, 85, 232, 0.13), transparent 70%) 18% 40% / 60% 90% no-repeat,
    radial-gradient(closest-side, rgba(124, 92, 252, 0.12), transparent 70%) 82% 30% / 55% 85% no-repeat,
    radial-gradient(closest-side, rgba(45, 127, 240, 0.09), transparent 70%) 50% 85% / 60% 70% no-repeat;
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { max-width: 19ch; }
.hero .lede { max-width: 56ch; font-size: 1.2rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 3rem; align-items: center; }
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; gap: 2rem; } .hero h1, .hero .lede { max-width: none; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--peri); background: rgba(74, 85, 232, 0.10);
  padding: 0.38rem 0.85rem; border-radius: 999px; margin-bottom: 1.1rem;
}
.eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--peri); }

/* Home hero content block: the wave divider renders after it, so it only constrains line
   lengths. The second lede (.hero-lede-2) is the app hand-off line — quieter than the lede. */
.hero-inner { max-width: 860px; }
.hero-lede-2 { font-size: 1.02rem; color: var(--muted); max-width: 58ch; margin: -0.3rem 0 0; }

/* Tool-page heroes carry breadcrumb + h1 + lede + an inline get-the-app rule — tighter than
   the home hero, and flush at the bottom so the wave sits directly under the badges. */
.hero-tool { padding: 1.7rem 0 0.6rem; }
.hero-tool h1 { max-width: 24ch; }

.hero-points { list-style: none; padding: 0; margin: 1.8rem 0 0; display: grid; gap: 0.55rem; }
.hero-points li { display: flex; gap: 0.6rem; align-items: flex-start; font-size: 0.99rem; }
.hero-points svg { width: 19px; height: 19px; flex: none; margin-top: 3px; color: var(--teal-text); }

/* The evidence-carrying versions of the hero points, where there is room to actually read them. */
.proof-list { list-style: none; padding: 0; margin: 1.8rem 0 0; display: grid; gap: 0.9rem; max-width: 78ch; }
.proof-list li { display: flex; gap: 0.7rem; align-items: flex-start; font-size: 0.96rem; line-height: 1.6; }
.proof-list svg { width: 18px; height: 18px; flex: none; margin-top: 5px; color: var(--teal-text); }

.phone-shot {
  border-radius: 30px; box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  background: var(--white); margin: 0 auto; max-width: 320px;
}

/* ---------- wave divider ---------- */

/* The store screenshots close with layered blue waves; the site reuses one low-detail inline-SVG
   WAVE const between the hero and the first content section. The SVG's back layers carry inline
   fills of the brand blues at low opacity (decorative — no text ever sits on them); its FRONT
   layer fills with currentColor, so the .wave-to-* helper picks which surface the wave lands on. */
.wave-divider { line-height: 0; position: relative; z-index: 1; pointer-events: none; }
.wave-divider svg, .wave { display: block; width: 100%; height: clamp(42px, 7vw, 88px); }
.wave-to-alt { color: var(--cream-2); }
.wave-to-white { color: var(--white); }
.wave-to-ink { color: var(--ink); }
.wave-flip { transform: scaleY(-1); }

/* ---------- the builder (the site's real tool) ---------- */

.builder {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 2rem;
  align-items: start;
}
@media (max-width: 940px) { .builder { grid-template-columns: 1fr; gap: 1.6rem; } }

.builder-form {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.5rem; box-shadow: var(--shadow);
}
@media (min-width: 720px) { .builder-form { padding: 1.8rem 2rem; } }
.builder-form h2, .builder-head h2 { font-size: 1.35rem; margin-bottom: 0.2rem; }
.builder-head { margin-bottom: 1.1rem; grid-column: 1 / -1; } /* spans both builder columns */
.builder-head p { margin: 0; font-size: 0.9rem; color: var(--muted); }

.field { margin-bottom: 1.05rem; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > .field-label {
  display: block; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em;
  color: var(--ink); margin-bottom: 0.35rem;
}
.field .req { color: var(--coral-text); }
.field .hint { display: block; font-size: 0.78rem; font-weight: 400; color: var(--muted); margin-top: 0.25rem; }

.builder input[type="text"], .builder textarea, .builder select {
  width: 100%; font: inherit; font-size: 0.95rem; color: var(--ink);
  background: var(--white); border: 1.5px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
}
.builder textarea { min-height: 5.2em; resize: vertical; line-height: 1.5; }
.builder input::placeholder, .builder textarea::placeholder { color: #75738f; opacity: 1; } /* 4.6:1 on white (measured 4.56) */
.builder input:focus, .builder textarea:focus, .builder select:focus {
  outline: none; border-color: var(--peri); box-shadow: 0 0 0 3px rgba(74, 85, 232, 0.18);
}

/* Tone + length sit in one controls row with Shuffle and the sample filler. */
.builder-controls { display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: flex-end; margin-top: 1.3rem; }
.builder-controls .field { margin: 0; flex: 1 1 130px; }
.tone-select { min-width: 130px; }
.btn-shuffle, .btn-sample { flex: none; }
.btn-shuffle { background: var(--white); color: var(--indigo); border: 1.5px solid var(--line-2); }
.btn-shuffle:hover { border-color: var(--peri); }
.btn-sample { background: transparent; color: var(--peri); border: 1.5px dashed var(--line-2); }
.btn-sample:hover { border-color: var(--peri); color: var(--indigo); }

/* Live preview column. Sticky so the letter stays in view while fields are edited. */
.letter-preview { position: sticky; top: 82px; }
@media (max-width: 940px) { .letter-preview { position: static; } }

/* The letter itself: a white sheet, serif document stack, generous leading — it should read
   like paper in a printer tray, not like a UI panel. The preview text is plain with real line
   breaks, so the sheet preserves them itself (pre-wrap) whether the content is a text node
   or an inner <pre>. */
.letter-paper {
  position: relative;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2rem 2.1rem 2.2rem;
  font-family: var(--serif); font-size: 0.98rem; line-height: 1.7; color: var(--ink);
  white-space: pre-wrap; overflow-wrap: break-word;
  min-height: 340px;
}
.letter-paper::before {
  /* Letterhead rule in the pure brand gradient (decorative — hidden in print). */
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(90deg, var(--grad-a), var(--grad-b));
}
.letter-paper pre {
  margin: 0; padding: 0; background: none; border: 0; border-radius: 0;
  font: inherit; color: inherit; white-space: inherit; overflow: visible;
}
.letter-paper .ph { color: var(--muted); } /* bracketed [Your Name]-style placeholders, if marked */
.letter-paper.is-streaming::after { content: '▍'; color: var(--peri); animation: caret-blink 1s steps(1) infinite; }
@keyframes caret-blink { 50% { opacity: 0; } }
@media (max-width: 560px) { .letter-paper { padding: 1.4rem 1.2rem 1.6rem; font-size: 0.94rem; } }

.letter-meta { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 0.55rem; font-size: 0.8rem; color: var(--muted); }
.letter-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }

.letter-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.9rem; }
.btn-copy, .btn-download, .btn-print {
  background: var(--white); color: var(--ink); border: 1.5px solid var(--line-2);
  padding: 0.5rem 1rem; font-size: 0.88rem;
}
.btn-copy:hover, .btn-download:hover, .btn-print:hover { color: var(--indigo); border-color: var(--peri); }
.btn-copy.is-copied { color: var(--teal-text); border-color: var(--teal-text); }

/* The AI row: the one control that talks to a server, visually set apart from the in-browser
   builder so the honesty note has a clear referent. */
.ai-row {
  display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center;
  margin-top: 1.4rem; padding: 1rem 1.1rem;
  background: linear-gradient(135deg, rgba(124, 92, 252, 0.07), rgba(45, 127, 240, 0.06));
  border: 1px solid var(--line); border-radius: var(--radius);
}
.ai-row .field { margin: 0; flex: 1 1 150px; }
.btn-ai { background: linear-gradient(100deg, var(--grad-a-btn), var(--grad-b)); color: #fff; box-shadow: 0 6px 18px rgba(92, 85, 245, 0.24); flex: none; }
.btn-ai:hover { color: #fff; }
.btn-ai[aria-busy="true"] { opacity: 0.7; cursor: progress; transform: none; }
.ai-note { flex-basis: 100%; margin: 0; font-size: 0.8rem; line-height: 1.5; color: var(--muted); }

/* The daily-limit message is an upsell, not an error: amber notice, no red anywhere. */
.ai-limit-note {
  flex-basis: 100%; margin: 0;
  background: #fdf3e3; border: 1px solid #ecd3a8; border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem; font-size: 0.88rem; line-height: 1.5;
  color: #7a4e0e; /* 6.5:1 on #FDF3E3 */
}
.ai-limit-note a { color: #7a4e0e; font-weight: 600; }

/* ---------- cards & grids ---------- */

.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }

.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 0.4rem; font-size: 1.08rem; }
.card p:last-child { margin-bottom: 0; }
.card-link { text-decoration: none; color: inherit; display: block; transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease; }
.card-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-2); color: inherit; }
.card-link h3 { color: var(--peri); }

/* Accent tiles. Icons inside are white line art, aria-hidden decoration beside a heading that
   carries the meaning — so the gradients only need to be distinct, not text-contrast. The
   *text* variant of each accent (used for links, kickers, table verdicts) is the measured
   token: violet 6.8:1, blue 6.0:1, teal 6.0:1, amber 5.6:1, coral 5.4:1 — all on cream. */
.icon-tile {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 0.85rem;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b));
}
.icon-tile svg { width: 21px; height: 21px; color: #fff; }
.icon-tile.t-violet { background: linear-gradient(135deg, var(--grad-a), #4c30d9); }
.icon-tile.t-blue { background: linear-gradient(135deg, var(--app-blue), var(--blue-text)); }
.icon-tile.t-teal { background: linear-gradient(135deg, var(--teal), var(--teal-text)); }
.icon-tile.t-amber { background: linear-gradient(135deg, var(--amber), var(--amber-text)); }
.icon-tile.t-coral { background: linear-gradient(135deg, var(--coral), var(--coral-text)); }

/* ---------- steps ---------- */

.steps { counter-reset: step; display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step { position: relative; padding-left: 3.2rem; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: -2px;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; color: #fff;
  background: linear-gradient(135deg, var(--grad-a-btn), var(--grad-b));
}
.step h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.step p { margin: 0; font-size: 0.95rem; }

/* ---------- screenshots ---------- */

.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1.4rem; }
.shot figure { margin: 0; }
.shot img { border-radius: 22px; box-shadow: var(--shadow); border: 1px solid var(--line); background: #fff; }
.shot figcaption { margin-top: 0.7rem; font-size: 0.88rem; color: var(--muted); text-align: center; }

/* ---------- comparison table ---------- */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); border: 1px solid var(--line); background: var(--white); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { padding: 0.72rem 0.95rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--cream-2); color: var(--indigo); font-weight: 700; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.yes, td.no, td.copy { font-weight: 600; white-space: nowrap; }
td.yes { color: var(--teal-text); }
td.no { color: var(--red-text); }
td.copy { color: var(--violet-text); }

/* ---------- FAQ ---------- */

.faq { display: grid; gap: 0.8rem; }
.faq details {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0 1.2rem; box-shadow: var(--shadow);
}
.faq summary {
  cursor: pointer; padding: 1.05rem 0; font-weight: 600; color: var(--ink);
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; flex: none; width: 10px; height: 10px;
  border-right: 2px solid var(--peri); border-bottom: 2px solid var(--peri);
  transform: rotate(45deg) translate(-2px, -2px); transition: transform 0.16s ease;
}
.faq details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq .faq-body { padding: 0 0 1.15rem; }
.faq .faq-body p { margin: 0 0 0.7rem; font-size: 0.97rem; }
.faq .faq-body p:last-child { margin: 0; }
.learn-more { font-weight: 600; font-size: 0.92rem; display: inline-flex; align-items: center; gap: 0.3rem; }
.learn-more::after { content: '→'; }

/* ---------- guides ---------- */

.guide-list { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.guide-card { display: flex; flex-direction: column; }
.guide-card .kicker { margin-bottom: 0.45rem; }
.guide-card h3 { font-size: 1.03rem; line-height: 1.35; }
.guide-card p { font-size: 0.92rem; color: var(--muted); margin: 0; }

.article { padding: 2.5rem 0 4rem; }
.article h2 { margin-top: 2.4rem; scroll-margin-top: 84px; }
.article h3 { margin-top: 1.8rem; font-size: 1.12rem; }
.article ul, .article ol { padding-left: 1.3rem; margin: 0 0 1.2em; }
.article li { margin-bottom: 0.45em; }
.article > .table-scroll { margin: 1.6rem 0; }
.article blockquote {
  margin: 1.6rem 0; padding: 0.9rem 1.2rem; border-left: 3px solid var(--peri);
  background: var(--white); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink);
}
.article blockquote p:last-child { margin: 0; }

/* Letter/email examples inside guides: the same paper language as the builder preview, never
   code styling — wrapped serif text on a white sheet, no horizontal scrolling, no mono. */
figure.letter-example { margin: 1.8rem 0; }
.letter-example pre {
  margin: 0;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.7rem;
  font-family: var(--serif); font-size: 0.95rem; line-height: 1.7; color: var(--ink);
  white-space: pre-wrap; overflow-wrap: break-word; overflow-x: visible;
}
.letter-example figcaption { margin-top: 0.6rem; font-size: 0.82rem; color: var(--muted); }
@media (max-width: 560px) { .letter-example pre { padding: 1.1rem 1rem; font-size: 0.92rem; } }

.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 1.2rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--peri); }
.breadcrumb span { margin: 0 0.4rem; color: var(--line-2); }

.toc {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; margin: 1.8rem 0;
}
.toc b { display: block; font-size: 0.78rem; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.6rem; }
.toc ol { margin: 0; padding-left: 1.1rem; }
.toc li { margin-bottom: 0.3rem; font-size: 0.94rem; }

.callout {
  border-radius: var(--radius); padding: 1.1rem 1.3rem; margin: 1.8rem 0;
  border-left: 4px solid var(--peri); background: var(--white); box-shadow: var(--shadow);
}
.callout.tip { border-left-color: var(--teal-text); }
.callout.warn { border-left-color: var(--amber-text); }
.callout b { display: block; color: var(--indigo); margin-bottom: 0.3rem; }
.callout p:last-child { margin: 0; }

.inline-cta {
  display: flex; gap: 1.1rem; align-items: center; flex-wrap: wrap;
  background: var(--ink); color: var(--on-dark); border-radius: var(--radius); padding: 1.3rem 1.5rem; margin: 2.2rem 0;
}
.inline-cta .ic-main { flex: 1; min-width: 220px; }
.inline-cta .ic-actions { flex: none; display: flex; flex-direction: column; align-items: flex-start; gap: 0.7rem; }
.inline-cta b { display: block; color: #fff; font-size: 1.05rem; margin-bottom: 0.2rem; }
.inline-cta p { margin: 0; font-size: 0.92rem; color: var(--on-dark-dim); }
.inline-cta a:not(.btn) { color: var(--on-dark-link); }
.inline-cta .btn { background: linear-gradient(100deg, var(--grad-a-btn), var(--grad-b)); color: #fff; }
.inline-cta .btn:hover { color: #fff; }

.related { margin-top: 3rem; padding-top: 1.8rem; border-top: 1px solid var(--line); }
.related h2 { font-size: 1.2rem; }
.related ul { list-style: none; padding: 0; display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.related a { font-size: 0.95rem; }

/* ---------- final CTA ---------- */

.cta-band {
  background: var(--ink); color: var(--on-dark); border-radius: var(--radius-lg);
  padding: 2.8rem 2rem; text-align: center; position: relative; overflow: hidden;
}
.cta-band::before {
  content: ''; position: absolute; inset: auto -10% -60% -10%; height: 320px; z-index: 0;
  background:
    radial-gradient(closest-side, rgba(124, 92, 252, 0.32), transparent 70%) 25% 50% / 55% 100% no-repeat,
    radial-gradient(closest-side, rgba(45, 127, 240, 0.28), transparent 70%) 75% 50% / 55% 100% no-repeat;
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { color: #fff; }
.cta-band p { color: var(--on-dark); max-width: 52ch; margin-left: auto; margin-right: auto; }
.cta-band .stores { justify-content: center; margin-top: 1.5rem; }
.cta-band .store-badge { filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.35)); }

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

.site-footer { background: var(--ink); color: var(--on-dark); padding: 3rem 0 2rem; margin-top: 4rem; font-size: 0.92rem; }
.site-footer a { color: var(--on-dark-link); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.footer-grid .footer-heading { color: #fff; font-size: 0.79rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.8rem; font-weight: 700; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.42rem; }
.footer-brand { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.8rem; }
.footer-brand img { width: 34px; height: 34px; border-radius: 9px; }
.footer-brand b { color: #fff; font-size: 1rem; }
.footer-bottom { margin-top: 2.4rem; padding-top: 1.4rem; border-top: 1px solid #26244d; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.85rem; }

/* ---------- misc ---------- */

.pill-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 1rem 0 0; }
.pill { background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.8rem; font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.pill strong { color: var(--indigo); font-weight: 700; }

.notice {
  background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--amber-text);
  border-radius: var(--radius-sm); padding: 0.9rem 1.1rem; font-size: 0.92rem; margin: 1.2rem 0;
}

/* ---------- print ---------- */

/* Two behaviours. On any page: the chrome disappears and the content prints clean. On a page
   with a builder (.letter-paper present): ONLY the letter prints — the Print/PDF button is the
   free path to a PDF, so the output must be the bare sheet. The :has() isolation is a
   progressive enhancement; a browser without :has() still gets the chrome-free fallback. */
@page { margin: 1.8cm; }
@media print {
  .site-header, .site-footer, .cta-band, .inline-cta, .skip-link, .nav,
  .stores, .get-app, .get-app-inline, .hero-cta, .breadcrumb, .wave-divider, .wave,
  .btn, .letter-actions, .ai-row, .ai-limit-note { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  a { color: #000; text-decoration: none; }

  /* Builder pages: everything except the sheet vanishes. Sections without the sheet are
     removed from flow entirely (no blank trailing pages), the rest is visibility-isolated. */
  body:has(.letter-paper) main > *:not(:has(.letter-paper)) { display: none !important; }
  body:has(.letter-paper) * { visibility: hidden; }
  body:has(.letter-paper) .letter-paper,
  body:has(.letter-paper) .letter-paper * { visibility: visible; }
  body:has(.letter-paper) .letter-paper {
    position: absolute; left: 0; top: 0; width: 100%; min-height: 0;
    margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none;
    font-size: 12pt; line-height: 1.6; color: #000; background: #fff;
  }
  body:has(.letter-paper) .letter-paper::before,
  body:has(.letter-paper) .letter-paper::after { display: none; }

  /* Guide letter examples print as plain paper, not cards. */
  .letter-example pre { border: 0; box-shadow: none; padding: 0; }
}
