/*
 * The website's styles, from the design tokens in docs/design/tokens.md (the app's theme mirrors
 * the same tokens). Everyday pages are paper and ink; festive pieces are plum. Apricot is only
 * ever the fill of the one primary button, with an ink label.
 */

@font-face { font-family: "Lora"; font-weight: 500; font-display: swap; src: url("fonts/lora-500.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 400; font-display: swap; src: url("fonts/jakarta-400.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 600; font-display: swap; src: url("fonts/jakarta-600.woff2") format("woff2"); }
@font-face { font-family: "Plus Jakarta Sans"; font-weight: 700; font-display: swap; src: url("fonts/jakarta-700.woff2") format("woff2"); }

:root {
  --paper: #F7F5F2;
  --surface: #FFFFFF;
  --ink: #221E2A;
  --ink-muted: #57515F;
  --hairline: #E6E0D9;
  --apricot: #F2683C;
  --plum: #2C1A3F;
  --plum-raised: #3D2B4D;
  --warm-white: #FFF4EA;
  --warm-white-muted: #C4B7BA;
  --marigold: #FFB627;
  --coral: #FF5D73;
  --sky: #4CC9F0;
  --mint: #3DDC97;
  --lilac: #B79CFF;
  --berry: #9B2C4E;

  --font-display: "Lora", Georgia, serif;
  --font-sans: "Plus Jakarta Sans", system-ui, sans-serif;

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-12: 48px;
  --radius-media: 16px; --radius-card: 24px; --radius-pill: 999px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/24px var(--font-sans);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, label.button:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.topbar {
  padding: var(--space-4) var(--space-6) 0;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
}
.wordmark { font: 500 22px/28px var(--font-display); text-decoration: none; }

.page {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-6) var(--space-12);
}
.guest .page, .narrow { max-width: 480px; }
.guest .topbar { max-width: 480px; }

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: var(--space-6);
  color: var(--ink-muted);
  font: 500 13px/18px var(--font-sans);
  text-align: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-6); margin-bottom: var(--space-3); }
.site-footer a { color: var(--ink-muted); }
.site-footer p { margin: 0; }

/* Type */
.display { font: 500 36px/44px var(--font-display); margin: var(--space-6) 0 var(--space-4); }
.headline { font: 500 28px/36px var(--font-display); margin: var(--space-4) 0 var(--space-2); }
.title { font: 500 22px/28px var(--font-display); margin: var(--space-8) 0 var(--space-3); }
.lede { color: var(--ink-muted); font: 400 16px/24px var(--font-sans); margin: 0 0 var(--space-6); }
.overline { display: inline-block; font: 600 12px/16px var(--font-sans); letter-spacing: 0.2px; color: var(--ink-muted); margin: var(--space-4) 0 0; text-transform: uppercase; }
.hint, .fineprint { color: var(--ink-muted); font: 500 13px/18px var(--font-sans); }
.fineprint { text-align: center; margin: var(--space-3) 0 0; }
@media (min-width: 640px) { .display { font-size: 45px; line-height: 52px; } }

/* Confetti along the top, as in the designs */
.confetti { position: relative; height: 28px; margin: var(--space-2) 0 0; }
.bit { position: absolute; top: 8px; width: 12px; height: 5px; border-radius: 3px; }
.bit-0 { left: 4%; background: var(--marigold); transform: rotate(-20deg); }
.bit-1 { left: 16%; top: 2px; width: 6px; height: 6px; background: var(--coral); }
.bit-2 { left: 28%; top: 14px; background: var(--sky); transform: rotate(35deg); }
.bit-3 { left: 41%; width: 6px; height: 6px; background: var(--mint); }
.bit-4 { left: 53%; top: 2px; background: var(--lilac); transform: rotate(-55deg); }
.bit-5 { left: 66%; width: 6px; height: 6px; background: var(--marigold); }
.bit-6 { left: 78%; top: 14px; background: var(--coral); transform: rotate(15deg); }
.bit-7 { left: 90%; top: 2px; width: 6px; height: 6px; background: var(--sky); }
.bit-8 { left: 97%; top: 12px; width: 6px; height: 6px; background: var(--mint); }

.centered { text-align: center; }
.hero-mark, .seal-mark { width: 120px; height: 120px; display: block; margin: var(--space-4) auto 0; }
.icon { width: 24px; height: 24px; fill: currentColor; flex: none; }

/* Buttons: pill shaped, 48px touch targets */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 48px; padding: 0 var(--space-6);
  border-radius: var(--radius-pill); border: 0;
  font: 600 14px/20px var(--font-sans); letter-spacing: 0.1px;
  text-decoration: none; cursor: pointer;
}
.button.wide { display: flex; width: 100%; margin-top: var(--space-3); }
.button-primary { background: var(--apricot); color: var(--ink); min-height: 56px; font-size: 16px; }
.button-primary .icon { width: 20px; height: 20px; }
.button-primary[disabled] { opacity: 0.6; cursor: progress; }
.button-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--ink-muted); }
.button-disabled { background: var(--hairline); color: var(--ink-muted); cursor: default; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-card); padding: var(--space-5); margin-top: var(--space-4); }
.card .title { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }

.festive-card { background: var(--plum); color: var(--warm-white); border-radius: var(--radius-card); padding: var(--space-6) var(--space-5); margin-top: var(--space-8); }
.festive-card .overline { color: var(--marigold); margin-top: 0; }
.festive-card .headline { color: var(--warm-white); margin-top: var(--space-2); }
.festive-card p { color: var(--warm-white-muted); margin-bottom: 0; }

/* Landing page */
.hero { text-align: center; padding-top: var(--space-4); }
.hero .lede { max-width: 560px; margin-left: auto; margin-right: auto; }
.features { display: grid; gap: var(--space-4); margin-top: var(--space-12); }
@media (min-width: 640px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { margin-top: 0; }
.feature .title { margin: var(--space-3) 0 var(--space-2); font-size: 20px; }
.feature p { color: var(--ink-muted); margin: 0; font-size: 14px; line-height: 20px; }
.feature-icon { display: inline-flex; width: 40px; height: 40px; border-radius: 50%; background: var(--paper); border: 1px solid var(--hairline); align-items: center; justify-content: center; color: var(--berry); }

/* Forms (guest page) */
.guest-form { margin-top: var(--space-2); text-align: left; }
.field-label { display: block; font: 600 14px/20px var(--font-sans); margin-bottom: var(--space-2); }
.text-field {
  width: 100%; min-height: 56px; padding: var(--space-4);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--ink-muted); border-radius: var(--radius-media);
  font: 400 16px/24px var(--font-sans);
}
.text-field::placeholder { color: var(--ink-muted); opacity: 0.8; }
.letter { resize: vertical; min-height: 200px; }

.choice {
  display: flex; align-items: center; gap: var(--space-4); width: 100%;
  min-height: 64px; margin-top: var(--space-3); padding: var(--space-3) var(--space-4);
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--ink-muted); border-radius: var(--radius-card);
  font: 600 16px/24px var(--font-sans); text-align: left; cursor: pointer;
}
.choice:first-of-type { margin-top: var(--space-4); }
.choice-icon { display: inline-flex; width: 40px; height: 40px; border-radius: 50%; background: var(--paper); border: 1px solid var(--hairline); align-items: center; justify-content: center; flex: none; }
.choice-label { flex: 1; }
.choice-chevron { display: inline-flex; transition: transform 0.15s; }
.choice[aria-expanded="true"] { border: 2px solid var(--ink); padding: calc(var(--space-3) - 1px) calc(var(--space-4) - 1px); }
.choice[aria-expanded="true"] .choice-chevron { transform: rotate(90deg); }

.prediction { margin-top: var(--space-3); border: 1px dashed var(--ink-muted); border-radius: var(--radius-card); background: var(--surface); }
.prediction summary {
  display: flex; align-items: center; gap: var(--space-4); min-height: 64px; padding: var(--space-3) var(--space-4);
  font: 600 16px/24px var(--font-sans); cursor: pointer; list-style: none;
}
.prediction summary::-webkit-details-marker { display: none; }
.prediction .optional { display: block; font-weight: 400; font-size: 14px; color: var(--ink-muted); }
.prediction[open] .choice-chevron { transform: rotate(90deg); }
.prediction .text-field { display: block; width: calc(100% - 2 * var(--space-4)); margin: 0 var(--space-4) var(--space-4); }

.panel { padding: var(--space-4) var(--space-2) var(--space-2); }
.panel .hint { margin: 0 0 var(--space-3); }
.panel audio, .panel video { width: 100%; margin-top: var(--space-3); border-radius: var(--radius-media); }
.panel video { background: var(--ink); max-height: 360px; }

.recorder { display: flex; align-items: center; gap: var(--space-4); }
.record-button {
  width: 64px; height: 64px; border-radius: 50%; flex: none;
  background: var(--surface); border: 2px solid var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.record-dot { width: 24px; height: 24px; border-radius: 50%; background: var(--berry); transition: border-radius 0.15s; }
.record-button.recording .record-dot { border-radius: 4px; }
.record-time { font: 600 22px/28px var(--font-sans); font-variant-numeric: tabular-nums; }

.form-error { color: var(--berry); font: 600 14px/20px var(--font-sans); margin: var(--space-4) 0 0; }
.notice { background: var(--surface); border: 1px solid var(--ink-muted); border-radius: var(--radius-media); padding: var(--space-4); }
.guest-form + .sealed-state, .sealed-state { padding-top: var(--space-4); }
.sealed-state:focus { outline: none; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Invite page */
.steps { padding-left: var(--space-6); margin: 0 0 var(--space-3); }
.steps li { margin-bottom: var(--space-2); }
.link-box { background: var(--paper); border: 1px solid var(--hairline); border-radius: var(--radius-media); padding: var(--space-3) var(--space-4); font: 500 13px/18px var(--font-sans); word-break: break-all; user-select: all; }

/* Legal pages */
.legal { max-width: 640px; }
.legal .fineprint { text-align: left; }
.legal ul { padding-left: var(--space-6); }
.legal li { margin-bottom: var(--space-2); }
.draft-notice { background: var(--surface); border: 2px solid var(--marigold); border-radius: var(--radius-media); padding: var(--space-4); margin: var(--space-4) 0; font-size: 14px; line-height: 20px; }
.placeholder { background: var(--marigold); color: var(--ink); border-radius: 4px; padding: 0 var(--space-1); font-weight: 600; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
