:root {
  color-scheme: light;
  --paper: #f6f2e9;
  --ink: #203b31;
  --green: #234c3c;
  --dark-green: #132e26;
  --muted: #575e52;
  --line: #d9d1be;
  --gold: #e3bc76;
  --heading: Georgia, "Times New Roman", serif;
  font-family: system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 280px; margin: 0; }
h1, h2, p { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid #9b5a34; outline-offset: 4px; }

.shell { width: min(1120px, calc(100% - 80px)); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 72px; display: flex; align-items: center; gap: 20px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-family: var(--heading);
  font-size: 1.42rem;
  font-weight: 700;
}
.brand img { flex-shrink: 0; }
.header-label {
  border-left: 1px solid var(--line);
  padding-left: 20px;
  color: var(--muted);
  font-size: .85rem;
}
.quiet-button {
  border: 1px solid #bcb6a5;
  background: transparent;
  border-radius: 6px;
  padding: 8px 13px;
  color: var(--ink);
  font-size: .86rem;
}
.quiet-button:hover { background: #eae4d6; }
.header-actions { display: flex; flex: none; gap: 6px; margin-inline-start: auto; }
.preview-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}
.preview-notice a { text-decoration: none; }
.preview-notice:not([hidden]) + .hero { margin-top: 17px; }

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  align-items: center;
  min-height: 375px;
  margin-top: 29px;
  border-radius: 14px;
  background: var(--dark-green);
  color: #fff7e7;
}
.hero-art {
  position: absolute;
  z-index: -1;
  inset: 0 0 0 31%;
  background: url("/winter-cabin.webp") center 59% / cover no-repeat;
}
.hero::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, var(--dark-green) 30%, #132e26f0 40%, #132e2690 54%, #132e2610 79%);
}
.hero-copy { padding: 42px 60px; max-width: 600px; }
.hero:has(#calendar-copy:not([hidden])) .hero-copy { align-self: start; padding-block-start: 22px; }
.hero-ornament { color: var(--gold); font-size: 1.9rem; line-height: 1; }
.hero h1 {
  --hero-heading-size: clamp(2.85rem, 5.5vw, 4.85rem);
  max-width: 9.1em;
  margin: 12px 0 17px;
  font: 400 var(--hero-heading-size) / .98 var(--heading);
  letter-spacing: -.052em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.calendar-heading { width: fit-content; margin-bottom: 17px; text-align: center; }
#calendar-title { margin: 0 0 6px; font-size: calc(var(--hero-heading-size) * .7); }
.hero p { max-width: 33ch; color: #f5e8d4; font-size: 1rem; line-height: 1.57; white-space: pre-wrap; overflow-wrap: anywhere; }
.daily-message-heading { max-width: 33ch; margin-bottom: 4px; font-size: 1.1rem; line-height: 1.3; overflow-wrap: anywhere; }

.advent-candles {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: clamp(6px, 2vw, 15px);
  min-height: 58px;
}
.advent-candles span {
  position: relative;
  width: clamp(14px, 4.5vw, 18px);
  height: 30px;
  border-radius: 50% 50% 3px 3px / 4px 4px 3px 3px;
  background: linear-gradient(90deg, #c2ad8b, #f1e0bf 42%, #d5bc98);
  box-shadow: inset 0 2px #fff1d9a0;
}
.advent-candles span:nth-child(2) { height: 36px; }
.advent-candles span:nth-child(3) { height: 33px; }
.advent-candles span:nth-child(4) { height: 39px; }
.advent-candles span::before {
  position: absolute;
  bottom: calc(100% - 2px);
  left: calc(50% - 1px);
  width: 2px;
  height: 6px;
  border-radius: 2px;
  background: #a9987a;
  content: "";
}
.advent-candles .is-lit::after {
  position: absolute;
  bottom: calc(100% + 2px);
  left: calc(50% - 4px);
  width: 8px;
  height: 15px;
  border-radius: 62% 38% 52% 48% / 76% 69% 31% 24%;
  background: radial-gradient(ellipse at 50% 75%, #fff8d8 15%, #ffdc89 52%, #eba64c 84%);
  box-shadow: 0 0 13px 3px #f0b25470;
  transform-origin: bottom;
  animation: candle-flicker 1.6s ease-in-out 2 alternate;
  content: "";
}
.advent-candles .is-lit:nth-child(even)::after { animation-delay: .2s; }
@keyframes candle-flicker {
  0%, 100% { transform: scale(1); }
  40% { transform: rotate(5deg) scale(.93, 1.05); }
  70% { transform: rotate(-4deg) scale(1.04, .95); }
}

.page-status { margin-top: 23px; color: var(--muted); }
.retry { margin-top: 10px; }
.signin {
  max-width: 404px;
  margin: 32px auto 0;
  padding: 25px 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffaf0;
}
.calendar h2, dialog h2 {
  font: 400 clamp(1.85rem, 3.3vw, 2.65rem) / 1.08 var(--heading);
  letter-spacing: -.035em;
}
#login-form { display: grid; gap: 6px; }
#login-form label { font-size: .88rem; font-weight: 650; }
#login-form input {
  min-width: 0;
  width: 100%;
  padding: 9px 11px;
  color: var(--ink);
  background: #fffdf7;
  border: 1px solid #bcb6a5;
  border-radius: 5px;
  margin-bottom: 6px;
}
.primary-button, .download {
  justify-self: start;
  border: 1px solid var(--green);
  border-radius: 6px;
  padding: 9px 18px;
  background: var(--green);
  color: #fff8e9;
  font-weight: 600;
  text-decoration: none;
}
.primary-button:hover, .download:hover { background: var(--dark-green); }
.primary-button:disabled, .quiet-button:disabled { cursor: wait; opacity: .7; }
.signin .form-status { margin-top: 8px; color: #8b3c2b; font-size: .9rem; line-height: 1.5; }
.form-status:empty { display: none; }

.calendar { margin-top: 38px; }
.shared-message {
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
}
.shared-message summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: inherit;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.shared-message summary::-webkit-details-marker { display: none; }
.shared-message summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}
.shared-message[open] summary::after { transform: rotate(45deg); }
.shared-message p { padding: 0 16px 14px; color: var(--muted); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.calendar-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 22px;
  margin-bottom: 20px;
}
.calendar-header h2 { overflow-wrap: anywhere; }
.calendar-bonus { display: grid; justify-items: end; gap: 6px; }
.calendar-bonus-card { width: clamp(108px, 16vw, 176px); }
.bonus-toggle {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  padding: 0;
  border-color: #c8bca1;
  background: #f6f2e9;
  color: var(--ink);
}
.progress { display: grid; gap: 7px; width: min(160px, 100%); margin-top: 14px; color: var(--muted); }
.progress label { font-size: .86rem; font-weight: 600; }
progress { width: 100%; height: 6px; border: 0; border-radius: 2px; background: #e5ddcd; }
progress::-webkit-progress-bar { border-radius: 2px; background: #e5ddcd; }
progress::-webkit-progress-value { border-radius: 2px; background: #427a62; }
progress::-moz-progress-bar { border-radius: 2px; background: #427a62; }

.doors {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.door {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  min-height: 120px;
  border: 1px solid #a29a82;
  border-radius: 10px;
  padding: 0;
  background: #efe8d6;
  perspective: 700px;
  color: var(--ink);
  text-align: left;
  transition: translate 160ms ease, box-shadow 160ms ease;
}
.door:not(:disabled):hover { translate: 0 -2px; box-shadow: 0 5px 15px #263c2b22; }
.door:disabled {
  color: #545a4e;
  cursor: default;
  border-color: #d9d0bc;
  background: repeating-linear-gradient(135deg, #f1ecdf 0 7px, #eee9dc 7px 8px);
}
.door[data-state="available"] { background: var(--green); color: #fff5dd; border-color: var(--green); }
.door.door-today { outline: 1px solid #986431; outline-offset: 3px; }
.door.door-today:focus-visible { outline-width: 3px; }
.door-face {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: space-between;
  min-width: 0;
  padding: 12px;
  border-radius: 9px;
  transform-origin: left;
}
.door-number { font: 400 clamp(1.8rem, 3vw, 2.7rem) / 1 var(--heading); letter-spacing: -.03em; }
.door-icon { position: absolute; top: 13px; right: 12px; }
.door[data-state="available"] .door-icon { color: var(--gold); }
.lock {
  position: relative;
  width: 12px;
  height: 9px;
  border: 1.4px solid currentColor;
  border-radius: 2px;
}
.lock::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 1.5px;
  width: 6px;
  height: 6px;
  border: 1.4px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}
.door-icon.lock { position: absolute; top: 18px; }
.door-caption { font-size: .78rem; font-weight: 650; }
.door-preview {
  position: absolute;
  z-index: -1;
  inset: 0;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 9px 8px 7px 46%;
  overflow: hidden;
  border-radius: 9px;
  color: #5b4b38;
  opacity: .75;
}
.door-preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(2px);
  mask-image: linear-gradient(90deg, transparent 18%, black 75%);
}
.preview-title, .preview-text { filter: blur(1.25px); overflow: hidden; overflow-wrap: anywhere; }
.preview-title { font: 400 .98rem / 1.1 var(--heading); }
.preview-text { font-size: .68rem; line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.door[data-state="opened"] .door-face {
  background: linear-gradient(90deg, #efe8d6 12%, #efe8d695 50%, transparent 86%);
}
.door[data-state="opened"] .door-icon {
  background: #efe8d6;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1;
}
.door-opening .door-face { animation: swing-open 760ms ease-in-out both; }
@keyframes swing-open {
  from { transform: rotateY(0); background: var(--green); color: #fff5dd; }
  to { transform: rotateY(-90deg); background: var(--green); color: #fff5dd; }
}

.site-footer {
  margin-block: 33px 24px;
  text-align: center;
  border-top: 1px solid var(--line);
  padding: 18px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
}
.site-footer span { color: #8a562e; margin-right: 4px; }

dialog {
  max-width: min(560px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  width: 100%;
  padding: 23px 28px 30px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fffaf0;
  color: var(--ink);
  overflow-wrap: anywhere;
}
dialog::backdrop { background: #112920bd; }
dialog[open] { animation: reveal 180ms ease-out both; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } }
.surprise-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.surprise-top p { color: #775330; font-size: .9rem; font-weight: 650; }
.close-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font: 1.45rem / 1 system-ui, sans-serif;
}
.close-button:hover { background: #eee7d7; }
#surprise-content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 15px; }
.surprise-message { color: #41493e; line-height: 1.6; white-space: pre-line; }
.surprise-image { display: block; width: 100%; border-radius: 7px; }
.download { display: inline-block; }

@media (max-width: 860px) {
  .shell { width: calc(100% - 48px); }
  .hero-copy { padding-inline: 40px; }
  .hero { min-height: 345px; }
  .doors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .shell { width: calc(100% - 30px); }
  .header-inner { min-height: 58px; gap: 10px; }
  .header-inner:has(.header-actions:not([hidden])) { flex-wrap: wrap; padding-block: 8px; }
  .header-label { padding-left: 10px; }
  .hero { grid-template-rows: 140px auto; min-height: 0; margin-top: 16px; }
  .hero-art, .hero::after { grid-area: 1 / 1 / 2 / 2; inset: 0 0 -80px; }
  .hero-art { background-position: center 64%; }
  .hero::after { background: linear-gradient(0deg, var(--dark-green) 14px, transparent 100px); }
  .hero-copy { grid-row: 2; padding: 14px 22px 27px; }
  .hero:has(#calendar-copy:not([hidden])) { min-height: 220px; }
  .hero:has(#calendar-copy:not([hidden]))::after {
    background:
      linear-gradient(0deg, var(--dark-green) 14px, transparent 140px),
      linear-gradient(90deg, #132e26ed, #132e26b3 72%, #132e2633);
  }
  .hero:has(#calendar-copy:not([hidden])) .hero-copy { grid-row: 1 / -1; }
  .hero h1 { --hero-heading-size: clamp(2.5rem, 10vw, 3.15rem); }
  .hero-ornament { font-size: 1.35rem; }
  .signin { padding: 22px; margin-top: 23px; }
  .calendar { margin-top: 28px; }
  .calendar-header { gap: 12px; }
  .calendar-header h2 { font-size: clamp(1.4rem, 6.4vw, 1.85rem); }
  .doors { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .door { min-height: 99px; }
  .door-face { padding: 9px; }
  .door-icon { right: 8px; }
  .door-icon.lock { top: 15px; }
  .door-preview { padding-left: 48%; }
  dialog { padding-inline: clamp(16px, 5vw, 28px); }
}

@media (max-width: 350px) { .header-label { display: none; } }

@media (pointer: coarse) {
  .quiet-button, .primary-button, #login-form input, .download { min-height: 44px; }
  .bonus-toggle, .close-button { width: 44px; height: 44px; }
  .preview-notice a, .download { align-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
