/* ============================================================
   Design tokens — single source of visual truth.
   Warm paper, evergreen, berry, parchment. One palette for all pages.
   ============================================================ */
:root {
  /* Color — paper-craft */
  --paper: #f6eddc;        /* warm cream page background */
  --paper-2: #efe4cd;      /* parchment panel */
  --paper-3: #e6d7b8;      /* parchment edge / stitch shadow */
  --card: #fffdf8;         /* warm white card surface */
  --evergreen: #0b221d;    /* deep evergreen (near-black green) */
  --evergreen-700: #14352b;
  --sage: #e6f1ea;         /* light sage (empty-door surface) */
  --sage-2: #cfe0d4;
  --berry: #c62f45;        /* primary CTA red */
  --berry-dark: #a31f37;
  --berry-soft: #f8e4e8;
  --pine: #2f6b4f;         /* success / positive */
  --pine-soft: #e2efe6;
  --gold: #c99a3f;         /* subtle accent (numbers, stitching, ribbon) */
  --gold-soft: #f0ddaa;

  /* Neutral text (green-tinted, AA on paper) */
  --ink: #1f2a26;
  --ink-soft: #3c4a44;
  --ink-muted: #5c6a63;
  --line: #ddcba7;
  --line-strong: #c9b287;

  /* On-dark text */
  --on-evergreen: #fffdf8;
  --on-evergreen-muted: #cdd8d2;

  /* Type — serif display + humanist sans, both system-stack (no font download) */
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "DM Serif Display", Georgia, "Iowan Old Style", "Times New Roman", serif;

  /* Sizing */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --gutter: 16px;
  --content-max: 72rem;
  --content-max-narrow: 68rem;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 180ms;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(11, 34, 29, 0.08), 0 1px 4px rgba(11, 34, 29, 0.06);
  --shadow-md: 0 4px 14px rgba(11, 34, 29, 0.10), 0 2px 6px rgba(11, 34, 29, 0.08);
  --shadow-lg: 0 14px 40px rgba(11, 34, 29, 0.16);
}

/* ============================================================
   Base — reset, typography, accessibility primitives.
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--on-evergreen-muted);
  background-color: #0b1f1a; /* deep evergreen, site-wide */
  background-image:
    radial-gradient(rgba(255, 253, 248, 0.022) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.14;
  color: var(--evergreen);
  margin: 0 0 0.55em;
  text-wrap: balance;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.95rem, 4.8vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.95rem); }
h3 { font-size: 1.22rem; }
h4 { font-size: 1.05rem; font-weight: 600; }

p { margin: 0 0 1em; }

a {
  color: var(--berry);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--berry-dark); }

strong { font-weight: 650; color: var(--evergreen); }

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

ul, ol { padding-left: 1.4em; }
li { margin-bottom: 0.35em; }

blockquote {
  margin: 1.1em 0;
  padding: 1.05em 1.35em 1.05em 1.6em;
  background:
    linear-gradient(0deg, transparent 0 27px, rgba(201, 154, 63, 0.14) 27px 28px),
    var(--card);
  background-size: 100% 28px;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-size: 1.05em;
  line-height: 1.85;
  box-shadow: var(--shadow-sm);
}
blockquote p { margin: 0; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}

code, kbd {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.9em;
  background: var(--paper-2);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Accessible focus */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 4px;
}

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

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 1000;
  background: var(--evergreen);
  color: var(--on-evergreen);
  padding: 0.7em 1.1em;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--gutter); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Layout — container, header, nav, footer, hero, grids.
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Header (evergreen, light text) ---------- */
.site-header {
  background: color-mix(in srgb, #0b1f1a 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 253, 248, 0.12);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 62px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--on-evergreen);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--gold-soft); }
.brand .mark { width: 30px; height: 30px; flex: none; }

.site-nav { display: flex; align-items: center; gap: 0.2rem; }
.site-nav a {
  color: var(--on-evergreen-muted);
  text-decoration: none;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
.site-nav a:hover { color: var(--on-evergreen); background: rgba(255, 253, 248, 0.08); }
.site-nav a[aria-current="page"] { color: var(--gold-soft); font-weight: 600; }

.nav-cta { margin-left: 0.4rem; }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255, 253, 248, 0.35);
  color: var(--on-evergreen);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem;
  font-size: 0.95rem;
  cursor: pointer;
  min-height: 44px;
}

/* ---------- Mobile nav ---------- */
@media (max-width: 760px) {
  .menu-toggle { display: inline-block; }
  .site-nav {
    position: absolute;
    top: 62px; left: 0; right: 0;
    background: var(--paper);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1rem;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.85rem 0.5rem; font-size: 1.05rem; border-bottom: 1px solid var(--line); }
  .nav-cta { margin: 0.5rem 0 0; }
}

/* ---------- Footer (transparent; fixed scene shows through) ---------- */
.site-footer {
  background: transparent;
  color: var(--on-evergreen-muted);
  margin-top: 4rem;
  padding: 3rem 0 3.5rem;
  font-size: 0.95rem;
  border-top: 1px solid rgba(255, 253, 248, 0.12);
}
.site-footer a { color: var(--on-evergreen); text-decoration-color: rgba(232, 198, 122, 0.4); }
.site-footer a:hover { color: var(--gold-soft); }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
}
.footer-col h2 {
  color: var(--gold-soft);
  font-family: var(--font-body);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.9rem;
  font-weight: 650;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-bottom {
  border-top: 1px solid rgba(255, 253, 248, 0.14);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}
.footer-bottom .legal-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }

/* ---------- Hero (transparent over the site-wide evergreen) ---------- */
.hero {
  padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(2rem, 5vw, 3.5rem);
  position: relative;
  background:
    radial-gradient(900px 420px at 82% -8%, rgba(201, 154, 63, 0.22), transparent 62%),
    radial-gradient(700px 360px at 8% 110%, rgba(198, 47, 69, 0.14), transparent 60%);
  color: var(--on-evergreen);
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 253, 248, 0.55), transparent 50%),
    radial-gradient(1.5px 1.5px at 30% 64%, rgba(255, 253, 248, 0.4), transparent 50%),
    radial-gradient(1.5px 1.5px at 55% 30%, rgba(246, 201, 90, 0.7), transparent 50%),
    radial-gradient(1.5px 1.5px at 72% 72%, rgba(255, 253, 248, 0.5), transparent 50%),
    radial-gradient(1.5px 1.5px at 88% 18%, rgba(246, 201, 90, 0.6), transparent 50%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 460px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
}
.hero-grid > * { min-width: 0; }
.hero-copy h1 { color: var(--on-evergreen); margin-bottom: 0.22em; max-width: 20ch; font-size: clamp(1.75rem, 4vw, 2.6rem); }
.hero-copy .hero-lead { color: var(--on-evergreen-muted); font-size: clamp(1rem, 2vw, 1.1rem); line-height: 1.5; margin-bottom: 0.8rem; }
.hero-copy .hero-lead p { margin: 0; }
@media (max-width: 600px) {
  .hero { padding-top: 0.75rem; }
  .hero-copy h1 { font-size: 1.55rem; margin-bottom: 0.15em; }
  .hero-copy .hero-lead { font-size: 0.92rem; line-height: 1.4; margin-bottom: 0.6rem; }
}

/* Compact the inline create form so the CTA stays above the fold */
.hero-create .panel { padding: 0.9rem 1rem; }
.hero-create .field { margin-bottom: 0.5rem; }
.hero-create .choice { padding: 0.5rem 0.6rem; }
.hero-create .choice-title { font-size: 0.95rem; }
.hero-create .choice-desc { font-size: 0.8rem; }
.hero-create .help { display: none; }
.hero-create .check .check-text { font-size: 0.85rem; }
@media (max-width: 480px) {
  .hero-create .panel { padding: 0.7rem 0.8rem; }
  .hero-create .field { margin-bottom: 0.35rem; }
}

.hero-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  font-size: 0.9rem;
  color: var(--on-evergreen-muted);
  margin-top: 1rem;
}
.hero-notes a { font-weight: 600; color: var(--gold-soft); }
.hero-notes a:hover { color: #fff; }

/* ---------- Section spacing ---------- */
.section { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section-alt { background: var(--paper-2); }
.section-head { max-width: 60ch; margin-bottom: 1.5rem; }

/* ---------- Generic grids ---------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }

/* ============================================================
   Forms — buttons, inputs, cards-as-forms, consent, feedback.
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.62em 1.25em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--berry); color: #fff; }
.btn-primary:hover { background: var(--berry-dark); box-shadow: var(--shadow-md); }

.btn-gold { background: var(--gold); color: var(--evergreen); }
.btn-gold:hover { background: #b88a30; box-shadow: var(--shadow-md); }

.btn-evergreen { background: var(--evergreen); color: var(--on-evergreen); }
.btn-evergreen:hover { background: var(--evergreen-700); }

.btn-ghost { background: transparent; color: var(--berry); border-color: var(--berry); }
.btn-ghost:hover { background: var(--berry-soft); }

.btn-ghost-light { background: transparent; color: var(--on-evergreen); border-color: rgba(255, 253, 248, 0.5); }
.btn-ghost-light:hover { background: rgba(255, 253, 248, 0.1); }

.btn-sm { min-height: 38px; padding: 0.4em 0.9em; font-size: 0.9rem; }
.btn-block { width: 100%; }

.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Fields ---------- */
.field { margin-bottom: 1.1rem; }
.field label, .field .label {
  display: block;
  font-weight: 650;
  color: var(--evergreen);
  margin-bottom: 0.35rem;
  font-size: 0.98rem;
}
.field .help { font-size: 0.88rem; color: var(--ink-muted); margin-top: 0.3rem; }

.input, .select, .textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.65em 0.8em;
  min-height: 46px;
}
.textarea { min-height: 120px; resize: vertical; }

/* Writing-paper textarea (aligned ruled lines) */
.textarea.letter-area {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 2em;
  background-color: var(--card);
  background-image: linear-gradient(transparent, transparent calc(2em - 1px), rgba(201, 154, 63, 0.22) calc(2em - 1px));
  background-size: 100% 2em;
  background-attachment: local;
}
.input:focus, .select:focus, .textarea:focus {
  outline: 3px solid var(--gold-soft);
  border-color: var(--gold);
}

/* ---------- Choice cards (mode / sticker selection) ---------- */
.choice-grid { display: grid; gap: 0.7rem; }
.choice-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) {
  .choice-grid.cols-3 { grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
  .choice-grid.cols-3 .choice { padding: 0.5rem 0.35rem; text-align: center; }
  .choice-grid.cols-3 .choice-title { font-size: 0.85rem; }
  .choice-grid.cols-3 .choice-desc { display: none; }
}
.choice {
  position: relative;
  text-align: left;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--card);
  padding: 0.95rem;
  cursor: pointer;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.choice:hover { border-color: var(--gold); }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--berry); box-shadow: var(--shadow-md); background: #fff6f7; }
.choice:has(input:focus-visible) { outline: 3px solid var(--gold-soft); }
.choice .choice-title { font-weight: 650; color: var(--evergreen); margin-bottom: 0.2em; }
.choice .choice-desc { font-size: 0.87rem; color: var(--ink-muted); }

.sticker-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sticker-opt {
  position: relative;
  border: 1.5px solid var(--line-strong);
  background: var(--card);
  border-radius: var(--radius-sm);
  width: 48px; height: 48px;
  display: grid; place-items: center;
  cursor: pointer;
}
.sticker-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.sticker-opt:has(input:checked) { border-color: var(--berry); background: var(--berry-soft); }
.sticker-opt .emoji { font-size: 1.4rem; }

/* ---------- Checkbox ---------- */
.check { display: flex; gap: 0.6rem; align-items: flex-start; }
.check input { margin-top: 0.25em; width: 1.15em; height: 1.15em; flex: none; accent-color: var(--berry); }
.check .check-text { font-size: 0.92rem; color: var(--ink-soft); }

/* ---------- Feedback ---------- */
.alert {
  padding: 0.85em 1.1em;
  border-radius: var(--radius-sm);
  margin: 1rem 0;
  font-size: 0.95rem;
}
.alert-error { background: var(--berry-soft); color: var(--berry-dark); border: 1px solid #eeb6c0; }
.alert-success { background: var(--pine-soft); color: var(--pine); border: 1px solid #bfdccb; }
.alert-info { background: var(--paper-2); color: var(--ink-soft); border: 1px solid var(--line-strong); }

.field-error { color: var(--berry-dark); font-size: 0.88rem; margin-top: 0.3rem; }

/* ---------- Character counter ---------- */
.counter { font-size: 0.88rem; color: var(--ink-muted); text-align: right; margin-top: 0.25rem; }
.counter.over { color: var(--berry-dark); font-weight: 650; }

/* ---------- Panel ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(1.25rem, 3vw, 1.9rem);
}
.panel.dark {
  background: var(--evergreen);
  border-color: transparent;
  color: var(--on-evergreen);
}
.panel.dark .field label, .panel.dark .choice-title { color: var(--on-evergreen); }
.panel.dark .input, .panel.dark .select, .panel.dark .textarea {
  background: rgba(255, 253, 248, 0.1);
  border-color: rgba(255, 253, 248, 0.3);
  color: var(--on-evergreen);
}
.panel.dark .help, .panel.dark .choice-desc, .panel.dark .check-text { color: var(--on-evergreen-muted); }

/* ---------- Consent banner & dialog ---------- */
/* Reserve space so the fixed banner never hides the create form's CTA. */
body.consent-open { padding-bottom: 9.5rem; }
@media (min-width: 640px) {
  body.consent-open { padding-bottom: 7rem; }
}

.consent-banner {
  position: fixed;
  left: var(--gutter);
  right: var(--gutter);
  bottom: var(--gutter);
  z-index: 300;
  max-width: 40rem;
  margin-inline: auto;
  background: var(--evergreen);
  color: var(--on-evergreen);
  border: 1px solid rgba(255, 253, 248, 0.18);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 0.7rem 1rem;
}
.consent-banner .consent-text { margin: 0 0 0.55rem; font-size: 0.9rem; line-height: 1.4; }
.consent-banner .consent-text a { color: var(--gold-soft); }
.consent-banner .consent-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.consent-banner .consent-actions .btn { min-height: 38px; font-size: 0.88rem; }
@media (max-width: 480px) {
  .consent-banner { padding: 0.6rem 0.8rem; }
  .consent-banner .consent-text { font-size: 0.82rem; margin-bottom: 0.45rem; }
  .consent-banner .consent-actions .btn { min-height: 34px; font-size: 0.82rem; padding: 0.3em 0.7em; }
}
@media (min-width: 640px) {
  .consent-banner { display: flex; align-items: center; gap: 1rem; }
  .consent-banner .consent-text { margin: 0; flex: 1 1 auto; }
  .consent-banner .consent-actions { flex: none; white-space: nowrap; }
}

.consent-dialog {
  position: fixed;
  inset: 0;
  background: rgba(11, 34, 29, 0.6);
  z-index: 400;
  display: grid;
  place-items: center;
  padding: var(--gutter);
}
.consent-dialog.hidden { display: none; }
.consent-dialog-card {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius-lg);
  max-width: 30rem;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

/* Calendar appearance chooser */
.appearance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6rem;
}
.appearance-choice {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
}
.appearance-choice:has(input:checked) {
  border-color: var(--berry);
  box-shadow: 0 0 0 2px var(--berry-soft);
}
.appearance-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.appearance-swatch {
  display: block;
  height: 54px;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.swatch-pine { background: linear-gradient(135deg, #0b221d 0 40%, #c62f45 40% 60%, #fffdf8 60%); }
.swatch-post { background: repeating-linear-gradient(45deg, #f6eddc 0 8px, #b9584f 8px 12px, #e8eef2 12px 20px); }
.swatch-cocoa { background: repeating-linear-gradient(90deg, #5a3a26 0 6px, #8a5a3b 6px 12px, #f0ddaa 12px 15px); }
.appearance-name { font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
@media (max-width: 560px) {
  .appearance-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Calendar — a hanging cloth advent calendar with pockets and
   wrapped gifts. Rod, strings, lights, stitching, ribbons, tags.
   ============================================================ */

/* The cloth board the pockets hang on. */
.calendar-wall {
  position: relative;
  max-width: 54rem;
  margin-inline: auto;
  padding: clamp(0.7rem, 2vw, 1.1rem) clamp(0.6rem, 1.5vw, 1rem);
  background:
    linear-gradient(180deg, rgba(244, 230, 200, 0.97), rgba(236, 218, 180, 0.97)),
    repeating-linear-gradient(45deg, transparent 0 5px, rgba(11, 34, 29, 0.02) 5px 6px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow:
    inset 0 0 0 4px rgba(255, 253, 248, 0.35),
    var(--shadow-lg);
}

.example-label {
  font-size: 0.85rem;
  color: var(--on-evergreen-muted);
  margin: 0 0 0.6rem;
  text-align: center;
  font-style: italic;
  max-width: 40ch;
  margin-inline: auto;
}

/* Hanging rod + strings + a connected string of lights. */
.calendar-hang {
  position: relative;
  height: 54px;
  margin-bottom: 4px;
}
/* the wooden rod */
.calendar-hang::before {
  content: "";
  position: absolute;
  left: -6px; right: -6px; top: 20px;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(180deg, #8a6a42, #5f4526);
  box-shadow: 0 3px 4px rgba(11, 34, 29, 0.3), inset 0 1px 0 rgba(255, 253, 248, 0.3);
}
/* two hanging strings */
.calendar-hang .hang-string {
  position: absolute;
  top: 28px;
  width: 2px;
  height: 18px;
  background: linear-gradient(180deg, #7a5a3a, #b28a52);
}
.calendar-hang .hang-string.left { left: 8%; }
.calendar-hang .hang-string.right { right: 8%; }
/* a swagged wire with warm bulbs */
.calendar-hang .light-wire {
  position: absolute;
  left: 4%; right: 4%; top: 30px;
  height: 22px;
  border-top: 2px solid rgba(122, 90, 58, 0.75);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.calendar-hang .light-wire::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle 5px at 8% 8px, var(--gold-soft) 96%, transparent),
    radial-gradient(circle 5px at 22% 2px, var(--berry) 96%, transparent),
    radial-gradient(circle 5px at 36% 9px, var(--gold-soft) 96%, transparent),
    radial-gradient(circle 5px at 50% 1px, var(--evergreen) 96%, transparent),
    radial-gradient(circle 5px at 64% 9px, var(--gold-soft) 96%, transparent),
    radial-gradient(circle 5px at 78% 2px, var(--berry) 96%, transparent),
    radial-gradient(circle 5px at 92% 8px, var(--gold-soft) 96%, transparent);
  filter: drop-shadow(0 0 3px var(--gold-soft));
}

.door-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.5rem, 1.6vw, 0.85rem);
}
@media (min-width: 768px) {
  .door-grid.advent { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .door-grid.newyear { grid-template-columns: repeat(8, minmax(0, 1fr)); }
}

/* ---------- The pocket ---------- */
.door {
  position: relative;
  aspect-ratio: 0.95;
  border-radius: var(--radius-sm) var(--radius-sm) 6px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  text-align: center;
  padding: 0.4rem 0.35rem 0.6rem;
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(180deg, #fffdf8 0%, var(--paper-2) 78%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(11, 34, 29, 0.015) 3px 4px);
  box-shadow:
    inset 0 8px 6px -6px rgba(11, 34, 29, 0.28),  /* pocket mouth depth */
    var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  overflow: visible;
}
/* stitched seam */
.door::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1.5px dashed rgba(201, 154, 63, 0.55);
  border-radius: calc(var(--radius-sm) - 2px);
  pointer-events: none;
}
/* the wrapped gift peeking out of the pocket (filled states) */
.door.locked::after,
.door.ready::after {
  content: "";
  position: absolute;
  top: -7px;
  left: 16%;
  right: 16%;
  height: 42%;
  border-radius: 4px 4px 3px 3px;
  background:
    linear-gradient(90deg, transparent 0 44%, rgba(255, 253, 248, 0.9) 44% 56%, transparent 56%),
    linear-gradient(180deg, transparent 0 58%, rgba(255, 253, 248, 0.75) 58% 70%, transparent 70%),
    repeating-linear-gradient(45deg, var(--berry) 0 7px, #d84a5e 7px 14px);
  box-shadow: 0 3px 5px rgba(11, 34, 29, 0.22);
}
.door.read::after {
  /* opened: a small letter peeking out */
  content: "";
  position: absolute;
  top: -6px;
  left: 22%;
  right: 22%;
  height: 34%;
  background: #fffdf8;
  border: 1px solid var(--line);
  border-radius: 2px;
  transform: rotate(-2deg);
  box-shadow: 0 2px 4px rgba(11, 34, 29, 0.18);
}

.door .door-num {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.6vw, 1.35rem);
  line-height: 1;
  color: var(--evergreen);
}
.door .door-icon { position: relative; z-index: 1; font-size: clamp(0.8rem, 2vw, 1.05rem); line-height: 1; margin-top: 0.2rem; }
.door .door-label {
  position: relative;
  z-index: 1;
  font-size: clamp(0.55rem, 1.4vw, 0.68rem);
  line-height: 1.2;
  color: var(--ink-muted);
  margin-top: 0.22rem;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.door.btn-door { cursor: pointer; }
.door.btn-door:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.door.btn-door:active { transform: translateY(-1px); }

/* ---------- States (shape + mark + text, never colour alone) ---------- */
.door.empty {
  background:
    linear-gradient(180deg, var(--sage) 0%, #eef4ef 78%);
}
.door.empty::before { opacity: 0.6; }
.door.empty .door-num { color: var(--ink-muted); }
.door.empty .door-icon { opacity: 0.5; }

.door.locked { border-color: var(--gold); }
.door.locked .door-num { color: var(--berry-dark); }

.door.ready {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 154, 63, 0.45), var(--shadow-md);
  animation: pulse-gold 2.6s ease-in-out infinite;
}
.door.ready .door-num { color: var(--berry-dark); }
.door.ready .door-label { color: var(--berry-dark); font-weight: 650; }

.door.read { border-color: var(--sage-2); }
.door.read .door-num { color: var(--pine); }

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 3px rgba(201, 154, 63, 0.4), var(--shadow-md); }
  50% { box-shadow: 0 0 0 9px rgba(201, 154, 63, 0), var(--shadow-md); }
}

/* Gift wrapping variety (a small unified set, cycled by position). */
.door.locked:nth-child(4n+2)::after,
.door.ready:nth-child(4n+2)::after {
  background:
    linear-gradient(90deg, transparent 0 44%, rgba(255, 253, 248, 0.9) 44% 56%, transparent 56%),
    linear-gradient(180deg, transparent 0 58%, rgba(255, 253, 248, 0.75) 58% 70%, transparent 70%),
    repeating-linear-gradient(45deg, var(--gold) 0 7px, #e3bd6a 7px 14px);
}
.door.locked:nth-child(4n)::after,
.door.ready:nth-child(4n)::after {
  background:
    linear-gradient(90deg, transparent 0 44%, rgba(255, 253, 248, 0.9) 44% 56%, transparent 56%),
    linear-gradient(180deg, transparent 0 58%, rgba(255, 253, 248, 0.75) 58% 70%, transparent 70%),
    repeating-linear-gradient(45deg, var(--evergreen) 0 7px, #24503f 7px 14px);
}

/* ---------- The letter (opened note) ---------- */
.note-card {
  background:
    linear-gradient(0deg, transparent 0 31px, rgba(201, 154, 63, 0.16) 31px 32px),
    #fffdf8;
  background-size: 100% 32px;
  border: 1px solid var(--gold);
  border-radius: 2px;
  box-shadow: var(--shadow-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.4rem, 4vw, 2.4rem);
  max-width: 34rem;
  margin-inline: auto;
  position: relative;
}
.note-card::before {
  /* a small tape / fold at the top */
  content: "";
  position: absolute;
  top: -8px; left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 72px; height: 22px;
  background: rgba(201, 154, 63, 0.35);
  border-radius: 2px;
}
.note-card .note-sticker { font-size: 2.2rem; line-height: 1; margin-bottom: 0.7rem; }
.note-card .note-body {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.8vw, 1.5rem);
  line-height: 2;
  color: var(--evergreen);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.note-card .note-meta { margin-top: 1.4rem; font-size: 0.9rem; color: var(--ink-muted); }

/* ---------- Door reveal overlay (lift + unfold) ---------- */
.door-reveal {
  position: fixed;
  inset: 0;
  background: rgba(11, 34, 29, 0.82);
  display: grid;
  place-items: center;
  padding: var(--gutter);
  z-index: 200;
  animation: fade-in 180ms var(--ease);
}
.door-reveal .inner {
  width: 100%;
  max-width: 34rem;
  animation: lift-unfold 340ms var(--ease);
  transform-origin: 50% 100%;
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes lift-unfold {
  from { opacity: 0; transform: translateY(22px) scale(0.96) rotateX(6deg); }
  60% { opacity: 1; }
  to { opacity: 1; transform: translateY(0) scale(1) rotateX(0); }
}
.door-reveal .close { display: block; margin: 1rem auto 0; }

/* ---------- Progress / share bar ---------- */
.progress-track { height: 10px; background: var(--paper-3); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--gold); border-radius: 999px; transition: width 400ms var(--ease); }

.code-badge {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.14em;
  font-size: 1.15rem;
  background: var(--paper-2);
  color: var(--evergreen);
  padding: 0.4em 0.8em;
  border-radius: var(--radius-sm);
  display: inline-block;
  border: 1px dashed var(--gold);
}

/* Multiple notes in one door (Collect F13 extension) */
.door.extra {
  border-style: dashed;
}
.note-list-title {
  margin: 0 0 .75rem;
  font-size: 1.05rem;
  color: var(--evergreen);
}
.note-list-item {
  padding: .9rem 0;
  border-bottom: 1px solid rgba(11, 34, 29, .12);
}
.note-list-item:last-of-type {
  border-bottom: 0;
}
.note-remove {
  margin-top: .5rem;
  font-size: .85rem;
}

/* ---------- Calendar appearances (independent of mode) ---------- */
.door-grid.theme-post .door {
  background: linear-gradient(180deg, #fffdf8 0%, #f4eee2 78%);
  border-color: #b9584f;
}
.door-grid.theme-post .door::before {
  border-color: #b9584f;
  border-style: dashed;
}
.door-grid.theme-post .door.read::after {
  background: repeating-linear-gradient(45deg, #3b6480 0 7px, #4f7f9e 7px 14px);
}
.door-grid.theme-post .door-num { color: #8f3a35; }

.door-grid.theme-cocoa .door {
  background: linear-gradient(180deg, #fbf0dc 0%, #e9d4b4 78%);
  border-color: #8a5a3b;
}
.door-grid.theme-cocoa .door::before {
  border-color: #8a5a3b;
}
.door-grid.theme-cocoa .door.read::after {
  background: repeating-linear-gradient(90deg, #8a5a3b 0 7px, #b07a4f 7px 14px);
}
.door-grid.theme-cocoa .door-num { color: #5a3a26; }

/* Note cards keep the chosen calendar appearance */
.note-card.theme-post { border-color: #b9584f; }
.note-card.theme-post .note-meta { color: #8f3a35; }
.note-card.theme-cocoa {
  border-color: #8a5a3b;
  background: linear-gradient(180deg, #fbf0dc 0%, #f0e0c4 100%);
}
.note-card.theme-cocoa .note-meta { color: #6b4a33; }

/* Paid note wrapping (entitlement-gated) */
.note-list-item.wrapper-berry,
.note-list-item.wrapper-gold,
.note-list-item.wrapper-pine {
  border-radius: var(--radius);
  padding: .9rem;
  margin-top: .5rem;
}
.note-list-item.wrapper-berry { background: linear-gradient(135deg, #f8e4e8, #fffdf8); border: 1px solid var(--berry); }
.note-list-item.wrapper-gold { background: linear-gradient(135deg, #f0ddaa, #fffdf8); border: 1px solid var(--gold); }
.note-list-item.wrapper-pine { background: linear-gradient(135deg, #e2efe6, #fffdf8); border: 1px solid var(--pine); }
.wrapper-chip { display: inline-block; padding: .35rem .55rem; border-radius: 999px; font-size: .82rem; border: 1px solid var(--line); }
.wrapper-chip.wrapper-berry { border-color: var(--berry); }
.wrapper-chip.wrapper-gold { border-color: var(--gold); }
.wrapper-chip.wrapper-pine { border-color: var(--pine); }

/* ============================================================
   Content — prose, cards, breadcrumb, policy pages.
   ============================================================ */
/* ---------- Breadcrumb (on evergreen) ---------- */
.breadcrumb {
  font-size: 0.88rem;
  color: var(--on-evergreen-muted);
  margin: 1rem 0 1rem;
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 0.4rem; color: rgba(255, 253, 248, 0.35); }
.breadcrumb a { color: var(--gold-soft); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---------- Prose article (cream reading panel) ---------- */
.prose {
  max-width: 46rem;
  margin-inline: auto;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.5rem, 4vw, 3rem);
}
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--evergreen); }
.prose section { margin-bottom: 2.4rem; }
.prose h2 { scroll-margin-top: 96px; }
.prose .lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 62ch; }
.prose p, .prose li { color: var(--ink-soft); }

/* ---------- Semantic cards ---------- */
.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}
.cards > * { min-width: 0; }
.card {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
}
.card h3 { margin-bottom: 0.4em; color: var(--evergreen); }
.card p { color: var(--ink-soft); margin: 0; }
.card .card-icon { font-size: 1.6rem; line-height: 1; margin-bottom: 0.6rem; }

/* Two-column content cards for the home "how it works" strip */
.split-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.split-cards > * { min-width: 0; }
@media (max-width: 720px) {
  .split-cards { grid-template-columns: 1fr; }
}

/* Three-column cards (modes, message ideas) — desktop 3-across, mobile 1 */
.cards-3 {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cards-3 > * { min-width: 0; }
@media (max-width: 760px) {
  .cards-3 { grid-template-columns: 1fr; }
}

/* Home page module wrapper (wide enough for card grids, prose still readable) */
.home-modules { max-width: var(--content-max-narrow); }
.home-module {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.25rem, 4vw, 2rem);
  margin-bottom: 1.5rem;
}
.home-module h2 { max-width: 46rem; color: var(--evergreen); }
.home-module .module-lead { max-width: 46rem; color: var(--ink-soft); }
.home-module .module-link { margin-top: 1rem; }
.home-module .module-link a { color: var(--berry); }
/* prose inside a module is plain text, not a nested panel */
.home-module .prose {
  background: transparent;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  margin: 0;
  max-width: 46rem;
}

/* Example notes (clearly labelled, not real submissions) */
.note-example {
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.5;
  color: var(--ink-soft);
  margin: 0;
}

/* FAQ (native details/summary) */
.faq-list { display: grid; gap: 0.6rem; max-width: 46rem; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.faq-item summary {
  cursor: pointer;
  padding: 0.85rem 1.1rem;
  font-weight: 650;
  color: var(--evergreen);
  font-family: var(--font-body);
  font-size: 1rem;
  list-style-position: inside;
}
.faq-item summary:hover { color: var(--berry); }
.faq-item summary::marker { color: var(--berry); }
.faq-item[open] summary { border-bottom: 1px solid var(--line); }
.faq-answer { padding: 0.9rem 1.1rem; color: var(--ink-soft); }
.faq-answer p { margin: 0 0 0.8rem; }
.faq-answer p:last-child { margin-bottom: 0; }

/* Anchor targets clear the sticky header */
#make { scroll-margin-top: 84px; }

/* ---------- Feature split (steps) ---------- */
.step { display: flex; gap: 1rem; align-items: flex-start; }
.step .step-num {
  flex: none;
  width: 2.2rem; height: 2.2rem;
  border-radius: 50%;
  background: var(--gold);
  color: var(--evergreen);
  font-weight: 700;
  display: grid; place-items: center;
  font-family: var(--font-display);
}

/* ---------- Legal / policy pages ---------- */
.policy { max-width: 48rem; }
.policy section { margin-bottom: 2.2rem; }
.policy h2 { scroll-margin-top: 84px; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; }
.hidden { display: none !important; }
.visually-hidden { clip: rect(0 0 0 0); clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; }

/* ============================================================
   Festive scene — site-wide snow, light string, pine trees, snow ground.
   Snow is a fixed viewport layer behind content; decorations never
   capture pointer events. Snow is a nonessential loop with a pause
   control, a reduced-motion path, and a saved preference.
   ============================================================ */

/* --- Snow (fixed, behind everything) --- */
.snow-layer {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.snowflake {
  position: absolute;
  top: -3vh;
  left: 0;
  width: var(--sz, 6px);
  height: var(--sz, 6px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff 0%, rgba(255, 255, 255, 0.85) 40%, rgba(255, 255, 255, 0.12) 78%);
  opacity: var(--op, 0.8);
  animation: snow-fall var(--dur, 14s) linear infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform;
}
@keyframes snow-fall {
  0% { transform: translate3d(0, -4vh, 0); }
  100% { transform: translate3d(var(--drift, 24px), 106vh, 0); }
}
.snow-layer.paused .snowflake,
.snow-layer.tab-hidden .snowflake {
  animation-play-state: paused;
}

/* --- Snow pause/resume control (fixed, below the header) --- */
.snow-control {
  position: fixed;
  top: 5.75rem;
  right: 1rem;
  z-index: 210;
  min-height: 34px;
  padding: 0.3em 0.8em;
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--on-evergreen);
  background: rgba(255, 253, 248, 0.1);
  border: 1px solid rgba(255, 253, 248, 0.35);
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.snow-control:hover { background: rgba(255, 253, 248, 0.18); border-color: rgba(255, 253, 248, 0.6); }

/* --- Light string under the header bar (shared) --- */
.header-garland {
  height: 24px;
  overflow: hidden;
  pointer-events: none;
}
.header-garland svg { display: block; width: 100%; height: 24px; }
@media (max-width: 600px) {
  .header-garland { height: 16px; }
  .header-garland svg { height: 16px; }
}

/* --- Trees + snow ground at the bottom (fixed, behind content) --- */
.site-scene {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 150px;
  pointer-events: none;
  z-index: 0;
}

/* --- Reduced motion: drop the falling loop, keep the still scene --- */
@media (prefers-reduced-motion: reduce) {
  .snow-layer { display: none; }
  .snow-control { display: none; }
  .snowflake { animation: none; }
}

/* games.css — four local mini games */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.game-card {
  display: flex;
  flex-direction: column;
  gap: .6rem;
  padding: 1rem;
}
.game-title {
  margin: 0;
  font-size: 1.1rem;
}
.game-score {
  margin: 0;
  font-weight: 600;
  color: var(--ink-soft);
}
.game-controls {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}
.game-canvas {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  background: var(--evergreen);
  touch-action: manipulation;
}
.reaction-target {
  min-height: 120px;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
  color: var(--evergreen);
  font: 600 1.3rem var(--font-display);
  cursor: pointer;
}
.reaction-target.is-ready {
  background: var(--gold-soft);
  border-color: var(--gold);
}
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .45rem;
}
.memory-card {
  aspect-ratio: 1;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--evergreen);
  color: var(--on-evergreen);
  font-size: 1.6rem;
  cursor: pointer;
}
.memory-card.is-open,
.memory-card.is-found {
  background: var(--card);
  color: var(--evergreen);
}
.memory-card.is-found {
  border-color: var(--pine);
  opacity: .75;
}
.game-inline {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}
.game-inline .input { flex: 1 1 10rem; }
.word-prompt {
  margin: 0;
  font-weight: 600;
  letter-spacing: .04em;
}
@media (max-width: 760px) {
  .games-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .game-card, .reaction-target { transition: none; }
}
