/* Page style for the calendar and every scene: a small lit place in the dark, almost no chrome.
   Adapted from life-tableaus: night colours by default (a scene can set its own), a caption card that wraps
   a verse, and a calendar of 25 doors. */
:root { --ink: #ece4d2; --muted: #8f93a6; --paper: #121726; --gold: #e2bd6a; --door: #1a2034; --line: #2c3450; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--paper); color: var(--ink); }
body { font: 13px/1.4 ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; }
body.scene { overflow: hidden; }
/* a scene: the picture raised, the story centred under it, the day and title bottom left (Caleb's Day 1 mock-up) */
#stage {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 44px max(16px, env(safe-area-inset-right)) 76px max(16px, env(safe-area-inset-left));
}
canvas { display: block; flex: none; image-rendering: pixelated; touch-action: none; cursor: pointer; outline: none; }
/* the story box rises into the empty band under the floor (--lift, set by tableau.js) */
#story {
  position: relative; flex: none; width: min(27em, 100%); margin-top: calc(8px - var(--lift, 0px));
  font-size: 15px; line-height: 1.55; color: var(--ink); cursor: default;
}
#story p { margin: 0; min-height: calc(2 * 1.55em); padding-right: 1.5em; white-space: pre-line; }
#story.hint p { color: var(--muted); text-align: center; padding: 0 1.5em; }
#story.more { cursor: pointer; }
#story .more { position: absolute; right: 0; bottom: .1em; font-size: 13px; line-height: 1.55; visibility: hidden; }
#story.more .more { visibility: visible; animation: more 1s steps(1) infinite; }
#story p.turn { animation: turn .16s ease-out; }
@keyframes more { 50% { transform: translateY(2px); } }
@keyframes turn { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #story.more .more, #story p.turn { animation: none; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#meta {
  position: fixed; left: max(18px, env(safe-area-inset-left)); bottom: max(16px, env(safe-area-inset-bottom));
  right: max(18px, env(safe-area-inset-right)); display: grid; gap: 6px; pointer-events: none;
}
#meta small { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
#meta b { font-size: 14px; font-weight: 400; }
#chrome {
  position: fixed; top: max(4px, env(safe-area-inset-top)); left: max(6px, env(safe-area-inset-left));
  right: max(6px, env(safe-area-inset-right)); display: flex; justify-content: space-between; align-items: center;
}
#chrome a, #chrome button { font: inherit; color: var(--muted); background: none; border: 0; padding: 10px; cursor: pointer; text-decoration: none; }
#chrome a.back { display: grid; padding: 8px; }
#chrome a:hover, #chrome a:focus-visible, #chrome button:hover, #chrome button:focus-visible { color: var(--ink); }
/* an object's name: a small key-cap tag over it, like the WASD caps */
#label {
  position: fixed; left: 0; top: 0; z-index: 2; pointer-events: none; white-space: nowrap;
  font-size: 11px; line-height: 15px; padding: 1px 6px 2px; color: #1c1b19; background: #eee8da;
  border: 1px solid #1c1b19; box-shadow: inset 0 -2px 0 #b9b1a8;
}
#label[hidden] { display: none; }
@media (max-width: 480px) {
  #stage { padding-bottom: 70px; }
  #story { width: 100%; font-size: 14px; }
}

/* ---------- the calendar ---------- */
.calendar { max-width: 640px; margin: 0 auto; padding: max(36px, env(safe-area-inset-top)) 16px 40px; }
.calendar h1 { font: inherit; font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.calendar > p { color: var(--muted); margin: 0 0 20px; }
.note { color: var(--gold); margin: 0 0 16px; }
.note a { color: inherit; }
.doors { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.door {
  aspect-ratio: 3 / 4; display: flex; flex-direction: column; justify-content: space-between; padding: 8px;
  border: 1px solid var(--line); border-radius: 3px; background: var(--door); color: var(--muted); text-decoration: none; min-width: 0;
}
.door .n { font-size: 20px; line-height: 1; color: var(--ink); opacity: .55; }
.door small { font: inherit; font-size: 11px; line-height: 1.25; overflow-wrap: anywhere; }
a.door { border-color: var(--gold); color: var(--ink); background: #241f22; }
a.door .n { color: var(--gold); opacity: 1; }
a.door:hover, a.door:focus-visible { background: var(--gold); color: var(--paper); outline: none; }
a.door:hover .n, a.door:focus-visible .n { color: var(--paper); }
.door.coming { border-style: dashed; }
.door.locked { background: transparent; }
.credits { color: var(--muted); margin-top: 28px; font-size: 11px; }
.credits a { color: inherit; }
@media (max-width: 480px) {
  .doors { gap: 6px; }
  .door { padding: 6px; }
  .door .n { font-size: 17px; }
  .door small { font-size: 9.5px; }
}
