:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --page: #101615;
  --panel: #191f1e;
  --screen: #101916;
  --edge: #3b4742;
  --text: #f4ebd8;
  --muted: #b7c0b6;
  --amber: #f0ad70;
  --mint: #a9d7bd;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  color: var(--text);
  background: var(--page);
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; }
[hidden] { display: none !important; }
.shell { width: min(1190px, 100% - 88px); margin-inline: auto; }

.masthead { border-bottom: 1px solid #343c36; }
.topbar { display: flex; min-height: 68px; justify-content: space-between; align-items: center; gap: 14px; }
.brand-mark { background: var(--amber); }
.brand-period { color: var(--amber); }
.back { color: var(--muted); font-size: .86rem; text-decoration: none; display: inline-flex; align-items: center; gap: 9px; }
.back:hover { color: var(--text); }

.intro { display: flex; justify-content: space-between; align-items: end; gap: 25px; padding: 41px 0 31px; }
.intro h1 { margin: 0; font-size: clamp(2.6rem, 6vw, 5.8rem); font-weight: 820; letter-spacing: -.06em; line-height: 1.02; }
.intro p { color: var(--muted); margin: 15px 0 0; line-height: 1.55; }
.intro > .intro-instruction { text-align: right; max-width: 320px; font-size: .92rem; padding-bottom: 1px; }

.exhibit { display: grid; grid-template-columns: minmax(0, 1.63fr) minmax(0, 1fr); gap: 12px; }
.scene { position: relative; isolation: isolate; display: grid; align-items: end; min-width: 0; overflow: hidden; border: 1px solid var(--edge); border-radius: 13px; background: #14201f; }
.scene::before, .scene-shade { position: absolute; inset: 0; content: ''; pointer-events: none; }
.scene::before { z-index: -2; background: #14201f url("./hero.jpg") 55% 56% / cover; }
.scene-shade { z-index: -1; background: linear-gradient(0deg, #080d0df5 2%, #080d0d81 28%, transparent 62%); }
.scene[data-scene="weather"]::before {
  background: #253b3b url("./ridge.jpg") 66% 56% / cover;
}
.scene[data-scene="train"]::before {
  background: #303645 url("./train.jpg") 65% 50% / cover;
}
.scene-caption { padding: clamp(20px, 3.6vw, 46px); }
.scene-caption p, .scene-caption h2 { margin: 0; }
.scene-caption .scene-time { margin-bottom: 10px; color: var(--amber); font: 600 .81rem var(--mono); letter-spacing: .035em; }
.scene-caption h2 { font-size: clamp(1.7rem, 4vw, 3.9rem); font-weight: 780; letter-spacing: -.05em; line-height: 1.08; }
.scene-caption #scene-text { margin-top: 11px; color: #e5dece; max-width: 40ch; font-size: .92rem; line-height: 1.55; }
#scene-text strong { color: var(--text); }

.receiver { min-width: 0; padding: 21px; border: 1px solid var(--edge); border-radius: 13px; background: linear-gradient(155deg, #202824, var(--panel) 45%); box-shadow: inset 0 1px #ffffff0c; }
.receiver-header { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.receiver-header h2 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: .91rem; font-weight: 700; }
.lamp { display: inline-block; width: 8px; aspect-ratio: 1; border-radius: 50%; background: var(--amber); box-shadow: 0 0 9px #eaca7560; }
.sound, .tuner-buttons button { border: 1px solid #4e5c55; border-radius: 7px; background: #24302a; }
.sound:hover, .tuner-buttons button:not(:disabled):hover { background: #33453a; }
.sound { display: inline-flex; align-items: center; gap: 8px; padding: 0 11px; min-height: 42px; font-size: .78rem; white-space: nowrap; }
.sound[aria-pressed="true"] { color: var(--mint); border-color: #72927f; }
.sound-bars { display: flex; align-items: center; gap: 2px; }
.sound-bars i { width: 2px; height: 6px; background: currentColor; }
.sound-bars i:nth-child(2) { height: 12px; }
.sound-bars i:nth-child(3) { height: 9px; }

.display { color: var(--mint); background: var(--screen); border: 1px solid #34493e; border-radius: 9px; overflow: hidden; }
.readout { display: flex; align-items: baseline; gap: 10px; padding: 13px 14px 4px; }
#frequency { font: 500 clamp(2.65rem, 4.6vw, 4.15rem) / 1 var(--mono); letter-spacing: -.08em; font-variant-numeric: tabular-nums; }
.unit { font: .74rem var(--mono); }
#wave { display: block; width: 100%; height: 81px; background-image: linear-gradient(#6ab4951f 1px, transparent 1px), linear-gradient(90deg, #6ab4951f 1px, transparent 1px); background-size: 20px 20px; }
.signal-line { display: grid; grid-template-columns: auto minmax(0, 1fr) 3ch; align-items: center; gap: 11px; padding: 10px 14px 12px; font-size: .74rem; }
#signal-value { text-align: right; font-family: var(--mono); }
meter { width: 100%; height: 8px; appearance: none; background: #2f4239; border-radius: 2px; }
meter::-webkit-meter-bar { height: 8px; background: #2f4239; border: 0; border-radius: 2px; }
meter::-webkit-meter-optimum-value { background: var(--mint); border-radius: 2px; }
meter::-moz-meter-bar { background: var(--mint); border-radius: 2px; }

.tuner { margin: 15px 0 13px; }
.scale { display: flex; justify-content: space-between; color: #b7c4b9; font: .68rem var(--mono); padding: 0 3px 6px; }
#tune { display: block; appearance: none; width: 100%; height: 29px; margin: 0; border-radius: 5px; background: #101715 repeating-linear-gradient(90deg, #56655b 0 1px, transparent 1px 5%) center / 95% 44% no-repeat; cursor: ew-resize; }
#tune::-webkit-slider-runnable-track { height: 29px; }
#tune::-webkit-slider-thumb { appearance: none; width: 12px; height: 29px; border: 1px solid #ffdda7; border-radius: 3px; background: var(--amber); box-shadow: 0 0 9px #f0ad7050; }
#tune::-moz-range-thumb { width: 10px; height: 27px; border: 1px solid #ffdda7; border-radius: 3px; background: var(--amber); }
.tuner-buttons { display: grid; grid-template-columns: 44px 1fr 44px; gap: 8px; align-items: center; margin-top: 9px; }
.tuner-buttons button { height: 44px; font-size: 1.2rem; }
.tuner-buttons button:disabled { opacity: .48; }
#lock-status { color: var(--muted); font-size: .8rem; margin: 0; text-align: center; }
.receiver[data-locked="true"] #lock-status { color: var(--mint); }
.capture { width: 100%; display: flex; align-items: center; justify-content: space-between; min-height: 45px; gap: 8px; border: 1px solid var(--amber); border-radius: 7px; padding: 0 13px; background: var(--amber); color: #241710; font-weight: 800; font-size: .89rem; }
.capture:hover:not(:disabled) { background: #ffd09a; }
.capture:disabled { color: #bdc3b9; background: #29342c; border-color: #3c4d41; }

.archive { margin-top: 38px; }
.archive-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--edge); padding-bottom: 13px; }
.archive-header h2 { margin: 0; font-size: 1.6rem; letter-spacing: -.06em; }
#archive-count { margin: 0; color: var(--muted); font: .78rem var(--mono); white-space: nowrap; }
.archive-grid { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1fr); gap: 17px; padding-top: 13px; }
.archive-list { display: grid; align-content: start; gap: 7px; }
.archive-list button { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 47px; padding: 6px 12px; border: 1px solid var(--edge); border-radius: 7px; background: #1c2620; text-align: left; }
.archive-list button[aria-pressed="true"] { color: var(--mint); border-color: #82978a; }
.archive-list button:not(:disabled):hover { background: #2c3c33; }
.archive-list button:disabled { color: var(--muted); background: #171e1b; }
.archive-list .record-frequency { color: var(--muted); font: .73rem var(--mono); white-space: nowrap; }
.log { min-height: 154px; padding: 18px 21px; border: 1px solid var(--edge); border-radius: 8px; background: #1a231e; }
.log h3 { font-size: 1.26rem; margin: 0 0 8px; letter-spacing: -.04em; }
.log p { line-height: 1.65; margin: 0; font-size: .94rem; color: var(--muted); }
.log .log-meta { color: var(--mint); margin-bottom: 7px; font: .76rem var(--mono); }
.log .log-clue { margin-top: 11px; color: var(--amber); }
.ending { border-left: 2px solid var(--mint); padding: 9px 12px; color: var(--mint); line-height: 1.55; }
footer { margin-top: 33px; border-top: 1px solid #343c36; padding: 18px 0 30px; color: var(--muted); font-size: .79rem; line-height: 1.6; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 850px) {
  .shell { width: min(100% - 40px, 1190px); }
  .exhibit { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .receiver { padding: 15px; }
}

@media (max-width: 650px) {
  .topbar { min-height: 57px; }
  .shell { width: calc(100% - 28px); }
  .intro { display: block; padding: 29px 0 20px; }
  .intro p { margin-top: 10px; }
  .intro > .intro-instruction { text-align: left; max-width: none; }
  .intro-instruction br { display: none; }
  .exhibit, .archive-grid { grid-template-columns: minmax(0, 1fr); }
  .scene { min-height: clamp(190px, 60vw, 290px); }
  .archive { margin-top: 29px; }
  .archive-grid { gap: 10px; }
  #wave { height: 65px; }
}

.feedback { color: #f3bd9d; font-size: .82rem; line-height: 1.5; margin: 10px 0 0; }
.return { display: block; margin: 12px 0 0; padding: 0 4px; min-height: 40px; text-decoration: underline; text-underline-offset: 3px; border: 0; border-radius: 4px; background: transparent; color: var(--mint); font-size: .83rem; }
.return:hover { color: var(--text); }
