/* Seventeen — pink / lilac / sky, the three colours she keeps saying she likes. */

@font-face { font-family: 'Cormorant'; src: url('/fonts/cormorant-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cormorant'; src: url('/fonts/cormorant-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Cormorant'; src: url('/fonts/cormorant-400i.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('/fonts/caveat-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Caveat'; src: url('/fonts/caveat-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Quicksand'; src: url('/fonts/quicksand-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Quicksand'; src: url('/fonts/quicksand-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }

:root {
  --cream:     #fff7f5;
  --paper:     #fffdfd;
  --blush:     #ffe3ec;
  --blush-deep:#ffc9dc;
  --rose:      #ef7fa6;
  --rose-deep: #d95f89;
  --lilac:     #cdb1ee;
  --lilac-deep:#a77fd0;
  --sky:       #a9daf2;
  --gold:      #ffc670;
  --gold-soft: #ffe6b8;
  --ink:       #5f4451;
  --ink-soft:  #937c88;
  --shadow:    0 18px 48px -22px rgba(146, 88, 118, .55);
  --radius:    26px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(120% 70% at 12% 0%,  #ffe9f1 0%, transparent 60%),
    radial-gradient(110% 60% at 92% 12%, #e9e0fb 0%, transparent 62%),
    radial-gradient(130% 70% at 50% 100%,#dff0fb 0%, transparent 58%),
    linear-gradient(170deg, #fff6f8 0%, #fdf4fb 46%, #f4f7fd 100%);
  background-attachment: fixed;
}

body {
  overscroll-behavior-y: none;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

#petals { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }

.screen { position: relative; z-index: 2; max-width: 520px; margin: 0 auto; padding: 0 18px 28px; }
[hidden] { display: none !important; }

/* ── the seventeen candles ─────────────────────────────────────────────── */
.rail-wrap { padding: 20px 2px 18px; }
.rail { display: flex; align-items: flex-end; justify-content: space-between; height: 40px; }

.candle {
  position: relative; width: 9px; flex: 0 0 9px; height: 27px; border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #fff 0%, var(--blush) 55%, var(--blush-deep) 100%);
  box-shadow: inset -1.5px 0 0 rgba(217, 95, 137, .14), inset 0 -2px 0 rgba(217, 95, 137, .18);
  opacity: .5; transition: opacity .5s ease, transform .5s ease;
}
.candle::after {                      /* the wick */
  content: ''; position: absolute; left: 50%; top: -3px; width: 1.5px; height: 4px;
  background: #b79aa6; transform: translateX(-50%); border-radius: 1px;
}
.candle::before {                     /* the flame */
  content: ''; position: absolute; left: 50%; top: -13px;
  width: 8px; height: 12px; transform: translateX(-50%) scale(0);
  border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%;
  background: radial-gradient(circle at 50% 70%, #fff6dd 0%, var(--gold) 45%, rgba(255,150,120,.75) 100%);
  box-shadow: 0 0 12px 4px rgba(255,196,110,.55), 0 0 26px 10px rgba(255,170,190,.30);
  transition: transform .45s cubic-bezier(.2,1.5,.4,1);
}
/* the one she is on: unlit, but the wick is warm and the wax is waiting */
.candle.now {
  opacity: .95;
  background: linear-gradient(180deg, #fff 0%, #ffe9f0 50%, var(--blush-deep) 100%);
}
.candle.now::after { background: var(--rose-deep); height: 5px; top: -4px; }
.candle.now::before {
  transform: translateX(-50%) scale(.5); opacity: .5;
  animation: waiting 2.4s ease-in-out infinite;
}
@keyframes waiting {
  0%,100% { transform: translateX(-50%) scale(.36); opacity: .35; }
  50%     { transform: translateX(-50%) scale(.62); opacity: .7; }
}
.candle.lit { opacity: 1; }
.candle.lit::before { transform: translateX(-50%) scale(1); animation: flicker 2.6s ease-in-out infinite; }
@keyframes flicker {
  0%,100% { transform: translateX(-50%) scale(1)   rotate(-1deg); }
  35%     { transform: translateX(-52%) scale(1.09) rotate(2deg); }
  70%     { transform: translateX(-48%) scale(.94)  rotate(-2deg); }
}

.rail-note {
  margin-top: 11px; text-align: center; font-size: 11px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-soft);
}

/* ── the letter ────────────────────────────────────────────────────────── */
.letter {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.93) 0%, rgba(255,250,252,.88) 100%);
  border: 1px solid rgba(255,190,214,.75);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 #fff;
  padding: 30px 22px 24px;
  backdrop-filter: blur(6px);
  animation: rise .7s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.letter-no {
  position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
  min-width: 30px; height: 30px; padding: 0 10px; border-radius: 15px;
  display: grid; place-items: center;
  font-family: 'Cormorant', serif; font-size: 16px; letter-spacing: .04em; color: #fff;
  font-variant-numeric: lining-nums; font-feature-settings: 'lnum' 1;
  background: linear-gradient(135deg, var(--rose) 0%, var(--lilac-deep) 100%);
  box-shadow: 0 6px 16px -6px rgba(200,100,150,.8);
}

.letter-title {
  margin: 2px 0 16px; text-align: center;
  font-family: 'Cormorant', serif; font-weight: 600; font-size: 25px; line-height: 1.24;
  letter-spacing: .01em; color: var(--rose-deep);
}

.letter-body {
  font-family: 'Cormorant', serif; font-size: 18.5px; line-height: 1.66; color: var(--ink);
}
.letter-body p { margin: 0 0 .85em; }
.letter-body p:last-child { margin-bottom: 0; }
.letter-body em { font-style: italic; color: var(--lilac-deep); }
/* What she has to send back. It has to be legible, but it is a line in his
   letter — not a task bar bolted under it. */
.letter-body .ask {
  margin-top: 1.2em; font-family: 'Cormorant', serif; font-size: 18.5px;
  font-style: italic; color: var(--rose-deep);
}
.letter-body .sign {
  margin-top: 1.1em; text-align: right;
  font-family: 'Caveat', cursive; font-size: 24px; color: var(--lilac-deep);
}

.stage { margin-top: 18px; }

/* Him, half to himself, in the margin. No box, no border: the moment it
   looks like a system message she is looking at a website. */
.nudge {
  margin: 16px 0 0; padding: 0 6px;
  font-family: 'Caveat', cursive; font-size: 20px; line-height: 1.35;
  color: rgba(167,127,208,.85); text-align: center;
  animation: rise .6s ease both;
}

/* ── answer ────────────────────────────────────────────────────────────── */
.answer { display: flex; gap: 10px; align-items: center; margin: 18px 2px 0; }
.answer-input {
  flex: 1; height: 50px; padding: 0 20px; border-radius: 25px;
  border: 1px solid rgba(255,183,209,.9); background: rgba(255,255,255,.92);
  font-family: 'Quicksand', sans-serif; font-size: 16px; font-weight: 600;
  letter-spacing: .14em; color: var(--rose-deep); text-align: center;
  box-shadow: inset 0 2px 8px rgba(226,150,180,.12);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.answer-input::placeholder { letter-spacing: .3em; color: #e7bed0; }
.answer-input:focus { border-color: var(--rose); box-shadow: 0 0 0 4px rgba(239,127,166,.15); }
/* A tally, not a text field: nothing to type here, so nothing should invite it. */
.answer-input.tally {
  font-family: 'Cormorant', serif; font-style: italic; font-size: 18px;
  letter-spacing: .02em; color: var(--lilac-deep); background: rgba(255,255,255,.72);
  caret-color: transparent; cursor: default;
}

.answer-send {
  width: 50px; height: 50px; flex: none; border: none; border-radius: 50%;
  display: grid; place-items: center; color: #fff; cursor: pointer;
  background: linear-gradient(140deg, var(--rose) 0%, var(--lilac-deep) 100%);
  box-shadow: 0 10px 22px -10px rgba(200,100,150,.9);
  transition: transform .18s ease, filter .18s ease;
}
.answer-send:active { transform: scale(.92); }
.answer-send[disabled] { filter: grayscale(.5) opacity(.6); cursor: default; }

.shake { animation: shake .42s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); }
  45% { transform: translateX(6px); }  70% { transform: translateX(-3px); }
}

/* ── toast ─────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 14px);
  z-index: 40; max-width: min(420px, 88vw); padding: 12px 20px; border-radius: 18px;
  background: rgba(95,68,81,.93); color: #fff5f8; backdrop-filter: blur(8px);
  font-family: 'Cormorant', serif; font-size: 17px; line-height: 1.4; text-align: center;
  box-shadow: 0 16px 40px -18px rgba(90,50,70,.9);
  opacity: 0; transition: opacity .3s ease, transform .3s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.warm { background: linear-gradient(135deg, rgba(239,127,166,.96), rgba(167,127,208,.96)); }

/* ── drawer ────────────────────────────────────────────────────────────── */
.drawer-btn {
  display: block; margin: 22px auto 0; padding: 9px 20px; border-radius: 20px; cursor: pointer;
  border: 1px solid rgba(205,177,238,.7); background: rgba(255,255,255,.6);
  font-family: 'Cormorant', serif; font-style: italic; font-size: 15px; color: var(--lilac-deep);
}
.drawer { position: fixed; inset: 0; z-index: 50; background: rgba(95,68,81,.38); backdrop-filter: blur(3px); }
.drawer-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow-y: auto;
  padding: 24px 20px calc(30px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0; background: var(--cream);
  box-shadow: 0 -20px 50px -24px rgba(120,70,100,.7);
  animation: sheetUp .38s cubic-bezier(.2,.9,.3,1) both;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-sheet h3 {
  margin: 0 0 16px; text-align: center; font-family: 'Cormorant', serif;
  font-weight: 600; font-size: 21px; color: var(--rose-deep);
}
.drawer-close {
  position: absolute; top: 14px; right: 16px; width: 32px; height: 32px; border: none; border-radius: 16px;
  background: rgba(255,255,255,.8); color: var(--ink-soft); font-size: 20px; line-height: 1; cursor: pointer;
}
.drawer-list { display: flex; flex-direction: column; gap: 12px; }
.card {
  padding: 16px 18px; border-radius: 18px; background: #fff;
  border: 1px solid rgba(255,196,218,.7); box-shadow: 0 10px 26px -18px rgba(180,110,150,.8);
}
.card .n { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--rose); }
.card .t { margin: 4px 0 6px; font-family: 'Cormorant', serif; font-size: 18px; color: var(--ink); }
.card .c { font-family: 'Caveat', cursive; font-size: 20px; line-height: 1.35; color: var(--lilac-deep); }
.card .a { margin-top: 8px; font-size: 12px; letter-spacing: .18em; color: #d8b6c6; }
.drawer-empty { text-align: center; font-family: 'Cormorant', serif; font-style: italic; color: var(--ink-soft); }

/* ── locked / done ─────────────────────────────────────────────────────── */
#locked, #done { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.lock-art {
  width: 132px; height: 132px; margin-bottom: 22px; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #fff7e3 0%, var(--gold-soft) 22%, rgba(255,198,112,.35) 45%, rgba(205,177,238,.22) 70%, transparent 78%);
  animation: breathe 4.6s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.07); opacity: 1; } }
.lock-title { margin: 0; font-family: 'Cormorant', serif; font-weight: 600; font-size: 46px; letter-spacing: .06em; color: var(--rose-deep); }
.lock-sub { margin: 10px 0 26px; font-family: 'Cormorant', serif; font-style: italic; font-size: 19px; color: var(--ink-soft); }
.lock-foot { margin-top: 26px; font-family: 'Caveat', cursive; font-size: 21px; color: var(--lilac-deep); }
.countdown { display: flex; gap: 10px; }
.cd-unit {
  min-width: 66px; padding: 12px 6px 9px; border-radius: 18px;
  background: rgba(255,255,255,.72); border: 1px solid rgba(255,196,218,.8);
  box-shadow: var(--shadow);
}
.cd-unit b { display: block; font-family: 'Cormorant', serif; font-size: 30px; font-weight: 600; color: var(--rose-deep); }
.cd-unit span { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-soft); }

@media (max-width: 360px) {
  .letter { padding: 26px 16px 20px; }
  .letter-body { font-size: 17.5px; }
}

/* ── the cover ─────────────────────────────────────────────────────────── */
.cover {
  position: fixed; inset: 0; max-width: none; padding: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  animation: rise .9s ease both;
}
.cover-sky {
  position: absolute; inset: 0;
  background: url('/art/cover-night-sea.webp') center 38% / cover no-repeat, #6b5f9a;
}
.cover-sky::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(60,44,78,.34) 0%, rgba(60,44,78,.06) 34%,
              rgba(72,48,86,.42) 72%, rgba(58,40,72,.72) 100%);
}
.cover-inner {
  position: relative; width: 100%; max-width: 440px;
  padding: 0 26px calc(38px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  height: 100%; text-align: center;
}
.cover-title {
  margin: 0 0 22px; font-family: 'Cormorant', serif; font-weight: 600;
  font-size: 54px; letter-spacing: .07em; color: #fff9f6;
  text-shadow: 0 2px 26px rgba(80,40,70,.55), 0 0 60px rgba(255,200,150,.25);
}
.cover-rail { width: min(100%, 300px); height: 34px; margin-bottom: 26px; }
.cover-rail .candle { opacity: .82; height: 24px; width: 8px; flex: 0 0 8px; }
.cover-line {
  margin: 0 0 30px; font-family: 'Cormorant', serif; font-style: italic;
  font-size: 19.5px; line-height: 1.55; color: #fff4f6;
  text-shadow: 0 2px 16px rgba(60,30,55,.75);
}
.cover-go {
  padding: 13px 30px; border-radius: 26px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.55); background: rgba(255,255,255,.14);
  backdrop-filter: blur(6px);
  font-family: 'Caveat', cursive; font-size: 23px; color: #fff;
  box-shadow: 0 10px 30px -14px rgba(0,0,0,.6);
  transition: transform .18s ease, background .18s ease;
}
.cover-go:active { transform: scale(.95); background: rgba(255,255,255,.26); }
.cover.leaving { opacity: 0; transform: scale(1.04); transition: opacity .7s ease, transform .7s ease; }
