/* Trengrove Orbital — hero masthead, three aligned panels, chart under search */

:root {
  --accent: #ff8c00;      /* headings, markers, links on hover */
  --bright: #ffa033;      /* links, emphasis */
  --fg: #e8bd85;          /* body text — warm but readable */
  --dim: #a97740;         /* secondary text */
  --red: #ff4a36;         /* badges; deeper variant fills the map's home sector */
  --cream: #ecdcc2;       /* name + panel headings */
  --ink: #0a0500;
  --panel: rgba(18, 10, 2, 0.82);
  --line: rgba(255, 140, 0, 0.32);
}

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

html, body { height: 100%; }

body {
  background: var(--ink);
  color: var(--fg);
  font-family: "SF Mono", "Cascadia Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  font-size: 15px;
  line-height: 1.65;
  overflow-x: hidden;
}

#space {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.frame {
  position: relative; z-index: 2;
  max-width: 1160px;
  margin: 0 auto;
  padding: 26px 22px 18px;
  display: flex; flex-direction: column;
  min-height: 100vh;
}

/* masthead: cube + name left, links right */
.masthead {
  display: flex; align-items: center; gap: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
  margin-bottom: 24px;
}
.ident {
  flex: 1;
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 16px; flex-wrap: wrap;
}
.masthead h1 {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(20px, 2.4vw, 27px);
  letter-spacing: 0.05em;
  font-weight: 200;
  color: var(--cream);
}
.masthead nav { display: flex; gap: 22px; }

#cube {
  width: 100px;
  flex-shrink: 0;
  margin: -16px 0;             /* let the glow bleed past the header band */
  mix-blend-mode: screen;      /* black background melts into the page */
  /* fade the frame edge so compression noise never draws a rectangle */
  -webkit-mask-image: radial-gradient(circle at center, #000 52%, transparent 86%);
  mask-image: radial-gradient(circle at center, #000 52%, transparent 86%);
  transition: filter 0.5s;
}
#cube.sweep { filter: brightness(1.4); transition: filter 0.08s; }

/* three aligned panels, chart under search */
.deck {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "search about recent"
    "chart  about recent";
  gap: 18px;
  align-items: start;
  flex: 1;
}
.area-search { grid-area: search; }
.area-about  { grid-area: about; }
.area-recent { grid-area: recent; }
.area-chart  { grid-area: chart; }

.chart img { width: 100%; display: block; }

/* panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 14px 18px 16px;
  position: relative;
}
.panel::before, .panel::after {
  content: ""; position: absolute; width: 9px; height: 9px;
  border: 2px solid var(--accent); pointer-events: none;
}
.panel::before { top: -2px; left: -2px; border-right: 0; border-bottom: 0; }
.panel::after { bottom: -2px; right: -2px; border-left: 0; border-top: 0; }

.panel h2 {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px; letter-spacing: 0.1em; font-weight: 300;
  color: var(--cream);
  border-bottom: 1px dashed var(--line);
  padding-bottom: 7px; margin-bottom: 12px;
}

.panel p { margin-bottom: 8px; }
.panel p:last-child { margin-bottom: 0; }

a { color: var(--bright); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--dim); }
a:hover { color: #ffc266; text-decoration-color: var(--bright); }

/* feeds */
.feed { list-style: none; }
.feed li {
  display: flex; gap: 12px; align-items: baseline;
  margin-bottom: 14px;
}
.feed li:last-child { margin-bottom: 0; }
.feed p { color: var(--dim); font-size: 13.5px; margin: 2px 0 0; }
.stamp {
  flex-shrink: 0;
  font-size: 11px; color: var(--red);
  border: 1px solid rgba(255, 74, 54, 0.38); padding: 0 6px;
  white-space: nowrap;
}
.blink { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

/* search */
.sensor-row {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 140, 0, 0.05);
  padding: 8px 12px;
}
.prompt { color: var(--accent); }
#query {
  flex: 1; background: none; border: 0; outline: none;
  color: var(--fg); font: inherit;
  caret-color: var(--accent);
}
#query::placeholder { color: var(--dim); }
#query::-webkit-search-cancel-button { display: none; }

#sensor-readout { font-size: 12px; color: var(--dim); margin-top: 8px; min-height: 1.2em; }

#results { list-style: none; margin-top: 4px; }
#results li {
  padding: 10px 2px; border-bottom: 1px dotted var(--line);
}
#results li:last-child { border-bottom: 0; }
#results .kind {
  font-size: 10.5px; letter-spacing: 0.14em; color: var(--dim);
}
#results .bar {
  display: block; height: 3px; margin-top: 5px;
  background: linear-gradient(90deg, var(--accent), var(--bright));
  transition: width 0.3s;
}
#results p { font-size: 13px; color: var(--dim); margin-top: 3px; }
#results .nosignal { color: var(--dim); font-style: italic; }

.colophon {
  border-top: 1px solid var(--line);
  margin-top: 26px; padding-top: 10px;
  font-size: 12.5px; color: var(--dim);
}

::selection { background: var(--accent); color: var(--ink); }

@media (max-width: 920px) {
  .masthead { flex-direction: column; gap: 6px; text-align: center; }
  .ident { flex-direction: column; align-items: center; gap: 6px; }
  #cube { width: 170px; margin: -10px 0; }
  /* single column: search, about, recent, chart — full-width panels */
  .deck { display: flex; flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .blink { animation: none; }
}
