/*  Scholarly Investing — homepage redesign (per docs/redesign-implementation-guide.md, Phase A).
    Source of truth: docs/scholarly-investing-redesign.html — do NOT edit here without
    updating the prototype as well.
    Prototype CSS variables (--paper, --ink, --gold-tint, --rule, etc.) are aliased to the
    existing site-wide brand tokens in static/css/custom.css so the prototype's CSS works
    unchanged below the alias block. */

:root {
  /* ── Aliases mapping prototype names to existing brand tokens ── */
  --paper:        #FAF8F5;
  --paper-deep:   #F1ECE3;
  --ink:          #1A1814;
  --ink-soft:     #4A4339;
  --ink-faint:    #8A8378;
  --gold:         var(--si-gold,         #C9A84C);
  --gold-light:   var(--si-gold-light,   #E5C96A);
  --gold-dark:    var(--si-gold-dark,    #9A7E2A);
  --gold-tint:    rgba(201, 168, 76, 0.08);
  --silver:       var(--si-silver,       #A8B2BC);
  --silver-light: var(--si-silver-light, #C8D0D8);
  --silver-deep:  #6F7884;
  --silver-tint:  rgba(168, 178, 188, 0.12);
  --rule:         rgba(26, 24, 20, 0.12);
  --rule-strong:  rgba(26, 24, 20, 0.30);
}

/* ── Homepage opt-out of dark mode (Phase A first iteration only).
   The site-wide dark toggle still works on inner pages; the homepage stays
   in publication-masthead light mode for this iteration. */
body.home-page,
body.home-page.bg-dark {
  background-color: var(--paper) !important;
  color: var(--ink) !important;
}

/* ── Begin prototype CSS (with prototype's :root block stripped — aliases above) ── */

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

  html, body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  body {
    background-image:
      radial-gradient(circle at 12% 18%, rgba(201, 168, 76, 0.06), transparent 55%),
      radial-gradient(circle at 88% 82%, rgba(168, 178, 188, 0.10), transparent 55%);
    background-attachment: fixed;
    min-height: 100vh;
  }

  .grain {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.4;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    z-index: 1;
  }

  /* ─── Layout ─── */
  .frame {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 56px;
    position: relative;
    z-index: 2;
  }

  /* ─── Header (sticky) ─── */
  .site-top {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(250, 248, 245, 0.85);
    backdrop-filter: blur(14px) saturate(120%);
    -webkit-backdrop-filter: blur(14px) saturate(120%);
    transition: box-shadow 0.3s ease, background 0.3s ease;
  }
  .site-top.scrolled {
    background: rgba(250, 248, 245, 0.94);
    box-shadow: 0 1px 0 var(--rule), 0 6px 20px -16px rgba(26, 24, 20, 0.4);
  }
  header {
    padding: 22px 0 0;
  }
  header .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 18px;
  }
  .wordmark {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 22px;
    letter-spacing: 0.04em;
    line-height: 1;
    color: var(--ink);
  }
  .wordmark .logo {
    height: 38px;
    width: auto;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(26, 24, 20, 0.08));
    animation: logo-orbit 30s linear infinite;
    transform-origin: 50% 50%;
  }
  @keyframes logo-orbit {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
  }
  @media (prefers-reduced-motion: reduce) {
    .wordmark .logo { animation: none; }
  }
  .wordmark span {
    font-variant: small-caps;
    letter-spacing: 0.08em;
    font-size: 16px;
    text-transform: uppercase;
  }
  .wordmark em {
    font-style: italic;
    font-weight: 500;
    text-transform: none;
    font-size: 19px;
    letter-spacing: 0;
    font-variant: normal;
    background: linear-gradient(
      100deg,
      var(--gold-dark) 0%,
      var(--gold-dark) 35%,
      var(--gold-light) 50%,
      var(--gold-dark) 65%,
      var(--gold-dark) 100%
    );
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: shimmer 6s ease-in-out infinite;
  }
  nav {
    display: flex;
    gap: 36px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  nav a {
    color: var(--ink-soft);
    text-decoration: none;
    transition: color 0.2s;
  }
  nav a:hover { color: var(--gold); }
  nav .pill {
    border: 1px solid var(--ink);
    padding: 8px 16px;
    border-radius: 100px;
    color: var(--ink);
  }
  nav .pill:hover {
    background: var(--ink);
    color: var(--paper);
  }

  /* ─── Issue line ─── */
  .issue-line {
    display: flex;
    justify-content: space-between;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
  }

  /* ─── Hero ─── */
  .hero {
    padding: 88px 0 48px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .hero-pre {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.5;
    color: var(--ink-soft);
    max-width: 620px;
    padding-left: 24px;
    border-left: 2px solid var(--gold);
  }
  .hero-pre em {
    font-style: italic;
    color: var(--ink);
  }
  .hero h1 {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(56px, 9vw, 132px);
    line-height: 0.9;
    letter-spacing: -0.03em;
  }
  .hero h1 em {
    font-style: italic;
    font-weight: 400;
    color: var(--gold);
  }
  .hero-after {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 28px;
    align-items: start;
    max-width: 720px;
    margin-left: auto;
  }
  .hero-arrow {
    font-family: var(--font-display);
    font-size: 40px;
    line-height: 1;
    color: var(--gold);
    font-weight: 400;
  }
  .lede {
    font-family: var(--font-body);
    font-size: 20px;
    line-height: 1.5;
    color: var(--ink-soft);
  }
  .lede strong {
    color: var(--ink);
    font-weight: 500;
  }

  /* ─── Wave ─── */
  .wave-wrap {
    margin: 60px 0 24px;
    position: relative;
  }
  .wave-rail {
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
    padding: 24px 0 12px;
    position: relative;
  }
  .wave-svg {
    width: 100%;
    height: auto;
    display: block;
    overflow: visible;
  }
  .wave-path {
    fill: none;
    stroke: url(#wave-gradient);
    stroke-width: 1.5;
    stroke-linecap: round;
  }
  .wave-path-shadow {
    fill: none;
    stroke: var(--gold);
    stroke-width: 1.5;
    stroke-linecap: round;
    opacity: 0.12;
    transform: translate(0, 5px);
  }
  .wave-future {
    fill: none;
    stroke: var(--gold);
    stroke-width: 1.5;
    stroke-dasharray: 2 5;
    stroke-linecap: round;
    opacity: 0.6;
  }
  .wave-baseline {
    stroke: var(--rule);
    stroke-width: 1;
    stroke-dasharray: 1 4;
  }

  .node {
    cursor: pointer;
  }
  .node-circle {
    fill: var(--paper);
    stroke: var(--silver-deep);
    stroke-width: 1.5;
    transition: all 0.25s ease;
  }
  .node[data-step="4"] .node-circle,
  .node[data-step="5"] .node-circle,
  .node[data-step="6"] .node-circle,
  .node[data-step="7"] .node-circle,
  .node[data-step="8"] .node-circle,
  .node[data-step="9"] .node-circle {
    stroke: var(--gold-dark);
  }
  .node-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    fill: var(--ink);
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    font-weight: 500;
  }
  .node-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    fill: var(--ink-soft);
    text-anchor: middle;
    pointer-events: none;
  }

  .node:hover .node-circle {
    fill: var(--ink);
    stroke: var(--ink);
    r: 16;
  }
  .node:hover .node-num { fill: var(--paper); }

  .node.active .node-circle {
    fill: var(--gold);
    stroke: var(--gold-dark);
    r: 17;
    filter: drop-shadow(0 2px 6px rgba(201, 168, 76, 0.4));
  }
  .node.active .node-num { fill: var(--ink); font-weight: 600; }
  .node.active .node-label { fill: var(--gold-dark); font-weight: 600; }

  /* Phase markers in the wave area */
  .phase-label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    fill: var(--ink-soft);
    text-anchor: middle;
    opacity: 0;
    animation: fade-in 0.7s ease-out 0.3s forwards;
  }
  .phase-divider {
    stroke: var(--ink-faint);
    stroke-width: 1;
    stroke-dasharray: 2 6;
    opacity: 0;
    animation: divider-in 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s forwards;
  }
  @keyframes divider-in {
    from { opacity: 0; stroke-dashoffset: 60; }
    to   { opacity: 0.5; stroke-dashoffset: 0; }
  }
  @media (prefers-reduced-motion: reduce) {
    .phase-label    { opacity: 1; animation: none; }
    .phase-divider  { opacity: 0.5; animation: none; }
  }
/* ─── Detail panel ─── */
  .detail {
    margin: 64px 0 96px;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 80px;
    align-items: start;
  }
  .detail-meta {
    border-top: 2px solid var(--ink);
    padding-top: 20px;
  }
  .detail-step {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 96px;
    line-height: 1;
    letter-spacing: -0.04em;
    background: linear-gradient(
      100deg,
      var(--gold-dark) 0%,
      var(--gold-dark) 30%,
      var(--gold-light) 50%,
      var(--gold-dark) 70%,
      var(--gold-dark) 100%
    );
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: shimmer 5s ease-in-out infinite;
  }
  @keyframes shimmer {
    0%   { background-position: 200% 50%; }
    100% { background-position: -50% 50%; }
  }
  @media (prefers-reduced-motion: reduce) {
    .detail-step { animation: none; background-position: 50% 50%; }
  }
  .detail-phase {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-top: 14px;
  }
  .detail-phase span {
    color: var(--ink);
  }
  .detail-body {
    border-top: 2px solid var(--ink);
    padding-top: 20px;
  }
  .detail-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 42px;
    line-height: 1.05;
    letter-spacing: -0.01em;
  }
  .detail-title em {
    font-style: italic;
    color: var(--gold);
    font-weight: 400;
  }
  .detail-subtitle {
    margin-top: 12px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold-dark);
    font-weight: 500;
  }
  .detail-prose {
    margin-top: 22px;
    font-family: var(--font-body);
    font-size: 19px;
    line-height: 1.55;
    color: var(--ink-soft);
  }
  .detail-prose p + p { margin-top: 14px; }

  .detail-actions {
    margin-top: 32px;
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
  }
  .btn-primary {
    background: var(--ink);
    color: var(--paper);
    padding: 14px 24px;
    border-radius: 100px;
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--ink);
  }
  .btn-primary:hover {
    background: var(--gold);
    border-color: var(--gold);
  }
  .btn-secondary {
    color: var(--ink);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--ink);
    padding-bottom: 4px;
    transition: all 0.2s;
  }
  .btn-secondary:hover { color: var(--gold); border-color: var(--gold); }

  .detail-pairing {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--rule);
    display: flex;
    align-items: baseline;
    gap: 14px;
    font-size: 14px;
    color: var(--ink-faint);
  }
  .detail-pairing strong {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--ink-soft);
  }
  .detail-pairing a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--rule-strong);
    text-underline-offset: 4px;
  }

  /* ─── Footer ─── */
  footer {
    border-top: 1px solid var(--rule);
    padding: 36px 0 48px;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    text-transform: uppercase;
  }
  footer .colophon {
    font-family: var(--font-body);
    font-style: italic;
    text-transform: none;
    letter-spacing: 0;
    font-size: 14px;
  }

  /* ─── Masthead strip (real edition info) ─── */
  .masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--rule);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    gap: 32px;
  }
  .masthead-info {
    color: var(--ink);
    flex-shrink: 0;
  }
  .masthead-info .sep {
    color: var(--ink-faint);
    margin: 0 8px;
  }
  .masthead-feature {
    display: flex;
    align-items: baseline;
    gap: 12px;
    text-decoration: none;
    color: var(--ink-soft);
    transition: color 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  .masthead-feature:hover { color: var(--gold); }
  .masthead-feature .kicker {
    color: var(--gold);
    font-weight: 500;
    flex-shrink: 0;
  }
  .masthead-feature .arrow {
    color: var(--gold);
    flex-shrink: 0;
  }
  .masthead-feature .feature-title {
    font-family: var(--font-body);
    font-style: italic;
    text-transform: none;
    letter-spacing: 0;
    font-size: 15px;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ─── This Week feature ─── */
  .this-week {
    margin: 0 0 80px;
    padding: 0;
  }
  .tw-rule {
    height: 1px;
    background: var(--ink);
    margin: 0;
  }
  .tw-rule + .tw-grid { padding-top: 56px; }
  .tw-grid + .tw-rule { margin-top: 56px; }
  .tw-grid {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 80px;
    padding-bottom: 56px;
  }
  .tw-meta {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 24px;
    border-right: 1px solid var(--rule);
    padding-right: 24px;
  }
  .tw-kicker {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--gold);
    line-height: 1.6;
  }
  .tw-kicker span {
    color: var(--ink-soft);
  }
  .tw-info {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .tw-info a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--rule-strong);
    padding-bottom: 1px;
  }
  .tw-info a:hover { color: var(--gold); border-color: var(--gold); }
  .tw-headline {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(40px, 5.5vw, 72px);
    line-height: 0.98;
    letter-spacing: -0.02em;
  }
  .tw-headline em {
    font-style: italic;
    font-weight: 400;
    color: var(--gold);
  }
  .tw-dek {
    margin-top: 18px;
    font-family: var(--font-body);
    font-style: italic;
    font-size: 22px;
    line-height: 1.4;
    color: var(--ink-soft);
    max-width: 640px;
  }
  .tw-prose {
    margin-top: 28px;
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 1.65;
    color: var(--ink);
    max-width: 640px;
  }
  .tw-prose p + p { margin-top: 14px; }
  .tw-prose em { font-style: italic; }
  .tw-cta {
    margin-top: 28px;
    display: inline-block;
  }
  .tw-citation {
    margin-top: 36px;
    padding-top: 18px;
    border-top: 1px solid var(--rule);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--ink-faint);
    text-transform: none;
    max-width: 640px;
  }
  .tw-citation em {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--ink-soft);
    font-style: italic;
  }

  /* ─── Responsive ─── */
  @media (max-width: 900px) {
    .frame { padding: 0 24px; }
    .hero { padding: 48px 0 32px; gap: 28px; }
    .hero-after { grid-template-columns: 1fr; gap: 12px; margin-left: 0; }
    .hero-arrow { display: none; }
    .detail { grid-template-columns: 1fr; gap: 28px; }
    nav { gap: 20px; }
    nav .pill { display: none; }
    .detail-step { font-size: 72px; }
    .detail-title { font-size: 32px; }
    .masthead { flex-direction: column; align-items: flex-start; gap: 8px; }
    .masthead-feature { white-space: normal; }
    .tw-grid { grid-template-columns: 1fr; gap: 32px; padding-bottom: 40px; }
    .tw-rule + .tw-grid { padding-top: 40px; }
    .tw-grid + .tw-rule { margin-top: 40px; }
    .tw-meta { border-right: none; border-bottom: 1px solid var(--rule); padding-right: 0; padding-bottom: 20px; flex-direction: row; justify-content: space-between; }
  }

  /* ─── Entrance motion ─── */
  @keyframes fade-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
  .hero-pre, .hero h1, .hero-after { animation: fade-up 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .hero-pre   { animation-delay: 0.1s; }
  .hero h1    { animation-delay: 0.25s; }
  .hero-after { animation-delay: 0.45s; }

  .wave-path, .wave-path-shadow {
    stroke-dasharray: 2400;
    stroke-dashoffset: 2400;
    animation: draw-wave 2.4s cubic-bezier(0.4, 0, 0.2, 1) 0.6s forwards;
  }
  .wave-path-shadow { animation-delay: 0.7s; }
  @keyframes draw-wave {
    to { stroke-dashoffset: 0; }
  }

  .node {
    opacity: 0;
    animation: fade-in 0.5s ease-out both;
  }
  .node[data-step="1"] { animation-delay: 1.2s; }
  .node[data-step="2"] { animation-delay: 1.35s; }
  .node[data-step="3"] { animation-delay: 1.5s; }
  .node[data-step="4"] { animation-delay: 1.65s; }
  .node[data-step="5"] { animation-delay: 1.8s; }
  .node[data-step="6"] { animation-delay: 1.95s; }
  .node[data-step="7"] { animation-delay: 2.1s; }
  .node[data-step="8"] { animation-delay: 2.25s; }
  .node[data-step="9"] { animation-delay: 2.4s; }

  .handoff-line, .handoff-label {
    opacity: 0;
    animation: fade-in 0.6s ease-out 1.7s forwards;
  }

  @media (prefers-reduced-motion: reduce) {
    .hero-pre, .hero h1, .hero-after,
    .wave-path, .wave-path-shadow,
    .node, .handoff-line, .handoff-label {
      animation: none;
      opacity: 1;
      stroke-dashoffset: 0;
    }
  }

  /* Active node pulses gently */
  .node.active .node-circle {
    animation: gold-pulse 2.8s ease-in-out infinite;
  }
  @keyframes gold-pulse {
    0%, 100% { filter: drop-shadow(0 2px 6px rgba(201, 168, 76, 0.4)); }
    50%      { filter: drop-shadow(0 2px 14px rgba(229, 201, 106, 0.7)); }
  }

  /* ─── Publication masthead (top banner, not sticky) ─── */
  .masthead-banner {
    text-align: center;
    padding: 56px 0 36px;
    border-bottom: 1px solid var(--rule);
    position: relative;
    z-index: 1;
  }
  .masthead-logo {
    height: 88px;
    width: auto;
    display: block;
    margin: 0 auto 18px;
    filter: drop-shadow(0 3px 10px rgba(26, 24, 20, 0.12));
    animation: logo-orbit 30s linear infinite;
    transform-origin: 50% 50%;
  }
  .masthead-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(56px, 9vw, 104px);
    line-height: 0.95;
    letter-spacing: 0.005em;
    color: var(--ink);
    margin: 0 0 22px;
  }
  .masthead-title em {
    font-style: italic;
    font-weight: 500;
    background: linear-gradient(
      100deg,
      var(--gold-dark) 0%,
      var(--gold-dark) 30%,
      var(--gold-light) 50%,
      var(--gold-dark) 70%,
      var(--gold-dark) 100%
    );
    background-size: 250% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    animation: shimmer 6s ease-in-out infinite;
  }
  .masthead-date {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-soft);
  }
  .masthead-date .rule {
    display: block;
    width: 48px;
    height: 1px;
    background: var(--rule-strong);
  }
  .masthead-date .sep {
    color: var(--ink-faint);
    margin: 0 6px;
  }

  /* ─── Breaking news ticker (sticky, under nav) ─── */
  .ticker {
    display: flex;
    align-items: stretch;
    background: var(--ink);
    color: var(--paper);
    height: 34px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
  }
  .ticker-label {
    background: var(--gold);
    color: var(--ink);
    padding: 0 18px;
    display: flex;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-weight: 600;
    flex-shrink: 0;
    position: relative;
  }
  .ticker-label::after {
    content: '';
    position: absolute;
    right: -6px; top: 0; bottom: 0;
    width: 6px;
    background: linear-gradient(90deg, var(--gold) 0%, transparent 100%);
    pointer-events: none;
  }
  .ticker-track {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
  }
  .ticker-content {
    display: inline-flex;
    white-space: nowrap;
    animation: ticker-scroll 55s linear infinite;
    font-family: var(--font-body);
    font-size: 13.5px;
    line-height: 1;
  }
  .ticker-item {
    padding: 0 60px 0 24px;
    color: var(--paper);
  }
  @keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
  }
  @media (prefers-reduced-motion: reduce) {
    .ticker-content { animation: none; }
    .masthead-logo  { animation: none; }
  }

  @media (max-width: 700px) {
    .masthead-banner { padding: 36px 0 24px; }
    .masthead-logo   { height: 64px; }
    .masthead-title  { font-size: clamp(40px, 12vw, 72px); }
    .ticker          { height: 30px; }
    .ticker-label    { padding: 0 12px; font-size: 9px; }
    .ticker-content  { font-size: 12px; }
  }

  /* ─── Floating tooltip on the active node ─── */
  .tooltip-frame {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-end;
  }
  .tooltip-card {
    background: var(--ink);
    color: var(--paper);
    border: 1px solid var(--gold-dark);
    padding: 9px 16px 10px;
    border-radius: 6px;
    text-align: center;
    box-shadow: 0 6px 20px -8px rgba(26, 24, 20, 0.4);
    max-width: 320px;
  }
  .tip-kicker {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 5px;
  }
  .tip-title {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 17px;
    color: var(--paper);
    line-height: 1.1;
    white-space: nowrap;
  }
  .tip-title em {
    color: var(--gold-light);
    font-style: italic;
  }
  .tip-sub {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--silver);
    margin-top: 4px;
    white-space: nowrap;
  }
  .tip-sub:empty { display: none; }
</style>


/* ── Homepage-specific overrides applied after the prototype CSS ── */

/* The prototype's .site-top (containing the publication header) stays sticky.
   The breaking-news ticker has been moved OUTSIDE site-top so it scrolls away
   with the rest of the page content — only the header sticks. */

/* Ticker leading buffer: the first sentence enters from blank space rather
   than starting mid-text when the page first paints. */
body.home-page .ticker--inflow .ticker-content {
  padding-left: 65vw;
}

/* Suppress Chrome's default blue focus rectangle on the wave nodes after click,
   while preserving an accessible keyboard focus ring via :focus-visible. */
.node:focus { outline: none; }
.node:focus-visible .node-circle {
  stroke: var(--gold);
  stroke-width: 3;
  filter: drop-shadow(0 0 6px rgba(201, 168, 76, 0.55));
}

/* When the hero ↓ arrow links to #wave, scroll-margin-top centres the wave
   in the viewport instead of pinning its top edge to the navbar. The value
   is roughly (viewport - wave-height) / 2; 22vh works at most aspect ratios. */
body.home-page #wave {
  scroll-margin-top: 22vh;
}

/* The tooltip card sits in an SVG <foreignObject> 360px wide above the active
   node. pointer-events="none" on the wrapping <g> doesn't reliably propagate
   into HTML descendants in Safari/older WebKit, so the invisible HTML overlay
   swallows clicks on neighbouring nodes (e.g. step 3 was un-clickable while
   step 2 was active). Force pointer-events: none on every descendant so
   clicks pass through to the SVG nodes underneath. */
#node-tooltip,
#node-tooltip foreignObject,
#node-tooltip .tooltip-frame,
#node-tooltip .tooltip-card,
#node-tooltip .tip-kicker,
#node-tooltip .tip-kicker > *,
#node-tooltip .tip-title,
#node-tooltip .tip-sub {
  pointer-events: none !important;
}

/* ── End prototype CSS ────────────────────────────────────── */
