/* =================================================================
   The Observatory Ledger — styles
   Static CSS only. No build step, no external fonts, no JS.
   System type only: a reading serif for prose, a clean sans for the
   interface, monospace for data. Warmth from type and space; the
   evidence stays structural.
   ================================================================= */

:root {
  /* Type — all system-resident, zero network requests */
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino,
    "Charter", Georgia, Cambria, "Times New Roman", serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "SFMono-Regular", "Cascadia Code",
    "JetBrains Mono", Menlo, Consolas, monospace;

  /* Paper + ink */
  --paper: #f7f1e5;
  --paper-2: #fffaf0;
  --panel: rgba(255, 250, 240, 0.55);
  --panel-solid: #fbf6ec;
  --ink: #16222f;
  --ink-soft: #2a3744; /* body prose — AA on paper */
  --muted: #586472;    /* small text — darkened for AA */
  --line: #ddd1bc;
  --line-soft: #e7ddca;

  /* Accents */
  --gold: #a17c33;        /* legible gold for text/marks */
  --gold-bright: #b58a42; /* decorative gold */
  --blue: #1f5f94;        /* emphasis + links */
  --blue-deep: #18537f;
  --deep: #0f2a3f;
  --green: #4c6a4f;
  --red: #9c4a34;

  --measure: 39rem;       /* reading column ~66 chars */
  --shadow: 0 18px 48px rgba(15, 42, 63, 0.13);
  --shadow-soft: 0 8px 22px rgba(15, 42, 63, 0.08);
  --radius: 3px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(60rem 32rem at 16% -4%, rgba(181, 138, 66, 0.10), transparent 70%),
    radial-gradient(48rem 30rem at 96% 2%, rgba(31, 95, 148, 0.06), transparent 70%),
    linear-gradient(180deg, #fbf7ee 0%, var(--paper) 46%, #f2e9da 100%);
}

::selection {
  background: rgba(31, 95, 148, 0.16);
}

/* Interface chrome speaks sans; content speaks serif */
.nav,
.eyebrow,
.section-kicker,
.meta,
.brand-subtitle,
.claim-state,
.metric span,
.article-nav,
.back-link,
.post-footer-nav,
.post-card p:not(.subtitle),
.footer,
.side-note {
  font-family: var(--sans);
}

a {
  color: inherit;
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(31, 95, 148, 0.4);
}

img {
  display: block;
  max-width: 100%;
}

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

.site {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-width: 0;
}

/* ----------------------------------------------------------------
   Header
   ---------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 0 22px;
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  gap: 13px;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold);
  background:
    radial-gradient(circle at 50% 38%, rgba(181, 138, 66, 0.14), transparent 65%);
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.brand-title {
  display: block;
  font-family: var(--serif);
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1.04;
  letter-spacing: 0.005em;
}

.brand-subtitle {
  color: var(--muted);
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 6px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: #33414f;
  font-size: 0.86rem;
}

.nav a {
  text-decoration: none;
  padding: 5px 1px;
  border-bottom: 1.5px solid transparent;
  transition: border-color 160ms ease, color 160ms ease;
}

.nav a[aria-current="page"],
.nav a:hover {
  border-color: var(--gold-bright);
  color: var(--ink);
}

/* ----------------------------------------------------------------
   Hero — lighthouse as atmosphere, not ornament
   ---------------------------------------------------------------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: 30px;
  padding: 52px 0 50px;
  min-width: 0;
}

.hero-copy {
  width: 100%;
  max-width: 32rem;
  min-width: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
}

.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}

h1,
h2,
h3,
.display {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.006em;
  line-height: 1.1;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.7rem, 5.2vw, 4.6rem);
  font-weight: 500;
  margin: 18px 0 20px;
}

.hero h1 {
  letter-spacing: -0.012em;
}

.hero h1 em {
  color: var(--blue);
  font-style: italic;
}

.hero p {
  color: var(--ink-soft);
  font-size: 1.16rem;
  line-height: 1.6;
  width: 100%;
  max-width: 32rem;
}

.hero-art {
  position: relative;
  min-height: 360px;
  isolation: isolate;
}

.hero-art img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  object-position: 72% 42%;
  /* Dissolve the watercolour into the paper on every edge */
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, #000 26%, #000 100%),
    linear-gradient(0deg, transparent 0%, #000 14%, #000 80%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent 0%, #000 26%, #000 100%),
    linear-gradient(0deg, transparent 0%, #000 14%, #000 80%, transparent 100%);
  mask-composite: intersect;
}

/* Belt-and-braces paper vignette for engines without mask-composite */
.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--paper) 0%, rgba(247, 241, 229, 0) 22%, rgba(247, 241, 229, 0) 88%, rgba(247, 241, 229, 0.5) 100%),
    linear-gradient(0deg, var(--paper) 0%, rgba(247, 241, 229, 0) 16%, rgba(247, 241, 229, 0) 84%, var(--paper) 100%);
  pointer-events: none;
  z-index: 1;
}

/* ----------------------------------------------------------------
   Latest observations — the post index
   ---------------------------------------------------------------- */
.section-kicker {
  color: var(--gold);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 8px 0 0;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin: 20px 0 30px;
}

.post-card {
  position: relative;
  min-height: 412px;
  padding: 28px 28px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink-soft);
  text-decoration: none;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.post-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--gold-bright), rgba(181, 138, 66, 0));
  opacity: 0;
  transition: opacity 200ms ease;
}

.post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(161, 124, 51, 0.6);
  box-shadow: var(--shadow);
}

.post-card:hover::before {
  opacity: 1;
}

.post-number {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.86rem;
  letter-spacing: 0.18em;
  font-variant-numeric: tabular-nums;
}

.post-number::before {
  content: "OBS · ";
  color: var(--muted);
}

.card-art {
  margin: 14px -28px 22px;
  width: calc(100% + 56px);
  max-width: none;
  height: 158px;
  object-fit: cover;
  object-position: center 58%;
}

.post-card h2 {
  font-size: clamp(1.5rem, 2.1vw, 1.95rem);
  margin: 0 0 8px;
  line-height: 1.14;
}

.subtitle {
  color: var(--blue);
  font-family: var(--serif);
  font-style: italic;
  margin: 0 0 14px;
}

.post-card p:not(.subtitle) {
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.55;
  margin: 0;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 12px;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.01em;
  margin-top: 20px;
}

.post-card .meta {
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}

.meta span + span::before {
  content: "·";
  margin-right: 12px;
  color: var(--line);
}

/* ----------------------------------------------------------------
   Quote band + about
   ---------------------------------------------------------------- */
.quote-band {
  position: relative;
  margin: 18px 0 30px;
  padding: 34px 36px;
  border-radius: var(--radius);
  overflow: hidden;
  background:
    linear-gradient(100deg, rgba(15, 42, 63, 0.94), rgba(31, 95, 148, 0.78)),
    url("assets/blog/correction-boats.jpg") center 60% / cover;
  color: var(--paper-2);
  font-family: var(--serif);
  font-size: clamp(1.3rem, 2.1vw, 1.7rem);
  line-height: 1.28;
  letter-spacing: 0.002em;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 240, 0.08);
}

.quote-band::before {
  content: "“";
  position: absolute;
  top: -0.35em;
  left: 0.22em;
  font-size: 6rem;
  color: rgba(255, 250, 240, 0.16);
  font-family: var(--serif);
  pointer-events: none;
}

.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-bright);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 26px 0;
  background: var(--panel);
}

.callout h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.callout p {
  margin: 0;
}

/* ----------------------------------------------------------------
   Footer
   ---------------------------------------------------------------- */
.footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  padding: 26px 0 40px;
  margin-top: 38px;
}

/* ----------------------------------------------------------------
   Article layout
   ---------------------------------------------------------------- */
.article-shell {
  display: grid;
  grid-template-columns: 180px minmax(0, var(--measure)) minmax(170px, 1fr);
  gap: 40px;
  align-items: start;
  padding-top: 38px;
}

.article-nav {
  position: sticky;
  top: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  font-size: 0.8rem;
  overflow: hidden;
}

.article-nav::before {
  content: "Contents";
  display: block;
  padding: 12px 16px 8px;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.article-nav a {
  display: block;
  padding: 9px 16px;
  text-decoration: none;
  color: var(--ink-soft);
  border-top: 1px solid var(--line-soft);
  transition: color 150ms ease, background 150ms ease;
}

.article-nav a:hover {
  color: var(--blue);
  background: rgba(31, 95, 148, 0.05);
}

.article {
  min-width: 0;
}

.article > * {
  scroll-margin-top: 26px;
}

.back-link {
  display: inline-block;
  color: var(--blue);
  font-size: 0.8rem;
  text-decoration: none;
  letter-spacing: 0.01em;
  margin-bottom: 14px;
}

.back-link::before {
  content: "← ";
}

.back-link:hover {
  text-decoration: underline;
}

.article-header {
  margin-bottom: 34px;
  padding-bottom: 4px;
}

.article-header .section-kicker {
  font-family: var(--mono);
  letter-spacing: 0.16em;
}

.article-header h1 {
  font-size: clamp(2.4rem, 4.4vw, 4rem);
  margin: 10px 0 12px;
  line-height: 1.06;
}

.article-header .subtitle {
  font-size: 1.28rem;
  margin-bottom: 16px;
}

.article-header .meta {
  margin-top: 0;
}

/* Reading prose */
.article h2 {
  font-size: 1.85rem;
  margin: 50px 0 14px;
  padding-top: 4px;
}

.article h3 {
  font-size: 1.3rem;
  margin: 32px 0 8px;
  color: var(--deep);
}

.article p,
.article li {
  color: var(--ink-soft);
  font-size: 1.13rem;
  line-height: 1.74;
}

.article p {
  margin: 0 0 1.15em;
}

.article ul,
.article ol {
  padding-left: 1.3rem;
  margin: 0 0 1.2em;
}

.article li {
  margin-bottom: 0.5em;
}

.article li::marker {
  color: var(--gold);
}

.lead {
  font-size: 1.3rem !important;
  line-height: 1.55 !important;
  color: var(--deep);
  margin-bottom: 1.3em;
}

.lead::first-letter {
  font-size: 3.1rem;
  float: left;
  line-height: 0.84;
  padding: 0.06em 0.1em 0 0;
  color: var(--gold);
  font-weight: 500;
}

/* ----------------------------------------------------------------
   Evidence modules — the falsification spine, made structural
   ---------------------------------------------------------------- */
.claim-states {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin: 28px 0 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.claim-state {
  position: relative;
  background: var(--panel);
  padding: 14px 8px;
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  border-right: 1px solid var(--line-soft);
}

.claim-state:last-child {
  border-right: 0;
}

.claim-state strong {
  display: block;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 0.92rem;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

/* The turn: the null result is where the claim changes state */
.claim-state.is-turn {
  background: linear-gradient(180deg, rgba(156, 74, 52, 0.12), rgba(156, 74, 52, 0.04));
  color: var(--red);
  font-weight: 600;
}

.claim-state.is-turn strong {
  color: var(--red);
}

.claim-state.is-survivor strong {
  color: var(--green);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 30px 0;
  background: var(--panel);
  overflow: hidden;
}

.metric {
  padding: 26px 18px;
  text-align: center;
  border-right: 1px solid var(--line-soft);
}

.metric:last-child {
  border-right: 0;
}

.metric strong {
  display: block;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  margin-top: 10px;
}

/* The null is the protagonist number */
.metric.is-null {
  background: linear-gradient(180deg, rgba(156, 74, 52, 0.10), rgba(156, 74, 52, 0.02));
}

.metric.is-null strong {
  color: var(--red);
}

.metric.is-null span {
  color: var(--red);
}

/* ----------------------------------------------------------------
   Figures, quotes, code
   ---------------------------------------------------------------- */
figure {
  margin: 32px 0;
}

figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

figcaption {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.5;
  margin-top: 11px;
  padding-left: 14px;
  border-left: 2px solid var(--gold-bright);
}

blockquote {
  margin: 30px 0;
  border-left: 3px solid var(--gold-bright);
  padding: 4px 0 4px 24px;
  color: var(--deep);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.32rem;
  line-height: 1.42;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: rgba(15, 42, 63, 0.05);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

pre {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbf6ea;
  padding: 18px 20px;
  margin: 26px 0;
  font-size: 0.86rem;
  line-height: 1.6;
}

pre code {
  background: none;
  padding: 0;
  font-size: 0.86rem;
  color: var(--deep);
}

/* ----------------------------------------------------------------
   Side notes + post nav + references
   ---------------------------------------------------------------- */
.side-note {
  position: sticky;
  top: 26px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 20px;
  font-size: 0.85rem;
  line-height: 1.55;
}

.side-note p {
  margin: 0 0 1em;
}

.side-note strong {
  color: var(--ink);
  display: block;
  margin-bottom: 2px;
}

.post-footer-nav {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  margin-top: 50px;
  padding-top: 22px;
  font-size: 0.9rem;
}

.post-footer-nav a {
  color: var(--blue);
  text-decoration: none;
  max-width: 48%;
}

.post-footer-nav a:hover {
  text-decoration: underline;
}

/* Data tables (e.g. the decision table) */
.article table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.article thead th {
  text-align: left;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.article tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}

.article tbody tr:last-child td {
  border-bottom: 0;
}

.article tbody td:first-child {
  font-family: var(--mono);
  font-size: 0.85rem;
  white-space: nowrap;
  color: var(--deep);
}

/* Compact provenance / method footer */
.detail-block {
  margin: 34px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold-bright);
  border-radius: var(--radius);
  background: var(--panel);
}

.detail-block p {
  font-family: var(--sans);
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 5px;
}

.detail-block p:last-child {
  margin-bottom: 0;
}

.detail-block strong {
  color: var(--ink);
}

.references {
  margin-top: 44px;
  padding-top: 8px;
  font-size: 0.9rem;
}

.references h2 {
  font-size: 1.3rem;
  margin: 0 0 12px;
}

.references ol {
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.85rem;
  line-height: 1.5;
}

.references li {
  margin-bottom: 7px;
}

/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */
@media (max-width: 960px) {
  .article-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }

  .article {
    max-width: var(--measure);
  }

  .article-nav {
    display: none;
  }

  .side-note {
    position: static;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 18px 0 0;
  }
}

@media (max-width: 880px) {
  .hero,
  .posts-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 30px 0 36px;
    gap: 8px;
  }

  .hero-art {
    min-height: auto;
    margin-top: 10px;
  }

  .hero-art img {
    height: 200px;
    object-position: 72% 38%;
  }

  .post-card {
    min-height: 0;
  }
}

@media (max-width: 620px) {
  html {
    font-size: 16px;
  }

  .site {
    width: min(1180px, calc(100% - 28px));
  }

  .topbar,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px 18px;
    font-size: 0.84rem;
  }

  .hero p {
    max-width: 100%;
  }

  .article p,
  .article li {
    font-size: 1.06rem;
    line-height: 1.7;
  }

  .lead {
    font-size: 1.16rem !important;
  }

  .metrics,
  .claim-states {
    grid-template-columns: 1fr;
  }

  .metric {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .metric:last-child {
    border-bottom: 0;
  }

  .claim-state {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    display: flex;
    align-items: baseline;
    justify-content: flex-start;
    gap: 10px;
    text-align: left;
  }

  .claim-state:last-child {
    border-bottom: 0;
  }

  .claim-state strong {
    margin-bottom: 0;
  }

  .quote-band::before {
    display: none;
  }
}

/* ----------------------------------------------------------------
   Motion + print
   ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .post-card:hover {
    transform: none;
  }
}

@media print {
  body {
    background: #fff;
  }

  .nav,
  .article-nav,
  .side-note,
  .post-footer-nav,
  .quote-band {
    display: none;
  }

  .article-shell {
    grid-template-columns: 1fr;
  }

  .article p,
  .article li {
    font-size: 11pt;
    line-height: 1.5;
  }

  a {
    text-decoration: none;
  }

  figure img {
    box-shadow: none;
  }
}
