:root {
  color-scheme: light;
  --ink: #15283a;
  --ink-soft: #526677;
  --paper: #f2f0e9;
  --paper-deep: #e7e5dd;
  --frost: #d9e7ef;
  --gold: #d4a95f;
  --line: rgba(21, 40, 58, 0.16);
  --display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua",
    Palatino, Georgia, serif;
  --body: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  text-rendering: optimizeLegibility;
  transition: background 700ms ease, color 700ms ease;
}

body.twilight {
  --ink: #dce8ee;
  --ink-soft: #9fb2bf;
  --paper: #0f1e2c;
  --paper-deep: #142637;
  --line: rgba(220, 232, 238, 0.15);
  color-scheme: dark;
}

a {
  color: inherit;
}

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

.reading-progress {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  width: var(--progress, 0%);
  height: 3px;
  background: linear-gradient(90deg, #b4d3e3, #f1c578);
  box-shadow: 0 0 18px rgba(241, 197, 120, 0.6);
}

.site-header {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  padding: 30px clamp(24px, 5vw, 76px);
  color: #f5f8fa;
}

.monogram {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 50%;
  font-family: var(--display);
  font-size: 14px;
  line-height: 44px;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.08em;
  backdrop-filter: blur(8px);
}

.edition {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.75;
}

.mood-toggle {
  justify-self: end;
  display: flex;
  gap: 9px;
  align-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  font: 600 11px/1 var(--body);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  cursor: pointer;
}

.mood-toggle__icon {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  font-size: 18px;
  transition: transform 500ms ease;
}

.mood-toggle:hover .mood-toggle__icon {
  transform: rotate(180deg);
}

.hero {
  position: relative;
  display: grid;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background: #7692aa url("/assets/winter-morning.png") center / cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 28, 43, 0.78) 0%, rgba(10, 28, 43, 0.42) 39%, transparent 68%),
    linear-gradient(0deg, rgba(8, 22, 34, 0.48), transparent 44%);
  transition: background 800ms ease;
}

.twilight .hero::after {
  background:
    linear-gradient(90deg, rgba(5, 15, 27, 0.88) 0%, rgba(6, 18, 32, 0.68) 52%, rgba(10, 25, 42, 0.28)),
    linear-gradient(0deg, rgba(4, 12, 23, 0.68), rgba(20, 42, 66, 0.08));
}

.hero__veil {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: radial-gradient(circle at 65% 47%, rgba(255, 214, 142, 0.18), transparent 28%);
  mix-blend-mode: screen;
}

.hero__content {
  align-self: center;
  width: min(760px, 84vw);
  margin-left: clamp(24px, 10vw, 160px);
  padding-top: 70px;
  color: #f8fafb;
}

.eyebrow,
.section-kicker {
  margin: 0 0 26px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.26em;
}

.eyebrow {
  color: #dcecf3;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(76px, 11vw, 176px);
  font-weight: 400;
  line-height: 0.76;
  letter-spacing: -0.065em;
  text-wrap: balance;
}

h1 span {
  display: block;
}

h1 span:last-child {
  margin-left: clamp(28px, 9vw, 130px);
  color: #f4c879;
  font-style: italic;
}

.hero__lead {
  margin: 54px 0 42px clamp(4px, 9vw, 130px);
  font-family: var(--display);
  font-size: clamp(20px, 2vw, 29px);
  font-style: italic;
  line-height: 1.45;
}

.read-link {
  display: inline-flex;
  gap: 22px;
  align-items: center;
  margin-left: clamp(4px, 9vw, 130px);
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  transition: gap 250ms ease, border-color 250ms ease;
}

.read-link:hover {
  gap: 32px;
  border-color: #f4c879;
}

.hero__caption {
  position: absolute;
  right: clamp(24px, 5vw, 76px);
  bottom: 38px;
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--display);
  font-size: 13px;
  font-style: italic;
}

.snow,
.snow span {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.snow span {
  top: -8vh;
  left: var(--left);
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background: rgba(255, 255, 255, var(--opacity));
  filter: blur(var(--blur));
  animation: fall var(--duration) linear var(--delay) infinite;
}

@keyframes fall {
  to {
    transform: translate3d(var(--drift), 112vh, 0) rotate(240deg);
  }
}

.poem {
  position: relative;
  display: grid;
  grid-template-columns: minmax(200px, 0.72fr) minmax(480px, 1.28fr);
  gap: clamp(40px, 9vw, 150px);
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(110px, 14vw, 210px) clamp(24px, 6vw, 76px) 140px;
}

.poem::before {
  content: "❄";
  position: absolute;
  top: 90px;
  right: 4vw;
  color: var(--line);
  font-family: var(--display);
  font-size: clamp(140px, 24vw, 340px);
  line-height: 1;
  pointer-events: none;
}

.poem__intro {
  position: sticky;
  top: 120px;
  align-self: start;
}

.section-kicker {
  color: #8a6b3e;
}

.twilight .section-kicker {
  color: #e0b66c;
}

.poem__note {
  max-width: 300px;
  margin: 0;
  color: var(--ink-soft);
  font-family: var(--display);
  font-size: 20px;
  font-style: italic;
  line-height: 1.6;
}

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

.stanza {
  position: relative;
  margin: 0 0 clamp(70px, 9vw, 120px);
}

.stanza p {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(25px, 3vw, 40px);
  line-height: 1.57;
  letter-spacing: -0.018em;
}

.stanza__number {
  position: absolute;
  top: 10px;
  right: calc(100% + 34px);
  color: var(--ink-soft);
  font: 600 10px/1 var(--body);
  letter-spacing: 0.12em;
}

.stanza--light p::first-line {
  color: #a06f2e;
}

.twilight .stanza--light p::first-line {
  color: #f0c06d;
}

.poem__footer {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding-top: 52px;
  border-top: 1px solid var(--line);
}

.signature {
  margin: 0;
  font-family: var(--display);
  font-size: 42px;
  font-style: italic;
}

.year {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  letter-spacing: 0.18em;
}

.poem__footer a,
.site-footer a {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  text-underline-offset: 5px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 34px clamp(24px, 6vw, 76px);
  border-top: 1px solid var(--line);
  background: var(--paper-deep);
  color: var(--ink-soft);
}

.site-footer p {
  margin: 0;
  font-family: var(--display);
  font-size: 14px;
  font-style: italic;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 800ms ease, transform 800ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

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

  .edition,
  .mood-toggle__text {
    display: none;
  }

  .hero__content {
    width: auto;
    margin: 0 22px;
    padding-top: 40px;
  }

  h1 {
    font-size: clamp(72px, 23vw, 112px);
    line-height: 0.82;
  }

  h1 span:last-child {
    margin-left: 10vw;
  }

  .hero__lead,
  .read-link {
    margin-left: 10vw;
  }

  .hero__caption {
    right: 20px;
    bottom: 24px;
  }

  .poem {
    display: block;
    padding: 100px 24px 90px;
  }

  .poem__intro {
    position: static;
    margin-bottom: 76px;
  }

  .poem__note {
    max-width: 460px;
  }

  .stanza {
    padding-left: 26px;
  }

  .stanza p {
    font-size: clamp(21px, 5.6vw, 29px);
    line-height: 1.62;
  }

  .stanza__number {
    right: auto;
    left: 0;
  }

  .poem__footer {
    display: flex;
    margin-left: 26px;
  }
}

@media (max-width: 460px) {
  .hero {
    background-position: 58% center;
  }

  .eyebrow {
    max-width: 180px;
    line-height: 1.7;
  }

  .hero__lead {
    margin-top: 42px;
  }

  .poem__footer {
    gap: 30px;
    align-items: start;
    flex-direction: column;
  }

  .site-footer {
    gap: 20px;
    align-items: start;
    flex-direction: column;
  }
}

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

  .snow {
    display: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
