:root {
  color-scheme: light;
  --paper: #f0eadf;
  --ink: #182623;
  --muted: #6d756e;
  --accent: #dd5c3f;
  --line: rgba(24, 38, 35, 0.19);
  --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 14%, rgba(255, 255, 255, 0.65), transparent 29rem),
    var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  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='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
  content: "";
  opacity: 0.07;
  pointer-events: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

.page-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px clamp(24px, 5vw, 78px) 28px;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-decoration: none;
  text-transform: uppercase;
}

.wordmark-mark {
  width: 35px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  letter-spacing: -0.02em;
}

.edition,
.eyebrow,
.poem-kicker,
.timer-label,
.site-footer,
.folio {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.edition span {
  padding: 0 8px;
  color: var(--accent);
}

.reader {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(500px, 1.28fr);
  gap: clamp(58px, 9vw, 150px);
  align-items: center;
  padding: clamp(62px, 9vh, 108px) 0;
}

.intro {
  align-self: start;
  padding-top: 38px;
}

.eyebrow {
  margin-bottom: 26px;
  color: var(--accent);
}

.intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(58px, 6.4vw, 102px);
  font-weight: 400;
  letter-spacing: -0.052em;
  line-height: 0.84;
}

.intro h1 em {
  font-weight: 400;
}

.intro-copy {
  width: min(320px, 100%);
  margin: 35px 0 0;
  color: var(--muted);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.45;
}

.poem-stage {
  position: relative;
}

.stage-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}

.poem-kicker {
  color: var(--accent);
}

.timer-label {
  font-size: 9px;
}

.poem-frame {
  position: relative;
  min-height: 470px;
  padding: clamp(47px, 6vw, 82px) clamp(35px, 5.2vw, 78px);
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(248, 244, 236, 0.46);
}

.poem-frame::before,
.poem-frame::after {
  position: absolute;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(221, 92, 63, 0.32);
  border-radius: 50%;
  content: "";
}

.poem-frame::before {
  top: -96px;
  right: -70px;
}

.poem-frame::after {
  right: -98px;
  bottom: -70px;
}

.poem {
  position: relative;
  z-index: 1;
}

.poem.is-entering {
  animation: poem-in 650ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes poem-in {
  from {
    opacity: 0;
    transform: translateY(var(--entry-direction, 12px));
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.poem h2 {
  margin: 0 0 37px;
  font-family: var(--serif);
  font-size: clamp(44px, 5.1vw, 76px);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.95;
}

.poem-lines {
  font-family: var(--serif);
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.5;
}

.poem-lines p {
  margin: 0;
}

.folio {
  position: absolute;
  right: 24px;
  bottom: 23px;
}

.progress-track {
  height: 2px;
  overflow: hidden;
  background: rgba(24, 38, 35, 0.12);
}

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

.reader-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 20px;
}

.arrow-button,
.pause-button,
.page-dot {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.arrow-button {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 19px;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.arrow-button:hover {
  color: var(--paper);
  border-color: var(--ink);
  background: var(--ink);
  transform: translateY(-2px);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  justify-content: center;
}

.page-dot {
  position: relative;
  width: clamp(10px, 1.4vw, 17px);
  height: 24px;
  padding: 0;
}

.page-dot::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
  content: "";
  transform: translate(-50%, -50%);
  transition: width 180ms ease, height 180ms ease, background 180ms ease;
}

.page-dot:hover::after,
.page-dot.is-active::after {
  width: 7px;
  height: 7px;
  background: var(--accent);
}

.pause-button {
  min-width: 80px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 0 10px 10px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.pause-icon {
  width: 9px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-left: 2px solid currentColor;
}

.pause-button.is-paused .pause-icon {
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-right: 0;
  border-bottom: 5px solid transparent;
  border-left: 8px solid currentColor;
}

.arrow-button:focus-visible,
.page-dot:focus-visible,
.pause-button:focus-visible,
.wordmark:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.site-footer {
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 9px;
}

.hint span {
  margin-right: 9px;
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.25em;
}

.noscript {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 10;
  margin: 0;
  padding: 12px;
  color: #fff;
  background: var(--ink);
  font-family: var(--sans);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 860px) {
  .page-shell {
    min-height: 100svh;
  }

  .reader {
    grid-template-columns: 1fr;
    gap: 50px;
    padding: 55px 0;
  }

  .intro {
    padding-top: 0;
  }

  .intro h1 {
    font-size: clamp(62px, 15vw, 92px);
  }

  .intro-copy {
    margin-top: 26px;
  }

  .poem-frame {
    min-height: 430px;
  }
}

@media (max-width: 540px) {
  .page-shell {
    padding: 18px 17px 20px;
  }

  .edition {
    font-size: 8px;
  }

  .edition span,
  .edition span + * {
    display: none;
  }

  .wordmark {
    font-size: 10px;
  }

  .wordmark-mark {
    width: 31px;
  }

  .reader {
    gap: 42px;
    padding: 44px 0 38px;
  }

  .intro h1 {
    font-size: clamp(57px, 19vw, 78px);
  }

  .intro-copy {
    font-size: 17px;
  }

  .timer-label {
    max-width: 100px;
    text-align: right;
    line-height: 1.45;
  }

  .poem-frame {
    min-height: 390px;
    padding: 48px 27px;
  }

  .poem h2 {
    margin-bottom: 30px;
    font-size: clamp(41px, 13vw, 58px);
  }

  .poem-lines {
    font-size: 21px;
  }

  .reader-controls {
    gap: 8px;
  }

  .arrow-button {
    width: 36px;
    height: 36px;
  }

  .pagination {
    gap: 0;
  }

  .page-dot {
    width: 13px;
  }

  .pause-button {
    min-width: 30px;
    width: 30px;
    padding-left: 4px;
  }

  .pause-button span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .site-footer {
    justify-content: center;
  }

  .site-footer > p:first-child {
    display: none;
  }
}

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

  .poem.is-entering {
    animation-duration: 1ms;
  }

  .arrow-button,
  .page-dot::after {
    transition: none;
  }
}
