/* ALT-1 project site */

:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1d1f21;
  --muted: #5c6166;
  --border: #dcdcd7;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --code-bg: #eeeeea;
  --max: 64rem;
  --gutter: 1rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1d2024;
    --text: #e6e6e3;
    --muted: #9aa0a6;
    --border: #33373c;
    --accent: #4c8dff;
    --accent-text: #0b0d10;
    --code-bg: #24282d;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 4rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

a { color: var(--accent); }

code, pre {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9em;
}
code { background: var(--code-bg); padding: 0.1em 0.3em; border-radius: 3px; }
pre {
  background: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}
pre code { background: none; padding: 0; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.site-header nav a:hover { color: var(--text); }

/* Sections */

section { padding: 3rem 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }

h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.15; margin: 0.25rem 0 1rem; }
h2 { font-size: 1.6rem; margin: 0 0 1rem; }
h3 { font-size: 1.15rem; margin: 2rem 0 0.75rem; }

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 44rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0; }
.button {
  display: inline-block;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  font-weight: 600;
}
.button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* Station cards */

.cards {
  list-style: none;
  counter-reset: station;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
}
.cards li {
  counter-increment: station;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}
.cards li strong { display: block; margin-bottom: 0.25rem; }
.cards li strong::before { content: counter(station) ". "; color: var(--muted); }

/* Key facts */

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.5rem;
}
.facts dt { font-weight: 600; }
.facts dd { margin: 0; color: var(--muted); }

@media (max-width: 30rem) {
  .facts { grid-template-columns: 1fr; }
  .facts dd { margin-bottom: 0.5rem; }
}

/* Tables */

.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { text-align: left; padding: 0.5rem 0.75rem; border: 1px solid var(--border); }
th { background: var(--code-bg); }

.test-coverage th:nth-child(2),
.test-coverage td:nth-child(2) { white-space: nowrap; }

/* Screenshots */

.screenshot { margin: 1.5rem 0; }
.screenshot img,
.screenshot video {
  display: block;
  width: 100%;
  max-width: 1024px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.screenshot figcaption { margin-top: 0.5rem; color: var(--muted); font-size: 0.9rem; }

/* Diagrams: inline SVG, coloured from the theme tokens */

.diagram { margin: 1.5rem 0; }
.diagram-scroll { overflow-x: auto; }
.diagram svg { display: block; width: 100%; min-width: 720px; height: auto; }
.diagram figcaption { margin-top: 0.5rem; color: var(--muted); font-size: 0.9rem; }

.diagram text { fill: var(--text); font-size: 13px; }
.diagram .d-title { font-size: 15px; font-weight: 700; }
.diagram .d-head { font-size: 14px; font-weight: 600; }
.diagram .d-small { font-size: 12px; }
.diagram .d-muted { fill: var(--muted); font-weight: 400; }
.diagram .d-code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 11px; }
.diagram .d-mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }

.diagram .d-zone { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 6 4; }
.diagram .d-box { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.diagram .d-flow { stroke: var(--accent); stroke-width: 2; }
.diagram .d-arrowhead { fill: var(--accent); }
.diagram .d-flow-muted { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 3; }
.diagram .d-arrowhead-muted { fill: var(--muted); }
.diagram .d-box-alt { stroke: var(--muted); stroke-dasharray: 5 3; }

/* Ladder rung excerpt: energised wire in the accent colour, as in the editor */
.ladder text { font-size: 12px; }
.ladder .d-head { font-size: 13px; }
.ladder .l-wire { stroke: var(--text); stroke-width: 2; fill: none; }
.ladder .l-on { stroke: var(--text); stroke-width: 2; }
.ladder .l-rail { stroke: var(--text); stroke-width: 4; }
.ladder .l-box { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }

/* Machine sequence: table and flow diagram side by side on wide screens */

.sequence-layout { display: grid; gap: 1.5rem 2rem; align-items: start; }
.sequence-layout .diagram { margin: 0; }
.sequence-diagram svg { min-width: 340px; max-width: 440px; margin: 0 auto; }
.sequence-diagram .d-small { font-size: 13px; }

@media (min-width: 52rem) {
  .sequence-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* Stand-ins for images and diagrams still to be made */

.placeholder {
  margin: 1.5rem 0;
  min-height: 12rem;
  display: grid;
  place-items: center;
  border: 2px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
  padding: 1rem;
}

/* Footer */

.site-footer { padding: 2rem 0; color: var(--muted); font-size: 0.9rem; }
