/* ════════════════════════════════════════════════════════════════════
   OUR ANNIVERSARY — soft rust & navy, glossy, gentle
   one stylesheet shared by every page
   ════════════════════════════════════════════════════════════════════ */

:root {
  --cream:      #f8f2e9;
  --cream-deep: #f1e7d8;
  --paper:      #fffdf6;
  --rust:       #c07a5b;
  --rust-soft:  #d99a78;
  --rust-deep:  #a35c40;
  --navy:       #3a465e;
  --navy-deep:  #2b3548;
  --navy-mist:  #55617e;
  --pink:       #e89ab0;
  --pink-soft:  #f2b7c6;
  --pink-glow:  #fbd7e0;
  --pink-deep:  #d97a96;
  --ink:        #3b352e;
  --ink-soft:   #6f665a;
  --line:       rgba(58, 70, 94, .16);

  --shadow-soft: 0 18px 40px rgba(58, 70, 94, .14);
  --shadow-lift: 0 24px 50px rgba(58, 70, 94, .20);

  --serif:   "Playfair Display", "Georgia", serif;
  --body:    "Cormorant Garamond", "Georgia", serif;
  --script:  "Great Vibes", "Segoe Script", "Brush Script MT", cursive;
}

/* ── reset & base ─────────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }

body {
  min-height: 100%;
  font-family: var(--body);
  font-size: 1.14rem;
  line-height: 1.6;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: var(--rust); text-decoration: none; }
a:hover { color: var(--rust-deep); }

::selection { background: var(--pink-soft); color: var(--ink); }

:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 6px; }

/* ── the two moods ────────────────────────────────────────────────── */
.scene-cream {
  background:
    radial-gradient(1100px 720px at 12% 8%,  rgba(217, 154, 119, .16), transparent 60%),
    radial-gradient(900px 640px at 88% 90%,  rgba(85, 97, 126, .14),  transparent 60%),
    radial-gradient(700px 520px at 80% 12%,  rgba(242, 183, 198, .18), transparent 62%),
    var(--cream);
  color: var(--ink);
}

.scene-navy {
  background:
    radial-gradient(1000px 700px at 72% 16%, rgba(232, 154, 176, .15), transparent 58%),
    radial-gradient(900px 640px at 16% 84%,  rgba(192, 122, 91, .16),  transparent 55%),
    linear-gradient(160deg, #313d54, #3a465e 52%, #2b3548);
  color: var(--cream);
  min-height: 100vh;
  min-height: 100dvh;
}

/* drifting soft glow orbs (decor) */
.orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; animation: orbdrift 26s ease-in-out infinite alternate; }
.orb.o1 { width: 300px; height: 300px; left: 6%;  top: 12%; background: rgba(242, 183, 198, .35); }
.orb.o2 { width: 380px; height: 380px; right: 4%; top: 46%; background: rgba(217, 154, 119, .28); animation-delay: -8s; }
.orb.o3 { width: 260px; height: 260px; left: 34%; bottom: 2%; background: rgba(85, 97, 126, .30); animation-delay: -16s; }
@keyframes orbdrift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(36px, -44px) scale(1.12); }
}

/* ── typography helpers ───────────────────────────────────────────── */
.script  { font-family: var(--script); font-weight: 400; }
.serif   { font-family: var(--serif); }

.eyebrow {
  font-family: var(--serif);
  font-size: .78rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 1.1rem;
}

h1, h2 {
  font-family: var(--serif);
  font-weight: 500;
  color: var(--navy);
  line-height: 1.18;
}
h2 { font-size: clamp(1.7rem, 4.6vw, 2.5rem); margin-bottom: .9rem; }

.scene-navy h2 { color: var(--cream); }

.script-title {
  font-family: var(--script);
  font-size: clamp(2.3rem, 7vw, 3.6rem);
  color: var(--rust-deep);
  line-height: 1.15;
}
.scene-navy .script-title { color: var(--pink-soft); }

.soft-line { color: var(--ink-soft); font-style: italic; }

/* ── glossy buttons ───────────────────────────────────────────────── */
.btn {
  --c1: var(--rust-soft); --c2: var(--rust);
  position: relative;
  overflow: hidden;
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--serif);
  font-size: 1.02rem;
  letter-spacing: .04em;
  color: #fff;
  padding: .82rem 1.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .38);
  background: linear-gradient(180deg, var(--c1), var(--c2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5),
              inset 0 -8px 14px rgba(0, 0, 0, .10),
              0 12px 26px rgba(163, 92, 64, .30);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .18);
  cursor: pointer;
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), box-shadow .28s, filter .28s;
  user-select: none;
}
.btn::before {  /* the gloss sweep */
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(115deg,
    transparent 32%, rgba(255, 255, 255, .55) 47%,
    rgba(255, 255, 255, .18) 54%, transparent 70%);
  transform: translateX(-130%);
  transition: transform .9s ease;
  pointer-events: none;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 16px 30px rgba(163, 92, 64, .34); }
.btn:hover:not(:disabled)::before { transform: translateX(130%); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }

.btn-pink  { --c1: var(--pink-soft); --c2: var(--pink-deep); box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 12px 26px rgba(217,122,150,.35); }
.btn-navy  { --c1: var(--navy-mist); --c2: var(--navy); box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 12px 26px rgba(43,53,72,.35); }
.btn-ghost {
  background: rgba(255, 255, 255, .5);
  color: var(--navy);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 8px 20px rgba(58,70,94,.12);
  text-shadow: none;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}

.link-quiet {
  font-family: var(--serif); font-size: .95rem; color: var(--ink-soft);
  border-bottom: 1px dotted rgba(111, 102, 90, .5);
}
.scene-navy .link-quiet { color: rgba(248, 242, 233, .75); border-color: rgba(248,242,233,.4); }

/* ── glass cards & chips ──────────────────────────────────────────── */
.glass {
  background: rgba(255, 255, 255, .58);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 22px;
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, .85);
}

.glass-navy {
  background: rgba(248, 242, 233, .10);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid rgba(248, 242, 233, .20);
  border-radius: 18px;
  color: var(--cream);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 14px 34px rgba(15, 22, 36, .35);
}

/* stat chips (days counter etc.) */
.chip-stat {
  min-width: 108px;
  padding: .7rem 1.1rem;
  text-align: center;
  border-radius: 16px;
}
.chip-stat .k {
  font-family: var(--serif);
  font-size: .62rem; letter-spacing: .26em; text-transform: uppercase;
  color: var(--ink-soft);
}
.chip-stat .v {
  font-family: var(--serif); font-size: 1.55rem; color: var(--navy);
  font-variant-numeric: tabular-nums;
}
.chip-row { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* ── entrance animations ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
html.js .fx { opacity: 0; }
html:not(.js) .fx { opacity: 1; }   /* no JS? content still shows, just static */
.screen.active .fx, .stage-once .fx, .login-wrap .fx {
  animation: fadeUp .75s cubic-bezier(.2, .8, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 130ms + 120ms);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(.82); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes shakeX {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

/* ════════════════════════════════════════════════════════════════════
   THE HEART & ITS BLOOM  (login gate + journey welcome)
   ════════════════════════════════════════════════════════════════════ */

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.085); }
  28% { transform: scale(.985); }
  42% { transform: scale(1.06); }
  60% { transform: scale(1); }
}
@keyframes heartSquish {  /* wrong passcode */
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.14, .82); }
  70% { transform: scale(.94, 1.05); }
}

.bloom {
  position: relative;
  width: 288px; height: 288px;
  margin: 0 auto;
}
.bloom::before {  /* soft aura behind everything */
  content: "";
  position: absolute; inset: -14%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 183, 198, .38), transparent 65%);
  filter: blur(6px);
  animation: aura 4.5s ease-in-out infinite alternate;
}
@keyframes aura {
  from { opacity: .6; transform: scale(.96); }
  to   { opacity: 1;  transform: scale(1.05); }
}

.bloom .bud {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  z-index: 3;
  transition: transform 1.1s cubic-bezier(.3, .7, .3, 1), opacity 1s ease;
}
.bloom .bud svg {
  width: 46%;
  filter: drop-shadow(0 12px 26px rgba(232, 154, 176, .55));
}
.bloom .bud svg .hbeat { animation: heartbeat 1.9s ease-in-out infinite; transform-origin: 50% 45%; }
.bloom.squish .bud svg .hbeat { animation: heartSquish .55s ease; }

.bloom .petal {
  position: absolute;
  left: 50%; top: 50%;
  width: 58px; height: 92px;
  margin: -92px 0 0 -29px;           /* bottom edge sits at centre */
  transform-origin: 50% 100%;
  border-radius: 50% / 100% 100% 0 0; /* dome petal */
  background: radial-gradient(130% 95% at 34% 16%, var(--p1), var(--p2) 72%);
  box-shadow: inset 0 -8px 16px rgba(0, 0, 0, .05), inset 0 2px 4px rgba(255, 255, 255, .45);
  opacity: 0;
  transform: rotate(var(--ca)) scale(.27);
  z-index: 2;
  transition:
    transform 1.45s cubic-bezier(.22, .85, .25, 1) var(--d, 0ms),
    opacity  .95s ease var(--d, 0ms);
}

.bloom.open .petal {
  opacity: 1;
  transform: rotate(var(--oa)) scale(var(--ps, 1));
}
.bloom.open .bud {
  transform: scale(1.75);
  opacity: 0;
}
.bloom.open .petal { z-index: 4; }

.bloom .bloom-title {
  position: absolute; inset: -12% 0;
  z-index: 6;
  display: grid; place-items: center;
  text-align: center;
  padding: 0 .8rem;               /* longer titles wrap, never touch edges */
  opacity: 0;
  transform: scale(.66);
  transition: opacity .9s ease .85s, transform 1s cubic-bezier(.2, .8, .2, 1) .85s;
}
.bloom.open .bloom-title { opacity: 1; transform: scale(1); }
.bloom .bloom-title .bt-script {
  font-family: var(--script);
  font-size: 2.1rem;
  color: var(--rust-deep);
  line-height: 1.1;
}
.bloom .bloom-title .bt-names {
  font-family: var(--serif);
  font-size: 1.12rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--navy-mist);
  margin-top: .5rem;
}

/* ════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ════════════════════════════════════════════════════════════════════ */
.login-wrap {
  position: relative; z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;              /* mobile address-bar safe */
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.6rem;
  padding: 2.2rem 1.2rem 3rem;
  text-align: center;
  transition: opacity .8s ease;
}
.login-wrap .login-script {
  font-family: var(--script);
  font-size: clamp(1.8rem, 5.5vw, 2.6rem);
  color: var(--pink-soft);
  text-shadow: 0 2px 18px rgba(232, 154, 176, .35);
}

.pass-card {
  width: min(400px, 92vw);
  padding: 1.9rem 1.7rem 1.6rem;
}
.pass-card label {
  display: block;
  font-family: var(--serif);
  font-size: .68rem; letter-spacing: .3em; text-transform: uppercase;
  color: rgba(248, 242, 233, .66);
  margin-bottom: .7rem;
}
.pass-input {
  width: 100%;
  background: rgba(248, 242, 233, .08);
  border: none;
  border-bottom: 1.5px solid rgba(248, 242, 233, .4);
  color: var(--cream);
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: .45em;
  text-align: center;
  padding: .45rem .2rem;
  transition: border-color .3s, background .3s;
}
.pass-input::placeholder { color: rgba(248, 242, 233, .3); letter-spacing: .2em; }
.pass-input:focus { outline: none; border-color: var(--pink-soft); background: rgba(248, 242, 233, .13); }

.pass-msg {
  min-height: 1.5rem;
  font-style: italic;
  font-size: 1rem;
  color: var(--pink-soft);
  margin: .8rem 0 .4rem;
  opacity: .92;
}
.pass-msg.err { animation: shakeX .5s ease; }

.riddle {
  width: min(400px, 92vw);
  padding: 1.15rem 1.4rem 1.3rem;
  text-align: left;
}
.riddle .riddle-toggle {
  font-family: var(--serif);
  font-size: .95rem;
  color: rgba(248, 242, 233, .85);
  display: inline-flex; align-items: center; gap: .5rem;
}
.riddle .riddle-toggle::before {
  content: "♥"; color: var(--pink-soft); font-size: 1rem;
  transition: transform .3s;
}
.riddle-body {
  max-height: 0; overflow: hidden;
  transition: max-height .55s ease, margin .45s ease, opacity .5s ease;
  opacity: 0;
}
.riddle.open .riddle-body { max-height: 320px; margin-top: .8rem; opacity: 1; }
.riddle-body .rb-title {
  font-family: var(--script);
  font-size: 1.7rem;
  color: var(--pink-soft);
  margin-bottom: .35rem;
}
.riddle-body p {
  color: rgba(248, 242, 233, .88);
  font-style: italic;
  font-size: 1.06rem;
  white-space: pre-line;
  line-height: 1.65;
}

.login-foot {
  font-family: var(--serif);
  font-size: .8rem;
  letter-spacing: .18em;
  color: rgba(248, 242, 233, .45);
}
.login-foot .h { color: var(--pink); }

/* success transition */
#fadeVeil {
  position: fixed; inset: 0; z-index: 90;
  background: var(--cream);
  opacity: 0; pointer-events: none;
  transition: opacity 1s ease;
}
#fadeVeil.on { opacity: 1; }

/* ════════════════════════════════════════════════════════════════════
   THE JOURNEY  (story.html)
   ════════════════════════════════════════════════════════════════════ */
#stage {
  position: relative; z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;                          /* mobile address-bar safe */
  padding-bottom: 110px;            /* room for journey bar */
}

.screen { display: none; }
.screen.hidden { display: none !important; }   /* temporarily retired screens */
.screen.active {
  display: flex;
  flex-direction: column;
  align-items: center; justify-content: center;
  min-height: calc(100vh - 110px);
  min-height: calc(100dvh - 110px);            /* mobile address-bar safe */
  padding: 3rem 1.3rem 2rem;
  text-align: center;
}
.screen .col {
  width: min(660px, 100%);
  display: flex; flex-direction: column; align-items: center;
}

/* journey bar */
#journeyBar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1.4rem;
  /* NOTE: no backdrop-filter here — a blur region creates a hard
     horizontal edge across the page when content scrolls under it.
     A soft fading gradient does the same job invisibly. */
  background: linear-gradient(180deg,
    rgba(248, 242, 233, 0),
    rgba(248, 242, 233, .55) 26%,
    rgba(248, 242, 233, .96) 68%);
}
#dots { display: flex; gap: .55rem; align-items: center; }
.dot {
  font-size: 1rem;
  line-height: 1;
  color: rgba(85, 97, 126, .38);
  transition: transform .25s, color .25s, text-shadow .25s;
  padding: .3rem .15rem;
}
.dot:hover { transform: scale(1.3); }
.dot.seen { color: var(--rust-soft); }
.dot.here { color: var(--pink-deep); transform: scale(1.45); text-shadow: 0 0 12px rgba(232, 154, 176, .7); }

/* ── 1 · days together ────────────────────────────────────────────── */
.days-big {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(4.2rem, 17vw, 7.6rem);
  line-height: 1;
  background: linear-gradient(180deg, var(--rust-soft) 8%, var(--rust-deep) 88%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 16px rgba(163, 92, 64, .25));
  font-variant-numeric: tabular-nums;
}
.days-word {
  font-family: var(--script);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  color: var(--navy-mist);
  margin: .2rem 0 1.4rem;
}

/* ── 2 · timeline ─────────────────────────────────────────────────── */
.tl {
  list-style: none;
  position: relative;
  text-align: left;
  width: min(560px, 100%);
  padding: .4rem 0 .4rem 46px;
  margin-top: 1.1rem;
}
.tl::before {
  content: "";
  position: absolute; left: 15px; top: 10px; bottom: 10px;
  width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--rust-soft), var(--rust) 45%, var(--navy-mist));
  box-shadow: 0 0 14px rgba(217, 154, 119, .45);
}
.tl li { position: relative; margin: 1.55rem 0; }
.tl li::before {
  content: "♥";
  position: absolute; left: -37px; top: 1px;
  color: var(--pink-deep);
  font-size: 1.05rem;
  text-shadow: 0 0 0 1.5px var(--cream), 0 2px 8px rgba(217, 122, 150, .55);
  animation: popIn .6s both;
  animation-delay: var(--i, 0ms);
}
.tl .tl-when {
  font-family: var(--script);
  font-size: 1.35rem;
  color: var(--rust);
  line-height: 1.2;
}
.tl .tl-title {
  font-family: var(--serif);
  font-size: 1.22rem;
  color: var(--navy);
  margin: .1rem 0 .15rem;
}
.tl .tl-note {
  color: var(--ink-soft);
  font-style: italic;
  font-size: 1.02rem;
}

/* ── 3 · polaroids ────────────────────────────────────────────────── */
.polo-row {
  display: flex; flex-wrap: wrap; gap: 1.6rem 1.4rem;
  justify-content: center;
  margin: 1.6rem 0 .4rem;
}
.polo {
  --tilt: -3deg;
  position: relative;
  background: var(--paper);
  padding: 12px 12px 10px;
  border-radius: 6px;
  box-shadow: 0 16px 32px rgba(58, 70, 94, .20);
  transform: rotate(var(--tilt));
  transition: transform .4s cubic-bezier(.2, .8, .2, 1), box-shadow .4s;
  cursor: zoom-in;
}
.polo::after {  /* glossy photo sheen */
  content: "";
  position: absolute; inset: 12px 12px calc(32% + 10px);
  border-radius: 2px;
  background: linear-gradient(118deg, rgba(255,255,255,.34) 0%, rgba(255,255,255,0) 34%, rgba(255,255,255,0) 62%, rgba(255,255,255,.2) 100%);
  pointer-events: none;
}
.polo:hover {
  transform: rotate(0deg) translateY(-8px) scale(1.04);
  box-shadow: 0 26px 44px rgba(58, 70, 94, .26);
  z-index: 2;
}
.polo img {
  width: 168px; height: 168px;
  object-fit: cover;
  background: var(--cream-deep);
  border-radius: 2px;
}
.polo figcaption {
  font-family: var(--script);
  font-size: 1.25rem;
  color: #6b5b4e;
  text-align: center;
  padding: .5rem .2rem .25rem;
}

/* lightbox */
#lightbox {
  position: fixed; inset: 0; z-index: 80;
  display: none;
  place-items: center;
  background: rgba(43, 53, 72, .58);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  cursor: zoom-out;
}
#lightbox.on { display: grid; }
#lightbox img {
  max-width: min(86vw, 640px);
  max-height: 74vh;
  border-radius: 10px;
  border: 10px solid var(--paper);
  box-shadow: 0 30px 80px rgba(15, 22, 36, .5);
  animation: popIn .45s both;
}
#lightbox .lb-cap {
  position: absolute; bottom: 7vh;
  font-family: var(--script);
  font-size: 1.9rem;
  color: var(--cream);
  text-shadow: 0 2px 14px rgba(0, 0, 0, .5);
}

/* ── 4 · the letter ───────────────────────────────────────────────── */
.env-wrap { display: flex; flex-direction: column; align-items: center; }
.env {
  width: min(300px, 74vw);
  cursor: pointer;
  filter: drop-shadow(0 16px 30px rgba(58, 70, 94, .25));
  transition: transform .35s;
}
.env:hover { transform: translateY(-4px) scale(1.015); }
.env .env-flap {
  transform-box: fill-box;
  transform-origin: 50% 0%;
  transition: transform .65s cubic-bezier(.4, 0, .2, 1);
}
.env.open .env-flap { transform: scaleY(-1); }
.env .env-seal { transition: opacity .4s; transform-box: fill-box; transform-origin: center; }
.env.open .env-seal { opacity: 0; transform: scale(1.6) rotate(14deg); }
.env .env-hint {
  font-family: var(--serif); font-size: .68rem; letter-spacing: .28em;
  fill: rgba(107, 91, 78, .75); text-anchor: middle;
}

.letter-card {
  width: min(560px, 94vw);
  margin-top: 1.4rem;
  padding: 2rem 2rem 1.7rem;
  text-align: left;
  background:
    repeating-linear-gradient(180deg, transparent 0 34px, rgba(192, 122, 91, .09) 34px 35px),
    var(--paper);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  transform: rotate(-.6deg);
  position: relative;
  display: none;
}
.letter-card.show { display: block; animation: popIn .6s both; }
.letter-card .lt-for {
  font-family: var(--script);
  font-size: 1.9rem;
  color: var(--rust);
  margin-bottom: 1rem;
}
.letter-card .lt-body {
  min-height: 130px;
  max-height: 46vh;                            /* bound the letter… */
  max-height: 46dvh;                           /* …so the page never re-flows while it types */
  overflow-y: auto;
  overscroll-behavior: contain;                /* swiping inside won't fling the page */
  scrollbar-width: thin;
  scrollbar-color: rgba(192, 122, 91, .4) transparent;
  white-space: pre-wrap;
  font-style: italic;
  font-size: 1.18rem;
  line-height: 34px;              /* matches ruled lines */
  color: var(--ink);
}
/* long letters arrive at full height, so typing never re-flows the page */
.letter-card .lt-body.tall {
  height: min(46vh, 380px);
  height: min(46dvh, 380px);
  min-height: 0;
}
.letter-card .lt-body::-webkit-scrollbar { width: 5px; }
.letter-card .lt-body::-webkit-scrollbar-thumb {
  background: rgba(192, 122, 91, .4); border-radius: 99px;
}
.letter-card .lt-body::-webkit-scrollbar-track { background: transparent; }
.letter-card .lt-caret {
  display: inline-block;
  width: 2px; height: 1.05em;
  background: var(--rust);
  vertical-align: -.18em;
  margin-left: 2px;
  animation: caretblink 1s step-end infinite;
}
@keyframes caretblink { 50% { opacity: 0; } }
.letter-card .lt-sign {
  font-family: var(--script);
  font-size: 1.7rem;
  color: var(--navy-mist);
  text-align: right;
  margin-top: 1.1rem;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.letter-card.done .lt-sign { opacity: 1; }
.letter-card .lt-skip {
  margin-top: .6rem;
  font-family: var(--serif); font-size: .78rem; color: var(--ink-soft);
  letter-spacing: .12em;
}

/* ── 5 · scratch card ─────────────────────────────────────────────── */
.scratch-wrap {
  position: relative;
  width: min(360px, 88vw);
  aspect-ratio: 2 / 1.16;
  border-radius: 18px;
  margin: 1.3rem 0 .4rem;
  box-shadow: var(--shadow-lift);
  background: var(--paper);
}
.scratch-prize {
  position: absolute; inset: 0;
  border-radius: 18px;
  display: grid; place-items: center;
  padding: 1rem;
  text-align: center;
  background:
    radial-gradient(120% 130% at 80% 10%, rgba(242, 183, 198, .5), transparent 55%),
    radial-gradient(120% 130% at 12% 92%, rgba(217, 154, 119, .4), transparent 55%),
    var(--paper);
}
.scratch-prize .sp-script {
  font-family: var(--script);
  font-size: 1.55rem;
  color: var(--rust-deep);
  line-height: 1.3;
  white-space: pre-line;
}
.scratch-prize.won { animation: prizeGlow 1.6s ease; }
@keyframes prizeGlow {
  0%   { box-shadow: 0 0 0 0 rgba(232, 154, 176, .0); }
  35%  { box-shadow: 0 0 42px 10px rgba(232, 154, 176, .55); }
  100% { box-shadow: var(--shadow-lift); }
}
#scratchCanvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border-radius: 18px;
  cursor: crosshair;
  touch-action: none;
}
#scratchCanvas.away { transition: opacity .9s ease, transform .9s ease; opacity: 0; transform: scale(1.12); pointer-events: none; }
.scratch-tip {
  font-family: var(--serif); font-size: .8rem; letter-spacing: .2em;
  color: var(--ink-soft);
}

/* ── 6 & 7 · game intros ──────────────────────────────────────────── */
.intro-card {
  width: min(520px, 94vw);
  padding: 2rem 1.8rem 1.8rem;
  display: flex; flex-direction: column; align-items: center; gap: .8rem;
}
.intro-card .ic-icon { width: 84px; margin-bottom: .2rem; filter: drop-shadow(0 8px 18px rgba(58,70,94,.25)); }
.intro-card p { color: var(--ink-soft); max-width: 40ch; }
.intro-card .ic-best {
  font-family: var(--serif); font-size: .95rem;
  color: var(--rust);
  border: 1px dashed rgba(192, 122, 91, .5);
  padding: .3rem .9rem; border-radius: 999px;
}
.intro-card .ic-list {
  list-style: none; text-align: left;
  color: var(--ink-soft); font-size: 1rem;
}
.intro-card .ic-list li { padding: .18rem 0 .18rem 1.35rem; position: relative; }
.intro-card .ic-list li::before { content: "♥"; position: absolute; left: 0; color: var(--pink-deep); font-size: .85rem; }

/* ── 8 · finale ───────────────────────────────────────────────────── */
.finale-script {
  font-family: var(--script);
  font-size: clamp(2rem, 6.5vw, 3.1rem);
  color: var(--rust-deep);
  max-width: 18ch;
  line-height: 1.35;
}
.finale-btns { display: flex; gap: .8rem; flex-wrap: wrap; justify-content: center; margin-top: 1.6rem; }
.finale-foot { margin-top: 2.2rem; font-family: var(--serif); font-size: .8rem; letter-spacing: .24em; color: var(--ink-soft); }

/* falling hearts (finale & login success) */
.p-heart { position: fixed; z-index: 70; pointer-events: none; will-change: transform, opacity; }

/* ════════════════════════════════════════════════════════════════════
   CUPID'S DARTS  (darts.html)
   ════════════════════════════════════════════════════════════════════ */
.darts-body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }

.darts-hud {
  position: relative; z-index: 30;
  display: flex; align-items: center; gap: .7rem;
  padding: .8rem 1.1rem;
  flex-wrap: wrap;
}
.darts-hud .hud-back {
  font-family: var(--script); font-size: 1.4rem; color: var(--pink-soft);
  padding: .2rem .5rem;
}
.chip-hud {
  flex: 0 0 auto;
  min-width: 84px;
  padding: .45rem .9rem;
  text-align: center;
  border-radius: 15px;
}
.chip-hud .k {
  font-family: var(--serif); font-size: .58rem;
  letter-spacing: .24em; text-transform: uppercase;
  color: rgba(248, 242, 233, .62);
}
.chip-hud .v {
  font-family: var(--serif); font-size: 1.3rem;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.chip-hud.spacer { flex: 1; min-width: 0; background: none; border: none; box-shadow: none; }
.chip-hud.urgent .v { color: var(--pink-soft); animation: urgentPulse 1s ease infinite; }
@keyframes urgentPulse { 50% { transform: scale(1.13); text-shadow: 0 0 16px rgba(232,154,176,.9); } }
.chip-hud .v.combo-on { color: var(--pink-soft); }
.chip-hud.wiggle { animation: comboWiggle .4s ease; }
@keyframes comboWiggle { 30% { transform: rotate(-3.5deg) scale(1.06); } 70% { transform: rotate(3deg) scale(1.03); } }

#arena {
  position: relative;
  flex: 1;
  overflow: hidden;
  cursor: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* starfield */
.star { position: absolute; border-radius: 50%; background: rgba(248, 242, 233, .8); animation: twinkle var(--tw, 3s) ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .12; } to { opacity: .85; } }

/* the drifting beloved */
#target {
  position: absolute;
  width: var(--ts, 240px); height: var(--ts, 240px);
  z-index: 10;
  will-change: transform;
}
#target img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid rgba(242, 183, 198, .9);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55), 0 0 34px rgba(232, 154, 176, .4);
  background: var(--cream-deep);
}
#target.oww img { animation: oww .32s ease; }
@keyframes oww { 40% { transform: scale(.93); filter: brightness(1.14); } }

/* crosshair */
#crosshair {
  position: absolute;
  width: 48px; height: 48px;
  margin: -24px 0 0 -24px;
  border: 2px solid rgba(242, 183, 198, .95);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(232, 154, 176, .45), inset 0 0 12px rgba(232, 154, 176, .3);
  pointer-events: none;
  z-index: 25;
  opacity: 0;
  transition: opacity .25s;
}
#arena.aiming #crosshair { opacity: 1; }
#crosshair::before {
  content: ""; position: absolute;
  left: calc(50% - 1px); top: -2px; width: 2px; height: 100%;
  background: linear-gradient(180deg, var(--pink-soft) 0 26%, transparent 26% 74%, var(--pink-soft) 74% 100%);
}
#crosshair::after {
  content: ""; position: absolute;
  top: calc(50% - 1px); left: -2px; height: 2px; width: 100%;
  background: linear-gradient(90deg, var(--pink-soft) 0 26%, transparent 26% 74%, var(--pink-soft) 74% 100%);
}
#crosshair i {
  position: absolute; left: 50%; top: 50%;
  width: 6px; height: 6px; margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--pink-glow);
  box-shadow: 0 0 10px rgba(251, 215, 224, .9);
}

/* a thrown dart */
.dart {
  position: absolute;
  z-index: 22;
  pointer-events: none;
  animation: dartIn .16s cubic-bezier(.2, .8, .3, 1.2) both;
  filter: drop-shadow(0 6px 8px rgba(15, 22, 36, .5));
}
@keyframes dartIn {
  from { transform: translate(var(--dx), var(--dy)) scale(2) rotate(0deg); opacity: 0; }
  to   { transform: translate(0, 0) scale(1) rotate(var(--rot)); opacity: 1; }
}
.dart.bye { animation: dartOut .5s ease both; }
@keyframes dartOut { to { opacity: 0; transform: translateY(-26px) rotate(var(--rot)); } }

/* floating score labels */
.float {
  position: absolute;
  z-index: 28;
  pointer-events: none;
  font-family: var(--serif);
  color: var(--pink-glow);
  text-shadow: 0 2px 12px rgba(15, 22, 36, .6);
  white-space: nowrap;
  transform: translate(-50%, -110%);
  animation: floatUp 1s ease-out both;
}
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, -70%) scale(.7); }
  18%  { opacity: 1; transform: translate(-50%, -105%) scale(1.12); }
  100% { opacity: 0; transform: translate(-50%, -200%) scale(1); }
}
.float.bull { color: #fff; font-size: 1.35rem; }
.float.miss { color: rgba(248, 242, 233, .75); font-size: .95rem; font-style: italic; }

/* game overlays (start / end) */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: rgba(43, 53, 72, .55);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 1.2rem;
}
.overlay.off { display: none; }
.overlay .ov-card {
  width: min(430px, 94vw);
  padding: 2rem 1.8rem 1.8rem;
  text-align: center;
  background: linear-gradient(165deg, #fffdf8, #f4ecdd);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: 0 30px 70px rgba(15, 22, 36, .45);
  animation: popIn .5s both;
}
.overlay .ov-script { font-family: var(--script); font-size: 2.2rem; color: var(--rust-deep); }
.overlay .ov-big {
  font-family: var(--serif); font-weight: 700;
  font-size: 3.6rem; line-height: 1.1;
  background: linear-gradient(180deg, var(--rust-soft), var(--rust-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.overlay .ov-sub { color: var(--ink-soft); font-style: italic; margin: .4rem 0 1.1rem; }
.overlay .ov-row { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }
.overlay .ov-badge {
  font-family: var(--serif); font-size: .9rem; color: var(--rust);
  border: 1px dashed rgba(192, 122, 91, .5);
  border-radius: 999px; padding: .25rem .8rem; margin-bottom: .9rem;
  display: inline-block;
}

/* ════════════════════════════════════════════════════════════════════
   PIXEL LOVE  (pixels.html)
   ════════════════════════════════════════════════════════════════════ */
.px-body {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  overflow: hidden;
}

.px-head {
  position: relative; z-index: 20;
  display: flex; align-items: center; gap: .9rem;
  padding: .7rem 1.1rem .5rem;
  flex-wrap: wrap;
}
.px-head .px-back { font-family: var(--script); font-size: 1.4rem; color: var(--rust); }
.px-head h1 { font-size: 1.25rem; margin: 0; }
.px-thumbs { display: flex; gap: .55rem; margin-left: auto; }
.thumb {
  position: relative;
  width: 52px; height: 52px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .75);
  box-shadow: 0 5px 14px rgba(58, 70, 94, .18), inset 0 1px 0 rgba(255,255,255,.6);
  cursor: pointer;
  transition: transform .25s, box-shadow .25s;
  background: var(--cream-deep);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover { transform: translateY(-3px); }
.thumb.sel { box-shadow: 0 0 0 3px var(--pink-deep), 0 8px 18px rgba(58,70,94,.25); }
.thumb .tp {
  position: absolute; right: 2px; bottom: 2px;
  font-family: var(--serif); font-size: .6rem; font-weight: 700;
  background: rgba(255, 253, 246, .92);
  color: var(--ink);
  padding: 1px 5px; border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.thumb .td {
  position: absolute; left: 3px; top: 3px;
  color: var(--pink-deep);
  font-size: .8rem;
  text-shadow: 0 0 4px rgba(255,255,255,.9);
}

.px-toolbar {
  position: relative; z-index: 20;
  display: flex; align-items: center; gap: .55rem;
  padding: .3rem 1.1rem .55rem;
  flex-wrap: wrap;
}
.tbtn {
  width: 40px; height: 40px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .62);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 5px 12px rgba(58,70,94,.14);
  color: var(--navy);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, color .2s;
}
.tbtn:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 8px 16px rgba(58,70,94,.2); }
.tbtn:active { transform: scale(.94); }
.tbtn.on { color: #fff; background: linear-gradient(180deg, var(--navy-mist), var(--navy)); border-color: rgba(255,255,255,.3); }
.tbtn svg { width: 20px; height: 20px; }
.tbtn.hold:active { color: var(--pink-deep); }

.px-progress {
  display: flex; align-items: center; gap: .5rem;
  margin-left: auto;
  min-width: 150px;
}
.pbar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(85, 97, 126, .16);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(43, 53, 72, .25);
}
.pbar i {
  display: block; height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink-soft), var(--pink-deep) 55%, var(--rust));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5);
  transition: width .35s ease;
}
.px-progress .pv {
  font-family: var(--serif); font-size: .95rem; color: var(--navy);
  font-variant-numeric: tabular-nums;
  min-width: 3.2em; text-align: right;
}

.px-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 1.1rem;
  border-radius: 20px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, .8);
  box-shadow: var(--shadow-soft), inset 0 0 0 1px var(--line);
  overflow: hidden;
}
#gridCanvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  touch-action: none;
  cursor: crosshair;
}
.px-stage.pan #gridCanvas { cursor: grab; }
.px-stage.panning #gridCanvas { cursor: grabbing; }
.px-hint {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  font-family: var(--serif); font-size: .74rem; letter-spacing: .16em;
  color: var(--ink-soft);
  background: rgba(255, 253, 246, .85);
  padding: .25rem .8rem; border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
  max-width: 94%;
  overflow: hidden; text-overflow: ellipsis;
}

/* palette dock */
.px-palette {
  position: relative; z-index: 20;
  display: flex; gap: .65rem;
  padding: .65rem 1.1rem .95rem;
  overflow-x: auto;
  scrollbar-width: thin;
}
.px-palette::-webkit-scrollbar { height: 6px; }
.px-palette::-webkit-scrollbar-thumb { background: rgba(85, 97, 126, .3); border-radius: 99px; }

.sw {
  position: relative;
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, .65);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -6px 10px rgba(0,0,0,.08), 0 5px 12px rgba(58,70,94,.16);
  cursor: pointer;
  transition: transform .22s, box-shadow .22s, opacity .3s;
}
.sw:hover { transform: translateY(-4px); }
.sw.sel {
  transform: translateY(-7px) scale(1.1);
  box-shadow: 0 0 0 3px var(--pink-deep), 0 12px 22px rgba(58,70,94,.28);
}
.sw.done { opacity: .4; }
.sw.pop { animation: swPop .5s ease; }
@keyframes swPop { 40% { transform: scale(1.25) rotate(-6deg); } }
.sw .n {
  position: absolute; top: -7px; left: -7px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif); font-size: .68rem; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
}
.sw .c {
  position: absolute; bottom: -7px; right: -5px;
  font-family: var(--serif); font-size: .62rem; font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border-radius: 8px;
  padding: 0 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
  font-variant-numeric: tabular-nums;
}
.sw .ok {
  position: absolute; inset: 0;
  border-radius: 13px;
  display: none;
  place-items: center;
  color: #fff;
  font-size: 1.05rem;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
}
.sw.done .ok { display: grid; }

/* pixel reveal overlay */
.reveal-card {
  width: min(470px, 94vw);
  text-align: center;
  padding: 1.8rem 1.6rem 1.6rem;
}
.reveal-card .rv-frame {
  margin: .8rem auto 1rem;
  width: min(300px, 70vw);
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  border: 8px solid var(--paper);
  box-shadow: var(--shadow-lift);
  position: relative;
  background: var(--cream-deep);
}
.reveal-card canvas, .reveal-card img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}
.reveal-card img { image-rendering: auto; opacity: 0; transition: opacity 1.1s ease; }
.reveal-card.real img { opacity: 1; }
.reveal-card.real canvas { opacity: 0; }
.reveal-card canvas { transition: opacity 1.1s ease; }

/* ── small responsive touches ─────────────────────────────────────── */
@media (max-width: 700px) {
  .screen.active { padding: 2.4rem 1rem 1.6rem; }
  #journeyBar { flex-direction: column; gap: .5rem; padding: .6rem .8rem .9rem; }
  #dots { order: 1; }
  #journeyBar .btn { order: 2; width: 100%; justify-content: center; }
  .polo img { width: 132px; height: 132px; }
  .polo { padding: 9px 9px 7px; }
  .letter-card { padding: 1.5rem 1.2rem 1.3rem; }
  .letter-card .lt-body { font-size: 1.06rem; line-height: 30px; }
  .letter-card { background: repeating-linear-gradient(180deg, transparent 0 30px, rgba(192,122,91,.09) 30px 31px), var(--paper); }
  .darts-hud .chip-hud { min-width: 72px; padding: .35rem .7rem; }
  .darts-hud .chip-hud .v { font-size: 1.12rem; }
  .px-head h1 { font-size: 1.05rem; }
  .px-thumbs { margin-left: 0; }
  .px-progress { margin-left: 0; width: 100%; order: 2; }
  .px-thumbs { margin-left: auto; }
}

/* ── gentler for those who prefer less motion ─────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01s !important;
  }
  .bloom .petal { transition-duration: .15s !important; }
  .bloom .bloom-title { transition-delay: .2s !important; }
}
