@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Noto+Serif+SC:wght@500;600;700;900&display=swap");

:root {
  --ink: #1d1d18;
  --muted: #77756d;
  --paper: #f3f0e8;
  --paper-deep: #e8e3d8;
  --signal: #e75b32;
  --night: #171713;
  --line: rgba(29, 29, 24, 0.16);
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: "DM Sans", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
  color: var(--ink);
}

body {
  margin: 0;
  font-family: var(--sans);
  background:
    linear-gradient(rgba(29, 29, 24, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 34px;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  color: inherit;
}

a {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

button {
  font: inherit;
}

.reading-progress {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.reading-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left center;
}

.site-header {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 82px;
  padding: 0 4.5vw;
  color: white;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.wordmark {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: white;
  font-size: 0.79rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-decoration: none;
}

.wordmark i {
  width: 22px;
  height: 1px;
  background: var(--signal);
}

.header-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.toc-button {
  justify-self: end;
  display: grid;
  grid-template-columns: auto 24px;
  align-items: center;
  gap: 0.25rem 1rem;
  padding: 0;
  color: white;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.toc-button span {
  grid-row: 1 / 3;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
}

.toc-button i {
  display: block;
  width: 24px;
  height: 1px;
  background: currentColor;
  transition: transform 180ms ease;
}

.toc-button:hover i:first-of-type {
  transform: translateX(5px);
}

.hero {
  position: relative;
  min-height: min(900px, 100svh);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 138px 4.5vw 8vh;
  color: white;
  background: var(--night);
  isolation: isolate;
}

.hero-image {
  position: absolute;
  z-index: -3;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  scale: 1.035;
  animation: hero-settle 1.5s cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.hero-wash {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 13, 11, 0.9) 0%, rgba(12, 13, 11, 0.64) 42%, rgba(12, 13, 11, 0.14) 73%),
    linear-gradient(0deg, rgba(12, 13, 11, 0.78) 0%, transparent 48%);
}

.hero-grain {
  position: absolute;
  z-index: -1;
  inset: 0;
  opacity: 0.16;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.hero-content {
  width: min(680px, 62vw);
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: clamp(1.4rem, 3vh, 2.5rem);
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(0.65rem, 0.75vw, 0.75rem);
  letter-spacing: 0.18em;
  animation: rise-in 700ms 120ms both;
}

.hero-kicker span:first-child {
  color: #ff7651;
  font-weight: 600;
}

.hero h1 {
  max-width: 680px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.2rem, 5.75vw, 5.8rem);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.055em;
  text-wrap: balance;
  animation: rise-in 850ms 200ms both;
}

.hero h1 small {
  display: block;
  margin-top: 0.28em;
  font-family: var(--sans);
  font-size: 0.14em;
  font-weight: 500;
  letter-spacing: 0.32em;
}

.hero-deck {
  max-width: 570px;
  margin: 1.6rem 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--serif);
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  line-height: 1.75;
  animation: rise-in 850ms 280ms both;
}

.hero-byline {
  display: flex;
  gap: clamp(1.5rem, 4vw, 4.5rem);
  align-items: flex-end;
  margin-top: clamp(2.4rem, 5vh, 4.5rem);
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  animation: rise-in 850ms 360ms both;
}

.hero-byline div,
.hero-byline a {
  display: grid;
  gap: 0.3rem;
  text-decoration: none;
}

.hero-byline a {
  margin-left: auto;
  text-align: right;
}

.hero-byline span {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-byline strong {
  font-size: 0.83rem;
  font-weight: 500;
}

.scroll-cue {
  position: absolute;
  right: 4.5vw;
  bottom: 8vh;
  display: flex;
  gap: 1rem;
  align-items: center;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-decoration: none;
  writing-mode: vertical-rl;
}

.scroll-cue i {
  width: 1px;
  height: 52px;
  background: linear-gradient(white 50%, rgba(255, 255, 255, 0.2) 50%);
  background-size: 100% 200%;
  animation: scroll-line 1.8s ease-in-out infinite;
}

.brief {
  display: grid;
  grid-template-columns: minmax(50px, 0.45fr) minmax(400px, 1.6fr) minmax(280px, 1fr);
  gap: clamp(2rem, 5vw, 6rem);
  padding: clamp(5rem, 10vw, 10rem) 7vw;
  border-bottom: 1px solid var(--line);
}

.brief-number,
.chapter-index {
  color: var(--signal);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
}

.section-label {
  margin-bottom: 1.5rem;
  color: var(--signal);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.standfirst {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.55rem, 2.45vw, 2.5rem);
  font-weight: 600;
  line-height: 1.62;
  letter-spacing: -0.025em;
}

.brief blockquote {
  align-self: end;
  margin: 0;
  padding-top: 1.2rem;
  border-top: 1px solid var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.02rem, 1.3vw, 1.3rem);
  line-height: 1.85;
}

.brief cite {
  display: block;
  margin-top: 1.4rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-style: normal;
  letter-spacing: 0.1em;
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(90px, 13vw) minmax(0, 1fr);
  max-width: 1380px;
  margin: 0 auto;
}

.reader-rail {
  border-right: 1px solid var(--line);
}

.rail-sticky {
  position: sticky;
  top: 3rem;
  display: grid;
  justify-content: center;
  padding-top: 5rem;
  text-align: center;
}

.rail-current {
  color: var(--signal);
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 700;
}

.rail-rule {
  justify-self: center;
  width: 1px;
  height: 68px;
  margin: 0.8rem 0;
  background: var(--line);
}

.rail-total,
.rail-sticky p {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
}

.rail-sticky p {
  margin: 0.7rem 0 0;
  writing-mode: vertical-rl;
  justify-self: center;
}

.transcript {
  width: min(100%, 940px);
  padding: clamp(5rem, 8vw, 9rem) clamp(2rem, 7vw, 7rem) 9rem;
}

.chapter {
  padding: clamp(5rem, 9vw, 8.5rem) 0;
  border-bottom: 1px solid var(--line);
  opacity: 0.15;
  transform: translateY(24px);
  transition: opacity 650ms ease, transform 650ms cubic-bezier(0.2, 0.75, 0.25, 1);
  scroll-margin-top: 2rem;
}

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

.chapter-header {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 1.5rem;
  margin-bottom: clamp(3.2rem, 6vw, 5.5rem);
}

.chapter-header time {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
}

.chapter-header h2 {
  max-width: 760px;
  margin: 0.65rem 0 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 3.8vw, 3.65rem);
  line-height: 1.32;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.chapter-copy {
  max-width: 790px;
  margin-left: 78px;
}

.chapter-copy > p:not(.dialogue) {
  font-family: var(--serif);
  font-size: 1.08rem;
  line-height: 2.05;
}

.dialogue {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 1.6rem;
  margin: 0 0 1.8rem;
  font-family: var(--serif);
  font-size: clamp(1.02rem, 1.25vw, 1.12rem);
  line-height: 2.05;
}

.speaker {
  padding-top: 0.42em;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
}

.dialogue-guest .speaker {
  color: var(--signal);
}

.dialogue-host .speaker {
  color: var(--muted);
}

.utterance > p {
  margin: 0;
}

.utterance > p + p {
  margin-top: 0.9em;
}

.utterance strong {
  font-weight: 700;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  min-height: 330px;
  padding: 6rem 7vw;
  color: white;
  background: var(--night);
}

.page-footer div {
  display: grid;
  gap: 1.4rem;
}

.page-footer span {
  color: var(--signal);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
}

.page-footer strong {
  max-width: 650px;
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.back-to-top {
  padding: 0.8rem 0;
  color: white;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.toc-panel {
  position: fixed;
  z-index: 80;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(580px, 92vw);
  padding: 2rem 3rem 4rem;
  color: white;
  background: #20201b;
  overflow-y: auto;
  transform: translateX(102%);
  transition: transform 420ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.toc-scrim {
  position: fixed;
  z-index: 70;
  inset: 0;
  background: rgba(12, 12, 10, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
  backdrop-filter: blur(5px);
}

.menu-open {
  overflow: hidden;
}

.menu-open .toc-panel {
  transform: none;
}

.menu-open .toc-scrim {
  opacity: 1;
  pointer-events: auto;
}

.toc-close {
  display: block;
  margin-left: auto;
  padding: 0.5rem 0;
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.toc-heading {
  display: flex;
  justify-content: space-between;
  margin: 4rem 0 2rem;
  padding-bottom: 1.3rem;
  color: var(--signal);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.25);
}

.toc-heading strong {
  color: rgba(255, 255, 255, 0.5);
  font-weight: 400;
}

.toc-link {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1rem 0;
  color: rgba(255, 255, 255, 0.52);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition: color 160ms ease, transform 160ms ease;
}

.toc-link:hover,
.toc-link.is-active {
  color: white;
  transform: translateX(5px);
}

.toc-link span,
.toc-link time {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.toc-link.is-active span {
  color: var(--signal);
}

.toc-link strong {
  font-family: var(--serif);
  font-size: 0.92rem;
  font-weight: 500;
}

@keyframes hero-settle {
  from { opacity: 0; scale: 1.11; }
  to { opacity: 1; scale: 1.035; }
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes scroll-line {
  0% { background-position: 0 100%; }
  100% { background-position: 0 -100%; }
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .header-meta {
    display: none;
  }

  .hero {
    min-height: 820px;
    padding-bottom: 5rem;
  }

  .hero-content {
    width: min(680px, calc(100% - 2rem));
  }

  .hero-wash {
    background:
      linear-gradient(90deg, rgba(12, 13, 11, 0.83), rgba(12, 13, 11, 0.2)),
      linear-gradient(0deg, rgba(12, 13, 11, 0.94) 0%, rgba(12, 13, 11, 0.35) 70%);
  }

  .brief {
    grid-template-columns: 42px 1fr;
  }

  .brief blockquote {
    grid-column: 2;
    margin-top: 2rem;
  }

  .reader-layout {
    grid-template-columns: 76px minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .site-header {
    height: 66px;
    padding: 0 1.25rem;
  }

  .wordmark span:last-child,
  .toc-button span {
    display: none;
  }

  .hero {
    min-height: 760px;
    padding: 116px 1.25rem 3.25rem;
  }

  .hero-image {
    object-position: 36% center;
  }

  .hero h1 {
    font-size: 2.75rem;
  }

  .hero-content {
    width: 100%;
  }

  .hero-kicker {
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
  }

  .hero-kicker span:last-child {
    display: none;
  }

  .hero-byline {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.3rem;
  }

  .hero-byline a {
    grid-column: 1 / 3;
    margin: 0;
    text-align: left;
  }

  .scroll-cue {
    display: none;
  }

  .brief {
    display: block;
    padding: 5rem 1.25rem;
  }

  .brief-number {
    margin-bottom: 2rem;
  }

  .standfirst {
    font-size: 1.38rem;
  }

  .brief blockquote {
    margin-top: 3.5rem;
  }

  .reader-layout {
    display: block;
  }

  .reader-rail {
    display: none;
  }

  .transcript {
    padding: 5rem 1.25rem 6rem;
  }

  .chapter {
    padding: 5rem 0;
  }

  .chapter-header {
    display: block;
  }

  .chapter-index {
    margin-bottom: 1.6rem;
  }

  .chapter-header h2 {
    font-size: 2rem;
  }

  .chapter-copy {
    margin-left: 0;
  }

  .dialogue {
    display: block;
    margin-bottom: 2rem;
    font-size: 1.02rem;
  }

  .speaker {
    display: block;
    margin-bottom: 0.55rem;
  }

  .page-footer {
    display: grid;
    align-items: start;
    min-height: 390px;
    padding: 4.5rem 1.25rem;
  }

  .back-to-top {
    justify-self: start;
  }

  .toc-panel {
    padding: 1.5rem 1.25rem 3rem;
  }
}

@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;
  }
}
