/**
 * site.css — layout, chrome and page structure.
 *
 * Lifted from sovfound.org: centred page heads, a serif reading column
 * set justified at a long leading, mono meta labels, and hairline rules
 * doing the structural work. What changes is the ground (dark) and the
 * key (red). Nothing here is decorative.
 */

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

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* A faint red wash behind the first screen, so the head is not a flat field. */
body::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 720px;
  background: radial-gradient(60% 55% at 50% 0%, var(--accent-wash), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

main, .site-footer { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }

::selection { background: rgba(224, 74, 58, 0.35); color: var(--ink-strong); }

:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }

/* ══ Shared primitives ═══════════════════════════════════════════ */

.rule { border-top: 1px solid var(--rule); }

.meta {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.eyebrow {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip { position: absolute; left: 12px; top: -40px; z-index: 100; padding: 8px 12px; background: var(--accent-deep); color: #fff; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; border-radius: var(--r-sm); transition: top 0.15s ease; }
.skip:focus { top: 12px; }

.tm { font-size: 0.72em; vertical-align: super; line-height: 0; color: var(--ink-dim); margin-left: 1px; font-weight: 500; }

/* ══ Masthead ════════════════════════════════════════════════════
   Nav splits left and right around the centred mark, as on
   sovfound.org. The mark is Logos's own, in a hairline circle where
   the Foundation carries its section sign: a cursive L that spells
   IPL in one pen stroke, as the § spells SOV (tools/draw_mark.py). */

.masthead {
  position: sticky; top: 0; z-index: 60;
  background: rgba(13, 12, 11, 0.86);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.masthead-inner {
  max-width: var(--w-wide);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.nav-group { display: flex; align-items: center; gap: 22px; flex: 1; }
.nav-group.left  { justify-content: flex-end; }
.nav-group.right { justify-content: flex-start; }

.nav-link {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink-muted);
  padding-bottom: 1px;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.nav-link:hover { color: var(--ink-strong); }
.nav-link.is-active { color: var(--ink-strong); border-bottom-color: var(--accent); }
.nav-link .ext { color: var(--ink-faint); margin-left: 3px; }

.mark-btn {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--ink-strong);
  color: var(--ink-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.mark-btn .logos-mark {
  display: block;
  height: 30px;
  width: auto;
  transform: translateX(1px);
}
.mark-btn:hover { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-wash); }

/* Mobile directory — the nav groups collapse into one panel. */
.menu-btn {
  display: none;
  position: absolute; right: 0; top: 0; height: 100%;
  padding: 0 var(--pad-x);
  background: none; border: none; cursor: pointer;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--ink-strong);
}

.menu-panel { display: none; }

@media (max-width: 760px) {
  .masthead-inner { position: relative; height: 62px; }
  .nav-group { display: none; }
  .menu-btn { display: block; }
  .menu-panel {
    position: fixed; inset: 62px 0 0 0; z-index: 59;
    background: var(--paper);
    padding: 12px var(--pad-x) 48px;
    overflow-y: auto;
  }
  body.menu-open .menu-panel { display: block; }
  body.menu-open { overflow: hidden; }
  .menu-panel a {
    display: block;
    padding: 15px 2px;
    border-bottom: 1px solid var(--rule);
    font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--ink-strong);
  }
  .menu-panel a.is-active { color: var(--accent); }
}

/* ══ Page head ═══════════════════════════════════════════════════ */

.page-head {
  max-width: var(--w-wide);
  margin: 0 auto;
  padding: 56px var(--pad-x) 44px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}

.breadcrumb { font-family: var(--sans); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 24px; }
.breadcrumb a { transition: color 0.18s ease; }
.breadcrumb a:hover { color: var(--ink-strong); }
.breadcrumb .sep { margin: 0 8px; color: var(--ink-faint); }
.breadcrumb .here { color: var(--ink-strong); }

.page-head .eyebrow { margin-bottom: 20px; }

.page-head h1 {
  font-family: var(--serif);
  font-size: var(--display-lg);
  font-weight: 400;
  line-height: 1.1;
  color: var(--ink-strong);
  margin-bottom: 20px;
  max-width: 18ch;
}

.page-head h1 em { font-style: italic; color: var(--accent); }

.page-head .standfirst {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--ink-muted);
  max-width: 44ch;
}

/* ══ Prose ═══════════════════════════════════════════════════════ */

.prose-block { max-width: var(--w-read); margin: 0 auto; padding: 44px var(--pad-x) 56px; display: flex; flex-direction: column; gap: 24px; }

.prose {
  font-family: var(--serif);
  font-size: var(--prose);
  line-height: var(--prose-lead);
  color: var(--ink);
  text-align: justify;
  hyphens: auto;
}

.prose strong { font-weight: 600; color: var(--ink-strong); }

.prose a {
  color: var(--ink-strong);
  border-bottom: 1px solid var(--ink-faint);
  transition: color 0.18s ease, border-color 0.18s ease;
}
.prose a:hover { color: var(--accent-hi); border-bottom-color: var(--accent); }

@media (max-width: 620px) { .prose { text-align: left; } }

/* ══ Sections ════════════════════════════════════════════════════ */

.section-block { max-width: var(--w-wide); margin: 0 auto; padding: 48px var(--pad-x) 64px; display: flex; flex-direction: column; align-items: center; gap: 40px; }
.section-block > .prose { max-width: var(--w-read); width: 100%; }

.section-title { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }

.section-title h2 {
  font-family: var(--serif);
  font-size: var(--section-lg);
  font-style: italic;
  font-weight: 400;
  color: var(--ink-strong);
  text-align: center;
}

.section-title hr { width: 80px; border: none; border-top: 1px solid var(--accent-line); }

.fig-caption {
  font-family: var(--serif);
  font-size: 0.8rem; color: var(--ink-dim); font-style: italic;
  text-align: center; margin: 0.85em auto 0; max-width: 680px; line-height: 1.6;
}

/* ══ Stat cards — a row of counts ════════════════════════════════ */

.stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; margin: 0 auto 2.3em; padding: 0 var(--pad-x); }

.stat {
  text-align: center;
  padding: 1.1em 1.2em;
  min-width: 116px;
  background: var(--paper-raise);
  border: 1px solid var(--rule-soft);
}
.stat .val { font-family: var(--mono); font-size: 1.55rem; font-weight: 600; line-height: 1.05; color: var(--ink-strong); }
.stat .label { font-family: var(--mono); font-size: var(--t-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); margin-top: 0.45em; }
.stat.is-keyed { border-top: var(--edge) solid var(--accent); }
.stat.is-keyed .val { color: var(--accent); }

@media (max-width: 620px) {
  .stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .stat { min-width: 0; padding: 0.9em 0.5em; }
  .stat .val { font-size: 1.3rem; }
}

/* ══ Viz canvas — the cartographer figure idiom ═════════════════ */

.viz { margin: 0 auto 1.4em; position: relative; max-width: var(--w-wide); padding: 0 var(--pad-x); width: 100%; }
.viz canvas { display: block; width: 100%; border: 1px solid var(--rule-soft); background: #0b0a09; border-radius: var(--r-md); }
html:not(.js) .viz canvas { display: none; }
.viz-caption { font-family: var(--serif); font-size: 0.8rem; color: var(--ink-dim); text-align: center; margin-top: 0.7em; font-style: italic; line-height: 1.6; }

/* ══ Actions ═════════════════════════════════════════════════════ */

.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 28px; }

.action {
  font-family: var(--sans);
  font-size: 11px; font-weight: 500; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--ink-strong);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 3px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.action:hover { color: var(--accent-hi); }

.action-quiet { font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-muted); border-bottom: 1px solid var(--rule-strong); padding-bottom: 3px; transition: color 0.18s ease, border-color 0.18s ease; }
.action-quiet:hover { color: var(--accent-hi); border-bottom-color: var(--accent); }

/* ══ Enquiries — the one contact line ═══════════════════════════ */

.enq-lede { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-dim); margin-top: 0.6em; }

.enq-mail {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--ink-strong);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 2px;
  margin-bottom: 1.2em;
  overflow-wrap: anywhere;
  transition: color 0.18s ease;
}
.enq-mail:hover { color: var(--accent-hi); }

@media (max-width: 620px) { .enq-mail { font-size: 1.3rem; } }

/* ══ Pull statement ══════════════════════════════════════════════ */

.pull {
  font-family: var(--serif);
  font-size: 1.5rem;
  line-height: 1.45;
  color: var(--ink-strong);
  text-align: center;
  max-width: 730px;
  margin: 0.4em auto 0.8em;
}
.pull em { color: var(--accent); font-style: italic; }

/* ══ Footer ══════════════════════════════════════════════════════ */

.site-footer { margin-top: auto; border-top: 1px solid var(--rule); padding: 40px 0 36px; }
.footer-inner { max-width: var(--w-wide); margin: 0 auto; padding: 0 var(--pad-x); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.footer-inner .brand { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-strong); }
.footer-inner .brand { display: flex; align-items: center; gap: 10px; }
.footer-inner .brand .lam { height: 22px; width: auto; color: var(--accent); }
.footer-inner p { font-family: var(--sans); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-dim); line-height: 1.9; }
.footer-inner a { border-bottom: 1px solid var(--rule-strong); transition: color 0.18s ease, border-color 0.18s ease; }
.footer-inner a:hover { color: var(--accent-hi); border-bottom-color: var(--accent); }
.footer-inner .mail { text-transform: none; letter-spacing: 0.04em; font-size: 11.5px; }

/* ══ Motion ══════════════════════════════════════════════════════ */

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

@media (max-width: 760px) {
  :root { --display-lg: var(--display-sm); --section-lg: var(--section-sm); }
  .page-head { padding: 40px var(--pad-x) 34px; }
  .section-block { padding: 40px var(--pad-x) 52px; gap: 32px; }
  .pull { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  :root {
    color-scheme: light;
    --paper: #fff; --paper-soft: #fff; --paper-sunk: #fff; --paper-raise: #fff;
    --ink-strong: #111; --ink: #222; --ink-soft: #333; --ink-muted: #444; --ink-dim: #555; --ink-faint: #888;
    --rule: #ddd; --rule-soft: #e6e6e6; --rule-strong: #bbb; --accent: #a8281d;
  }
  body::before, .masthead, .menu-panel, .viz, .est-tools { display: none; }
  .js .reveal { opacity: 1; transform: none; }
}
