/* Klein Schiphol. One dark visual world: night-glass panels over a WebGL map.
   Layout: full-bleed canvas, HUD top-left, detail panel under it, aircraft card bottom-centre. */
:root {
  color-scheme: dark;
  --glass: rgba(16, 20, 30, .74);
  --glass-solid: #121722;
  --line: rgba(255, 255, 255, .1);
  --ink: #eef0f4;
  --muted: #98a0b3;
  --oranje: #ff7a1a;       /* accent: selection, demo state */
  --live: #3ee08f;         /* semantic: live data */
  --sky: #5c6470;          /* matches the cloud deck while loading */
  --font: "Familjen Grotesk", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gap: 14px;
  --r: 12px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--sky); color: var(--ink); font: 14px/1.45 var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; opacity: 0; transition: opacity 1.2s ease; }
#gl:active { cursor: grabbing; }
body.ready #gl { opacity: 1; }
#boot { position: fixed; inset: 0; margin: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--ink); font-size: 15px; letter-spacing: .02em; pointer-events: none; }
body.ready #boot { display: none; }
.vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(6, 8, 14, .38) 100%); }
.rain { position: fixed; inset: -40px; pointer-events: none; opacity: 0; background-image: repeating-linear-gradient(104deg, transparent 0 11px, rgba(220, 230, 245, .11) 11px 12px); background-size: 46px 180px; }
body.rain .rain { opacity: 1; animation: rain .45s linear infinite; }
@keyframes rain { to { background-position: -46px 180px; } }

/* aircraft tags */
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; pointer-events: auto; font: 500 10.5px/1 var(--mono); letter-spacing: .03em; color: #10141c; background: rgba(238, 240, 244, .88); border: 0; border-radius: 4px; padding: 3px 5px; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
.tag::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 9px; background: rgba(238, 240, 244, .7); }
.tag.sel { background: var(--oranje); color: #fff; z-index: 2; }
.tag.sel::after { background: var(--oranje); }

/* panels */
.ui { position: fixed; z-index: 3; }
.hud, .panel, .card { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.hud { top: var(--gap); left: var(--gap); width: 252px; padding: 16px 16px 8px; }
.hud header { display: flex; flex-direction: column; gap: 8px; }
.hud-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#btn-menu { display: none; background: none; border: 0; font-size: 18px; padding: 2px 6px; border-radius: 6px; color: var(--muted); }
h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.01em; line-height: 1; }
.status { margin: 0; display: inline-flex; align-items: center; gap: 7px; font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.status i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.status.live { color: var(--live); } .status.live i { background: var(--live); box-shadow: 0 0 0 0 rgba(62, 224, 143, .6); animation: pulse 2s infinite; }
.status.demo { color: var(--oranje); } .status.demo i { background: var(--oranje); }
@keyframes pulse { to { box-shadow: 0 0 0 9px rgba(62, 224, 143, 0); } }
.line { margin: 10px 0 8px; font: 400 12px/1.3 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
nav { display: flex; flex-direction: column; border-top: 1px solid var(--line); margin: 0 -16px; padding: 4px 8px 0; }
button { font: inherit; color: inherit; cursor: pointer; }
nav button { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: none; border: 0; border-radius: 8px; padding: 9px 8px; text-align: left; font-weight: 500; }
nav button:hover, nav button[aria-expanded="true"] { background: rgba(255, 255, 255, .08); }
nav button b, nav button span { font: 400 12px var(--mono); color: var(--muted); }
nav button[aria-pressed="true"] { color: var(--oranje); } nav button[aria-pressed="true"] b { color: var(--oranje); }
button:focus-visible, a:focus-visible, tr:focus-visible { outline: 2px solid var(--oranje); outline-offset: 2px; }
[hidden] { display: none !important; }

.panel { top: var(--gap); left: calc(252px + 2 * var(--gap)); width: min(380px, calc(100vw - 252px - 3 * var(--gap))); max-height: calc(100% - 2 * var(--gap)); display: flex; flex-direction: column; }
.panel header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
h2 { margin: 0; font-size: 16px; font-weight: 600; text-wrap: balance; }
#panel-x, #card-x { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
#panel-x:hover, #card-x:hover { color: var(--ink); background: rgba(255, 255, 255, .08); }
#panel-body { overflow-y: auto; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
#panel-body p { margin: 0; max-width: 62ch; }
a { color: var(--ink); text-decoration-color: var(--oranje); text-underline-offset: 3px; }
.small { font-size: 12.5px; color: var(--muted); }
.atis { font: 400 12.5px/1.6 var(--mono); background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
table { width: 100%; border-collapse: collapse; font: 400 12px/1.3 var(--mono); font-variant-numeric: tabular-nums; }
th { text-align: left; font: 600 10.5px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 2px 6px 8px; }
td { padding: 7px 6px; border-top: 1px solid var(--line); vertical-align: top; }
tbody tr { cursor: pointer; } tbody tr:hover { background: rgba(255, 255, 255, .06); }
td i, .card-top i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; }
dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
dl div { background: var(--glass-solid); padding: 8px 10px; min-width: 0; }
dt { font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
dd { margin: 2px 0 0; font: 500 13px var(--mono); overflow-wrap: anywhere; }

.card { left: 50%; bottom: var(--gap); transform: translateX(-50%); width: min(360px, calc(100vw - 2 * var(--gap))); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card-top { display: flex; align-items: flex-start; gap: 10px; }
.card-top i { width: 10px; height: 34px; border-radius: 3px; margin: 2px 0 0; flex: none; }
.card-top div { flex: 1; min-width: 0; }
.card h2 { font: 600 18px/1.1 var(--mono); letter-spacing: .02em; }
.card p { margin: 2px 0 0; color: var(--muted); }
.card .phase { color: var(--ink); font-weight: 500; border-left: 3px solid var(--oranje); padding-left: 9px; margin: 0; }
#card-follow { background: rgba(255, 255, 255, .08); border: 1px solid var(--line); border-radius: 8px; padding: 9px; font-weight: 600; }
#card-follow:hover { background: rgba(255, 255, 255, .14); }
#card-follow[aria-pressed="true"] { background: var(--oranje); border-color: var(--oranje); color: #fff; }

.zoom { right: var(--gap); bottom: 38px; display: flex; flex-direction: column; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.zoom button { width: 38px; height: 36px; background: none; border: 0; font-size: 17px; }
.zoom button + button { border-top: 1px solid var(--line); }
.zoom button:hover { background: rgba(255, 255, 255, .1); }
.credit { right: var(--gap); bottom: 10px; margin: 0; font-size: 10.5px; color: rgba(238, 240, 244, .6); text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.toast { position: fixed; z-index: 4; left: 50%; top: 18px; transform: translateX(-50%); background: var(--oranje); color: #fff; font-weight: 600; padding: 9px 16px; border-radius: 99px; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); max-width: calc(100vw - 32px); text-align: center; }
.tv-hint { display: none; position: fixed; z-index: 4; left: 50%; bottom: 18px; transform: translateX(-50%); margin: 0; font-size: 12px; color: #fff; background: rgba(10, 12, 18, .6); padding: 6px 12px; border-radius: 99px; }
body.tv .ui { display: none; }
body.tv .tv-hint { display: block; animation: fade 1s 4s forwards; }
@keyframes fade { to { opacity: 0; } }

@media (max-width: 760px) {
  .hud { width: 216px; padding: 12px 12px 6px; }
  nav { margin: 0 -12px; display: none; }
  .hud.open nav { display: flex; }
  .hud:not(.open) { padding-bottom: 4px; }
  #btn-menu { display: block; }
  .panel { left: var(--gap); right: var(--gap); top: auto; bottom: var(--gap); width: auto; max-height: 55%; z-index: 5; }
  .card { bottom: 12px; }
  .zoom { bottom: auto; top: var(--gap); }
}
@media (prefers-reduced-motion: reduce) { #gl { transition: none; } .status.live i, body.rain .rain, body.tv .tv-hint { animation: none; } }
