:root {
  color-scheme: dark;
  color: #fff4df;
  background: #121e2b;
  font-family: "Segoe UI", sans-serif;
  --gold: #e3c390;
  --muted: #ded8ce;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; }
button { font: inherit; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .21em; }
:focus-visible { outline: 2px solid #fff1c9; outline-offset: 4px; }
.winter {
  position: fixed;
  inset: -14px;
  z-index: -1;
  background:
    linear-gradient(90deg, #0b1726f0 0%, #101e2bd6 34%, #101e2b75 100%),
    linear-gradient(0deg, #101c2b 0%, transparent 67%),
    url("./assets/winter.jpg") center 47% / cover;
  filter: blur(5px);
}
.calendar {
  width: min(100% - 7rem, 1300px);
  flex: 1;
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(260px, .83fr) minmax(0, 2fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5.5rem);
  padding-block: 3.7rem;
}
.intro { align-self: center; }
.eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  font-size: .875rem;
  letter-spacing: .24em;
  font-weight: 600;
  margin: 0;
}
h1, h2, .door-number, .poem { font-family: Georgia, "Times New Roman", serif; }
h1 {
  font-size: clamp(3.65rem, 6vw, 6.9rem);
  line-height: .95;
  letter-spacing: -.058em;
  font-weight: 400;
  margin: 1.28rem 0 1.5rem;
}
h1 em { display: block; font-weight: 400; color: var(--gold); font-size: .72em; white-space: nowrap; }
.dedication { font-size: 1.04rem; color: var(--muted); line-height: 1.7; margin: 0; }
.progress { max-width: 14rem; margin-top: 2.25rem; }
.progress p { margin: 0 0 .62rem; color: var(--muted); font-size: .9rem; }
progress { display: block; height: 4px; width: 100%; appearance: none; border: 0; background: #fff4df35; border-radius: 9px; }
progress::-webkit-progress-bar { background: #fff4df35; border-radius: 9px; }
progress::-webkit-progress-value { background: var(--gold); border-radius: 9px; }
progress::-moz-progress-bar { background: var(--gold); border-radius: 9px; }
.background-credit { font-size: .875rem; line-height: 1.6; color: var(--muted); }
.background-credit summary { color: inherit; }
.doors { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(.5rem, 1.05vw, .9rem); }
.door {
  --tile: #263a43;
  --light: #40555a;
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  aspect-ratio: .87;
  width: 100%;
  min-height: 66px;
  border: 1px solid #e3c39072;
  border-radius: .45rem;
  color: #fff4df;
  background: radial-gradient(ellipse at 35% 0%, var(--light), transparent 82%), var(--tile);
  box-shadow: 0 8px 18px #060e1a47;
  cursor: pointer;
  transition: transform .2s, border-color .2s, filter .2s;
  padding: 0;
}
.door[data-tone="1"] { --tile: #42292f; --light: #603e46; }
.door[data-tone="2"] { --tile: #192c3d; --light: #30485b; }
.door[data-tone="3"] { --tile: #31392f; --light: #4a5344; }
.door::before { content: ""; position: absolute; inset: 5px; border: 1px solid #e3c39043; border-radius: .25rem; pointer-events: none; }
.door-number { font-size: clamp(1.65rem, 3.45vw, 3.1rem); font-variant-numeric: lining-nums; line-height: 1; }
.door-mark { position: absolute; top: 12%; color: var(--gold); font-size: clamp(.57rem, 1.2vw, .85rem); line-height: 1; }
.door-state { position: absolute; bottom: 11%; color: var(--gold); font-size: .75rem; line-height: 1; }
.door[aria-disabled="true"] { cursor: default; filter: saturate(.58); }
.door[aria-disabled="true"] .door-state { width: 8px; height: 6px; border: 1px solid; border-radius: 1px; }
.door[aria-disabled="true"] .door-state::before { content: ""; position: absolute; width: 6px; height: 5px; inset: -5px 0 auto; border: 1px solid; border-radius: 5px 5px 0 0; }
.door[data-opened="true"] { border-color: var(--gold); }
@media (hover: hover) {
  .door:not([aria-disabled="true"]):hover { transform: translateY(-3px); border-color: #fff1c9; filter: brightness(1.16); }
}
dialog {
  width: min(880px, 100% - 2rem);
  max-height: calc(100dvh - 2rem);
  border: 1px solid #e3c39091;
  border-radius: .85rem;
  padding: 0;
  color: #fff4df;
  background: #182734;
  box-shadow: 0 22px 75px #000a;
}
dialog::backdrop { background: #080e17c9; backdrop-filter: blur(6px); }
.memory-content { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); align-items: center; gap: clamp(1.15rem, 4vw, 2.7rem); padding: clamp(1rem, 4vw, 2.65rem); }
.photo-frame { margin: 0; background: #eee4d2; padding: .48rem; border-radius: .15rem; display: grid; place-items: center; }
.photo-frame img { display: block; width: auto; max-width: 100%; max-height: 67dvh; object-fit: contain; }
.verse { padding-block: .5rem; min-width: 0; }
.verse h2 { font-size: clamp(1.95rem, 4vw, 3rem); font-weight: 400; line-height: 1.05; margin: .55rem 0; }
.author { color: var(--gold); font-size: .9rem; margin: 0; }
.poem { white-space: pre-line; font-size: clamp(1rem, 2.4vw, 1.18rem); line-height: 1.58; margin: 1.15rem 0; }
.poem-source { color: var(--muted); font-size: .875rem; }
.close { position: absolute; z-index: 1; top: .58rem; right: .58rem; width: 44px; height: 44px; border: 1px solid #e3c39080; border-radius: 50%; color: #fff4df; background: #152320; font-size: 1.75rem; line-height: 1; cursor: pointer; }
details { margin-top: 1.3rem; }
summary { cursor: pointer; color: var(--gold); }
details img { display: block; width: 100%; height: auto; margin-top: .75rem; }
@media (max-width: 980px) {
  .calendar { width: min(100% - 3rem, 820px); grid-template-columns: 1fr; gap: 2rem; padding-block: 2.5rem; }
  .intro { text-align: center; }
  h1 { font-size: clamp(3.35rem, 8.6vw, 5.9rem); margin: .65rem 0 .8rem; }
  h1 em { display: inline; }
  .dedication br { display: none; }
  .progress { margin: 1.15rem auto 0; }
  .door { aspect-ratio: 1; }
  .door-number { font-size: clamp(1.85rem, 5vw, 3rem); }
}
@media (max-width: 600px) {
  .calendar { width: calc(100% - 1.7rem); padding-block: 1.85rem; gap: 1.3rem; }
  .doors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dedication { font-size: 1rem; line-height: 1.45; }
  .memory-content { grid-template-columns: minmax(0, 1fr); padding-top: 3.55rem; }
  .photo-frame img { max-height: 48dvh; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
