/* bothkeysturning.com. Near-black stone and vault steel, ivory paper text, one brass accent. The investigator's
   red appears only in Act III and in the countdown's final hour, and never carries meaning on its own. Night is
   the home state; daylight turns the page to paper while the jacket and the door stay dark. */
:root {
  color-scheme: dark light;
  --stone: #0C0B0A; --steel: #14161A; --rule: #2C2A26; --text: #ECE5D3; --soft: #B5AC98;
  --brass: #C9A560; --red: #E0574D; --paper: #EFE7D2; --paper-ink: #221C12;
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}
@media (prefers-color-scheme: light) {
  :root {
    --stone: #F3EDDF; --steel: #E7DFCC; --rule: #CBBFA4; --text: #1B1711; --soft: #574D3B;
    --brass: #765A1F; --red: #A3221B; --paper: #FBF7EC;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--stone); color: var(--text); font: 400 1.0625rem/1.7 var(--serif); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-color: var(--brass); }
a:hover { color: var(--brass); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }
.skip { position: absolute; left: -999rem; top: 0; background: var(--paper); color: var(--paper-ink); padding: 0.6rem 1rem; z-index: 30; }
.skip:focus { left: 0; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0 0 0.6em; text-wrap: balance; }
h2 { font-size: clamp(1.7rem, 3.8vw, 2.7rem); max-width: 22ch; }
p { margin: 0 0 1em; max-width: 62ch; }
.eyebrow { font: 600 0.74rem/1.2 var(--sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--brass); margin-bottom: 1.1rem; }

.wrap { max-width: 76rem; margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 46rem; }
.band { position: relative; padding: clamp(3.5rem, 9vw, 7rem) 0; border-top: 1px solid var(--rule); }
.band--steel { background: var(--steel); }
.split { display: grid; gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
@media (min-width: 52rem) { .split { grid-template-columns: 1.1fr 0.9fr; } .split--game { grid-template-columns: 1.2fr 0.8fr; align-items: center; } }

.button { display: inline-block; font: 600 0.85rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none; color: #14100A; background: #C9A560; border: 1px solid #C9A560; padding: 1rem 1.4rem; border-radius: 2px; cursor: pointer; }
.button:hover { background: #DDBB78; color: #14100A; }
.button:disabled { opacity: 0.6; cursor: default; }

/* The music control: pinned. Waves show while the music is on, which is the default; a cross once the visitor turns it off. */
.sound { position: fixed; top: 0.9rem; right: 0.9rem; z-index: 20; display: inline-flex; align-items: center; gap: 0.5rem; font: 600 0.72rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: #ECE5D3; background: rgba(12, 11, 10, 0.82); border: 1px solid #5A5140; border-radius: 999px; padding: 0.55rem 0.9rem; cursor: pointer; }
.sound .sound__waves, .sound .sound__cross { display: none; }
.sound[data-state="on"] { color: #C9A560; border-color: #C9A560; }
.sound[data-state="on"] .sound__waves { display: inline; }
.sound[data-state="off"] .sound__cross { display: inline; }

/* The hero is black stone in both themes: the jacket sits on it. */
.hero { background: radial-gradient(120% 90% at 30% 20%, #1B1A18 0%, #0C0B0A 55%, #060606 100%); color: #ECE5D3; padding: clamp(4.5rem, 9vw, 7rem) 0 clamp(3rem, 8vw, 6rem); }
.hero .eyebrow { color: #C9A560; }
.hero__grid { display: grid; gap: clamp(2rem, 6vw, 5rem); align-items: center; justify-items: center; }
@media (min-width: 52rem) { .hero__grid { grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); justify-items: start; } }
.jacket { position: relative; width: min(100%, 22rem); aspect-ratio: 2 / 3; background: linear-gradient(180deg, #050505 0%, #050505 55%, #15130F 100%); border: 1px solid #2A2620; border-left-width: 6px; border-radius: 2px 4px 4px 2px; overflow: hidden; container-type: inline-size; box-shadow: 0 2.5rem 4rem -1.5rem #000, 0 0 0 1px #000; }
@media (min-width: 52rem) { .jacket { transform: perspective(70rem) rotateY(7deg); transform-origin: left center; } }
.jacket picture, .jacket img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.jacket__type { position: absolute; inset: 9% 8% auto; text-align: center; }
.jacket__title { font-size: 12.5cqw; letter-spacing: 0.1em; text-transform: uppercase; line-height: 1.12; color: #ECE5D3; margin: 0; }
.jacket__title span { display: block; color: #C9A560; }
.jacket__byline { font: 600 3.4cqw/1 var(--sans); letter-spacing: 0.42em; text-transform: uppercase; color: #B5AC98; margin: 6cqw auto 0; max-width: none; }
.jacket__sweep { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 38%, rgba(255, 240, 205, 0.16) 50%, transparent 62%); transform: translateX(-120%); animation: sweep 3.4s ease-out 0.5s 1 both; pointer-events: none; }
@keyframes sweep { to { transform: translateX(120%); } }
.hook { font-size: clamp(1.7rem, 4.4vw, 3rem); line-height: 1.15; max-width: 16ch; margin-bottom: 1.6rem; text-wrap: balance; }
.twelves { list-style: none; margin: 0 0 2rem; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid #3A352B; border-bottom: 1px solid #3A352B; max-width: 34rem; }
.twelves li { padding: 0.9rem 0.6rem 0.9rem 0; }
.twelves li + li { padding-left: 0.8rem; border-left: 1px solid #3A352B; }
.twelves strong { display: block; font: 600 clamp(0.62rem, 2.6vw, 0.8rem)/1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: #C9A560; }
.twelves span { display: block; font-size: 0.95rem; color: #B5AC98; }
@media (max-width: 51.99rem) { .hero__copy { text-align: center; } .hook, .twelves { margin-left: auto; margin-right: auto; } .twelves { text-align: left; } }

/* The facts ledger. */
.ledger { margin: 0; border-top: 2px solid var(--brass); font-family: var(--sans); font-size: 0.95rem; }
.ledger div { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--rule); }
.ledger dt { font-weight: 600; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); padding-top: 0.25rem; }
.ledger dd { margin: 0; }
.ledger__note { font-size: 0.85rem; color: var(--soft); margin: 0.9rem 0 0; }
@media (max-width: 26rem) { .ledger div { grid-template-columns: 1fr; gap: 0.15rem; } }
.pull { margin: clamp(3rem, 7vw, 5rem) auto 0; }
.pull p { font-size: clamp(1.6rem, 4.6vw, 3.2rem); line-height: 1.2; font-style: italic; max-width: 22ch; margin: 0; padding-left: 1.2rem; border-left: 3px solid var(--brass); text-wrap: balance; }

/* Pictures. A frame whose picture has not arrived removes itself (js/site.js). */
.plate { margin: 0; }
.plate img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--rule); background: #0C0B0A; }
.plate figcaption { font: 400 0.8rem/1.4 var(--sans); color: var(--soft); padding-top: 0.5rem; }
.plate--small { width: 55%; margin-top: 1.2rem; }
.plate--still img { aspect-ratio: 16 / 9; }

.acts { display: grid; gap: clamp(2rem, 4vw, 3rem); margin-top: 2.5rem; }
@media (min-width: 60rem) { .acts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.act { border-top: 1px solid var(--rule); padding-top: 1.2rem; }
.act__numeral { font-size: 3.4rem; line-height: 1; color: var(--brass); margin: 1.2rem 0 0.4rem; }
.act h3 { font: 600 0.74rem/1.2 var(--sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--soft); }
.act h3 span { display: block; font: 400 1.6rem/1.2 var(--serif); letter-spacing: 0; text-transform: none; color: var(--text); margin-top: 0.4rem; }
.act--pursuit .act__numeral { color: var(--red); }
.circled { list-style: none; margin: 1.2rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, 2.1rem); gap: 0.45rem; font: 400 0.8rem/1 var(--sans); }
.circled li { width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border: 1.5px solid var(--red); border-radius: 50%; transform: rotate(-4deg); }
.circled li:nth-child(even) { transform: rotate(3deg); border-radius: 48% 52% 50% 50%; }

/* The ritual. */
.band--ritual { overflow: hidden; }
.ritual__detail { position: absolute; inset: 0 0 0 auto; width: min(55%, 46rem); margin: 0; opacity: 0.22; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 70%); mask-image: linear-gradient(90deg, transparent, #000 70%); }
.ritual__detail img { width: 100%; height: 100%; object-fit: cover; }
.band--ritual .wrap { position: relative; }
.clock { border: 1px solid var(--rule); background: var(--steel); padding: 1.4rem 1.5rem; }
.clock__label { font: 600 0.74rem/1.2 var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: var(--brass); margin: 0 0 0.6rem; }
.clock__time { font: 400 clamp(2.4rem, 9vw, 3.8rem)/1 var(--sans); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; margin: 0 0 0.6rem; }
.clock__note { font: 400 0.85rem/1.5 var(--sans); color: var(--soft); margin: 0; }
.clock[data-final] .clock__time { color: var(--red); }

/* The door is steel in both themes. */
.door { margin-top: clamp(2rem, 5vw, 3.5rem); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.4fr) minmax(0, 1fr); gap: clamp(0.5rem, 2vw, 1.5rem); align-items: center; background: linear-gradient(180deg, #1A1D22, #0F1114); color: #ECE5D3; border: 1px solid #343840; border-radius: 4px; padding: clamp(1rem, 3vw, 2rem); -webkit-user-select: none; user-select: none; }
.key { display: grid; justify-items: center; gap: 0.5rem; min-height: 9rem; padding: 0.9rem 0.4rem; font: 600 0.68rem/1.3 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: #C9A560; background: #0C0D10; border: 1px solid #4A4434; border-radius: 4px; cursor: pointer; touch-action: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.key__glyph { transform-origin: 32px 32px; transition: transform 0.35s ease; }
.key[aria-pressed="true"] { background: #1E1A10; border-color: #C9A560; color: #EBCB8B; }
.key[aria-pressed="true"] .key__glyph { transform: rotate(90deg); }
.key kbd { font: 600 0.7rem/1 var(--sans); color: #B5AC98; border: 1px solid #4A4434; border-radius: 3px; padding: 0.25rem 0.45rem; }
@media (hover: none) and (pointer: coarse) { .key kbd { display: none; } }
.bolt svg { display: block; width: 100%; height: auto; }
.bolt__plate { fill: #20242A; stroke: #3B4049; stroke-width: 2; }
.bolt__keeper { fill: #0B0C0E; stroke: #3B4049; stroke-width: 2; }
.bolt__bar { fill: #9AA0A8; stroke: #5B616A; stroke-width: 2; transition: transform 0.9s cubic-bezier(0.6, 0, 0.2, 1); }
.bolt__rivet { fill: #3B4049; }
.bolt__lamp { fill: #2A2A2A; stroke: #5B616A; stroke-width: 2; transition: fill 0.5s ease; }
.door[data-state="open"] .bolt__bar { transform: translateX(-62px); }
.door[data-state="open"] .bolt__lamp { fill: #EBCB8B; }
.door[data-state="open"] { border-color: #C9A560; }
.door__say { grid-column: 1 / -1; text-align: center; font-size: clamp(1.1rem, 3vw, 1.5rem); min-height: 3.2em; margin: 0.6rem auto 0; max-width: 34ch; -webkit-user-select: text; user-select: text; }
.door[data-state="open"] .door__say { font-style: italic; color: #EBCB8B; }
.door__help { grid-column: 1 / -1; text-align: center; font: 400 0.82rem/1.5 var(--sans); color: #B5AC98; margin: 0 auto; }

/* The bank. */
.pair { display: grid; gap: 1rem; padding: 0 var(--gutter); max-width: 100rem; margin: 1.5rem auto 2.5rem; }
@media (min-width: 52rem) { .pair { grid-template-columns: 1.7fr 1fr; } .pair .plate img { height: 26rem; aspect-ratio: auto; } }

/* Notebook pages are paper in both themes. Every word is text. */
.pages { display: grid; gap: 1.5rem; margin-top: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(14.5rem, 1fr)); }
.page { background: var(--paper); color: var(--paper-ink); padding: 1.5rem 1.4rem 1.3rem; background-image: repeating-linear-gradient(180deg, transparent 0 1.74rem, rgba(60, 50, 30, 0.14) 1.74rem 1.8rem); box-shadow: 0 1rem 1.6rem -1rem rgba(0, 0, 0, 0.7); transform: rotate(-0.7deg); }
.page:nth-child(even) { transform: rotate(0.6deg); }
.page h3 { font: 600 0.7rem/1.8rem var(--sans); letter-spacing: 0.2em; text-transform: uppercase; color: #6A531D; margin: 0; }
.page p { font-style: italic; line-height: 1.8rem; margin: 0; }
.page--loose { outline: 1px dashed #8A6F3C; outline-offset: -0.5rem; }

.band--game { background: var(--steel); }
.plate--still img { border-width: 6px; border-color: #0C0B0A; outline: 1px solid var(--rule); }

/* Signup. */
.signup { margin-top: 1.8rem; }
.signup label { display: block; font: 600 0.74rem/1.2 var(--sans); letter-spacing: 0.16em; text-transform: uppercase; color: var(--soft); margin-bottom: 0.5rem; }
.signup__row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.signup input { flex: 1 1 16rem; min-width: 0; font: 400 1rem/1.2 var(--sans); color: var(--text); background: transparent; border: 1px solid var(--soft); border-radius: 2px; padding: 0.95rem 1rem; }
.signup input[aria-invalid="true"] { border-color: var(--red); border-width: 2px; }
.signup__note { font: 400 0.92rem/1.5 var(--sans); min-height: 1.5em; margin: 0.8rem 0 0; }
.signup__note[data-state="error"]::before { content: "Not saved. "; font-weight: 700; }
.signup__note[data-state="done"] { color: var(--brass); }

.foot { border-top: 1px solid var(--rule); padding: 2.5rem 0 3.5rem; font: 400 0.85rem/1.6 var(--sans); color: var(--soft); }
.foot p { margin-bottom: 0.5em; }

.lost { min-height: 100vh; display: grid; align-items: center; }
.lost h1 { font-size: clamp(2rem, 6vw, 3.4rem); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .jacket__sweep { animation: none; display: none; }
  .bolt__bar, .bolt__lamp, .key__glyph { transition: none; }
}
