/* =========================================================================
   site.css — the public, static, crawlable side of yoursubjects.com
   =========================================================================
   This stylesheet is for the marketing/editorial pages ONLY (homepage,
   guides, about, policy pages). The React app under /app/ has its own
   stylesheets and must not load this one.

   Deliberately standalone: these pages are plain HTML with no build step and
   no JavaScript requirement, so a crawler — or a reader with JS disabled —
   gets the full content from the first byte of the response.
   ========================================================================== */

:root {
  --paper: #f3ede0;
  --paper-2: #ebe4d3;
  --card: #fbf7ee;
  --ink: #1c1a17;
  --ink-2: #4a4640;
  --ink-3: #7a7268;
  --rule: #d9d1bf;
  --rule-2: #c3b89f;
  --accent: oklch(0.58 0.13 45);
  --accent-2: oklch(0.92 0.04 65);
  --good: oklch(0.55 0.10 145);
  --bad: oklch(0.55 0.16 25);
  --shadow: 0 1px 0 rgba(28, 26, 23, 0.06), 0 14px 30px -18px rgba(28, 26, 23, 0.18);
  --radius: 6px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
  --measure: 34rem;
}

* { box-sizing: border-box; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, rgba(28, 26, 23, 0.04) 1px, transparent 0);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

::selection { background: var(--accent-2); }

/* Skip link — keyboard users shouldn't have to tab the whole nav. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  z-index: 999;
  border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

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

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.site-brand img { width: 34px; height: 34px; object-fit: contain; display: block; }
.site-brand span {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.site-brand em { font-style: italic; color: var(--accent); font-weight: 500; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); background: rgba(28, 26, 23, 0.05); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--paper-2); }

.site-nav a.cta,
a.btn {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease, transform 0.08s ease;
}
.site-nav a.cta:hover,
a.btn:hover { background: #2c2924; color: var(--paper); }
a.btn:active { transform: translateY(1px); }

a.btn.accent { background: var(--accent); border-color: var(--accent); }
a.btn.accent:hover { filter: brightness(0.95); background: var(--accent); }
a.btn.ghost { background: transparent; color: var(--ink); border-color: var(--rule-2); }
a.btn.ghost:hover { background: rgba(28, 26, 23, 0.04); color: var(--ink); }

/* ---------- Layout ---------- */

main { flex: 1 0 auto; }

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
}

.wrap-narrow {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Typography ---------- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(34px, 5.2vw, 52px); }
h2 { font-size: clamp(25px, 3.2vw, 32px); margin-top: 2.4em; margin-bottom: 0.5em; }
h3 { font-size: clamp(19px, 2.2vw, 22px); margin-top: 1.9em; margin-bottom: 0.4em; }
h1 em, h2 em, h3 em { font-style: italic; color: var(--accent); font-weight: 500; }

p { margin: 0 0 1.15em; }

a { color: var(--ink); text-underline-offset: 2px; text-decoration-color: var(--rule-2); }
a:hover { text-decoration-color: var(--accent); }

strong { font-weight: 600; }

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 3rem 0;
}

/* ---------- Article body ---------- */

.prose {
  font-family: var(--serif);
  font-size: 19.5px;
  line-height: 1.68;
  color: var(--ink);
}
.prose > p:first-of-type { font-size: 21px; color: var(--ink-2); }
.prose h2, .prose h3 { font-family: var(--serif); }
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.5em; }
.prose li { margin-bottom: 0.5em; }
.prose li::marker { color: var(--ink-3); }
.prose blockquote {
  margin: 1.8em 0;
  padding: 2px 0 2px 22px;
  border-left: 3px solid var(--accent);
  color: var(--ink-2);
  font-style: italic;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--paper-2);
  padding: 2px 5px;
  border-radius: 4px;
}
.prose figure { margin: 2em 0; }
.prose figcaption {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink-3);
  margin-top: 8px;
  text-align: center;
}
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); display: block; }

/* Callout box — used for worked examples and "try this" boxes. */
.callout {
  background: var(--card);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 2em 0;
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.6;
}
.callout > :last-child { margin-bottom: 0; }
.callout h3, .callout h4 {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-3);
  font-weight: 500;
  margin: 0 0 10px;
  letter-spacing: 0.09em;
}

/* Comparison / data table */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  font-family: var(--sans);
  font-size: 16px;
}
.table-scroll { overflow-x: auto; margin: 2em 0; }
.table-scroll table { margin: 0; }
.prose th, .prose td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.prose th {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-3);
  font-weight: 500;
  background: var(--paper-2);
}
.prose tbody tr:last-child td { border-bottom: 0; }

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

.article-head {
  padding: 56px 0 0;
  margin-bottom: 2.2rem;
}
.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 14px;
  display: block;
}
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { color: var(--accent); }
.article-standfirst {
  font-family: var(--serif);
  font-size: 21px;
  font-style: italic;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 18px 0 0;
  max-width: var(--measure);
  text-wrap: pretty;
}
.article-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}
.article-meta .sep { opacity: 0.4; }

/* Key-takeaways summary box at the top of an article */
.key-points {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 22px 26px;
  margin: 0 0 2.6rem;
  font-family: var(--sans);
  font-size: 16.5px;
}
.key-points h2 {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-3);
  font-weight: 500;
  margin: 0 0 12px;
}
.key-points ul { margin: 0; padding-left: 1.3em; }
.key-points li { margin-bottom: 7px; line-height: 1.55; }
.key-points li:last-child { margin-bottom: 0; }
.key-points li::marker { color: var(--accent); }

/* ---------- Ad slots ----------
   Ads appear ONLY on long-form article pages, and only between or after
   substantial blocks of editorial content. They are always labelled, so a
   reader can tell an ad from the article — that labelling is a requirement,
   not decoration. Nothing on a navigation, empty, auth or app screen may
   carry one; see docs/adsense-policy.md before adding a slot anywhere new. */
.ad-slot {
  margin: 3rem 0;
  padding: 0;
  text-align: center;
  min-height: 100px;
  clear: both;
}
.ad-slot::before {
  content: "Advertisement";
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  opacity: 0.7;
  margin-bottom: 8px;
}
.ad-slot ins { display: block; }

/* ---------- Cards / listings ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin: 2rem 0;
}

.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 24px 26px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
  position: relative;
  overflow: hidden;
}
.guide-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.14s ease;
}
.guide-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--rule-2);
}
.guide-card:hover::before { opacity: 1; }
.guide-card .kicker {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.guide-card h3 {
  margin: 0 0 9px;
  font-size: 21px;
  line-height: 1.25;
}
.guide-card p {
  margin: 0;
  font-size: 15.5px;
  color: var(--ink-2);
  line-height: 1.55;
  flex: 1;
}
.guide-card .read-on {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

/* ---------- Feature rows (homepage) ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
  margin: 2.2rem 0;
}
.feature {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 26px;
}
.feature h3 { margin: 0 0 10px; font-size: 20px; }
.feature p { margin: 0; font-size: 16px; color: var(--ink-2); line-height: 1.6; }
.feature .num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
  display: block;
  margin-bottom: 12px;
  text-transform: uppercase;
}

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--rule);
}
.hero h1 { max-width: 20ch; }
.hero .lede {
  font-family: var(--serif);
  font-size: clamp(19px, 2.4vw, 23px);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 42ch;
  margin: 22px 0 30px;
  text-wrap: pretty;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero-note {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 18px;
}

/* ---------- Section headings on listing pages ---------- */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 3.4rem 0 0.4rem;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}
.section-head h2 { margin: 0; }
.section-head .count {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Further reading / related ---------- */

.related {
  margin: 3.5rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}
.related h2 {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-3);
  font-weight: 500;
  margin: 0 0 16px;
}
.related ul { list-style: none; margin: 0; padding: 0; }
.related li { margin-bottom: 10px; }
.related a {
  font-family: var(--serif);
  font-size: 18px;
  text-decoration: none;
  border-bottom: 1px solid var(--rule-2);
  padding-bottom: 1px;
}
.related a:hover { border-bottom-color: var(--accent); color: var(--accent); }

/* References / sources list at the foot of an article */
.sources {
  margin: 3rem 0 0;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--ink-2);
  line-height: 1.55;
}
.sources h2 {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--ink-3);
  font-weight: 500;
  margin: 0 0 14px;
}
.sources ol { margin: 0; padding-left: 1.4em; }
.sources li { margin-bottom: 9px; }
.sources li::marker { color: var(--ink-3); font-family: var(--mono); font-size: 12px; }

/* ---------- Inline app promo inside an article ---------- */

.app-promo {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 24px 28px;
  margin: 2.6rem 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
}
.app-promo p { margin: 0 0 14px; color: var(--ink-2); }
.app-promo strong { color: var(--ink); }

/* ---------- Footer ---------- */

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
  margin-top: 5rem;
  padding: 44px 0 40px;
  font-size: 15px;
}
.site-footer-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
}
.site-footer h2 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  font-weight: 500;
  margin: 0 0 14px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer .blurb { color: var(--ink-3); font-size: 14.5px; line-height: 1.6; max-width: 34ch; margin: 0; }
.site-footer .colophon {
  max-width: 1080px;
  margin: 34px auto 0;
  padding: 20px 28px 0;
  border-top: 1px solid var(--rule-2);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Responsive ---------- */

@media (max-width: 760px) {
  body { font-size: 16px; }
  .site-header-inner { height: auto; padding: 12px 18px; flex-wrap: wrap; gap: 10px; }
  .site-brand span { font-size: 17px; }
  .site-nav { gap: 2px; }
  .site-nav a { font-size: 13.5px; padding: 6px 10px; }
  .wrap, .wrap-narrow { padding: 0 18px; }
  .hero { padding: 44px 0 38px; }
  .article-head { padding-top: 34px; }
  .prose { font-size: 18px; }
  .prose > p:first-of-type { font-size: 19px; }
  .article-standfirst { font-size: 18.5px; }
  .key-points, .callout, .app-promo { padding: 18px 20px; }
  .site-footer-inner { grid-template-columns: 1fr; gap: 26px; }
  .site-footer { margin-top: 3rem; }
}

@media print {
  .site-header, .site-footer, .ad-slot, .app-promo, .related { display: none; }
  body { background: #fff; }
}
