@font-face {
  font-family: "Star Serif";
  src: url("/assets/fonts/star-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

@font-face {
  font-family: "Star Sans";
  src: url("/assets/fonts/star-sans.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #070b12;
  --bg-soft: #0d131e;
  --ink: #f1ebe0;
  --ink-soft: #c8c1b4;
  --muted: #8b8e96;
  --gold: #cfae70;
  --gold-soft: #e1c995;
  --coral: #c65e48;
  --blue: #7ea9c4;
  --line: rgba(241, 235, 224, 0.16);
  --serif: "Star Serif", "Noto Serif SC", "Source Han Serif SC", "Songti SC", serif;
  --sans: "Star Sans", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --measure: 1180px;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.28);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
svg,
canvas {
  display: block;
}

::selection {
  background: rgba(207, 174, 112, 0.3);
  color: #fffaf0;
}

:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 5px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-180%);
  padding: 10px 14px;
  background: var(--ink);
  color: var(--bg);
  font-family: var(--sans);
  font-size: 13px;
  transition: transform 180ms ease;
}

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

.site-frame {
  position: fixed;
  inset: 14px;
  z-index: 30;
  pointer-events: none;
  border: 1px solid rgba(207, 174, 112, 0.15);
}

.site-frame::before,
.site-frame::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: rgba(207, 174, 112, 0.58);
  border-style: solid;
}

.site-frame::before {
  top: -1px;
  left: -1px;
  border-width: 1px 0 0 1px;
}

.site-frame::after {
  right: -1px;
  bottom: -1px;
  border-width: 0 1px 1px 0;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 76px;
  padding: 16px clamp(24px, 5vw, 72px);
  border-bottom: 1px solid transparent;
  transition:
    background 280ms ease,
    border-color 280ms ease,
    backdrop-filter 280ms ease;
}

.site-header.is-scrolled {
  background: rgba(7, 11, 18, 0.76);
  border-color: rgba(241, 235, 224, 0.1);
  backdrop-filter: blur(18px) saturate(120%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--ink);
}

.brand-mark {
  position: relative;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid rgba(207, 174, 112, 0.48);
  border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  background: var(--gold);
}

.brand-mark::before {
  width: 9px;
  height: 1px;
}

.brand-mark::after {
  width: 1px;
  height: 9px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 34px);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
}

.site-nav a {
  position: relative;
  padding: 8px 0;
}

.site-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  left: 0;
  height: 1px;
  transform: scaleX(0);
  transform-origin: right;
  background: var(--gold);
  transition: transform 220ms ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.home-main {
  position: relative;
  z-index: 1;
}

.sky-canvas {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cosmic-wash {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 73% 20%, rgba(72, 111, 143, 0.18), transparent 31%),
    radial-gradient(circle at 18% 72%, rgba(198, 94, 72, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(7, 11, 18, 0.08), var(--bg) 90%);
}

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  padding: 132px clamp(24px, 5vw, 72px) 48px;
  overflow: hidden;
  isolation: isolate;
}

.hero::after {
  content: "";
  position: absolute;
  right: 6vw;
  bottom: 10vh;
  width: min(35vw, 420px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(207, 174, 112, 0.45));
}

.hero-meta {
  align-self: start;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.27em;
  color: var(--muted);
}

.hero-title-wrap {
  align-self: center;
  margin: clamp(-50px, -3vh, -20px) 0;
}

.hero-kicker {
  margin: 0 0 22px 7px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--gold);
}

.hero-title {
  margin: 0;
  font-size: clamp(82px, 16vw, 218px);
  font-weight: 560;
  line-height: 0.83;
  letter-spacing: 0.03em;
  text-shadow: 0 18px 90px rgba(0, 0, 0, 0.25);
}

.hero-title span {
  display: block;
}

.hero-title span:last-child {
  margin-left: clamp(46px, 15vw, 220px);
  color: var(--gold-soft);
}

.hero-orbit {
  position: absolute;
  z-index: -1;
  top: 15%;
  right: -10%;
  width: min(73vw, 930px);
  color: rgba(207, 174, 112, 0.31);
  transform: translate3d(
    calc(var(--pointer-x, 0) * -9px),
    calc(var(--pointer-y, 0) * -7px),
    0
  );
  transition: transform 450ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.hero-orbit svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.hero-graph {
  position: absolute;
  right: 7%;
  bottom: 17%;
  width: min(24vw, 320px);
  opacity: 0.6;
  color: var(--coral);
  transform: translate3d(
    calc(var(--pointer-x, 0) * 8px),
    calc(var(--pointer-y, 0) * 8px),
    0
  );
}

.hero-glyph {
  position: absolute;
  right: -0.06em;
  bottom: -0.18em;
  z-index: -1;
  font-size: clamp(230px, 44vw, 650px);
  line-height: 1;
  color: rgba(241, 235, 224, 0.025);
  pointer-events: none;
  user-select: none;
}

.hero-bottom {
  align-self: end;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 36px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.hero-quote {
  display: grid;
  grid-template-columns: auto minmax(180px, 310px);
  gap: 22px;
  align-items: start;
  color: var(--ink-soft);
}

.hero-quote-mark {
  color: var(--gold);
  font-size: 36px;
  line-height: 0.8;
}

.hero-quote p {
  margin: 0;
  font-size: 14px;
  line-height: 2;
}

.hero-quote cite {
  display: block;
  margin-top: 9px;
  font-family: var(--sans);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.28em;
  color: var(--muted);
}

.enter-link {
  display: inline-grid;
  grid-template-columns: auto 42px;
  align-items: center;
  gap: 18px;
  min-height: 42px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--gold-soft);
}

.enter-link::after {
  content: "↓";
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(207, 174, 112, 0.42);
  border-radius: 50%;
  transition:
    transform 220ms ease,
    background 220ms ease;
}

.enter-link:hover::after,
.enter-link:focus-visible::after {
  transform: translateY(4px);
  background: rgba(207, 174, 112, 0.08);
}

.section {
  position: relative;
  width: min(calc(100% - 48px), var(--measure));
  margin-inline: auto;
  padding: clamp(82px, 11vw, 152px) 0;
}

.section[id] {
  scroll-margin-top: 96px;
}

.section-head {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 28px;
  margin-bottom: clamp(42px, 7vw, 86px);
}

.section-code {
  padding-top: 10px;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--gold);
}

.section-title {
  margin: 0;
  font-size: clamp(38px, 6.2vw, 84px);
  font-weight: 470;
  line-height: 1.05;
  letter-spacing: 0.02em;
}

.section-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(240px, 0.7fr);
  gap: clamp(30px, 8vw, 100px);
  margin-top: 24px;
}

.section-intro p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 2;
}

.section-intro .micro {
  justify-self: end;
  max-width: 280px;
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.9;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.movement-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 16px;
}

.movement {
  position: relative;
  display: grid;
  min-height: 390px;
  padding: clamp(26px, 4vw, 46px);
  overflow: hidden;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
  isolation: isolate;
  transition:
    transform 320ms cubic-bezier(0.2, 0.7, 0.2, 1),
    border-color 220ms ease,
    filter 220ms ease;
}

.movement:hover {
  transform: translateY(-7px);
}

.movement[aria-pressed="true"] {
  border-color: currentColor;
}

.movement--star {
  grid-column: span 7;
  background:
    radial-gradient(circle at 76% 25%, rgba(90, 137, 166, 0.24), transparent 28%),
    #08131f;
  color: #f1eadb;
}

.movement--math {
  grid-column: span 5;
  background: #ece9df;
  color: #1c2024;
}

.movement--literature {
  grid-column: span 5;
  background: #f5ecdc;
  color: #27211d;
}

.movement--music {
  grid-column: span 7;
  background:
    radial-gradient(circle at 72% 38%, rgba(125, 64, 55, 0.23), transparent 27%),
    #1a1413;
  color: #f2eadb;
}

.movement-gridline {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.5;
}

.movement--math .movement-gridline {
  background-image:
    linear-gradient(rgba(49, 75, 94, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49, 75, 94, 0.11) 1px, transparent 1px);
  background-size: 28px 28px;
}

.movement--literature .movement-gridline::after {
  content: "文";
  position: absolute;
  right: -0.03em;
  bottom: -0.18em;
  font-size: 290px;
  line-height: 1;
  color: rgba(110, 32, 29, 0.045);
}

.movement-topline {
  align-self: start;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.28em;
  opacity: 0.72;
}

.movement-center {
  align-self: end;
}

.movement-element {
  display: block;
  font-size: clamp(44px, 7vw, 88px);
  font-weight: 520;
  line-height: 1;
  letter-spacing: 0.06em;
}

.movement-theme {
  display: block;
  margin-top: 11px;
  font-size: 17px;
  letter-spacing: 0.3em;
  color: var(--gold);
}

.movement--math .movement-theme {
  color: #8d3f30;
}

.movement--literature .movement-theme {
  color: #a23f32;
}

.movement-english {
  display: block;
  margin-top: 18px;
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.22em;
  opacity: 0.56;
}

.movement-arrow {
  position: absolute;
  right: clamp(24px, 4vw, 46px);
  bottom: clamp(24px, 4vw, 46px);
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--sans);
  opacity: 0.55;
  transition:
    transform 220ms ease,
    opacity 220ms ease;
}

.movement:hover .movement-arrow {
  transform: rotate(45deg);
  opacity: 1;
}

.movement-art {
  position: absolute;
  top: 18%;
  right: 4%;
  z-index: -1;
  width: 51%;
  max-width: 420px;
  opacity: 0.72;
  pointer-events: none;
}

.movement-art svg {
  width: 100%;
  height: auto;
}

.movement-wave {
  position: absolute;
  right: 3%;
  bottom: 19%;
  z-index: -1;
  width: 56%;
  opacity: 0.55;
}

.movement-wave svg {
  width: 100%;
}

.prologue {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.prologue-inner {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) minmax(220px, 0.65fr);
  gap: clamp(28px, 7vw, 96px);
  align-items: start;
}

.prologue-index {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--gold);
}

.prologue-quote {
  margin: 0;
  color: var(--ink);
  font-size: clamp(24px, 3.4vw, 44px);
  line-height: 1.65;
}

.prologue-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 2;
}

.library {
  padding-top: clamp(68px, 8vw, 110px);
}

.library-controls {
  position: sticky;
  top: 76px;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 360px);
  gap: 24px;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 12px;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(7, 11, 18, 0.9));
  backdrop-filter: blur(12px);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.filter-button:hover {
  border-color: rgba(207, 174, 112, 0.5);
}

.filter-button[aria-pressed="true"] {
  background: var(--gold-soft);
  border-color: var(--gold-soft);
  color: #11151c;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  border-bottom: 1px solid rgba(241, 235, 224, 0.26);
}

.search-field svg {
  flex: 0 0 auto;
  width: 17px;
  color: var(--gold);
}

.search-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.search-field input::placeholder {
  color: rgba(241, 235, 224, 0.42);
}

.library-summary {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0 20px;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.poem-list {
  display: grid;
}

.poem-item {
  --item-accent: var(--gold);
  border-bottom: 1px solid rgba(241, 235, 224, 0.1);
}

.poem-item[data-chapter="c2"] {
  --item-accent: #ef997f;
}

.poem-item[data-chapter="c3"] {
  --item-accent: #ed8d7c;
}

.poem-item[data-chapter="c4"] {
  --item-accent: #e5c77f;
}

.poem-link {
  display: grid;
  grid-template-columns: 70px minmax(155px, 0.55fr) minmax(260px, 1fr) 90px 24px;
  gap: 20px;
  align-items: center;
  min-height: 78px;
  padding: 14px 4px;
  transition:
    padding 220ms ease,
    background 220ms ease;
}

.poem-link:hover,
.poem-link:focus-visible {
  padding-inline: 14px;
  background: linear-gradient(90deg, rgba(207, 174, 112, 0.06), transparent 78%);
}

.poem-number,
.poem-chapter,
.poem-arrow {
  font-family: var(--sans);
}

.poem-number {
  color: var(--item-accent);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.poem-title {
  font-size: clamp(22px, 2.2vw, 31px);
  font-weight: 500;
  line-height: 1.18;
  letter-spacing: 0.12em;
  transition: color 180ms ease;
}

.poem-link:hover .poem-title {
  color: var(--item-accent);
}

.poem-preview {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.poem-chapter {
  justify-self: end;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.15em;
  white-space: nowrap;
}

.poem-arrow {
  justify-self: end;
  color: var(--item-accent);
  font-size: 14px;
}

.no-results {
  padding: 70px 0;
  text-align: center;
  color: var(--muted);
}

.no-results strong {
  display: block;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 28px;
  font-weight: 450;
}

.reset-search {
  min-height: 42px;
  margin-top: 18px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}

.site-footer {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 48px), var(--measure));
  margin-inline: auto;
  padding: 42px 0 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.18em;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 32px;
}

.footer-elements {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

/* Individual poem pages */
.poem-page {
  --theme-bg: #07131f;
  --theme-ink: #f1eadc;
  --theme-soft: #b9b3a7;
  --theme-muted: #858d98;
  --theme-accent: #cfae70;
  --theme-line: rgba(241, 234, 220, 0.15);
  --theme-surface: rgba(255, 255, 255, 0.035);
  min-height: 100svh;
  background: var(--theme-bg);
  color: var(--theme-ink);
  color-scheme: dark;
}

.poem-page[data-chapter="c2"] {
  --theme-bg: #efeee8;
  --theme-ink: #1c252c;
  --theme-soft: #4e5c65;
  --theme-muted: #626d73;
  --theme-accent: #b9533d;
  --theme-line: rgba(28, 37, 44, 0.14);
  --theme-surface: rgba(255, 255, 255, 0.44);
  color-scheme: light;
}

.poem-page[data-chapter="c3"] {
  --theme-bg: #f5ecdc;
  --theme-ink: #26211c;
  --theme-soft: #5e544a;
  --theme-muted: #75675c;
  --theme-accent: #a63f34;
  --theme-line: rgba(58, 38, 29, 0.14);
  --theme-surface: rgba(255, 255, 255, 0.35);
  color-scheme: light;
}

.poem-page[data-chapter="c4"] {
  --theme-bg: #191312;
  --theme-ink: #f1e7d7;
  --theme-soft: #c9b9a7;
  --theme-muted: #95877b;
  --theme-accent: #d2ae70;
  --theme-line: rgba(241, 231, 215, 0.14);
  --theme-surface: rgba(255, 255, 255, 0.035);
  color-scheme: dark;
}

.poem-page .site-header {
  color: var(--theme-ink);
}

.poem-page .site-header.is-scrolled {
  background: color-mix(in srgb, var(--theme-bg) 82%, transparent);
  border-color: var(--theme-line);
}

.poem-page .brand,
.poem-page .site-nav {
  color: var(--theme-ink);
}

.poem-page .brand-mark {
  border-color: color-mix(in srgb, var(--theme-accent) 58%, transparent);
}

.poem-page .brand-mark::before,
.poem-page .brand-mark::after {
  background: var(--theme-accent);
}

.poem-atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.poem-sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.poem-grid {
  position: absolute;
  inset: 0;
  display: none;
  opacity: 0.52;
  background-image:
    linear-gradient(rgba(48, 77, 98, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(48, 77, 98, 0.08) 1px, transparent 1px);
  background-size: 28px 28px;
}

.poem-books {
  position: absolute;
  right: 5vw;
  bottom: 8vh;
  display: none;
  width: min(36vw, 460px);
  height: min(45vw, 530px);
  border: 1px solid rgba(121, 77, 57, 0.14);
  box-shadow:
    7px 7px 0 rgba(121, 77, 57, 0.03),
    14px 14px 0 rgba(121, 77, 57, 0.025);
}

.poem-books::after {
  content: attr(data-glyph);
  position: absolute;
  right: -0.08em;
  bottom: -0.18em;
  font-size: clamp(220px, 32vw, 500px);
  line-height: 1;
  color: rgba(112, 49, 37, 0.045);
}

.poem-staff {
  position: absolute;
  right: -5vw;
  bottom: 10vh;
  display: none;
  width: min(62vw, 850px);
  color: rgba(210, 174, 112, 0.18);
}

.poem-page[data-chapter="c1"] .poem-sky {
  display: block;
}

.poem-page[data-chapter="c2"] .poem-grid {
  display: block;
}

.poem-page[data-chapter="c3"] .poem-books {
  display: block;
}

.poem-page[data-chapter="c4"] .poem-staff {
  display: block;
}

.poem-graph {
  position: absolute;
  top: 8vh;
  right: 2vw;
  width: min(40vw, 520px);
  display: none;
  color: rgba(185, 83, 61, 0.36);
}

.poem-page[data-chapter="c2"] .poem-graph {
  display: block;
}

.poem-orbit {
  position: absolute;
  top: 11vh;
  right: 3vw;
  width: min(39vw, 520px);
  color: rgba(207, 174, 112, 0.24);
  display: none;
}

.poem-page[data-chapter="c1"] .poem-orbit {
  display: block;
}

.poem-shell {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 48px), 1160px);
  min-height: 100svh;
  margin-inline: auto;
  padding: 132px 0 54px;
}

.poem-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: clamp(46px, 8vw, 82px);
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--theme-muted);
}

.poem-breadcrumb a {
  color: var(--theme-accent);
}

.poem-head {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: clamp(28px, 6vw, 84px);
  align-items: start;
  padding-bottom: clamp(45px, 7vw, 88px);
}

.poem-rail {
  padding-top: 12px;
  border-top: 1px solid var(--theme-accent);
}

.poem-rail-number {
  display: block;
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 300;
  line-height: 1;
  color: var(--theme-accent);
}

.poem-rail-label {
  display: block;
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: 0.18em;
  color: var(--theme-muted);
}

.poem-kicker {
  margin: 0 0 20px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--theme-accent);
}

.poem-page .poem-title {
  max-width: 900px;
  margin: 0;
  font-size: clamp(58px, 10vw, 124px);
  font-weight: 480;
  line-height: 0.96;
  letter-spacing: 0.08em;
}

.poem-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-top: 28px;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.19em;
  color: var(--theme-muted);
}

.poem-content {
  display: grid;
  grid-template-columns: 160px minmax(0, 720px);
  gap: clamp(28px, 6vw, 84px);
  padding: clamp(34px, 5vw, 62px) 0 clamp(70px, 10vw, 128px);
}

.poem-side-note {
  position: sticky;
  top: 112px;
  align-self: start;
  font-family: var(--sans);
  font-size: 8px;
  line-height: 1.9;
  letter-spacing: 0.16em;
  color: var(--theme-muted);
}

.poem-side-line {
  width: 42px;
  height: 1px;
  margin-bottom: 16px;
  background: var(--theme-accent);
}

.poem-text {
  position: relative;
  width: min(100%, 660px);
  font-size: clamp(18px, 1.9vw, 22px);
  line-height: 2.15;
  letter-spacing: 0.025em;
  color: var(--theme-ink);
}

.stanza {
  margin: 0 0 1.55em;
}

.stanza:last-child {
  margin-bottom: 0;
}

.line {
  margin: 0;
  min-height: 1em;
}

.stanza:first-child .line:first-child {
  color: var(--theme-accent);
}

.poem-end {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 64px;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--theme-muted);
}

.poem-end::before,
.poem-end::after {
  content: "";
  width: 46px;
  height: 1px;
  background: var(--theme-line);
}

.poem-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--theme-line);
  border-bottom: 1px solid var(--theme-line);
}

.poem-pager {
  display: grid;
  min-height: 128px;
  padding: 28px 0;
  align-content: space-between;
}

.poem-pager + .poem-pager {
  padding-left: 36px;
  border-left: 1px solid var(--theme-line);
  text-align: right;
}

.poem-pager-label {
  font-family: var(--sans);
  font-size: 8px;
  letter-spacing: 0.25em;
  color: var(--theme-muted);
}

.poem-pager-title {
  margin-top: 20px;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.2;
  letter-spacing: 0.1em;
  transition: color 180ms ease;
}

.poem-pager:hover .poem-pager-title {
  color: var(--theme-accent);
}

.poem-pager.is-empty {
  pointer-events: none;
}

.poem-pager.is-empty .poem-pager-title {
  color: var(--theme-muted);
}

.poem-footer {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  padding-top: 26px;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--theme-muted);
}

.not-found {
  display: grid;
  min-height: 100svh;
  place-items: center;
  padding: 120px 24px 60px;
  text-align: center;
}

.not-found h1 {
  margin: 0;
  font-size: clamp(64px, 14vw, 180px);
  font-weight: 420;
  line-height: 1;
}

.not-found p {
  max-width: 480px;
  color: var(--muted);
  line-height: 2;
}

.text-link {
  display: inline-block;
  margin-top: 18px;
  border-bottom: 1px solid var(--gold);
  color: var(--gold-soft);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.17em;
}

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 700ms ease,
    transform 700ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

@media (max-width: 980px) {
  .hero-title {
    font-size: clamp(76px, 17vw, 140px);
  }

  .movement {
    min-height: 340px;
  }

  .poem-link {
    grid-template-columns: 58px minmax(145px, 0.5fr) minmax(190px, 1fr) 24px;
  }

  .poem-chapter {
    display: none;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 72px;
  }

  .site-frame {
    inset: 8px;
  }

  .site-header {
    min-height: 66px;
    padding: 12px 22px;
  }

  .brand {
    gap: 9px;
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .brand-mark {
    width: 23px;
    height: 23px;
  }

  .site-nav {
    gap: 15px;
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .site-nav a:first-child {
    display: none;
  }

  .hero {
    min-height: 96svh;
    padding: 104px 24px 28px;
  }

  .hero-meta {
    font-size: 8px;
  }

  .hero-title-wrap {
    margin: 40px 0 20px;
  }

  .hero-title {
    font-size: clamp(68px, 23vw, 112px);
    line-height: 0.86;
  }

  .hero-title span:last-child {
    margin-left: 12vw;
  }

  .hero-orbit {
    top: 24%;
    right: -34%;
    width: 118vw;
  }

  .hero-graph {
    display: none;
  }

  .hero-glyph {
    right: -0.18em;
    bottom: 0.02em;
    font-size: 72vw;
  }

  .hero-bottom {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .hero-quote {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 12px;
  }

  .hero-quote p {
    font-size: 12px;
  }

  .enter-link {
    justify-self: end;
  }

  .section {
    width: min(calc(100% - 40px), var(--measure));
    padding: 74px 0;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 42px;
  }

  .section-code {
    padding-top: 0;
  }

  .section-intro {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .section-intro .micro {
    justify-self: start;
  }

  .movement-grid {
    grid-template-columns: 1fr;
  }

  .movement {
    grid-column: auto;
    min-height: 290px;
  }

  .movement-element {
    font-size: 52px;
  }

  .movement-art {
    top: 10%;
    right: -8%;
    width: 72%;
  }

  .prologue-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .prologue-quote {
    font-size: 25px;
  }

  .library-controls {
    top: 66px;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px 0;
  }

  .filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
    padding-bottom: 4px;
  }

  .filter-button {
    width: 100%;
    padding-inline: 6px;
  }

  .poem-link {
    grid-template-columns: 42px minmax(0, 1fr) 20px;
    gap: 12px;
    min-height: 80px;
  }

  .poem-title {
    font-size: 22px;
  }

  .poem-preview {
    display: block;
    grid-column: 2 / -1;
    margin-top: -8px;
    font-size: 11px;
  }

  .poem-arrow {
    grid-column: 3;
    grid-row: 1;
  }

  .footer-grid {
    display: grid;
    gap: 20px;
  }

  .footer-elements {
    gap: 10px;
  }

  .poem-shell {
    width: min(calc(100% - 40px), 1160px);
    padding-top: 105px;
  }

  .poem-breadcrumb {
    margin-bottom: 46px;
  }

  .poem-head,
  .poem-content {
    grid-template-columns: 1fr;
    gap: 27px;
  }

  .poem-head {
    padding-bottom: 48px;
  }

  .poem-rail {
    display: flex;
    align-items: end;
    gap: 15px;
    padding-top: 10px;
  }

  .poem-rail-number {
    font-size: 34px;
  }

  .poem-rail-label {
    margin-top: 0;
  }

  .poem-page .poem-title {
    font-size: clamp(58px, 18vw, 92px);
  }

  .poem-content {
    padding-top: 26px;
  }

  .poem-side-note {
    position: static;
    display: flex;
    gap: 12px;
    align-items: center;
  }

  .poem-side-line {
    margin: 0;
  }

  .poem-text {
    font-size: 18px;
    line-height: 2.05;
    letter-spacing: 0.015em;
  }

  .poem-pagination {
    grid-template-columns: 1fr;
  }

  .poem-pager + .poem-pager {
    padding-left: 0;
    border-top: 1px solid var(--theme-line);
    border-left: 0;
    text-align: left;
  }

  .poem-pager {
    min-height: 108px;
  }

  .poem-books {
    right: -18%;
    bottom: 14%;
    width: 72vw;
    height: 82vw;
  }

  .poem-graph,
  .poem-orbit {
    top: 12%;
    right: -19%;
    width: 76vw;
  }

  .poem-staff {
    right: -28%;
    width: 120vw;
  }
}

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

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

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
