/* HD_steve — field survey instrument
   ink & phosphor; grid paper; hard pixel edges                            */

:root {
  --ink:      #0a0c0b;
  --ink-2:    #10130f;
  --ink-3:    #161a15;
  --grid:     rgba(232,228,217,.045);
  --line:     rgba(232,228,217,.14);
  --chalk:    #e9e5da;
  --dim:      #8b9184;
  --dimmer:   #5d635a;
  --amber:    #f0a63a;
  --orange:   #ff6b35;
  --moss:     #7fa06a;
  --live:     #7ee081;
  --dead:     #b8503c;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --disp: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(20,26,20,.55), transparent 60%),
    repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 32px),
    radial-gradient(120% 90% at 50% -10%, #1a2119 0%, var(--ink) 55%);
  background-attachment: fixed;
  color: var(--chalk);
  font-family: var(--mono);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* film grain */
.grain {
  position: fixed; inset: 0; z-index: 999; pointer-events: none; opacity: .28;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 88px; }

/* ── masthead ─────────────────────────────────────────────── */
.masthead {
  max-width: 1180px; margin: 0 auto;
  padding: clamp(28px, 5vw, 52px) clamp(16px, 4vw, 40px) clamp(20px, 3vw, 32px);
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.compass {
  color: var(--orange); font-size: 22px; line-height: 1;
  animation: spin 24s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.masthead h1 {
  font-family: var(--disp);
  font-variation-settings: "SOFT" 0, "WONK" 1, "opsz" 120;
  font-weight: 600;
  font-size: clamp(34px, 6vw, 58px);
  letter-spacing: -.03em;
  line-height: .9;
  color: var(--chalk);
}
.tagline { color: var(--dim); font-size: 12px; letter-spacing: .04em; }
.world { color: var(--moss); }

.status {
  display: flex; align-items: center; gap: 9px;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line);
  padding: 7px 13px;
  background: rgba(10,12,11,.6);
}
.status .dot {
  width: 7px; height: 7px; background: var(--dimmer);
  box-shadow: 0 0 0 0 rgba(126,224,129,.6);
}
.status.live .dot { background: var(--live); animation: ping 2.4s ease-out infinite; }
.status.live { color: var(--chalk); border-color: rgba(126,224,129,.35); }
.status.dead .dot { background: var(--dead); }
@keyframes ping {
  0%   { box-shadow: 0 0 0 0 rgba(126,224,129,.55); }
  70%  { box-shadow: 0 0 0 8px rgba(126,224,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(126,224,129,0); }
}
.ago { color: var(--dimmer); letter-spacing: .08em; }

/* ── viewport ─────────────────────────────────────────────── */
.viewport-wrap { position: relative; padding: 22px 0 0 26px; }

.ticks { position: absolute; pointer-events: none; }
.ticks-x {
  top: 0; left: 26px; right: 0; height: 14px;
  background-image: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 40px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticks-y {
  left: 0; top: 22px; bottom: 0; width: 14px;
  background-image: repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px 40px);
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(180deg, transparent, #000 8%, #000 92%, transparent);
}

.viewport {
  position: relative;
  background: var(--ink-2);
  border: 1px solid var(--line);
  overflow: hidden;
  aspect-ratio: 10 / 7;
  box-shadow: 0 40px 90px -50px #000, inset 0 0 120px rgba(0,0,0,.55);
}
.viewport img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  image-rendering: pixelated;
  filter: saturate(1.06) contrast(1.04);
}
.viewport img[hidden] { display: none; }

.crosshair { position: absolute; inset: 0; pointer-events: none; opacity: .5; }
.crosshair i {
  position: absolute; background: rgba(240,166,58,.5);
}
.crosshair i:first-child { left: 50%; top: calc(50% - 9px); width: 1px; height: 18px; }
.crosshair i:last-child  { top: 50%; left: calc(50% - 9px); height: 1px; width: 18px; }

.scan {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(240,166,58,.07) 50%, transparent 100%);
  height: 42%;
  animation: sweep 7s cubic-bezier(.4,0,.6,1) infinite;
}
@keyframes sweep { 0% { transform: translateY(-110%); } 100% { transform: translateY(340%); } }

.bracket { position: absolute; width: 13px; height: 13px; pointer-events: none; border: 0 solid var(--amber); opacity: .75; }
.bracket.tl { top: 7px; left: 7px;  border-top-width: 1px; border-left-width: 1px; }
.bracket.tr { top: 7px; right: 7px; border-top-width: 1px; border-right-width: 1px; }
.bracket.bl { bottom: 7px; left: 7px;  border-bottom-width: 1px; border-left-width: 1px; }
.bracket.br { bottom: 7px; right: 7px; border-bottom-width: 1px; border-right-width: 1px; }

.nosignal {
  position: absolute; inset: 0; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.028) 0 2px, transparent 2px 4px),
    var(--ink-2);
  color: var(--dead);
  letter-spacing: .4em; font-size: 13px; text-indent: .4em;
  animation: flicker 4s steps(2) infinite;
}
.nosignal small { color: var(--dimmer); letter-spacing: .08em; text-indent: 0; font-size: 11px; }
.nosignal.show { display: flex; }
@keyframes flicker { 0%,96%,100% { opacity: 1; } 97% { opacity: .55; } }

.hud {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; gap: 26px; flex-wrap: wrap;
  padding: 11px 16px;
  background: linear-gradient(0deg, rgba(6,8,7,.92), rgba(6,8,7,.35) 70%, transparent);
  font-size: 11px; letter-spacing: .08em;
}
.hud b { color: var(--dimmer); font-weight: 400; letter-spacing: .18em; margin-right: 7px; }
.hud em { font-style: normal; color: var(--chalk); }

/* ── directive ────────────────────────────────────────────── */
.label {
  font-family: var(--mono); font-weight: 400;
  font-size: 10px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--dimmer);
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px;
}
.label::before { content: ""; width: 16px; height: 1px; background: var(--orange); display: inline-block; }
.label .sub { letter-spacing: .06em; text-transform: none; color: var(--dimmer); opacity: .7; }

.directive { margin-top: 46px; }
.goal {
  font-family: var(--disp);
  font-variation-settings: "SOFT" 40, "WONK" 0, "opsz" 90;
  font-weight: 400; font-size: clamp(19px, 2.5vw, 27px); line-height: 1.35;
  letter-spacing: -.015em;
  color: var(--chalk);
  max-width: 62ch;
  border-left: 2px solid var(--amber);
  padding-left: 20px;
}
.log { list-style: none; margin-top: 22px; display: grid; gap: 7px; max-width: 78ch; }
.log li {
  display: grid; grid-template-columns: 62px 1fr; gap: 14px;
  font-size: 12.5px; color: var(--dim);
  padding: 7px 0; border-top: 1px solid rgba(232,228,217,.07);
}
.log time { color: var(--dimmer); font-size: 11px; letter-spacing: .06em; }
.log .req { color: var(--orange); }

/* ── split panels ─────────────────────────────────────────── */
.split {
  margin-top: 54px;
  display: grid; gap: 34px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.map-frame {
  position: relative; background: var(--ink-2);
  border: 1px solid var(--line); aspect-ratio: 1;
  overflow: hidden;
}
.map-frame img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  image-rendering: pixelated; opacity: .95;
}

.atlas { list-style: none; display: grid; gap: 1px; background: rgba(232,228,217,.07); border: 1px solid var(--line); }
.atlas li { background: var(--ink); padding: 12px 15px; }
.atlas li.empty { color: var(--dimmer); font-size: 12px; }
.atlas .row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.atlas .nm { color: var(--chalk); font-size: 13px; letter-spacing: .02em; }
.atlas .ty {
  font-size: 9px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink); background: var(--moss); padding: 2px 7px; white-space: nowrap;
}
.atlas .ty[data-t="unexplored"] { background: var(--orange); }
.atlas .ty[data-t="home"]  { background: var(--amber); }
.atlas .ty[data-t="town"]  { background: #6f8fb0; }
.atlas .co { color: var(--dimmer); font-size: 11px; letter-spacing: .05em; margin-top: 3px; }
.atlas .nt { color: var(--dim); font-size: 11.5px; margin-top: 5px; line-height: 1.5; }

/* ── capability log ───────────────────────────────────────── */
.panel.wide { margin-top: 54px; }
.caps { list-style: none; display: grid; gap: 0; }
.caps li {
  display: grid; grid-template-columns: 46px 1fr; gap: 16px; align-items: baseline;
  padding: 10px 0; border-top: 1px solid rgba(232,228,217,.07);
  font-size: 13px; color: var(--dim);
}
.caps li:hover { color: var(--chalk); }
.caps li:hover .v { color: var(--orange); border-color: var(--orange); }
.caps .v {
  font-size: 10px; letter-spacing: .1em; color: var(--dimmer);
  border: 1px solid var(--line); padding: 2px 0; text-align: center;
  transition: color .2s, border-color .2s;
}
.caps li.empty { grid-template-columns: 1fr; color: var(--dimmer); font-size: 12px; }

/* ── about ────────────────────────────────────────────────── */
.about { margin-top: 64px; max-width: 68ch; }
.about p { color: var(--dim); font-size: 13.5px; margin-bottom: 14px; }
.about .hl { color: var(--amber); }
.about .fine { color: var(--dimmer); font-size: 12px; border-left: 1px solid var(--line); padding-left: 16px; }

footer {
  border-top: 1px solid rgba(232,228,217,.07);
  max-width: 1180px; margin: 0 auto;
  padding: 22px clamp(16px, 4vw, 40px) 40px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  color: var(--dimmer); font-size: 11px; letter-spacing: .04em;
}
.pulse { color: var(--moss); animation: fade 3.6s ease-in-out infinite; }
@keyframes fade { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

/* ── entrance ─────────────────────────────────────────────── */
.reveal { animation: up .8s cubic-bezier(.16,1,.3,1) both; animation-delay: var(--d, 0ms); }
@keyframes up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
