/* ============================================================
   Narrative — Novel Writing App · gonarrative.app
   Design system: calm, writerly, paper-and-ink with brand blue
   ============================================================ */

/* Hallmark · audit-fix pass (2 critical + 6 major from audit.md)
 * nav: N5 floating pill — was N1a sticky translucent bar (AI fingerprint)
 * footer: Ft5 statement — was Ft3 4-column link catalogue (AI fingerprint)
 * majors: eyebrows cut · headers roman (no italic emphasis) · store-cards
 * de-templated · clickable labels nowrap · hex/rgba lifted into tokens ·
 * :focus-visible rings on every interactive element
 * minors: curly quotes · varied section rhythm (padding + head alignment) ·
 * named easings · tinted card surfaces · single icon voice · mobile
 * disclosure menu · one bloom kept (hero), two cut (cta, article-hero)
 */

:root {
  --paper: #fbfaf7;
  --paper-warm: #f5f2ec;
  --ink: #1a2433;
  --ink-soft: #45526a;
  --ink-faint: #6b7790;
  --blue: #2b87c8;
  --blue-deep: #1d6aa8;
  --blue-dark: #123a5c;
  --blue-night: #0e2c47;
  --blue-tint: #e8f2fa;
  --gold: #e8a33d;
  --line: #e5e0d6;
  --white: #ffffff;
  --card: #fcfcfd; /* fallback for the OKLCH line below */
  --card: oklch(99% 0.005 250); /* card surface — tinted toward the anchor hue, not pure white (minor #13) */
  --ink-black: #000;
  --blue-sky: #9fd4f2;
  --ink-body: #2c3648;
  --blue-tint-border: #cfe4f4;
  --blue-glow: rgba(43, 135, 200, .14); /* the single allowed bloom, hero only (minor #16) */
  --blue-shadow: rgba(43, 135, 200, .65);
  --blue-shadow-strong: rgba(43, 135, 200, .8);
  --paper-glass: rgba(251, 250, 247, .82);
  --on-dark: rgba(255, 255, 255, .82);
  --on-dark-dim: rgba(255, 255, 255, .6);
  --on-dark-fill: rgba(255, 255, 255, .12);
  --on-dark-fill-hover: rgba(255, 255, 255, .22);
  --on-dark-line: rgba(255, 255, 255, .28);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --shadow-soft: 0 20px 60px -20px rgba(18, 58, 92, .25);
  --shadow-card: 0 6px 24px -8px rgba(18, 58, 92, .18);
  --radius: 18px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

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

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Keyboard focus — instant ring, never animated in (audit major #8) */
:focus-visible {
  outline: 2px solid var(--blue-deep);
  outline-offset: 2px;
}
.cta :focus-visible,
.article-cta :focus-visible {
  outline-color: var(--blue-sky);
}

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

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; color: var(--ink); }

.section { padding: 96px 0; }
section[id] { scroll-margin-top: 100px; } /* clear the fixed pill on anchor jumps */
/* Section rhythm varies — not one uniform padding value (minor #10) */
#screenshots { padding: 72px 0; }
#how-it-works { padding: 120px 0; }
.section-alt { background: var(--paper-warm); }

.section-head { max-width: 720px; margin: 0 auto 56px; text-align: center; }
/* Heads biased left where the content below is left-led (minor #11) */
#screenshots .section-head,
#how-it-works .section-head { text-align: left; margin-left: 0; margin-right: 0; }
.section-head h2 { font-size: clamp(28px, 4vw, 42px); margin-bottom: 16px; }
.section-head p { font-size: 19px; color: var(--ink-soft); }

/* ---------- Header ----------
   N5 Floating pill — content-sized, visibly detached from the page edges,
   blur+saturate backdrop over the hero gradient. Replaces the sticky
   translucent wordmark-left / links-right / CTA-right bar, which was the
   canonical AI nav fingerprint (audit critical #1). */
.site-header {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}
.nav-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 22px;
  padding: 8px 10px 8px 18px;
  background: var(--paper-glass);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand img { width: 30px; height: 30px; border-radius: 7px; }
.nav-links { display: flex; gap: 22px; list-style: none; }
.nav-links a {
  color: var(--ink-soft);
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--ink); text-decoration: none; }

/* Mobile disclosure menu (minor #15) — desktop hides it; links are inline.
   No-JS <details>/<summary>; a tiny script closes it on pick / Escape. */
.nav-menu { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 28px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), background .15s var(--ease-out);
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-deep) 100%);
  color: var(--white);
  box-shadow: 0 10px 26px -10px var(--blue-shadow);
}
.btn-primary:hover { box-shadow: 0 14px 32px -10px var(--blue-shadow-strong); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue-deep); }
.btn-sm { padding: 9px 20px; font-size: 14px; }
.btn-light { background: var(--white); color: var(--blue-dark); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 600px at 85% -10%, var(--blue-glow), transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--blue-tint) 100%);
  padding: 124px 0 96px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: center;
}
.hero h1 {
  font-size: clamp(38px, 5.4vw, 62px);
  letter-spacing: -.01em;
  margin-bottom: 22px;
}
/* Headers stay roman — emphasis carried by accent colour (audit major #4) */
.hero h1 .accent { color: var(--blue-deep); }
.hero-sub {
  font-size: 20px;
  color: var(--ink-soft);
  max-width: 520px;
  margin-bottom: 32px;
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.hero-trust {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--ink-faint);
  align-items: center;
}
.hero-trust .stars { color: var(--gold); font-size: 15px; letter-spacing: 1px; }
.hero-shot {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero-shot img {
  width: 100%;
  max-width: 660px;
}

/* ---------- Store badges ---------- */
.badges { display: flex; gap: 14px; flex-wrap: wrap; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  background: var(--ink);
  color: var(--white);
  border-radius: 12px;
  padding: 10px 18px;
  line-height: 1.2;
  transition: transform .15s var(--ease-out), background .15s var(--ease-out);
}
.badge:hover { background: var(--ink-black); text-decoration: none; transform: translateY(-2px); }
.badge svg { width: 26px; height: 26px; flex: none; fill: var(--white); }
.badge small { display: block; font-size: 11px; opacity: .75; font-weight: 500; }
.badge strong { display: block; font-size: 16px; font-weight: 600; }

/* ---------- Download section ----------
   De-templated store cards (audit major #5): icon inline with the heading,
   left-aligned text, and the Apple card spans the full row so the grid is
   no longer N identical centred columns. Clickable labels are short and
   nowrap — a clickable span must never wrap to two lines (audit major #6). */
.download-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.store-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  text-align: left;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.store-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); text-decoration: none; }
.store-card-head { display: flex; align-items: center; gap: 12px; }
.store-card svg { width: 30px; height: 30px; flex: none; fill: var(--blue-deep); }
.store-card h3 { font-size: 20px; }
.store-card p { font-size: 14.5px; color: var(--ink-faint); flex: 1; }
.store-card .get {
  font-weight: 700;
  color: var(--blue-deep);
  font-size: 15px;
  white-space: nowrap;
}
.store-card-wide {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 20px;
}
.store-card-wide svg { width: 42px; height: 42px; }
.store-card-wide .store-card-text { flex: 1; }
.store-card-wide h3 { font-size: 22px; margin-bottom: 4px; }
.store-card-wide p { flex: none; }
.price-note {
  text-align: center;
  margin-top: 34px;
  color: var(--ink-faint);
  font-size: 15px;
}

/* ---------- Screenshots ---------- */
.shots {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(280px, 72vw);
  gap: 26px;
  overflow-x: auto;
  padding: 10px 24px 34px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.shots figure {
  scroll-snap-align: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.shots img { width: 100%; }
.shots figcaption {
  padding: 16px 18px 20px;
  font-size: 15px;
  color: var(--ink-soft);
  text-align: center;
}
.shots figcaption strong { display: block; font-family: var(--serif); font-size: 18px; color: var(--ink); margin-bottom: 3px; }

/* Landscape (Mac) screenshot gallery */
.shots-landscape { grid-auto-columns: min(620px, 86vw); }
.shots-landscape img { width: 100%; }
.shots-label {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}
.shots-label h3 { font-size: 24px; margin-bottom: 6px; }
.shots-label p { color: var(--ink-faint); font-size: 15.5px; margin-bottom: 18px; }
.shots-group + .shots-group { margin-top: 48px; }

/* ---------- How it works ---------- */
.steps { display: flex; flex-direction: column; gap: 80px; }
.step {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.step:nth-child(even) .step-media { order: 2; }
.step-num {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--blue-deep);
  border: 1.5px solid var(--blue);
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.step h3 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 14px; }
.step p { color: var(--ink-soft); font-size: 17.5px; margin-bottom: 14px; }
.step ul { list-style: none; margin-top: 6px; }
.step li {
  padding-left: 30px;
  position: relative;
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 16px;
}
.step li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--blue);
  font-weight: 700;
}
.step-media img {
  border-radius: 26px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  max-height: 560px;
  width: auto;
  margin: 0 auto;
}

/* ---------- Guides ---------- */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.guide-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-card);
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.guide-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); text-decoration: none; }
.guide-card .tag {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue-deep);
}
.guide-card h3 { font-size: 19.5px; line-height: 1.3; color: var(--ink); }
.guide-card p { font-size: 14.5px; color: var(--ink-faint); flex: 1; }
.guide-card .more { font-size: 14.5px; font-weight: 700; color: var(--blue-deep); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.faq-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 24px;
  font-family: var(--serif);
  font-size: 18.5px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 400;
  color: var(--blue);
  flex: none;
  transition: transform .2s var(--ease-in-out);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-body { padding: 0 24px 22px; color: var(--ink-soft); font-size: 16px; }
.faq-body a { font-weight: 600; white-space: nowrap; }

/* ---------- CTA ---------- */
.cta {
  /* flat dark gradient — bloom cut; the hero keeps the single allowed one (minor #16) */
  background: linear-gradient(160deg, var(--blue-dark) 0%, var(--blue-night) 100%);
  color: var(--white);
  text-align: center;
  padding: 110px 0;
}
.cta h2 { color: var(--white); font-size: clamp(30px, 4.4vw, 48px); margin-bottom: 18px; }
.cta h2 .accent { color: var(--blue-sky); } /* roman — no italic headers */
.cta p { color: var(--on-dark); font-size: 19px; max-width: 560px; margin: 0 auto 36px; }
.cta .badges { justify-content: center; margin-bottom: 22px; }
.cta .badge { background: var(--on-dark-fill); border: 1px solid var(--on-dark-line); }
.cta .badge:hover { background: var(--on-dark-fill-hover); }
.cta small { display: block; color: var(--on-dark-dim); font-size: 14px; }

/* ---------- Footer ----------
   Ft5 Statement — one closing line dominates; wordmark, a minimal link row
   and the copyright sit beneath a hairline in muted small type. Replaces
   the 4-column link catalogue with uppercase tracked h4s — the genre-blind
   AI footer fingerprint (audit critical #2). Light paper so the close
   doesn't merge into the dark CTA above it. */
.site-footer {
  background: var(--blue-night);
  color: rgba(255, 255, 255, .72);
  padding: 72px 0 40px;
  font-size: 14.5px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 44px;
  margin-bottom: 52px;
}
.footer-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.footer-brand img { width: 36px; height: 36px; border-radius: 9px; }
.footer-brand span { font-family: var(--serif); font-size: 21px; font-weight: 700; color: var(--white); }
.footer-col h4 {
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { color: rgba(255, 255, 255, .72); }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .14);
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: rgba(255, 255, 255, .5);
  font-size: 13.5px;
}

/* ---------- Guide / article pages ---------- */
.article-hero {
  /* flat tinted surface — bloom cut; the hero keeps the single allowed one (minor #16) */
  background: linear-gradient(180deg, var(--paper) 0%, var(--blue-tint) 100%);
  padding: 116px 0 64px; /* extra top room clears the fixed pill */
}
.article-hero .wrap { max-width: 800px; }
.breadcrumb { font-size: 14px; color: var(--ink-faint); margin-bottom: 22px; }
.breadcrumb a { color: var(--blue-deep); }
.article-hero h1 { font-size: clamp(32px, 4.6vw, 50px); margin-bottom: 18px; }
.article-meta { font-size: 14.5px; color: var(--ink-faint); margin-top: 20px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.article-meta img { width: 34px; height: 34px; border-radius: 8px; }
.lede { font-size: 20.5px; color: var(--ink-soft); line-height: 1.55; }

.article { padding: 64px 0 88px; }
.article .wrap { max-width: 800px; }
.article h2 { font-size: 30px; margin: 52px 0 16px; }
.article h3 { font-size: 22px; margin: 36px 0 12px; }
.article p { margin-bottom: 18px; color: var(--ink-body); font-size: 17.5px; }
.article ul, .article ol { margin: 0 0 20px 26px; color: var(--ink-body); }
.article li { margin-bottom: 10px; font-size: 17.5px; }
.article li strong { color: var(--ink); }
.article figure { margin: 36px 0; text-align: center; }
.article figure img {
  border-radius: 22px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  margin: 0 auto;
  max-height: 620px;
  width: auto;
  max-width: 100%;
}
.article figcaption { font-size: 14px; color: var(--ink-faint); margin-top: 12px; }
.article blockquote {
  border-left: 3px solid var(--blue);
  padding: 6px 0 6px 22px;
  margin: 28px 0;
  font-family: var(--serif);
  font-size: 20px;
  font-style: italic;
  color: var(--ink-soft);
}

.app-callout {
  background: var(--blue-tint);
  border: 1px solid var(--blue-tint-border);
  border-radius: var(--radius);
  padding: 30px 32px;
  margin: 40px 0;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
.app-callout img { width: 58px; height: 58px; border-radius: 14px; flex: none; }
.app-callout h3 { margin: 0 0 8px; font-size: 21px; }
.app-callout p { font-size: 15.5px; color: var(--ink-soft); margin-bottom: 14px; }

.article-cta {
  background: linear-gradient(160deg, var(--blue-dark) 0%, var(--blue-night) 100%);
  border-radius: 24px;
  color: var(--white);
  text-align: center;
  padding: 52px 36px;
  margin: 56px 0 0;
}
.article-cta h2 { color: var(--white); font-size: 30px; margin: 0 0 12px; }
.article-cta p { color: var(--on-dark); margin: 0 auto 26px; max-width: 480px; }
.article-cta .badges { justify-content: center; margin-bottom: 0; }
.article-cta .badge { background: var(--on-dark-fill); border: 1px solid var(--on-dark-line); }
.article-cta .badge:hover { background: var(--on-dark-fill-hover); }

.related-guides { padding: 72px 0 88px; background: var(--paper-warm); }
.related-guides h2 { font-size: 28px; margin-bottom: 32px; text-align: center; }
.related-guides .guides-grid { grid-template-columns: repeat(3, 1fr); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 52px; }
  .hero { padding: 110px 0 80px; text-align: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-ctas, .hero-trust, .badges { justify-content: center; }
  .nav-links { display: none; } /* inline links collapse into the disclosure menu */
  /* Mobile disclosure menu — pill keeps wordmark + CTA + menu button (minor #15) */
  .nav-menu { display: block; position: relative; }
  .nav-menu summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    color: var(--ink);
    cursor: pointer;
  }
  .nav-menu summary::-webkit-details-marker { display: none; }
  .nav-menu summary:hover { background: var(--paper-warm); }
  .nav-menu summary svg { width: 20px; height: 20px; }
  .nav-menu .icon-close { display: none; }
  .nav-menu[open] .icon-open { display: none; }
  .nav-menu[open] .icon-close { display: block; }
  .nav-menu-links {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    min-width: 216px;
    margin: 0;
    padding: 8px;
    list-style: none;
    display: flex;
    flex-direction: column;
    background: var(--paper-glass);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
  }
  .nav-menu-links a {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 500;
  }
  .nav-menu-links a:hover { background: var(--paper-warm); text-decoration: none; }
  .guides-grid { grid-template-columns: repeat(2, 1fr); }
  .related-guides .guides-grid { grid-template-columns: 1fr; }
  .step { grid-template-columns: 1fr; gap: 36px; }
  .step:nth-child(even) .step-media { order: 0; }
}
@media (max-width: 720px) {
  .download-grid { grid-template-columns: 1fr; }
  .store-card-wide { flex-direction: column; align-items: flex-start; gap: 14px; }
  .footer-copy { margin-left: 0; }
}
@media (max-width: 560px) {
  .section { padding: 68px 0; }
  #screenshots { padding: 56px 0; }
  #how-it-works { padding: 84px 0; }
  .site-header { top: 10px; }
  .nav-pill { gap: 14px; padding: 8px 9px 8px 14px; }
  .nav-pill .btn-sm { padding: 11px 16px; } /* keep a 44px hit target */
  .guides-grid { grid-template-columns: 1fr; }
  .app-callout { flex-direction: column; }
}
@media (max-width: 380px) {
  .nav-brand span { display: none; } /* icon-only brand keeps the pill inside a 320px viewport */
}
