/* =========================================================
   Retro Space Portfolio — shared stylesheet
   Palette: deep indigo night, cream ink, 70s sunset stripe
   (mustard / orange / pink / violet) and a teal "go" colour.
   ========================================================= */

:root {
  --bg: #0d0b1e;
  --bg-2: #141030;
  --panel: rgba(26, 21, 54, 0.78);
  --panel-2: rgba(36, 29, 72, 0.6);
  --border: rgba(243, 233, 210, 0.12);
  --border-strong: rgba(243, 233, 210, 0.22);
  --text: #f3e9d2;
  --text-dim: #b9b0c9;
  --mustard: #ffc857;
  --orange: #ff7a45;
  --pink: #ff5c8a;
  --violet: #9b6bff;
  --teal: #3ec1b4;
  --accent: var(--orange);
  --stripe: linear-gradient(90deg, var(--mustard) 0 25%, var(--orange) 25% 50%, var(--pink) 50% 75%, var(--violet) 75% 100%);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
  --truss: #8f86a8;
  --worm: #ff7a45;
  --worm-dark: #c4502a;
  --font-head: "Audiowide", "Segoe UI", sans-serif;
  --font-body: "Space Grotesk", "Segoe UI", sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
  /* legacy names still used by a few inline styles / figures */
  --panel-border: var(--border);
  --accent-2: var(--teal);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}

body { position: relative; display: flex; flex-direction: column; }

a { color: var(--mustard); text-underline-offset: 3px; }
a:hover { color: var(--orange); }
strong { color: #fff6e3; }
code { font-family: var(--font-mono); font-size: 0.85em; background: rgba(255, 200, 87, 0.1); color: var(--mustard); padding: 0.1rem 0.35rem; border-radius: 6px; }
h1, h2, h3, h4 { line-height: 1.25; }

/* ---------- Starfield background ---------- */
#stars {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 120% 60% at 50% 115%, rgba(255, 122, 69, 0.22), transparent 60%),
    radial-gradient(ellipse 80% 50% at 85% -10%, rgba(155, 107, 255, 0.18), transparent 60%),
    radial-gradient(ellipse 60% 40% at 0% 30%, rgba(62, 193, 180, 0.08), transparent 60%),
    linear-gradient(180deg, #0b0919 0%, var(--bg) 55%, #1a1030 100%);
  overflow: hidden;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: #fff3da;
  opacity: 0.6;
  animation: twinkle linear infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50% { opacity: 0.95; transform: scale(1.3); }
}

/* faint CRT scanlines for the retro feel */
.nebula-drift {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px);
}

@media (prefers-reduced-motion: reduce) {
  .star { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Navigation ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 2rem;
  background: rgba(13, 11, 30, 0.82);
  backdrop-filter: blur(10px);
}

.site-nav::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--stripe);
  opacity: 0.9;
}

.brand {
  font-family: var(--font-head);
  letter-spacing: 0.06em;
  color: var(--text);
  text-decoration: none;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.brand:hover { color: var(--text); }
.brand span { color: var(--orange); }
.brand::before {
  content: "";
  width: 22px; height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--mustard), var(--orange) 55%, var(--pink));
  box-shadow: 0 0 0 3px rgba(255, 200, 87, 0.15);
}

.nav-links {
  display: flex;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: block;
  color: var(--text-dim);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.nav-links a:hover { color: var(--text); border-color: var(--border-strong); }
.nav-links a.active { color: var(--bg); background: var(--mustard); }

/* ---------- Layout helpers ---------- */
main { flex: 1; width: 100%; }

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.eyebrow {
  font-family: var(--font-mono);
  color: var(--mustard);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin: 0 0 0.75rem;
}

.page-title {
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(2.1rem, 5.2vw, 3.4rem);
  line-height: 1.12;
  margin: 0 0 1rem;
  color: var(--text);
  text-shadow: 3px 3px 0 rgba(255, 92, 138, 0.35), 6px 6px 0 rgba(155, 107, 255, 0.2);
}

.subtitle {
  color: var(--text-dim);
  font-size: 1.12rem;
  margin: 0 0 2rem;
  max-width: 700px;
}

.page-head { padding-bottom: 0.5rem; }

/* Sections: numbered retro labels */
.section { margin-top: 3.25rem; }
.section-head { display: flex; align-items: baseline; gap: 0.9rem; margin-bottom: 1.1rem; }
.section-head .num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--bg);
  background: var(--mustard);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  transform: translateY(-3px);
}
.section-head h2 {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  letter-spacing: 0.02em;
}
.section-lead { color: var(--text-dim); max-width: 760px; margin: -0.25rem 0 1.25rem; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 1.25rem; }
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.panel h3, .card h3 {
  margin: 0 0 0.6rem;
  font-family: var(--font-head);
  font-weight: 400;
  font-size: 1.08rem;
  color: var(--mustard);
  letter-spacing: 0.02em;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.card p { margin: 0; color: var(--text-dim); }
.card p + p { margin-top: 0.6rem; }
a.card { display: block; text-decoration: none; color: inherit; }
a.card:hover { transform: translateY(-3px); border-color: rgba(255, 200, 87, 0.45); }
.card .card-link { display: inline-block; margin-top: 0.8rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--mustard); letter-spacing: 0.06em; text-transform: uppercase; }

.card-accent { border-top: 4px solid var(--orange); }
.card-accent.teal { border-top-color: var(--teal); }
.card-accent.pink { border-top-color: var(--pink); }
.card-accent.violet { border-top-color: var(--violet); }
.card-accent.mustard { border-top-color: var(--mustard); }

.btn-row { display: flex; gap: 0.85rem; flex-wrap: wrap; margin-top: 1.75rem; }

.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 0.2s, background 0.2s, color 0.2s;
}
.btn-primary { background: var(--orange); color: var(--bg); box-shadow: 0 4px 0 #a8431f; }
.btn-primary:hover { color: var(--bg); background: var(--mustard); }
.btn-secondary { border: 1px solid var(--border-strong); color: var(--text); }
.btn-secondary:hover { color: var(--text); border-color: var(--mustard); }
.btn:hover { transform: translateY(-2px); }

.media-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin-top: 1rem; }

.figure, .sim-fig {
  margin: 0;
  background: rgba(13, 11, 30, 0.55);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}
.figure img, .sim-fig img { display: block; width: 100%; border-radius: 8px; }
.figure figcaption, .sim-fig figcaption { color: var(--text-dim); font-size: 0.86rem; margin-top: 0.6rem; line-height: 1.5; }
.sim-fig { margin: 0 0 1.25rem; }
.wide-img { display: block; width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.tag {
  background: rgba(62, 193, 180, 0.1);
  border: 1px solid rgba(62, 193, 180, 0.3);
  color: #9fe7de;
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  font-size: 0.85rem;
}

.callout {
  border-left: 4px solid var(--orange);
  padding: 0.9rem 1.2rem;
  background: rgba(255, 122, 69, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}
.callout.teal { border-left-color: var(--teal); background: rgba(62, 193, 180, 0.08); }

.muted { color: var(--text-dim); }
.small { font-size: 0.86rem; }

/* ---------- Hero (home) ---------- */
.hero { padding-top: 4.5rem; padding-bottom: 1.5rem; }
.hero .page-title { max-width: 820px; }

/* ---------- Truss / Inchworm animation ---------- */
.truss-wrap {
  position: relative;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 0 0.25rem;
  overflow: hidden;
}
.truss-hint {
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  margin: 0 0 0.25rem;
}
#truss-svg { display: block; width: 100%; height: 220px; }
.truss-line { stroke: var(--truss); stroke-width: 2; opacity: 0.85; }
.truss-brace { stroke: var(--truss); stroke-width: 1.4; opacity: 0.45; }
.truss-node { fill: var(--mustard); opacity: 0.75; }
#worm { cursor: pointer; }
.worm-seg { stroke: url(#wormGradient); stroke-width: 9; stroke-linecap: round; }
.worm-hip { fill: var(--worm-dark); stroke: #fff3da; stroke-width: 1.4; }
.worm-foot { fill: var(--worm-dark); stroke: #fff3da; stroke-width: 1; }
.worm-eye { fill: var(--bg); }

/* ---------- Steps ---------- */
.step-list { list-style: none; padding: 0; margin: 0.5rem 0 0; counter-reset: step; }
.step-list li {
  counter-increment: step;
  position: relative;
  padding: 0.2rem 0 1.1rem 3rem;
  border-left: 2px dotted var(--border-strong);
  margin-left: 1rem;
}
.step-list li::before {
  content: counter(step);
  position: absolute;
  left: -1.05rem;
  top: 0;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  background: var(--orange);
  color: var(--bg);
  font-family: var(--font-mono);
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step-list li:last-child { border-left-color: transparent; padding-bottom: 0; }

/* ---------- CAD viewer ---------- */
model-viewer {
  display: block;
  width: 100%;
  height: min(60vw, 520px);
  min-height: 320px;
  background: transparent;
  --progress-bar-color: var(--orange);
  --progress-bar-height: 3px;
}
.viewer-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: radial-gradient(circle at 50% 40%, rgba(255, 200, 87, 0.12), rgba(13, 11, 30, 0.95) 70%);
  overflow: hidden;
}
.viewer-frame figcaption { padding: 0.6rem 1rem; color: var(--text-dim); font-size: 0.85rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }

/* ---------- Spec list (hardware facts) ---------- */
.spec-list { list-style: none; margin: 0; padding: 0; }
.spec-list li { display: grid; grid-template-columns: 9rem 1fr; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px dashed var(--border); }
.spec-list li:last-child { border-bottom: none; }
.spec-list .k { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mustard); padding-top: 0.15rem; }

/* ---------- Agent workflow (project page) ---------- */
.flow { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.6rem; align-items: stretch; margin: 0.5rem 0 0; padding: 0; list-style: none; }
.flow li {
  position: relative;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 0.9rem 1rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.flow li b { display: block; color: var(--text); font-family: var(--font-head); font-weight: 400; font-size: 0.92rem; margin-bottom: 0.3rem; }
.flow li .who { display: inline-block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; padding: 0.05rem 0.5rem; margin-bottom: 0.45rem; }
.who.me { background: rgba(255, 200, 87, 0.18); color: var(--mustard); }
.who.ai { background: rgba(62, 193, 180, 0.16); color: #9fe7de; }
.who.both { background: rgba(255, 92, 138, 0.16); color: #ffb0c6; }
.flow li:not(:last-child)::after {
  content: "\2192";
  position: absolute;
  right: -0.62rem; top: 50%;
  transform: translate(50%, -50%);
  color: var(--orange);
  font-weight: 700;
  z-index: 2;
}
.loop-note { margin-top: 0.75rem; font-size: 0.88rem; color: var(--text-dim); font-family: var(--font-mono); }

.role-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.role-table th, .role-table td { text-align: left; vertical-align: top; padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--border); }
.role-table th { font-family: var(--font-mono); font-weight: 400; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-dim); }
.role-table td:first-child { white-space: nowrap; color: var(--text); font-weight: 500; }
.role-table tr:last-child td { border-bottom: none; }
.role-table .num-cell { font-family: var(--font-mono); white-space: nowrap; color: var(--mustard); }

.cost-bar { display: flex; height: 18px; border-radius: 999px; overflow: hidden; border: 1px solid var(--border); margin: 0.75rem 0 0.5rem; }
.cost-bar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 0.85rem; color: var(--text-dim); margin: 0; padding: 0; list-style: none; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 0.4rem; vertical-align: -1px; }

.big-number { font-family: var(--font-head); font-size: 2rem; color: var(--text); line-height: 1.1; }
.big-number + p { margin-top: 0.3rem; }

.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li { padding: 0.55rem 0 0.55rem 1.6rem; position: relative; border-bottom: 1px dashed var(--border); color: var(--text-dim); }
.lesson-list li:last-child { border-bottom: none; }
.lesson-list li strong { color: var(--text); }
.lesson-list.good li::before { content: "+"; color: var(--teal); }
.lesson-list.bad li::before { content: "\2212"; color: var(--pink); }
.lesson-list li::before { position: absolute; left: 0.2rem; top: 0.5rem; font-family: var(--font-mono); font-weight: 700; }

/* ---------- Dev log: at a glance ---------- */
.glance-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; }
.overall .pct { font-family: var(--font-head); font-size: 3rem; line-height: 1; color: var(--mustard); }
.overall .pct small { font-size: 1rem; color: var(--text-dim); font-family: var(--font-body); margin-left: 0.4rem; }

.progress {
  display: flex;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(243, 233, 210, 0.06);
  border: 1px solid var(--border);
}
.progress.lg { height: 22px; margin: 0.9rem 0 0.6rem; }
.progress span { display: block; height: 100%; }
.progress .done { background: var(--teal); }
.progress .doing { background: repeating-linear-gradient(135deg, var(--mustard) 0 8px, #f2b63f 8px 16px); }
.progress .todo { background: transparent; }
.key-done { background: var(--teal); }
.key-doing { background: var(--mustard); }
.key-todo { background: transparent; border: 1px solid var(--border-strong); }

.milestones { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.milestones li { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 7.5rem; gap: 0.4rem 1rem; align-items: center; padding: 0.7rem 0; border-bottom: 1px dashed var(--border); }
.milestones li:last-child { border-bottom: none; }
.ms-name { font-weight: 500; color: var(--text); line-height: 1.3; }
.ms-name .ms-id { font-family: var(--font-mono); font-size: 0.75rem; color: var(--mustard); margin-right: 0.4rem; }
.ms-name .ms-desc { display: block; font-weight: 400; font-size: 0.82rem; color: var(--text-dim); margin-top: 0.15rem; }
.ms-count { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-dim); text-align: right; line-height: 1.35; }
.ms-count b { color: var(--text); font-weight: 400; }
.ms-check { color: var(--teal); }

.status-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.25rem; }
.status-cards .card ul { margin: 0.25rem 0 0; padding-left: 1.1rem; color: var(--text-dim); }
.status-cards .card li + li { margin-top: 0.35rem; }
.blocker { border-color: rgba(255, 92, 138, 0.45); background: linear-gradient(180deg, rgba(255, 92, 138, 0.1), var(--panel) 60%); }
.blocker h3 { color: var(--pink); }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1.25rem; }
.stat { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.9rem 1rem; }
.stat b { display: block; font-family: var(--font-head); font-weight: 400; font-size: 1.5rem; color: var(--text); line-height: 1.2; }
.stat span { font-size: 0.83rem; color: var(--text-dim); }

/* Timeline of phases */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 3px; background: var(--stripe); border-radius: 3px; opacity: 0.8; }
.timeline li { position: relative; padding: 1.75rem 0.6rem 0 0; font-size: 0.86rem; color: var(--text-dim); }
.timeline li::before { content: ""; position: absolute; top: 2px; left: 0; width: 17px; height: 17px; border-radius: 50%; background: var(--bg); border: 3px solid var(--mustard); }
.timeline li.now::before { background: var(--orange); border-color: var(--orange); box-shadow: 0 0 0 5px rgba(255, 122, 69, 0.25); }
.timeline .when { display: block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mustard); }
.timeline a { color: var(--text); text-decoration: none; font-weight: 500; display: block; margin: 0.1rem 0 0.2rem; }
.timeline a:hover { color: var(--orange); }

/* Completed work by milestone */
.done-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.done-group h3 { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.done-group h3 small { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); letter-spacing: 0.05em; }
.done-list { list-style: none; margin: 0; padding: 0; }
.done-list li { padding: 0.55rem 0 0.55rem 1.7rem; position: relative; border-bottom: 1px dashed var(--border); color: var(--text-dim); font-size: 0.93rem; }
.done-list li:last-child { border-bottom: none; padding-bottom: 0; }
.done-list li::before { content: "\2713"; position: absolute; left: 0.15rem; top: 0.5rem; color: var(--teal); font-weight: 700; }
.done-list li b { color: var(--text); font-weight: 500; }

.task-id {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 0 0.35rem;
  margin-left: 0.25rem;
  vertical-align: 1px;
  white-space: nowrap;
}

/* ---------- Dev log entries ---------- */
.log-entry { padding: 1.6rem 1.9rem; scroll-margin-top: 90px; }
.log-entry + .log-entry { margin-top: 1.25rem; }
.log-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; margin-bottom: 0.4rem; }
.log-date { font-family: var(--font-mono); color: var(--text-dim); font-size: 0.8rem; letter-spacing: 0.05em; margin-left: auto; white-space: nowrap; }
.phase { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; border-radius: 999px; padding: 0.12rem 0.6rem; border: 1px solid currentColor; }
.phase.site { color: var(--violet); }
.phase.sim { color: #8ab4ff; }
.phase.hw { color: var(--orange); }
.phase.plan { color: var(--mustard); }
.phase.code { color: var(--teal); }
.phase.agents { color: var(--pink); }
.log-title { margin: 0 0 0.35rem; font-family: var(--font-head); font-weight: 400; font-size: 1.3rem; color: var(--text); }
.log-tldr { margin: 0 0 1.1rem; color: var(--text); font-size: 1.02rem; padding: 0.7rem 1rem; background: rgba(255, 200, 87, 0.07); border-radius: var(--radius-sm); border: 1px solid rgba(255, 200, 87, 0.18); }
.log-tldr::before { content: "In short \2014  "; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mustard); }
.log-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; }
.log-col { padding: 0 1.5rem; }
.log-col:first-child { padding-left: 0; border-right: 1px solid var(--border); }
.log-col:last-child { padding-right: 0; }
.log-col h4 { margin: 0 0 0.6rem; font-family: var(--font-mono); font-weight: 400; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.log-col ul { margin: 0; padding-left: 1.1rem; }
.log-col li { color: var(--text-dim); font-size: 0.95rem; }
.log-col li b { color: var(--text); font-weight: 500; }
.log-col li + li { margin-top: 0.5rem; }
.log-col p { margin-top: 0; font-size: 0.95rem; }
.log-col .notes { color: var(--text); font-style: italic; border-left: 3px solid var(--pink); padding-left: 0.9rem; }
.log-col .no-notes { color: var(--text-dim); font-style: italic; font-size: 0.9rem; }
.log-tasks { margin-top: 0.9rem; font-size: 0.8rem; color: var(--text-dim); }
.log-full { margin-top: 1.25rem; }

/* ---------- Simulation page ---------- */
table.sim-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.88rem; font-variant-numeric: tabular-nums; }
table.sim-table th, table.sim-table td { text-align: right; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); }
table.sim-table th { color: var(--mustard); font-family: var(--font-mono); font-weight: 400; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.7rem; }
table.sim-table td:first-child, table.sim-table th:first-child { text-align: left; }
table.sim-table tr.is-key td { color: var(--text); font-weight: 500; }
.ptag { display: inline-block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.1rem 0.45rem; border-radius: 6px; border: 1px solid currentColor; margin-right: 0.35rem; }
.tag-paper { color: #7be3b0; }
.tag-inferred { color: var(--mustard); }
.tag-derived { color: var(--teal); }
code.inline { font-size: 0.85em; }
pre.sim-pre { background: rgba(8, 6, 20, 0.8); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem; overflow-x: auto; font-family: var(--font-mono); font-size: 0.78rem; line-height: 1.55; color: #d9cfb8; }
.eq { font-family: var(--font-mono); color: var(--text); font-size: 0.9rem; text-align: center; padding: 0.6rem 0; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  text-align: center;
  padding: 2rem 1rem 2.25rem;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 2rem;
}
.site-footer::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: min(420px, 70%); height: 3px; background: var(--stripe); border-radius: 3px; }
.site-footer .egg-note { opacity: 0.4; font-family: var(--font-mono); font-size: 0.72rem; margin-top: 0.4rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .glance-top, .grid-2, .done-groups { grid-template-columns: 1fr; }
  .grid-3, .status-cards { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: 1fr; }
  .flow li:not(:last-child)::after { content: "\2193"; right: 50%; top: auto; bottom: -0.65rem; transform: translate(50%, 50%); }
  .timeline { grid-template-columns: 1fr; }
  .timeline::before { left: 7px; right: auto; top: 0; bottom: 0; width: 3px; height: auto; }
  .timeline li { padding: 0 0 1rem 2rem; }
  .timeline li::before { top: 3px; }
  .milestones li { grid-template-columns: 1fr auto; }
  .milestones .progress { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 760px) {
  .log-cols { grid-template-columns: 1fr; }
  .log-col { padding: 0; }
  .log-col:first-child { border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 1.1rem; margin-bottom: 1.1rem; }
}
@media (max-width: 640px) {
  html, body { font-size: 16px; }
  .site-nav { padding: 0.75rem 1rem; flex-wrap: wrap; }
  .nav-links a { padding: 0.35rem 0.55rem; font-size: 0.74rem; }
  #truss-svg { height: 160px; }
  model-viewer { min-height: 280px; }
  .panel, .log-entry { padding: 1.25rem; }
  .spec-list li { grid-template-columns: 1fr; gap: 0.1rem; }
  .role-table td:first-child { white-space: normal; }
}

/* ---------- Project: agent harness breakdown ---------- */
.harness h4 { margin: 1.1rem 0 0.4rem; font-family: var(--font-mono); font-weight: 400; font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.harness .grid-2 > div > h4:first-child { margin-top: 0.4rem; }
.harness .lesson-list li::before { content: "\2022"; color: var(--teal); }

/* ---------- Testing (project page) ---------- */
.flow.flow-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tg-safety { --tg: var(--pink); } .tg-drivers { --tg: var(--orange); } .tg-geometry { --tg: var(--mustard); }
.tg-crawl { --tg: var(--teal); } .tg-learning { --tg: var(--violet); } .tg-printing { --tg: #5b8cff; }
.tg-tooling { --tg: #8c84a3; } .tg-sim { --tg: #8ad4ff; }
.test-bar { display: flex; height: 22px; border-radius: 999px; overflow: hidden; border: 1px solid var(--border); margin: 0.75rem 0 0.7rem; }
.test-bar span { display: block; height: 100%; background: var(--tg); }
.legend i[class^="tg-"] { background: var(--tg); }
.tg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; margin-top: 1.25rem; }
.tg-card { background: var(--panel); border: 1px solid var(--border); border-top: 4px solid var(--tg); border-radius: var(--radius); padding: 1.1rem 1.2rem 1.2rem; }
.tg-card .tg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.tg-card h3 { margin: 0 0 0.5rem; font-family: var(--font-head); font-weight: 400; font-size: 1.02rem; }
.tg-card .tg-count { font-family: var(--font-mono); color: var(--tg); font-size: 1.15rem; white-space: nowrap; }
.tg-card p { margin: 0; color: var(--text-dim); font-size: 0.92rem; }
.tg-card p + p { margin-top: 0.55rem; }
.tg-card .tg-note { color: var(--text); font-size: 0.88rem; }
.tg-card .tg-files { font-size: 0.8rem; }
.tg-card .tg-files code { font-size: 0.78rem; }
@media (max-width: 900px) { .flow.flow-4 { grid-template-columns: 1fr; } }
