/* Shared chrome for the tool/guide pages (words-to-pages,
   novel-word-count, novel-calculator). Values mirror the final
   landing (index.html) so the cluster reads as one site.
   Import order: base.css → tools.css → page-specific <style>.

   Fonts are SELF-HOSTED (assets/fonts/, variable woff2, latin
   subset) — no Google Fonts request chain: faster LCP, no
   third-party IP handoff (GDPR), one origin. */

@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400 650;
  font-display: swap;
  src: url('fonts/fraunces-italic-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 650;
  font-display: swap;
  src: url('fonts/fraunces-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/inter-var.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --font-serif: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --section-gap: clamp(52px, 8vw, 92px);
}
body {
  font-size: 16.5px;
  background:
    radial-gradient(720px 480px at 12% 4%, var(--wash-1), transparent 62%),
    radial-gradient(640px 460px at 88% 12%, var(--wash-2), transparent 60%),
    radial-gradient(700px 520px at 78% 78%, var(--wash-3), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
h1, h2 { font-weight: 560; letter-spacing: -.015em; text-wrap: balance; }
h3 { font-family: var(--font-body); font-weight: 650; font-size: 1.02rem; }
::selection { background: var(--accent-bg); }
section[id], h2[id] { scroll-margin-top: 96px; }

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--glass-shadow);
}
.nav {
  position: sticky; top: 14px; z-index: 5;
  border-radius: 999px; padding: 12px 22px; margin-top: 14px;
}
.nav .links { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.nav .links a {
  color: var(--text-secondary); text-decoration: none;
  font-weight: 600; font-size: .86rem;
}
.nav .links a:hover { color: var(--accent-deep); }

.btn-primary {
  font-family: var(--font-body);
  background: linear-gradient(115deg, #C4956A 10%, #A97BB8 90%);
  box-shadow: 0 10px 26px rgba(169,123,184,.32), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary:hover { box-shadow: 0 14px 32px rgba(196,149,106,.45), inset 0 1px 0 rgba(255,255,255,.25); }
.btn:focus-visible { outline: 2px solid var(--accent-deep); outline-offset: 3px; }

/* Page header (no phone visual on tool pages) */
.hero-lite { max-width: 720px; padding-top: clamp(32px, 5vw, 56px); }
.hero-lite h1 { margin: 14px 0 16px; font-size: clamp(2rem, 4.6vw, 3rem); }
/* Gradient text accent — usable in any heading. */
.grad {
  background: linear-gradient(120deg, var(--accent-deep), var(--editing));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lite .lead { margin: 0; max-width: 56ch; line-height: 1.62; }

/* Tool panel */
.tool { border-radius: 20px; padding: 28px; margin-top: 34px; }
.tool .fields { display: flex; gap: 14px; flex-wrap: wrap; }
.tool label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: .82rem; font-weight: 600; color: var(--text-secondary);
}
.tool input, .tool select {
  font: 600 1.05rem var(--font-body); color: var(--text);
  background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; width: 170px;
}
.tool input:focus-visible, .tool select:focus-visible {
  outline: 2px solid var(--accent-deep); outline-offset: 1px;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chips button {
  font: 600 .8rem var(--font-body); color: var(--text-secondary);
  background: transparent; border: 1px solid var(--border);
  border-radius: 999px; padding: 7px 14px; cursor: pointer;
}
.chips button:hover { color: var(--accent-deep); border-color: var(--accent); }
.result {
  margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px;
}
.key-stats {
  border-radius: 20px; padding: 26px 28px; margin-top: 34px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 18px;
}
.result .num, .key-stats .num {
  font-family: var(--font-serif); font-size: 1.9rem; font-weight: 560;
  background: linear-gradient(120deg, var(--accent-deep), var(--editing) 55%, var(--writing));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.result .cap, .key-stats .cap { color: var(--muted); font-size: .85rem; margin-top: 4px; }

/* Snippet-ready quick answer — the tool's textual output. Static
   HTML holds the default-input values (what crawlers index); JS
   rewrites the numbers live with the calculator. */
.quick-answer {
  max-width: 720px; margin: 26px 0 0;
  padding-left: 18px; border-left: 3px solid var(--accent);
  font-size: 1.05rem; line-height: 1.6; color: var(--text-secondary);
}
.quick-answer strong { color: var(--text); }

/* Table of contents on long guides (jump-to links in SERP). */
.toc {
  display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 22px;
  font-size: .9rem;
}
.toc a { color: var(--text-secondary); text-decoration: none;
  border-bottom: 1px solid var(--border); }
.toc a:hover { color: var(--accent-deep); border-color: var(--accent); }

.byline { margin: 14px 0 0; font-size: .88rem; color: var(--muted); }
.byline a { color: var(--muted); }

figure.chart { margin: 26px 0 0; }
figure.chart img { border-radius: 18px; height: auto; }
figure.chart figcaption {
  margin-top: 10px; font-size: .86rem; color: var(--muted);
}
.prose { max-width: 720px; }
.prose p { color: var(--text-secondary); line-height: 1.65; }
.prose h2 { margin-bottom: 14px; }
.tbl-wrap { overflow-x: auto; border-radius: 18px; margin-top: 26px; }
table.ref { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .95rem; }
table.ref th, table.ref td { text-align: left; padding: 12px 16px; }
table.ref th {
  font: 700 .78rem var(--font-body); letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--border);
}
table.ref td { border-bottom: 1px solid var(--border); color: var(--text-secondary); }
table.ref tr:last-child td { border-bottom: none; }
table.ref td:first-child { font-weight: 600; color: var(--text); }

.sec-head { max-width: 640px; margin: 0 0 26px; }
.sec-head p { color: var(--muted); margin: 10px 0 0; }

.faq details { border: none; border-radius: 16px; padding: 4px 22px; margin-bottom: 12px; }
.faq summary { padding: 14px 0; font-family: var(--font-body); font-weight: 600; }
.faq summary::after { transition: transform .2s ease; color: var(--accent-deep); }
.faq details[open] summary::after { transform: rotate(180deg); }
.faq p { padding-bottom: 16px; }

/* Cross-links between cluster pages */
.xlinks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.xlinks a {
  display: block; text-decoration: none; color: inherit;
  border-radius: 16px; padding: 18px 20px;
}
.xlinks a:hover { transform: translateY(-2px); }
.xlinks b { display: block; font-family: var(--font-body); font-size: .98rem; margin-bottom: 4px; }
.xlinks span { color: var(--muted); font-size: .86rem; }

.cta {
  text-align: center; border-radius: var(--radius-lg); padding: 48px 30px;
  background: linear-gradient(135deg, rgba(196,149,106,.16), rgba(123,110,168,.14));
  border: 1px solid var(--cta-border);
}
.cta h2 { margin-bottom: 10px; }
.cta p { color: var(--text-secondary); margin: 0 0 24px; }

.footer { font-family: var(--font-body); margin-top: calc(var(--section-gap) * .7); }

@media (max-width: 480px) {
  .container { padding-left: 18px; padding-right: 18px; }
  .tool input, .tool select { width: 100%; }
  .tool label { flex: 1 1 100%; }
}


/* ── Print: reference pages get printed — make paper look like
   paper, even if the dark override is active (the :not/[light] pair
   out-specifies the dark token blocks). ─────────────────────────── */
@media print {
  :root:not([data-theme="light"]), :root[data-theme="light"] {
    color-scheme: light;
    --bg: #fff; --surface: #fff; --surface-dark: #f2f2f2;
    --text: #111; --text-secondary: #333; --muted: #555;
    --border: #bbb; --accent: #444; --accent-deep: #444;
    --glass-bg: #fff; --glass-border: #ccc; --glass-shadow: none;
    --wash-1: transparent; --wash-2: transparent; --wash-3: transparent;
  }
  body { background: #fff; font-size: 11.5pt; }
  .nav, .footer, .cta, .chips, .theme-btn, .hero-visual,
  section[aria-label="More tools"] { display: none !important; }
  .glass { backdrop-filter: none; -webkit-backdrop-filter: none; }
  a { color: inherit; text-decoration: underline; }
  .grad, .result .num, .band .num {
    background: none; -webkit-text-fill-color: initial; color: #111;
  }
  .faq summary::after { content: ''; }
}
