/* ArmBot build log — design system.
   Concept: a lab notebook that turns into a blueprint at night. Light mode is warm paper with
   a faint graph-paper grid; dark mode is a literal drafting blueprint — same structure, same
   ruled lines, different material. Two named type roles: a condensed technical display face
   for headings/labels (drafting-lettering character), a humanist serif for narrative body copy
   (the "investor letter" voice), and a monospace face for dates/stats/coordinates. */

:root {
  --paper: #f3f0e7;
  --paper-2: #e9e4d5;
  --ink: #201f1a;
  --ink-dim: #5b5646;
  --line: #cdc4ac;
  --line-strong: #a89d7f;
  --accent: #c4530f;
  --accent-ink: #fff8ee;
  --accent-dim: #a3450c;

  --font-display: "Helvetica Neue", Arial, "Segoe UI", sans-serif;
  --font-body: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --font-mono: "SF Mono", "Cascadia Mono", "Segoe UI Mono", Consolas, "Liberation Mono", monospace;

  --max-w: 1080px;
  --radius: 2px;
  --shadow: 0 1px 0 var(--line-strong);
}

:root[data-theme="dark"] {
  --paper: #0e2038;
  --paper-2: #123056;
  --ink: #dbe6f2;
  --ink-dim: #8ba3c2;
  --line: #274b73;
  --line-strong: #3a678f;
  --accent: #ff9c4a;
  --accent-ink: #1a1206;
  --accent-dim: #ffb066;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0e2038;
    --paper-2: #123056;
    --ink: #dbe6f2;
    --ink-dim: #8ba3c2;
    --line: #274b73;
    --line-strong: #3a678f;
    --accent: #ff9c4a;
    --accent-ink: #1a1206;
    --accent-dim: #ffb066;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* Faint graph-paper grid — reads as "notebook" in light mode, "blueprint" in dark mode, at
   zero extra cost, since it's drawn straight from the theme's own --line token. A separate
   fixed layer (not body's own background) so the grid's low opacity never mixes unpredictably
   with whatever's rendered on top of it. */
#grid-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.35;
}

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

img, video { max-width: 100%; display: block; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}

/* ---------------------------------------------------------------------------
   Top bar / nameplate nav
   --------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: 1px solid var(--line-strong);
  backdrop-filter: saturate(1.1);
}
.topbar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.nameplate {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 15px;
  white-space: nowrap;
}
.nameplate .mark {
  width: 22px; height: 22px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  position: relative;
  flex: none;
}
.nameplate .mark::before, .nameplate .mark::after {
  content: "";
  position: absolute;
  background: var(--ink);
}
.nameplate .mark::before { top: 50%; left: 15%; right: 15%; height: 2px; transform: translateY(-1px); }
.nameplate .mark::after { left: 50%; top: 15%; bottom: 15%; width: 2px; transform: translateX(-1px); }

.navlinks {
  display: flex;
  gap: 22px;
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}
.navlinks a {
  color: var(--ink-dim);
  position: relative;
  padding: 4px 0;
}
.navlinks a:hover, .navlinks a.active { color: var(--ink); text-decoration: none; }
.navlinks a.active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--accent);
}
.theme-toggle {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-dim);
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }

/* ---------------------------------------------------------------------------
   Section scaffolding — every section gets a ruled "drawing sheet" header with
   corner tick marks, like a page in a technical notebook.
   --------------------------------------------------------------------------- */
.section { padding: 88px 0; position: relative; }
.section + .section { border-top: 1px solid var(--line); }
.sheet-label {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 40px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}
.sheet-label .idx { color: var(--accent); font-weight: 700; }
.sheet-label .rule { flex: 1; height: 1px; background: var(--line-strong); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0 0 0.5em;
}
h2 { font-size: clamp(28px, 4vw, 40px); text-transform: uppercase; letter-spacing: 0.01em; }
p { max-width: 62ch; }
.lede { font-size: 19px; color: var(--ink-dim); max-width: 58ch; }

/* ---------------------------------------------------------------------------
   Hero
   --------------------------------------------------------------------------- */
.hero { padding-top: 64px; padding-bottom: 72px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: end;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(40px, 6.4vw, 78px);
  line-height: 0.98;
  text-transform: uppercase;
}
.hero h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero-sub { font-size: 19px; color: var(--ink-dim); max-width: 46ch; margin-top: 18px; }

/* the nameplate stat block — styled like an equipment ID plate riveted to the page, with
   drafting-style crop marks at two corners instead of an actual rivet illustration */
.spec-plate {
  border: 1.5px solid var(--ink);
  background: var(--paper-2);
  padding: 20px 22px;
  position: relative;
}
.spec-plate::before, .spec-plate::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border: 1.5px solid var(--accent);
}
.spec-plate::before { top: -6px; left: -6px; border-width: 1.5px 0 0 1.5px; }
.spec-plate::after { bottom: -6px; right: -6px; border-width: 0 1.5px 1.5px 0; }
.spec-plate-title {
  font-family: var(--font-display);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.spec-item .n {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}
.spec-item .l {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------------------------------------------------------------------------
   Vision — two-phase roadmap as a horizontal instrument strip
   --------------------------------------------------------------------------- */
.phase-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  border: 1px solid var(--line-strong);
}
.phase {
  background: var(--paper-2);
  padding: 26px 26px 22px;
  position: relative;
}
.phase-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.phase h3 { font-size: 22px; text-transform: uppercase; margin-top: 6px; }
.phase p { color: var(--ink-dim); font-size: 15.5px; }
.phase-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 14px;
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
}
.phase-status.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
/* "ready" (hardware done, software ahead) is deliberately a THIRD visual state, not a reuse of
   .active — conflating "hardware built" with "in active daily development" would overclaim
   how far Phase 2 actually is. Outlined in accent, not filled, sits visually between .active
   (filled) and the plain unstyled "Planned" state. */
.phase-status.ready { color: var(--accent); border-color: var(--accent); }
.phase-status .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------------------------------------------------------------------
   Architecture — heritage callout + subsystem group labels
   --------------------------------------------------------------------------- */
.heritage-note {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  align-items: start;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  padding: 22px 26px;
  margin-bottom: 40px;
}
.heritage-tag {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-right: 1px dashed var(--line-strong);
  padding-right: 20px;
}
.heritage-tag .oss { color: var(--accent); }
.heritage-note p { color: var(--ink-dim); font-size: 15px; max-width: 60ch; margin: 0; }

.subhead {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  margin: 40px 0 14px;
}
.subhead:first-of-type { margin-top: 0; }

/* ---------------------------------------------------------------------------
   Build — architecture diagrams (compute layer, power/drivetrain/actuation layer)
   --------------------------------------------------------------------------- */
.board-diagram {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--line-strong);
  position: relative;
}
.board-diagram.cols-4 { grid-template-columns: repeat(4, 1fr); }
.board {
  padding: 22px 20px 20px;
  border-right: 1px solid var(--line-strong);
  position: relative;
}
.board:last-child { border-right: none; }
.board-role {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.board h4 {
  font-family: var(--font-display);
  font-size: 18px;
  text-transform: uppercase;
  margin: 6px 0 10px;
}
.board ul { margin: 0; padding-left: 18px; font-size: 14.5px; color: var(--ink-dim); }
.board li { margin-bottom: 4px; }
.bus-line {
  position: relative;
  height: 28px;
  margin-top: -1px;
  border-top: 1px dashed var(--line-strong);
}
.bus-line span {
  position: absolute;
  top: 6px; left: 50%;
  transform: translateX(-50%);
  background: var(--paper);
  padding: 0 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-dim);
  letter-spacing: 0.05em;
  white-space: nowrap;
}

/* ---------------------------------------------------------------------------
   Timeline — the centerpiece. A vertical spine, newest entry at the top.
   --------------------------------------------------------------------------- */
.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--line-strong);
}
.tl-item {
  position: relative;
  padding-bottom: 52px;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-node {
  position: absolute;
  left: -26px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--accent);
}
.tl-item:first-child .tl-node { background: var(--accent); }
.tl-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.tl-date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  font-weight: 700;
}
.tl-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
  border: 1px solid var(--line-strong);
  padding: 2px 8px;
}
.tl-item h3 {
  font-family: var(--font-display);
  font-size: 21px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
  margin-bottom: 8px;
}
.tl-body { color: var(--ink-dim); font-size: 16px; max-width: 62ch; }
.tl-stats {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.tl-stats .s-n { color: var(--accent); font-weight: 700; }
.tl-stats .s-l { color: var(--ink-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.tl-media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 16px;
  max-width: 760px;
}
.tl-media figure {
  margin: 0;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
}
.tl-media video { width: 100%; height: 220px; object-fit: cover; }
/* object-fit: contain, not cover, for images specifically — these are as often dense
   diagrams/screenshots as they are photos, and cropping a diagram's edges to fill a box is
   actively harmful (loses labels/content) in a way cropping a photo usually isn't. */
.tl-media img {
  width: 100%;
  height: 220px;
  object-fit: contain;
  cursor: zoom-in;
  background: var(--paper);
}
.tl-media img:hover { outline: 2px solid var(--accent); outline-offset: -2px; }
.tl-media figcaption {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-dim);
  padding: 6px 8px;
  border-top: 1px solid var(--line);
}
.tl-media-empty {
  margin-top: 14px;
  border: 1px dashed var(--line-strong);
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-dim);
  letter-spacing: 0.03em;
}
.tl-media-empty::before { content: "▢"; color: var(--line-strong); }

/* ---------------------------------------------------------------------------
   Next / Contact
   --------------------------------------------------------------------------- */
.next-block {
  border: 1px solid var(--line-strong);
  padding: 32px;
  background: var(--paper-2);
}
.next-block h3 { font-size: 22px; text-transform: uppercase; }
.next-block p { color: var(--ink-dim); }

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 18px;
}
.btn {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 13px 22px;
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  display: inline-block;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }

footer {
  padding: 32px 0 48px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-dim);
  letter-spacing: 0.03em;
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .navlinks { display: none; }
  /* .board-diagram.cols-4 has higher specificity (two classes) than a bare .board-diagram —
     without repeating it explicitly here, the 4-column architecture grid below would win over
     this override and stay 4-wide on a phone screen. */
  .board-diagram, .board-diagram.cols-4 { grid-template-columns: 1fr; }
  .board { border-right: none; border-bottom: 1px solid var(--line-strong); }
  .board:last-child { border-bottom: none; }
  .phase-strip { grid-template-columns: 1fr; }
  .heritage-note { grid-template-columns: 1fr; }
  .heritage-tag { border-right: none; border-bottom: 1px dashed var(--line-strong); padding: 0 0 14px; }
  .section { padding: 56px 0; }
}
@media (max-width: 520px) {
  .container { padding: 0 18px; }
  .spec-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------------------------------------
   Lightbox — click any timeline image to see it at real size. Dark backdrop
   regardless of theme (an overlay, not page chrome, so it doesn't need to match
   the light/notebook or dark/blueprint tokens).
   --------------------------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(10, 10, 8, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 1px solid rgba(255, 255, 255, 0.25);
  cursor: default;
}
.lightbox-caption {
  position: absolute;
  left: 0; right: 0; bottom: 16px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #e8e4d8;
  padding: 0 60px;
}
.lightbox-close {
  position: absolute;
  top: 18px; right: 24px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #e8e4d8;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 8px 14px;
  cursor: pointer;
}
.lightbox-close:hover { border-color: #e8e4d8; }
@media (max-width: 520px) {
  .lightbox { padding: 16px; }
  .lightbox-caption { padding: 0 16px; bottom: 8px; }
}
