/* Canoe in a Hurricane — Canadian Indie Broadsheet (generated by html_generator.py) */
:root {
  --paper:       #f2f5f8;   /* cool crisp birch/glacier newsprint */
  --panel:       #ffffff;   /* broadsheet sheet surface */
  --surface-alt: #e8eef4;   /* cool mist callout & table header surface */
  --ink:         #141920;   /* deep printing-press ink */
  --slate:       #38414d;   /* secondary editorial prose (9.6:1 contrast) */
  --faint:       #505864;   /* metadata & captions (>=6.5:1 WCAG AA contrast) */
  --rule:        #cbd4df;   /* crisp rule */
  --rule-soft:   #dde4ed;   /* hairline divider */
  --canoe:       #9e2a2b;   /* Canadian red canoe accent */
  --canoe-bg:    #f9ebea;
  --accent:      #184a63;   /* St. Lawrence maritime teal */
  --accent-ink:  #0f3346;
  --up:          #1f6346;   /* forest spruce green (Optimistic / Green Shoots) */
  --up-bg:       #e6f3ec;
  --down:        #8c2d2d;   /* terracotta crimson (Pessimistic / Thin Ice) */
  --down-bg:     #f9ebe9;
  --fact:        #1f6346;   --fact-bg:     #e6f3ec;
  --analysis:    #184a63;   --analysis-bg: #e5eff5;
  --spec:        #785512;   --spec-bg:     #f6eedb;
  --measure:     70ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Newsreader", Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.64;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.2rem 2rem 4.5rem;
}

/* ----- Masthead ----- */
.masthead {
  text-align: center;
  padding: 1.4rem 1rem 1.2rem;
  margin-bottom: 1.6rem;
  border-top: 4px double var(--ink);
  border-bottom: 4px double var(--ink);
  background: var(--panel);
}
.masthead-emblem-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.55rem;
}
.masthead-emblem {
  width: 112px;
  height: 48px;
  display: block;
}
.masthead .wordmark {
  font-family: "Playfair Display", "Newsreader", Georgia, serif;
  font-weight: 800;
  font-size: 2.75rem;
  letter-spacing: -0.015em;
  margin: 0;
  line-height: 1.08;
  color: var(--ink);
  text-wrap: balance;
}
.masthead .wordmark .glyph {
  font-size: 0.82em;
  margin-left: 0.28rem;
  vertical-align: baseline;
}
.masthead .tagline {
  font-style: italic;
  color: var(--slate);
  font-size: 1.06rem;
  max-width: 58ch;
  margin: 0.55rem auto 0;
  text-wrap: balance;
}
.dispatch-ribbon {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.55rem 0.9rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule-soft);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.dispatch-ribbon .dateline {
  color: var(--slate);
  font-weight: 500;
}
.dispatch-ribbon .lens-badge {
  color: var(--canoe);
  background: var(--canoe-bg);
  border: 1px solid #e4c3c1;
  padding: 0.14rem 0.55rem;
  border-radius: 4px;
  font-weight: 600;
}
.dispatch-ribbon .reading-time {
  color: var(--faint);
}
.dispatch-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-substack {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--panel);
  background: var(--accent);
  border: 1px solid var(--accent-ink);
  border-radius: 4px;
  padding: 0.26rem 0.7rem;
  cursor: pointer;
  text-decoration: none;
}
.btn-substack:hover {
  background: var(--accent-ink);
}
.btn-substack[data-copied="true"] {
  background: var(--up);
  border-color: var(--up);
}
.btn-substack-link {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ----- In-Page Jump Navigation Bar ----- */
.jump-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.65rem 1rem;
  margin-bottom: 1.8rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
}
.jump-bar-label {
  font-weight: 600;
  color: var(--canoe);
  margin-right: 0.25rem;
}
.jump-bar a {
  color: var(--slate);
  text-decoration: none;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  background: var(--paper);
  border: 1px solid var(--rule-soft);
}
.jump-bar a:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--analysis-bg);
}

/* ----- Layout ----- */
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 2.4rem;
  align-items: start;
}
.main { min-width: 0; }
.rail { position: sticky; top: 1.4rem; }

/* ----- Broadsheet Sections / Cards ----- */
.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.75rem 2rem;
  margin-bottom: 1.8rem;
}
.card.feature {
  border-top: 4px double var(--ink);
  border-radius: 0 0 8px 8px;
}
h1, h2, h3, h4 {
  font-family: "Playfair Display", "Newsreader", Georgia, serif;
  font-weight: 700;
  line-height: 1.18;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: 2.75rem; font-weight: 800; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.22rem; }
h4 { font-size: 1.05rem; }
.eyebrow,
.section-heading {
  font-family: "Playfair Display", "Newsreader", Georgia, serif;
  font-size: 1.55rem;
  color: var(--ink);
  font-weight: 800;
  padding-bottom: 0.65rem;
  margin: 0 0 1.2rem;
  border-bottom: 2px solid var(--ink);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.eyebrow .count,
.section-heading .count {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: var(--faint);
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* ----- Editorial Fleurons ----- */
.fleuron {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.8rem 0 1.2rem;
  color: var(--faint);
}
.fleuron::before,
.fleuron::after {
  content: "";
  height: 1px;
  width: 3.5rem;
  background: var(--rule);
}
.fleuron svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* ----- Prose ----- */
.prose { max-width: var(--measure); }
.prose > *:first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  margin: 1.9rem 0 0.75rem;
}
.prose h1 { font-size: 2.25rem; font-weight: 800; }
.prose h2 {
  font-size: 1.55rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 1.2rem;
}
.prose h2 .section-kicker {
  display: block;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--faint);
  margin-bottom: 0.2rem;
}
.prose h3 { font-size: 1.22rem; }
.prose h4 { font-size: 1.05rem; }
.prose p, .prose li, .prose blockquote {
  color: var(--ink);
  text-wrap: pretty;
}
.prose p.standfirst {
  font-size: 1.14rem;
  line-height: 1.58;
  color: var(--ink);
  padding-bottom: 1rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--rule-soft);
}
.prose p.drop-cap::first-letter {
  float: left;
  font-family: "Playfair Display", "Newsreader", Georgia, serif;
  font-size: 3.1rem;
  line-height: 0.84;
  padding-right: 0.48rem;
  padding-top: 0.08rem;
  font-weight: 800;
  color: var(--canoe);
}
.prose a {
  color: var(--accent);
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
}
.prose a:hover { text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.45rem; }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
.prose blockquote {
  margin: 1.4rem 0;
  padding: 0.85rem 1.2rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--slate);
  font-style: italic;
  background: var(--surface-alt);
  border-radius: 4px;
}
.prose code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.86em;
  background: var(--surface-alt);
  padding: 0.08em 0.35em;
  border-radius: 3px;
}
.prose pre {
  background: var(--surface-alt);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
}
.prose pre code { background: none; padding: 0; }

/* Tone-tinted brief headers — makes the balance mandate visible at a glance */
.prose h2.tone-up       { color: var(--up);     border-bottom-color: var(--up); }
.prose h2.tone-up .section-kicker { color: var(--up); }
.prose h2.tone-down     { color: var(--down);   border-bottom-color: var(--down); }
.prose h2.tone-down .section-kicker { color: var(--down); }
.prose h2.tone-progress { color: var(--accent); border-bottom-color: var(--accent); }
.prose h2.tone-progress .section-kicker { color: var(--accent); }
.prose h2.tone-canada   { color: var(--canoe);  border-bottom-color: var(--canoe); }
.prose h2.tone-canada .section-kicker { color: var(--canoe); }
.prose h2.tone-domino   { color: var(--accent-ink); border-bottom-color: var(--accent); }
.prose h2.tone-portfolio { color: var(--accent-ink); border-bottom-color: var(--accent); }
.prose h2.tone-portfolio .section-kicker { color: var(--accent); }
.prose h2.tone-focus     { color: var(--canoe); border-bottom-color: var(--canoe); }
.prose h2.tone-focus .section-kicker { color: var(--canoe); }

/* ----- Domino Chain Callout Tracks ----- */
.prose ul.domino-list {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 1rem;
  margin: 1.1rem 0 1.5rem;
}
.domino-track {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  background: var(--surface-alt);
  margin: 0;
}
.domino-track.domino-down {
  background: var(--down-bg);
  border-color: #debab6;
}
.domino-track.domino-up {
  background: var(--up-bg);
  border-color: #b7d4c4;
}
.domino-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}
.domino-badge {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.14rem 0.55rem;
  border-radius: 4px;
  background: var(--panel);
  border: 1px solid var(--rule);
  color: var(--accent);
}
.domino-down .domino-badge {
  color: var(--down);
  border-color: #d5a7a2;
}
.domino-up .domino-badge {
  color: var(--up);
  border-color: #a3cbb5;
}
.domino-hinge-badge {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.14rem 0.55rem;
  border-radius: 4px;
  border: 1px solid var(--rule);
  background: var(--panel);
  color: var(--slate);
}
.domino-hinge-badge.hinge-confirmed {
  color: var(--fact);
  background: var(--fact-bg);
  border-color: #b7d4c4;
}
.domino-hinge-badge.hinge-unknown {
  color: var(--spec);
  background: var(--spec-bg);
  border-color: #dfd0ad;
}
.domino-title {
  font-family: "Playfair Display", "Newsreader", Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}
.domino-hinge-callout {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.65rem;
  font-size: 0.92rem;
  line-height: 1.48;
  color: var(--ink);
}
.domino-hinge-callout.hinge-confirmed {
  background: var(--fact-bg);
  border-color: #b7d4c4;
}
.domino-hinge-callout.hinge-unknown {
  background: var(--spec-bg);
  border-color: #dfd0ad;
}
.domino-hinge-label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink);
  margin-right: 0.25rem;
}
.domino-hinge-callout.hinge-confirmed .domino-hinge-label {
  color: var(--fact);
}
.domino-hinge-callout.hinge-unknown .domino-hinge-label {
  color: var(--spec);
}
.prose ol.domino-steps {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: grid;
  gap: 0.55rem;
}
.domino-step {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  background: var(--panel);
  border: 1px solid var(--rule-soft);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.5;
}
.domino-step-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--slate);
  flex-shrink: 0;
  padding-top: 0.1rem;
}
.domino-down .domino-step-meta { color: var(--down); }
.domino-up .domino-step-meta   { color: var(--up); }
.domino-reality-check {
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--rule-soft);
  font-size: 0.90rem;
  line-height: 1.48;
  color: var(--slate);
}
.domino-reality-label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink);
  margin-right: 0.25rem;
}

/* ----- Tables ----- */
.table-wrap {
  overflow-x: auto;
  margin: 1.4rem 0;
  -webkit-overflow-scrolling: touch;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.94rem;
}
.prose th, .prose td {
  border: 1px solid var(--rule);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
  font-variant-numeric: tabular-nums;
}
.prose th {
  background: var(--surface-alt);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  font-weight: 600;
  color: var(--ink);
}

/* ----- Epistemic chips (>=12px legibility floor) ----- */
.chip {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.12em 0.5em;
  border-radius: 4px;
  vertical-align: 0.04em;
  white-space: nowrap;
  border: 1px solid transparent;
  display: inline-block;
}
.chip + .chip { margin-left: 0.25rem; }
.chip-fact     { color: var(--fact);     background: var(--fact-bg);     border-color: #b7d4c4; }
.chip-analysis { color: var(--analysis); background: var(--analysis-bg); border-color: #b8d0de; }
.chip-spec     { color: var(--spec);     background: var(--spec-bg);     border-color: #dfd0ad; }

/* ----- Theory case-file cards ----- */
.theories { display: grid; gap: 1rem; }
.theory {
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  background: var(--panel);
}
.theory-optimistic,
.theory-confirmed {
  border-color: #b7d4c4;
}
.theory-pessimistic,
.theory-refuted {
  border-color: #debab6;
}
.theory-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  margin-bottom: 0.4rem;
}
.theory-id {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--faint);
}
.stamp {
  font-size: 0.76rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.12em 0.55em;
  border-radius: 4px;
  border: 1px solid currentColor;
}
.stamp-active {
  color: var(--accent);
  background: var(--analysis-bg);
  border-color: #b8d0de;
}
.stamp-confirmed,
.stamp-optimistic {
  color: var(--up);
  background: var(--up-bg);
  border-color: #b7d4c4;
}
.stamp-refuted,
.stamp-pessimistic {
  color: var(--down);
  background: var(--down-bg);
  border-color: #debab6;
}
.theory-conf {
  margin-left: auto;
  font-size: 0.80rem;
  font-weight: 600;
  color: var(--slate);
  font-variant-numeric: tabular-nums;
}
.theory-title {
  font-family: "Playfair Display", "Newsreader", Georgia, serif;
  font-weight: 700;
  font-size: 1.22rem;
  margin: 0.15rem 0 0.55rem;
  color: var(--ink);
  text-wrap: balance;
}
.meter {
  height: 6px;
  background: var(--surface-alt);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.65rem;
}
.meter-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
}
.meter-fill.meter-optimistic,
.meter-fill.meter-confirmed {
  background: var(--up);
}
.meter-fill.meter-pessimistic,
.meter-fill.meter-refuted {
  background: var(--down);
}
.theory-desc {
  margin: 0;
  color: var(--slate);
  font-size: 0.96rem;
  line-height: 1.56;
}

/* ----- Sidebar rail ----- */
.rail-heading {
  font-family: "Playfair Display", "Newsreader", Georgia, serif;
  font-size: 1.3rem;
  color: var(--ink);
  font-weight: 700;
  margin: 0 0 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--ink);
}
.rail .block {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.3rem;
}
.rail ul { list-style: none; padding: 0; margin: 0; }
.rail li { margin: 0; }
.rail a {
  display: block;
  padding: 0.42rem 0;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 0.92rem;
  line-height: 1.38;
}
.rail li:last-child a { border-bottom: 0; }
.rail a:hover { color: var(--accent); }
.rail .nav a { font-weight: 500; }
.rail .briefs a {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.rail .brief-stamp {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.rail .brief-headline {
  font-family: "Newsreader", Georgia, serif;
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 500;
}

/* ----- Colophon & Field Guide Legend ----- */
.colophon {
  margin-top: 2.6rem;
  padding: 1.6rem 2rem;
  background: var(--panel);
  border-top: 4px double var(--ink);
  border-bottom: 2px solid var(--ink);
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
  border-radius: 0 0 8px 8px;
}
.colophon-heading {
  font-family: "Playfair Display", "Newsreader", Georgia, serif;
  font-size: 1.55rem;
  font-weight: 700;
  margin: 0 0 0.65rem;
  color: var(--ink);
}
.colophon-intro {
  margin: 0 0 1.1rem;
  color: var(--slate);
  font-size: 0.96rem;
  max-width: var(--measure);
}
.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}
.legend-item {
  background: var(--paper);
  border: 1px solid var(--rule-soft);
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--slate);
}
.legend-item strong {
  color: var(--ink);
}

/* ----- Standalone page wrapper ----- */
.page { max-width: var(--measure); margin: 0 auto; }
.backlink {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.80rem;
  letter-spacing: 0.03em;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.backlink:hover { text-decoration: underline; }

/* ----- Accessibility ----- */
a:focus-visible, button:focus-visible, .theory:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ----- Responsive ----- */
@media (max-width: 860px) {
  .container { padding: 1.4rem 1rem 3.2rem; }
  .grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .rail { position: static; }
  .card { padding: 1.25rem 1.15rem; }
  .colophon { padding: 1.25rem 1.15rem; }
}

@media (max-width: 640px) {
  .table-wrap { overflow-x: visible; }
  .prose table,
  .prose thead,
  .prose tbody,
  .prose tr,
  .prose th,
  .prose td {
    display: block;
    width: 100%;
  }
  .prose thead {
    display: none;
  }
  .prose tbody {
    display: grid;
    gap: 0.85rem;
  }
  .prose tbody tr {
    border: 1px solid var(--rule);
    border-radius: 6px;
    background: var(--paper);
    padding: 0.75rem 0.9rem;
  }
  .prose tbody td {
    border: 0;
    border-bottom: 1px solid var(--rule-soft);
    padding: 0.45rem 0;
    text-align: left !important;
  }
  .prose tbody td:first-child { padding-top: 0; }
  .prose tbody td:last-child { border-bottom: 0; padding-bottom: 0; }
  .prose tbody td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--faint);
    margin-bottom: 0.18rem;
  }
}
