/* ════════════════════════════════════════════════════════════════════════════
   Momentum Tracking — guides (#79)
   Shared stylesheet for every page under /guides/. One file, cached once, so a
   ten-page cluster doesn't ship ten copies of the same 400 lines — and a brand
   tweak is one edit, not ten.

   Long-form reading is the whole job here: a single measured column, generous
   line-height, and headings that are scannable at a glance because most of this
   traffic arrives from a search result with one question in mind and will leave
   the moment it can't find the answer.

   Brand tokens are copied from index.html rather than imported — app.css is the
   app's stylesheet and carries ~80KB these pages have no use for.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg:      #080808;
  --bg2:     #0f0f0f;
  --card:    #141414;
  --card2:   #1a1a1a;
  --border:  rgba(255, 255, 255, .07);
  --border2: rgba(255, 255, 255, .12);
  --accent:  #7cf237;
  --accent2: #5ed620;
  --text:    #f0f0f0;
  --dim:     #b8b8b8;
  --muted:   #6b6b6b;
  --amber:   #fbbf24;
  --red:     #ff5252;
}

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

html { scroll-behavior: smooth; }
/* Anchor links land under the sticky header instead of behind it. */
h2, h3, [id] { scroll-margin-top: 84px; }

body {
  background: var(--bg);
  color: var(--dim);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection { background: rgba(124, 242, 55, .25); color: #fff; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 8, 8, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.top-in {
  max-width: 1080px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: .06em;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.brand b { color: var(--accent); font-weight: 400; }
.top-links { display: flex; align-items: center; gap: 18px; }
.top-links a {
  color: var(--muted); text-decoration: none;
  font-size: 14px; font-weight: 500;
  transition: color .15s;
}
.top-links a:hover { color: var(--text); }
.top-cta {
  background: var(--accent); color: #000 !important;
  border-radius: 9px; padding: 8px 16px;
  font-size: 14px; font-weight: 700;
  transition: background .15s;
}
.top-cta:hover { background: var(--accent2); }
/* The accent hairline under the header — the same device the legal pages use. */
.bar { height: 2px; background: linear-gradient(90deg, var(--accent), transparent); }

/* ── Layout ─────────────────────────────────────────────────────────────── */
main { max-width: 760px; margin: 0 auto; padding: 0 24px 96px; }

.crumbs {
  font-size: 13px; color: var(--muted);
  padding: 28px 0 0;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs span { margin: 0 6px; opacity: .5; }

/* ── Article head ───────────────────────────────────────────────────────── */
.eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent);
  margin: 32px 0 14px;
}
h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(38px, 7vw, 58px);
  line-height: 1.04; letter-spacing: .01em;
  color: #fff; font-weight: 400;
  margin-bottom: 18px;
}
.standfirst {
  font-size: 19px; line-height: 1.65;
  color: var(--dim);
  margin-bottom: 22px;
}
.meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  font-size: 13px; color: var(--muted);
  padding-bottom: 30px; margin-bottom: 34px;
  border-bottom: 1px solid var(--border);
}
/* The "·" between meta items is decoration, not content. Once the row wraps it
   strands itself at the end of a line and reads as a typo — so it's a marked-up
   separator that the mobile rule below removes, and it's hidden from screen
   readers everywhere. */
.meta .sep { opacity: .5; }

/* ── Body copy ──────────────────────────────────────────────────────────── */
h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 31px; line-height: 1.15; letter-spacing: .02em;
  color: #fff; font-weight: 400;
  margin: 52px 0 16px;
}
h3 {
  font-size: 18px; font-weight: 700;
  color: var(--text);
  margin: 34px 0 10px;
}
p { margin-bottom: 20px; }
main a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
main a:hover { color: var(--accent2); }
strong { color: var(--text); font-weight: 700; }
em { font-style: italic; }

ul, ol { margin: 0 0 22px 0; padding-left: 22px; }
li { margin-bottom: 9px; padding-left: 4px; }
li::marker { color: var(--accent); }
ul ul, ol ol, ul ol, ol ul { margin: 9px 0 0; }

hr { border: none; border-top: 1px solid var(--border); margin: 44px 0; }

blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 20px; margin: 0 0 22px;
  color: var(--dim); font-style: italic;
}

code {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88em; color: var(--text);
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
/* Wide tables scroll inside their own box — the page body never scrolls
   sideways on a phone, which is where most of this traffic reads. */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}
table { border-collapse: collapse; width: 100%; min-width: 460px; font-size: 15px; }
th, td { text-align: left; padding: 11px 15px; border-bottom: 1px solid var(--border); vertical-align: top; }
th {
  background: var(--card2);
  color: var(--text); font-weight: 700;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
td strong { color: var(--text); }
.yes { color: var(--accent); font-weight: 700; }
.no  { color: var(--red);    font-weight: 700; }
.dep { color: var(--amber);  font-weight: 700; }

/* ── Callouts ───────────────────────────────────────────────────────────── */
.callout {
  background: var(--card);
  border: 1px solid var(--border2);
  border-left: 3px solid var(--muted);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 0 0 26px;
  font-size: 15.5px; line-height: 1.7;
}
.callout p:last-child { margin-bottom: 0; }
.callout-title {
  display: block;
  font-size: 12px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  margin-bottom: 7px;
}
.callout.note    { border-left-color: var(--accent); }
.callout.note    .callout-title { color: var(--accent); }
.callout.warn    { border-left-color: var(--amber); background: rgba(251, 191, 36, .05); }
.callout.warn    .callout-title { color: var(--amber); }
.callout.trap    { border-left-color: var(--red); background: rgba(255, 82, 82, .05); }
.callout.trap    .callout-title { color: var(--red); }

/* The tax disclaimer. Deliberately quieter than a warning — it appears on every
   tax page and shouting it ten times would train people to skip it. */
.disclaimer {
  background: var(--card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 15px 19px;
  margin: 0 0 32px;
  font-size: 14px; line-height: 1.7;
  color: var(--muted);
}
.disclaimer strong { color: var(--dim); }
.disclaimer a { color: var(--dim); }

/* ── Key-facts box (the answer, above the fold) ─────────────────────────── */
/* Search traffic lands with one question. This gives the answer before the
   article earns it, which is also what tends to get pulled into a snippet. */
.answer {
  background: linear-gradient(180deg, rgba(124, 242, 55, .07), rgba(124, 242, 55, .02));
  border: 1px solid rgba(124, 242, 55, .22);
  border-radius: 14px;
  padding: 20px 24px;
  margin: 0 0 34px;
}
.answer .callout-title { color: var(--accent); }
.answer p:last-child, .answer ul:last-child { margin-bottom: 0; }

/* ── FAQ ────────────────────────────────────────────────────────────────── */
.faq { border-top: 1px solid var(--border); margin-top: 12px; }
.faq details {
  border-bottom: 1px solid var(--border);
  padding: 4px 0;
}
.faq summary {
  cursor: pointer; list-style: none;
  padding: 15px 30px 15px 0;
  font-size: 16.5px; font-weight: 600; color: var(--text);
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  color: var(--accent); font-size: 21px; font-weight: 400; line-height: 1;
}
.faq details[open] summary::after { content: '−'; }
.faq details > *:not(summary) { padding-bottom: 4px; }
.faq p:last-child { margin-bottom: 16px; }

/* ── In-article product bridge ──────────────────────────────────────────── */
/* One per page, placed where the manual version of the task just got tedious.
   Any more than that and the page stops being useful and starts being an ad. */
.bridge {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 22px 24px;
  margin: 38px 0;
}
.bridge h3 { margin: 0 0 8px; font-size: 17px; color: #fff; }
.bridge p { font-size: 15.5px; margin-bottom: 16px; color: var(--dim); }
.bridge .btn {
  display: inline-block;
  background: var(--accent); color: #000;
  border-radius: 10px; padding: 11px 22px;
  font-size: 15px; font-weight: 700; text-decoration: none;
  transition: background .15s;
}
.bridge .btn:hover { background: var(--accent2); }
.bridge .fine { display: block; margin-top: 11px; font-size: 13px; color: var(--muted); }

/* ── Related guides ─────────────────────────────────────────────────────── */
.related { margin-top: 56px; padding-top: 34px; border-top: 1px solid var(--border); }
.related h2 { margin-top: 0; }
.rel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.rel-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  text-decoration: none !important;
  transition: border-color .15s, transform .15s;
}
.rel-card:hover { border-color: rgba(124, 242, 55, .35); transform: translateY(-2px); }
.rel-card .rc-title { display: block; color: var(--text); font-weight: 700; font-size: 15.5px; margin-bottom: 4px; }
.rel-card .rc-sub   { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.55; }

/* ── Guides index ───────────────────────────────────────────────────────── */
.idx-group { margin-bottom: 44px; }
.idx-group > h2 { margin-top: 0; }
.idx-lead { color: var(--muted); font-size: 15.5px; margin: -6px 0 20px; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 34px 24px 46px;
  text-align: center;
  font-size: 13.5px; color: var(--muted);
  line-height: 1.9;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--accent); text-decoration: underline; }

/* ── Small screens ──────────────────────────────────────────────────────── */
@media (max-width: 620px) {
  body { font-size: 16.5px; }
  main { padding: 0 18px 72px; }
  .top-in { padding: 12px 18px; }
  .top-links { gap: 12px; }
  /* The nav CTA is the first thing to go — the brand and Guides link matter more
     at 375px, and every page carries a CTA in the body anyway. */
  .top-links .top-cta { display: none; }
  h2 { font-size: 27px; margin-top: 42px; }
  .standfirst { font-size: 17.5px; }
  /* Stack the meta line and drop the separators — a wrapped "·" strands itself. */
  .meta { flex-direction: column; gap: 3px; }
  .meta .sep { display: none; }
  .answer, .bridge { padding: 18px 18px; }
  .callout { padding: 14px 16px; }
}

/* Respect a reduced-motion preference — the only motion here is hover lift. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* Printing a guide to take to the accountant is a real thing people do. */
@media print {
  .top, .bridge, .related, footer, .bar { display: none; }
  body { background: #fff; color: #000; font-size: 12pt; }
  main { max-width: none; }
  h1, h2, h3, strong { color: #000; }
  main a { color: #000; }
  .answer, .callout, .disclaimer { border: 1px solid #999; background: none; }
  .faq details { display: block; }
  .faq details > *:not(summary) { display: block !important; }
}
