/* TIMDA: Deep Thoughts Station Arrivals. Palette sampled from the station art. */

@font-face {
  font-family: "Silkscreen";
  src: url("fonts/silkscreen-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url("fonts/silkscreen-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Space Mono";
  src: url("fonts/space-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/space-grotesk-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --space: #161d2e;      /* background */
  --deep: #1b2c54;       /* planet shadow */
  --mid: #38548c;        /* mid blue */
  --peri: #7d98c8;       /* hull shading (#7590c1 in the art; nudged up to 4.5:1 on --deep, for text) */
  --steel: #a3b8ce;      /* pale steel */
  --cream: #e1e3d6;      /* hull */
  --white: #faf9f2;      /* highlight */
  --amber: #e27a4e;      /* dome window lights */
  --cyan: #84dee4;       /* dome panel light */

  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; /* body */
  --mono2: "Space Mono", var(--mono);  /* secondary: readout, directory, footer */
  --label: "Space Grotesk", var(--mono2); /* bold uppercase labels; proportional, so caps space evenly */
  --pixel: "Silkscreen", var(--mono);  /* titles, headings, lettering */
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--space); }

body {
  margin: 0;
  color: var(--cream);
  background: var(--space);
  font: 1.0625rem/1.65 var(--mono);
}

a { color: var(--cyan); }
a:hover, a:focus-visible { color: var(--white); }

/* The station art: 320x180 pixel art, scaled up without smoothing. */
.viewport {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1rem 0;
}
.viewport img {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  border: 1px solid var(--steel);
}

main, footer {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Inner pages: a slim bar instead of the station art. */
.topbar {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 1rem;
}
.topbar .home {
  font: 700 1.5rem/1 var(--pixel);
  letter-spacing: 0.08em;
  color: var(--white);
  text-decoration: none;
  text-shadow: 0.06em 0.06em 0 var(--mid);
}
.topbar .tagline {
  font: 400 0.75rem/1.4 var(--pixel);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--peri);
}
@media (hover: hover) {
  .topbar .home:hover { color: var(--cyan); }
}
.deck-label {
  margin: 2rem 0 0.25rem;
  font: 700 0.875rem/1.2 var(--label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--peri);
}
h1.place {
  margin: 0 0 1.5rem;
  padding: 0;
  font: 400 2rem/1.25 var(--pixel); /* Silkscreen: multiples of 8px stay crisp */
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  color: var(--white);
  text-shadow: none;
}
@media (max-width: 30rem) {
  h1.place { font-size: 1.5rem; }
}
.deck-label + h1.place { margin-top: 0; }
h1.place:first-child { margin-top: 2rem; }

h1 {
  margin: 2rem 0 0;
  font: 700 clamp(3rem, 12vw, 5.5rem)/1 var(--pixel);
  letter-spacing: 0.08em;
  padding-left: 0.08em; /* balance the trailing letter-spacing so it centres truly */
  text-align: center;
  color: var(--white);
  text-shadow: 0.06em 0.06em 0 var(--mid);
}

.expansion {
  margin: 0.5rem 0 2rem;
  font: 400 clamp(0.75rem, 4vw, 1.1rem)/1.6 var(--pixel);
  color: var(--steel);
  letter-spacing: 0.04em;
  padding-left: 0.04em;
  text-align: center;
}
/* Always two lines: the company, then what it is. */
.expansion span { display: block; white-space: nowrap; }

h2 {
  margin: 0 0 0.75rem;
  /* Silkscreen is crisp only at multiples of 8px, so stay on that grid. */
  font: 400 var(--h2-size, 1.5rem)/1.2 var(--pixel);
  color: var(--amber);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

section { margin: 0 0 2rem; }
section p { margin: 0 0 0.75rem; text-wrap: pretty; } /* avoid one-word last lines */

/* Status readout with dotted leaders. */
.readout {
  padding: 1rem 1.25rem;
  background: var(--deep);
  border: 1px solid var(--mid);
}
.status-rows { margin: 0; font: 1rem/1.9 var(--mono2); }
.status-rows > div { /* the station-status rows */
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  text-transform: uppercase;
  font-family: var(--label);
  font-weight: 700;
  letter-spacing: 0.06em;
}
.status-rows dt { color: var(--peri); white-space: nowrap; }
/* Dotted leader between label and value. An empty flex item's baseline is its
   bottom edge, so the dots sit on the text baseline; nudge them up a little. */
.status-rows > div::after {
  content: "";
  order: 1;
  flex: 1;
  min-width: 1rem;
  border-bottom: 2px dotted var(--mid);
  transform: translateY(-0.3em);
}
.status-rows dd {
  order: 2;
  margin: 0;
  color: var(--white);
  text-align: right;
  white-space: nowrap;
}

/* Station directory: a mall-style deck listing. */
.directory ol {
  font: 1rem/1.6 var(--mono2);
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--deep);
}
.directory li {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--deep);
}
.directory .deck {
  color: var(--peri);
  text-transform: uppercase;
  font-family: var(--label);
  font-weight: 700;
  letter-spacing: 0.06em;
}
.directory em {
  grid-column: 2;
  font-style: normal;
  color: var(--steel);
}
.directory li a { color: var(--cream); text-decoration: none; }
.directory li a:focus-visible { outline: 1px dashed var(--cyan); outline-offset: 2px; }
@media (hover: hover) {
  .directory li a:hover { color: var(--cyan); text-decoration: underline; }
}
.directory .here, .directory .here a { color: var(--white); }
.directory .here strong {
  grid-column: 2;
  justify-self: start;
  font: 400 0.75rem/1.6 var(--pixel);
  padding: 0 0.4rem;
  color: var(--space);
  background: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
/* Station directory and other roll-ups: <details>/<summary>, no JavaScript. */
.directory summary, .rollup > summary {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  list-style: none;
  cursor: pointer;
}
.directory summary::-webkit-details-marker, .rollup > summary::-webkit-details-marker { display: none; }
.directory summary::before, .rollup > summary::before {
  content: "[+]";
  flex: none;          /* never squeezed by a long title... */
  white-space: nowrap; /* ...and never broken at the "-" in [-] */
  font: 400 var(--h2-size, 1.5rem)/1.2 var(--pixel);
  color: var(--peri);
}
.directory details[open] > summary::before, .rollup[open] > summary::before { content: "[-]"; }
.directory summary h2, .rollup > summary h2 { margin: 0; }
.directory details[open] > summary, .rollup[open] > summary { margin-bottom: 0.75rem; }
.rollup { margin: 1.25rem 0 0; }
@media (hover: hover) {
  .directory summary:hover::before, .rollup > summary:hover::before { color: var(--cyan); }
}
.directory summary:focus-visible::before, .rollup > summary:focus-visible::before { color: var(--cyan); }
.directory summary:focus-visible, .rollup > summary:focus-visible { outline: 1px dashed var(--cyan); outline-offset: 4px; }

/* Station map: Mermaid-rendered SVG (tools/render-map.mjs), skinned entirely here.
   Text sizes are in SVG units and must match what the renderer measured. */
.station-map { margin: 0 0 1.25rem; }
.station-map svg {
  display: block;
  width: 100%;
  max-width: 30rem;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}
.station-map .node rect {
  fill: var(--deep);
  stroke: var(--peri);
  stroke-width: 1px;
}
.station-map text { text-anchor: middle; }
.station-map .node text {
  fill: var(--cream);
  font: 400 15px var(--mono2);
}
.station-map .cluster rect {
  fill: none;
  stroke: var(--mid);
  stroke-width: 1px;
  stroke-dasharray: 4 3;
}
.station-map .cluster-label text {
  fill: var(--peri);
  font: 700 13px var(--label);
  letter-spacing: 0.06em;
}
.station-map .flowchart-link {
  fill: none;
  stroke: var(--peri);
  stroke-width: 1.5px;
}
.station-map .label .background { fill: none; stroke: none; }
.station-map .marker { display: none; }
.station-map .spot.here .node rect { fill: var(--amber); stroke: var(--amber); }
.station-map .spot.here .node text { fill: var(--space); }
.station-map .cluster.here > rect { stroke: var(--amber); stroke-width: 2px; stroke-dasharray: none; }
.station-map .cluster.here .cluster-label text { fill: var(--amber); }
/* Click-to-reveal: clicking (or tabbing to) a box focuses it and shows a callout with
   its full name; the callout is the link. Click elsewhere and it hides again. */
.station-map .spot { cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }
.station-map .callout { display: none; }
.station-map .spot:focus-within .callout { display: inline; }
.station-map .spot:focus-within .node rect { stroke: var(--cyan); stroke-width: 2px; }
.station-map .callout rect { fill: var(--space); stroke: var(--cyan); stroke-width: 1px; }
.station-map .callout text { fill: var(--cyan); font: 400 13px var(--mono2); }
.station-map .callout:focus { outline: none; }
.station-map .callout:focus-visible rect,
.station-map .callout:hover rect { fill: var(--deep); }
/* With a mouse, hovering shows the callout too (the bridge keeps it open on the way
   down to it). Only where there's a real pointer: on touchscreens :hover sticks after a tap. */
.station-map .callout .bridge { fill: transparent; stroke: none; }
@media (hover: hover) {
  .station-map .spot:hover .node rect { stroke: var(--cyan); stroke-width: 2px; }
  .station-map .spot:hover .callout { display: inline; }
}

/* Jumping to a directory entry from the map highlights it. */
.directory li:target { background: var(--deep); }

.fineprint {
  margin: 0.5rem 0 0;
  font: 0.8125rem/1.5 var(--mono2);
  color: var(--peri);
}

.shoot {
  padding-left: 1rem;
  border-left: 3px solid var(--amber);
  color: var(--steel);
}

footer {
  padding-top: 1rem;
  padding-bottom: 2rem;
  border-top: 1px solid var(--deep);
  color: var(--peri);
  font: 0.875rem/1.6 var(--mono2);
}
footer p { margin: 0 0 0.25rem; }
.credits { font-size: 0.8125rem; color: var(--peri); }
.credits a { color: var(--steel); }

/* Smallest phones: 24px headings would wrap; drop to the next crisp size. */
@media (max-width: 22.5rem) {
  h2 { --h2-size: 1rem; }
}

@media (max-width: 30rem) {
  .directory li { grid-template-columns: 1fr; }
  .directory em, .directory .here strong { grid-column: 1; }
  body { font-size: 1rem; }
  .readout { padding: 0.75rem; }
}

/* Page content extras */
main ul { margin: 0 0 0.75rem; padding-left: 1.25rem; }
main li { margin: 0 0 0.35rem; }
main code { font: 0.9em var(--mono); color: var(--cyan); }
.readout .empty { margin: 0; color: var(--steel); }
.shoot h2 + p, .shoot h2 + ul { margin-top: 0; }
.shoot h2:not(:first-child) { margin-top: 1.25rem; }

/* Section status colours (timda.space concepts/look.md): open cyan, closed amber, pending grey. */
.status-open { color: var(--cyan); }
.status-closed { color: var(--amber); }
.status-pending { color: var(--peri); }
.status-rows dd.status-open, .status-rows dd.status-closed, .status-rows dd.status-pending { font-weight: 700; }

/* Hub: storefronts, notices, the dock form */
.storefronts { list-style: none; margin: 0; padding: 0; }
.storefront {
  display: grid;
  grid-template-columns: 88px 1fr;   /* left: the status over the 88x31; right: the text */
  gap: 0.1rem 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--mid);
}
.storefront:last-child { border-bottom: 0; }
.storefront .status {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  margin-top: 0.15rem;
  padding: 0.05rem 0.6rem;
  border-radius: 999px;           /* a pill, like the transit console's: a sign, not a link */
  font: 700 0.75rem/1.6 var(--label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--space);
}
.storefront .status-open { background: var(--cyan); }
.storefront .status-closed { background: var(--amber); }
.storefront .status-pending { background: var(--peri); }
.storefront .name { font-weight: 700; color: var(--white); }
.storefront a.name { color: var(--cyan); }
.storefront .domain { color: var(--peri); font-size: 0.9em; }
.storefront .name, .storefront .domain, .storefront .concept, .storefront .links { grid-column: 2; justify-self: start; }
.storefront-pending .name, .storefront-pending .domain, .storefront-pending .concept, .storefront-pending .links { opacity: 0.55; }
.storefront .concept { color: var(--steel); }
.storefront .links { font-size: 0.9em; }
/* A Section's own 88x31, served from the hub (TIMDA-1 §6.1), under its status */
.storefront .button88 { grid-column: 1; grid-row: 2 / span 3; align-self: start; margin-top: 0.35rem; line-height: 0; }
.storefront .button88 img { display: block; image-rendering: pixelated; }
.storefront-pending .button88 { opacity: 0.55; filter: grayscale(1); }
.actions { margin: 1rem 0 0; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.button, .dock button {
  display: inline-block;
  padding: 0.35rem 0.9rem;
  font: 700 0.875rem/1.4 var(--label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--space);
  background: var(--cyan);
  border: 0;
  cursor: pointer;
}
@media (hover: hover) {
  .button:hover, .dock button:hover { background: var(--white); color: var(--space); }
}
.button:focus-visible, .dock button:focus-visible { outline: 2px dashed var(--cyan); outline-offset: 2px; }
.button-launch { background: var(--amber); }

/* Wormhole transit: an elbow-framed console with pill buttons. Shapes only, our palette. */
.transit {
  --bar: 7rem;        /* side column width */
  --top: 1.25rem;     /* top bar thickness */
  --r: 2.5rem;        /* outer elbow radius */
  display: grid;
  grid-template-columns: var(--bar) 1fr;
  column-gap: 0.75rem;
  margin: 2rem 0 2.5rem;
}
.transit-top, .transit-foot { grid-column: 1 / -1; display: grid; grid-template-columns: var(--bar) 1fr; }
.transit-top { grid-row: 1; height: calc(var(--top) + 1rem); }
.transit-top .corner, .transit-foot .corner { position: relative; background: var(--amber); }
.transit-top .corner { border-top-left-radius: var(--r); }
.transit-top .corner::after { /* the inner curve of the elbow */
  content: ""; position: absolute; right: 0; top: var(--top); width: 1rem; height: 1rem;
  background: radial-gradient(circle at 100% 100%, var(--space) 1rem, transparent calc(1rem + 0.5px));
}
.transit-top .bar { height: var(--top); margin-left: -1px; background: var(--amber); }
.transit h2 {
  grid-row: 1; grid-column: 2; justify-self: end; align-self: start;
  margin: -0.125rem 0 0; padding: 0 0 0 0.5rem;
  font: 700 1.5rem/1.25rem var(--label); letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--amber); background: var(--space);
}
.transit-side { grid-row: 2; display: flex; flex-direction: column; gap: 0.35rem; padding-top: 0.35rem; }
.transit-side span {
  flex: 1; min-height: 2.5rem; padding: 0.25rem 0.5rem;
  display: flex; align-items: flex-end; justify-content: flex-end;
  font: 700 0.8rem/1 var(--label); text-transform: uppercase; color: var(--space);
}
.transit-side .a { background: var(--peri); border-top-right-radius: 0.75rem; } /* follows the elbow's curve */
.transit-side .b { background: var(--steel); flex: 2; }
.transit-side .c { background: var(--amber); }
.transit-deck { grid-row: 2; display: flex; flex-direction: column; gap: 0.6rem; padding: 0.75rem 0; }
.transit .readline { margin: 0 0 0.25rem; font: 0.875rem/1.5 var(--mono2); color: var(--steel); }
.transit .readline b { font-weight: 400; color: var(--cyan); }
.transit .readline .sep { word-spacing: -0.5ch; color: var(--peri); } /* half-width spaces round the dots */
.transit .fineprint { margin: 0.25rem 0 0; font: 0.75rem/1.5 var(--mono2); color: var(--peri); }
.transit .fineprint q { color: var(--steel); }
.transit-foot { height: 1rem; }
.transit-foot .corner { border-bottom-left-radius: 1.25rem; }
.transit-foot .bar { height: 0.6rem; align-self: end; margin-left: -1px; background: var(--amber); }
.pill {
  display: flex; align-items: flex-end; justify-content: flex-end; gap: 0.5rem;
  min-height: 2.5rem; padding: 0.3rem 1.25rem 0.35rem 1.5rem;
  border-radius: 999px;
  font: 700 1rem/1.1 var(--label); letter-spacing: 0.05em; text-transform: uppercase; text-align: right;
  text-decoration: none; color: var(--space);
  -webkit-tap-highlight-color: transparent;
}
.pill:visited { color: var(--space); }
.pill .num { margin-right: auto; align-self: center; font-size: 0.75rem; color: var(--space); }
.pill-amber { background: var(--amber); }
.pill-peri { background: var(--peri); }
.pill-steel { background: var(--steel); }
.pill:active { background: var(--cream); }
.pill:focus-visible { outline: 2px dashed var(--cyan); outline-offset: 3px; }
@media (hover: hover) {
  .pill:hover { background: var(--white); }
}
@media (max-width: 30rem) {
  .transit { --bar: 4.25rem; --r: 1.75rem; column-gap: 0.5rem; }
  .transit-side span { white-space: nowrap; }
  .transit h2 { font-size: 1rem; }
  .transit-side span { font-size: 0.625rem; padding: 0.2rem 0.3rem; }
  .pill { font-size: 0.875rem; padding-right: 1rem; padding-left: 1rem; }
}

/* The 88x31 launch button for Sections, scaled without blurring. */
.ring-preview img { display: block; image-rendering: pixelated; }
.dock input[type="text"] {
  width: min(22rem, 100%); margin-top: 0.25rem; padding: 0.3rem 0.5rem;
  font: 0.95rem var(--mono); color: var(--cream); background: var(--space); border: 1px solid var(--mid);
}
.dock input[type="text"]:focus-visible { outline: 2px dashed var(--cyan); outline-offset: 2px; }
.dock input[type="file"] { margin-top: 0.25rem; max-width: 100%; color: var(--steel); font: 0.9rem var(--mono2); }
.dock .hint { color: var(--peri); font-size: 0.9em; }
.notice { margin: 0 0 1.5rem; padding: 0.75rem 1rem; border-left: 4px solid; background: var(--deep); }
.notice-good { border-color: var(--cyan); }
.notice-warn { border-color: var(--amber); }
.notice-crit { border-color: #e64646; }
main pre { margin: 0 0 0.75rem; padding: 0.75rem; overflow-x: auto; font: 0.875rem/1.5 var(--mono); background: var(--deep); border: 1px solid var(--mid); }
main pre code { font: 0.875rem/1.5 var(--mono); color: var(--cream); }

/* Staging and preview copies only (added by functions/_middleware.js) */
.env-badge {
  position: sticky; top: 0; z-index: 10;
  padding: 0.25rem 1rem;
  font: 700 0.8125rem/1.5 var(--label); letter-spacing: 0.08em; text-transform: uppercase; text-align: center;
  color: var(--space);
  background: var(--amber);
}
.env-badge::after { /* hazard stripe */
  content: ""; display: block; height: 4px; margin: 0.25rem -1rem -0.25rem;
  background: repeating-linear-gradient(-45deg, var(--space) 0 6px, var(--amber) 6px 12px);
}
.env-badge .resync {
  display: inline-block; margin-left: 0.75rem; padding: 0 0.6rem; border-radius: 999px;
  font: 700 0.75rem/1.6 var(--label); letter-spacing: 0.08em; text-decoration: none;
  color: var(--amber); background: var(--space);
}
.env-badge .resync:hover, .env-badge .resync:focus-visible { color: var(--white); }
@media (max-width: 30rem) { .env-badge span { display: none; } }

/* On inner pages the directory leads, right under the TIMDA bar */
main > .directory:first-child { margin-top: 1.25rem; }

/* The mast's beacon and signal tests: GOOD / WARN / CRIT, like finger */
.checks { margin: 1rem 0 0; padding: 0.75rem 1rem; background: var(--space); border: 1px solid var(--mid); }
.checks-title { margin: 0 0 0.5rem; font: 700 0.875rem/1.5 var(--label); letter-spacing: 0.06em; text-transform: uppercase; color: var(--steel); }
.checks ul { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 3.75rem 1fr; column-gap: 0.75rem; margin: 0 0 0.35rem; font: 0.9rem/1.5 var(--mono2); color: var(--cream); overflow-wrap: anywhere; }
.level {
  align-self: start; margin-top: 0.1rem; padding: 0 0.4rem; border-radius: 999px;
  font: 700 0.75rem/1.6 var(--label); letter-spacing: 0.08em; text-align: center; color: var(--space);
}
.level-good { background: var(--cyan); }
.level-warn { background: var(--amber); }
.level-crit { background: #e64646; color: var(--white); }

footer .aside { color: var(--peri); }
footer .aside a { color: var(--cyan); }
/* The beacon's button, "received" slow-scan style: painted in one pixel row at a
   time under a moving scan line. CSS only; no motion for those who asked for none. */
.sstv { margin: 0 0 0.9rem; }
.sstv-screen {
  position: relative; display: inline-block; padding: 6px; line-height: 0;
  background: repeating-linear-gradient(var(--deep) 0 1px, var(--space) 1px 2px);
  border: 1px solid var(--mid);
}
.sstv-screen img { image-rendering: pixelated; animation: sstv-paint 3.1s steps(31, end) both; }
.sstv-screen::after { /* the scan line */
  content: ""; position: absolute; left: 6px; right: 6px; top: 6px; height: 2px;
  background: var(--cyan); box-shadow: 0 0 6px var(--cyan);
  animation: sstv-scan 3.1s steps(31, end) both;
}
.sstv figcaption { margin-top: 0.3rem; font: 0.75rem/1.4 var(--mono2); letter-spacing: 0.04em; color: var(--peri); }
@keyframes sstv-paint { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes sstv-scan { from { transform: translateY(0); opacity: 1; } 99% { opacity: 1; } to { transform: translateY(62px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .sstv-screen img, .sstv-screen::after { animation: none; }
  .sstv-screen::after { display: none; }
}
/* The beacon's domain (and the signal's verdict) take the colour of the worst check */
.heard-good { color: var(--cyan); }
.heard-warn { color: var(--amber); }
.heard-crit { color: #e64646; }

.status-rows dd a { color: var(--cyan); }
.status-rows dd a:hover, .status-rows dd a:focus-visible { color: var(--white); }

/* The wide (banner) receiver: 60 rows instead of 31, and it shrinks to fit phones */
.sstv-wide .sstv-screen { max-width: 100%; }
.sstv-wide .sstv-screen img { max-width: 100%; height: auto; animation-duration: 4s; animation-timing-function: steps(60, end); }
.sstv-wide .sstv-screen::after { animation: sstv-scan-wide 4s steps(60, end) both; }
@keyframes sstv-scan-wide { from { top: 6px; opacity: 1; } 99% { opacity: 1; } to { top: calc(100% - 6px); opacity: 0; } }

/* The Observation Lounge's showcase, through the AuthentiGlass */
.viewport-glass {
  margin: 1.5rem 0 2rem; padding: 1.25rem;
  background: linear-gradient(160deg, var(--deep), var(--space) 70%);
  border: 1px solid var(--steel); box-shadow: inset 0 0 0 4px var(--space), inset 0 0 0 5px var(--mid);
}
.showcase { margin: 0; text-align: center; }
.showcase-banner { display: inline-block; max-width: 100%; line-height: 0; }
.showcase-banner img { max-width: 100%; height: auto; image-rendering: pixelated; }
.showcase figcaption { margin-top: 0.75rem; }
/* The Lounge's hosts: a pixel portrait and a speech bubble */
.host { display: flex; gap: 1rem; align-items: flex-start; margin: 1.25rem auto 0.75rem; max-width: 34rem; text-align: left; }
.host-portrait { flex: none; image-rendering: pixelated; }
.bubble { position: relative; flex: 1; padding: 0.6rem 0.85rem; background: var(--space); border: 1px solid var(--steel); }
.bubble::before { /* the tail, pointing at the host */
  content: ""; position: absolute; left: -9px; top: 18px; width: 16px; height: 16px;
  background: var(--space); border-left: 1px solid var(--steel); border-bottom: 1px solid var(--steel); transform: rotate(45deg);
}
.bubble p { position: relative; margin: 0; color: var(--cream); }
.bubble .host-name { margin-bottom: 0.25rem; font: 700 0.8125rem/1.4 var(--label); letter-spacing: 0.06em; text-transform: uppercase; color: var(--amber); }
.bubble .host-name span { font-weight: 700; color: var(--peri); text-transform: none; letter-spacing: 0; }
.bubble strong { color: var(--cyan); }
@media (max-width: 30rem) { .host-portrait { width: 48px; height: 48px; } }
.showcase-from { margin: 0; font: 0.9rem/1.5 var(--mono2); color: var(--steel); }
.showcase-from .domain { color: var(--peri); }
.showcase-button { margin: 0.6rem 0 0; line-height: 0; }
.showcase-button img { image-rendering: pixelated; }
.showcase-controls { margin: 1rem 0 0; text-align: center; font: 0.8125rem/1.5 var(--mono2); color: var(--peri); }
.showcase-empty { margin: 0; text-align: center; color: var(--steel); }

/* The record planner's form: text areas, selects, a roll-up of optional links */
.dock textarea, .dock select {
  width: min(36rem, 100%); margin-top: 0.25rem; padding: 0.3rem 0.5rem;
  font: 0.875rem/1.5 var(--mono); color: var(--cream); background: var(--space); border: 1px solid var(--mid);
}
.dock select { width: auto; }
.dock textarea:focus-visible, .dock select:focus-visible { outline: 2px dashed var(--cyan); outline-offset: 2px; }
.rollup > summary h3 { margin: 0; }
.planner-more { margin: 0.5rem 0 1rem; }
.plan-format { margin-top: 1rem; }
.plan-format pre { margin: 0; white-space: pre; }

/* The record values a beacon heard */
.heard-records { margin: 0.75rem 0 0; padding: 0.6rem 0.8rem; font: 0.8125rem/1.5 var(--mono2); background: var(--space); border: 1px solid var(--mid); }
.heard-records div { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 0.75rem; }
.heard-records dt { color: var(--peri); }
.heard-records dd { margin: 0; color: var(--cream); overflow-wrap: anywhere; }
/* A shortened key; tap to open the full value in a field to copy from */
.keyval summary { list-style: none; cursor: pointer; }
.keyval summary::-webkit-details-marker { display: none; }
.keyval summary { white-space: nowrap; }
.keyval summary code { font-size: 0.75rem; color: var(--cream); border-bottom: 1px dotted var(--peri); }
.keyval summary::after { content: " [+]"; color: var(--peri); }
.keyval[open] summary::after { content: " [-]"; }
.keyval input {
  display: block; width: 100%; margin-top: 0.35rem; padding: 0.25rem 0.4rem;
  font: 0.75rem/1.4 var(--mono); color: var(--cream); background: var(--deep); border: 1px solid var(--mid);
}
.keyval input:focus-visible { outline: 2px dashed var(--cyan); outline-offset: 2px; }

@media (max-width: 30rem) {
  .heard-records div { grid-template-columns: minmax(0, 1fr); gap: 0; margin-bottom: 0.35rem; }
  .heard-records dt { font-size: 0.6875rem; text-transform: uppercase; letter-spacing: 0.06em; }
}

/* The arrivals board (Arrivals page): a flight-information display. */
.flightboard { width: 100%; border-collapse: collapse; margin: 0 0 0.75rem; font: 0.95rem/1.6 var(--mono2); }
.flightboard th {
  text-align: left;
  color: var(--peri);
  font: 700 0.8rem/1.6 var(--label);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 2px solid var(--mid);
  padding: 0 0.75rem 0.2rem 0;
}
.flightboard td { padding: 0.25rem 0.75rem 0.25rem 0; border-bottom: 1px dotted var(--mid); vertical-align: baseline; }
.flightboard td:first-child { color: var(--steel); white-space: nowrap; }
.flightboard td:last-child { font-family: var(--label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; white-space: nowrap; padding-right: 0; }
.flightboard td.gone { color: var(--steel); }
.readout .fineprint { margin: 0; font-size: 0.85rem; color: var(--steel); }

/* The Wormhole Post (mast): held mail. */
.mail { margin: 1rem 0 0; padding: 0.75rem 0 0; border-top: 2px solid var(--mid); }
.mail-head { margin: 0 0 0.5rem; }
.mail-head dd { white-space: normal; overflow-wrap: break-word; min-width: 0; text-transform: none; letter-spacing: 0; }
.mail-head code { text-transform: none; }
.bang { color: var(--amber); padding: 0 0.1em; }
.mail-body {
  margin: 0 0 0.5rem;
  padding: 0.6rem 0.75rem;
  background: var(--space);
  border: 1px solid var(--mid);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 0.95rem/1.55 var(--mono);
  color: var(--white);
}
.mail-check { font-size: 0.85rem; color: var(--steel); overflow-wrap: anywhere; }

/* Sealed or open, at a glance: the GOOD colour if only the recipient can read it, amber if the hub can. */
.envelope { font-family: var(--label); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.envelope-sealed, .mail-head dd.envelope-sealed { color: var(--cyan); }
.envelope-open, .mail-head dd.envelope-open { color: var(--amber); }
.mail-head dd.envelope { text-transform: uppercase; letter-spacing: 0.06em; }
.readout h2 + .fineprint { margin: -0.25rem 0 0.75rem; } /* a strapline under a heading (TWIRL) */

/* The specs (/rnd/timda-<n>): long reading, tables, code. */
.spec h2 { margin: 2rem 0 0.5rem; }
.spec h3 { margin: 1.5rem 0 0.4rem; font-size: 1.05rem; color: var(--cream); }
.spec h2 code, .spec h3 code, .spec-title code { font: inherit; color: var(--cyan); }
.spec ol, .spec ul { margin: 0 0 0.75rem; padding-left: 1.5rem; }
.spec li > ul, .spec li > ol { margin: 0.35rem 0 0; }
.spec .spec-contents { margin: 0 0 1.5rem; }
.spec .spec-contents ol { margin: 0.5rem 0 0; }
.table-scroll { overflow-x: auto; margin: 0 0 1rem; }
.spec table { width: 100%; border-collapse: collapse; font: 0.875rem/1.5 var(--mono2); }
.spec th { text-align: left; color: var(--peri); font: 700 0.75rem/1.5 var(--label); text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 2px solid var(--mid); padding: 0.3rem 0.75rem 0.3rem 0; }
.spec td { border-bottom: 1px dotted var(--mid); padding: 0.35rem 0.75rem 0.35rem 0; vertical-align: top; }
.spec td:first-child { white-space: nowrap; }
.spec-licence { margin-top: 2rem; font-size: 0.85rem; color: var(--steel); }
.deck-label a { color: inherit; }

/* Boxes that scroll sideways (code, wide tables) take keyboard focus, so they can be scrolled without a mouse. */
pre:focus-visible, .table-scroll:focus-visible { outline: 2px dashed var(--cyan); outline-offset: 2px; }
