/* Julekalender til Hanne — lokal forhåndsvisning, ikke lagt ut */

:root {
  --bg0: #0c1812;
  --bg1: #163326;
  --bg2: #1e4030;
  --cream: #f6efe3;
  --cream-dim: #e8dcc8;
  --ink: #2a1c14;
  --ink-soft: #5a4638;
  --gold: #e8c872;
  --gold-deep: #c9a227;
  --gold-soft: rgba(232, 200, 114, 0.35);
  --burgundy: #7a3034;
  --burgundy-deep: #5c2226;
  --forest: #2a5a3d;
  --forest-deep: #1c3d2a;
  --teal: #2a5f5a;
  --teal-deep: #1a3f3c;
  --copper: #8a4a2f;
  --copper-deep: #5e301e;
  --text: #f4ebda;
  --muted: #cbbfa8;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --serif: "Cormorant Garamond", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", "Helvetica Neue", sans-serif;
  --radius: 18px;
}

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

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, #2a5a3d 0%, transparent 55%),
    radial-gradient(ellipse 40% 30% at 80% 80%, rgba(122, 48, 52, 0.25), transparent 50%),
    radial-gradient(ellipse 40% 30% at 10% 70%, rgba(201, 162, 39, 0.12), transparent 50%),
    linear-gradient(180deg, #12231b 0%, #0c1812 55%, #0a140f 100%);
}

.sky::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  pointer-events: none;
}

.snow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.flake {
  position: absolute;
  top: -10px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 10px;
  animation: fall linear infinite;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.35);
}

@keyframes fall {
  0% { transform: translateY(-10vh) translateX(0); opacity: 0; }
  10% { opacity: 0.8; }
  100% { transform: translateY(110vh) translateX(var(--drift, 20px)); opacity: 0.15; }
}

.preview-banner {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #c9a227;
  color: #1a1208;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  letter-spacing: 0.01em;
}

.hero {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2.6rem 1.25rem 1.5rem;
  max-width: 40rem;
  margin: 0 auto;
}

.hero__year {
  margin: 0 0 0.7rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero__year::before,
.hero__year::after {
  content: " ✦ ";
  letter-spacing: 0;
  opacity: 0.8;
}

.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.4rem, 8vw, 4.2rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--cream);
}

.hero__title span {
  display: block;
  font-style: italic;
  font-weight: 500;
  color: var(--gold);
}

.hero__from {
  margin: 0.85rem 0 1.1rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--cream-dim);
}

.hero__intro {
  margin: 0 auto;
  max-width: 28rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.hero__status {
  margin: 1.15rem 0 0;
  color: var(--gold);
  font-size: 0.92rem;
  font-weight: 600;
}

.calendar-wrap {
  position: relative;
  z-index: 1;
  max-width: 52rem;
  margin: 0 auto 2.5rem;
  padding: 0 1rem;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  padding: 1rem;
  background:
    linear-gradient(180deg, rgba(232, 200, 114, 0.16), rgba(232, 200, 114, 0.05)),
    linear-gradient(180deg, #1a3328, #13241d);
  border: 1px solid rgba(232, 200, 114, 0.35);
  border-radius: 24px;
  box-shadow:
    inset 0 1px 0 rgba(255, 236, 190, 0.18),
    var(--shadow);
}

@media (min-width: 520px) {
  .calendar {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.85rem;
    padding: 1.2rem;
  }
}

@media (min-width: 840px) {
  .calendar {
    grid-template-columns: repeat(6, 1fr);
    gap: 0.9rem;
    padding: 1.4rem;
  }
}

.door {
  appearance: none;
  border: 0;
  position: relative;
  aspect-ratio: 1 / 1.12;
  border-radius: 14px;
  cursor: pointer;
  color: var(--cream);
  font-family: var(--serif);
  padding: 0;
  background: var(--door);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -8px 16px rgba(0, 0, 0, 0.25),
    0 4px 0 var(--door-edge),
    0 8px 16px rgba(0, 0, 0, 0.28);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

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

.door__inner {
  position: absolute;
  inset: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 236, 190, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
}

.door__num {
  font-size: clamp(1.6rem, 5vw, 2.15rem);
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.door__icon {
  font-size: 1.05rem;
  line-height: 1;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.2));
}

.door__badge {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #1a1208;
  font-family: var(--sans);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.18rem 0.4rem;
  border-radius: 999px;
  white-space: nowrap;
}

.door__lock {
  position: absolute;
  bottom: 7px;
  right: 8px;
  font-size: 0.7rem;
  opacity: 0.55;
}

.door--burgundy { --door: linear-gradient(180deg, #9a3e43, #6a282c); --door-edge: #4a1b1e; }
.door--forest   { --door: linear-gradient(180deg, #3b7a52, #254e36); --door-edge: #163322; }
.door--gold     { --door: linear-gradient(180deg, #d4b056, #a78420); --door-edge: #6e5610; color: #2a1c08; }
.door--gold .door__num { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25); }
.door--teal     { --door: linear-gradient(180deg, #3b7570, #234e4a); --door-edge: #153330; }
.door--copper   { --door: linear-gradient(180deg, #b5643e, #7a3d26); --door-edge: #4e2617; }
.door--wine     { --door: linear-gradient(180deg, #7a3a58, #52243b); --door-edge: #351726; }

.door--today:not(.door--open) {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 0 2px var(--gold),
    0 0 22px rgba(232, 200, 114, 0.45),
    0 4px 0 var(--door-edge),
    0 8px 16px rgba(0, 0, 0, 0.28);
  animation: pulse 2.4s ease-in-out infinite;
}

.door--today.door--gold:not(.door--open) {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 0 0 2px #fff3c4,
    0 0 22px rgba(255, 236, 180, 0.55),
    0 4px 0 var(--door-edge),
    0 8px 16px rgba(0, 0, 0, 0.28);
}

@keyframes pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

.door--openable:hover {
  transform: translateY(-3px);
  filter: brightness(1.06);
}

.door--open {
  background: linear-gradient(180deg, #f7f0e3, #eadcc4);
  color: #6a282c;
  box-shadow:
    inset 0 0 0 1px rgba(201, 162, 39, 0.45),
    inset 0 8px 16px rgba(90, 50, 20, 0.08),
    0 3px 0 #c9a227,
    0 6px 14px rgba(0, 0, 0, 0.2);
  animation: none;
  filter: none;
}

.door--open .door__inner {
  border-color: rgba(201, 162, 39, 0.35);
}

.door--open .door__num {
  text-shadow: none;
}

.door--locked {
  cursor: default;
  filter: saturate(0.78) brightness(0.88);
}

.door--locked:hover {
  transform: none;
}

.door--special:not(.door--open) .door__inner::before {
  content: "★";
  position: absolute;
  top: 6px;
  font-size: 0.75rem;
  color: var(--gold);
}

.door--special.door--open .door__inner::before {
  content: "★";
  position: absolute;
  top: 6px;
  font-size: 0.75rem;
  color: #c9a227;
}

.foot {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 1rem 2.5rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.foot p { margin: 0; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 14, 10, 0.72);
  backdrop-filter: blur(6px);
}

.modal__card {
  position: relative;
  width: min(28rem, 100%);
  max-height: calc(100vh - 2.5rem);
  overflow: auto;
  background:
    linear-gradient(180deg, #fffaf2, #f3e6d0);
  color: var(--ink);
  border-radius: 22px;
  padding: 2rem 1.6rem 1.5rem;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.45),
    0 0 0 6px rgba(246, 239, 227, 0.08),
    0 24px 60px rgba(0, 0, 0, 0.45);
  animation: pop 0.32s ease;
}

@keyframes pop {
  from { transform: translateY(12px) scale(0.96); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.modal__close {
  position: absolute;
  top: 0.6rem;
  right: 0.7rem;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
}

.modal__close:hover,
.modal__close:focus-visible {
  background: rgba(0, 0, 0, 0.06);
  outline: none;
}

.modal__emoji {
  margin: 0 0 0.4rem;
  font-size: 2.6rem;
  line-height: 1;
}

.modal__kicker {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9a6d18;
}

.modal__title {
  margin: 0 0 0.85rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.15;
  color: #5c2226;
}

.modal__body {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--ink-soft);
  text-align: left;
}

.modal__body p { margin: 0 0 0.8rem; }
.modal__body p:last-child { margin-bottom: 0; }

.modal--locked .modal__title { color: #3a4a40; }
.modal--locked .modal__emoji { opacity: 0.85; }

.modal__ok {
  margin-top: 1.4rem;
  appearance: none;
  border: 0;
  background: linear-gradient(180deg, #8a3539, #6a282c);
  color: #f6efe3;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 3px 0 #4a1b1e;
}

.modal__ok:hover { filter: brightness(1.06); }
.modal__ok:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; }

body.modal-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .flake, .door--today:not(.door--open), .modal__card {
    animation: none !important;
  }
  .door { transition: none; }
}
