@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/cormorant-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/cormorant-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/cormorant-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/cormorant-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/source-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/source-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/source-sans-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/source-sans-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --paper: #f4eee4;
  --paper-edge: #e6d9c6;
  --ink: #231c16;
  --ink-soft: #6a5d50;
  --rule: #cbb9a3;
  --accent: #8a3d2c;
  --accent-hover: #5e2418;
  --shadow: 0 24px 60px rgba(60, 40, 20, 0.08);
  --serif: "Cormorant Garamond", "Iowan Old Style", Palatino, "Palatino Linotype", "Times New Roman", serif;
  --sans: "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161310;
    --paper-edge: #0e0c0a;
    --ink: #f0e6d6;
    --ink-soft: #b4a494;
    --rule: #3f352c;
    --accent: #e0a792;
    --accent-hover: #f4cbb8;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  }
}

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

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255, 255, 255, 0.35), transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-edge) 100%);
  font-family: var(--serif);
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.09;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.55'/></svg>");
  mix-blend-mode: multiply;
}

@media (prefers-color-scheme: dark) {
  body::before {
    mix-blend-mode: overlay;
    opacity: 0.16;
  }
}

.page {
  position: relative;
  z-index: 1;
  width: min(44rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2.75rem 0 4rem;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  color: inherit;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

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

.masthead-mark {
  width: 0.45rem;
  height: 0.45rem;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
}

.contents-hero {
  margin: 2.5rem 0 2.75rem;
}

.kicker {
  margin: 0 0 0.7rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hero-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin: 0;
  font-size: clamp(1.7rem, 4.8vw, 3.2rem);
  font-weight: 500;
  font-style: italic;
  line-height: 1;
  letter-spacing: -0.03em;
  white-space: nowrap;
}

.hero-sep {
  flex: 0 0 auto;
  width: 0.42rem;
  height: 0.42rem;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
}

.year-group {
  margin-top: 2.4rem;
}

.year-group h2 {
  margin: 0 0 0.55rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.lede {
  margin: 0 0 0.85rem;
  max-width: 32rem;
  color: var(--ink-soft);
  font-size: 1.12rem;
  font-style: italic;
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.toc li {
  border-bottom: 1px solid var(--rule);
}

.toc a {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 0.15rem;
  color: inherit;
  text-decoration: none;
}

.toc a:hover .title,
.toc a:focus-visible .title {
  color: var(--accent);
}

.title {
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.2;
}

.lang {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.poem h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 500;
  font-style: italic;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.ornament {
  display: flex;
  justify-content: center;
  margin: 1.25rem 0 2rem;
  color: var(--accent);
  font-size: 0.7rem;
  letter-spacing: 0.55em;
}

.poem p,
.poem pr {
  margin: 0 0 1.35rem;
  font-size: 1.18rem;
  line-height: 1.7;
}

.poem p:last-child {
  margin-bottom: 0;
}

.time-break {
  margin: 2.4rem 0;
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1rem;
}

.note {
  margin-top: 2.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--rule);
  font-size: 1rem;
  font-style: italic;
  color: var(--ink-soft);
}

.compose-slot {
  margin: 0 0 1.35rem;
}

.compose-slot p {
  margin: 0;
}

.compose-slot.awaiting,
.compose-gap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.2rem;
  margin: 1.1rem 0;
  overflow: hidden;
}

.compose-slot > .compose-thought {
  margin-top: 1.1rem;
  min-height: 4.2rem;
}

.compose-gap,
.compose-thought {
  overflow: hidden;
  transition:
    opacity 0.8s ease,
    min-height 0.8s ease,
    margin 0.8s ease;
}

.compose-gap.is-entering,
.compose-gap.is-leaving,
.compose-thought.is-leaving {
  opacity: 0;
  min-height: 0;
  margin-top: 0;
  margin-bottom: 0;
}

.compose-thought.is-leaving i {
  animation: none;
}

.compose-slot[hidden] {
  display: none !important;
}

.compose-thought {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
}

.compose-thought i {
  display: block;
  width: 0.42rem;
  height: 0.42rem;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
  opacity: 0.25;
  animation: compose-think 2.6s ease-in-out infinite;
}

.compose-thought i:nth-child(2) {
  animation-delay: 0.45s;
}

.compose-thought i:nth-child(3) {
  animation-delay: 0.9s;
}

@keyframes compose-think {
  0%,
  100% {
    opacity: 0.18;
    transform: rotate(45deg) scale(0.82);
  }
  50% {
    opacity: 0.95;
    transform: rotate(45deg) scale(1.18);
  }
}

.compose-caret {
  display: inline-block;
  width: 0.34rem;
  height: 0.34rem;
  margin-left: 0.2rem;
  border: 1px solid var(--accent);
  transform: rotate(45deg) translateY(-0.12em);
  vertical-align: middle;
  animation: compose-think 1.2s ease-in-out infinite;
}

body.composing .compose-note {
  opacity: 0;
  pointer-events: none;
}

body.composed .compose-note {
  opacity: 1;
  transition: opacity 1.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .compose-thought i,
  .compose-caret {
    animation: none;
  }

  body.composing .compose-note,
  body.composed .compose-note {
    opacity: 1;
    pointer-events: auto;
  }
}

.poem-with-figure {
  display: flex;
  align-items: flex-start;
  gap: 1.75rem;
}

.poem-col {
  flex: 1 1 18rem;
  min-width: 0;
}

.poem-figure {
  flex: 0 0 20.15rem;
  width: 20.15rem;
  margin: 0;
}

.poem-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 3.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
}

.pager a {
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.pager .prev {
  grid-column: 1;
}

.pager .next {
  grid-column: 2;
  text-align: right;
}

.pager .dir {
  display: block;
  margin-bottom: 0.2rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.pager-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.25;
}

.pager a:hover,
.pager a:focus-visible {
  color: var(--accent);
}

.colophon {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.pager + .colophon {
  margin-top: 1.15rem;
}

.back {
  color: inherit;
  text-decoration: none;
}

.back::before {
  content: "← ";
}

.back:hover,
.note a:hover,
.poem a:hover {
  color: var(--accent);
}

.note a,
.poem a {
  color: var(--accent);
}

.copy {
  margin: 0;
}

.copy .written {
  font-style: normal;
}

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

  .page {
    width: min(44rem, calc(100% - 1.6rem));
    padding-top: 1.6rem;
  }

  .toc a {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .colophon {
    flex-direction: column;
    gap: 0.4rem;
  }

  .pager {
    gap: 0.85rem;
  }

  .pager-title {
    font-size: 1.05rem;
  }

  .hero-title {
    font-size: clamp(1.35rem, 6.4vw, 2rem);
  }

  .poem-with-figure {
    flex-direction: column;
    align-items: stretch;
  }

  .poem-figure {
    flex-basis: auto;
    width: min(20.15rem, 85%);
    margin: 0.5rem 0 0 auto;
  }
}

.veil-stage {
  position: relative;
  margin: 0 -0.6rem;
  padding: 0.35rem 0.6rem 0.9rem;
}

.veil-stage canvas {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  touch-action: none;
}

body.veils-ready .veil-stage canvas {
  display: block;
}

.veil-hint {
  display: none;
  margin: 0.7rem 0 0;
  text-align: center;
  font-family: var(--serif);
  font-size: 0.92rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ink-soft);
}

body.veils-ready .veil-hint {
  display: block;
}

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

  .veil-stage canvas,
  body.veils-ready .veil-hint {
    display: none !important;
  }
}

@media print {
  body,
  body::before {
    background: none;
    mix-blend-mode: normal;
  }

  .masthead,
  .colophon {
    border-color: #ccc;
  }

  .back,
  .pager,
  .veil-stage canvas,
  .veil-hint {
    display: none;
  }
}
