:root {
  color-scheme: dark;
  --bg: #030909;
  --ink: #70f995;
  --bright: #9affb1;
  --muted: #599d72;
  --line: #2a6940;
  --gutter: clamp(24px, 4.8vw, 92px);
  --top: calc(clamp(12px, 2.8vh, 32px) + env(safe-area-inset-top));
  --baseline: calc(clamp(14px, 3vh, 36px) + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 "Obcoro Display Pixel", monospace;
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, p { margin: 0; }
body {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: var(--top) calc(var(--gutter) + env(safe-area-inset-right)) var(--baseline) calc(var(--gutter) + env(safe-area-inset-left));
}
button, a { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
button { padding: 0; border: 0; border-radius: 0; background: transparent; cursor: var(--ob-cursor-pointer, pointer); }
a { text-decoration: none; }
:focus-visible { outline: 2px solid var(--bright); outline-offset: 2px; }
#space { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
header, main { position: relative; min-width: 0; }
header { display: flex; align-items: center; justify-content: flex-end; }
.corner-nav { display: flex; }
.corner-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 clamp(12px, 1.45vw, 27px);
  white-space: nowrap;
}
.corner-nav a + a { background: linear-gradient(var(--line), var(--line)) no-repeat left center / 1px 12px; }
.corner-nav a:last-child { padding-right: 5px; }
.corner-nav svg {
  width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4;
}
.corner-nav a:is(:hover, :focus-visible) { color: var(--bright); background-color: #0b2016; }
.corner-nav a[aria-current] { background-color: rgb(20 61 40 / .56); color: var(--bright); }
.corner-nav a[aria-current]::after {
  content: ""; position: absolute; bottom: 3px; left: calc(50% - 8px); width: 16px; height: 2px;
  background: var(--ink);
}

main { display: flex; flex-direction: column; min-height: 0; padding-top: clamp(4px, 1.6vh, 18px); }
.sky-heading {
  display: flex; align-items: center; gap: 14px; flex: none; min-height: 52px;
  margin-bottom: 4px; border-bottom: 1px solid rgb(88 156 111 / .26);
}
h1 { font-size: clamp(25px, 2.6vw, 39px); font-weight: 400; line-height: 1.15; color: var(--bright); }
#sky-list {
  display: inline-flex; gap: 6px; align-items: center; min-height: 44px; margin-left: auto;
  color: var(--ink); font-size: 15px; text-decoration: underline; text-underline-offset: 5px;
}
#sky-list span { color: var(--muted); }
#sky-list:hover { color: var(--bright); }
#sky-status { color: var(--bright); font-size: 15px; }
.sky-window {
  position: relative; flex: 1 1 0; min-height: 0; overflow: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.beacons { --aura: 136 230 174; position: relative; width: 100%; min-height: 100%; overflow: clip; isolation: isolate; }
.beacons [data-tone="1"] { --aura: 142 212 221; --tilt: -7deg; }
.beacons [data-tone="2"] { --aura: 214 211 151; --tilt: 15deg; }
#sky-paths { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#sky-paths polyline { fill: none; stroke: rgb(var(--aura) / .48); stroke-width: 1; stroke-linejoin: round; }
.beacon {
  --hud-frame-size: 26px;
  --core-row: 26px;
  --light: rgb(var(--aura));
  --phase: -1.4s;
  position: absolute;
  left: var(--x); top: var(--y);
  transform: translate(-50%, -50%);
  display: grid; grid-template-rows: var(--core-row) 1fr; justify-items: center; align-items: center;
  width: max-content; max-width: var(--beacon-max, 100%); min-width: 46px; min-height: 48px;
  padding-inline: 2px;
  color: var(--ink);
  touch-action: manipulation;
}
.beacon[data-tone] { --flare: 25px; }
.beacon-core {
  grid-row: 1; position: relative; display: grid; place-items: center;
  width: var(--flare, 19px); height: var(--flare, 19px); transform: rotate(var(--tilt, 8deg)); pointer-events: none;
}
.beacon-core::before, .beacon-core::after { content: ""; position: absolute; }
.beacon-core::before {
  inset: -10% 0;
  background: radial-gradient(ellipse closest-side, #f2fff5 5%, var(--light) 25%, rgb(var(--aura) / .7) 58%, rgb(var(--aura) / .08));
  clip-path: polygon(50% 0, 52% 36%, 56% 45%, 65% 48%, 100% 50%, 64% 52%, 55% 56%, 52% 65%, 50% 100%, 48% 64%, 44% 55%, 35% 52%, 0 50%, 36% 48%, 45% 44%, 48% 35%);
}
.beacon-core::after {
  width: 3px; height: 3px; border-radius: 50%; background: #f2fff4;
  box-shadow: 0 0 4px var(--light), 0 0 10px rgb(var(--aura) / .9);
}
.beacon-pulse {
  position: absolute; inset: -110%; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(var(--aura) / .53), rgb(var(--aura) / .17) 22%, rgb(var(--aura) / .045) 53%, transparent);
  opacity: .74;
}
.beacon-name {
  max-width: 100%; min-width: 0; overflow-wrap: anywhere; text-align: center;
  color: #b4cebf; font-size: 16px; line-height: 1.3;
  -webkit-text-stroke: 3px var(--bg); paint-order: stroke fill; text-shadow: 0 0 6px var(--bg);
}
.beacon[data-locked] .beacon-name { color: var(--bright); }
footer {
  z-index: 1; min-width: 0;
  border-top: 1px solid var(--line); padding-top: clamp(12px, 1.8vh, 24px);
  color: var(--muted); font-size: 14px; line-height: 1.45;
}
footer .studio { color: #a2c5ac; font-size: 16px; margin-bottom: 3px; display: flex; align-items: center; gap: 10px; }
.studio span { width: 12px; height: 10px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px); transform: skew(-20deg); }

@media (max-width: 760px) {
  :root {
    --gutter: clamp(14px, 4.6vw, 30px);
    --top: calc(8px + env(safe-area-inset-top));
    --baseline: calc(12px + env(safe-area-inset-bottom));
  }
  .corner-nav a { gap: 4px; padding: 0 clamp(3px, 1.4vw, 11px); }
  .corner-nav svg { width: 16px; height: 16px; }
  main { padding-top: 3px; }
  .sky-heading { min-height: 45px; }
  .beacon-name { font-size: 14px; line-height: 1.15; }
  footer { line-height: 1.35; }
  footer .studio { font-size: 14px; gap: 6px; }
  footer p + p span { display: block; }
}
@media (max-height: 480px) {
  :root { --top: env(safe-area-inset-top); --baseline: env(safe-area-inset-bottom); }
  main, footer { padding-top: 0; }
}
