/* Fly Over Idaho (fly.html): full-screen canvas, story cards, flight panel, HUD. Loaded after site.css. */
html, body.fly { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.fly { background: #c9cdd2; touch-action: none; }
.fly .site-foot { display: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header: glassy and dark so it reads over fog, sunsets and night alike */
.fly .site-head { position: fixed; left: 0; right: 0; background: rgba(14,18,24,.28); border-bottom-color: rgba(255,255,255,.08); }
.fly .site-head .nm { color: #fff; }
.fly .site-head .nav a { color: #dfe5ea; }
.fly .site-head .nav a:hover { color: #fff; background: rgba(255,255,255,.1); }
.fly .site-head .world-btn { color: #f0b45a; border-color: rgba(232,162,58,.6); }
.fly .site-head .menu summary { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; }
.fly .site-head .menu[open] summary { background: #fff; color: #15181d; }

.fly-main { position: fixed; inset: 0; }
#fly-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; outline: none; }
#fly-canvas:active { cursor: grabbing; }

/* ---------- story cards ---------- */
.story { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; text-align: center; padding: 80px 16px 60px; }
.card { grid-area: 1 / 1; color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.25); max-width: 860px;
  opacity: 0; transform: translateY(14px); filter: blur(8px); transition: opacity .9s ease, transform .9s ease, filter .9s ease; }
.card.on { opacity: 1; transform: none; filter: none; }
.card h2 { font: 500 clamp(36px, 6.4vw, 84px)/1.04 var(--serif); letter-spacing: -.03em; margin: 6px 0; }
.card .small { font: 600 clamp(17px, 2vw, 24px)/1.35 var(--sans); margin: 0; }
.card .chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.card .chips span { padding: 6px 14px; border-radius: 999px; font: 600 14px var(--sans); background: rgba(10,14,20,.35);
  border: 1px solid color-mix(in srgb, var(--c) 70%, transparent); text-shadow: none; }
.card .chips span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 8px; }
.card .open { pointer-events: auto; display: inline-block; margin-top: 22px; padding: 10px 26px; border-radius: 999px; border: 1.5px solid #fff;
  color: #fff; font: 600 15px var(--sans); background: rgba(255,255,255,.08); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: background .2s, color .2s; text-shadow: none; cursor: pointer; }
.card:not(.on) .open { pointer-events: none; }
.card .open:hover, .card .open:focus-visible { background: #fff; color: #15181d; }
.card .start { font-size: 18px; padding: 12px 40px; }

.cue { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; text-shadow: 0 1px 8px rgba(0,0,0,.4);
  display: flex; flex-direction: column; align-items: center; gap: 8px; transition: opacity .6s; pointer-events: none; }
.cue i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: flyCue 2s infinite; }
.cue.gone { opacity: 0; }
@keyframes flyCue { 0% { transform: translateY(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(16px); opacity: 0; } }
.skip-story { position: absolute; right: 18px; bottom: 20px; padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,.5);
  background: rgba(10,14,20,.25); color: #fff; font: 600 13px var(--sans); cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.skip-story:hover { background: rgba(10,14,20,.5); }

/* ---------- flight UI ---------- */
.hud, .help { position: absolute; opacity: 0; pointer-events: none; transition: opacity .8s; }
.flying .hud { opacity: 1; }
.flying .help:not(.gone) { opacity: 1; }
.flying .cue, .flying .skip-story, .flying .story { display: none; }
.hud { right: 18px; bottom: 20px; display: flex; gap: 14px; padding: 8px 14px; border-radius: 10px; background: rgba(10,14,20,.38);
  color: #cfe9d6; font: 500 13px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hud b { color: #fff; font-weight: 600; }
.help { left: 50%; bottom: 70px; transform: translateX(-50%); margin: 0; padding: 8px 16px; border-radius: 999px; background: rgba(10,14,20,.4);
  color: #fff; font-size: 14px; line-height: 1.35; text-align: center; width: max-content; max-width: min(420px, calc(100vw - 32px)); border-radius: 18px; }

/* panel: bottom left, glassy; collapses to its button bar */
.fpanel { position: absolute; left: 16px; bottom: 16px; width: min(360px, calc(100vw - 32px)); border-radius: 16px; color: #fff;
  background: rgba(12,16,22,.42); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 10px 40px rgba(0,0,0,.18); transition: opacity .4s; }
.fp-bar { display: flex; align-items: center; gap: 6px; padding: 8px; }
.fp-bar .fp-link { margin-left: auto; margin-right: 6px; display: none; }
.flying .fp-bar .fp-link { display: block; }
.fp-gauges { display: none; }
.cockpit .fp-gauges { display: grid; }
.cockpit:not(.gauges-off) .fp-gauges { background: #fff; color: #15181d; }
.fp-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 0; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; }
.fp-btn:hover { background: rgba(255,255,255,.2); }
#fp-sound .on, #fp-sound[aria-pressed="true"] .off { display: none; }
#fp-sound[aria-pressed="true"] .on { display: block; }
.fp-body { display: none; padding: 4px 12px 4px; max-height: calc(100vh - 68px - 90px - var(--pb, 0px)); max-height: calc(100svh - 68px - 90px - var(--pb, 0px)); overflow-y: auto; }
.panel-open .fp-body { display: block; }
.panel-open #fp-toggle { background: #fff; color: #15181d; }
.fp-row { margin-top: 10px; }
.fp-row.fly-only { display: none; }
.flying .fp-row.fly-only { display: block; }
.fp-l { display: block; font: 600 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.7); margin-bottom: 6px; }
.fp-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.fp-opts button { padding: 7px 4px; border-radius: 8px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.06);
  color: #fff; font: 500 13px var(--sans); cursor: pointer; transition: background .2s, color .2s; }
.fp-opts button:hover { background: rgba(255,255,255,.16); }
.fp-opts button[aria-pressed="true"] { background: #fff; color: #15181d; border-color: #fff; font-weight: 600; }
.flying .fp-row.fp-split { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fp-check, .fp-speed { display: flex; align-items: center; gap: 8px; font: 500 14px var(--sans); cursor: pointer; }
.fp-check input { width: 18px; height: 18px; accent-color: #f0b45a; }
.fp-speed input { width: 130px; accent-color: #f0b45a; }
.fp-link { border: 0; background: none; color: rgba(255,255,255,.85); font: 500 13px var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 0; }

/* cockpit view: instrument panel along the bottom (js/fly/instruments.js); the flight panel moves up above it */
.gauges { position: absolute; left: 0; bottom: 0; width: 100%; display: none; pointer-events: none; }
.cockpit:not(.gauges-off) .gauges { display: block; }
.cockpit:not(.gauges-off) .hud { display: none; }
.cockpit:not(.gauges-off) .fpanel { bottom: calc(var(--ph, 200px) + 10px); }
.cockpit:not(.gauges-off) { --pb: var(--ph, 200px); }
.cockpit:not(.gauges-off) .help { bottom: calc(var(--ph, 200px) + 14px); }

/* the eye button: hide everything but the view */
.clean .story, .clean .hud, .clean .help, .clean .cue, .clean .skip-story, .clean .site-head { opacity: 0 !important; pointer-events: none !important; }
.clean .fpanel { opacity: .35; }
.clean .fpanel:hover { opacity: 1; }

/* fade in once the first frame is drawn; messages */
.fly-main::after { content: ""; position: absolute; inset: 0; background: #c9cdd2; pointer-events: none; transition: opacity 1.4s ease; }
.ready .fly-main::after { opacity: 0; }
.fly-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; font-size: 18px; color: #15181d; background: #c9cdd2; z-index: 5; }
.fly-msg a { text-decoration: underline; margin-left: 6px; }
.nogl { display: none; }
.no-webgl .nogl { display: grid; }

/* airstrip direction, notices, ground warning */
.hud-strip i { display: inline-block; font-style: normal; color: #f0b45a; transition: transform .25s; }
.notice { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); margin: 0; padding: 9px 18px; border-radius: 12px; max-width: min(560px, calc(100vw - 32px));
  background: rgba(10,14,20,.5); color: #fff; font-size: 15px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .6s;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.notice.on { opacity: 1; }
/* place name that fades in over the long river (same lettering as the story cards) */
.placename { position: absolute; left: 50%; top: 24%; transform: translate(-50%, 8px); margin: 0; width: max-content; max-width: calc(100vw - 32px); text-align: center;
  font: 500 clamp(30px, 5vw, 64px)/1.08 var(--serif); letter-spacing: -.02em; color: #fff; text-shadow: 0 2px 24px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.4);
  opacity: 0; pointer-events: none; transition: opacity 1.6s ease, transform 1.6s ease; }
.placename.on { opacity: 1; transform: translate(-50%, 0); }
.crashed .placename, .clean .placename { opacity: 0 !important; }
.pullup { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); margin: 0; padding: 6px 18px; border: 2px solid #ff4b3e; border-radius: 8px;
  color: #ff4b3e; font: 700 22px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .2em; background: rgba(20,0,0,.25); display: none; pointer-events: none; }
.flying.warn .pullup { display: block; animation: pullup .5s steps(2) infinite; }
@keyframes pullup { 50% { opacity: 0; } }
.fp-wide { width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid rgba(240,180,90,.6); background: rgba(240,180,90,.14); color: #fff;
  font: 600 14px var(--sans); cursor: pointer; }
.fp-wide:hover { background: rgba(240,180,90,.3); }

/* the crash: cracked windshield (cockpit), shaking panel, the card */
.crack { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 1s; }
.crash-cockpit .crack { opacity: 1; transition: none; }
.crash-cockpit .gauges { animation: crashShake .09s 12 linear; }
@keyframes crashShake { 25% { transform: translate(-6px, 4px) rotate(-.6deg); } 75% { transform: translate(5px, -3px) rotate(.5deg); } }
.crashed .hud, .crashed .help, .crashed .notice { opacity: 0 !important; }
.crash-box { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -40%); text-align: center; color: #fff; width: min(640px, calc(100vw - 32px));
  text-shadow: 0 2px 24px rgba(0,0,0,.5), 0 1px 3px rgba(0,0,0,.4); opacity: 0; pointer-events: none; transition: opacity .8s, transform .8s; }
.crash-card .crash-box { opacity: 1; transform: translate(-50%, -50%); pointer-events: auto; }
.crash-box h2 { font: 500 clamp(30px, 5vw, 60px)/1.06 var(--serif); letter-spacing: -.02em; margin: 6px 0 10px; }
.crash-box .small { font: 600 clamp(15px, 1.8vw, 20px)/1.35 var(--sans); margin: 0; }
.crash-box .open { margin-top: 22px; padding: 12px 40px; border-radius: 999px; border: 1.5px solid #fff; background: rgba(10,14,20,.3); color: #fff;
  font: 600 18px var(--sans); cursor: pointer; }
.crash-box .open:hover, .crash-box .open:focus-visible { background: #fff; color: #15181d; }

/* desktop: centre the hint in the space right of the flight panel so the panel never covers it */
@media (min-width: 761px) { .help { left: calc(50% + 188px); max-width: min(420px, calc(100vw - 420px)); } }
@media (max-width: 760px) {
  .notice { top: 118px; font-size: 14px; }
  .hud { top: 80px; bottom: auto; right: 12px; left: 12px; gap: 4px 10px; font-size: 12px; flex-wrap: wrap; justify-content: center; }
  .placename { top: 30%; }
  .help { bottom: 76px; font-size: 13px; }
  .fpanel { left: 12px; bottom: 12px; }
  .skip-story { bottom: 14px; right: 12px; }
  .cue { bottom: 70px; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: opacity .3s; filter: none; transform: none; } .cue i { animation: none; } }
