/* ==========================================================================
   Advent calendar — storybook night theme
   ========================================================================== */

/* Display face ------------------------------------------------------------- */

@font-face {
  font-family: "Henny Penny";
  src:
    local("Henny Penny"),
    url("fonts/HennyPenny-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/*
 * Nerd Font glyphs (Unicode private-use characters) are not present in the
 * system UI fonts. Use a locally installed Symbols Nerd Font when available,
 * otherwise load the bundled font. unicode-range means the font file is only
 * downloaded when a page actually uses one of these glyphs.
 */
@font-face {
  font-family: "Nerd Font Symbols";
  src:
    local("Symbols Nerd Font"),
    local("Symbols Nerd Font Mono"),
    url("fonts/SymbolsNerdFont-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range:
    U+23FB-23FE, U+2630, U+2665, U+26A1, U+276C-2771, U+2B58,
    U+E000-F8FF, U+F0000-FFFFD, U+100000-10FFFD;
}

/* Tokens ------------------------------------------------------------------- */

:root {
  color-scheme: dark;

  --night-0: #0e1a2b;
  --night-1: #172a43;
  --night-2: #20385a;

  --cream: #f4dfa9;
  --paper: #fff8e7;
  --paper-soft: #f7edd7;
  --ink: #17241e;
  --ink-soft: #4a5a50;
  --sky: #8ecbe1;
  --gold: #ebc655;
  --gold-soft: rgba(235, 198, 85, 0.16);
  --green: #286e4a;
  --green-deep: #1e5d42;
  --red: #a83230;
  --red-bright: #db342b;

  --font-display: "Henny Penny", "Segoe Print", cursive;
  --font-body:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    "Nerd Font Symbols",
    sans-serif;
  --font-serif: Georgia, "Times New Roman", "Nerd Font Symbols", serif;

  --num-shadow-dark: 0 1px 0 rgba(255, 255, 255, 0.38), 1px 3px 4px rgba(0, 0, 0, 0.28);
  --num-shadow-light: 1px 2px 0 rgba(0, 0, 0, 0.28), 2px 4px 6px rgba(0, 0, 0, 0.35);
  --door-radius: 0.2rem;
}

/* Base --------------------------------------------------------------------- */

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  line-height: 1.55;
  color: var(--cream);
  background-color: var(--night-1);
  background-image:
    linear-gradient(
      180deg,
      rgba(23, 42, 67, 0) 0%,
      rgba(23, 42, 67, 0) 45%,
      rgba(32, 56, 90, 0.85) 100%
    ),
    url("stars-small.svg"),
    url("stars-large.svg"),
    linear-gradient(180deg, var(--night-0) 0%, var(--night-1) 45%, var(--night-2) 100%);
  background-size: auto, 480px 480px, 770px 770px, auto;
  background-repeat: no-repeat, repeat, repeat, no-repeat;
  background-position: center top, 0 0, 137px 211px, center top;
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 0.75rem;
}

img {
  max-width: 100%;
}

a {
  color: var(--gold);
}

::selection {
  background: rgba(235, 198, 85, 0.3);
}

#snow-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 20;
  pointer-events: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 100;
  padding: 0.55rem 0.9rem;
  border-radius: 0.4rem;
  background: var(--green);
  color: var(--cream);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0.75rem;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 1.5rem);
}

/* Header ------------------------------------------------------------------- */

.site-header {
  position: relative;
  z-index: 10;
  background: linear-gradient(180deg, rgba(14, 26, 43, 0.82), rgba(14, 26, 43, 0));
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.75rem;
  gap: 0.9rem;
  flex-wrap: wrap;
  padding-block: 0.55rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--cream);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.brand-star {
  color: var(--gold);
  font-size: 1.05rem;
  line-height: 1;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.user-pill {
  color: rgba(244, 223, 169, 0.68);
  font-size: 0.8rem;
}

.user-pill strong {
  color: var(--cream);
  font-weight: 600;
}

.inline-form {
  margin: 0;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.badge-debug {
  color: #fff;
  background: rgba(168, 50, 48, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

/* Main / hero -------------------------------------------------------------- */

.main-content {
  flex: 1;
  padding-top: clamp(1.25rem, 3vw, 2rem);
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}

.hero {
  max-width: 48rem;
  margin: 0 auto clamp(1.6rem, 4vw, 2.6rem);
  text-align: center;
}

.hero-eyebrow {
  margin: 0 0 0.6rem;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 0.7rem;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: clamp(2.35rem, 7vw, 4rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.05;
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.22),
    0 0 28px rgba(244, 223, 169, 0.12);
  text-wrap: balance;
}

.subtitle {
  max-width: 40rem;
  margin: 0 auto;
  color: var(--sky);
  font-size: clamp(0.98rem, 2.4vw, 1.12rem);
  line-height: 1.55;
}

.subtitle span {
  display: block;
}

.subtitle span:nth-child(odd) {
  color: var(--sky);
}

.subtitle span:nth-child(even) {
  color: var(--gold);
}

.subtitle strong {
  color: var(--cream);
  font-weight: 600;
}

/* Flash messages / session warning ---------------------------------------- */

.flash-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 48rem;
  margin: 0 auto 1.4rem;
}

.flash {
  padding: 0.8rem 1rem;
  border-radius: 0.55rem;
  box-shadow: 0 6px 18px rgba(2, 8, 20, 0.28);
  font-size: 0.94rem;
  font-weight: 600;
}

.flash-error {
  background: #7f1d1d;
  color: #fff;
}

.flash-warning {
  background: rgba(168, 50, 48, 0.96);
  color: #fff;
}

.flash-info {
  background: var(--green);
  color: var(--cream);
}

.session-warning {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  max-width: 48rem;
  margin: 0 auto 1.4rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(235, 198, 85, 0.42);
  border-radius: 0.55rem;
  background: var(--gold-soft);
  color: var(--cream);
  font-size: 0.92rem;
}

.session-warning[hidden] {
  display: none;
}

/* Door grid ---------------------------------------------------------------- */

.doors-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(0.55rem, 1.3vw, 0.95rem);
  max-width: 60rem;
  margin-inline: auto;
}

.door-card {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 6;
  min-height: 0;
  padding: 0.5rem;
  border: 0;
  border-radius: var(--door-radius);
  background: var(--door-bg, var(--red-bright));
  color: var(--door-ink, #fff);
  text-decoration: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
  overflow: visible;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.door-card--locked {
  filter: saturate(0.94) brightness(0.98);
}

.door-card--open {
  box-shadow:
    0 0 0 2px rgba(244, 223, 169, 0.28),
    0 5px 16px rgba(0, 0, 0, 0.4);
}

.door-card--today {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  box-shadow:
    0 0 0 6px rgba(235, 198, 85, 0.14),
    0 5px 16px rgba(0, 0, 0, 0.4);
}

.door-card:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 3px;
  box-shadow:
    0 0 0 7px rgba(14, 26, 43, 0.82),
    0 8px 20px rgba(0, 0, 0, 0.4);
}

@media (hover: hover) and (pointer: fine) {
  .door-card:hover {
    transform: translateY(-2px) scale(1.035);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.48);
  }
}

.door-card:active {
  transform: translateY(0) scale(0.99);
}

.door-number {
  position: relative;
  z-index: 3;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6.5vw, 2.9rem);
  font-weight: 400;
  line-height: 1;
  text-shadow: var(--num-shadow, var(--num-shadow-dark));
  font-variant-numeric: tabular-nums;
}

/* Snow sitting on the top edge of closed doors */
.door-card::before {
  content: "";
  position: absolute;
  top: -0.6rem;
  left: -0.1rem;
  right: -0.1rem;
  height: 1.4rem;
  z-index: 2;
  background: url("snow-drift.svg") center top / 100% 100% no-repeat;
  filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, 0.25));
  pointer-events: none;
}

.door-card:nth-child(3n + 2)::before {
  transform: scaleX(-1);
}

.door-card--open::before {
  display: none;
}

.door-card--has-image {
  overflow: hidden;
  padding: 0;
}

.door-card--has-text,
.door-card--has-video {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.55rem 0.45rem 1.5rem;
}

.door-card--has-text .door-number,
.door-card--has-video .door-number {
  font-size: clamp(1.25rem, 5.2vw, 2.2rem);
}

.door-text {
  position: relative;
  z-index: 3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  max-width: 100%;
  font-family: var(--font-body);
  font-size: clamp(0.66rem, 1.7vw, 0.8rem);
  font-weight: 650;
  line-height: 1.18;
  text-align: center;
  text-shadow: none;
  opacity: 0.92;
}

.door-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.door-card--has-image .door-number {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  z-index: 4;
  padding: 0.15rem 0.35rem;
  border-radius: 0.18rem;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1.1;
  text-shadow: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.door-mark {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}

.door-today {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  z-index: 5;
  padding: 0.15rem 0.42rem;
  border-radius: 999px;
  background: var(--green);
  color: var(--cream);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1.2;
  text-transform: uppercase;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.lock-icon {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  z-index: 4;
  width: 0.9rem;
  height: 0.68rem;
  border: 2px solid currentColor;
  border-radius: 0.1rem;
  opacity: 0.7;
}

.lock-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 0.46rem;
  height: 0.4rem;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 0.35em 0.35em 0 0;
  transform: translateX(-50%);
}

/* Per-day door colours ----------------------------------------------------- */

[data-day="1"] {
  --door-bg: #f4dfa9;
  --door-ink: var(--ink);
}
[data-day="2"] {
  --door-bg: #3a7f58;
  --door-ink: #fff;
  --num-shadow: var(--num-shadow-light);
}
[data-day="3"] {
  --door-bg: #ebc655;
  --door-ink: var(--ink);
}
[data-day="4"] {
  --door-bg: #4b8050;
  --door-ink: #fff;
  --num-shadow: var(--num-shadow-light);
}
[data-day="5"] {
  --door-bg: #db342b;
  --door-ink: #fff;
  --num-shadow: var(--num-shadow-light);
}
[data-day="6"] {
  --door-bg: #76b9dc;
  --door-ink: var(--ink);
}
[data-day="7"] {
  --door-bg: #286e4a;
  --door-ink: #fff;
  --num-shadow: var(--num-shadow-light);
}
[data-day="8"] {
  --door-bg: #eac783;
  --door-ink: var(--ink);
}
[data-day="9"] {
  --door-bg: #a83230;
  --door-ink: #fff;
  --num-shadow: var(--num-shadow-light);
}
[data-day="10"] {
  --door-bg: #e86135;
  --door-ink: var(--ink);
}
[data-day="11"] {
  --door-bg: #c7933f;
  --door-ink: var(--ink);
}
[data-day="12"] {
  --door-bg: #f3b629;
  --door-ink: var(--ink);
}
[data-day="13"] {
  --door-bg: #e7a22b;
  --door-ink: var(--ink);
}
[data-day="14"] {
  --door-bg: #a62f36;
  --door-ink: #fff;
  --num-shadow: var(--num-shadow-light);
}
[data-day="15"] {
  --door-bg: #6ba3b9;
  --door-ink: var(--ink);
}
[data-day="16"] {
  --door-bg: #8dbd8d;
  --door-ink: var(--ink);
}
[data-day="17"] {
  --door-bg: #8ecbe1;
  --door-ink: var(--ink);
}
[data-day="18"] {
  --door-bg: #3f78a5;
  --door-ink: #fff;
  --num-shadow: var(--num-shadow-light);
}
[data-day="19"] {
  --door-bg: #aa6439;
  --door-ink: #fff;
  --num-shadow: var(--num-shadow-light);
}
[data-day="20"] {
  --door-bg: #1e5d42;
  --door-ink: #fff;
  --num-shadow: var(--num-shadow-light);
}
[data-day="21"] {
  --door-bg: #d7804d;
  --door-ink: var(--ink);
}
[data-day="22"] {
  --door-bg: #d98731;
  --door-ink: var(--ink);
}
[data-day="23"] {
  --door-bg: #287b70;
  --door-ink: #fff;
  --num-shadow: var(--num-shadow-light);
}
[data-day="24"] {
  --door-bg: #d23f2b;
  --door-ink: #fff;
  --num-shadow: var(--num-shadow-light);
}

/* Paper cards / forms ------------------------------------------------------ */

.auth-card,
.door-detail-card,
.error-card {
  max-width: 28rem;
  margin: clamp(1rem, 4vw, 2.5rem) auto;
  padding: clamp(1.4rem, 4vw, 2.2rem);
  border-radius: 0.65rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  color-scheme: light;
}

.auth-card h1,
.door-detail-card h1,
.error-card h1 {
  margin: 0 0 0.55rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 2.5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.auth-card .hero-eyebrow,
.error-card .hero-eyebrow {
  color: var(--green);
}

.auth-card .subtitle,
.door-detail-card .subtitle,
.error-card .subtitle {
  color: var(--ink-soft);
}

.auth-card a,
.door-detail-card a,
.error-card a {
  color: var(--green);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  margin-top: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  color: #33413a;
  font-size: 0.88rem;
  font-weight: 700;
}

.form-group input {
  width: 100%;
  padding: 0.72rem 0.85rem;
  border: 1px solid rgba(23, 36, 30, 0.22);
  border-radius: 0.4rem;
  background: #fffdf7;
  color: var(--ink);
  font: inherit;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.form-group input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(40, 110, 74, 0.18);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.68rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 0.42rem;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease;
}

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

.btn:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

.auth-card .btn:focus-visible,
.door-detail-card .btn:focus-visible,
.error-card .btn:focus-visible {
  outline-color: var(--green);
}

.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: var(--cream);
}

.btn-primary:hover {
  background: var(--green-deep);
  border-color: var(--green-deep);
}

.btn-secondary {
  background: transparent;
  border-color: rgba(244, 223, 169, 0.45);
  color: var(--cream);
}

.btn-secondary:hover {
  background: rgba(244, 223, 169, 0.12);
  border-color: var(--cream);
}

.auth-card .btn-primary,
.door-detail-card .btn-primary,
.error-card .btn-primary {
  color: var(--cream);
}

.auth-card .btn-secondary,
.door-detail-card .btn-secondary,
.error-card .btn-secondary {
  border-color: rgba(40, 110, 74, 0.35);
  color: var(--green);
}

.auth-card .btn-secondary:hover,
.door-detail-card .btn-secondary:hover,
.error-card .btn-secondary:hover {
  background: rgba(40, 110, 74, 0.08);
  border-color: var(--green);
}

.btn-sm {
  padding: 0.38rem 0.75rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

/* Door detail -------------------------------------------------------------- */

.door-detail-card {
  position: relative;
  max-width: 44rem;
}

.door-detail-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(23, 36, 30, 0.08);
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.door-detail-card .door-detail-close {
  color: var(--ink);
}

.door-detail-close:hover {
  background: rgba(23, 36, 30, 0.16);
}

.door-detail-close:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.door-detail-header {
  text-align: center;
}

.door-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--door-bg, var(--green));
  color: var(--door-ink, #fff);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid rgba(23, 36, 30, 0.1);
  box-shadow: 0 2px 6px rgba(23, 36, 30, 0.18);
}

.door-subtitle {
  margin: 0.4rem 0 0;
  color: var(--green);
  font-weight: 650;
}

.door-detail-body {
  margin: 1.5rem 0 2rem;
  color: #2b332e;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.75;
}

.door-content {
  margin: 0 0 1.25rem;
}

.door-media {
  margin: 1.25rem 0;
  overflow: hidden;
  border: 0.4rem solid #fff;
  border-radius: 0.5rem;
  background: var(--paper-soft);
  box-shadow: 0 10px 24px rgba(23, 36, 30, 0.16);
}

.door-media-image {
  min-height: 8rem;
}

.door-media-image img,
.door-media-video video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: contain;
}

.door-media-video {
  border-color: var(--night-0);
  background: var(--night-0);
}

.door-media-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-color: var(--night-0);
  background: #000;
}

.door-media-embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.door-detail-footer {
  display: flex;
  justify-content: center;
}

/* Login / error decorations ------------------------------------------------ */

.login-door {
  position: relative;
  display: grid;
  place-items: center;
  width: 4.2rem;
  height: 5rem;
  margin: 0 auto 1.2rem;
  border-radius: var(--door-radius);
  background: var(--door-bg);
  color: var(--door-ink);
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
  text-shadow: var(--num-shadow, var(--num-shadow-dark));
  box-shadow: 0 6px 16px rgba(23, 36, 30, 0.25);
}

.login-door::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 0.45rem;
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 50%;
  background: var(--gold);
  transform: translateY(-50%);
  box-shadow: 0 0 0 1px rgba(23, 36, 30, 0.16);
}

.error-card {
  max-width: 32rem;
  text-align: center;
}

.error-door {
  position: relative;
  display: grid;
  place-items: center;
  width: 9rem;
  min-height: 8.5rem;
  margin: 0 auto 1.2rem;
  border-radius: var(--door-radius);
  background: var(--door-bg, var(--red-bright));
  color: var(--door-ink, #fff);
  box-shadow: 0 8px 20px rgba(23, 36, 30, 0.28);
}

.error-door::before {
  content: "";
  position: absolute;
  top: -0.6rem;
  left: -0.1rem;
  right: -0.1rem;
  height: 1.4rem;
  background: url("snow-drift.svg") center top / 100% 100% no-repeat;
  filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, 0.2));
  pointer-events: none;
}

.error-code {
  margin: 0;
  color: inherit;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 10vw, 3.8rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.01em;
  text-shadow: var(--num-shadow, var(--num-shadow-dark));
}

.error-card .subtitle {
  margin-bottom: 1.4rem;
}

/* Footer ------------------------------------------------------------------- */

.site-footer {
  padding-block: 2rem 1.6rem;
  color: rgba(244, 223, 169, 0.65);
  font-size: 0.82rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.site-footer p::before {
  content: "❄";
  display: block;
  margin-bottom: 0.45rem;
  font-size: 1.05rem;
  opacity: 0.8;
}

/* Responsive --------------------------------------------------------------- */

@media (min-width: 48rem) {
  .doors-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(0.75rem, 1.5vw, 1.15rem);
  }

  .door-card {
    aspect-ratio: 9 / 10;
  }

  .door-card::before {
    top: -0.75rem;
    height: 1.7rem;
  }
}

@media (min-width: 64rem) {
  .doors-grid {
    gap: 1.1rem;
  }
}

@media (max-width: 640px) {
  .header-inner {
    justify-content: center;
    text-align: center;
  }

  .door-detail-footer .btn {
    width: 100%;
  }

  .door-detail-close {
    top: 0.55rem;
    right: 0.55rem;
  }
}

@media (max-width: 29.99rem) {
  .doors-grid {
    gap: 0.5rem;
  }

  .door-card {
    padding: 0.35rem;
  }

  .door-card::before {
    top: -0.45rem;
    height: 1.05rem;
  }

  .door-today {
    top: 0.25rem;
    right: 0.25rem;
    font-size: 0.52rem;
  }

  .door-card--has-image .door-number {
    top: 0.25rem;
    left: 0.25rem;
  }

  .door-mark {
    right: 0.25rem;
    bottom: 0.25rem;
    width: 1.35rem;
    height: 1.35rem;
    font-size: 0.65rem;
  }

  .lock-icon {
    right: 0.4rem;
    bottom: 0.4rem;
  }
}

/* Motion ------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  .door-detail-card {
    animation: unpack 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  @keyframes unpack {
    from {
      opacity: 0;
      transform: translateY(14px) scale(0.985);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

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

  #snow-canvas {
    display: none !important;
  }
}
