:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  --ink: #101827;
  --cream: #fff0d9;
  --gold: #ebbe83;
  --soft: #d0c7bf;
  --serif: Georgia, "Times New Roman", serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  background: radial-gradient(ellipse at 64% 0, #242b42, transparent 65%), var(--ink);
}
button { font: inherit; }
button:focus-visible { outline: 3px solid #fff4d5; outline-offset: 4px; }
.page {
  width: min(100%, 1120px);
  padding: 0 clamp(1rem, 3.6vw, 3.75rem) 2rem;
  margin: 0 auto;
}
.masthead {
  padding: clamp(1.05rem, 3vw, 2rem) 0;
  border-bottom: 1px solid #e7be8352;
  color: var(--gold);
  text-align: center;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 2.2rem;
  padding-top: clamp(1.5rem, 3vw, 2.7rem);
}
.masthead h1 {
  font-family: var(--serif);
  font-size: clamp(1.65rem, 5.1vw, 3.8rem);
  font-weight: 400;
  letter-spacing: -.035em;
  line-height: 1.1;
  margin: 0;
}
.progress-panel {
  width: min(100%, 480px);
  justify-self: center;
  border-top: 1px solid #e7be8352;
  padding: 1rem 0 .33rem;
}
.progress-heading { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .45rem; align-items: baseline; }
#progress-text { font-size: .9rem; font-weight: 650; }
#preview-mark { color: var(--gold); text-transform: uppercase; font-size: .76rem; letter-spacing: .08em; }
progress { display: block; width: 100%; height: 4px; margin: .75rem 0 .65rem; appearance: none; border: 0; background: #39445b; border-radius: 4px; }
progress::-webkit-progress-bar { background: #39445b; border-radius: 4px; }
progress::-webkit-progress-value { background: var(--gold); border-radius: 4px; }
progress::-moz-progress-bar { background: var(--gold); border-radius: 4px; }
#status { color: var(--soft); line-height: 1.55; font-size: .89rem; margin: 0; min-height: 1.4em; }
.jump, .signout {
  min-height: 44px;
  color: var(--gold);
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  font-size: .9rem;
}
.signout { color: var(--soft); }
.artwork { min-width: 0; }
.scene {
  position: relative;
  isolation: isolate;
  aspect-ratio: 3 / 2;
  background: #293651;
  border-radius: 9px;
  box-shadow: 0 19px 38px #040b16a3, 0 0 0 1px #ecc1858a;
}
.scene::after {
  position: absolute;
  inset: 6px;
  border: 1px solid #ffe2aa74;
  border-radius: 5px;
  content: "";
  pointer-events: none;
}
.panorama {
  position: absolute;
  width: 100%;
  height: 100%;
  inset: 0;
  object-fit: cover;
  object-position: 47% 50%;
  border-radius: inherit;
}
.doors { position: absolute; inset: 0; }
.door {
  --width: clamp(45px, 4.4vw, 65px);
  --height: clamp(49px, 5.1vw, 72px);
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--width);
  height: var(--height);
  transform: translate(-50%, -50%);
  border: 1px solid #f3c98abf;
  border-radius: 44% 44% 10% 10% / 28% 28% 9% 9%;
  background: #171824;
  color: #fff1cd;
  padding: 0;
  perspective: 360px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 3px 9px #090810bd;
}
.door:nth-child(3n) { border-radius: 4px; }
.door:nth-child(4n) { border-radius: 16% 16% 8% 8%; }
.door-face, .door-light { position: absolute; inset: 0; border-radius: inherit; display: grid; place-items: center; }
.door-face {
  display: flex;
  justify-content: center;
  align-items: center;
  transform-origin: left center;
  backface-visibility: hidden;
  isolation: isolate;
  background: linear-gradient(150deg, #3c3c57, #191f32 75%);
  box-shadow: inset 0 0 0 2px #1d2336;
  transition: transform .47s cubic-bezier(.2,.7,.22,1), background .2s;
}
.door-face::before { content: ""; border: 1px solid #e9ba7959; position: absolute; inset: 4px; border-radius: inherit; z-index: -1; }
.door-light { background: radial-gradient(ellipse, #fff6cf, #e39d53 62%, #754321 100%); color: #482814; font-size: 1.12rem; }
.door-number { font: 400 clamp(1.42rem, 2.15vw, 2rem)/1 var(--serif); font-variant-numeric: lining-nums; text-shadow: 0 1px 3px #170c06b0; }
.door-lock { position: absolute; bottom: 8%; right: 10%; font-size: .62rem; color: #dcc099; line-height: 1; }
.door[data-day="24"] .door-face { background: linear-gradient(150deg, #683834, #3b2029 75%); }
.door[data-today="true"] { border-color: #fff2c4; box-shadow: 0 0 0 2px #f1ba7080, 0 0 23px 5px #e9974990; }
.door[data-today="true"] .door-face { background: linear-gradient(150deg, #7a4b31, #522b29 75%); }
.door[data-seen="true"] .door-face { background: linear-gradient(150deg, #65543f, #363b46 75%); }
.door[data-seen="true"] .door-lock { color: #ffe6aa; }
.door[aria-disabled="true"] { cursor: default; }
.door.is-opening { z-index: 4; }
.door.is-opening .door-face { transform: rotateY(-112deg); }
.door.is-opening .door-light { box-shadow: 0 0 21px 4px #f7b46d; }
.door:focus-visible { z-index: 2; }
@media (hover:hover) {
  .door:not([aria-disabled="true"]):hover .door-face { background: linear-gradient(150deg, #775437, #4c3229 75%); }
}
dialog {
  color-scheme: light;
  color: #342721;
  background: #f9eedc;
  border: 1px solid #c89653;
  padding: 0;
  border-radius: 8px;
  width: min(510px, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  box-shadow: 0 20px 80px #05060ce0;
  overscroll-behavior: contain;
}
dialog::backdrop { background: #090f1dd9; backdrop-filter: blur(4px); }
dialog[open] { animation: note-in .24s ease-out both; }
html:has(dialog[open]) { overflow: hidden; }
.note-inner {
  padding: clamp(1.5rem, 4vw, 2.65rem);
  position: relative;
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 0, #fff8e9, #f4e4cd);
}
.note-inner::before { content: ""; position: absolute; inset: 8px; border: 1px solid #9b663b67; border-radius: 4px; z-index: -1; }
.note-body { text-align: center; }
.close {
  position: absolute;
  right: .72rem;
  top: .72rem;
  width: 44px;
  height: 44px;
  border: 1px solid #82593987;
  border-radius: 50%;
  color: #533721;
  background: #fff6e7;
  line-height: 1;
  font-size: 1.65rem;
  cursor: pointer;
}
.close:focus-visible { outline-color: #704321; }
.note-date {
  margin: .13rem 2.1rem .42rem;
  color: #7a451f;
  font-size: .77rem;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.note-ornament { color: #9b5e2b; font-size: 1.25rem; }
.epigraph {
  max-width: 35ch;
  margin: .5rem auto 1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid #b68b6352;
}
.epigraph blockquote {
  margin: 0;
  color: #6b4328;
  font: italic 400 clamp(1.05rem, 3.8vw, 1.33rem)/1.39 var(--serif);
  text-wrap: pretty;
}
.epigraph blockquote p { margin: 0; }
.epigraph figcaption { margin-top: .45rem; color: #6f4a32; font-size: .79rem; line-height: 1.45; }
.epigraph a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .17em; }
.epigraph a:focus-visible { outline: 2px solid #704321; outline-offset: 3px; }
.note-text {
  font: 400 clamp(1.25rem, 4.65vw, 1.82rem)/1.32 var(--serif);
  letter-spacing: -.024em;
  margin: .65rem auto 1.15rem;
  max-width: 30ch;
  white-space: pre-line;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}
.photo {
  margin: 0 auto;
  width: min(100%, 330px);
  padding: 9px;
  border: 1px solid #d7c7ad;
  background: #fffaf0;
  box-shadow: 0 7px 15px #72563726;
}
.photo-mat {
  display: grid;
  place-content: center;
  place-items: center;
  gap: .25rem;
  min-height: 135px;
  aspect-ratio: 4 / 3;
  background-color: #dfe3e8;
  background-image: repeating-linear-gradient(135deg, #b4c1cf38 0 1px, transparent 1px 11px), radial-gradient(ellipse at 50% 45%, #f0f1ef, #cdd6e0);
  color: #314259;
}
.photo-mat img { display: block; width: 100%; height: 100%; max-height: 40vh; object-fit: contain; grid-area: 1 / 1; }
.photo-mat:has(img) { display: block; min-height: 0; aspect-ratio: auto; background: #e0d6c6; }
.placeholder-mark { font: 400 2.1rem/1 var(--serif); }
.placeholder-label { font-size: .9rem; font-weight: 700; }
@keyframes note-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1000px) {
  .layout { row-gap: 1.35rem; }
  .door { --width: clamp(45px, 6.5vw, 63px); --height: clamp(49px, 7vw, 68px); }
}
@media (max-width: 680px) {
  .page { padding-inline: max(12px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .layout { padding-top: 1.15rem; gap: 1.1rem; }
  #note .photo { width: min(86%, 330px); }
  .scene { aspect-ratio: 4 / 5; }
  .panorama { object-position: 66% center; }
  .door { left: var(--mx); top: var(--my); --width: clamp(44px, 12vw, 63px); --height: clamp(46px, 12.7vw, 68px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  dialog::backdrop { backdrop-filter: none; }
}

.door-lock.is-locked {
  width: 7px;
  height: 5px;
  border-radius: 1px;
  background: #dcc099;
}
.door-lock.is-locked::before {
  position: absolute;
  top: -4px;
  left: 1px;
  width: 5px;
  height: 5px;
  border: 1px solid #dcc099;
  border-radius: 4px 4px 0 0;
  content: "";
}
.editor-link { display: inline-flex; align-items: center; }
.manage-button { display: block; }
#photo-manager h2 { font: 400 clamp(1.65rem, 6vw, 2.15rem)/1.1 var(--serif); margin: 0 2.9rem 1.1rem 0; }
#photo-manager label { display: block; font-weight: 650; margin: .95rem 0 .25rem; }
#photo-manager select, #photo-file { display: block; width: 100%; min-height: 44px; font: inherit; }
#photo-manager select { color: #33261c; background: #fffaf0; border: 1px solid #8c674a; border-radius: 4px; padding: .5rem .75rem; }
#photo-file { padding-block: .45rem; }
#photo-message { min-height: 1.5em; line-height: 1.45; }
.save-photo { color: #fff3df; background: #653e26; border: 0; border-radius: 4px; min-height: 44px; padding: .6rem 1rem; cursor: pointer; }
.save-photo:disabled { opacity: .65; cursor: default; }
#photo-manager :focus-visible { outline: 2px solid #79451e; outline-offset: 3px; }
