/* Live Launch Offline. Ink, paper, and lime once per page. */

@font-face {
  font-family: 'Krona One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/public/fonts/krona-one-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Albert Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/public/fonts/albert-sans-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Albert Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/public/fonts/albert-sans-latin-600-normal.woff2') format('woff2');
}
/* Local fallbacks sized to the two fonts (measured from the font files, against Arial),
   so nothing moves when the fonts load. */
@font-face {
  font-family: 'Krona Fallback';
  src: local('Arial');
  size-adjust: 143.5%;
  ascent-override: 69%;
  descent-override: 18%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Albert Fallback';
  src: local('Arial');
  size-adjust: 102.2%;
  ascent-override: 93%;
  descent-override: 24.5%;
  line-gap-override: 0%;
}

:root {
  --ink: #111111;
  --paper: #fafafa;
  --lime: #b4d800;
  --ground: var(--ink);
  --type: var(--paper);
  --dim: #b9b9b9;
  --line: #3a3a3a;
  --display: 'Krona One', 'Krona Fallback', sans-serif;
  --text: 'Albert Sans', 'Albert Fallback', system-ui, sans-serif;
  color-scheme: dark;
  /* Motion (job 16, R388: native CSS and WAAPI, no library). The numbers are read from
     Offline master/kit/TOKENS-offline-r1.json, timing.durations_ms, timing.house_curve and
     timing.house_spring, every one marked "proposed" there. This is their one place:
     change a number here and every transition follows. */
  --t-fast: 160ms;
  --t-base: 280ms;
  --t-slow: 480ms;
  --curve: cubic-bezier(0.2, 0, 0, 1);
  --spring: linear(0, 0.0667, 0.2048, 0.3577, 0.4991, 0.6189, 0.7154, 0.7905, 0.8475, 0.8900, 0.9213, 0.9441, 0.9605, 0.9722, 0.9805, 0.9864, 0.9905, 0.9934, 0.9955, 0.9969, 0.9978, 0.9985, 0.9990, 1);
  --t-spring: 690ms;
}
/* The Day (the packet): paper ground, ink type. */
.face-day {
  --ground: var(--paper);
  --type: var(--ink);
  --dim: #5a5a5a;
  --line: #cfcfcf;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--type);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.5;
}

main {
  max-width: 34rem;
  margin: 0 auto;
  padding: 2.5rem max(1.25rem, env(safe-area-inset-right)) 3rem max(1.25rem, env(safe-area-inset-left));
}
main.wide { max-width: 72rem; }

h1, h2, h3, .mark, .when, dt, .n { font-family: var(--display); font-weight: 400; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.6rem, 7vw, 2.5rem); line-height: 1.15; margin: 0 0 2rem; }
h2 { font-size: clamp(1.25rem, 5.2vw, 1.7rem); line-height: 1.2; margin: 0 0 1rem; }
h3 { font-size: 1.02rem; line-height: 1.3; margin: 2.25rem 0 1rem; }
p { margin: 0 0 1rem; }
a { color: var(--type); }
p time, li time, dd time { white-space: nowrap; }
h1 time, h2 time, h3 time, .lead time { white-space: normal; }

.vh { position: absolute; width: 1px !important; height: 1px !important; min-height: 0 !important; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 !important; padding: 0 !important; margin: 0; }
.mark { font-size: 0.95rem; letter-spacing: 0.02em; margin: 0 0 2.5rem; }
.mark img { display: block; height: 2rem; width: auto; }
.banner, .notice {
  margin: 0 0 1rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--line);
  font-weight: 600;
}
.banner { text-align: center; border-width: 0 0 1px; padding-top: max(0.75rem, env(safe-area-inset-top)); }
.lead { font-size: 1.25rem; line-height: 1.4; }
.small, .under, .privacy, .fine, .help { color: var(--dim); font-size: 1rem; }
.fine { font-size: 0.9rem; margin: 2rem 0 0; }
.under { margin-top: 1.5rem; }
.privacy { margin-top: 1rem; overflow-wrap: anywhere; }
.block { margin: 0 0 3rem; }

/* ---- hero: the video fills the first screen ---- */
.hero { background: var(--ink); display: flex; justify-content: center; position: relative; }
.hero-frame {
  position: relative;
  width: 100%;
  height: 100svh;
  max-width: calc(100svh * 9 / 16);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
}
.hero-frame .mark { margin: 0; }
.hero-poster, .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-video[hidden], .hero-poster[hidden] { display: none; }
.hero .pause {
  position: absolute; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom));
  width: auto; min-height: 2.75rem; padding: 0.4rem 1rem; background: var(--ink); color: var(--paper); border-color: var(--paper);
}

/* ---- photo slots: a plain field of the same shape until the file arrives ---- */
.photo { margin: 0 0 3rem; background: var(--line); }
.photo.bleed { margin-left: calc(-1 * max(1.25rem, env(safe-area-inset-left))); margin-right: calc(-1 * max(1.25rem, env(safe-area-inset-right))); }
.photo.portrait { aspect-ratio: 4 / 5; }
.photo.wide { aspect-ratio: 3 / 2; }
.photo.empty { background: var(--ground); border: 1px solid var(--line); }
.photo.square { aspect-ratio: 1; }
.photo.story { aspect-ratio: 9 / 16; }
.photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.graphic .row { margin-top: 0.75rem; }
.limebar { height: 6px; margin: -3rem 0 2.5rem; background: var(--lime); border: 0; }
.photo.bleed + .limebar { margin-left: calc(-1 * max(1.25rem, env(safe-area-inset-left))); margin-right: calc(-1 * max(1.25rem, env(safe-area-inset-right))); }

/* ---- the invite ---- */
.when { font-size: 1.02rem; line-height: 1.4; margin-bottom: 0.25rem; }
.where { margin-bottom: 1.5rem; }
.schedule { margin: 0 0 1.5rem; padding: 0; border-top: 1px solid var(--line); }
.schedule > div { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.schedule dt { font-size: 0.95rem; margin-bottom: 0.25rem; }
.schedule dd { margin: 0; }
.schedule .between { color: var(--dim); }

/* ---- forms: boxed fields, label above ---- */
form { margin: 0; }
.field { margin: 0 0 1.25rem; }
label, legend { display: block; font-weight: 600; margin: 0 0 0.4rem; padding: 0; }
.help { margin: 0 0 0.4rem; }
input[type='text'], input[type='email'], input[type='tel'], input[type='password'], input[type='url'],
input[type='date'], input[type='datetime-local'], input[type='search'], select, textarea {
  display: block;
  width: 100%;
  min-height: 3.25rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--dim);
  border-radius: 0;
  background: var(--ground);
  color: var(--type);
  font: inherit;
}
textarea { min-height: 7rem; resize: vertical; }
input[aria-invalid='true'], textarea[aria-invalid='true'] { border-width: 2px; border-color: var(--type); }
fieldset { border: 0; margin: 0 0 1.25rem; padding: 0; min-width: 0; }
fieldset.guest { border-top: 1px solid var(--line); padding-top: 1.25rem; }
.reveal { display: flex; gap: 0.5rem; }
.reveal input { flex: 1; min-width: 0; }
.reveal button { width: auto; min-width: 5rem; }

.radio { display: flex; align-items: center; gap: 0.75rem; min-height: 3.25rem; font-weight: 400; margin: 0; }
.radio input { width: 1.5rem; height: 1.5rem; margin: 0; accent-color: var(--type); flex: none; }
label.radio + label.radio { margin-top: 0.25rem; }
/* Three big choices, stacked. */
.choices { display: grid; gap: 0.6rem; margin-bottom: 0.5rem; }
.choices .radio { border: 1px solid var(--dim); padding: 0.9rem 1rem; min-height: 4rem; font-family: var(--display); font-size: 0.95rem; }
.choices .radio:has(input:checked) { border-width: 2px; border-color: var(--type); }
.offers { margin: 0.75rem 0 0; padding: 1rem 0 0; border-top: 1px solid var(--line); }

/* ---- buttons: one filled main action per screen; every other button outlined ---- */
button, .button {
  display: inline-block;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.9rem 1.25rem;
  border: 1px solid var(--type);
  border-radius: 0;
  background: var(--type);
  color: var(--ground);
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 150ms ease-out, background-color 150ms ease-out;
}
button.quiet, .button.quiet { background: var(--ground); color: var(--type); }
button:active, .button:active { transform: scale(0.96); }
button.link {
  width: auto; min-height: 3rem; padding: 0.5rem 0; border: 0; background: none; color: var(--type);
  font-family: var(--text); font-size: 1rem; text-decoration: underline;
}
a, input, select, textarea, summary { touch-action: manipulation; }
@media (hover: hover) {
  button:hover, .button:hover { background: var(--dim); border-color: var(--dim); }
  button.quiet:hover, .button.quiet:hover { background: var(--line); border-color: var(--type); }
  button.link:hover { background: none; color: var(--dim); }
  a:hover { color: var(--dim); }
}
/* A visible focus ring on every control. It is the type color, never lime. */
:focus-visible { outline: 3px solid var(--type); outline-offset: 3px; }
button:focus-visible, .button:focus-visible { outline-offset: 4px; }
.pair { display: grid; gap: 0.75rem; }
.actions { display: grid; gap: 0.75rem; margin: 1.5rem 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 0 0 1.5rem; }
.row button, td button, .copyline button, button[data-copy], details summary + * button.small { width: auto; min-height: 2.75rem; padding: 0.4rem 1rem; font-size: 0.9rem; }

.error { font-weight: 600; margin: 0.4rem 0 0; }
.error:empty { display: none; }
.form-error { margin: 0 0 1rem; }
.error.after { margin: 0.75rem 0 0; }
.errors { border: 2px solid var(--type); padding: 1rem 1.25rem; margin: 0 0 1.5rem; }
.errors ul { margin: 0; padding-left: 1.1rem; }
.errors a { font-weight: 600; }
.result { outline: none; }
.result p { font-size: 1.25rem; line-height: 1.4; overflow-wrap: anywhere; }
.signout { margin-top: 1.5rem; }

/* The trap field: off screen, out of the tab order, hidden from assistive tech. */
/* The contact registry (R541): a Live Launch page. */
.face-registry main.registry { max-width: 34rem; }
.face-registry .ll-logo { margin: 0 0 2rem; }
.face-registry .ll-logo img { height: 2.25rem; width: auto; display: block; }
.face-registry .added { border-left: 3px solid var(--lime); padding: 0.5rem 0.75rem; margin: 0 0 1.5rem; }
.face-registry .choice { display: flex; gap: 0.75rem; align-items: center; min-height: 2.75rem; cursor: pointer; }
.face-registry .choice input { width: 1.25rem; height: 1.25rem; accent-color: var(--lime); margin: 0; }
/* The giveaway entry sheet (R647) wears the registry's face. */
.face-registry main.giveaway .privacy-link { margin-top: 1.5rem; }
/* The open RSVP link (R665, R666) wears the registry's face. */
.face-registry main.open-rsvp .where { margin-bottom: 1rem; }
.face-registry main.open-rsvp .lead { margin-bottom: 1.5rem; text-wrap: balance; }
.face-registry main.open-rsvp h1 .unit { display: inline-block; }
.face-registry main.open-rsvp form { margin-top: 1.5rem; }
.face-registry main.open-rsvp .lead { margin-bottom: 0.75rem; }
.face-registry main.open-rsvp .from-seven { margin: 0 0 1.5rem; }
.face-registry main.open-rsvp .small + .small { margin-top: -0.5rem; }
.face-registry main.open-rsvp .added { margin-top: 1.5rem; }
.face-registry main.open-rsvp .privacy-link { margin-top: 1.5rem; }
#registry tr.vip td:first-child { box-shadow: inset 3px 0 0 var(--lime); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- the pass ---- */
.pass { border: 1px solid var(--type); padding: 1.5rem 1.25rem; margin: 0 0 2rem; outline: none; }
.pass .name { font-family: var(--display); font-size: clamp(1.5rem, 7vw, 2.3rem); line-height: 1.15; margin: 1rem 0; overflow-wrap: anywhere; }
.pass .facts { margin: 0 0 1.25rem; padding: 0; list-style: none; }
.pass .facts li { padding: 0.5rem 0; border-top: 1px solid var(--line); }
.people { margin: 0 0 1.5rem; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.people li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.people .state { color: var(--dim); text-align: right; }
/* job 19, S-2: an invited guest's own link, under their line, for the inviter to send.
   Layout only: no colour or type changes (A-12). */
.people li { flex-wrap: wrap; }
.people .send { flex-basis: 100%; }
.people .send p { margin: 0.5rem 0 0; }
.link-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.link-row a { overflow-wrap: anywhere; min-width: 0; }

/* The foot: one lime line, the only lime on the page. */
footer { padding: 0 max(1.25rem, env(safe-area-inset-right)) max(2.5rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left)); }
.lime { max-width: 34rem; margin: 0 auto; height: 2px; border: 0; background: var(--lime); }

/* ---- the 11/28 packet ---- */
.steps { list-style: none; margin: 0; padding: 0; }
.moment { font-family: var(--display); font-size: 0.95rem; margin: 2rem 0 0.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.act { padding: 0.9rem 0; border-bottom: 1px solid var(--line); }
.act > summary, .act > .head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.act > summary { cursor: pointer; min-height: 2.75rem; }
.act .state { font-family: var(--display); font-size: 0.8rem; white-space: nowrap; }
.act .state.done { color: var(--dim); }
.act > .inside { padding: 1.25rem 0 0.5rem; }
/* The Friday block is ink, inside the paper packet. */
.friday { background: var(--ink); color: var(--paper); padding: 1.5rem 1.25rem; margin: 1.5rem 0; --type: var(--paper); --ground: var(--ink); --dim: #b9b9b9; --line: #3a3a3a; }
.friday h3 { margin-top: 0; }
.terms { margin-bottom: 1.5rem; }
.qa { border-top: 1px solid var(--line); padding: 1rem 0 0; }
.qa h3 { margin: 0 0 0.5rem; }
.copyline { border-top: 1px solid var(--line); padding: 1rem 0; }
.brands { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.brands li { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.brands .line { display: block; color: var(--dim); }
.answers { margin: 0; }
.answers > div { padding: 0.75rem 0; border-bottom: 1px solid var(--line); display: grid; gap: 0.25rem; }
.answers dt { color: var(--dim); font-family: var(--text); font-size: 1rem; }
.answers dd { margin: 0; overflow-wrap: anywhere; }
input.stack { margin-bottom: 0.5rem; }
.choice > input[type='text'] { margin-top: 0.5rem; }
.share { display: grid; gap: 1.5rem; margin: 1rem 0 2rem; }
.share .photo { margin-bottom: 0.75rem; max-width: 16rem; }

/* ---- admin ---- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); margin: 0 0 1.5rem; }
table { width: 100%; border-collapse: collapse; font-size: 1rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line); }
th { white-space: nowrap; }
table form { margin: 0; }
tr.earlier td { color: var(--dim); }
.flag { font-weight: 600; }
details summary { cursor: pointer; text-decoration: underline; min-height: 2.75rem; }
form.inline { max-width: 30rem; margin: 1rem 0 2rem; }
pre.team { font-family: var(--text); white-space: pre-wrap; margin: 0 0 1rem; }
td input[readonly] { min-height: 2.75rem; min-width: 12rem; padding: 0.4rem 0.6rem; }
td input.code { min-width: 8rem; min-height: 2.75rem; padding: 0.4rem 0.6rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 0 0 1rem; }
.confirm { border: 2px solid var(--type); padding: 1rem 1.25rem; margin: 0.5rem 0; max-width: 30rem; }

td .button, td a.button { width: auto; min-height: 2.75rem; padding: 0.4rem 1rem; font-size: 0.9rem; white-space: nowrap; }
dl.pairs { display: grid; grid-template-columns: minmax(6rem, auto) 1fr; gap: 0.25rem 1rem; margin: 0 0 1.25rem; }
dl.pairs dt { color: var(--dim); }
dl.pairs dd { margin: 0; overflow-wrap: anywhere; }

/* ---- the summary (A-19): counts in a row, and a box to tick on paper ---- */
dl.counts { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin: 0 0 1.5rem; }
dl.counts dt { color: var(--dim); font-family: var(--text); font-size: 1rem; }
dl.counts dd { margin: 0; font-size: 1.6rem; }
td.mark-cell { white-space: nowrap; }
.tick { display: inline-block; width: 1.1rem; height: 1.1rem; border: 1px solid var(--type); vertical-align: middle; }

/* ---- the door ---- */
ul.door { list-style: none; margin: 0; padding: 0; }
.door-row { display: grid; grid-template-columns: 1fr auto; gap: 0.75rem 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.door-row .who { font-family: var(--display); font-size: 1rem; overflow-wrap: anywhere; }
.door-row .more { color: var(--dim); font-size: 1rem; }
.door-row button { width: auto; min-width: 8.5rem; min-height: 3.25rem; padding: 0.5rem 1rem; }
.door-row[data-arrived] button { background: var(--ground); color: var(--type); }
.door-row .warn { grid-column: 1 / -1; font-weight: 600; }

/* ---- signs ---- */
.sign { text-align: center; padding: 2rem 1rem; }
.sign svg { width: 9cm; height: 9cm; max-width: 100%; display: block; margin: 0 auto 1.5rem; }
.sign .scan { font-family: var(--display); font-size: clamp(1.5rem, 6vw, 2.5rem); line-height: 1.15; margin: 0 0 1rem; overflow-wrap: anywhere; }
.sign .address { font-size: 1.1rem; }

.js [data-second]:not([data-open]) { display: none; }
[hidden] { display: none !important; }

@media (min-width: 48rem) {
  main { padding-top: 4rem; }
  .pair { grid-template-columns: 1fr 1fr; }
}

/* View transitions (A-05). Only what is the same thing and on screen at both ends is
   paired: the sign-in's mark becomes the night page's hero frame (the poster, or the mark
   slot while there is no poster). The headline is not paired: it cross-fades with the
   page. Admin, the door and the packet (/day) change at once, with no fade.
   The pass (A-06) and the packet's steps (A-07) swap inside a same-page transition. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .face-signin .mark, .face-home .hero-frame { view-transition-name: lo-mark; }
  :root:has(> body.face-admin), :root:has(> body.face-day) { view-transition-name: none; }
  ::view-transition-group(*) { animation-duration: var(--t-base); animation-timing-function: var(--curve); }
  ::view-transition-group(lo-mark) { animation-duration: var(--t-spring); animation-timing-function: var(--spring); }
  /* The door (A-09): the row that took a tap flashes once. */
  .door-row.flash { animation: lo-flash var(--t-slow) var(--curve); }
  @keyframes lo-flash { from { background: var(--line); } to { background: transparent; } }
}
@media (prefers-reduced-motion: reduce) {
  button, .button { transition: none; }
  button:active, .button:active { transform: none; background: var(--dim); border-color: var(--dim); }
  button.quiet:active, .button.quiet:active { background: var(--line); }
}

@media (forced-colors: active) {
  button, .button { border: 2px solid ButtonText; background: ButtonFace; color: ButtonText; forced-color-adjust: none; }
  input, select, textarea { border: 2px solid FieldText; background: Field; color: FieldText; }
  :focus-visible { outline-color: Highlight; }
  .choices .radio, .pass, .errors, .confirm { border-color: CanvasText; }
  .lime, .limebar { background: CanvasText; }
}

/* ---- print: plain pages ---- */
@media print {
  :root, .face-day, .friday { --ground: #fff; --type: #000; --dim: #333; --line: #999; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .friday { background: #fff; color: #000; border: 1pt solid #000; }
  button, .button, .banner, form.signout, .hero, .no-print, [data-copy], .hp, footer, .filters, input[type='search'] { display: none !important; }
  main, main.wide { max-width: none; padding: 0; }
  a { text-decoration: none; }
  .print-links a[href^='http']::after { content: ' (' attr(href) ')'; font-size: 9pt; overflow-wrap: anywhere; }
  details > *:not(summary) { display: block; }
  details::details-content { content-visibility: visible; display: block; }
  section.block { break-before: page; }
  section.block:first-of-type { break-before: auto; }
  h1, h2, h3 { break-after: avoid; }
  .photo.empty { display: none; }
  .scroll { overflow: visible; border: 0; }
  .sign { break-after: page; padding-top: 3cm; }
  .sign:last-child { break-after: auto; }
  .door-row { break-inside: avoid; }
}
