:root {
  --ink: #050402;
  --panel: rgba(8, 6, 2, .92);
  --amber: #ff8a00;
  --amber-2: #ffb000;
  --amber-dim: #9d5500;
  --amber-faint: rgba(255, 138, 0, .18);
  --green: #a7c900;
  --red: #ff4a16;
  --line: rgba(255, 138, 0, .46);
  --mono: "IBM Plex Mono", monospace;
  --display: "Teko", sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--amber);
  font-family: var(--mono);
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,138,0,.018) 3px 4px),
    radial-gradient(circle at 52% 30%, rgba(120,62,0,.09), transparent 42rem),
    #030302;
  letter-spacing: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  background: linear-gradient(rgba(18,16,10,0) 50%, rgba(0,0,0,.12) 50%);
  background-size: 100% 4px;
  mix-blend-mode: multiply;
  opacity: .55;
}

a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }

.terminal-shell {
  width: min(1920px, calc(100% - 20px));
  margin: 10px auto;
  min-height: calc(100vh - 20px);
  display: grid;
  grid-template-columns: 252px minmax(620px, 1fr) 350px;
  gap: 10px;
}

.frame {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px rgba(255,138,0,.06), 0 0 18px rgba(255,91,0,.035);
}

.rail {
  position: sticky;
  top: 10px;
  height: calc(100vh - 20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand-block { padding: 22px 18px 18px; }
.brand-mark {
  font-family: var(--display);
  font-size: 7.8rem;
  line-height: .72;
  font-weight: 700;
  color: var(--amber);
  text-shadow: 0 0 6px rgba(255,111,0,.8), 3px 0 rgba(255,60,0,.2);
  filter: contrast(1.1);
}
.brand-name {
  margin-top: 22px;
  font: 500 2rem/1.12 var(--display);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.rail-nav { padding: 6px 12px 14px; display: grid; gap: 2px; }
.rail-nav a {
  min-height: 31px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  text-decoration: none;
  text-transform: uppercase;
  font-size: .77rem;
  font-weight: 700;
  border-left: 2px solid transparent;
}
.rail-nav a::before { content: ">"; color: transparent; }
.rail-nav a:hover, .rail-nav a.active { color: #140900; background: var(--amber); border-left-color: #ffd06a; }
.rail-nav a:hover::before, .rail-nav a.active::before { color: #140900; }

.rail-section { margin: 0 12px; padding: 13px 5px; border-top: 1px solid var(--line); }
.rail-title, .panel-title, .table-title, .mini-label { text-transform: uppercase; font-weight: 700; }
.rail-title { color: var(--amber-2); font-size: .68rem; margin-bottom: 10px; }
.status-row { display: grid; grid-template-columns: 1fr auto 8px; gap: 7px; align-items: center; font-size: .59rem; margin: 9px 0; }
.status-row .value { color: var(--green); }
.led { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.load-row { display: flex; justify-content: space-between; align-items: end; }
.load-row b { color: var(--green); font-size: 1.1rem; }
.load-meter { height: 8px; margin-top: 5px; border: 1px solid var(--amber-dim); padding: 1px; }
.load-meter i { display: block; width: 42%; height: 100%; background: repeating-linear-gradient(90deg,var(--green) 0 3px,transparent 3px 5px); }

.clock-block { margin-top: auto; padding: 14px 17px 20px; border-top: 1px solid var(--line); }
.clock-zone { color: var(--amber-2); font-size: .68rem; }
.clock-time { font: 500 2.5rem/.95 var(--display); color: var(--amber); margin: 9px 0 5px; }
.clock-date { font-size: .69rem; color: var(--amber-2); text-transform: uppercase; }

.center-column { min-width: 0; display: grid; gap: 10px; align-content: start; }
.telemetry-panel { min-height: 610px; display: flex; flex-direction: column; }
.panel-bar {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  font-size: .68rem;
  text-transform: uppercase;
}
.panel-title { display: flex; align-items: center; gap: 9px; }
.panel-title::before { content: "◎"; font-size: 1rem; }
.live-label { color: var(--green); display: flex; align-items: center; gap: 7px; }
.live-label::before { content:""; width:7px; height:7px; border-radius:50%; background:var(--green); box-shadow:0 0 8px var(--green); animation: blink 1.5s steps(2) infinite; }

.map-stage {
  position: relative;
  min-height: 410px;
  flex: 1;
  overflow: hidden;
  background: #030201;
}
.map-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('/assets/telemetry-world-map.webp') center / contain no-repeat;
  opacity: .94;
  filter: saturate(.92) contrast(1.08);
  transition: opacity .25s ease;
}
.map-stage.map-ready::before { opacity: .08; }
.storm-map { position: absolute; inset: 0; z-index: 1; background: transparent; }
.storm-map.leaflet-container { background: rgba(3,2,1,.36); font-family: var(--mono); }
.base-map-tiles {
  filter: grayscale(1) invert(1) sepia(1) saturate(4.5) hue-rotate(350deg) brightness(.68) contrast(1.32);
  opacity: .9;
  mix-blend-mode: screen;
}
.radar-tiles {
  filter: sepia(1) saturate(5.5) hue-rotate(342deg) brightness(1.3) contrast(1.4);
  mix-blend-mode: screen;
}
.map-controls { position:absolute;z-index:800;top:13px;left:13px;display:grid;gap:4px; }
.map-controls button {
  width:28px;height:28px;padding:0;display:grid;place-items:center;border:1px solid var(--line);
  border-radius:0;background:rgba(4,3,1,.88);color:var(--amber);font-weight:700;line-height:1;
}
.map-controls button:hover { background:var(--amber);color:#130800; }
.map-controls button:focus-visible { outline:2px solid var(--amber-2);outline-offset:2px; }
.map-readout {
  position: absolute;
  z-index: 800;
  top: 13px;
  right: 13px;
  width: 196px;
  border: 1px solid var(--line);
  background: rgba(4,3,1,.86);
  padding: 9px 10px;
  font-size: .62rem;
}
.readout-title { color: var(--amber-2); margin-bottom: 7px; }
.readout-row { display: flex; justify-content: space-between; margin: 4px 0; }
.readout-row b { color: var(--amber-2); }
.signal-legend { position: absolute; z-index:800; left: 13px; bottom: 13px; border: 1px solid var(--line); padding: 8px; background: rgba(4,3,1,.86); font-size: .56rem; pointer-events:none; }
.signal-legend span { display:block; margin:4px 0; }
.signal-legend i { display:inline-block; width:6px; height:6px; border-radius:50%; background:var(--green); margin-right:6px; box-shadow:0 0 7px currentColor; }
.signal-legend span:nth-child(3) i { background:var(--amber-2); }
.signal-legend span:nth-child(4) i { background:var(--red); }
.map-attribution { position:absolute;z-index:800;right:8px;bottom:6px;padding:3px 5px;background:rgba(3,2,1,.78);color:var(--amber-dim);font-size:.48rem; }
.map-attribution a { text-decoration:none; }
.map-attribution a:hover { color:var(--amber-2); }

.hero-copy { border-top: 1px solid var(--line); padding: 16px 20px 13px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 18px; }
.hero-copy h1 { margin: 0; font: 600 clamp(3.4rem,6vw,6rem)/.82 var(--display); text-transform: uppercase; letter-spacing: 0; text-shadow: 0 0 7px rgba(255,102,0,.55); }
.hero-copy p { max-width: 760px; margin: 12px 0 0; color: var(--amber-2); font-size: .68rem; line-height: 1.45; }
.hero-button { display: inline-flex; min-height: 43px; align-items: center; gap: 22px; padding: 0 14px; border: 1px solid var(--amber); text-decoration: none; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.hero-button:hover { background: var(--amber); color: #100700; }

.projects-panel { min-height: 230px; }
.projects-tools { display: flex; align-items: center; gap: 8px; }
.search-input { width: 190px; height: 26px; border: 1px solid var(--amber-dim); background:#050301; color:var(--amber); padding:0 8px; outline:none; font-size:.63rem; }
.search-input:focus { border-color: var(--amber); }
.filter-set { display:flex; gap:3px; }
.filter-button { height:26px; min-width:34px; padding:0 7px; border:1px solid var(--amber-dim); background:transparent; color:var(--amber-dim); font-size:.58rem; text-transform:uppercase; }
.filter-button:hover,.filter-button.active { color:#100700;background:var(--amber);border-color:var(--amber); }

.project-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.project-table th { height:30px; color:var(--amber-dim); font-size:.54rem; text-align:left; border-bottom:1px solid var(--line); text-transform:uppercase; }
.project-table td { border-bottom:1px solid rgba(255,138,0,.24); font-size:.64rem; padding:5px 7px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.project-table th:first-child,.project-table td:first-child { width:46px; text-align:center; }
.project-table th:nth-child(2),.project-table td:nth-child(2){width:30%;}
.project-table th:nth-child(4),.project-table td:nth-child(4){width:88px;}
.project-table th:nth-child(5),.project-table td:nth-child(5){width:72px;}
.project-row { cursor:pointer; }
.project-row:hover { background:rgba(255,138,0,.1); }
.project-row:hover td:nth-child(2) { color:#ffd16c; }
.index-box { border:1px solid var(--amber-dim); padding:3px 5px; color:var(--amber-2); }
.project-name { font-weight:700; }
.project-desc { color:var(--amber-2); opacity:.82; }
.status { color:var(--green); text-transform:uppercase; }
.status::before { content:"";display:inline-block;width:6px;height:6px;border-radius:50%;background:currentColor;margin-right:6px;box-shadow:0 0 6px currentColor; }
.status.sim { color:var(--amber-2); }.status.game { color:#ff5e2d; }
.bars-icon { display:inline-flex;align-items:end;gap:2px;height:14px; }
.bars-icon i { display:block;width:3px;background:var(--green); }
.bars-icon i:nth-child(1){height:4px}.bars-icon i:nth-child(2){height:7px}.bars-icon i:nth-child(3){height:10px}.bars-icon i:nth-child(4){height:13px}
.open-arrow { float:right;font-size:1rem; }
.no-projects { padding:22px;text-align:center;color:var(--amber-dim);font-size:.7rem; }

.news-panel {
  position:sticky;
  top:10px;
  height:calc(100vh - 20px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.news-panel .panel-title::before { content:"⌁"; }
.news-list { margin:0; padding:0 10px; list-style:none; overflow-y:auto; scrollbar-color:var(--amber-dim) #090500; scrollbar-width:thin; }
.news-item { padding:12px 3px 13px; border-bottom:1px solid rgba(255,138,0,.42); }
.news-time { display:block;color:var(--green);font-size:.59rem;margin-bottom:6px; }
.news-title { display:block;color:var(--amber-2);font-size:.69rem;line-height:1.35;text-decoration:none;font-weight:700; }
.news-title:hover { color:#ffd36e; }
.news-summary { color:var(--amber);font-size:.6rem;line-height:1.45;margin:5px 0 0;opacity:.88; }
.news-source { display:block;color:var(--amber-dim);font-size:.54rem;text-transform:uppercase;margin-top:6px; }
.news-footer { margin-top:auto;min-height:40px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 12px;font-size:.63rem;text-transform:uppercase; }
.news-footer button { border:0;background:transparent;color:var(--amber);padding:7px; }
.news-footer button:hover { color:#ffd36e; }

.mobile-bar { display:none; }
.terminal-footer { padding:8px 11px;font-size:.55rem;color:var(--amber-dim);display:flex;justify-content:space-between;gap:10px; }

@keyframes blink { 50% { opacity:.25; } }

@media (max-width: 1250px) {
  .terminal-shell { grid-template-columns: 205px minmax(560px,1fr) 300px; }
  .brand-mark { font-size:6.2rem; }
  .brand-name { font-size:1.6rem; }
  .project-desc { display:none; }
  .project-table th:nth-child(3),.project-table td:nth-child(3){width:1px;padding:0;}
}

@media (max-width: 980px) {
  .terminal-shell { width:min(100% - 12px,900px);grid-template-columns:1fr; }
  .rail { position:relative;top:0;height:auto; }
  .brand-block { display:flex;align-items:center;gap:18px;padding:13px 14px; }
  .brand-mark { font-size:4.3rem;line-height:.7; }
  .brand-name { margin:0;font-size:1.45rem; }
  .rail-nav { display:flex;overflow-x:auto;padding:5px 8px; }
  .rail-nav a { flex:0 0 auto; }
  .rail-section,.clock-block { display:none; }
  .news-panel { position:relative;top:0;height:520px; }
  .center-column { order:2; }.news-panel { order:3; }
}

@media (max-width: 640px) {
  .terminal-shell { margin:6px auto;gap:6px; }
  .telemetry-panel { min-height:auto; }
  .map-stage { min-height:310px; }
  .map-stage::before { background-size:contain; }
  .map-readout { width:145px;font-size:.52rem; }
  .signal-legend { display:none; }
  .map-attribution { font-size:.42rem; }
  .hero-copy { grid-template-columns:1fr;padding:14px; }
  .hero-copy h1 { font-size:clamp(3rem,15vw,4.6rem); }
  .hero-button { justify-content:space-between; }
  .panel-bar.projects-bar { align-items:flex-start;flex-direction:column;padding:9px; }
  .projects-tools { width:100%;flex-direction:column;align-items:stretch; }
  .search-input { width:100%; }
  .filter-set { display:grid;grid-template-columns:repeat(5,1fr); }
  .project-table th:nth-child(3),.project-table td:nth-child(3),.project-table th:nth-child(5),.project-table td:nth-child(5){display:none;}
  .project-table th:nth-child(2),.project-table td:nth-child(2){width:auto;}
  .project-table th:nth-child(4),.project-table td:nth-child(4){width:78px;}
  .project-table td { padding:8px 5px;font-size:.58rem; }
  .news-panel { height:480px; }
}

@media (prefers-reduced-motion:reduce){*{animation:none!important;scroll-behavior:auto!important;}}
