:root {
  color-scheme: dark;
  --ink: #000000;
  --pink: #ffb6c1;
  --pink-soft: rgba(255, 182, 193, 0.68);
  --muted: rgba(255, 232, 235, 0.48);
  --hairline: rgba(255, 182, 193, 0.18);
  font-family: 'DM Sans', Arial, sans-serif;
  background: var(--ink);
  color: #fff4f5;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--ink);
  overflow: hidden;
}

body.has-entered { overflow: auto; }
body:has(#page-shell:target) { overflow: auto; }
body:has(#page-shell:target) .opening-screen { opacity: 0; visibility: hidden; pointer-events: none; }

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

.page-shell {
  width: min(100%, 1440px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 30px clamp(22px, 5.2vw, 76px) 24px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 700ms ease, transform 700ms ease, visibility 0s linear 700ms;
}

.page-shell.is-visible, .page-shell:target { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); transition-delay: 0s; }

.opening-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 48%, rgba(255, 182, 193, .045), transparent 42%), var(--ink);
  opacity: 1;
  visibility: visible;
  transition: opacity 750ms ease, visibility 0s linear 750ms;
}

.opening-screen.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; }

.opening-orbit {
  position: absolute;
  width: min(72vmin, 680px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 182, 193, .13);
  border-radius: 50%;
  animation: orbit-breathe 7s ease-in-out infinite;
}

.opening-orbit::before {
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(255, 182, 193, .075);
  border-radius: 50%;
  content: '';
}

.opening-orbit::after {
  position: absolute;
  top: 7%;
  left: 50%;
  color: var(--pink-soft);
  content: '✳';
  font: 17px Arial, sans-serif;
  transform: translateX(-50%);
}

.opening-copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; width: min(92vw, 1000px); }
.opening-eyebrow { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 0 27px; color: var(--pink-soft); font: 8px 'DM Mono', monospace; letter-spacing: .18em; }
.opening-word { display: inline-block; max-width: 100%; padding: 0 .04em 0 .1em; color: #fff3f4; font: 500 clamp(72px, 20vw, 190px)/1 'Playfair Display', Georgia, serif; letter-spacing: .02em; text-decoration: none; text-shadow: 0 0 54px rgba(255, 182, 193, .13); transition: color 250ms ease, transform 350ms ease; }
.opening-word:hover { color: var(--pink); transform: scale(1.015); }
.opening-word:focus-visible { border-radius: 3px; outline: 2px solid var(--pink); outline-offset: 8px; }
.opening-hint { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 20px 0 0; color: var(--muted); font: 7px 'DM Mono', monospace; letter-spacing: .22em; }
.opening-hint::before { width: 28px; height: 1px; background: var(--pink); opacity: .65; content: ''; }
.opening-foot { position: absolute; bottom: 31px; margin: 0; color: rgba(255, 232, 235, .32); font: 7px 'DM Mono', monospace; letter-spacing: .17em; text-align: center; }

.topline, .footline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #fff0f2;
  font-size: 13px;
  letter-spacing: -0.025em;
  font-weight: 500;
}

.wordmark-symbol {
  color: var(--pink);
  font-family: Arial, sans-serif;
  font-size: 23px;
  line-height: 1;
  transform: translateY(-1px);
}

.edition, .eyebrow, .footline {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
}

.edition { color: var(--muted); }

.love-note {
  flex: 1;
  min-height: 690px;
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  grid-template-rows: 1fr auto;
  align-items: center;
  column-gap: clamp(8px, 3vw, 48px);
  padding: 38px 0 36px;
}

.intro {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  width: min(100%, 560px);
  padding-left: clamp(0px, 2.5vw, 34px);
  z-index: 1;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 25px;
  color: var(--pink-soft);
  font-size: 8px;
  letter-spacing: 0.17em;
}

.eyebrow-line { width: 24px; height: 1px; background: var(--pink); opacity: 0.7; }

h1 {
  margin: 0;
  color: #fff3f4;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.045em;
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1.08;
}

h1 em { color: var(--pink); font-weight: 500; }

.subtitle {
  margin: 20px 0 0;
  color: rgba(255, 240, 242, 0.58);
  font-size: 14px;
  letter-spacing: 0.01em;
}

.heart-figure {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  align-self: center;
  width: min(100%, 640px);
  height: min(66vh, 650px);
  min-height: 410px;
  margin: 0;
  position: relative;
}

#heart { display: block; width: 100%; height: 100%; overflow: visible; }

.heart-word {
  fill: var(--pink);
  font-family: Arial, sans-serif;
  font-size: 8pt;
  font-weight: normal;
  text-anchor: middle;
  dominant-baseline: central;
  user-select: none;
  pointer-events: none;
}

.controls {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: center;
  width: min(390px, 100%);
  display: grid;
  grid-template-columns: auto 1fr 38px;
  align-items: center;
  gap: 20px;
  padding-top: 15px;
}

.playback, .replay {
  border: 1px solid var(--hairline);
  background: transparent;
  color: #fff1f3;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.playback {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: 999px;
  font: 500 11px 'DM Sans', Arial, sans-serif;
  white-space: nowrap;
}

.playback-icon { color: var(--pink); font-size: 12px; width: 12px; text-align: center; }

.playback:hover, .replay:hover { border-color: rgba(255, 182, 193, 0.6); background: rgba(255, 182, 193, 0.06); }
.playback:focus-visible, .replay:focus-visible { outline: 2px solid var(--pink); outline-offset: 4px; }

.replay {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--pink);
  font: 22px/1 Arial, sans-serif;
}

.progress-wrap { min-width: 0; }
.progress-track { width: 100%; height: 1px; overflow: hidden; background: rgba(255, 182, 193, 0.18); }
#progress-bar { display: block; width: 0; height: 100%; background: var(--pink); transition: width 120ms linear; }
.progress-label { margin: 8px 0 0; color: var(--muted); font: 8px 'DM Mono', monospace; letter-spacing: 0.035em; white-space: nowrap; }
.progress-label span { color: var(--pink); }

.footline {
  min-height: 29px;
  color: rgba(255, 232, 235, 0.35);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.footer-note { display: flex; gap: 9px; align-items: center; }
.footer-note span { color: var(--pink-soft); font: 15px Arial, sans-serif; }
.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; }

@media (max-width: 760px) {
  .opening-orbit { width: min(78vmin, 470px); }
  .opening-word { font-size: clamp(64px, 20vw, 116px); }
  .opening-eyebrow { margin-bottom: 21px; font-size: 7px; }
  .opening-foot { bottom: 23px; font-size: 6px; }
  .page-shell { padding: 22px 22px 17px; }
  .edition { font-size: 7px; letter-spacing: 0.1em; }
  .love-note {
    min-height: 0;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(300px, 1fr) auto;
    padding: 55px 0 32px;
    row-gap: 4px;
  }
  .intro { grid-column: 1; grid-row: 1; width: 100%; padding-left: 4px; }
  .eyebrow { margin-bottom: 17px; font-size: 7px; }
  h1 { font-size: clamp(40px, 11vw, 58px); }
  .subtitle { margin-top: 13px; font-size: 12px; }
  .heart-figure {
    grid-column: 1;
    grid-row: 2;
    width: min(100%, 460px);
    height: clamp(300px, 56vh, 450px);
    min-height: 300px;
  }
  .controls { grid-column: 1; grid-row: 3; padding-top: 6px; gap: 12px; }
  .playback { padding: 0 11px; font-size: 10px; }
  .progress-label { font-size: 7px; }
  .footline { font-size: 7px; letter-spacing: 0.08em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

@keyframes orbit-breathe { 0%, 100% { transform: scale(.97); opacity: .75; } 50% { transform: scale(1.015); opacity: 1; } }
