/* altairsim.com — site styles
 *
 * Palette takes its cues from the Altair 8800 front panel: a dark blue-grey
 * chassis, red paddle switches, amber address LEDs. Everything is defined as
 * tokens on :root so the dark-mode block below only has to restate colours,
 * never layout.
 */

:root {
  --bg:          #f6f6f4;
  --surface:     #ffffff;
  --surface-alt: #f0f0ec;
  --border:      #d9d9d2;
  --text:        #1c1f24;
  --text-muted:  #5f6672;

  /* Front-panel chrome — deliberately the same in both themes: the header is
     the machine, and the machine does not have a light mode. */
  --panel:       #232c36;
  --panel-line:  #38434f;
  --panel-text:  #e8eaed;
  --panel-muted: #9aa4b0;

  --accent:      #c0392b;   /* paddle-switch red */
  --accent-soft: #f4ded9;
  --led:         #ff6a3d;   /* lit address LED */
  --led-off:     #4a3a34;

  --radius: 6px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "DejaVu Sans Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:          #14181d;
    --surface:     #1b2027;
    --surface-alt: #212832;
    --border:      #2e3742;
    --text:        #e6e8ea;
    --text-muted:  #98a1ad;
    --accent:      #e05a48;
    --accent-soft: #3a221e;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- front panel header --------------------------------------------------- */

.panel {
  background: var(--panel);
  color: var(--panel-text);
  border-bottom: 1px solid var(--panel-line);
}

.panel a { color: var(--panel-text); }

.panel-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 14px 20px;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.wordmark:hover { text-decoration: none; }
.wordmark .dim { color: var(--panel-muted); font-weight: 400; }

.nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 14px;
}
.nav a {
  padding: 6px 12px;
  border-radius: var(--radius);
  color: var(--panel-muted);
}
.nav a:hover { background: var(--panel-line); color: var(--panel-text); text-decoration: none; }
.nav a.is-active { background: var(--panel-line); color: var(--panel-text); }

/* Address-LED strip: decorative only, hence aria-hidden in the markup. */
.leds {
  display: flex;
  gap: 5px;
  padding: 0 20px 10px;
  max-width: 980px;
  margin: 0 auto;
}
.led {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--led-off);
}
.led.on {
  background: var(--led);
  box-shadow: 0 0 6px var(--led);
}

/* --- page furniture ------------------------------------------------------- */

main { padding: 32px 0 64px; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 12px; }
h1 { font-size: 30px; letter-spacing: -0.01em; }
h2 { font-size: 21px; margin-top: 36px; }
p  { margin: 0 0 16px; }

.lede { font-size: 18px; color: var(--text-muted); max-width: 62ch; }

.hero { padding: 24px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 500;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 24px 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card h3 { font-size: 16px; }
.card p { margin: 0; color: var(--text-muted); font-size: 15px; }

/* --- breadcrumbs ---------------------------------------------------------- */

.crumbs {
  font-family: var(--font-mono);
  font-size: 14px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}
.crumbs li { display: flex; align-items: center; gap: 6px; }
.crumbs .sep { color: var(--border); }
.crumbs [aria-current="page"] { color: var(--text); font-weight: 600; }

/* --- readme --------------------------------------------------------------- */

/* Rendered from a readme.html found in the directory being listed. Scoped so
   an author's stray heading can't out-shout the page's own h1. */
.readme {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0 0 24px;
  overflow-x: auto;
}
.readme > :first-child { margin-top: 0; }
.readme > :last-child { margin-bottom: 0; }
.readme h1, .readme h2, .readme h3 { font-size: 17px; margin-top: 20px; }
.readme pre { background: var(--surface-alt); padding: 12px; border-radius: var(--radius); overflow-x: auto; }
.readme img { max-width: 100%; height: auto; }

/* --- file listing --------------------------------------------------------- */

.listing-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow-x: auto;
}

table.listing {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

table.listing th {
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--surface-alt);
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.listing td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.listing tr:last-child td { border-bottom: 0; }
table.listing tbody tr:hover { background: var(--surface-alt); }

.col-meta { font-family: var(--font-mono); color: var(--text-muted); white-space: nowrap; }
.col-size { text-align: right; }

.entry { display: flex; align-items: center; gap: 10px; min-width: 0; }
.entry a { color: var(--text); word-break: break-word; }
.entry a:hover { color: var(--accent); }
.entry.up a { color: var(--text-muted); font-family: var(--font-mono); }

.icon { width: 18px; height: 18px; flex: 0 0 18px; color: var(--text-muted); }
.icon-dir { color: var(--accent); }

.empty { padding: 28px 14px; text-align: center; color: var(--text-muted); }

/* --- footer --------------------------------------------------------------- */

footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 40px;
  color: var(--text-muted);
  font-size: 14px;
}
footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

@media (max-width: 600px) {
  h1 { font-size: 25px; }
  .col-modified { display: none; }   /* name + size survive on a phone */
  table.listing th, table.listing td { padding: 9px 10px; }
}
