/* Layout: a pink love-note card up top, then the rules and task lists, one column. */
:root {
  --paper: #FFF1F6;
  --surface: #FFFFFF;
  --ink: #3B1231;
  --muted: #8C5A78;
  --line: #F5CFE0;
  --hot: #D92C74;
  --rose: #B8236A;
  --tint: #FFE3EE;
  --done: #D92C74;
  --done-ink: #FFFFFF;
  --display: "Playfair Display", "Didot", Georgia, serif;
  --body: "DM Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: var(--body); /* small caps labels and badges */
  color-scheme: light;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1C0A18; --surface: #2A1024; --ink: #FCE6F0; --muted: #CC9DB8; --line: #4D2243;
    --hot: #FF6FA8; --rose: #FF9CC6; --tint: #3A1532; --done: #FF6FA8; --done-ink: #1C0A18;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1C0A18; --surface: #2A1024; --ink: #FCE6F0; --muted: #CC9DB8; --line: #4D2243;
  --hot: #FF6FA8; --rose: #FF9CC6; --tint: #3A1532; --done: #FF6FA8; --done-ink: #1C0A18;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  font-variant-numeric: tabular-nums;
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap {
  max-width: 46rem; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 2rem 4rem;
}

/* Love-note card */
.pass {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 11rem;
}
.pass::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 10px;
  background: radial-gradient(circle at 9px 0, var(--hot) 8px, transparent 8.5px) 0 0 / 18px 10px repeat-x;
}
.pass-main { padding: 2rem 1.5rem 1.4rem; min-width: 0; }
.eyebrow { font-family: var(--mono); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
h1 { font-family: var(--display); font-weight: 700; font-style: italic; font-size: clamp(2.1rem, 7vw, 3.2rem); line-height: 1; letter-spacing: -.02em; margin: .35rem 0 1.25rem; text-wrap: balance; }
.route { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.city { display: flex; flex-direction: column; }
.code { font-family: var(--display); font-style: italic; font-weight: 700; font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1; letter-spacing: .02em; }
.code.secret { color: var(--hot); }
.city small { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.plane { flex: 1 1 3rem; min-width: 3rem; height: 2px; background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 11px); position: relative; }
.plane svg { position: absolute; right: -4px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); fill: var(--rose); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .9rem 1.2rem; margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px dashed var(--line); }
.field span { display: block; }
.field .v { font-weight: 600; font-size: 1rem; margin-top: .15rem; }
.stub {
  border-left: 2px dashed var(--line); padding: 2rem 1.1rem 1.4rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; text-align: center;
}
.ring { width: 6.5rem; height: 6.5rem; }
.ring circle { fill: none; stroke-width: 9; }
.ring .track { stroke: var(--tint); }
.ring .bar { stroke: var(--rose); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .4s ease; }
.ring text { font-family: var(--body); font-weight: 700; font-size: 20px; fill: var(--ink); }
.stub p { margin: 0; font-size: .85rem; color: var(--muted); }
.stub strong { color: var(--ink); }

/* Controls */
.controls { display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: center; justify-content: space-between; margin: 1.4rem 0 0; }
.hint { margin: 0; font-size: .85rem; color: var(--muted); }
.hint.warn { color: var(--hot); }

.letter { margin: 1.6rem 0 0; padding: 1.1rem 1.25rem; border-radius: 14px; background: var(--tint); border: 1px solid var(--line); }
.letter p { margin: 0; max-width: 62ch; }
.letter p + p { margin-top: .7rem; }
.letter .letter-title { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 1.35rem; line-height: 1.2; margin-bottom: .5rem; }

/* Sections */
section.block { margin-top: 1.25rem; }
section.block .moment { padding: 1.2rem 1.25rem .8rem; }
section.block h2 { font-size: clamp(1.4rem, 4.5vw, 1.7rem); }
.badges { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .25rem; }
.item .dress { display: inline-block; margin: 0; white-space: nowrap; }
.item .dress.shoe { color: var(--muted); }
.item .dress.shoe::before { content: "Shoes: "; }
.item .dress.for { color: var(--rose); }
.item .dress.for::before { content: "For: "; }
.item .dress.pts, .item .dress.cost { font-family: var(--mono); color: var(--rose); background: var(--tint); border-color: transparent; }
.item .dress.pts::before, .item .dress.cost::before { content: none; }
.shop .item input:checked ~ .txt .label { text-decoration: none; color: var(--ink); }
.shop .item input:checked ~ .txt .label::after { content: " · Bought"; font-family: var(--mono); font-size: .75rem; font-weight: 700; color: var(--rose); }
.shop .count { color: var(--rose); border-color: var(--rose); }
.item.locked label { opacity: .5; cursor: not-allowed; }
h2.day { margin: 2.4rem 0 -.2rem; font-size: clamp(1.25rem, 4vw, 1.5rem); color: var(--hot); }
.choice .box { border-radius: 50%; }
.choice .count { color: var(--muted); }
.vid { display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 .5rem 2.1rem; font-size: .8rem; color: var(--muted); cursor: pointer; }
.moment > .vid { margin: .2rem 0 .3rem; }
.vid b { color: var(--rose); font-family: var(--mono); }
.vid input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.vbox { flex: none; width: 1rem; height: 1rem; border-radius: 4px; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; }
.vbox svg { width: .65rem; height: .65rem; opacity: 0; }
.vid input:checked + .vbox { background: var(--done); border-color: var(--done); }
.vid input:checked + .vbox svg { opacity: 1; }
.vid input:focus-visible + .vbox { outline: 2px solid var(--hot); outline-offset: 2px; }
.vid.off { opacity: .45; cursor: not-allowed; }
h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 5vw, 2rem); line-height: 1.1; margin: 0; letter-spacing: -.01em; text-wrap: balance; }

.moment { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem .7rem; min-width: 0; }
.moment.must { border: 2px solid var(--hot); }
.must-tag { font-family: var(--mono); font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--surface); background: var(--hot); border-radius: 999px; padding: .12rem .6rem; white-space: nowrap; align-self: center; }
.moment.done { border-color: var(--done); }
.m-head { display: flex; align-items: baseline; gap: .4rem .7rem; flex-wrap: wrap; }
.count { margin-left: auto; font-family: var(--mono); font-size: .72rem; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: .05rem .55rem; white-space: nowrap; }
.moment.done .count { background: var(--done); border-color: var(--done); color: var(--done-ink); }
.note { margin: .3rem 0 .25rem; font-size: .92rem; color: var(--muted); max-width: 62ch; }
.dress::before { content: "Dress code: "; font-weight: 500; }
.dress { display: inline-block; margin: .15rem 0 .2rem; font-size: .78rem; font-weight: 600; color: var(--hot); border: 1px solid currentColor; border-radius: 999px; padding: .05rem .6rem; }

.items { list-style: none; margin: .3rem 0 0; padding: 0; }
.item > label:not(.vid) { display: flex; gap: .75rem; align-items: flex-start; padding: .45rem 0; cursor: pointer; }
.item + .item > label:not(.vid) { border-top: 1px solid var(--tint); }
.item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.box { flex: none; width: 1.35rem; height: 1.35rem; margin-top: .05rem; border-radius: 6px; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; transition: background .15s, border-color .15s; }
.box svg { width: .85rem; height: .85rem; opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s; }
.item input:checked + .box { background: var(--done); border-color: var(--done); }
.item input:checked + .box svg { opacity: 1; transform: none; }
.item input:focus-visible + .box { outline: 2px solid var(--hot); outline-offset: 2px; }
.txt { min-width: 0; }
.label { font-weight: 500; }
.item input:checked ~ .txt .label { text-decoration: line-through; text-decoration-color: var(--muted); color: var(--muted); }
.detail { display: block; font-size: .84rem; color: var(--muted); }

.room { margin-top: 2.8rem; padding: 1.3rem 1.25rem; border-radius: 14px; border: 2px dashed var(--hot); }
.room h2 { font-size: 1.4rem; }
.room p { margin: .4rem 0 0; max-width: 62ch; }

footer { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: .8rem 1rem; align-items: center; justify-content: space-between; color: var(--muted); font-size: .85rem; }
.reset { font: inherit; font-size: .88rem; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 999px; padding: .45rem 1.1rem; cursor: pointer; }
.reset:hover { color: var(--ink); border-color: var(--ink); }
.reset.armed { color: var(--hot); border-color: var(--hot); }
button:focus-visible { outline: 2px solid var(--hot); outline-offset: 2px; }

@media (max-width: 40rem) {
  .pass { grid-template-columns: 1fr; }
  .stub { border-left: 0; border-top: 2px dashed var(--line); flex-direction: row; justify-content: flex-start; text-align: left; padding: 1rem 1.5rem 1.3rem; }
  .ring { width: 4.8rem; height: 4.8rem; flex: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Lock screen */
.gate {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 2rem;
}
.lock { position: relative; width: 100%; max-width: 24rem; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; padding: 2.4rem 1.5rem 1.6rem; text-align: center; }
.lock::before { content: ""; position: absolute; inset: 0 0 auto; height: 10px; background: radial-gradient(circle at 9px 0, var(--hot) 8px, transparent 8.5px) 0 0 / 18px 10px repeat-x; }
.lock svg { width: 3.2rem; height: 3.2rem; color: var(--rose); }
.lock h1 { font-size: clamp(1.8rem, 7vw, 2.3rem); margin: .6rem 0 .4rem; }
.lock p { margin: 0; color: var(--muted); }
.lock form { display: flex; gap: .5rem; margin-top: 1.3rem; }
.lock input { flex: 1 1 auto; min-width: 0; font: inherit; font-family: var(--mono); font-size: 1rem; letter-spacing: .06em; color: var(--ink); background: var(--paper); border: 2px solid var(--line); border-radius: 12px; padding: .65rem .8rem; }
.lock input:focus-visible { outline: none; border-color: var(--rose); }
.lock button { font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: .65rem 1.1rem; background: var(--hot); color: var(--done-ink); cursor: pointer; }
.lock button:disabled { opacity: .6; cursor: wait; }
.lock .err { min-height: 1.4em; margin-top: .7rem; font-size: .9rem; color: var(--hot); }
.lock.shake { animation: shake .35s ease; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .lock.shake { animation: none; } }
