:root {
    --display: 'cormorant-garamond', 'Garamond', serif;
    --body: 'newsreader', Georgia, serif;
    --mono: 'jetbrains-mono', 'Courier New', monospace;
    --s-ink: #0a0907; --s-ink-2: #12100c;
    --s-paper: #e8e2d3; --s-paper-soft: #c8c1b0; --s-paper-dim: #8a847a; --s-paper-faint: #4a463f;
    --s-brass: #b89968; --s-brass-deep: #8a6f44; --s-brass-faint: #3d3221;
    --s-rule: #2a2620; --s-rule-strong: #3a342c;
    --type-scale: 1;
  }
  :root, [data-theme="light"] {
    --ink: #f4efe2; --ink-2: #ebe4d2; --ink-3: #e0d8c0;
    --paper: #1a1612; --paper-soft: #3d362c; --paper-dim: #6e6557; --paper-faint: #a39a89;
    --brass: #8a6f44; --brass-deep: #6e5736; --brass-faint: #f0e6cd;
    --rule: #d6cfb8; --rule-strong: #beb59c;
    --crimson: #8c2f2a;
    --hover-tint: rgba(138, 111, 68, 0.04);
    --highlight: rgba(138, 111, 68, 0.12);
    --grain-blend: multiply; --grain-opacity: 0.025;
  }
  [data-theme="dark"] {
    --ink: #0a0907; --ink-2: #12100c; --ink-3: #1a1712;
    --paper: #e8e2d3; --paper-soft: #c8c1b0; --paper-dim: #8a847a; --paper-faint: #4a463f;
    --brass: #b89968; --brass-deep: #8a6f44; --brass-faint: #3d3221;
    --rule: #2a2620; --rule-strong: #3a342c;
    --crimson: #d65d57;
    --hover-tint: rgba(184, 153, 104, 0.025);
    --highlight: rgba(184, 153, 104, 0.08);
    --grain-blend: screen; --grain-opacity: 0.035;
  }
  [data-text-size="medium"]  { --type-scale: 1; }
  [data-text-size="large"]   { --type-scale: 1.15; }
  [data-text-size="xlarge"]  { --type-scale: 1.3; }
  [data-text-size="xxlarge"] { --type-scale: 1.5; }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  html, body {
    background: var(--ink); color: var(--paper);
    font-family: var(--body);
    font-size: calc(17px * var(--type-scale));
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.4s ease;
  }
  body::before {
    content: ''; position: fixed; inset: 0;
    pointer-events: none; z-index: 1;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
    mix-blend-mode: var(--grain-blend);
  }

  .stage {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 1.2s ease;
    z-index: 10;
    background: var(--s-ink); color: var(--s-paper);
  }
  .stage.active { opacity: 1; pointer-events: auto; }
  .stage.scrollable {
    position: absolute; min-height: 100vh;
    display: block;
    align-items: initial; justify-content: initial;
    background: var(--ink); color: var(--paper);
  }

  #s1 .logo-wrap { text-align: center; }
  .logotype {
    font-family: var(--display); font-weight: 300;
    font-size: clamp(48px, 9vw, 128px);
    letter-spacing: 0.18em;
    color: var(--s-paper); text-transform: uppercase;
    opacity: 0; transform: translateY(12px);
    animation: rise 1.8s 0.4s ease-out forwards;
  }
  .logotype-mark {
    display: block; width: 1px; height: 64px;
    background: linear-gradient(to bottom, transparent, var(--s-brass) 30%, var(--s-brass) 70%, transparent);
    margin: 32px auto 0; opacity: 0;
    animation: rise 1.4s 1.6s ease-out forwards;
  }
  .logo-sub {
    font-family: var(--mono); font-size: calc(11px * var(--type-scale));
    letter-spacing: 0.4em; color: var(--s-paper-dim);
    text-transform: uppercase; margin-top: 28px;
    opacity: 0; animation: rise 1.4s 2.4s ease-out forwards;
  }
  @keyframes rise { to { opacity: 1; transform: translateY(0); } }

  #s2 .thesis { text-align: center; max-width: 880px; padding: 0 40px; }
  .thesis-line {
    font-family: var(--display); font-weight: 400;
    font-size: clamp(34px, 5vw, 64px);
    line-height: 1.15; letter-spacing: -0.005em;
    color: var(--s-paper);
    opacity: 0; transform: translateY(8px);
  }
  .thesis-line.active { animation: rise 1.4s ease-out forwards; }
  .thesis-sub {
    font-family: var(--body); font-style: italic;
    font-weight: 400; font-size: clamp(18px, 2vw, 24px);
    color: var(--s-paper-soft); margin-top: 36px; opacity: 0;
  }
  .thesis-sub.active { animation: rise 1.4s 0.6s ease-out forwards; }

  #s3 .discipline { max-width: 980px; padding: 0 60px; text-align: center; }
  .discipline-header {
    font-family: var(--mono); font-size: calc(11px * var(--type-scale));
    letter-spacing: 0.4em; color: var(--s-brass);
    text-transform: uppercase; margin-bottom: 56px; opacity: 0;
  }
  .discipline-header.active { animation: rise 1.2s ease-out forwards; }
  .pillars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
  .pillar { opacity: 0; transform: translateY(12px); }
  .pillar.active { animation: rise 1.2s ease-out forwards; }
  .pillar:nth-child(2).active { animation-delay: 0.25s; }
  .pillar:nth-child(3).active { animation-delay: 0.5s; }
  .pillar-num { font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.3em; color: var(--s-brass-deep); margin-bottom: 16px; }
  .pillar-title { font-family: var(--display); font-size: calc(28px * var(--type-scale)); font-weight: 500; color: var(--s-paper); margin-bottom: 18px; letter-spacing: 0.01em; }
  .pillar-body { font-size: calc(15px * var(--type-scale)); color: var(--s-paper-soft); line-height: 1.65; }

  .stage-controls {
    position: absolute; bottom: 48px; left: 50%;
    transform: translateX(-50%);
    display: flex; gap: 24px; align-items: center;
    opacity: 0; animation: rise 1.4s 2s ease-out forwards;
  }
  .stage-btn {
    background: none; border: 1px solid var(--s-rule-strong);
    color: var(--s-paper-soft);
    font-family: var(--mono); font-size: calc(10px * var(--type-scale));
    letter-spacing: 0.3em; text-transform: uppercase;
    padding: 14px 28px; cursor: pointer;
    transition: all 0.3s ease;
  }
  .stage-btn:hover { border-color: var(--s-brass); color: var(--s-brass); }
  .stage-btn.primary { border-color: var(--s-brass-deep); color: var(--s-brass); }
  .stage-btn.primary:hover { background: var(--s-brass-faint); color: var(--s-paper); }
  .stage-dots { display: flex; gap: 10px; }
  .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--s-rule-strong); transition: background 0.4s ease; }
  .dot.active { background: var(--s-brass); }

  .toolbar {
    position: fixed; top: 18px; right: 24px;
    z-index: 80; display: none; gap: 6px;
    background: var(--ink-2); border: 1px solid var(--rule);
    padding: 5px; box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: background 0.4s ease, border-color 0.4s ease;
  }
  .toolbar.visible { display: flex; }
  .toolbar-group { display: flex; gap: 2px; padding-right: 6px; border-right: 1px solid var(--rule); }
  .toolbar-group:last-child { border-right: none; padding-right: 0; }
  .tb-btn {
    background: none; border: none; color: var(--paper-dim);
    font-family: var(--display); cursor: pointer;
    padding: 8px 10px; min-width: 32px;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.2s ease, background 0.2s ease;
    line-height: 1;
  }
  .tb-btn:hover { color: var(--brass); background: var(--brass-faint); }
  .tb-btn.active { color: var(--brass); background: var(--brass-faint); font-weight: 600; }
  .tb-size-1 { font-size: 11px; } .tb-size-2 { font-size: 14px; }
  .tb-size-3 { font-size: 17px; } .tb-size-4 { font-size: 20px; }
  .tb-icon-btn { padding: 8px 9px; }
  .tb-icon-btn svg { display: block; }

  #directory { padding: 0 0 120px; opacity: 0; transition: opacity 0.8s ease; }
  /* directory padding handled by v2 rules (.directory-header/.dir-meta-strip/.dir-intro/.dir-controls/.dir-section) */
  #directory.active { opacity: 1; pointer-events: auto; position: relative; }
  .dir-header {
    border-bottom: 1px solid var(--rule);
    padding-bottom: 32px; margin-bottom: 48px;
    display: flex; justify-content: space-between; align-items: flex-end;
    gap: 32px; flex-wrap: wrap;
  }
  .dir-brand { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
  .dir-brand-name { font-family: var(--display); font-size: calc(32px * var(--type-scale)); font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper); }
  .dir-brand-tag { font-family: var(--body); font-style: italic; color: var(--paper-dim); font-size: calc(15px * var(--type-scale)); white-space: nowrap; }
  .dir-meta { display: flex; gap: 32px; font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.2em; text-transform: uppercase; color: var(--paper-dim); white-space: nowrap; }
  .dir-meta strong { color: var(--brass); font-weight: 500; }
  .public-badge {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--mono); font-size: calc(10px * var(--type-scale));
    letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--brass); white-space: nowrap;
  }
  .public-badge::before {
    content: ''; width: 6px; height: 6px;
    background: var(--brass); border-radius: 50%;
    box-shadow: 0 0 8px var(--brass);
  }

  .dir-intro { max-width: none; margin-bottom: 56px; }
  .dir-intro-eyebrow { font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.3em; text-transform: uppercase; color: var(--brass); margin-bottom: 16px; }
  .dir-intro-text { font-family: var(--display); font-size: calc(22px * var(--type-scale)); line-height: 1.5; color: var(--paper-soft); font-weight: 400; font-style: italic; }

  .dir-section-label { font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.4em; text-transform: uppercase; color: var(--paper-dim); margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }

  .subjects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px; align-items: start;
  }
  .subject-card {
    background: var(--ink); padding: 36px 32px; border: 1px solid var(--rule); border-radius: 2px;
    cursor: pointer; transition: background 0.3s ease;
    position: relative;
    display: flex !important; flex-direction: column !important; justify-content: space-between;
  }
  .subject-card:hover { background: var(--ink-2); }
  .subject-card:hover .subject-name { color: var(--brass); }
  .subject-card.featured { border-color: var(--brass); }
  .subject-card.scaffolded { background: var(--ink); opacity: 0.92; }
  .subject-card.scaffolded:hover { opacity: 1; }
  .subject-meta-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; gap: 12px; }
  .subject-type { font-family: var(--mono); font-size: calc(9px * var(--type-scale)); letter-spacing: 0.3em; text-transform: uppercase; color: var(--paper-dim); }
  .subject-status { font-family: var(--mono); font-size: calc(9px * var(--type-scale)); letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass); white-space: nowrap; }
  .subject-status.scaffolded-status { color: var(--paper-soft); }
  .subject-status.active-status { color: var(--brass); }
  .subject-name { font-family: var(--display); font-size: calc(30px * var(--type-scale)); font-weight: 500; color: var(--paper); letter-spacing: 0.005em; line-height: 1.15; transition: color 0.3s ease; margin-bottom: 8px; }
  .subject-dates { font-family: var(--mono); font-size: calc(12px * var(--type-scale)); color: var(--paper-dim); letter-spacing: 0.1em; margin-bottom: 16px; }
  .subject-summary { font-size: calc(14px * var(--type-scale)); color: var(--paper-soft); line-height: 1.55; font-style: italic; }
  .subject-stats { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--rule); display: flex; gap: 20px; font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.15em; text-transform: uppercase; color: var(--paper-dim); flex-wrap: wrap; }
  .subject-stats strong { color: var(--paper-soft); font-weight: 500; }

  #record { opacity: 0; transition: opacity 0.8s ease; min-height: 100vh; background: var(--ink); padding-top: 73px; position: absolute; top: 0; left: 0; right: 0; }
  #record.active { opacity: 1; pointer-events: auto; position: relative; }

  .record-topbar {
    position: fixed; top: 0; left: 0; right: 0;
    background: color-mix(in srgb, var(--ink) 92%, transparent);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--rule);
    padding: 18px 60px;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 1101; gap: 24px; flex-wrap: wrap;
  }
  .topbar-left { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
  .topbar-back {
    background: none; border: none; color: var(--paper-dim);
    font-family: var(--mono); font-size: calc(10px * var(--type-scale));
    letter-spacing: 0.25em; text-transform: uppercase;
    cursor: pointer; display: flex; align-items: center; gap: 10px;
    transition: color 0.2s ease;
  }
  .topbar-back:hover { color: var(--brass); }
  .topbar-brand { font-family: var(--display); font-size: calc(15px * var(--type-scale)); letter-spacing: 0.2em; text-transform: uppercase; color: var(--paper-soft); padding-left: 24px; border-left: 1px solid var(--rule); }
  .topbar-right { font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.2em; text-transform: uppercase; color: var(--paper-dim); display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
  .stewardship-badge { color: var(--brass); }
  .stewardship-badge::before { content: ''; display: inline-block; width: 6px; height: 6px; background: var(--brass); border-radius: 50%; margin-right: 8px; vertical-align: middle; box-shadow: 0 0 8px var(--brass); }

  .scaffolded-banner {
    background: var(--brass-faint); border-bottom: 1px solid var(--rule);
    padding: 14px 60px; text-align: center;
    font-family: var(--mono); font-size: calc(10px * var(--type-scale));
    letter-spacing: 0.25em; text-transform: uppercase;
    color: var(--brass-deep);
  }
  .scaffolded-banner strong { color: var(--paper); }

  .subject-hero { padding: 80px 60px 48px; border-bottom: 1px solid var(--rule); max-width: 1400px; margin: 0 auto; }
  .hero-eyebrow { font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.35em; text-transform: uppercase; color: var(--brass); margin-bottom: 28px; }
  .hero-name { font-family: var(--display); font-size: clamp(48px, 7vw, 104px); font-weight: 400; letter-spacing: 0.005em; line-height: 1; color: var(--paper); margin-bottom: 24px; }
  .hero-name .surname { font-style: italic; font-weight: 300; }
  .hero-meta { display: flex; gap: 48px; align-items: baseline; flex-wrap: wrap; margin-bottom: 40px; }
  .hero-dates { font-family: var(--display); font-size: calc(26px * var(--type-scale)); color: var(--paper-soft); font-weight: 400; letter-spacing: 0.05em; }
  .hero-dates .dash { color: var(--brass); padding: 0 12px; }
  .hero-dates .active-marker { color: var(--brass); font-style: italic; }
  .hero-tags { display: flex; gap: 16px; font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.25em; text-transform: uppercase; color: var(--paper-dim); flex-wrap: wrap; }
  .hero-tags span::before { content: '·'; margin-right: 16px; color: var(--rule-strong); }
  .hero-tags span:first-child::before { content: ''; margin-right: 0; }
  .hero-bio { max-width: 760px; font-family: var(--body); font-size: calc(19px * var(--type-scale)); line-height: 1.65; color: var(--paper-soft); font-style: italic; font-weight: 400; }

  .spine-section { padding: 64px 60px; max-width: 1400px; margin: 0 auto; border-bottom: 1px solid var(--rule); }
  .section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 40px; gap: 24px; flex-wrap: wrap; }
  .section-title { font-family: var(--display); font-size: calc(24px * var(--type-scale)); font-weight: 500; color: var(--paper); letter-spacing: 0.02em; }
  .section-eyebrow { font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.3em; text-transform: uppercase; color: var(--brass); margin-bottom: 6px; }
  .section-meta { font-family: var(--mono); font-size: calc(11px * var(--type-scale)); letter-spacing: 0.15em; color: var(--paper-dim); }
  .spine { position: relative; margin: 32px 0 16px; padding: 80px 0 100px; }
  .spine-line { position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: linear-gradient(to right, transparent 0%, var(--brass-faint) 5%, var(--brass-deep) 50%, var(--brass-faint) 95%, transparent 100%); }
  .spine-years { position: absolute; top: calc(50% + 28px); left: 0; right: 0; display: flex; justify-content: space-between; font-family: var(--mono); font-size: calc(11px * var(--type-scale)); color: var(--paper-dim); letter-spacing: 0.1em; }
  .year-marker { transform: translateX(-50%); position: absolute; top: 0; }
  .year-marker::before { content: ''; position: absolute; top: -36px; left: 50%; transform: translateX(-50%); width: 1px; height: 8px; background: var(--brass-deep); }
  .spine-events { position: absolute; top: 50%; left: 0; right: 0; height: 0; }
  .spine-event { position: absolute; transform: translate(-50%, -50%); cursor: pointer; display: flex; flex-direction: column; align-items: center; z-index: 2; }
  .spine-node { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 1.5px solid var(--brass); transition: all 0.3s ease; position: relative; z-index: 2; }
  .spine-node.major { width: 16px; height: 16px; background: var(--brass); }
  .spine-node.death { width: 18px; height: 18px; background: var(--crimson); border-color: var(--crimson); box-shadow: 0 0 12px rgba(140, 47, 42, 0.4); }
  .spine-event:hover .spine-node { transform: scale(1.4); box-shadow: 0 0 16px var(--brass); }
  .spine-event:hover .spine-tooltip { opacity: 1; transform: translateX(-50%) translateY(-8px); }
  .spine-tooltip { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%) translateY(0); background: var(--ink-3); border: 1px solid var(--rule-strong); padding: 12px 18px; min-width: 220px; max-width: 280px; margin-bottom: 12px; opacity: 0; transition: all 0.3s ease; pointer-events: none; z-index: 10; box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
  .spine-tooltip-date { font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.15em; color: var(--brass); text-transform: uppercase; margin-bottom: 4px; }
  .spine-tooltip-title { font-family: var(--display); font-size: calc(15px * var(--type-scale)); color: var(--paper); line-height: 1.3; }
  .spine-event.below .spine-tooltip { bottom: auto; top: 100%; margin-bottom: 0; margin-top: 12px; }

  .events-section { padding: 64px 60px 120px; max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: 1fr 320px; gap: 80px; }
  .events-list { display: flex; flex-direction: column; gap: 0; }
  .event-year-group { margin-bottom: 48px; }
  .event-year-header { font-family: var(--display); font-size: calc(64px * var(--type-scale)); font-weight: 300; color: var(--brass); margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); letter-spacing: 0.02em; position: sticky; top: 60px; background: var(--ink); z-index: 5; }
  .event-year-header .age { font-family: var(--mono); font-size: calc(11px * var(--type-scale)); letter-spacing: 0.25em; text-transform: uppercase; color: var(--paper-dim); margin-left: 16px; vertical-align: middle; }
  .event { padding: 28px 0 32px; border-bottom: 1px solid var(--rule); display: grid; grid-template-columns: 140px 1fr; gap: 32px; transition: background 0.2s ease; }
  .event:hover { background: var(--hover-tint); }
  .event-meta-col { display: flex; flex-direction: column; gap: 6px; }
  .event-date { font-family: var(--mono); font-size: calc(11px * var(--type-scale)); letter-spacing: 0.15em; text-transform: uppercase; color: var(--brass); }
  .event-density-tag { font-family: var(--mono); font-size: calc(9px * var(--type-scale)); letter-spacing: 0.25em; text-transform: uppercase; color: var(--paper-faint); }
  .event-type-tag { font-family: var(--mono); font-size: calc(9px * var(--type-scale)); letter-spacing: 0.15em; text-transform: uppercase; color: var(--paper-dim); margin-top: 4px; }
  .event-body { font-family: var(--body); }
  .event-title { font-family: var(--display); font-size: calc(26px * var(--type-scale)); font-weight: 500; color: var(--paper); line-height: 1.25; margin-bottom: 12px; letter-spacing: 0.005em; }
  .event-desc { font-size: calc(16px * var(--type-scale)); line-height: 1.65; color: var(--paper-soft); }
  .event-location { font-family: var(--mono); font-size: calc(11px * var(--type-scale)); color: var(--paper-dim); letter-spacing: 0.1em; margin-top: 12px; display: flex; align-items: center; gap: 8px; }
  .event-location svg { opacity: 0.6; }
  .event-sources { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); display: flex; gap: 16px; flex-wrap: wrap; }
  .event-source { font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); background: var(--paper); border: 1px solid var(--paper); padding: 9px 16px; margin: 0; cursor: pointer; display: inline-block; text-align: left; text-decoration: none; transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease; }

  .event-source:hover { background: var(--brass); border-color: var(--brass); color: var(--ink); transform: translateY(-1px); }

  .event-source-buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

  .event-source-pending { font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.1em; text-transform: uppercase; color: var(--paper-faint); font-style: italic; border-bottom: 1px dashed var(--rule-strong); padding-bottom: 2px; }
  .event-source:hover { color: var(--brass); border-color: var(--brass); }
  .event-source.pending { color: var(--paper-faint); border-bottom-style: dashed; font-style: italic; }
  .event-source-label { font-family: var(--mono); font-size: calc(9px * var(--type-scale)); letter-spacing: 0.3em; text-transform: uppercase; color: var(--paper-faint); margin-right: 16px; align-self: center; }
  .event.disputed { border-left: 2px solid var(--crimson); padding-left: 20px; margin-left: -22px; }
  .event-framings { margin-top: 16px; padding: 14px 18px; background: var(--ink-2); border-left: 2px solid var(--brass-deep); font-size: calc(14px * var(--type-scale)); color: var(--paper-soft); line-height: 1.55; font-style: italic; }
  .event-framings-label { font-family: var(--mono); font-size: calc(9px * var(--type-scale)); letter-spacing: 0.3em; text-transform: uppercase; color: var(--brass); font-style: normal; margin-bottom: 6px; display: block; }

  .events-sidebar { position: sticky; top: 100px; align-self: start; height: fit-content; }
  .sidebar-block { margin-bottom: 40px; padding-bottom: 32px; border-bottom: 1px solid var(--rule); }
  .sidebar-block:last-child { border-bottom: none; }
  .sidebar-label { font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.3em; text-transform: uppercase; color: var(--brass); margin-bottom: 16px; }
  .stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .stat { padding: 12px 0; }
  .stat-num { font-family: var(--display); font-size: calc(32px * var(--type-scale)); font-weight: 500; color: var(--paper); line-height: 1; }
  .stat-label { font-family: var(--mono); font-size: calc(9px * var(--type-scale)); letter-spacing: 0.25em; text-transform: uppercase; color: var(--paper-dim); margin-top: 6px; }

  .framings-section { background: var(--ink-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 80px 60px; }
  .framings-inner { max-width: 1400px; margin: 0 auto; }
  .framings-intro { max-width: 760px; font-size: calc(16px * var(--type-scale)); line-height: 1.65; color: var(--paper-soft); font-style: italic; margin-bottom: 32px; }
  .framings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); margin-top: 40px; }
  .framing { background: var(--ink); padding: 32px; }
  .framing-name { font-family: var(--display); font-size: calc(22px * var(--type-scale)); font-weight: 500; color: var(--brass); margin-bottom: 16px; letter-spacing: 0.01em; }
  .framing-need { font-family: var(--body); font-size: calc(13px * var(--type-scale)); line-height: 1.6; color: var(--paper-soft); font-style: italic; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--rule); }
  .framing-erases-label { font-family: var(--mono); font-size: calc(9px * var(--type-scale)); letter-spacing: 0.3em; text-transform: uppercase; color: var(--crimson); margin-bottom: 8px; }
  .framing-erases { font-size: calc(13px * var(--type-scale)); line-height: 1.55; color: var(--paper-dim); }

  .framings-pending {
    background: var(--ink); padding: 48px; border: 1px solid var(--rule);
    text-align: center;
  }
  .framings-pending-text {
    font-family: var(--body); font-style: italic;
    color: var(--paper-soft); font-size: calc(15px * var(--type-scale));
    line-height: 1.6; max-width: 520px; margin: 0 auto;
  }
  .framings-pending-label {
    font-family: var(--mono); font-size: calc(10px * var(--type-scale));
    letter-spacing: 0.3em; text-transform: uppercase;
    color: var(--brass); margin-bottom: 14px;
  }

  .record-footer { padding: 64px 60px 80px; max-width: 1400px; margin: 0 auto; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; }
  .footer-stewardship { max-width: 520px; }
  .footer-stewardship-title { font-family: var(--display); font-size: calc(20px * var(--type-scale)); color: var(--paper); margin-bottom: 12px; }
  .footer-stewardship-body { font-size: calc(14px * var(--type-scale)); line-height: 1.6; color: var(--paper-soft); }
  .footer-meta { font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.2em; text-transform: uppercase; color: var(--paper-dim); text-align: right; line-height: 2; }
  .footer-meta strong { color: var(--brass); }

  @media (max-width: 980px) {
    .pillars { grid-template-columns: 1fr; gap: 32px; }
    .events-section { grid-template-columns: 1fr; }
    .events-sidebar { position: static; }
    .event { grid-template-columns: 1fr; gap: 12px; }
    .subject-hero, .spine-section, .events-section, .framings-section, .record-footer { padding-left: 32px; padding-right: 32px; }
    .record-topbar { padding: 16px 24px; }
    .toolbar { top: 12px; right: 12px; }
    .scaffolded-banner { padding: 12px 24px; }
  }

/* ============================================================

   Deep-link mode: bypass splash for /chronicle.nw/<subject>.nw

   Stages and directory are removed from rendering entirely so

   they cannot stack above #record. JS removes the skip-splash

   class once enterSubject completes, restoring normal nav.

   ============================================================ */

html.skip-splash .stage { display: none !important; }

html.skip-splash .toolbar.visible { display: flex !important; }

/* ============================================================

   UNE SURFACING — chronicle citation handle visible in three places:

   - directory cards (between name and dates)

   - record hero (between H1 name and dates)

   - record topbar (third segment after Directory | Chronicle)

   ============================================================ */

/* Directory card UNE — small mono brass, between name and dates */

.subject-une {

  font-family: var(--mono);

  font-size: calc(11px * var(--type-scale));

  color: var(--brass);

  letter-spacing: 0.15em;

  margin-top: -4px;

  margin-bottom: 12px;

  text-transform: lowercase;

}

/* Record hero UNE — sits directly under the H1 name */

.hero-une {

  font-family: var(--mono);

  font-size: calc(14px * var(--type-scale));

  font-weight: 400;

  color: var(--brass);

  letter-spacing: 0.18em;

  text-transform: lowercase;

  margin: -12px 0 28px 0;

  padding: 0;

}

/* Directory-page topbar — matches record-topbar visual shape (left brand, right controls) */

.directory-topbar {

  position: sticky; top: 0;

  background: color-mix(in srgb, var(--ink) 92%, transparent);

  backdrop-filter: blur(8px);

  border-bottom: 1px solid var(--rule);

  padding: 18px 60px;

  display: flex;

  justify-content: space-between;

  align-items: center;

  z-index: 1101;

  gap: 24px;

  flex-wrap: wrap;

}

/* Inline toolbar — sits inside topbar-right; remove the floating positioning */

.inline-toolbar {

  position: static;

  display: flex;

  background: transparent;

  border: none;

  padding: 0;

  gap: 8px;

}

/* Override floating .toolbar absolute positioning when inline */

.directory-topbar .toolbar,

.record-topbar .toolbar.inline-toolbar {

  position: static;

  top: auto;

  right: auto;

}

/* Record topbar UNE — third pipe-separated segment, mono brass, matches topbar-brand sizing */

#topbarUne.topbar-une {

  font-family: var(--mono);

  font-size: calc(13px * var(--type-scale));

  letter-spacing: 0.22em;

  color: var(--brass);

  text-transform: lowercase;

  padding-left: 24px;

  border-left: 1px solid var(--rule);

  align-self: center;

}

/* Inline toolbar in record-topbar — align with left-side labels */

.record-topbar .inline-toolbar {

  position: static;

  background: transparent;

  border: none;

  padding: 0;

  display: flex;

  align-items: center;

  gap: 0;

}

.record-topbar .inline-toolbar .toolbar-group {

  display: flex;

  gap: 2px;

  padding-right: 12px;

  margin-right: 12px;

  border-right: 1px solid var(--rule);

  align-items: center;

}

.record-topbar .inline-toolbar .toolbar-group:last-child {

  border-right: none;

  padding-right: 0;

  margin-right: 0;

}

/* ============================================================

   Floating Back-to-Top button

   Appears bottom-right after the user scrolls past 400px.

   Fades in/out via .visible class toggled by JS scroll handler.

   ============================================================ */

.back-to-top {

  position: fixed;

  bottom: 32px;

  right: 32px;

  width: 44px;

  height: 44px;

  border-radius: 50%;

  background: var(--ink);

  color: var(--brass);

  border: 1px solid var(--brass-deep);

  cursor: pointer;

  display: flex;

  align-items: center;

  justify-content: center;

  opacity: 0;

  visibility: hidden;

  transform: translateY(8px);

  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.2s ease, color 0.2s ease;

  z-index: 50;

  box-shadow: 0 4px 12px rgba(0,0,0,0.18);

}

.back-to-top.visible {

  opacity: 1;

  visibility: visible;

  transform: translateY(0);

}

.back-to-top:hover {

  background: var(--brass-faint);

  color: var(--paper);

  border-color: var(--brass);

}

@media (max-width: 720px) {

  .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }

}

/* Source Viewer Panel — corrected sizing */

/* Centered header nav — Start / About, plain text links */

.topbar-center {

  position: absolute; left: 50%; transform: translateX(-50%);

  display: flex; gap: 28px; align-items: center;

}

.topbar-nav-link {

  font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.2em;

  text-transform: uppercase; color: var(--paper-dim);

  background: none; border: none; padding: 0; cursor: pointer;

  text-decoration: none; transition: color 0.18s ease;

}

.topbar-nav-link:hover { color: var(--brass); }

/* ============ PER-SUBJECT RECORD VEIL ============ */

/* Cinematic landing shown when arriving fresh at a subject (bare UNE).

   Lifted by "Enter the Record". Data-driven from window.SUBJECTS. */

.record-veil {

  position: fixed;

  inset: 0;

  z-index: 900;

  display: flex;

  align-items: center;

  justify-content: center;

  background: var(--ink);

  opacity: 0;

  visibility: hidden;

  transition: opacity 0.6s ease, visibility 0s linear 0.6s;

}

.record-veil.visible {

  opacity: 1;

  visibility: visible;

  transition: opacity 0.6s ease;

}

.record-veil .veil-inner {

  text-align: center;

  max-width: 760px;

  padding: 0 40px;

  transform: translateY(12px);

  transition: transform 0.7s ease;

}

.record-veil.visible .veil-inner { transform: translateY(0); }

.record-veil .veil-mark {

  font-family: var(--mono);

  font-size: calc(11px * var(--type-scale));

  letter-spacing: 0.28em;

  text-transform: uppercase;

  color: var(--brass);

  margin-bottom: 34px;

}

.record-veil .veil-name {

  font-family: var(--display);

  font-weight: 400;

  font-size: clamp(46px, 8vw, 92px);

  line-height: 1.02;

  color: var(--paper);

  margin: 0;

}

.record-veil .veil-name .surname { font-style: italic; }

.record-veil .veil-rule {

  width: 60px;

  height: 1px;

  background: var(--brass);

  margin: 34px auto;

  opacity: 0.6;

}

.record-veil .veil-dates {

  font-family: var(--display);

  font-size: clamp(20px, 3vw, 30px);

  color: var(--paper-soft);

  letter-spacing: 0.04em;

}

.record-veil .veil-dates .dash { color: var(--brass); margin: 0 14px; }

.record-veil .veil-meta {

  font-family: var(--mono);

  font-size: calc(11px * var(--type-scale));

  letter-spacing: 0.2em;

  text-transform: uppercase;

  color: var(--paper-dim);

  margin-top: 22px;

}

.record-veil .veil-enter {

  margin-top: 52px;

  font-family: var(--mono);

  font-size: calc(12px * var(--type-scale));

  letter-spacing: 0.22em;

  text-transform: uppercase;

  color: var(--ink);

  background: var(--brass);

  border: none;

  padding: 16px 38px;

  cursor: pointer;

  transition: background 0.2s ease, transform 0.2s ease;

}

.record-veil .veil-enter:hover {

  background: var(--paper);

  transform: translateY(-1px);

}

/* ============ DIRECTORY v2 — single header, meta strip, control bar, grid/list ============ */

/* Directory header: chrome row (brand + Start/About + reading controls). One header for this surface. */

#directory .directory-header,

#directory .dir-meta-strip,

#directory .dir-intro,

#directory .dir-controls,

#directory .dir-section,

#directory .dir-empty { padding-left: 60px; padding-right: 60px; }

.directory-header {

  display: flex; align-items: center; justify-content: space-between;

  gap: 24px; padding-top: 26px; padding-bottom: 22px;

  border-bottom: 1px solid var(--rule); flex-wrap: wrap;

  z-index: 50;

  background: color-mix(in srgb, var(--ink) 92%, transparent);

  backdrop-filter: blur(8px);

}

/* Fixed only while directory is the active stage — cannot leak onto splash covers. */

#directory.active .directory-header { position: fixed; top: 0; left: 0; right: 0; }

.directory-header .dir-head-left { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }

.directory-header .dir-brand-name { font-family: var(--display); font-size: calc(26px * var(--type-scale)); font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper); }

.directory-header .dir-brand-tag { font-family: var(--body); font-style: italic; color: var(--paper-dim); font-size: calc(14px * var(--type-scale)); white-space: nowrap; }

.directory-header .dir-head-center { display: flex; gap: 28px; }

.directory-header .dir-head-right { display: flex; align-items: center; }

/* Meta strip */

.dir-meta-strip { display: flex; gap: 32px; align-items: center; padding-top: 22px; padding-bottom: 4px; font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.2em; text-transform: uppercase; color: var(--paper-dim); flex-wrap: wrap; }

.dir-meta-strip strong { color: var(--brass); font-weight: 500; }

/* Control bar */

.dir-controls {

  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;

  padding-top: 24px; padding-bottom: 28px; margin-bottom: 8px;

}

.dir-search-wrap { flex: 1 1 280px; min-width: 220px; }

.dir-search {

  width: 100%; background: transparent; border: none; border-bottom: 1px solid var(--rule);

  padding: 10px 2px; font-family: var(--body); font-size: calc(16px * var(--type-scale));

  color: var(--paper); outline: none; transition: border-color 0.2s ease;

}

.dir-search:focus { border-bottom-color: var(--brass); }

.dir-search::placeholder { color: var(--paper-dim); font-style: italic; }

.dir-filter-group, .dir-view-toggle { display: flex; gap: 0; border: 1px solid var(--rule); }

.dir-filter, .dir-view {

  background: transparent; border: none; cursor: pointer;

  font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.16em; text-transform: uppercase;

  color: var(--paper-dim); padding: 9px 14px; transition: background 0.18s ease, color 0.18s ease;

  border-right: 1px solid var(--rule);

}

.dir-filter:last-child, .dir-view:last-child { border-right: none; }

.dir-filter:hover, .dir-view:hover { color: var(--paper); }

.dir-filter.active, .dir-view.active { background: var(--brass); color: var(--ink); }

/* Sections + load more */

.dir-section { margin-top: 40px; }

.dir-section + .dir-section { margin-top: 56px; }

.dir-load-more {

  margin-top: 28px; background: transparent; border: 1px solid var(--rule);

  color: var(--paper-soft); font-family: var(--mono); font-size: calc(11px * var(--type-scale)); letter-spacing: 0.18em;

  text-transform: uppercase; padding: 12px 28px; cursor: pointer; transition: all 0.18s ease;

}

.dir-load-more:hover { border-color: var(--brass); color: var(--brass); }

.dir-empty { padding-top: 48px; font-family: var(--body); font-style: italic; color: var(--paper-dim); font-size: calc(16px * var(--type-scale)); }

/* LIST VIEW — two-line rows (toggled by .is-list on the grid) */

.subjects-grid.is-list { display: block; }

.subjects-grid.is-list .subject-card {

  display: block; width: auto; border: none; border-bottom: 1px solid var(--rule);

  padding: 18px 4px; margin: 0; cursor: pointer; transition: background 0.15s ease;

}

.subjects-grid.is-list .subject-card:hover { background: var(--ink-2, rgba(255,255,255,0.02)); }

.subjects-grid.is-list .sc-line1 { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }

.subjects-grid.is-list .sc-name { font-family: var(--display); font-size: calc(22px * var(--type-scale)); color: var(--paper); }

.subjects-grid.is-list .sc-une { font-family: var(--mono); font-size: calc(11px * var(--type-scale)); letter-spacing: 0.12em; color: var(--brass); }

.subjects-grid.is-list .sc-dates { font-family: var(--mono); font-size: calc(11px * var(--type-scale)); color: var(--paper-soft); letter-spacing: 0.08em; }

.subjects-grid.is-list .sc-status { font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-dim); }

.subjects-grid.is-list .sc-events { font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-dim); }

.subjects-grid.is-list .sc-line2 { margin-top: 8px; font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper-dim); display: flex; gap: 24px; flex-wrap: wrap; }

.subjects-grid.is-list .subject-card .sc-grid-only { display: none; }

/* Hide list-only markup when in grid view */

.subjects-grid:not(.is-list) .sc-list-only { display: none; }

/* Directory colophon — closing seal on the record. Mirrors source-viewer seal language. Authored vincent.nw. */

.chronicle-colophon {

  margin-top: 96px; padding-top: 40px;

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

  text-align: center;

}

.chronicle-colophon-creed {

  font-family: var(--display); font-style: italic;

  font-size: calc(18px * var(--type-scale));

  color: var(--paper-soft); letter-spacing: 0.02em;

  margin-bottom: 20px;

}

.chronicle-colophon-rule {

  width: 48px; height: 1px; background: var(--brass);

  margin: 0 auto 20px; opacity: 0.6;

}

.chronicle-colophon-seal {

  font-family: var(--mono); font-size: calc(10px * var(--type-scale));

  letter-spacing: 0.22em; text-transform: uppercase;

  color: var(--paper-dim);

}

.chronicle-colophon-seal .cc-steward { color: var(--brass); }

.chronicle-colophon-seal .cc-dot { color: var(--rule-strong); margin: 0 10px; }

/* Co-subject events: shared events surfacing on a secondary record's timeline (SSOT — one event, multiple records). Authored vincent.nw. */

.event-cosubject-tag { font-family: var(--mono); font-size: calc(9px * var(--type-scale)); letter-spacing: 0.25em; text-transform: uppercase; color: var(--brass); }

.event-surface { font-family: var(--body); font-style: italic; color: var(--paper-dim); font-size: calc(13px * var(--type-scale)); line-height: 1.5; margin: 2px 0 10px; }

/* Framings: NGI's stewarded note on contested or multi-perspective events. Authored vincent.nw. */

.event-framings { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); }

.event-framings-label { font-family: var(--mono); font-size: calc(10px * var(--type-scale)); letter-spacing: 0.25em; text-transform: uppercase; color: var(--brass); display: block; margin-bottom: 6px; }

.event-framings-body { font-family: var(--body); font-size: calc(13px * var(--type-scale)); line-height: 1.6; color: var(--paper-soft); }

.hero-portrait{float:right;width:300px;max-width:38%;height:auto;margin:0 0 24px 40px;border-radius:2px;filter:grayscale(8%);box-shadow:0 2px 24px rgba(0,0,0,0.18)}

.subject-hero::after{content:"";display:block;clear:both}

@media(max-width:720px){.hero-portrait{float:none;width:60%;margin:0 0 24px 0;display:block}}

.hero-gallery{float:right;width:340px;max-width:40%;margin:0 0 24px 44px}

.hero-gallery .hero-portrait{float:none;width:100%;max-width:100%;margin:0;display:block}

.hero-gallery-nav{display:flex;align-items:center;justify-content:center;gap:18px;margin-top:12px}

.hg-arrow{background:none;border:1px solid var(--rule);color:var(--ink,inherit);width:34px;height:34px;border-radius:50%;font-size:18px;line-height:1;cursor:pointer;transition:background .15s,border-color .15s}

.hg-arrow:hover{border-color:var(--brass,#9a7b3f);background:rgba(154,123,63,0.08)}

.hg-counter{font-family:var(--mono);font-size:11px;letter-spacing:0.15em;color:var(--paper-dim,#8a857a)}

.hero-gallery-cap{margin-top:10px;text-align:center}

.hg-caption{display:block;font-family:var(--body);font-size:12.5px;line-height:1.5;color:var(--paper-soft,#6b6457)}

.hg-credit{display:block;margin-top:4px;font-family:var(--mono);font-size:10px;letter-spacing:0.08em;color:var(--paper-dim,#8a857a)}

@media(max-width:720px){.hero-gallery{float:none;width:70%;margin:0 0 24px 0}}

/* ===== WITNESS - The Visual Record ===== */
#witness { padding: 0; }
.witness-body { max-width:1400px; margin:0 auto; padding:32px 60px 120px; }
.witness-placeholder { font-family:var(--body); font-style:italic; color:var(--paper-dim); padding:40px 0; }

.wt-toolbar { display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin-bottom:8px; }
.wt-search { flex:1 1 220px; min-width:180px; background:transparent; border:1px solid var(--rule); color:var(--ink); font-family:var(--body); font-size:calc(14px * var(--type-scale)); padding:9px 12px; border-radius:2px; }
.wt-search::placeholder { color:var(--paper-dim); font-style:italic; }
.wt-select { background:transparent; border:1px solid var(--rule); color:var(--ink); font-family:var(--mono); font-size:calc(11px * var(--type-scale)); letter-spacing:0.06em; padding:9px 10px; border-radius:2px; cursor:pointer; }
.wt-viewtoggle { display:flex; border:1px solid var(--rule); border-radius:2px; overflow:hidden; }
.wt-vt { background:transparent; border:none; color:var(--paper-dim); font-family:var(--mono); font-size:calc(10px * var(--type-scale)); letter-spacing:0.15em; text-transform:uppercase; padding:9px 14px; cursor:pointer; }
.wt-vt.active { background:var(--brass); color:var(--paper); }
.wt-count { font-family:var(--mono); font-size:calc(10px * var(--type-scale)); letter-spacing:0.2em; text-transform:uppercase; color:var(--paper-dim); margin:14px 0 24px; }

.wt-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:24px; }
.wt-card { margin:0; cursor:pointer; border:1px solid var(--rule); border-radius:2px; overflow:hidden; background:var(--ink); transition:border-color .15s ease, transform .15s ease; }
.wt-card:hover { border-color:var(--brass); transform:translateY(-2px); }
.wt-thumb { aspect-ratio:4/5; overflow:hidden; background:var(--paper-soft); }
.wt-thumb img { width:100%; height:100%; object-fit:cover; display:block; filter:grayscale(6%); }
.wt-meta { padding:12px 14px 14px; display:flex; flex-direction:column; gap:4px; }
.wt-card-title { font-family:var(--display); font-size:calc(16px * var(--type-scale)); color:var(--ink); line-height:1.25; }
.wt-card-sub { font-family:var(--mono); font-size:calc(10px * var(--type-scale)); letter-spacing:0.08em; color:var(--brass-deep); text-transform:uppercase; }
.wt-card-credit { font-family:var(--body); font-size:calc(11px * var(--type-scale)); color:var(--paper-dim); line-height:1.4; margin-top:2px; }

.wt-list { display:flex; flex-direction:column; }
.wt-row { display:grid; grid-template-columns:56px 2fr 1.4fr 60px 2fr; gap:18px; align-items:center; padding:10px 0; border-bottom:1px solid var(--rule); cursor:pointer; }
.wt-row:hover { background:var(--hover-tint); }
.wt-row-head { cursor:default; font-family:var(--mono); font-size:calc(9px * var(--type-scale)); letter-spacing:0.2em; text-transform:uppercase; color:var(--paper-dim); }
.wt-row-head:hover { background:transparent; }
.wt-row-thumb { width:56px; height:56px; overflow:hidden; border-radius:2px; background:var(--paper-soft); }
.wt-row-thumb img { width:100%; height:100%; object-fit:cover; display:block; }
.wt-row-title { font-family:var(--display); font-size:calc(15px * var(--type-scale)); color:var(--ink); }
.wt-row-sub { font-family:var(--body); font-size:calc(13px * var(--type-scale)); color:var(--paper-soft); }
.wt-row-date { font-family:var(--mono); font-size:calc(11px * var(--type-scale)); color:var(--paper-dim); }
.wt-row-credit { font-family:var(--body); font-size:calc(11px * var(--type-scale)); color:var(--paper-dim); }

@media (max-width:720px) {
  .witness-body { padding:24px 20px 80px; }
  .wt-grid { grid-template-columns:repeat(auto-fill, minmax(140px, 1fr)); gap:14px; }
  .wt-row { grid-template-columns:44px 1fr; gap:10px; }
  .wt-row-sub, .wt-row-date, .wt-row-credit, .wt-row-head { display:none; }
  .wt-toolbar { gap:8px; }
  .wt-search { flex:1 1 100%; }
}

/* ============================================================

   MOBILE NAV — hamburger + right-side drawer. Desktop unaffected.

   ============================================================ */

.nav-hamburger { display: none; }
/* DESKTOP: drawer wrapper transparent to layout */
.nav-drawer { display: flex; align-items: center; gap: 40px; flex: 1; justify-content: flex-end; }

.nav-scrim { display: none; }

.nav-drawer-close-row { display: none; }

@media (max-width: 820px) {

  /* header becomes: brand left, hamburger right */

  .directory-header { align-items: center; justify-content: space-between; }

  .nav-hamburger {

    display: inline-flex; align-items: center; justify-content: center;

    background: none; border: none; color: var(--paper); cursor: pointer;

    padding: 6px; margin-left: auto;

  }

  .dir-brand-tag { display: none; } /* save space on small screens */

  /* the drawer: off-canvas right, slides in */

  .nav-drawer {

    position: fixed !important; top: 0 !important; right: 0 !important; bottom: 0 !important; left: auto !important;

    width: 300px !important; max-width: 82vw !important; height: 100vh !important; box-sizing: border-box !important;

    background: #14110d !important;

    border-left: 1px solid rgba(190,150,90,0.3);

    transform: translateX(100%);

    transition: transform 0.3s ease;

    z-index: 9999 !important;

    display: flex; flex-direction: column;

    padding: 24px 28px; gap: 28px;

    overflow-y: auto;

  }

  body.nav-open .nav-drawer { transform: translateX(0) !important; }

  .nav-drawer-close-row { display: flex; justify-content: flex-end; }

  .nav-drawer-close {

    background: none; border: none; color: var(--paper-dim); cursor: pointer;

    font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;

  }

  /* nav links stack vertically, large tap targets */

  .nav-drawer .dir-head-center {

    display: flex; flex-direction: column; gap: 4px; align-items: flex-start;

  }

  .nav-drawer .topbar-nav-link {

    display: block; width: 100%; padding: 14px 0;

    font-size: calc(16px * var(--type-scale));

    border-bottom: 1px solid var(--rule);

  }

  /* display controls move into the drawer, laid out for touch */

  .nav-drawer .dir-head-right { display: block; }

  .nav-drawer .inline-toolbar {

    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;

  }

  .nav-drawer .toolbar-group { border-right: none; padding-right: 0; gap: 6px; }

  .nav-drawer .tb-btn {

    min-width: 40px; min-height: 40px; display: inline-flex;

    align-items: center; justify-content: center;

    border: 1px solid var(--rule-strong);

  }

  /* the scrim behind the drawer */

  .nav-scrim {

    position: fixed; inset: 0; background: rgba(6,5,4,0.55);

    z-index: 190; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;

  }

  body.nav-open .nav-scrim { display: block; opacity: 1; pointer-events: auto; }

  body.nav-open { overflow: hidden; }

}

@media (max-width: 820px) {

  /* drawer is dark chrome in BOTH themes — force light text on its dark surface */

  body.nav-open .nav-drawer .topbar-nav-link,

  .nav-drawer .topbar-nav-link { color: #ece5d6; }

  .nav-drawer .topbar-nav-link { border-bottom: 1px solid rgba(236,229,214,0.14); }

  .nav-drawer .nav-drawer-close { color: #b6a98f; }

  .nav-drawer .tb-btn { color: #ece5d6; border: 1px solid rgba(236,229,214,0.25); background: none; }

  .nav-drawer .tb-btn.active { color: #1a1612; background: var(--brass); }

  .nav-drawer .toolbar-group { border-right: none; }

}

@media (max-width: 820px) {
  /* hide density on mobile — phone is always one column */
  .dir-density-toggle { display: none !important; }
}
