/* ============================================================
   main.css — design system
   Light mode default · dark mode via [data-theme="dark"]
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────────── */
/* Declaring color-scheme tells mobile browsers (Chrome's "auto dark theme")
   that this site manages its own light/dark palette, so they must not
   auto-invert the page — which was darkening the paper background and
   leaving the navy logo unreadable on phones. */
:root {
  color-scheme: light;
  --paper: #f6f4ef;
  --surface: #fdfcfa;
  --surface-2: #efece4;
  --ink: #1c2b36;
  --ink-2: #4e6172;
  --ink-3: #82909e;
  --hair: #e5e0d5;
  --hair-2: #d6d0c2;
  --accent: #1e5c45;
  --accent-ink: #f2efe8;
  --accent-soft: #e5ede7;
  --pos: #177245;
  --neg: #b3402e;
  --chip: #ebe7dd;
  --header-bg: rgba(246, 244, 239, 0.88);
  --shadow: 0 1px 2px rgba(28, 43, 54, 0.04), 0 8px 24px rgba(28, 43, 54, 0.06);
  --chart-1: #2c8a66;
  --chart-2: #4272c8;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, Menlo, monospace;

  --max: 1120px;
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0e1418;
  --surface: #151d23;
  --surface-2: #1b2630;
  --ink: #e9e5db;
  --ink-2: #a6b2be;
  --ink-3: #798a99;
  --hair: #253039;
  --hair-2: #303e4a;
  --accent: #5ea988;
  --accent-ink: #0e1418;
  --accent-soft: #1b2b25;
  --pos: #54b586;
  --neg: #dd7361;
  --chip: #1e2933;
  --header-bg: rgba(14, 20, 24, 0.88);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.28);
  --chart-1: #3fa97c;
  --chart-2: #6d88de;
}

/* ── Base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; font-weight: 500; }
p { margin: 0 0 1em; }
a { color: inherit; }
img { max-width: 100%; height: auto; }
button { font-family: inherit; }

::selection { background: var(--accent); color: var(--accent-ink); }

/* Language toggling: blocks tagged .lang-en / .lang-es */
html[data-lang="en"] .lang-es { display: none !important; }
html[data-lang="es"] .lang-en { display: none !important; }
html:not([data-lang]) .lang-es { display: none !important; }

/* Cards hidden by dedupe (language pairs) or by archive filters */
[data-lang-hidden], [data-filter-hidden] { display: none !important; }

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

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 0 0 8px 0; font-size: 14px; text-decoration: none;
}
.skip-link:focus { left: 0; }

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

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}

.header-inner {
  display: flex; align-items: center; gap: 28px;
  height: 62px;
}

.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}

.brand-mark {
  width: 32px; height: 32px; flex-shrink: 0;
  object-fit: contain; display: block;
  background-color: var(--paper); border-radius: 8px;
  filter: invert(0) !important;
}

/* The emblem is navy — on any dark surface it needs a light chip to stay legible */
[data-theme="dark"] .brand-mark {
  background: #f6f4ef;
  border-radius: 7px;
  padding: 2px;
}

/* Safety net: if a browser still forces a dark rendering despite color-scheme,
   the chip keeps the logo readable. Invisible in normal light mode (chip colour
   matches the paper background). */
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .brand-mark {
    background: #f6f4ef;
    border-radius: 7px;
    padding: 2px;
  }
}

.brand-name {
  font-family: var(--serif); font-size: 18px; font-weight: 500; letter-spacing: -0.015em;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .brand-name { font-size: 14px; }
  .brand-mark { width: 26px; height: 26px; }
  .header-inner { gap: 6px; padding: 0 16px; }
  .header-actions { gap: 6px; }
  .lang-trigger { padding: 0 6px; gap: 4px; font-size: 12px; height: 28px; }
  .theme-toggle, .nav-toggle { width: 28px; height: 28px; }
}

.site-nav { display: flex; gap: 22px; margin-left: 8px; flex: 1; }

.site-nav a {
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  text-decoration: none; padding: 4px 0;
  transition: color 140ms ease;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* ── Language menu ──────────────────────────────────────────── */
.lang-menu { position: relative; }

.lang-trigger {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 10px;
  border: 1px solid var(--hair-2); border-radius: 8px;
  background: transparent; color: var(--ink-2);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease;
}
.lang-trigger:hover { color: var(--ink); border-color: var(--ink-3); }
.lang-caret { transition: transform 160ms ease; opacity: 0.7; }
.lang-trigger[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }

.lang-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 152px; padding: 5px;
  background: var(--surface);
  border: 1px solid var(--hair-2); border-radius: 10px;
  box-shadow: var(--shadow);
  animation: langIn 130ms ease;
}
.lang-dropdown[hidden] { display: none; }

@keyframes langIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.lang-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 8px 10px;
  border: 0; border-radius: 7px; background: transparent;
  color: var(--ink); font-size: 13.5px; font-weight: 500;
  text-align: left; cursor: pointer;
  transition: background 120ms ease;
}
.lang-option:hover { background: var(--surface-2); }

.lang-check { opacity: 0; flex-shrink: 0; color: var(--accent); }
html[data-lang="en"] .lang-option[data-set-lang="en"] .lang-check,
html[data-lang="es"] .lang-option[data-set-lang="es"] .lang-check { opacity: 1; }

.theme-toggle, .nav-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--hair-2); background: transparent; color: var(--ink-2);
  cursor: pointer; transition: color 140ms ease, border-color 140ms ease;
}
.theme-toggle:hover, .nav-toggle:hover { color: var(--ink); border-color: var(--ink-3); }

.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.nav-toggle { display: none; }

@media (max-width: 920px) {
  .site-nav {
    display: none;
    position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--hair);
    padding: 8px 24px 16px;
    margin: 0;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 0; font-size: 15px; border-bottom: 1px solid var(--hair); }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav a[aria-current="page"] { box-shadow: none; color: var(--accent); }
  .nav-toggle { display: inline-flex; }
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px;
  font-size: 14px; font-weight: 500; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }

.btn-ghost { border-color: var(--hair-2); color: var(--ink); background: transparent; }
.btn-ghost:hover { border-color: var(--ink-3); }

.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: 8px; }

/* ── Typography helpers ─────────────────────────────────────── */
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 14px;
}

.section-title {
  font-family: var(--serif); font-size: 26px; font-weight: 500; letter-spacing: -0.01em;
}

.lead { font-size: 17px; line-height: 1.65; color: var(--ink-2); }

.num, .tnum { font-variant-numeric: tabular-nums; }

/* ── Hero (home) ────────────────────────────────────────────── */
.hero { padding: 88px 0 56px; }

.hero h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.12; letter-spacing: -0.015em;
  max-width: 700px; margin: 0 0 20px;
}

.hero .lead { max-width: 600px; margin-bottom: 30px; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* Home: theses list sits directly under the hero */
.section-top { padding-top: 8px; border-top: 1px solid var(--hair); }

/* ── Stat tiles ─────────────────────────────────────────────── */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-value {
  font-size: 26px; font-weight: 600; letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.stat-value.pos { color: var(--pos); }
.stat-value.neg { color: var(--neg); }
.stat-label {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3);
}
.stat-sub { font-size: 12.5px; color: var(--ink-3); }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 20px; margin: 28px 0 8px;
  padding: 22px 24px;
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
}

/* ── Sections ───────────────────────────────────────────────── */
.section { padding: 56px 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  margin-bottom: 26px;
}
.section-link { font-size: 13.5px; font-weight: 500; color: var(--accent); text-decoration: none; }
.section-link:hover { text-decoration: underline; }

/* ── Page shell ─────────────────────────────────────────────── */
.page-shell { padding: 56px 24px 72px; }
.page-head { margin-bottom: 36px; max-width: 720px; }
.page-head h1 {
  font-family: var(--serif); font-size: clamp(30px, 4vw, 40px);
  font-weight: 500; letter-spacing: -0.01em; line-height: 1.15; margin-bottom: 14px;
}
.page-head .lead { margin-bottom: 0; }

/* ── Cards (theses) ─────────────────────────────────────────── */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

.thesis-card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 20px 22px;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.thesis-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--hair-2); }

.thesis-card-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 12px; color: var(--ink-3);
}

.thesis-card h3 a, .thesis-card h2 a {
  font-family: var(--serif); font-size: 19px; font-weight: 500; line-height: 1.3;
  color: var(--ink); text-decoration: none;
}
.thesis-card h3 a:hover, .thesis-card h2 a:hover { color: var(--accent); }

.thesis-card-summary {
  font-size: 13.5px; line-height: 1.55; color: var(--ink-2); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.thesis-card-foot {
  margin-top: auto; padding-top: 10px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--ink-3);
}
.thesis-card-foot .badge { margin-left: auto; }

/* ── Chips & badges ─────────────────────────────────────────── */
.ticker-chip {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  background: var(--chip); color: var(--ink);
  padding: 2px 8px; border-radius: 6px; white-space: nowrap;
}

.badge {
  display: inline-block;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
}
.badge-open { background: var(--accent-soft); color: var(--accent); }
.badge-closed { background: var(--chip); color: var(--ink-3); }

[data-theme="dark"] .badge-open { color: var(--pos); }

.badge-lang {
  font-size: 10px; font-weight: 600; letter-spacing: 0.06em;
  border: 1px solid var(--hair-2); color: var(--ink-3);
  padding: 2px 6px; border-radius: 5px;
}

.badge-return { margin-left: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ── Filter bar ─────────────────────────────────────────────── */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 14px 16px; margin-bottom: 24px;
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
}

.filter-bar select {
  appearance: none; -webkit-appearance: none;
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--ink);
  background-color: transparent;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2382909e' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  border: 1px solid var(--hair-2); border-radius: 8px;
  padding: 8px 30px 8px 12px; cursor: pointer;
}
.filter-bar select:hover { border-color: var(--ink-3); }

.filter-reset {
  border: 0; background: transparent; color: var(--ink-3);
  font-size: 12.5px; font-weight: 500; cursor: pointer; padding: 6px 8px;
}
.filter-reset:hover { color: var(--ink); text-decoration: underline; }

.filter-count { margin-left: auto; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ── Empty states ───────────────────────────────────────────── */
.empty-state {
  border: 1px dashed var(--hair-2); border-radius: var(--radius);
  padding: 44px 24px; text-align: center;
  color: var(--ink-3); font-size: 14.5px;
}

/* ── Tables ─────────────────────────────────────────────────── */
.table-scroll { overflow-x: auto; border: 1px solid var(--hair); border-radius: var(--radius); background: var(--surface); }

.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }

.data-table thead th {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); text-align: left;
  padding: 12px 16px; border-bottom: 1px solid var(--hair-2);
  white-space: nowrap;
}

.data-table td {
  padding: 13px 16px; border-bottom: 1px solid var(--hair);
  vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background 120ms ease; }
.data-table tbody tr:hover { background: var(--surface-2); }

.data-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table .pos { color: var(--pos); font-weight: 500; }
.data-table .neg { color: var(--neg); font-weight: 500; }

.cell-company { font-weight: 500; }
.cell-company a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--hair-2); transition: border-color 120ms ease, color 120ms ease; }
.cell-company a:hover { color: var(--accent); border-color: var(--accent); }

.quotes-stamp { display: block; margin-top: 4px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* % move next to the current price */
.delta { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.delta.pos { color: var(--pos); }
.delta.neg { color: var(--neg); }

.thesis-link {
  font-size: 12.5px; font-weight: 500; color: var(--accent); text-decoration: none; white-space: nowrap;
}
.thesis-link:hover { text-decoration: underline; }
.no-thesis { color: var(--hair-2); }

/* Weight bar inside table cell */
.wcell { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.wbar { width: 84px; height: 5px; background: var(--surface-2); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.wbar i { display: block; height: 100%; background: var(--accent); border-radius: 0 3px 3px 0; }

/* ── Allocation bars ────────────────────────────────────────── */
.alloc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
@media (max-width: 760px) { .alloc-grid { grid-template-columns: 1fr; } }

.alloc-card {
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 20px 22px;
}
.alloc-card h3 {
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 16px;
}
.alloc-row { display: grid; grid-template-columns: 92px 1fr 52px; align-items: center; gap: 12px; margin-bottom: 12px; }
.alloc-row:last-child { margin-bottom: 0; }
.alloc-label { font-size: 13px; font-weight: 500; }
.alloc-track { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.alloc-fill { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.alloc-val { font-size: 12.5px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }

/* ── Charts ─────────────────────────────────────────────────── */
.chart-card {
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 22px 24px; margin: 28px 0;
}
.chart-card h2 { font-family: var(--serif); font-size: 20px; margin-bottom: 4px; }
.chart-sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 18px; }
.chart-wrap { position: relative; height: 320px; }
@media (max-width: 640px) { .chart-wrap { height: 240px; } }

.table-details { margin-top: 16px; }
.table-details summary {
  font-size: 12.5px; font-weight: 500; color: var(--ink-2); cursor: pointer;
  padding: 4px 0;
}
.table-details summary:hover { color: var(--ink); }
.table-details .table-scroll { margin-top: 12px; }

/* ── Data meta / notes ──────────────────────────────────────── */
.data-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: 12.5px; color: var(--ink-3); margin: 14px 0 0; }
.footnote { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; margin-top: 16px; }

.error-box {
  background: var(--surface); border: 1px solid var(--hair-2); border-radius: var(--radius);
  padding: 32px 24px; text-align: center; color: var(--ink-2); font-size: 14.5px;
}
.error-box .btn { margin-top: 14px; }

/* ── Skeletons ──────────────────────────────────────────────── */
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skel {
  border-radius: 6px; min-height: 14px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--hair) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skel-row { display: flex; gap: 18px; padding: 15px 16px; border-bottom: 1px solid var(--hair); }
.skel-row:last-child { border-bottom: 0; }
.skel-row .skel:nth-child(1) { flex: 2; }
.skel-row .skel:nth-child(2) { flex: 1; }
.skel-row .skel:nth-child(3) { flex: 1; }

/* ── Article (thesis pages) ─────────────────────────────────── */
.article-wrap { max-width: 780px; margin: 0 auto; padding: 48px 24px 72px; }

.article-back { margin-bottom: 34px; }
.article-back a { font-size: 13px; font-weight: 500; color: var(--ink-3); text-decoration: none; }
.article-back a:hover { color: var(--accent); }

.article-header { margin-bottom: 36px; }

.article-title {
  font-family: var(--serif); font-size: clamp(30px, 4.5vw, 42px);
  font-weight: 500; line-height: 1.15; letter-spacing: -0.015em; margin-bottom: 16px;
}

.article-lead { font-size: 17.5px; line-height: 1.6; color: var(--ink-2); margin: 0 0 8px; }

.article-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px 24px;
  margin: 26px 0 0; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
}
.article-meta dt {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 4px;
}
.article-meta dd { margin: 0; font-size: 14px; font-weight: 500; }

.article-altlang { margin: 18px 0 0; font-size: 13.5px; }
.article-altlang a { color: var(--accent); text-decoration: none; font-weight: 500; }
.article-altlang a:hover { text-decoration: underline; }

.article-cta { margin: 40px 0 8px; }

/* ── Prose (markdown body) ──────────────────────────────────── */
.prose {
  font-family: var(--serif);
  font-size: 17.5px; line-height: 1.75; color: var(--ink);
}

.prose > *:first-child { margin-top: 0; }

.prose h2 {
  font-size: 24px; font-weight: 500; letter-spacing: -0.01em;
  margin: 2em 0 0.6em;
}
.prose h3 { font-size: 19px; font-weight: 600; margin: 1.7em 0 0.5em; }

.prose p { margin: 0 0 1.05em; }

.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hair-2); transition: text-decoration-color 120ms ease; }
.prose a:hover { text-decoration-color: var(--accent); }

.prose strong { font-weight: 600; }

.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 26px; }
.prose li { margin-bottom: 0.35em; }

.prose blockquote {
  margin: 1.6em 0; padding: 2px 0 2px 20px;
  border-left: 2px solid var(--accent);
  color: var(--ink-2); font-style: italic;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose img {
  display: block; margin: 30px auto;
  border: 1px solid var(--hair); border-radius: 10px;
  background: var(--surface);
}

/* Company logo inside an article: small, and always on a light card so
   navy-on-transparent logos stay legible in dark mode too. */
.prose img.thesis-logo {
  max-width: 220px;
  margin: 26px auto 34px;
  padding: 20px 24px;
  background: #f6f4ef;
  border: 1px solid var(--hair);
  border-radius: 12px;
}

/* An italic-only line right after an image reads as its caption */
.prose p:has(> img) { margin: 0; }
.prose p:has(> img) + p:has(> em:only-child) {
  text-align: center; font-family: var(--sans); font-size: 12.5px;
  color: var(--ink-3); margin: -18px 0 30px;
}

.prose table {
  width: 100%; border-collapse: collapse;
  font-family: var(--sans); font-size: 13.5px;
  margin: 1.6em 0; display: block; overflow-x: auto;
}
.prose th {
  font-size: 11px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--ink-3); text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--hair-2);
}
.prose td { padding: 9px 12px; border-bottom: 1px solid var(--hair); font-variant-numeric: tabular-nums; }

.prose code {
  font-family: var(--mono); font-size: 0.82em;
  background: var(--chip); padding: 2px 6px; border-radius: 5px;
}
.prose pre { background: var(--chip); padding: 16px 18px; border-radius: 10px; overflow-x: auto; }
.prose pre code { background: transparent; padding: 0; }

.prose hr { border: 0; border-top: 1px solid var(--hair-2); margin: 2.4em auto; width: 120px; }

/* ── Disclaimer box ─────────────────────────────────────────── */
.disclaimer-box {
  margin-top: 56px; padding: 20px 22px;
  background: var(--surface-2); border: 1px solid var(--hair); border-radius: var(--radius);
  font-size: 12.5px; line-height: 1.65; color: var(--ink-3);
}
.disclaimer-box p { margin: 0 0 10px; }
.disclaimer-box p:last-child { margin-bottom: 0; }
.disclaimer-box strong { color: var(--ink-2); }

/* ── Position disclosure ────────────────────────────────────── */
.disclosure-box {
  margin-top: 56px; padding: 16px 20px;
  background: var(--surface-2); border: 1px solid var(--hair);
  border-left: 3px solid var(--ink-2); border-radius: var(--radius);
  font-size: 13px; line-height: 1.65; color: var(--ink-2);
}
.disclosure-box p { margin: 0; }
.disclosure-box strong { color: var(--ink-1, var(--ink-2)); }
.disclosure-box + .disclaimer-box { margin-top: 16px; }

/* ── Methodology blocks ─────────────────────────────────────── */
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
@media (max-width: 760px) { .method-grid { grid-template-columns: 1fr; } }

.method-card {
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 24px 26px;
}
.method-card .idx {
  font-family: var(--mono); font-size: 12px; color: var(--accent); display: block; margin-bottom: 10px;
}
.method-card h3 { font-family: var(--serif); font-size: 20px; font-weight: 500; margin-bottom: 10px; }
.method-card p { font-size: 14px; line-height: 1.65; color: var(--ink-2); margin: 0; }

.placeholder-note { color: var(--ink-3); font-style: italic; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--hair);
  padding: 52px 0 26px;
  background: var(--paper);
}

.footer-grid { display: grid; grid-template-columns: 1.6fr 0.8fr 1.6fr; gap: 40px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }

.footer-tagline { font-size: 13.5px; color: var(--ink-2); margin: 14px 0 16px; }

.footer-social { display: flex; gap: 16px; }
.footer-social a { font-size: 13px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.footer-social a:hover { color: var(--accent); }

.footer-heading {
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 14px;
}

.footer-nav { display: flex; flex-direction: column; gap: 9px; }
.footer-nav a { font-size: 13.5px; color: var(--ink-2); text-decoration: none; }
.footer-nav a:hover { color: var(--ink); }

.footer-legal p { font-size: 12px; line-height: 1.65; color: var(--ink-3); margin: 0; }

.footer-bottom {
  margin-top: 40px; padding-top: 18px;
  border-top: 1px solid var(--hair);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: 12.5px; color: var(--ink-3);
}

/* ── 404 ────────────────────────────────────────────────────── */
.notfound { text-align: center; padding: 110px 24px 130px; }
.notfound .code { font-family: var(--serif); font-size: 84px; font-weight: 500; color: var(--hair-2); line-height: 1; margin-bottom: 18px; }
.notfound p { color: var(--ink-2); margin-bottom: 26px; }

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