/* ==========================================================================
   Christmas Dinner · shared foundations
   One winter night: pine-dark sky, gold leaf, cranberry wax and ivory card.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Night */
  --night-0: #030b08;
  --night-1: #06120e;
  --night-2: #0a1c16;
  --night-3: #0f271f;
  --night-4: #15332a;

  /* Gold leaf */
  --gold: #d9b45a;
  --gold-hi: #f2d994;
  --gold-lo: #a07c2e;
  --gold-ink: #7d5c1a;
  --foil: linear-gradient(100deg, #a07c2e 0%, #d9b45a 14%, #fff1c0 27%, #e3be62 40%, #a9822f 55%, #f1d78b 72%, #c09239 86%, #a07c2e 100%);

  /* Cranberry wax */
  --berry: #b21f37;
  --berry-deep: #751024;
  --berry-hi: #e46377;

  /* Ivory card */
  --paper: #f8f1e2;
  --paper-2: #efe3c7;
  --ink: #1a2a22;
  --ink-2: #44554b;
  --ink-3: #6b7a71;

  /* Text on night */
  --snow: #eef4f0;
  --frost: #bccdc4;
  --mist: #8ba498;
  --line: rgba(222, 236, 229, 0.12);
  --line-strong: rgba(222, 236, 229, 0.2);
  --line-gold: rgba(217, 180, 90, 0.4);

  /* Reply states (validated for colour-blind separation on the night surface; always paired with an icon + label) */
  --yes: #2fa99a;
  --no: #df6e57;

  /* Type */
  --font-script: "Pinyon Script", "Snell Roundhand", "Apple Chancery", "Segoe Script", cursive;
  --font-serif: "Cormorant Garamond", "Cormorant", "EB Garamond", Garamond, "Iowan Old Style", "Times New Roman", serif;
  --font-sans: "Jost", "Futura", "Avenir Next", "Century Gothic", "Segoe UI", system-ui, sans-serif;

  --gutter: clamp(18px, 5vw, 48px);
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --shadow-card: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 30px 60px -32px rgba(0, 0, 0, 0.85);
  --shadow-paper: 0 1px 1px rgba(0, 0, 0, 0.2), 0 18px 36px -18px rgba(0, 0, 0, 0.7), 0 60px 100px -50px rgba(0, 0, 0, 0.8);

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .42 0 0 0 0 .33 0 0 0 0 .18 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --corner-tl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%23a07c2e' stroke-width='1'%3E%3Cpath d='M5 34V13a8 8 0 0 1 8-8h21'/%3E%3Cpath d='M9 34V17a8 8 0 0 1 8-8h17' stroke-opacity='.45'/%3E%3Cpath d='M5 5l4 4'/%3E%3Ccircle cx='4' cy='4' r='1.8' fill='%23a07c2e' stroke='none'/%3E%3C/svg%3E");
  --corner-tr: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%23a07c2e' stroke-width='1'%3E%3Cg transform='rotate(90 20 20)'%3E%3Cpath d='M5 34V13a8 8 0 0 1 8-8h21'/%3E%3Cpath d='M9 34V17a8 8 0 0 1 8-8h17' stroke-opacity='.45'/%3E%3Cpath d='M5 5l4 4'/%3E%3Ccircle cx='4' cy='4' r='1.8' fill='%23a07c2e' stroke='none'/%3E%3C/g%3E%3C/svg%3E");
  --corner-br: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%23a07c2e' stroke-width='1'%3E%3Cg transform='rotate(180 20 20)'%3E%3Cpath d='M5 34V13a8 8 0 0 1 8-8h21'/%3E%3Cpath d='M9 34V17a8 8 0 0 1 8-8h17' stroke-opacity='.45'/%3E%3Cpath d='M5 5l4 4'/%3E%3Ccircle cx='4' cy='4' r='1.8' fill='%23a07c2e' stroke='none'/%3E%3C/g%3E%3C/svg%3E");
  --corner-bl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40' fill='none' stroke='%23a07c2e' stroke-width='1'%3E%3Cg transform='rotate(270 20 20)'%3E%3Cpath d='M5 34V13a8 8 0 0 1 8-8h21'/%3E%3Cpath d='M9 34V17a8 8 0 0 1 8-8h17' stroke-opacity='.45'/%3E%3Cpath d='M5 5l4 4'/%3E%3Ccircle cx='4' cy='4' r='1.8' fill='%23a07c2e' stroke='none'/%3E%3C/g%3E%3C/svg%3E");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--night-1);
  overflow-x: clip;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--night-1);
  color: var(--snow);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 500;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(217, 180, 90, 0.38);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--gold-hi);
  outline-offset: 3px;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
}

/* --------------------------------------------------------------------------
   Type
   -------------------------------------------------------------------------- */

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
}

.script {
  font-family: var(--font-script);
  font-weight: 400;
}

.foil {
  background-image: var(--foil);
  background-size: 240% 100%;
  background-position: 0% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  --btn-h: 52px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65em;
  min-height: var(--btn-h);
  padding: 0 1.7em;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.3s var(--ease), box-shadow 0.35s var(--ease), background-color 0.3s, color 0.3s;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.btn:active {
  transform: translateY(1px) scale(0.985);
}

.btn--gold {
  color: #2a1f08;
  background: linear-gradient(180deg, #f7e2a3 0%, #e2c066 46%, #c89c3e 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(90, 60, 10, 0.25),
    0 12px 30px -12px rgba(217, 180, 90, 0.7),
    0 2px 6px rgba(0, 0, 0, 0.35);
}

.btn--gold::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.75) 46%, transparent 62%);
  transform: translateX(-130%);
  transition: transform 0.9s var(--ease-out);
}

@media (hover: hover) {
  .btn--gold:hover {
    transform: translateY(-2px);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.6),
      inset 0 -1px 0 rgba(90, 60, 10, 0.25),
      0 18px 40px -12px rgba(217, 180, 90, 0.85),
      0 2px 6px rgba(0, 0, 0, 0.35);
  }

  .btn--gold:hover::after {
    transform: translateX(130%);
  }
}

.btn--ghost {
  color: var(--gold-hi);
  background: rgba(217, 180, 90, 0.06);
  box-shadow: inset 0 0 0 1px var(--line-gold);
}

@media (hover: hover) {
  .btn--ghost:hover {
    background: rgba(217, 180, 90, 0.14);
    box-shadow: inset 0 0 0 1px rgba(217, 180, 90, 0.7);
  }
}

.btn--ink-ghost {
  color: var(--ink);
  background: transparent;
  box-shadow: inset 0 0 0 1px rgba(26, 42, 34, 0.32);
}

@media (hover: hover) {
  .btn--ink-ghost:hover {
    background: rgba(26, 42, 34, 0.06);
    box-shadow: inset 0 0 0 1px rgba(26, 42, 34, 0.55);
  }
}

.btn--sm {
  --btn-h: 42px;
  padding: 0 1.25em;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
}

.btn--lg {
  --btn-h: 58px;
  padding: 0 2.2em;
  font-size: 0.82rem;
}

.btn__spinner {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.btn__spinner .icon {
  width: 22px;
  height: 22px;
  animation: spin 1.4s linear infinite;
}

.btn[aria-busy="true"] {
  pointer-events: none;
}

.btn[aria-busy="true"] .btn__label {
  opacity: 0;
}

.btn[aria-busy="true"] .btn__spinner {
  opacity: 1;
}

.link-btn {
  border: 0;
  background: none;
  padding: 6px 2px;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mist);
  text-decoration: underline;
  text-decoration-color: rgba(139, 164, 152, 0.4);
  text-underline-offset: 4px;
  transition: color 0.2s;
}

.link-btn:hover {
  color: var(--frost);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   The night sky behind everything
   -------------------------------------------------------------------------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% 108%, #0e2a21 0%, transparent 60%),
    linear-gradient(180deg, #020907 0%, #051410 34%, #0a2119 72%, #07160f 100%);
}

.backdrop__night,
.backdrop__warm {
  position: absolute;
  inset: 0;
}

.backdrop__night {
  opacity: calc(1 - var(--indoor, 0) * 0.75);
}

.backdrop__warm {
  opacity: var(--indoor, 0);
  background:
    radial-gradient(70% 45% at 50% 100%, rgba(255, 168, 76, 0.13), transparent 70%),
    radial-gradient(45% 40% at 0% 55%, rgba(178, 31, 55, 0.16), transparent 70%),
    radial-gradient(45% 40% at 100% 35%, rgba(217, 180, 90, 0.13), transparent 70%),
    linear-gradient(180deg, #07130f 0%, #0b1a14 100%);
}

.aurora {
  position: absolute;
  inset: -20% -30% 30%;
  background:
    radial-gradient(38% 42% at 28% 42%, rgba(70, 220, 165, 0.13), transparent 70%),
    radial-gradient(32% 36% at 66% 30%, rgba(90, 170, 225, 0.09), transparent 70%),
    radial-gradient(26% 30% at 50% 56%, rgba(130, 235, 190, 0.07), transparent 70%);
  animation: aurora 28s ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes aurora {
  from {
    transform: translate3d(-5%, 0, 0) scale(1);
  }
  to {
    transform: translate3d(5%, 4%, 0) scale(1.1);
  }
}

.stars {
  position: absolute;
  inset: 0 0 30%;
  -webkit-mask-image: linear-gradient(180deg, #000 20%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 20%, transparent 100%);
}

.stars i {
  position: absolute;
  inset: 0;
  animation: stars var(--t) ease-in-out infinite alternate;
}

.stars i:nth-child(1) {
  --t: 4.2s;
  background-image:
    radial-gradient(1px 1px at 23px 37px, #fff, transparent),
    radial-gradient(1px 1px at 137px 83px, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1.4px 1.4px at 211px 157px, #fff, transparent),
    radial-gradient(1px 1px at 71px 199px, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1px 1px at 173px 21px, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1px 1px at 97px 131px, rgba(255, 244, 214, 0.8), transparent);
  background-size: 240px 240px;
}

.stars i:nth-child(2) {
  --t: 6.4s;
  animation-delay: -2s;
  background-image:
    radial-gradient(1.2px 1.2px at 51px 91px, #fff, transparent),
    radial-gradient(1px 1px at 263px 41px, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1.6px 1.6px at 181px 257px, rgba(255, 246, 220, 0.95), transparent),
    radial-gradient(1px 1px at 301px 187px, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1px 1px at 121px 311px, rgba(255, 255, 255, 0.7), transparent);
  background-size: 337px 337px;
}

.stars i:nth-child(3) {
  --t: 3.1s;
  animation-delay: -1.1s;
  background-image:
    radial-gradient(1.8px 1.8px at 83px 67px, #fff, transparent),
    radial-gradient(1px 1px at 331px 223px, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1.3px 1.3px at 217px 389px, rgba(220, 240, 255, 0.9), transparent),
    radial-gradient(1px 1px at 389px 119px, rgba(255, 255, 255, 0.8), transparent);
  background-size: 419px 419px;
}

@keyframes stars {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 1;
  }
}

.moon {
  position: absolute;
  top: clamp(120px, 17vh, 190px);
  right: clamp(22px, 11vw, 230px);
  width: clamp(40px, 5.5vw, 76px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 62% 38%, rgba(190, 180, 150, 0.35) 0 9%, transparent 10%),
    radial-gradient(circle at 36% 62%, rgba(190, 180, 150, 0.3) 0 7%, transparent 8%),
    radial-gradient(circle at 58% 70%, rgba(190, 180, 150, 0.22) 0 5%, transparent 6%),
    radial-gradient(circle at 38% 34%, #fffbef 0%, #f1ead3 50%, #d6ceb4 100%);
  box-shadow:
    0 0 30px 6px rgba(255, 246, 220, 0.22),
    0 0 110px 40px rgba(190, 225, 215, 0.1);
  opacity: 0.92;
}

.bokeh span {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: var(--o, 0.2);
  background: radial-gradient(circle, rgba(var(--c), 0.9) 0%, rgba(var(--c), 0.35) 38%, rgba(var(--c), 0) 70%);
  animation: bokeh var(--d, 20s) ease-in-out infinite alternate;
  will-change: transform;
}

@keyframes bokeh {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(40px, -60px, 0) scale(1.15);
  }
}

/* Canvases */

.snow {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  z-index: 45;
  pointer-events: none;
}

.confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 80;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Ivory card and gold frame
   -------------------------------------------------------------------------- */

.paper {
  position: relative;
  color: var(--ink);
  background:
    radial-gradient(140% 90% at 15% 0%, #fffcf3 0%, rgba(255, 252, 243, 0) 55%),
    linear-gradient(170deg, var(--paper) 0%, var(--paper-2) 100%);
  border-radius: 8px;
  box-shadow: var(--shadow-paper);
}

.paper::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: var(--grain);
  opacity: 0.32;
  pointer-events: none;
}

.frame::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(160, 124, 46, 0.5);
  outline: 1px solid rgba(160, 124, 46, 0.24);
  outline-offset: -6px;
  border-radius: 3px;
  pointer-events: none;
  background:
    var(--corner-tl) top left / 30px 30px no-repeat,
    var(--corner-tr) top right / 30px 30px no-repeat,
    var(--corner-br) bottom right / 30px 30px no-repeat,
    var(--corner-bl) bottom left / 30px 30px no-repeat;
}

/* --------------------------------------------------------------------------
   Guest baubles (initials on a glass ornament)
   -------------------------------------------------------------------------- */

.bauble {
  --c: #b21f37;
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  font-family: var(--font-sans);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fffaf0;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 32%),
    radial-gradient(circle at 60% 70%, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%),
    var(--c);
  box-shadow: 0 0 0 2px var(--night-1), inset 0 -2px 4px rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

.peek .bauble {
  margin-left: -8px;
}

.bauble[data-tone="0"] { --c: #b21f37; }
.bauble[data-tone="1"] { --c: #1f6a4f; }
.bauble[data-tone="2"] { --c: #b7892c; }
.bauble[data-tone="3"] { --c: #2d5d8c; }
.bauble[data-tone="4"] { --c: #7b3b7f; }
.bauble[data-tone="5"] { --c: #9a4a26; }

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: min(92vw, 480px);
  padding: 14px 20px;
  border-radius: 14px;
  background: rgba(10, 26, 21, 0.94);
  color: var(--snow);
  box-shadow: inset 0 0 0 1px var(--line-gold), 0 24px 60px -20px rgba(0, 0, 0, 0.85);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.45;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 0.35s, transform 0.5s var(--ease-out);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.toast .icon {
  width: 20px;
  height: 20px;
  color: var(--gold-hi);
}

.toast--error {
  box-shadow: inset 0 0 0 1px rgba(236, 127, 143, 0.55), 0 24px 60px -20px rgba(0, 0, 0, 0.85);
}

.toast--error .icon {
  color: var(--no);
}

/* --------------------------------------------------------------------------
   Scroll reveals (content is visible without JavaScript)
   -------------------------------------------------------------------------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 1s var(--ease-out), transform 1.2s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}
