:root {
  --paper: #0a0a0b;
  --ink: #f0ebe1;
  --ink-soft: #8c857b;
  --accent: #d33c3c;
  --line: rgba(255, 255, 255, 0.1);
  --shell: max(90vw, 1280px);
  --shadow-deep: 0 50px 100px -20px rgba(0, 0, 0, 0.4), 0 30px 60px -30px rgba(0, 0, 0, 0.6);
}

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

::selection {
  background: var(--accent);
  color: #fff;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  font-family: "Instrument Sans", "Helvetica Neue", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 10001;
  padding: 0.75rem 1rem;
  background: rgba(10, 10, 11, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  transform: translateY(-220%);
  transition: transform 0.25s ease-out, border-color 0.25s ease-out;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.page-grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  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.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.08'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: overlay;
}

img {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(100%) contrast(1.1);
  transition: filter 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-deep);
  transform: translateZ(0);
  /* Hardware acceleration */
}

img:hover {
  filter: grayscale(0%) contrast(1.05);
}

a {
  color: inherit;
  text-decoration: none;
  text-decoration-skip-ink: auto;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

main {
  width: 90vw;
  max-width: 1320px;
  margin: 0 auto;
}

section[id],
h2[id] {
  scroll-margin-top: 5rem;
}

/* --- CINEMATIC HERO --- */
.hero--cinematic {
  position: relative;
  width: 100vw;
  min-height: 100vh;
  margin-left: calc(-50vw + 50%);
  display: flex;
  flex-direction: column;
  color: #fff;
  padding: 0;
  margin-top: 0;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 65%;
  z-index: 1;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 30%, black 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 30%, black 100%);
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  filter: grayscale(100%) contrast(1.1);
  box-shadow: none;
  transform: scale(1.1) translateX(0%);
}

.hero-bg:hover img {
  filter: grayscale(0%) contrast(1.1);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 2;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 10;
  width: 90vw;
  max-width: 1320px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 0 6rem;
}

.hero-masthead {
  position: absolute;
  top: 3rem;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 1.5rem;
  width: 100%;
}

.masthead-label {
  color: var(--accent);
  display: block;
  margin-bottom: 0.2rem;
}

.masthead-note {
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.2;
}

.hero-text {
  max-width: 650px;
  padding-top: 0;
}

.hero-kicker {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 0.4rem 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin-bottom: 2rem;
}

.hero-text h1 {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(2.5rem, 4.5vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  /* Tighter kerning */
  margin: 0 0 2rem 0;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.2);
  max-width: 100%;
  text-wrap: balance;
}

.hero-text h1 span.nobr {
  white-space: nowrap;
}

.hero-text h1 span.sub {
  display: block;
  font-family: "Instrument Sans", sans-serif;
  font-size: clamp(1.1rem, 1.8vw, 1.6rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-transform: none;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 1rem;
}

.hero-lead {
  font-family: "Instrument Sans", sans-serif;
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  max-width: 42ch;
  margin: 0 0 3rem 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  font-weight: 400;
  letter-spacing: -0.01em;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 1.5rem;
}

.hero-lead::first-line {
  color: #fff;
  font-weight: 500;
  letter-spacing: 0;
}

.hero-caption {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 1.5rem;
  max-width: 400px;
}

.hero-caption p {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  line-height: 1.4;
}

/* --- PROLOGUE --- */
.prologue-band {
  max-width: 850px;
  margin: 8rem auto 6rem;
  padding: 0 2rem;
  text-align: center;
}

.prologue-band p {
  font-family: "Instrument Sans", sans-serif;
  font-size: clamp(1.2rem, 2vw, 1.4rem);
  color: var(--ink);
  line-height: 1.8;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* --- QUOTE PANELS --- */
.quote-panel {
  margin: 3rem 0;
  border-left: 2px solid var(--accent);
  padding: 0 0 0 2rem;
}

.quote-panel-label {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.quote-panel blockquote {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.03em;
  /* Tighter kerning */
  margin: 0;
  color: var(--ink);
}

.quote-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 3rem;
}

/* --- STORY BANDS --- */
.story-band {
  padding: 12vh 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 4rem;
  position: relative;
}

/* --- THE TIMELINE SPINE --- */
.timeline-spine {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 216px;
  /* Align with the label */
  width: 1px;
  background: linear-gradient(to bottom,
      transparent 0%,
      rgba(255, 255, 255, 0.15) 10%,
      rgba(255, 255, 255, 0.15) 90%,
      transparent 100%);
  z-index: 0;
}

.story-label {
  position: sticky;
  top: 6rem;
  z-index: 10;
}

.story-label span {
  font-family: "Newsreader", serif;
  font-size: 4rem;
  line-height: 0.8;
  color: var(--accent);
  display: inline-block;
  position: relative;
}

/* The Glowing Node */
.story-label span::before {
  content: "";
  position: absolute;
  top: 50%;
  right: -52px;
  /* Position on the spine */
  transform: translateY(-50%) translateZ(0);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(10, 10, 11, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  z-index: 2;
  transition: background 0.5s ease-out, border-color 0.5s ease-out, box-shadow 0.5s ease-out, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Active node state driven by JS */
.story-band.is-active .story-label span::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent);
  transform: translateY(-50%) scale(1.2);
}

.story-label {
  position: sticky;
  top: 4rem;
}

.story-label span {
  font-family: "Newsreader", serif;
  font-size: 4rem;
  line-height: 0.8;
  color: var(--accent);
  display: block;
}

.story-label p {
  color: var(--ink-soft);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-top: 1rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.story-content {
  max-width: 65ch;
  min-width: 0;
}

.story-band h2 {
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: 1.05;
  font-weight: 500;
  letter-spacing: -0.04em;
  /* Tighter kerning */
  margin: 0 0 2.5rem 0;
  text-wrap: balance;
}

.story-content p {
  font-size: 1.25rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0 0 1.5rem 0;
}

/* Premium Typography Updates */
.story-content p strong {
  color: var(--ink);
  font-weight: 500;
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
  font-family: "Newsreader", serif;
  font-size: 1.05em;
  /* Slight bump for rhythm */
  letter-spacing: -0.01em;
}

.drop-cap {
  float: left;
  font-family: "Newsreader", serif;
  font-size: 5rem;
  line-height: 0.8;
  padding-top: 0.15em;
  padding-right: 0.1em;
  padding-left: 0;
  color: var(--ink);
}

/* Feature grid variations */
.story-band--feature .story-content {
  max-width: none;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
}

.story-content--media-first {
  max-width: none;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
}

/* Right Aligned Image Stack (Section 05) */
.story-aside--stack {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  align-items: flex-end;
}

.story-aside--stack .story-plate {
  width: 85%;
}

/* Scattered / Offset Stack (Section 06) */
.story-aside--scatter {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.story-aside--scatter .story-plate:first-child {
  width: 85%;
  align-self: flex-start;
}

.story-aside--scatter .story-plate:nth-child(2) {
  width: 85%;
  align-self: flex-end;
}

/* Cinematic Images */
.story-plate {
  margin: 0;
  position: relative;
}

.story-plate img {
  border-radius: 0;
  width: 100%;
  transition: filter 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.story-plate:hover img {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset, var(--shadow-deep);
  transform: scale(1.02);
}

.story-plate--fit img {
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: top center;
}

.story-plate figcaption {
  margin-top: 1.25rem;
  font-family: "Instrument Sans", sans-serif;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-soft);
  text-align: center;
  padding: 0 1rem;
}

/* Artifact 3D Tilt */
.story-plate--research img {
  transform: perspective(1000px) rotateY(4deg) scale(1.02);
  box-shadow: -15px 20px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.story-plate--research:hover img {
  transform: perspective(1000px) rotateY(0deg) scale(1);
}

/* Spotlight Mask */
.story-plate--spotlight img {
  -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
  filter: grayscale(100%) contrast(1.2);
  transform: scale(1.05);
  /* Account for mask clipping */
}

/* Glassmorphic Breakout Panel */
.glass-panel {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4rem 2rem;
  margin: 2rem calc(-50vw + 50%);
  width: 100vw;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 20px 40px rgba(0, 0, 0, 0.4);
}

.glass-panel .quote-row {
  max-width: 1320px;
  width: 90vw;
  margin: 0 auto;
}

.glass-panel .quote-panel {
  border-left: none;
  padding: 0;
  margin: 0;
}

.glass-panel blockquote {
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 0 40px rgba(211, 60, 60, 0.15);
}

.story-link {
  color: var(--ink);
  border-bottom: 1px solid var(--accent);
  transition: color 0.3s ease-out, border-color 0.3s ease-out;
}

.story-link:hover {
  color: var(--accent);
}

/* --- FULL BLEED IMAGES --- */
.full-bleed {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  padding: 0;
}

.full-bleed-media img {
  width: 100%;
  height: 90vh;
  object-fit: cover;
  border-radius: 0;
}

.full-bleed--narrow .full-bleed-media img {
  height: 60vh;
}

/* --- CLOSING --- */
.story-band--ending {
  padding-bottom: 25vh;
  border-bottom: none;
  /* Removed line for cleaner finish */
  text-align: center;
}

.story-band--ending .story-content {
  margin: 0 auto;
  max-width: 800px;
}

.quote-panel--monument {
  border-left: none;
  padding: 0;
  margin: 4rem 0;
}

.quote-panel--monument blockquote {
  font-size: clamp(2.5rem, 6vw, 6rem);
  margin-bottom: 3rem;
  line-height: 1;
  background: linear-gradient(to bottom, #fff 20%, rgba(255, 255, 255, 0.3) 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

.closing-author {
  margin-top: 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.author-avatar-wrapper {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  transform: translateZ(0);
  /* Hardware acceleration */
}

.author-avatar-wrapper:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.author-avatar-wrapper:hover .author-avatar {
  /* Ensure the global img hover triggers correctly when hovering the wrapper */
  filter: grayscale(0%) contrast(1.05);
  transform: scale(1.15) translateZ(0);
}

.author-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.15) translateZ(0);
  /* 115% inner zoom */
  border-radius: 50%;
  transition: filter 0.5s ease-out, transform 0.5s ease-out;
}

.author-details {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.closing-signature-link {
  color: var(--accent);
  font-size: 1.8rem;
  font-family: "Newsreader", serif;
  font-style: italic;
  font-weight: 400;
  text-shadow: 0 0 20px rgba(211, 60, 60, 0.3);
  /* Softer neon */
  text-decoration: none;
  transition: opacity 0.3s ease-out, text-shadow 0.3s ease-out;
}

.closing-signature-link:hover {
  opacity: 0.8;
}

.closing-date {
  font-family: "Instrument Sans", sans-serif;
  font-size: 0.85rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.full-text-link-wrapper {
  margin-top: 4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 3rem;
  margin-bottom: -2rem;
}

.full-text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  transition: background 0.3s ease-out, border-color 0.3s ease-out, color 0.3s ease-out, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease-out;
  padding: 1rem 1.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  backdrop-filter: blur(10px);
}

.full-text-link svg {
  transition: transform 0.3s ease;
}

.full-text-link:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.full-text-link:hover svg {
  transform: translateX(4px);
}

/* --- ANIMATIONS --- */
.reveal {
  opacity: 0;
  transform: translateY(40px) translateZ(0);
  /* HW acceleration */
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .hero-bg {
    width: 100%;
    -webkit-mask-image: linear-gradient(to top, transparent 0%, black 40%, black 100%);
    mask-image: linear-gradient(to top, transparent 0%, black 40%, black 100%);
  }

  .hero-bg img {
    transform: none;
    object-position: center 15%;
  }

  .hero-scrim {
    background: linear-gradient(to bottom, rgba(10, 10, 11, 0) 0%, rgba(10, 10, 11, 0.4) 50%, rgba(10, 10, 11, 1) 100%);
  }

  .hero-content {
    justify-content: flex-end;
    padding: 0 0 3rem 0;
  }

  .hero-masthead {
    position: relative;
    top: 0;
    margin-bottom: auto;
    padding-top: 1.5rem;
    flex-direction: column;
    gap: 1rem;
  }

  .desktop-only {
    display: none;
  }

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

  .hero-kicker {
    margin-bottom: 1rem;
  }

  .hero-text h1 {
    font-size: clamp(2rem, 8vw, 4.5rem);
    margin-bottom: 1rem;
  }

  .hero-lead {
    margin-bottom: 1.5rem;
  }

  .story-band {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 8vh 0;
  }

  .story-label {
    /* Reset label to horizontal flow on mobile */
    position: relative;
    top: 0;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid var(--line);
  }

  /* Remove glowing node bubble and timeline on mobile */
  .timeline-spine {
    display: none;
  }

  .story-label span::before {
    display: none;
  }

  .story-label p {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
  }

  .story-band--feature .story-content,
  .story-content--media-first {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .story-aside--stack,
  .story-aside--scatter {
    align-items: center;
  }

  .story-aside--stack .story-plate,
  .story-aside--scatter .story-plate {
    width: 100% !important;
    margin-bottom: 3rem !important;
    margin-top: 0 !important;
  }
}

@media (max-width: 640px) {
  html {
    font-size: 14px;
  }

  .hero-text h1 {
    font-size: clamp(1.5rem, 8.5vw, 3rem);
  }

  .hero-text {
    padding-top: 0;
  }

  .hero-masthead {
    flex-direction: column;
    align-items: flex-start;
  }

  .quote-row {
    grid-template-columns: 1fr;
  }

  .full-bleed-media img,
  .full-bleed--narrow .full-bleed-media img {
    height: 50vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}