/* Xmas Dinner — evergreen night, cream paper, cranberry and gold. */

@font-face {
  font-family: "Playfair Display";
  src: url("/static/fonts/playfair.woff2") format("woff2");
  font-weight: 400 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Playfair Display";
  src: url("/static/fonts/playfair-italic.woff2") format("woff2");
  font-weight: 400 900; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Mountains of Christmas";
  src: url("/static/fonts/mountains-of-christmas-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --pine-900: #082a1f;
  --pine-800: #0c3326;
  --pine-700: #11432f;
  --pine-600: #1a5a3f;
  --pine-200: #b9d3c3;
  --cream: #fbf6ec;
  --cream-2: #f3eadb;
  --cream-3: #e6d9c2;
  --ink: #22302a;
  --ink-soft: #55635c;
  --cranberry: #a51d2a;
  --cranberry-dark: #84131f;
  --gold: #d9a441;
  --gold-soft: #f3d9a4;
  --green-ok: #1d6b45;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --festive: "Mountains of Christmas", "Playfair Display", Georgia, serif;
  --radius: 18px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(1200px 520px at 50% -120px, #1b6245 0%, transparent 70%),
    linear-gradient(180deg, var(--pine-800) 0%, var(--pine-900) 100%);
  background-color: var(--pine-900);
  background-attachment: fixed;
  padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--cranberry); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0; text-wrap: balance; }
p { margin: 0 0 12px; }
[hidden] { display: none !important; }

.festive { font-family: var(--festive); font-weight: 700; letter-spacing: .01em; }

/* ---------------------------------------------------------------- snow */
.snow { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.snow span {
  position: absolute; top: -12px; border-radius: 50%; background: #fff;
  animation: fall linear infinite;
}
@keyframes fall {
  to { transform: translate3d(var(--drift, 0), 105vh, 0); }
}

/* -------------------------------------------------------------- lights */
.lights {
  position: absolute; top: 0; left: 0; right: 0; height: 52px; overflow: hidden;
  display: flex; justify-content: center; pointer-events: none;
}
.lights svg { flex: none; overflow: visible; }
.lights-wire { fill: none; stroke: #041c13; stroke-width: 2.5; }
.lights-cap { fill: #041c13; }
.lights .bulb { fill: currentColor; filter: drop-shadow(0 0 5px currentColor); animation: twinkle 2.6s ease-in-out infinite; }
.b0 { color: #ff5a5f; }
.b1 { color: #ffd166; }
.b2 { color: #6ee7a8; }
.b3 { color: #7cc4ff; }
.b1 .bulb { animation-delay: .65s; }
.b2 .bulb { animation-delay: 1.3s; }
.b3 .bulb { animation-delay: 1.95s; }
@keyframes twinkle {
  0%, 100% { opacity: 1; }
  50% { opacity: .45; }
}

/* ----------------------------------------------------------------- nav */
.nav {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1040px; margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}
.nav-brand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--cream); text-decoration: none;
  font-family: var(--serif); font-weight: 700; font-size: 18px; white-space: nowrap;
}
.nav-brand img { border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links form { margin: 0; }
.nav-pill {
  display: inline-block; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--pine-900); background: var(--gold); border: 1px solid var(--gold);
  padding: 7px 14px; border-radius: 999px; text-decoration: none; white-space: nowrap;
}
.nav-quiet { color: var(--cream); background: transparent; border-color: rgba(251, 246, 236, .35); }

/* ---------------------------------------------------------------- hero */
.hero {
  position: relative; z-index: 1; text-align: center; color: var(--cream);
  padding: 74px 18px 34px;
}
.eyebrow {
  font-family: var(--serif); font-style: italic; font-size: 17px;
  color: var(--gold-soft); margin: 0 0 4px;
}
.hero-title {
  font-size: clamp(58px, 15vw, 112px); line-height: .95; color: #fff;
  text-shadow: 0 3px 0 var(--cranberry-dark), 0 10px 30px rgba(0, 0, 0, .35);
  margin-bottom: 14px;
}
.hero-when { font-family: var(--serif); font-size: clamp(19px, 4.6vw, 26px); font-weight: 600; margin: 0 0 6px; }
.hero-when .dot { color: var(--gold); padding: 0 4px; }
.hero-where { margin: 0 0 18px; }
.hero-where a { color: var(--pine-200); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(185, 211, 195, .5); }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 0; }
.countdown, .chip {
  display: inline-block; padding: 7px 15px; border-radius: 999px; font-size: 15px; font-weight: 600;
}
.countdown { background: var(--cranberry); color: #fff; }
.chip { background: rgba(251, 246, 236, .12); color: var(--cream); text-decoration: none; border: 1px solid rgba(251, 246, 236, .3); }

/* ---------------------------------------------------------------- page */
.page {
  position: relative; z-index: 1;
  max-width: 720px; margin: 0 auto; padding: 0 14px 40px;
}
.page-wide { max-width: 1040px; }
.page-title { color: var(--cream); font-size: 32px; margin: 18px 4px 16px; }
.crumb { margin: 14px 4px 0; }
.crumb a { color: var(--pine-200); }

.card {
  background: var(--cream); border-radius: var(--radius);
  padding: 22px 20px 24px; margin: 0 0 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  scroll-margin-top: 14px;
}
.card h2 { font-size: 25px; margin-bottom: 12px; color: var(--pine-800); }
.card h3 { font-size: 18px; }
.lead { font-size: 18px; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
.empty { color: var(--ink-soft); font-style: italic; margin: 6px 0 12px; }

.count {
  display: inline-block; min-width: 26px; text-align: center; vertical-align: middle;
  font-family: var(--sans); font-size: 13px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; background: var(--cream-3); color: var(--ink);
}
.count-big { font-size: 15px; background: var(--cranberry); color: #fff; padding: 3px 11px; }

/* --------------------------------------------------------------- tally */
.tally {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--cranberry) 0%, var(--cranberry-dark) 100%);
  color: #fff; border-radius: var(--radius); padding: 18px 22px; margin: 0 0 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
  border: 2px solid rgba(243, 217, 164, .55);
}
.tally-main { display: flex; align-items: baseline; gap: 12px; flex: 1 1 220px; }
.tally-num { font-family: var(--serif); font-weight: 800; font-size: 68px; line-height: 1; color: var(--gold-soft); }
.tally-label { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.tally-side { flex: 1 1 200px; font-size: 15.5px; line-height: 1.7; color: #fbe9e6; }
.tally-side b { color: #fff; font-size: 17px; }

/* ---------------------------------------------------------- note card */
.note-card {
  background:
    linear-gradient(var(--cream), var(--cream)) padding-box,
    repeating-linear-gradient(45deg, var(--cranberry) 0 12px, #fff 12px 24px) border-box;
  border: 6px solid transparent;
}
.asks { list-style: none; margin: 14px 0 10px; padding: 0; display: grid; gap: 12px; }
.asks li { display: flex; gap: 13px; align-items: flex-start; }
.ask-icon {
  flex: none; width: 42px; height: 42px; display: grid; place-items: center; font-size: 22px;
  background: var(--cream-2); border-radius: 50%;
}
.sign { font-family: var(--serif); font-style: italic; font-size: 19px; margin: 14px 0 0; text-align: right; color: var(--pine-700); }

/* ------------------------------------------------------------- flashes */
.flashes { margin: 0 0 14px; display: grid; gap: 8px; }
.flash { padding: 12px 15px; border-radius: 12px; font-weight: 600; font-size: 16px; }
.flash-ok { background: #dff3e6; color: #124a2f; border: 1px solid #a9d9bc; }
.flash-error { background: #fde4e1; color: #7c1420; border: 1px solid #f0b3ad; }

/* --------------------------------------------------------------- forms */
.field { margin: 0 0 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--ink-soft); font-size: 14.5px; }
input[type=text], input[type=email], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: #fff; border: 1.5px solid var(--cream-3); border-radius: 12px;
  padding: 11px 13px; min-height: 48px;
}
textarea { resize: vertical; min-height: 0; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}
input[readonly] { background: var(--cream-2); color: var(--ink-soft); }

.btn {
  display: inline-block; font: inherit; font-weight: 700; cursor: pointer; text-align: center;
  text-decoration: none; border: 0; border-radius: 999px; padding: 13px 26px; min-height: 48px;
}
.btn-primary { background: var(--cranberry); color: #fff; }
.btn-primary:hover { background: var(--cranberry-dark); }
.btn-gold { background: var(--gold); color: var(--pine-900); }
.btn-ghost { background: transparent; color: var(--pine-700); border: 1.5px solid var(--pine-600); }
.btn-danger { background: #fff; color: var(--cranberry); border: 1.5px solid var(--cranberry); }
.btn-big { width: 100%; font-size: 18px; }
.link-btn {
  font: inherit; font-size: 15px; font-weight: 600; color: var(--cranberry);
  background: none; border: 0; padding: 4px 2px; cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px;
}
.inline-form { margin: 12px 0 0; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 500; margin: 0 0 16px; }
.check input { width: 20px; height: 20px; accent-color: var(--cranberry); }

/* RSVP */
.status { padding: 11px 14px; border-radius: 12px; font-weight: 600; margin-bottom: 16px; }
.status-yes { background: #dff3e6; color: #124a2f; }
.status-no { background: var(--cream-2); color: var(--ink); }
.status-pending { background: #fff3cf; color: #5c4306; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 18px; }
.choice-opt { margin: 0; cursor: pointer; }
.choice-opt input { position: absolute; opacity: 0; pointer-events: none; }
.choice-opt span {
  display: block; text-align: center; padding: 15px 8px; border-radius: 14px;
  background: #fff; border: 2px solid var(--cream-3); font-size: 16.5px;
}
.choice-opt input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 2px; }
.choice-yes input:checked + span { background: #dff3e6; border-color: var(--green-ok); color: #124a2f; }
.choice-no input:checked + span { background: var(--cream-2); border-color: var(--ink-soft); }

.stepper { display: grid; grid-template-columns: 48px 1fr 48px; gap: 6px; }
.stepper button {
  font: inherit; font-size: 24px; font-weight: 700; line-height: 1; cursor: pointer;
  border: 1.5px solid var(--cream-3); background: var(--cream-2); color: var(--pine-800); border-radius: 12px;
}
.stepper input { text-align: center; font-weight: 700; font-size: 20px; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Items you bring */
.my-items { list-style: none; margin: 0 0 14px; padding: 0; }
.my-items li {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px dashed var(--cream-3);
}
.my-items form { margin: 0 0 0 auto; }
.my-item-emoji { font-size: 22px; }
.my-item-text { font-weight: 600; overflow-wrap: anywhere; }
.item-form { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) auto; gap: 8px; }

/* Pot luck table */
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 14px; }
.table-cat { background: #fff; border: 1.5px solid var(--cream-3); border-radius: 14px; padding: 13px 15px; }
.table-cat h3 { display: flex; align-items: center; gap: 8px; font-size: 17px; margin-bottom: 6px; }
.table-cat h3 .count { margin-left: auto; }
.table-cat ul { list-style: none; margin: 0; padding: 0; }
.table-cat li { padding: 5px 0; border-top: 1px dashed var(--cream-3); overflow-wrap: anywhere; }
.table-cat li:first-child { border-top: 0; }
.table-cat .who { display: block; font-size: 14px; color: var(--ink-soft); }
.table-cat-empty { background: transparent; border-style: dashed; }
.table-cat-empty .empty { margin: 0; font-size: 15px; }

/* Guest list */
.guest-list { list-style: none; margin: 0; padding: 0; }
.guest-list li { padding: 12px 0; border-bottom: 1px solid var(--cream-3); }
.guest-list li:last-child { border-bottom: 0; }
.guest-main { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.guest-name { font-family: var(--serif); font-weight: 700; font-size: 19px; overflow-wrap: anywhere; }
.party {
  flex: none; font-size: 14px; font-weight: 700; color: var(--green-ok);
  background: #dff3e6; padding: 3px 10px; border-radius: 999px;
}
.you {
  font-family: var(--sans); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  background: var(--gold-soft); color: #5c4306; padding: 2px 7px; border-radius: 999px; vertical-align: middle;
}
.guest-items { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.dish { background: #fff; border: 1px solid var(--cream-3); border-radius: 999px; padding: 3px 11px; font-size: 15px; overflow-wrap: anywhere; }
.dish-none { background: transparent; border-style: dashed; color: var(--ink-soft); font-style: italic; }
.sub { margin: 20px 0 8px; color: var(--pine-800); }
.names { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.names span { background: #fff3cf; color: #5c4306; border-radius: 999px; padding: 3px 11px; font-size: 15px; }
.names-quiet span { background: var(--cream-2); color: var(--ink-soft); }

/* Install help */
.install details { border-top: 1px solid var(--cream-3); padding: 4px 0; }
.install details:last-of-type { border-bottom: 1px solid var(--cream-3); margin-bottom: 12px; }
.install summary { cursor: pointer; font-weight: 700; padding: 10px 2px; font-size: 17px; }
.install ol { margin: 2px 0 12px; padding-left: 24px; }
.install li { margin-bottom: 6px; }
.key {
  display: inline-block; min-width: 26px; text-align: center; padding: 0 6px;
  background: var(--cream-2); border: 1px solid var(--cream-3); border-radius: 6px; font-weight: 700;
}

.foot { text-align: center; color: var(--pine-200); padding: 14px 0 10px; }
.foot p { margin: 0 0 4px; }

/* ---------------------------------------------------------------- auth */
.auth-page { display: flex; flex-direction: column; }
.auth-wrap {
  position: relative; z-index: 1; flex: 1; display: grid; place-items: center;
  padding: 76px 16px 40px; min-height: 100vh;
}
.auth-card {
  width: 100%; max-width: 420px; text-align: center;
  background: var(--cream); border-radius: 22px; padding: 30px 24px 26px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4);
  border-top: 8px solid var(--cranberry);
}
.auth-logo { border-radius: 20px; box-shadow: 0 6px 16px rgba(0, 0, 0, .2); }
.auth-emoji { font-size: 52px; line-height: 1; margin-bottom: 8px; }
.auth-card .eyebrow { color: var(--cranberry); margin-top: 12px; }
.auth-card h1 { font-size: 34px; color: var(--pine-800); margin-bottom: 6px; }
.auth-card h1.festive { font-size: 52px; line-height: 1; color: var(--cranberry); }
.auth-sub { color: var(--ink-soft); margin-bottom: 20px; }
.auth-label { text-align: left; font-size: 15px; }
.auth-input { margin-bottom: 14px; font-size: 18px; }
.auth-code { text-align: center; font-size: 30px !important; letter-spacing: .32em; font-weight: 700; }
.auth-alt { font-size: 15px; color: var(--ink-soft); margin: 16px 0 0; }
.auth-card .flash { text-align: left; margin-bottom: 16px; }

/* --------------------------------------------------------------- admin */
.invite-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; align-items: end; }
.invite-form .check, .invite-form .btn { grid-column: 1 / -1; justify-self: start; }
.invite-form + .small { margin: 14px 0 0; }
.table-scroll { overflow-x: auto; margin: 0 -6px; }
.guests-table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.guests-table th {
  text-align: left; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-soft); padding: 8px 8px; border-bottom: 2px solid var(--cream-3); white-space: nowrap;
}
.guests-table td { padding: 10px 8px; border-bottom: 1px solid var(--cream-3); vertical-align: top; }
.guests-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.guest-link { font-weight: 700; color: var(--pine-800); }
.cell-sub { font-size: 13.5px; color: var(--ink-soft); }
.note-cell { max-width: 220px; font-size: 14.5px; overflow-wrap: anywhere; }
.actions { white-space: nowrap; text-align: right; }
.actions form { display: inline; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.tag-yes { background: #dff3e6; color: #124a2f; }
.tag-no { background: var(--cream-3); color: var(--ink); }
.tag-pending { background: #fff3cf; color: #5c4306; }
.danger-row { display: flex; flex-wrap: wrap; gap: 10px; }
.danger-row form { margin: 0; }

/* -------------------------------------------------------------- mobile */
@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .hero { padding-top: 66px; }
  .card { padding: 20px 16px 22px; }
  .field-row, .invite-form { grid-template-columns: 1fr; }
  .item-form { grid-template-columns: 1fr; }
  .tally-num { font-size: 58px; }
  .choice-opt span { font-size: 15.5px; padding: 14px 4px; }
}

/* Guest table becomes a stack of cards on phones */
@media (max-width: 760px) {
  .table-scroll { overflow: visible; margin: 0; }
  .guests-table thead { display: none; }
  .guests-table, .guests-table tbody, .guests-table tr, .guests-table td { display: block; }
  .guests-table tr { padding: 13px 0; border-bottom: 1px solid var(--cream-3); }
  .guests-table td { border: 0; padding: 3px 0; text-align: left; max-width: none; }
  .guests-table td.num { text-align: left; }
  .guests-table td[data-label] { display: flex; gap: 8px; }
  .guests-table td[data-label]::before {
    content: attr(data-label); flex: none; width: 76px;
    font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); padding-top: 3px;
  }
  .guests-table td.actions { text-align: left; padding-top: 6px; display: flex; gap: 16px; }
  .guests-table td.is-empty[data-label] { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lights .bulb { animation: none; }
  .snow { display: none; }
}
