@font-face {
  font-family: 'Dancing Script';
  src: url('/fonts/dancing-script.woff2') format('woff2');
  font-weight: 500 700;
  font-display: swap;
}
:root {
  color-scheme: light;
  --paper: #f8f3e9;
  --ink: #29271f;
  --wine: #731e2e;
  --evergreen: #29483a;
  --muted: #675a4d;
  --line: #ded3c1;
  --serif: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  --script: 'Dancing Script', 'Segoe Script', cursive;
  font-family: system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--evergreen); outline-offset: 4px; }
.page { max-width: 1540px; margin-inline: auto; padding: 0 clamp(20px, 5vw, 82px) 32px; }
.masthead {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: .94rem; }
.wordmark span { color: var(--wine); font-size: 1.65rem; line-height: 1; }
.season { color: var(--muted); font-size: .87rem; text-align: right; }
.layout {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(0, 1.75fr);
  align-items: center;
  gap: clamp(30px, 5vw, 96px);
  padding-top: clamp(30px, 6vh, 85px);
}
.intro { padding-bottom: 28px; }
.edition {
  width: fit-content;
  margin: 0 0 15px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--wine);
  font-size: .875rem;
}
h1 { margin: 0; font: 700 clamp(2.9rem, 6.1vw, 6.65rem)/.94 var(--script); letter-spacing: -.02em; }
h1 span { display: inline-block; color: var(--wine); font: 600 1.06em/.95 var(--script); letter-spacing: -.045em; }
.intro-text { margin: 25px 0 20px; }
.intro-copy { color: var(--muted); max-width: 33ch; margin: 0; font-size: clamp(1rem, 1.35vw, 1.17rem); line-height: 1.55; }
.intro-copy.daily-fact { max-width: 38ch; }
.fact-date { margin: 0 0 5px; color: var(--wine); font: 700 1.45rem/1.1 var(--script); }
.primary {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .75rem 1.1rem;
  background: var(--evergreen);
  color: #fffaf0;
  font-weight: 650;
}
.primary:hover { background: #1b382a; }
.primary:disabled { opacity: .65; cursor: wait; }
.calendar-status { max-width: 32ch; margin: 10px 0 0; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.calendar-status:empty { display: none; }
.calendar-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.calendar-top h2 { font: 700 clamp(1.4rem, 2.4vw, 2rem)/1.1 var(--script); margin: 0; }
#progress { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.doors {
  display: grid;
  gap: clamp(5px, .7vw, 10px);
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(5, clamp(57px, 7.6vw, 112px));
  grid-template-areas:
    "d7 d15 d1 d1 d22 d22 d9"
    "d24 d24 d4 d10 d20 d13 d9"
    "d24 d24 d5 d16 d11 d11 d18"
    "d19 d8 d14 d12 d3 d6 d6"
    "d19 d17 d17 d23 d3 d21 d2";
}
.door {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: end;
  justify-content: start;
  padding: clamp(6px, 1vw, 15px);
  overflow: hidden;
  border: 1px solid var(--box-border, #0002);
  border-radius: clamp(8px, 1.05vw, 16px);
  color: var(--box-ink);
  background-color: var(--box);
  text-align: left;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.door:hover { transform: translateY(-2px); z-index: 1; box-shadow: 0 5px 10px #4a251829; }
.door[data-tone="red"] { --box: #a51f2b; --box-ink: #fff8e9; }
.door[data-tone="wine"] { --box: #651c2a; --box-ink: #fff4df; }
.door[data-tone="blush"] { --box: #e8cfc4; --box-ink: #641b25; }
.door[data-tone="ivory"] { --box: #f1e5d2; --box-ink: #611d28; --box-border: #d6c5ad; }
.door[data-tone="green"] { --box: #29483a; --box-ink: #fff5df; }
.door[data-wrap="stripes"] { background-image: repeating-linear-gradient(135deg, transparent 0 12px, #fff8e916 12px 15px); }
.door[data-wrap="dots"] { background-image: radial-gradient(circle, #fff8e934 1px, transparent 1.6px); background-size: 12px 12px; }
.door[data-wrap="check"] { background-image: repeating-linear-gradient(90deg, transparent 0 14px, #581f2510 14px 22px), repeating-linear-gradient(0deg, transparent 0 14px, #581f2510 14px 22px); }
.door[data-state="open"] { box-shadow: inset 0 0 0 2px var(--box-ink); }
.door[data-state="found"] { box-shadow: inset 0 0 0 2px #b78c49; }
.number { position: relative; font: 700 clamp(1.35rem, 3.3vw, 3.25rem)/.82 var(--serif); letter-spacing: -.065em; }
.door[data-day="24"] .number { font-size: clamp(2.5rem, 6.4vw, 6.4rem); }
.door-mark { position: absolute; top: 7px; right: 8px; font-size: clamp(.7rem, 1.3vw, 1rem); line-height: 1; }
.ribbon {
  position: absolute;
  inset: 0;
  z-index: -1;
  color: #f5ddad;
  background: linear-gradient(90deg, transparent 47%, currentColor 47% 52%, transparent 52%),
    linear-gradient(0deg, transparent 57%, currentColor 57% 62%, transparent 62%);
}
.ribbon::before, .ribbon::after {
  position: absolute;
  bottom: 62%;
  width: 21%;
  height: 17%;
  content: '';
  border: clamp(3px, .5vw, 7px) solid currentColor;
}
.ribbon::before { right: 50%; border-radius: 55% 65% 22% 65%; transform: rotate(16deg); }
.ribbon::after { left: 50%; border-radius: 65% 55% 65% 22%; transform: rotate(-16deg); }
.calendar-key { display: flex; flex-wrap: wrap; gap: 6px 17px; color: var(--muted); margin: 15px 0 0; font-size: .85rem; }
.calendar-key span { display: flex; align-items: center; gap: 6px; }
.calendar-key i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.key-open { background: var(--evergreen); }
.key-found { background: #986a2d; }
.key-locked { border: 1px solid #8c7a68; }
dialog {
  width: min(510px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  padding: clamp(25px, 5vw, 46px);
  border: 1px solid var(--line);
  border-top: 5px solid var(--wine);
  border-radius: 18px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 20px 90px #24110c50;
}
dialog::backdrop { background: #271d21aa; }
.close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--wine); font-size: 1.55rem; line-height: 1; }
.close:hover { background: #eaded0; }
.door-date { margin: 0 35px 10px 0; color: var(--wine); font-size: .9rem; }
dialog h2 { margin: 0; color: var(--wine); font: 700 clamp(2rem, 6vw, 3rem)/1.06 var(--script); }
.door-message { display: grid; margin: 15px 0 0; line-height: 1.6; overflow-wrap: anywhere; }
.door-message > span { grid-area: 1 / 1; }
dialog[data-revealed="true"] .dialog-content { animation: reveal 300ms ease both; }
@keyframes reveal { from { opacity: .35; transform: translateY(6px); } }
form { margin-top: 24px; }
form label { display: block; margin-bottom: 8px; font-weight: 600; }
.code-row { display: flex; flex-wrap: wrap; gap: 10px; }
.code-row input { min-width: 0; flex: 1 1 150px; border: 1px solid #9f8d76; border-radius: 10px; padding: 11px; color: var(--ink); background: #fffdf6; }
#code-feedback { color: var(--wine); font-size: .9rem; margin: 9px 0 0; min-height: 1.35em; }
@media (max-width: 850px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .intro { padding-bottom: 0; }
  h1 { font-size: clamp(3.65rem, 9vw, 5.65rem); }
  .intro-text { margin: 16px 0; }
  .intro-copy { max-width: 38ch; }
  .doors { grid-template-rows: repeat(5, clamp(57px, 11vw, 100px)); }
  .number { font-size: clamp(1.6rem, 5vw, 3.1rem); }
}
@media (max-width: 485px) {
  .masthead { min-height: 60px; }
  .wordmark, .season { font-size: .8rem; }
  .wordmark { gap: 5px; }
  .layout { padding-top: 22px; }
  .doors {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(8, clamp(55px, 17vw, 82px));
    grid-template-areas:
      "d7 d15 d1 d1"
      "d24 d24 d4 d9"
      "d24 d24 d20 d9"
      "d5 d16 d11 d11"
      "d19 d8 d14 d12"
      "d19 d17 d2 d3"
      "d10 d22 d13 d3"
      "d23 d6 d18 d21";
  }
  .door { padding: 9px; }
  .door[data-day="24"] .number { font-size: 3.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
