/* Layout: an airmail boarding pass up top, then a checklist that reads like a carry-on manifest, one column. */
:root {
  --paper: #F4F6FB;
  --surface: #FFFFFF;
  --ink: #18203D;
  --muted: #5B6383;
  --line: #D8DDEB;
  --red: #CF3238;
  --blue: #2747B0;
  --tint: #E9EDF8;
  --done: #2747B0;
  --done-ink: #FFFFFF;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  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: #0F1328; --surface: #171C37; --ink: #E7EAF7; --muted: #A2A9C7; --line: #2C3358;
    --red: #FF6E72; --blue: #93A9FF; --tint: #1E2546; --done: #93A9FF; --done-ink: #0F1328;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F1328; --surface: #171C37; --ink: #E7EAF7; --muted: #A2A9C7; --line: #2C3358;
  --red: #FF6E72; --blue: #93A9FF; --tint: #1E2546; --done: #93A9FF; --done-ink: #0F1328;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  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;
}

/* Boarding pass */
.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: repeating-linear-gradient(-45deg, var(--red) 0 14px, transparent 14px 22px, var(--blue) 22px 36px, transparent 36px 44px);
}
.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: 800; 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(--mono); font-weight: 700; font-size: clamp(2rem, 8vw, 2.8rem); line-height: 1; letter-spacing: .02em; }
.code.secret { color: var(--red); }
.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: -2px; top: 50%; width: 22px; height: 22px; transform: translateY(-50%); fill: var(--blue); }
.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(--blue); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .4s ease; }
.ring text { font-family: var(--mono); 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(--red); }

.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 b { font-weight: 700; }

/* 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(--blue); }
.item .dress.for::before { content: "For: "; }
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.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(--red); border: 1px solid currentColor; border-radius: 999px; padding: .05rem .6rem; }

.items { list-style: none; margin: .3rem 0 0; padding: 0; }
.item label { display: flex; gap: .75rem; align-items: flex-start; padding: .45rem 0; cursor: pointer; }
.item + .item label { 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(--red); 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(--red); }
.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(--red); border-color: var(--red); }
button:focus-visible { outline: 2px solid var(--red); 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: repeating-linear-gradient(-45deg, var(--red) 0 14px, transparent 14px 22px, var(--blue) 22px 36px, transparent 36px 44px); }
.lock svg { width: 3.2rem; height: 3.2rem; color: var(--blue); }
.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(--blue); }
.lock button { font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: .65rem 1.1rem; background: var(--ink); color: var(--paper); cursor: pointer; }
.lock button:disabled { opacity: .6; cursor: wait; }
.lock .err { min-height: 1.4em; margin-top: .7rem; font-size: .9rem; color: var(--red); }
.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; } }
