:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  --back: #080d13;
  --surface: #101b25;
  --ink: #eef4f7;
  --muted: #9fb1bf;
  --line: #304250;
  --accent: #ffc67d;
  --signal: #a6e5c3;
  --code: ui-monospace, SFMono-Regular, Consolas, monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 60% -10%, #182e3e 0%, var(--back) 55%); min-height: 100vh; }
.brief { max-width: 1050px; margin: 0 auto; padding: 28px clamp(18px, 4vw, 44px); }
.mast, footer { display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.mast { padding: 0 0 18px; }
.stamp, .progress, .eyebrow, .receiver-label, output, .status, .scale, footer { font-family: var(--code); letter-spacing: .09em; }
.stamp { color: #ffac73; border: 1px solid #9a5d3b; padding: 7px 10px; font-size: .75rem; font-weight: 800; }
.progress { font-size: .82rem; color: var(--muted); }
.screen { padding: clamp(28px, 5vw, 58px); border: 1px solid var(--line); background: linear-gradient(135deg, #101e29, #0a1119); min-height: 520px; }
.cover { position: relative; min-height: min(650px, 79svh); display: grid; align-items: end; isolation: isolate; overflow: hidden; }
.cover-background { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #060a10e8, #060a1020 85%), linear-gradient(0deg, #060a10ee, transparent 60%), url("assets/pilot.jpg") 65% center / cover; }
.cover-text { position: relative; }
.opening-actions .quiet { background: #091520e6; }
.opening-actions .quiet:hover { background: #192b38; }
.briefing-play-icon { margin-right: 7px; color: var(--accent); }
.briefing-transcript { max-width: 475px; margin-top: 14px; color: #c5d3de; font-size: .9rem; line-height: 1.5; }
.briefing-transcript summary { width: fit-content; padding: 4px 0; cursor: pointer; color: var(--ink); }
.briefing-transcript summary:focus-visible { outline: 2px solid #edfbff; outline-offset: 4px; }
.briefing-transcript blockquote { margin: 8px 0 0; padding: 9px 13px; background: #091520e6; border-left: 2px solid var(--accent); }
.eyebrow { text-transform: uppercase; font-size: .72rem; color: var(--accent); margin: 0 0 16px; }
.led { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ffc67d; margin: 0 7px 1px 0; box-shadow: 0 0 16px #ffb873; vertical-align: middle; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.3rem, 7.2vw, 5.6rem); letter-spacing: -.074em; line-height: .96; max-width: 16ch; }
h2 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -.045em; line-height: 1; }
h1:focus, h2:focus { outline: none; }
.cover p:not(.eyebrow), .intro { color: #c5d3de; margin-top: 20px; line-height: 1.6; font-size: 1rem; }
.briefing-audio-status, .cover p.briefing-audio-status { margin: 10px 0 0; color: #c5d3de; font-size: .88rem; }
.screen-briefing { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 14px; margin-top: 14px; }
.screen-briefing .briefing-transcript { margin-top: 0; }
.screen-briefing .briefing-transcript[open], .screen-briefing .briefing-audio-status { flex-basis: 100%; }
button { font: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid #edfbff; outline-offset: 5px; }
.primary { background: var(--accent); color: #241407; margin-top: 25px; padding: 11px 17px; border: 0; min-height: 48px; display: inline-flex; gap: 16px; align-items: center; font-weight: 750; }
.primary:hover:not(:disabled) { background: #ffdaac; }
.primary:disabled { opacity: .43; cursor: default; }
.quiet { color: #d7e4ef; background: transparent; border: 1px solid var(--line); padding: 11px 14px; min-height: 46px; text-align: left; }
.quiet:hover { border-color: #8ca0ad; }
.dossier { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; margin: 26px 0 0; }
.file { border: 1px solid #3c5566; text-align: left; background: #0c151e; align-content: start; padding: clamp(5px, 1.7vw, 12px); color: var(--ink); display: grid; grid-template-areas: "name" "art" "story"; gap: 8px; }
.file:hover { border-color: var(--accent); }
.file.real-pilot { border-color: #8e6747; }
.file.real-pilot:hover { border-color: var(--accent); }
.file-photo { grid-area: art; width: 100%; aspect-ratio: 1; position: relative; overflow: hidden; background: repeating-linear-gradient(-45deg, #142a39, #142a39 11px, #1b3446 11px, #1b3446 12px); }
.file-photo img { position: absolute; width: 100%; height: 100%; object-fit: cover; inset: 0; }
.file-title { grid-area: name; font-size: clamp(.6rem, 2.65vw, 1.12rem); line-height: 1.25; min-height: 1.25em; letter-spacing: -.02em; text-align: center; }
.real-pilot .file-title { color: var(--accent); }
.file-story { grid-area: story; color: var(--muted); font-size: .84rem; line-height: 1.35; padding-bottom: 4px; }
.receiver { max-width: 570px; margin: 27px 0 0; padding: 20px; border: 1px solid #395666; background: #09121a; }
.receiver-face { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 12px; background: #13252e; color: var(--muted); }
.receiver-label, .status { font-size: .7rem; }
output { color: var(--ink); font-variant-numeric: tabular-nums; font-size: 2rem; }
.status.locked { color: var(--signal); }
input[type=range] { width: 100%; margin: 20px 0 5px; accent-color: var(--accent); height: 30px; cursor: ew-resize; }
.scale { display: flex; justify-content: space-between; font-size: .66rem; color: var(--muted); }
.control { color: var(--ink); min-width: 44px; min-height: 44px; padding: 7px 11px; border: 1px solid #486171; background: #182a35; font-weight: 700; }
.control:hover { background: #253c48; }
.tuner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; margin: 15px 0 8px; }
.tuner input { margin: 0; }
.radio-audio { margin: 10px 0 0; }
.radio-audio .quiet { min-height: 44px; font: .72rem var(--code); }
#radio-sound-status { color: var(--accent); margin-left: 4px; text-transform: uppercase; }
.location-quiz { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 2.4vw, 22px); margin-top: 25px; }
.location-card { min-width: 0; border: 1px solid #395666; background: #0b151d; }
.location-card > .archive-photo { border-bottom: 1px solid #395666; }
.location-copy { min-width: 0; padding: clamp(12px, 3vw, 22px); }
.location-quiz h2 { font-size: clamp(1.15rem, 4vw, 1.8rem); line-height: 1.15; min-height: 2.3em; }
.location-options { display: grid; gap: 7px; margin: 12px 0 0; }
.location-option { color: var(--ink); background: #152733; border: 1px solid #405e70; min-height: 44px; padding: 7px 10px; text-align: left; }
.location-option:hover { border-color: var(--accent); }
.location-option[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.location-option.correct { border-color: var(--signal); color: var(--signal); }
.location-quiz .feedback { margin-top: 8px; min-height: 1.45em; }
.birthday-burst { max-width: 570px; position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: clamp(10px, 4vw, 22px); margin-top: 15px; padding: 16px; background: radial-gradient(ellipse at 3% 100%, #4a3424, #10212e 67%); border: 1px solid #9c724d; }
.birthday-number { color: #ffd08e; font: 900 clamp(2.8rem, 15vw, 5.4rem)/.9 var(--code); letter-spacing: -.11em; padding-right: .09em; text-shadow: 0 0 28px #faa95765; animation: birthday-50 .62s cubic-bezier(.18, .84, .39, 1.3) both; }
.birthday-copy { position: relative; z-index: 1; animation: birthday-copy .55s .08s both; }
.birthday-copy h2 { color: #fff1db; font-size: clamp(1.15rem, 4vw, 1.8rem); }
.birthday-copy p { font-size: clamp(.78rem, 2.5vw, .91rem); line-height: 1.42; color: #e0d3c4; margin-top: 7px; }
.birthday-confetti { position: absolute; inset: 0; pointer-events: none; }
.birthday-confetti span { display: block; position: absolute; top: 50%; left: 45%; width: 6px; height: 10px; border-radius: 2px; background: #ffc67d; opacity: 0; animation: birthday-confetti .95s cubic-bezier(.12, .68, .25, .98) both; }
.birthday-confetti span:nth-child(3n) { background: #a6e5c3; width: 5px; }
.birthday-confetti span:nth-child(3n + 1) { background: #73b8ea; height: 7px; }
@keyframes birthday-50 { from { transform: translateY(9px) scale(.6); opacity: .25; } to { transform: none; opacity: 1; } }
@keyframes birthday-copy { from { transform: translateX(7px); opacity: .25; } to { transform: none; opacity: 1; } }
@keyframes birthday-confetti { 0% { opacity: 0; transform: scale(.4); } 22% { opacity: .9; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rotate)); } }
.mission-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(12px, 3vw, 24px); align-items: start; margin: 25px 0 0; }
.mission-panel { min-width: 0; padding: clamp(14px, 3vw, 23px); background: #0b151d; border: 1px solid #395666; }
.mission-photo { margin: 0; max-width: 430px; min-width: 0; background: #0b151d; border: 1px solid #395666; }
.archive-photo { position: relative; overflow: hidden; aspect-ratio: 4 / 3; }
.archive-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mission-photo figcaption { padding: 8px 10px; color: #b9c9d5; font-size: .81rem; line-height: 1.45; }
.route-controls { display: grid; gap: 8px; }
.route-option { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 14px; padding: 12px; color: var(--ink); background: #152733; border: 1px solid #405e70; min-height: 47px; text-align: left; }
.route-option small { color: #b4c8d5; font-family: var(--code); }
.route-option:hover { border-color: #bdcfd6; }
.route-option[aria-pressed="true"] { border-color: var(--accent); background: #35291f; }
.feedback { margin-top: 15px; color: #c4d4dc; font-size: .93rem; line-height: 1.45; }
.feedback.success { color: var(--signal); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 20px 0 0; }
.actions .primary { margin: 0; }
.birthday-cassette { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; border-radius: 17px; color: #223848; background: linear-gradient(135deg, #f6fbff, #c7d6df); box-shadow: inset 0 0 0 2px #ffffff70, inset 0 -5px 0 #92a5b2; }
.birthday-cassette .eyebrow { color: #314959; margin-bottom: 8px; font-weight: 750; }
.result-window { background: #dae7ee; border: 2px solid #acbeca; border-radius: 6px; display: flex; justify-content: space-evenly; width: 114px; height: 33px; }
.result-window span { height: 23px; width: 3px; margin: auto 0; background: #8a3365; opacity: 0; }
.birthday-cassette.passed .result-window span { opacity: 1; }
.birthday-cassette.passed .result-window .birthday-line { background: #165b59; }
.test-marks { display: block; margin-top: 8px; font: .68rem var(--code); }
.sample-hole { width: 38px; height: 38px; border-radius: 50%; background: #b0c2d0; border: 5px solid #dbe7ee; box-shadow: inset 0 0 7px #648193; flex: 0 0 auto; }
.test-age-controls { display: flex; gap: 8px; margin-top: 18px; }
.test-age-controls button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.birthday-test-result { border: 1px solid #4d9877; background: #102a26; padding: 12px; margin-top: 14px; line-height: 1.5; }
.birthday-test-result .eyebrow { margin: 0 0 4px; color: #b8e6cf; }
.birthday-test-result strong { display: block; color: var(--signal); font: 900 clamp(1.15rem, 4vw, 1.62rem) var(--code); }
.birthday-test-result > p:last-child { margin-top: 6px; color: #d3e7e0; font-size: .9rem; }
video { display: block; width: 100%; max-width: 780px; background: #060a0e; aspect-ratio: 16/9; margin: 20px 0 0; border: 1px solid var(--line); }
.gift { margin: 26px 0 0; padding: clamp(16px, 3vw, 32px); border: 1px solid #466354; background: linear-gradient(155deg, #182a26, #101819); }
.pilot-id { display: grid; grid-template-columns: minmax(86px, 27%) 1fr; align-items: center; gap: clamp(13px, 3vw, 28px); }
.portrait { display: grid; place-content: center; justify-items: center; gap: 6px; isolation: isolate; position: relative; overflow: hidden; aspect-ratio: 1; background: repeating-linear-gradient(-40deg, #172e31, #172e31 9px, #213a3b 9px, #213a3b 10px); border: 1px solid #587a70; text-align: center; }
.portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.portrait.has-photo img { opacity: 1; }
.file-photo .framed-photo, .portrait .framed-photo, .archive-photo .framed-photo { inset: auto; object-fit: fill; max-width: none; }
.portrait.has-photo span { visibility: hidden; }
.portrait-initial { margin: 0; color: #b2d1bd; font-size: clamp(1.65rem, 5vw, 3.5rem); font-weight: 800; line-height: .95; }
#portrait-label { color: #cadbd3; text-transform: uppercase; font: .58rem var(--code); padding: 0 4px; }
.pilot-id-copy .eyebrow { margin-bottom: 7px; color: #b8cec0; }
.gift h2 { color: var(--signal); font-size: clamp(2rem,7vw,4.5rem); text-transform: uppercase; }
.clearance { color: #d8eade; font-weight: 700; font-size: clamp(.82rem,2.5vw,1.05rem); margin-top: 8px; }
.gift-label { margin: 22px 0 0; }
.sorties { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin: 21px 0; }
.sorties div { padding: 11px 13px; border-top: 1px solid #496558; }
.sorties .eyebrow { color: #c4d7cc; display: block; margin-bottom: 5px; }
.sorties strong { font-size: 1.55rem; }
.family-note { margin-bottom: 20px; }
.family-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 2.5vw, 20px); }
.family-photos .mission-photo { max-width: none; }
#message { color: #d5e3df; line-height: 1.65; }
.signature { margin: 12px 0 22px; font-weight: 700; }
footer { margin-top: 16px; color: var(--muted); text-transform: uppercase; font-size: .65rem; line-height: 1.55; }
footer span:last-child { text-align: right; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media (max-width:550px) {
  .brief { padding-top: 18px; }
  .screen { padding: 24px 18px; }
  .cover { min-height: min(610px, 76svh); }
  .cover-background { background-position: 67% center; }
  .dossier { gap: 6px; }
  .file { gap: 5px; }
  .file-story { font-size: .69rem; }
  .mission-layout, .family-photos, .location-quiz { grid-template-columns: minmax(0, 1fr); }
  .location-quiz h2 { min-height: 0; }
  footer { font-size: .57rem; }
}
@media (prefers-reduced-motion: reduce) {
  .birthday-number, .birthday-copy { animation: none; }
  .birthday-confetti { display: none; }
}
