/* FriendsAdvent — Candlelit Nordic Holiday Keepsake & 3D Hinged Doors */
:root {
  --bg-cream: #fcf7ee;
  --bg-kraft: #f2eadc;
  --bg-card: #fffdf8;
  --ink-pine: #0f2e25;
  --ink-muted: #455951;
  --ink-soft: #5f7069;
  --accent-berry: #c42b3c;
  --accent-berry-dark: #931c2b;
  --accent-gold: #d69d34;
  --accent-gold-bright: #f4ce6b;
  --border-vellum: #ddd0ba;
  --border-strong: #c5b190;
  --ok-green: #166534;
  --ok-bg: #ecfdf5;
  --warn-amber: #92400e;
  --warn-bg: #fffbeb;
  --err-red: #991b1b;
  --err-bg: #fef2f2;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-card: 0 14px 36px rgba(10, 32, 25, 0.08), 0 3px 8px rgba(10, 32, 25, 0.04);
  --shadow-collector: 0 24px 64px rgba(5, 19, 15, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --shadow-door: 0 8px 18px rgba(4, 15, 11, 0.28);
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Default collector stage tokens (snowy-pine) */
  --stage-bg: radial-gradient(circle at 80% 15%, rgba(244, 206, 107, 0.16), transparent 48%),
    linear-gradient(155deg, #0b241c 0%, #143d30 56%, #081b15 100%);
  --stage-ink: #fcf7ee;
  --stage-accent: #c42b3c;
  --stage-gold: #f0c460;
  --stage-bezel: rgba(240, 196, 96, 0.28);
  --flap-unlocked-bg: linear-gradient(155deg, #fffdf9 0%, #f7efe0 100%);
  --flap-unlocked-ink: #0f2e25;
  --flap-locked-bg: linear-gradient(155deg, #1b4a3c 0%, #113127 100%);
  --flap-locked-ink: #f7eedc;
  --recess-bg: linear-gradient(180deg, #fff5df 0%, #fae6bd 100%);
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.62;
  color: var(--ink-pine);
  background-color: var(--bg-cream);
  background-image:
    radial-gradient(rgba(15, 46, 37, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, #fcf7ee 0%, #f6eee0 100%);
  background-size: 24px 24px, 100% 100%;
  overflow-x: clip;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--accent-berry);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-berry-dark);
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.18;
  color: var(--ink-pine);
  margin: 0 0 0.65rem;
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2rem, 4.1vw, 3.05rem); }
h2 { font-size: clamp(1.45rem, 2.8vw, 2.05rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.38rem); }

p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.35rem; }
li { margin-bottom: 0.4rem; }

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

.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;
}

.container {
  width: min(1180px, 100% - 2rem);
  margin-inline: auto;
}

.container-narrow {
  width: min(860px, 100% - 2rem);
  margin-inline: auto;
}

/* Unified Tactile Button System */
.btn, button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.16s cubic-bezier(.22,1,.36,1), box-shadow 0.16s ease, filter 0.16s ease, background-color 0.16s ease;
  user-select: none;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1.5px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #cf3042 0%, #a51e2e 100%);
  color: #ffffff;
  border-color: #8f1826;
  box-shadow: 0 6px 18px rgba(196, 43, 60, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.06);
  color: #ffffff;
}

.btn-pine {
  background: linear-gradient(135deg, #164437 0%, #0d2b22 100%);
  color: #fcf7ee;
  border-color: #0b241c;
  box-shadow: 0 5px 14px rgba(10, 32, 25, 0.26);
}

.btn-pine:hover:not(:disabled) {
  filter: brightness(1.08);
  color: #ffffff;
}

.btn-gold {
  background: linear-gradient(135deg, #f6d57a 0%, #d3962c 100%);
  color: #191f16;
  border-color: #b47a1c;
  box-shadow: 0 6px 18px rgba(214, 157, 52, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-gold:hover:not(:disabled) {
  filter: brightness(1.04);
  color: #11160f;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--ink-pine);
  border-color: var(--border-strong);
  box-shadow: 0 2px 6px rgba(15, 46, 37, 0.06);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-kraft);
  border-color: var(--ink-pine);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-pine);
  border-color: rgba(15, 46, 37, 0.24);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(15, 46, 37, 0.06);
}

.btn-hero-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #fcf7ee;
  border-color: rgba(244, 206, 107, 0.42);
}

.btn-hero-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.btn-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.btn-sm {
  min-height: 38px;
  padding: 0.42rem 0.9rem;
  font-size: 0.875rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(252, 247, 238, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-vellum);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink-pine);
  text-decoration: none;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.18rem;
  flex-shrink: 0;
}

.brand-link svg {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 0.82rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--ink-pine);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: var(--bg-kraft);
  color: var(--accent-berry);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.flake-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 38px;
  padding: 0.25rem 0.82rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ecf5f1 0%, #dfece6 100%);
  border: 1.5px solid #adc9bd;
  color: var(--ink-pine);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--ink-pine);
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
  }
  .nav-links {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    background: var(--bg-cream);
    border-bottom: 1px solid var(--border-vellum);
    padding: 0.75rem 1rem 1rem;
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow-card);
  }
  .nav-links.is-open {
    display: flex;
  }
  .nav-links a {
    padding: 0.65rem 0.9rem;
    min-height: 44px;
  }
}

main {
  flex: 1;
}

/* Badges & Collector Stamps */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.28rem 0.78rem;
  border-radius: 999px;
  background: var(--bg-kraft);
  color: var(--ink-pine);
  border: 1px solid var(--border-vellum);
}

.pill-berry {
  background: #fdebec;
  color: var(--accent-berry-dark);
  border-color: #f4b7be;
}

.pill-gold {
  background: linear-gradient(135deg, #fef5dc 0%, #fae7b4 100%);
  color: #6e4504;
  border-color: #e4be63;
}

.pill-pine {
  background: #e5f1ec;
  color: var(--ink-pine);
  border-color: #b4d0c3;
}

.pill-twilight {
  background: rgba(244, 206, 107, 0.16);
  color: #f9dea0;
  border-color: rgba(244, 206, 107, 0.42);
}

.stamp-code {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-weight: 800;
  letter-spacing: 0.1em;
  background: #fffcf5;
  color: var(--ink-pine);
  border: 2px dashed var(--accent-gold);
  border-radius: 10px;
  padding: 0.35rem 0.8rem;
  box-shadow: 0 2px 8px rgba(15, 46, 37, 0.08);
}

/* Cards & Sections */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-vellum);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
}

.section {
  padding: 3.1rem 0;
}

.section-tight {
  padding: 2rem 0;
}

.section-kraft {
  background: rgba(242, 234, 220, 0.65);
  border-top: 1px solid var(--border-vellum);
  border-bottom: 1px solid var(--border-vellum);
}

.muted {
  color: var(--ink-muted);
}

.small {
  font-size: 0.875rem;
}

/* Candlelit Atmospheric Hero Band */
.hero-band {
  position: relative;
  overflow: hidden;
  padding: 2.3rem 0 2.9rem;
  background:
    radial-gradient(circle at 78% 18%, rgba(244, 206, 107, 0.2), transparent 46%),
    radial-gradient(circle at 18% 84%, rgba(196, 43, 60, 0.18), transparent 44%),
    linear-gradient(155deg, #071913 0%, #103227 52%, #091d16 100%);
  color: #fcf7ee;
  border-bottom: 3px solid #d69d34;
}

.hero-band h1,
.hero-band .hero-headline {
  color: #fcf7ee;
}

.hero-band .hero-lead {
  color: rgba(252, 247, 238, 0.86);
  font-size: 1.07rem;
  max-width: 58ch;
}

.hero-band .trust-row {
  color: #f6e7c5;
}

.hero-band .trust-row span::before {
  color: #6ee7b7;
}

.hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 1.85rem;
  align-items: start;
}

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.hero-lead {
  font-size: 1.07rem;
  color: var(--ink-muted);
  max-width: 58ch;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0.9rem 0 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.trust-row span::before {
  content: "✓ ";
  color: var(--ok-green);
  font-weight: 800;
}

/* Pure CSS Falling Snow Dots (GPU transform only, light count) */
.snow-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.snow-dot {
  position: absolute;
  top: -12px;
  border-radius: 50%;
  background: rgba(255, 252, 244, 0.72);
  box-shadow: 0 0 8px rgba(255, 244, 214, 0.45);
  will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
  .snow-dot {
    animation: snowfallFall linear infinite;
  }
  @keyframes snowfallFall {
    0% { transform: translate3d(0, -16px, 0); opacity: 0; }
    12% { opacity: 0.85; }
    88% { opacity: 0.8; }
    100% { transform: translate3d(24px, 760px, 0); opacity: 0; }
  }
}

.snow-dot:nth-child(1) { left: 6%; width: 5px; height: 5px; animation-duration: 12s; animation-delay: 0s; }
.snow-dot:nth-child(2) { left: 14%; width: 3px; height: 3px; animation-duration: 15s; animation-delay: -3s; }
.snow-dot:nth-child(3) { left: 23%; width: 6px; height: 6px; animation-duration: 11s; animation-delay: -6s; }
.snow-dot:nth-child(4) { left: 32%; width: 4px; height: 4px; animation-duration: 16s; animation-delay: -2s; }
.snow-dot:nth-child(5) { left: 41%; width: 5px; height: 5px; animation-duration: 13s; animation-delay: -8s; }
.snow-dot:nth-child(6) { left: 52%; width: 3px; height: 3px; animation-duration: 14s; animation-delay: -4s; }
.snow-dot:nth-child(7) { left: 61%; width: 6px; height: 6px; animation-duration: 10.5s; animation-delay: -1s; }
.snow-dot:nth-child(8) { left: 70%; width: 4px; height: 4px; animation-duration: 14.5s; animation-delay: -7s; }
.snow-dot:nth-child(9) { left: 79%; width: 5px; height: 5px; animation-duration: 12.5s; animation-delay: -5s; }
.snow-dot:nth-child(10) { left: 88%; width: 4px; height: 4px; animation-duration: 15.5s; animation-delay: -9s; }
.snow-dot:nth-child(11) { left: 95%; width: 6px; height: 6px; animation-duration: 11.5s; animation-delay: -2.5s; }
.snow-dot:nth-child(12) { left: 46%; width: 4px; height: 4px; animation-duration: 13.5s; animation-delay: -10s; }

/* Luminous Vellum Creator Jewel Card */
.creator-card {
  position: relative;
  border: 2px solid #d9ab4d;
  color: var(--ink-pine);
  background: linear-gradient(180deg, #fffefb 0%, #f9f2e4 100%);
  box-shadow: 0 24px 52px rgba(4, 15, 11, 0.36), inset 0 0 0 1px rgba(214, 157, 52, 0.25);
}

.creator-steps {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.step-chip {
  flex: 1;
  text-align: center;
  padding: 0.45rem 0.5rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--bg-kraft);
  color: var(--ink-muted);
  border: 1px solid var(--border-vellum);
  cursor: pointer;
}

.step-chip.is-active {
  background: var(--ink-pine);
  color: #fcf7ee;
  border-color: var(--ink-pine);
}

.field {
  margin-bottom: 0.95rem;
}

.field label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: var(--ink-pine);
}

.input, select.input, textarea.input {
  width: 100%;
  min-height: 44px;
  padding: 0.62rem 0.85rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-strong);
  background: #ffffff;
  color: var(--ink-pine);
  font-family: var(--font-sans);
  font-size: 1rem;
}

textarea.input {
  min-height: 96px;
  resize: vertical;
}

.input:focus {
  border-color: var(--ink-pine);
  outline: 3px solid rgba(214, 157, 52, 0.35);
  outline-offset: 0;
}

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

@media (max-width: 520px) {
  .theme-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.28rem;
  padding: 0.6rem 0.65rem;
  min-height: 74px;
  border-radius: 12px;
  border: 2px solid var(--border-vellum);
  background: #ffffff;
  color: var(--ink-pine);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.theme-option:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
}

.theme-option.is-selected {
  border-color: var(--accent-berry);
  background: #fff9f9;
  box-shadow: 0 0 0 3px rgba(196, 43, 60, 0.14);
}

.theme-swatch {
  width: 100%;
  height: 16px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.14);
}

.theme-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.25rem;
  font-size: 0.83rem;
  font-weight: 700;
}

.toggle-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.choice-pill {
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  border: 2px solid var(--border-vellum);
  background: #ffffff;
  color: var(--ink-pine);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  text-align: center;
}

.choice-pill.is-selected {
  background: #eaf4ef;
  border-color: var(--ink-pine);
}

.lookup-inline-card {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
  background: rgba(255, 253, 248, 0.96);
  color: var(--ink-pine);
}

/* ==================== 6 THEMED COLLECTOR STAGES ==================== */
.calendar-stage {
  background: var(--stage-bg);
  color: var(--stage-ink);
  border-radius: var(--radius-lg);
  padding: 1.45rem;
  border: 2px solid var(--stage-bezel);
  box-shadow: var(--shadow-collector);
  position: relative;
  overflow: hidden;
}

.calendar-stage::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  pointer-events: none;
  z-index: 0;
}

.calendar-stage h2,
.calendar-stage h3 {
  color: var(--stage-ink);
}

.calendar-stage[data-theme="gingerbread"] {
  --stage-bg: radial-gradient(circle at 80% 15%, rgba(255, 224, 168, 0.18), transparent 45%),
    linear-gradient(150deg, #5e2918 0%, #7d3a23 55%, #481d10 100%);
  --stage-accent: #d97736;
  --stage-gold: #f6ce7a;
  --stage-bezel: rgba(246, 206, 122, 0.4);
  --flap-unlocked-bg: linear-gradient(155deg, #fff8ec 0%, #fae6cc 100%);
  --flap-unlocked-ink: #4a2113;
  --flap-locked-bg: linear-gradient(155deg, #8b472b 0%, #642c17 100%);
  --flap-locked-ink: #ffecd0;
}

.calendar-stage[data-theme="snowy-pine"] {
  --stage-bg: radial-gradient(circle at 80% 15%, rgba(244, 206, 107, 0.16), transparent 46%),
    linear-gradient(155deg, #0b241c 0%, #143d30 56%, #081b15 100%);
  --stage-accent: #c42b3c;
  --stage-gold: #f0c460;
  --stage-bezel: rgba(240, 196, 96, 0.34);
  --flap-unlocked-bg: linear-gradient(155deg, #fffdf9 0%, #f6eddd 100%);
  --flap-unlocked-ink: #0f2e25;
  --flap-locked-bg: linear-gradient(155deg, #1b4b3d 0%, #103026 100%);
  --flap-locked-ink: #f7eedc;
}

.calendar-stage[data-theme="candy-cane"] {
  --stage-bg: linear-gradient(150deg, #7f1220 0%, #a51e30 55%, #5b0c16 100%);
  --stage-accent: #1c5e4a;
  --stage-gold: #fde49b;
  --stage-bezel: #fde49b;
  --flap-unlocked-bg: linear-gradient(155deg, #fffef9 0%, #fdf0ed 100%);
  --flap-unlocked-ink: #6a101b;
  --flap-locked-bg: linear-gradient(155deg, #9d1e2f 0%, #71111e 100%);
  --flap-locked-ink: #fff2eb;
  box-shadow: inset 0 0 0 6px rgba(255, 255, 255, 0.12), var(--shadow-collector);
}

.calendar-stage[data-theme="midnight-gold"] {
  --stage-bg: radial-gradient(circle at 75% 20%, rgba(247, 207, 108, 0.16), transparent 48%),
    linear-gradient(155deg, #090f20 0%, #152140 55%, #070b17 100%);
  --stage-accent: #e0a83e;
  --stage-gold: #f8d474;
  --stage-bezel: rgba(248, 212, 116, 0.45);
  --flap-unlocked-bg: linear-gradient(155deg, #fdfaf0 0%, #f2e8cf 100%);
  --flap-unlocked-ink: #0e162c;
  --flap-locked-bg: linear-gradient(155deg, #1c2c52 0%, #101933 100%);
  --flap-locked-ink: #fdecbe;
}

.calendar-stage[data-theme="velvet-royal"] {
  --stage-bg: radial-gradient(circle at 25% 20%, rgba(246, 213, 125, 0.14), transparent 50%),
    linear-gradient(150deg, #3c0c1b 0%, #5c162b 55%, #290711 100%);
  --stage-accent: #d69e36;
  --stage-gold: #f6d57d;
  --stage-bezel: rgba(246, 213, 125, 0.42);
  --flap-unlocked-bg: linear-gradient(155deg, #fffaf2 0%, #f7e9d2 100%);
  --flap-unlocked-ink: #3c0c1b;
  --flap-locked-bg: linear-gradient(155deg, #681c33 0%, #410e1d 100%);
  --flap-locked-ink: #fceccb;
}

.calendar-stage[data-theme="aurora"] {
  --stage-bg: radial-gradient(circle at 70% 12%, rgba(92, 238, 206, 0.18), transparent 48%),
    linear-gradient(145deg, #071f29 0%, #0d3a46 52%, #17274c 100%);
  --stage-accent: #32c9aa;
  --stage-gold: #6ef2d6;
  --stage-bezel: rgba(110, 242, 214, 0.38);
  --flap-unlocked-bg: linear-gradient(155deg, #f7fdfd 0%, #e4f6f5 100%);
  --flap-unlocked-ink: #0a2a36;
  --flap-locked-bg: linear-gradient(155deg, #114b58 0%, #0b303a 100%);
  --flap-locked-ink: #dcfcf7;
}

/* Progress Ribbon inside Stage */
.stage-progress-bar {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.88rem;
}

.progress-track {
  width: min(220px, 100%);
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f4ce6b 0%, #f97316 100%);
  transition: width 0.3s ease;
}

/* ==================== 3D HINGED ADVENT DOORS ==================== */
.doors-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.95rem;
  position: relative;
  z-index: 2;
}

.doors-grid-demo {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 960px) {
  .doors-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .doors-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
  }
  .doors-grid-demo {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.door-tile {
  position: relative;
  display: block;
  min-height: 132px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  perspective: 900px;
}

.door-recess {
  position: absolute;
  inset: 2px;
  border-radius: 14px;
  background: var(--recess-bg);
  color: #3a230b;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0.5rem 0.5rem 1.35rem;
  text-align: center;
  box-shadow: inset 6px 6px 14px rgba(72, 42, 10, 0.22);
  border: 1px solid rgba(214, 157, 52, 0.55);
}

.door-recess-icon {
  font-size: 1.55rem;
  line-height: 1;
}

.door-recess-hint {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.door-flap {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 132px;
  padding: 0.76rem;
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.24);
  background: var(--flap-locked-bg);
  color: var(--flap-locked-ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-door);
  transform-origin: left center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transition: transform 0.56s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.door-flap::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  pointer-events: none;
}

.door-tile.is-unlocked .door-flap {
  background: var(--flap-unlocked-bg);
  color: var(--flap-unlocked-ink);
  border-color: rgba(214, 157, 52, 0.58);
}

.door-tile.is-unlocked .door-flap::before {
  border-color: rgba(15, 46, 37, 0.16);
}

.door-tile.is-empty.is-unlocked .door-flap {
  opacity: 0.94;
}

.door-flap::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--stage-gold);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.door-tile:hover .door-flap {
  transform: rotateY(-12deg) translateY(-1px);
  border-color: var(--stage-gold);
}

.door-tile.is-swinging .door-flap {
  transform: rotateY(-74deg);
  box-shadow: 6px 10px 22px rgba(0, 0, 0, 0.34);
}

@media (prefers-reduced-motion: no-preference) {
  .door-tile.is-shaking .door-flap {
    animation: doorLockShake 0.42s ease;
  }
  @keyframes doorLockShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px) rotateZ(-1.2deg); }
    45% { transform: translateX(4px) rotateZ(1.2deg); }
    70% { transform: translateX(-2px); }
  }
}

/* Wrap Tier Foils */
.door-tile[data-wrap="sparkle"] .door-flap {
  border-color: #eab308;
  box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.35), var(--shadow-door);
}

.door-tile[data-wrap="dazzle"] .door-flap {
  border-color: #e11d48;
  box-shadow: 0 0 0 2px rgba(225, 29, 72, 0.38), 0 10px 24px rgba(185, 43, 59, 0.28);
}

.door-tile[data-wrap="wonder"] .door-flap {
  border-color: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.5), 0 12px 28px rgba(214, 158, 54, 0.38);
}

@media (prefers-reduced-motion: no-preference) {
  .door-tile[data-wrap="wonder"]::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 17px;
    border: 2px solid rgba(250, 204, 21, 0.72);
    pointer-events: none;
    z-index: 3;
    animation: wonderPulse 2.8s ease-in-out infinite;
  }
  @keyframes wonderPulse {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 0.95; }
  }
}

.door-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
}

.door-num {
  font-family: var(--font-serif);
  font-size: 1.48rem;
  font-weight: 700;
  line-height: 1;
}

.door-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  color: inherit;
  white-space: nowrap;
}

.door-tile.is-unlocked .door-badge {
  background: rgba(15, 46, 37, 0.11);
}

.door-body {
  margin-top: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  padding-right: 10px;
}

.door-sticker {
  font-size: 1.25rem;
  line-height: 1;
}

.door-caption {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 560px) {
  .door-tile, .door-flap {
    min-height: 112px;
  }
  .door-flap {
    padding: 0.56rem 0.5rem;
  }
  .door-caption {
    font-size: 0.75rem;
    white-space: normal;
    line-height: 1.2;
  }
}

/* Status Banners */
.notice {
  border-radius: var(--radius-md);
  padding: 0.9rem 1.15rem;
  border: 1.5px solid var(--border-vellum);
  background: var(--bg-card);
  margin-bottom: 1rem;
}

.notice-ok {
  background: var(--ok-bg);
  border-color: #86efac;
  color: #14532d;
}

.notice-warn {
  background: var(--warn-bg);
  border-color: #fcd34d;
  color: #78350f;
}

.notice-err {
  background: var(--err-bg);
  border-color: #fca5a5;
  color: #7f1d1d;
}

/* Feature Grids & Comparison Table */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

@media (max-width: 860px) {
  .grid-3, .grid-2 {
    grid-template-columns: 1fr;
  }
}

.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-vellum);
  background: var(--bg-card);
}

.comp-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.comp-table th, .comp-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-vellum);
  font-size: 0.94rem;
}

.comp-table th {
  background: var(--bg-kraft);
  font-family: var(--font-serif);
}

/* FAQ Accordion */
.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--border-vellum);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
}

.faq-trigger {
  width: 100%;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: transparent;
  border: 0;
  text-align: left;
  font-family: var(--font-serif);
  font-size: 1.07rem;
  font-weight: 700;
  color: var(--ink-pine);
  cursor: pointer;
}

.faq-body {
  padding: 0 1.2rem 1.05rem;
  color: var(--ink-muted);
}

/* Modal & Tactile Keepsake Postcard System */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(7, 22, 17, 0.74);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(670px, 100%);
  max-height: 92dvh;
  overflow-y: auto;
  background: linear-gradient(180deg, #fffdf9 0%, #faf3e6 100%);
  border-radius: var(--radius-lg);
  border: 2px solid #d4b06b;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.42);
  padding: 1.5rem;
  position: relative;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.modal-close {
  min-width: 40px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-kraft);
  color: var(--ink-pine);
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}

/* Tactile Keepsake Postcards */
.entry-card {
  position: relative;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  background: #ffffff;
  margin-bottom: 1rem;
  box-shadow: 0 6px 18px rgba(15, 46, 37, 0.06);
}

.entry-card[data-wrap="sparkle"] {
  border-color: #eab308;
  background: linear-gradient(180deg, #fffdf4 0%, #ffffff 100%);
}

.entry-card[data-wrap="dazzle"] {
  border-color: #e11d48;
  background: linear-gradient(180deg, #fff7f9 0%, #ffffff 100%);
}

.entry-card[data-wrap="wonder"] {
  border-color: #d69d34;
  background: linear-gradient(135deg, #fffbeb 0%, #fdf8ee 55%, #fff5f7 100%);
}

.postmark-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-berry-dark);
  border: 1.5px dashed rgba(196, 43, 60, 0.45);
  border-radius: 8px;
  padding: 0.14rem 0.48rem;
  background: rgba(253, 235, 236, 0.55);
}

/* Polaroid Keepsake Frames */
.entry-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin: 0.85rem 0;
}

.entry-media-grid a {
  display: block;
  padding: 0.42rem 0.42rem 0.85rem;
  background: #ffffff;
  border: 1px solid var(--border-vellum);
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(15, 46, 37, 0.14);
  transform: rotate(-1deg);
  transition: transform 0.2s ease;
}

.entry-media-grid a:nth-child(even) {
  transform: rotate(1.2deg);
}

.entry-media-grid a:hover {
  transform: rotate(0deg) scale(1.02);
}

.entry-media-grid img,
.entry-media-grid video {
  width: 100%;
  border-radius: 4px;
  max-height: 250px;
  object-fit: cover;
  display: block;
}

.music-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #f3ece0 0%, #faf5eb 100%);
  border: 1px solid var(--border-strong);
  margin: 0.65rem 0;
}

.vinyl-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, #f4ce6b 0 6px, #12352c 7px 100%);
  flex-shrink: 0;
}

.ai-carol-box {
  padding: 0.95rem;
  border-radius: 14px;
  background: linear-gradient(135deg, #fef5df 0%, #ebf6f1 100%);
  border: 1.5px solid #e4bc61;
  margin: 0.65rem 0;
}

/* Friend Fill-a-Door Mini Picker & Envelope Preview */
.envelope-preview {
  border-radius: 14px;
  padding: 0.85rem 1rem;
  background: var(--flap-unlocked-bg);
  border: 2px dashed var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.mini-door-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin-top: 0.45rem;
}

.mini-door-btn {
  min-width: 36px;
  height: 34px;
  padding: 0 0.4rem;
  border-radius: 8px;
  border: 1.5px solid var(--border-vellum);
  background: #ffffff;
  color: var(--ink-pine);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}

.mini-door-btn.is-empty {
  border-color: #e4bc61;
  background: #fffbeb;
}

.mini-door-btn.is-selected {
  background: var(--accent-berry);
  border-color: var(--accent-berry);
  color: #ffffff;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.prompt-chip {
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-kraft);
  color: var(--ink-pine);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.prompt-chip:hover {
  border-color: var(--accent-berry);
  background: #fdebec;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.45rem;
}

.sticker-btn {
  min-height: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--border-vellum);
  background: #ffffff;
  font-size: 1.2rem;
  cursor: pointer;
}

.sticker-btn.is-selected {
  border-color: var(--accent-berry);
  background: #fdebec;
}

.wrap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

@media (max-width: 520px) {
  .wrap-grid {
    grid-template-columns: 1fr;
  }
}

.wrap-option {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1.5px solid var(--border-vellum);
  background: #ffffff;
  color: var(--ink-pine);
  text-align: left;
  cursor: pointer;
}

.wrap-option.is-selected {
  border-color: var(--accent-berry);
  box-shadow: 0 0 0 3px rgba(196, 43, 60, 0.14);
}

/* Zero-CLS Ad Slots */
.ad-slot {
  width: 100%;
  min-height: 90px;
  margin: 0.5rem 0 1rem;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-strong);
  background: rgba(242, 234, 220, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.65rem;
  text-align: center;
}

.ad-slot[data-ad-hidden="true"] {
  display: none !important;
}

@media (max-width: 640px) {
  .ad-slot {
    min-height: 60px;
  }
}

.ad-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

/* Cookie / Ad Consent Strip (Non-obstructive flow above footer) */
.consent-bar {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 1.25rem;
  background: var(--ink-pine);
  color: #fcf7ee;
  border: 1.5px solid var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.15rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.consent-bar[hidden] {
  display: none !important;
}

.consent-bar .btn-secondary {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink-pine);
}

/* Toast Notifications */
.toast-host {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 110;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: min(360px, calc(100% - 2rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--ink-pine);
  color: #fcf7ee;
  border: 1.5px solid var(--accent-gold);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
  font-size: 0.92rem;
  font-weight: 600;
}

/* Sparkle Burst Canvas */
.sparkle-burst-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 120;
}

/* Demo Checkout */
.page-checkout-demo {
  justify-content: center;
  align-items: center;
  padding: 2rem 1rem;
}

.demo-checkout-wrap {
  width: min(520px, 100%);
  margin: auto;
}

.demo-price {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  margin: 0.4rem 0 0.75rem;
  color: var(--ink-pine);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-vellum);
  background: #eee5d5;
  padding: 2.3rem 0 2.5rem;
  margin-top: 2.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 820px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 500px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.42rem;
}

.footer-links a {
  color: var(--ink-pine);
  text-decoration: none;
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: var(--accent-berry);
  text-decoration: underline;
}

/* Calendar Header Toolbar */
.cal-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.cal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.story-preview-img {
  width: 240px;
  border-radius: 14px;
  border: 2px solid var(--border-strong);
  box-shadow: var(--shadow-card);
  display: block;
  margin: 0.75rem auto;
}

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