:root {
  color-scheme: dark;
  --forest: #10251f;
  --forest-light: #18382d;
  --cream: #fff7e9;
  --muted: #c3cabe;
  --gold: #e7c77f;
  --red: #b94d48;
  --green: #2e6550;
  font-family: "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--cream);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(52, 94, 72, .46), transparent 49rem),
    linear-gradient(160deg, #10251f 4%, #0c1c19 72%, #101f1c);
}

button {
  font: inherit;
}

.page-shell {
  position: relative;
  z-index: 2;
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 30px;
}

.masthead {
  position: relative;
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.masthead h1,
.section-heading h2,
.modal-card h2 {
  font-family: Georgia, serif;
  font-weight: 500;
}

.masthead h1 {
  margin: 15px 0 8px;
  font-size: clamp(2.65rem, 7vw, 5.2rem);
  letter-spacing: -.055em;
  line-height: 1.05;
}

.masthead h1 span {
  color: var(--gold);
}

.intro {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: .98rem;
  line-height: 1.75;
}

.light-string {
  display: flex;
  justify-content: center;
  gap: clamp(15px, 4vw, 43px);
  margin: 32px auto 42px;
}

.light-string span {
  width: 9px;
  height: 13px;
  border-radius: 50% 50% 45% 45%;
  background: #e8c67b;
  box-shadow: 0 0 13px 3px rgba(232, 198, 123, .48);
}

.light-string span:nth-child(3n + 1) {
  background: #d97160;
  box-shadow: 0 0 13px 3px rgba(217, 113, 96, .4);
}

.light-string span:nth-child(3n) {
  background: #99b57e;
  box-shadow: 0 0 13px 3px rgba(153, 181, 126, .4);
}

.calendar-section {
  padding: 30px;
  border: 1px solid rgba(231, 199, 127, .18);
  border-radius: 24px;
  background: rgba(15, 33, 28, .76);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .23), inset 0 1px rgba(255, 255, 255, .035);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 24px;
}

.section-heading .eyebrow {
  font-size: .63rem;
}

.section-heading h2 {
  margin: 6px 0 0;
  font-size: clamp(1.55rem, 3vw, 2rem);
  letter-spacing: -.025em;
}

.open-count {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: .82rem;
  white-space: nowrap;
}

.notice {
  margin: 0 0 18px;
  padding: 12px 15px;
  border: 1px solid rgba(231, 199, 127, .35);
  border-radius: 10px;
  color: var(--cream);
  background: rgba(185, 77, 72, .2);
  font-size: .88rem;
  line-height: 1.5;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 13px;
}

.door {
  position: relative;
  display: grid;
  min-height: 124px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(231, 199, 127, .46);
  border-radius: 13px;
  color: var(--cream);
  background:
    radial-gradient(circle at 15% 13%, rgba(255, 255, 255, .17), transparent 22%),
    linear-gradient(145deg, #346b53, #1d4838 72%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .22), inset 0 1px rgba(255, 255, 255, .15);
  cursor: pointer;
  isolation: isolate;
  perspective: 700px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.door-face {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background:
    radial-gradient(circle at 15% 13%, rgba(255, 255, 255, .17), transparent 22%),
    linear-gradient(145deg, #346b53, #1d4838 72%);
  backface-visibility: hidden;
  transform-origin: left center;
  transition: transform .62s cubic-bezier(.2, .75, .3, 1);
}

.door-face::before,
.door-face::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.door-face::before {
  inset: 9px;
  border: 1px solid rgba(255, 247, 233, .19);
  border-radius: 8px;
}

.door-face::after {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: rgba(255, 247, 233, .12);
}

.door-reveal {
  color: var(--gold);
  font-size: 2rem;
  text-shadow: 0 0 20px rgba(231, 199, 127, .6);
}

.door:hover {
  z-index: 2;
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .32), 0 0 18px rgba(231, 199, 127, .12);
}

.door:focus-visible,
.reset-button:focus-visible,
.modal-close:focus-visible,
.scene-door-face:focus-visible,
.content-link:focus-visible {
  outline: 3px solid #fff0b8;
  outline-offset: 4px;
}

.door-number {
  position: relative;
  z-index: 2;
  font-family: Georgia, serif;
  font-size: 2.15rem;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .28);
}

.door-hint {
  position: absolute;
  bottom: 15px;
  z-index: 1;
  color: rgba(255, 247, 233, .74);
  font-size: .64rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.door[data-day="24"] {
  border-color: rgba(239, 211, 145, .87);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28), 0 0 20px rgba(231, 199, 127, .13);
}

.door[data-day="24"] .door-face {
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 226, 151, .27), transparent 46%),
    linear-gradient(145deg, #9e4b43, #71332f 76%);
}

.door[data-day="24"] .door-number {
  color: #ffe8ac;
  font-size: 2.8rem;
}

.door[data-state="opened"] {
  border-color: rgba(231, 199, 127, .27);
  background:
    radial-gradient(circle at 50% 10%, rgba(231, 199, 127, .14), transparent 54%),
    linear-gradient(145deg, #263d33, #182d26);
  box-shadow: inset 0 3px 12px rgba(0, 0, 0, .18);
}

.door[data-state="opened"] .door-number {
  color: var(--gold);
}

.door[data-state="opened"] .door-hint {
  color: #b9c9b5;
}

.door[data-state="opened"] .door-face {
  transform: rotateY(-105deg);
}

.door[data-state="locked"] {
  cursor: not-allowed;
  filter: grayscale(.65);
}

.door[data-state="locked"] .door-hint::after {
  content: " \2022 Locked";
}

.page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 4px 0;
  color: rgba(195, 202, 190, .7);
  font-size: .75rem;
}

.page-footer p {
  margin: 0;
}

.reset-button {
  padding: 7px 10px;
  border: 1px solid rgba(231, 199, 127, .25);
  border-radius: 8px;
  color: rgba(255, 247, 233, .76);
  background: rgba(255, 255, 255, .035);
  cursor: pointer;
  font-size: .72rem;
  transition: background .2s ease, border-color .2s ease;
}

.reset-button:hover {
  border-color: rgba(231, 199, 127, .6);
  background: rgba(255, 255, 255, .08);
}

.content-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: var(--cream);
  background: transparent;
}

.content-modal::backdrop {
  background: rgba(4, 12, 10, .76);
}

.scene-stage {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  perspective: 1600px;
  transform-origin: var(--zoom-origin-x, 50%) var(--zoom-origin-y, 50%);
  animation: camera-zoom-in .8s cubic-bezier(.2, .75, .3, 1) both;
}

.content-modal.is-closing .scene-stage {
  animation: camera-zoom-out .55s cubic-bezier(.5, 0, .8, .25) both;
}

.scene-return {
  position: absolute;
  z-index: 1;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}

.scene-doorway {
  position: relative;
  z-index: 2;
  width: clamp(210px, 30vw, 340px);
  height: min(58vh, 420px);
  min-height: 280px;
  overflow: visible;
  border: 10px solid #6c5133;
  border-bottom-width: 13px;
  border-radius: 9px 9px 0 0;
  background:
    radial-gradient(ellipse at 50% 34%, rgba(231, 199, 127, .19), transparent 50%),
    linear-gradient(90deg, #142720, #091410 18%, #0b1712 82%, #142720);
  box-shadow:
    0 0 0 2px rgba(231, 199, 127, .5),
    0 25px 75px rgba(0, 0, 0, .58),
    inset 0 0 55px rgba(0, 0, 0, .88);
  perspective: 1200px;
}

.doorway-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 48%, rgba(237, 206, 132, .14), transparent 62%);
  opacity: 0;
  transition: opacity .8s ease .35s;
}

.content-modal.is-open .doorway-glow {
  opacity: 1;
}

.scene-door-face {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  border: 1px solid rgba(255, 247, 233, .42);
  border-radius: 2px;
  color: #ffe8ac;
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 226, 151, .2), transparent 46%),
    linear-gradient(145deg, #346b53, #1d4838 72%);
  box-shadow: inset 0 0 0 9px rgba(255, 247, 233, .08), inset 0 0 0 11px rgba(255, 247, 233, .17);
  font-family: Georgia, serif;
  font-size: clamp(3rem, 12vw, 6rem);
  backface-visibility: hidden;
  transform-origin: left center;
  transform-style: preserve-3d;
  transition: transform .76s cubic-bezier(.2, .75, .3, 1) .18s;
}

.scene-door-face::before {
  position: absolute;
  inset: 20px;
  border: 1px solid rgba(255, 247, 233, .2);
  content: "";
  pointer-events: none;
}

.scene-door-handle {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 9px;
  height: 9px;
  border: 1px solid #f3d996;
  border-radius: 50%;
  background: #c59c50;
  box-shadow: 0 0 8px rgba(243, 217, 150, .45);
}

.content-modal.is-open .scene-door-face {
  transform: rotateY(-76deg);
  cursor: zoom-out;
}

.modal-card {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: min(210px, calc(100% - 38px));
  max-height: min(72vh, 680px);
  padding: 43px 18px 32px;
  overflow-y: auto;
  border: 1px solid #e3c985;
  border-radius: 5px 5px 3px 3px;
  color: #3d392f;
  background:
    linear-gradient(90deg, transparent 0 25px, rgba(190, 83, 68, .2) 25px 26px, transparent 26px),
    repeating-linear-gradient(to bottom, #fff4dc 0 29px, rgba(169, 146, 104, .2) 30px, #fff4dc 31px);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .16);
  opacity: 0;
  text-align: center;
  transform: translate(-50%, calc(-50% + 95px)) scale(.16) rotate(-8deg);
  transform-origin: center;
}

.content-modal.is-open .modal-card {
  animation: note-fly-in .7s cubic-bezier(.17, .8, .3, 1) .52s both;
}

.modal-close {
  position: absolute;
  top: 13px;
  right: 15px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(74, 65, 48, .2);
  border-radius: 50%;
  color: #4a4130;
  background: rgba(255, 255, 255, .55);
  cursor: pointer;
  font-size: 1.45rem;
  line-height: 1;
}

.modal-day {
  margin: 0 0 9px;
  color: #9c7537;
  font-size: .69rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.modal-card h2 {
  margin: 0 0 17px;
  font-size: clamp(1.8rem, 6vw, 2.5rem);
}

.modal-content {
  color: #514a3e;
  font-size: .92rem;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.modal-content p {
  margin: 0;
}

.modal-content img,
.modal-content video {
  display: block;
  max-width: 100%;
  max-height: 55vh;
  margin: 18px auto;
  border-radius: 12px;
}

.modal-content iframe {
  width: 100%;
  min-height: 210px;
  margin-top: 14px;
  border: 1px solid rgba(231, 199, 127, .25);
  border-radius: 12px;
  background: #0e201b;
}

.content-link {
  display: inline-block;
  margin-top: 18px;
  padding: 11px 17px;
  border: 1px solid rgba(82, 105, 72, .55);
  border-radius: 10px;
  color: #35523c;
  text-decoration: none;
  background: rgba(82, 105, 72, .09);
}

.content-link:hover {
  background: rgba(82, 105, 72, .17);
}

.snow {
  position: fixed;
  z-index: 0;
  inset: -100px 0 0;
  pointer-events: none;
  background-repeat: repeat;
}

.snow-back {
  opacity: .18;
  background-image:
    radial-gradient(2px 2px at 40px 60px, #fff 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 130px 160px, #fff 50%, transparent 52%),
    radial-gradient(2px 2px at 250px 40px, #fff 50%, transparent 52%);
  background-size: 330px 240px;
}

.snow-front {
  opacity: .12;
  background-image:
    radial-gradient(2.5px 2.5px at 70px 100px, #fff 50%, transparent 52%),
    radial-gradient(2px 2px at 190px 30px, #fff 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 290px 190px, #fff 50%, transparent 52%);
  background-size: 410px 290px;
}

[hidden] {
  display: none !important;
}

@keyframes camera-zoom-in {
  from { opacity: .2; transform: scale(.2); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes camera-zoom-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(.2); }
}

@keyframes note-fly-in {
  0% { opacity: 0; transform: translate(-50%, calc(-50% + 95px)) scale(.16) rotate(-8deg); }
  72% { opacity: 1; transform: translate(-50%, calc(-50% - 8px)) scale(1.03) rotate(2deg); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0); }
}

@media (max-width: 850px) {
  .calendar-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .door {
    min-height: 112px;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: min(100% - 24px, 450px);
    padding-top: 34px;
  }

  .calendar-section {
    padding: 20px 14px;
    border-radius: 19px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 18px;
  }

  .calendar-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
  }

  .door {
    min-height: 100px;
    border-radius: 11px;
  }

  .door-number {
    font-size: 1.85rem;
  }

  .door[data-day="24"] .door-number {
    font-size: 2.45rem;
  }

  .door-hint {
    bottom: 12px;
    font-size: .57rem;
  }

  .page-footer {
    align-items: flex-start;
    font-size: .68rem;
  }

  .reset-button {
    flex: 0 0 auto;
  }

  .scene-doorway {
    width: min(74vw, 290px);
    height: min(55vh, 380px);
    min-height: 250px;
  }

  .modal-card {
    width: min(210px, calc(100% - 34px));
    max-height: 70vh;
    padding: 40px 22px 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
