/* Be Write — shared design base for the site.
   Single source of truth: tokens + components. Every page variant
   imports this file and adds ONLY its own layout on top. */

/* ── Tokens (mirrors the app palette, lib/theme.dart) ─────────────── */
:root {
  /* Native widgets (number spinners, selects, scrollbars) follow the
     page theme instead of the OS — flipped in the dark blocks below. */
  color-scheme: light;
  --bg: #FBF8F4;
  --surface: #F3EEE5;
  --surface-dark: #EDE8DF;
  --border: #E2DACE;
  --text: #3D3425;
  --text-secondary: #5C4F3A;
  --muted: #8B7E6A;
  --hint: #B5A992;
  --accent: #C4956A;
  --accent-deep: #A97B4F;   /* darker accent for text-on-cream contrast */
  --accent-bg: rgba(196, 149, 106, .12);
  /* The aurora trio (share-card gradients, og cards, accents). */
  --aurora-1: #b53fa7;
  --aurora-2: #6a5cd0;
  --aurora-3: #e8734e;
  /* Theme-dependent surfaces (so pages/tools.css need no dark blocks). */
  --glass-bg: rgba(255, 255, 255, .50);
  --glass-border: rgba(255, 255, 255, .72);
  --glass-shadow: 0 8px 32px rgba(61, 52, 37, .07);
  --input-bg: rgba(255, 255, 255, .7);
  --cta-border: rgba(255, 255, 255, .6);
  --wash-1: rgba(196, 149, 106, .21);
  --wash-2: rgba(123, 110, 168, .17);
  --wash-3: rgba(74, 123, 165, .13);
  /* Feature-chip tints (mirror writingBg/… in theme.dart). */
  --writing-bg: rgba(74, 123, 165, .12);
  --editing-bg: rgba(123, 110, 168, .12);
  --publishing-bg: rgba(123, 158, 106, .12);
  /* Gradient-text stops for big numerals (.band .num / .result .num). */
  --phone-bezel: #2A2520;
  /* Theme-switcher icon visibility. */
  --show-sun: none;
  --show-moon: inline;
  --writing: #4A7BA5;
  --editing: #7B6EA8;
  --publishing: #7B9E6A;

  --font-serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --radius: 14px;
  --radius-lg: 22px;
  --container: 1040px;
  --section-gap: clamp(64px, 10vw, 120px);
}
/* Dark theme. Two entry points: explicit user choice (data-theme set
   by assets/theme.js) and the system preference when no choice is
   stored. THE TWO VAR BLOCKS MUST BE IDENTICAL — site_check.py
   compares them and checks both against AppPalette.dark. */
:root[data-theme="dark"] {
  --bg: #1E1B16;
  --surface: #2A2520;
  --surface-dark: #23201B;
  --border: #3D3630;
  --text: #E8E0D4;
  --text-secondary: #C4BAA8;
  --muted: #8B7E6A;
  --hint: #6B604F;
  --accent: #D4AD86;
  --accent-deep: #D4AD86;
  --accent-bg: rgba(212, 173, 134, .16);
  --writing: #6FA0CE;
  --editing: #A396D2;
  --publishing: #A0C58D;
  --glass-bg: rgba(42, 37, 32, .55);
  --glass-border: rgba(232, 224, 212, .10);
  --glass-shadow: 0 10px 34px rgba(0, 0, 0, .32);
  --input-bg: rgba(20, 17, 13, .5);
  --cta-border: rgba(232, 224, 212, .10);
  --wash-1: rgba(212, 173, 134, .16);
  --wash-2: rgba(163, 150, 210, .14);
  --wash-3: rgba(111, 160, 206, .11);
  --writing-bg: rgba(111, 160, 206, .20);
  --editing-bg: rgba(163, 150, 210, .20);
  --publishing-bg: rgba(160, 197, 141, .20);
  --phone-bezel: #4A443C;
  --show-sun: inline;
  --show-moon: none;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #1E1B16;
  --surface: #2A2520;
  --surface-dark: #23201B;
  --border: #3D3630;
  --text: #E8E0D4;
  --text-secondary: #C4BAA8;
  --muted: #8B7E6A;
  --hint: #6B604F;
  --accent: #D4AD86;
  --accent-deep: #D4AD86;
  --accent-bg: rgba(212, 173, 134, .16);
  --writing: #6FA0CE;
  --editing: #A396D2;
  --publishing: #A0C58D;
  --glass-bg: rgba(42, 37, 32, .55);
  --glass-border: rgba(232, 224, 212, .10);
  --glass-shadow: 0 10px 34px rgba(0, 0, 0, .32);
  --input-bg: rgba(20, 17, 13, .5);
  --cta-border: rgba(232, 224, 212, .10);
  --wash-1: rgba(212, 173, 134, .16);
  --wash-2: rgba(163, 150, 210, .14);
  --wash-3: rgba(111, 160, 206, .11);
  --writing-bg: rgba(111, 160, 206, .20);
  --editing-bg: rgba(163, 150, 210, .20);
  --publishing-bg: rgba(160, 197, 141, .20);
  --phone-bezel: #4A443C;
  --show-sun: inline;
  --show-moon: none;
  color-scheme: dark;
  }
}

/* ── Reset-ish ────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-deep); }

/* ── Type ─────────────────────────────────────────────────────────── */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(2.4rem, 5.5vw, 3.6rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
h3 { font-size: 1.15rem; }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--text-secondary); }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.eyebrow {
  font-family: var(--font-body); font-size: .78rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--accent-deep);
}

/* ── Layout ───────────────────────────────────────────────────────── */
.container {
  max-width: var(--container); margin: 0 auto;
  /* left/right ONLY — the shorthand `padding: 0 24px` was zeroing
     section padding-top on <section class="container"> (class beats
     element selector), collapsing the gap before FAQ. */
  padding-left: 24px; padding-right: 24px;
}
.narrow { max-width: 720px; }
section { padding-top: var(--section-gap); }
section:last-of-type { padding-bottom: var(--section-gap); }

/* ── Nav / footer ─────────────────────────────────────────────────── */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0;
}
.brand {
  font-family: var(--font-serif); font-size: 1.35rem; font-weight: 650;
  color: var(--text); text-decoration: none;
}
.brand .mark { margin-right: 8px; }
.footer {
  margin-top: var(--section-gap);
  border-top: 1px solid var(--border);
  padding: 28px 0 44px;
  display: flex; flex-wrap: wrap; gap: 12px 28px;
  align-items: center; justify-content: space-between;
  color: var(--muted); font-size: .9rem;
}
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--accent-deep); }

/* ── Components ───────────────────────────────────────────────────── */
.btn {
  display: inline-block; border-radius: 999px; text-decoration: none;
  font-weight: 700; font-size: 1rem; padding: 14px 28px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #FBF8F4; }
.btn-ghost { border: 1.5px solid var(--border); color: var(--text); }

.pill {
  display: inline-block; background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 18px; font-size: .9rem;
  color: var(--text-secondary);
}

.card {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 28px;
}
.card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--text-secondary); font-size: .98rem; }
.card .glyph { font-size: 1.9rem; margin-bottom: 14px; display: block; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 820px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* FAQ — semantic details/summary, long-tail SEO content lives here. */
.faq details {
  border-bottom: 1px solid var(--border); padding: 18px 0;
}
.faq summary {
  cursor: pointer; font-weight: 700; font-size: 1.05rem;
  list-style: none; display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::after { content: '+'; color: var(--accent-deep); font-size: 1.2rem; }
.faq details[open] summary::after { content: '–'; }
.faq p { color: var(--text-secondary); margin: 10px 0 0; }

/* ── Share-card mock (pure CSS, echoes the app's real card designs) ─ */
.share-card {
  border-radius: 18px; padding: 22px; color: #fff; width: 250px;
  aspect-ratio: 4 / 5;
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 18px 40px rgba(61, 52, 37, .22);
}
.share-card .head { font-size: .8rem; opacity: .85; font-weight: 600; }
.share-card .big { font-family: var(--font-serif); font-size: 2.6rem; font-weight: 650; line-height: 1; }
.share-card .big small { display: block; font-family: var(--font-body); font-size: .85rem; font-weight: 600; opacity: .85; margin-top: 6px; }
.share-card .foot { font-size: .72rem; opacity: .8; display: flex; justify-content: space-between; }
.grad-aurora { background: linear-gradient(160deg, var(--aurora-1) 0%, var(--aurora-2) 45%, var(--aurora-3) 100%); }
.grad-ink { background: linear-gradient(160deg, #2A2520 0%, #3D3630 100%); }
.grad-warm { background: linear-gradient(160deg, #C4956A 0%, #A97B4F 100%); }

/* Theme switcher button (icons flip via --show-* tokens). */
.theme-btn {
  width: 34px; height: 34px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent;
  cursor: pointer; font-size: 15px; line-height: 1;
  display: grid; place-items: center; padding: 0;
}
.theme-btn:hover { border-color: var(--accent); }
.theme-btn .tb-sun { display: var(--show-sun); }
.theme-btn .tb-moon { display: var(--show-moon); }

/* Phone frame for CSS mockups */
.phone {
  width: 270px; border-radius: 36px; border: 10px solid var(--phone-bezel);
  background: var(--bg); overflow: hidden;
  box-shadow: 0 24px 60px rgba(61, 52, 37, .28);
}

/* Mini home-screen inside the phone — shared by all variants (DRY).
   Pure CSS echo of the real app's Home: greeting, streak dots, stat
   rows, week bar chart. */
.mini { padding: 16px 14px 18px; font-size: .68rem; color: var(--text); }
.mini .status {
  display: flex; justify-content: space-between; color: var(--muted);
  font-size: .6rem; padding: 0 2px 10px;
}
.mini h4 {
  font-family: var(--font-serif); font-size: 1.05rem; font-weight: 650;
  margin: 0 2px 2px;
}
.mini .sub { color: var(--muted); margin: 0 2px 10px; }
.mini .streak { display: flex; gap: 5px; margin: 0 2px 12px; }
.mini .dot {
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--accent); box-shadow: inset 0 -2px 0 rgba(0,0,0,.08);
}
.mini .dot.off { background: var(--surface-dark); box-shadow: none; }
.mini .row {
  background: var(--surface); border-radius: 12px;
  padding: 9px 11px; margin-bottom: 7px;
  display: flex; justify-content: space-between; align-items: center;
}
.mini .row b { display: block; font-size: .76rem; }
.mini .row .cap { color: var(--muted); }
.mini .row .badge {
  background: var(--accent-bg); color: var(--accent-deep);
  border-radius: 999px; padding: 2px 8px; font-weight: 700; font-size: .6rem;
}
.mini .chart {
  display: flex; align-items: flex-end; gap: 5px; height: 44px;
  background: var(--surface); border-radius: 12px; padding: 9px 11px 8px;
}
.mini .chart i {
  flex: 1; background: var(--accent); border-radius: 3px 3px 0 0;
  opacity: .85;
}
.mini .chart i.lo { opacity: .35; }
