/* ============================================================
   Robótica Nova — Lab Notebook blog
   Surfaces: data-surface="dark" (default) | "paper"
   System: PRINTED figures = light beige cards;
           SCREEN blocks (code/terminal/scope) = always dark CRT.
   ============================================================ */

:root {
  --accent: #cf362f; /* Nova red (tweakable) */
  --screen-bg: #100f0c;
  --screen-bg2: #16150f;
  --green: #74d06c; /* phosphor */
  --green-dim: #4f7a4a;
  --amber: #e3a83f;
  --beige: #ddc9a0;
  --beige-dim: #b9a679;
  --measure: 66ch; /* line length (tweakable) */
  --fs: 19px; /* body size (tweakable) */
  --rail: 268px;
  --gut: 52px;
  --serif: "Spectral", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

/* ---------- DARK surface (default) ---------- */
body[data-surface="dark"] {
  --bg: #141310;
  --bg2: #1b1a14;
  --text: #e9e3d4;
  --text-soft: #9c9484;
  --head: #f4efe3;
  --hair: rgba(233, 227, 213, 0.13);
  --hair-strong: rgba(233, 227, 213, 0.28);
  --printed-bg: #e9e1cd;
  --printed-ink: #201e17;
  --printed-soft: #5d5742;
  --printed-hair: #c8bb98;
  --card: #1b1a14;
}
/* ---------- PAPER surface ---------- */
body[data-surface="paper"] {
  --bg: #efe9db;
  --bg2: #e6dfcd;
  --text: #2b2820;
  --text-soft: #726c5b;
  --head: #1b1913;
  --hair: rgba(43, 40, 32, 0.16);
  --hair-strong: rgba(43, 40, 32, 0.32);
  --printed-bg: #f6f0e1;
  --printed-ink: #201e17;
  --printed-soft: #6b6450;
  --printed-hair: #cabd9c;
  --card: #e7e0ce;
}

* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: var(--fs);
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition:
    background 0.3s,
    color 0.3s;
}
/* faint scanline / grain overlay across the whole page (toggle) */
body[data-scan="on"]::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 3px,
    rgba(0, 0, 0, 0.035) 3px 4px
  );
  mix-blend-mode: multiply;
  opacity: 0.7;
}
body[data-surface="dark"][data-scan="on"]::before {
  background: repeating-linear-gradient(
    0deg,
    transparent 0 3px,
    rgba(0, 0, 0, 0.22) 3px 4px
  );
  mix-blend-mode: normal;
}
/* …but every inserted block (code, terminal, charts, diagrams, photos) rides ABOVE
   the overlay on its opaque bg, so no scanlines fall on any of them */
.printed,
.screen {
  position: relative;
  z-index: 10;
}

::selection {
  background: var(--accent);
  color: #fff;
}
a {
  color: inherit;
}

/* reading progress */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 60;
  transition: width 0.08s linear;
}

/* ============ masthead ============ */
.masthead {
  border-bottom: 2px solid var(--hair-strong);
}
.masthead .topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.masthead .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.masthead .brand .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(207, 54, 47, 0.22);
}
.masthead .brand b {
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.01em;
  color: var(--head);
  white-space: nowrap;
}
.masthead .furniture {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}

/* ============ hero ============ */
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px 40px 30px;
}
.kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.hero h1 {
  font-weight: 800;
  font-size: clamp(40px, 6.4vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--head);
  margin: 14px 0 0;
  max-width: 15ch;
  text-wrap: balance;
}
.hero .dek {
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 23px);
  line-height: 1.5;
  color: var(--text);
  max-width: 54ch;
  margin: 20px 0 0;
  opacity: 0.92;
}
.byline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.byline .tag {
  border: 1.5px solid var(--hair-strong);
  padding: 3px 9px;
  border-radius: 2px;
}
.byline .tag.red {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.byline .sep {
  opacity: 0.4;
}

/* status console strip under hero */
.console {
  max-width: 1180px;
  margin: 22px auto 0;
  padding: 0 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.console .cell {
  border-top: 2px solid var(--hair-strong);
  padding: 12px 16px 12px 0;
}
.console .cell + .cell {
  padding-left: 22px;
  border-left: 1px solid var(--hair);
}
.console .cell .k {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.console .cell .v {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--head);
  margin-top: 4px;
}
.console .cell .v.live {
  color: var(--accent);
}
.console .cell .v .led {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 7px;
  box-shadow: 0 0 7px var(--accent);
  animation: blink 1.6s steps(1) infinite;
}
@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

/* ============ article grid ============ */
.article {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 40px 90px;
}
.block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail);
  column-gap: var(--gut);
  align-items: start;
  margin: 0;
}
.block > .main {
  min-width: 0;
  max-width: none;
}
.block > .main > p,
.block > .main > .pull,
.block > .main > .endmark {
  max-width: var(--measure);
}
.block > .rail {
  min-width: 0;
}

/* section header */
.sec {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 54px 0 22px;
}
.sec .no {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  padding: 3px 9px;
  border-radius: 2px;
  letter-spacing: 0.06em;
  flex: 0 0 auto;
}
.sec h2 {
  font-weight: 800;
  font-size: clamp(24px, 3vw, 33px);
  line-height: 1.1;
  color: var(--head);
  margin: 0;
  letter-spacing: -0.01em;
  flex: 0 0 auto;
}
.sec .line {
  flex: 1 1 0;
  min-width: 20px;
  height: 0;
  border-top: 1px solid var(--hair);
}

/* body type */
.main p {
  margin: 0 0 1.15em;
}
.main p.lead {
  font-size: 1.12em;
}
.main p:first-of-type::first-letter {
}
.drop::first-letter {
  font-weight: 800;
  float: left;
  font-size: 3.4em;
  line-height: 0.78;
  padding: 6px 10px 0 0;
  color: var(--accent);
}
.main strong {
  color: var(--head);
  font-weight: 700;
}
.main em {
}
code.inl {
  font-family: var(--mono);
  font-size: 0.82em;
  color: var(--green);
  background: color-mix(in oklab, var(--green) 14%, transparent);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid color-mix(in oklab, var(--green) 26%, transparent);
}
body[data-surface="paper"] code.inl {
  color: #2c6e2a;
  background: rgba(44, 110, 42, 0.1);
  border-color: rgba(44, 110, 42, 0.28);
}
.main a.link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1.5px solid color-mix(in oklab, var(--accent) 50%, transparent);
  padding-bottom: 1px;
}
.main a.link:hover {
  border-bottom-color: var(--accent);
}
sup.fn {
  font-family: var(--mono);
  font-size: 0.62em;
  color: var(--accent);
  font-weight: 700;
  vertical-align: super;
  padding: 0 1px;
  cursor: pointer;
}

/* pull quote */
.pull {
  font-weight: 800;
  font-style: italic;
  font-size: clamp(22px, 2.7vw, 30px);
  line-height: 1.22;
  color: var(--accent);
  border-top: 3px solid var(--accent);
  border-bottom: 3px solid var(--accent);
  padding: 18px 0;
  margin: 30px 0;
  max-width: 24ch;
}

/* ============ PRINTED figures (light cards) ============ */
figure {
  margin: 26px 0;
}
.printed {
  background: var(--printed-bg);
  color: var(--printed-ink);
  border: 1px solid var(--printed-hair);
  border-radius: 4px;
  padding: 0 22px 16px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 12px 30px rgba(0, 0, 0, 0.22);
}
body[data-surface="paper"] .printed {
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.04),
    0 8px 18px rgba(0, 0, 0, 0.08);
}
/* window-style top bar — mirrors the code/terminal title bar */
.printed .figlabel {
  margin: 0 -22px 18px;
  padding: 8px 15px;
  display: block;
  white-space: nowrap;
  background: var(--beige);
  border-bottom: 1px solid rgba(33, 30, 23, 0.22);
  border-radius: 4px 4px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #3f3a2b;
}
.printed .figlabel::before {
  content: "";
  display: inline-block;
  vertical-align: middle;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  margin-right: 9px;
}
.printed .figlabel b {
  color: var(--accent);
}

/* image placeholder (printed) */
.imgph {
  position: relative;
  border: 1px solid var(--printed-hair);
  border-radius: 3px;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(33, 30, 23, 0.05) 0 9px,
      transparent 9px 18px
    ),
    var(--printed-bg);
}
.imgph .meta {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: var(--printed-bg);
  border: 1px solid var(--printed-hair);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--printed-soft);
  padding: 3px 8px;
}
.imgph .hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--printed-soft);
  text-transform: uppercase;
  opacity: 0.7;
}
/* annotated callouts */
.imgph .callnum {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 3;
}
.imgph .callnum .n {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--printed-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}
.imgph .callnum span.t {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--printed-ink);
  background: rgba(246, 240, 225, 0.9);
  padding: 1px 6px;
  border-radius: 2px;
}

figcaption {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-soft);
  margin-top: 11px;
  display: flex;
  gap: 9px;
}
figcaption b {
  color: var(--accent);
  white-space: nowrap;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.printed figcaption {
  color: var(--printed-soft);
  margin-top: 13px;
}

/* ============ SCREEN blocks (dark CRT) ============ */
.screen {
  background: var(--screen-bg);
  border: 1px solid #2a281e;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.3),
    inset 0 0 40px rgba(0, 0, 0, 0.5);
}
/* code/terminal CRT scanline removed — inserted blocks read clean */
.screen::after {
  display: none;
}
.screen .titlebar {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--beige);
  color: #221f17;
  padding: 7px 12px;
  border-bottom: 1px solid #2a281e;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
}
.screen .titlebar > span:not(.led):not(.sp) {
  overflow: hidden;
  text-overflow: ellipsis;
}
.screen .titlebar .led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}
.screen .titlebar .sp {
  margin-left: auto;
  color: #5b513c;
}
.screen .scr {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
}

/* code */
pre.code {
  margin: 0;
}
pre.code code {
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.75;
  display: block;
  white-space: pre;
  color: #cfe6c8;
}
/* highlight.js phosphor theme */
.hljs {
  background: transparent;
  color: #cfe6c8;
}
.hljs-comment,
.hljs-quote {
  color: #5f7a59;
  font-style: italic;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-built_in,
.hljs-type {
  color: var(--amber);
}
.hljs-string,
.hljs-number,
.hljs-literal {
  color: var(--green);
}
.hljs-title,
.hljs-title.function_,
.hljs-function .hljs-title {
  color: #e8e2cf;
  font-weight: 700;
}
.hljs-params {
  color: #bfe0b8;
}
.hljs-meta {
  color: #cf6f42;
}
.hljs-attr,
.hljs-attribute,
.hljs-variable {
  color: #bfe0b8;
}
.hljs-punctuation {
  color: #7fae79;
}

/* terminal */
.term .scr {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}
.term .scr .ok {
  color: var(--green);
}
.term .scr .cmd {
  color: #f0e6cf;
}
.term .scr .cur {
  display: inline-block;
  width: 8px;
  height: 15px;
  background: var(--amber);
  vertical-align: -2px;
  animation: blink 1s steps(1) infinite;
}

/* oscilloscope chart */
/* oscilloscope chart — no scanline overlay (keeps the trace readable) */
.scope::after {
  display: none;
}
.scope .scr {
  padding: 0;
}
.scope svg {
  display: block;
  width: 100%;
  height: auto;
}
.scope .grid {
  stroke: rgba(116, 208, 108, 0.16);
  stroke-width: 1;
}
.scope .axis {
  stroke: rgba(116, 208, 108, 0.5);
  stroke-width: 1.5;
}
.scope .trace {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  filter: drop-shadow(0 0 4px rgba(207, 54, 47, 0.5));
}
.scope .trace2 {
  fill: none;
  stroke: var(--green);
  stroke-width: 2;
  stroke-dasharray: 5 4;
  opacity: 0.9;
}
.scope .lab {
  fill: rgba(207, 200, 180, 0.7);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============ MARGIN RAIL ============ */
.rail {
  font-family: var(--mono);
}
.rail > * + * {
  margin-top: 20px;
}
.note {
  border-left: 3px solid var(--accent);
  padding: 2px 0 2px 14px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-soft);
}
.note .lab {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
  font-weight: 700;
}
.note.plain {
  border-left-color: var(--hair-strong);
}
.note.plain .lab {
  color: var(--text-soft);
}
.rail .meta {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-soft);
}
.rail .meta .row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--hair);
}
.rail .meta .row b {
  color: var(--head);
  font-weight: 500;
}
.fnlist {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-soft);
}
.fnlist .item {
  display: flex;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--hair);
}
.fnlist .item b {
  color: var(--accent);
}
.rail .smallfig {
  margin: 0;
}

/* references block (full width-ish) */
.refs {
  margin-top: 60px;
  border-top: 2px solid var(--hair-strong);
  padding-top: 24px;
}
.refs h3 {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin: 0 0 18px;
}
.refs ol {
  list-style: none;
  counter-reset: r;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 48px;
}
.refs li {
  counter-increment: r;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-soft);
  padding-left: 34px;
  position: relative;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--hair);
}
.refs li::before {
  content: "[" counter(r) "]";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}
.refs li a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--hair-strong);
}
.refs li a:hover {
  color: var(--accent);
}
.refs .src {
  display: block;
  color: var(--accent);
  margin-top: 3px;
  opacity: 0.8;
}

/* end mark */
.endmark {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.endmark .sq {
  width: 11px;
  height: 11px;
  background: var(--accent);
}

/* footer */
.foot {
  border-top: 2px solid var(--hair-strong);
  margin-top: 40px;
}
.foot .in {
  max-width: 1180px;
  margin: 0 auto;
  padding: 30px 40px 70px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.foot .in .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

/* ============ responsive: collapse rail ============ */
@media (max-width: 980px) {
  .block {
    grid-template-columns: 1fr;
    row-gap: 0;
  }
  .block > .main {
    max-width: none;
  }
  .block > .rail {
    border-left: 3px solid var(--hair-strong);
    padding-left: 16px;
    margin: 6px 0 30px;
  }
  .rail > * + * {
    margin-top: 16px;
  }
  .console {
    grid-template-columns: 1fr 1fr;
  }
  .console .cell + .cell {
    border-left: none;
    padding-left: 0;
  }
  .refs ol {
    grid-template-columns: 1fr;
  }
  .hero,
  .article,
  .masthead .topbar,
  .console,
  .foot .in {
    padding-left: 24px;
    padding-right: 24px;
  }
}
@media (max-width: 560px) {
  .console {
    grid-template-columns: 1fr;
  }
  .sec {
    flex-wrap: wrap;
  }
  .sec h2 {
    white-space: normal;
  }
  .sec .line {
    flex-basis: 100%;
  }
}

/* ============================================================
   On Edgy's Lab — landing page styles
   Loads AFTER blog.css (reuses all tokens + masthead/console/sec/
   screen/printed/footer). Adds: nav, CP-500 chassis + boot screen,
   career trace, project header, entries index, links.
   ============================================================ */

/* ---------- masthead nav ---------- */
.masthead .nav {
  display: flex;
  gap: 20px;
  margin-left: 30px;
}
.masthead .nav a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-soft);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
  transition:
    color 0.12s,
    border-color 0.12s;
}
.masthead .nav a:hover {
  color: var(--head);
  border-bottom-color: var(--accent);
}
@media (max-width: 760px) {
  .masthead .nav {
    display: none;
  }
}

/* ---------- hero ---------- */
.hero .lead-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.hero .lead-row .tag-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(17px, 2vw, 21px);
  color: var(--text);
  opacity: 0.92;
}
.hero .latest {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero .latest:hover {
  color: var(--head);
}
.hero .latest .arr {
  transition: transform 0.15s;
}
.hero .latest:hover .arr {
  transform: translateX(4px);
}

/* ---------- CP-500 chassis ---------- */
.chassis {
  position: relative;
  max-width: 860px;
  margin: 6px auto 0;
  background: linear-gradient(158deg, #e6d6b0 0%, #d6c192 52%, #c9b487 100%);
  border-radius: 16px;
  padding: 20px 20px 40px;
  border: 1px solid rgba(0, 0, 0, 0.24);
  box-shadow:
    0 30px 60px rgba(0, 0, 0, 0.4),
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 -4px 10px rgba(0, 0, 0, 0.16);
}
body[data-surface="paper"] .chassis {
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.16),
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 -4px 10px rgba(0, 0, 0, 0.12);
}
.chassis .vents {
  position: absolute;
  top: -2px;
  right: 20px;
  display: flex;
  gap: 4px;
  transform: translateY(-50%);
}
.chassis .vents i {
  width: 3px;
  height: 22px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 2px;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.3);
}
.chassis .plate {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  pointer-events: none;
}
.chassis .plate .sq {
  display: flex;
  gap: 2px;
}
.chassis .plate .sq i {
  width: 5px;
  height: 5px;
  background: #5b513c;
}
.chassis .plate b {
  font-family: var(--serif);
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: #5b513c;
  white-space: nowrap;
}
.chassis .pwr {
  position: absolute;
  right: 22px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chassis .pwr .led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 7px var(--accent);
  animation: blink 1.6s steps(1) infinite;
}
.chassis .pwr span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.18em;
  color: #5b513c;
}
.chassis .knob {
  position: absolute;
  left: 22px;
  bottom: 8px;
  width: 26px;
  height: 13px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.28);
}

/* boot screen (a .screen, recessed) */
.boot {
  border: 2px solid #0c0b08;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.4),
    inset 0 0 50px rgba(0, 0, 0, 0.7);
  cursor: default;
}
.boot .titlebar {
  cursor: default;
}
.boot .scr {
  min-height: 23em;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
}
.boot .bl {
  min-height: 1.7em;
  white-space: pre-wrap;
}
.boot .b-title {
  color: #a6ec99;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.boot .b-dim {
  color: #5f9a59;
}
.boot .b-cmd {
  color: #e3a83f;
}
.boot .b-info {
  color: #7bd673;
}
.boot .b-quote {
  color: #cdebc8;
  font-style: italic;
}
.boot .b-active {
  color: #7bd673;
}
.boot .b-active .hot {
  color: var(--accent);
  font-weight: 700;
}
.boot .cur {
  display: inline-block;
  width: 9px;
  height: 15px;
  background: #e3a83f;
  vertical-align: -2px;
  margin-left: 1px;
  animation: blink 1s steps(1) infinite;
}

/* ---------- career trace (printed figure) ---------- */
.trace {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 4px;
}
.tnode {
  position: relative;
  border: 1.5px solid var(--printed-ink);
  background: #f4ecd6;
  color: var(--printed-ink);
  border-radius: 3px;
  padding: 9px 12px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  min-width: 84px;
}
.tnode .sub {
  display: block;
  font-size: 8.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--printed-soft);
  margin-top: 3px;
}
.tnode.now {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tnode.now .sub {
  color: rgba(255, 255, 255, 0.8);
}
.tnode.aborted {
  opacity: 0.92;
}
.tnode .xtag {
  position: absolute;
  top: -9px;
  right: -9px;
  background: var(--accent);
  color: #fff;
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 2px;
  border: 1.5px solid #f4ecd6;
  transform: rotate(4deg);
}
.tarrow {
  color: var(--printed-soft);
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  flex: 0 0 auto;
}

/* ---------- projects ---------- */
.projhead {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  margin: 2px 0 4px;
}
.projhead h2 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(30px, 4.4vw, 50px);
  line-height: 1;
  letter-spacing: -0.015em;
  color: var(--head);
  margin: 0;
  white-space: nowrap;
}
.projhead .badge {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 4px 9px;
  border-radius: 2px;
  font-weight: 700;
  align-self: center;
  white-space: nowrap;
}
.projhead .badge.idle {
  background: transparent;
  color: var(--text-soft);
  border: 1.5px solid var(--hair-strong);
}

/* entries index — directory listing */
.entries {
  border: 1px solid var(--hair-strong);
  border-radius: 6px;
  overflow: hidden;
  margin: 24px 0 8px;
}
.entries .ehead {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--beige);
  color: #221f17;
  padding: 7px 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  white-space: nowrap;
}
.entries .ehead .led {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  flex: 0 0 auto;
}
.entries .ehead .sp {
  margin-left: auto;
  color: #5b513c;
}
.entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: baseline;
  padding: 16px 16px;
  border-top: 1px solid var(--hair);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}
.entries .entry:first-of-type {
  border-top: none;
}
a.entry:hover {
  background: color-mix(in oklab, var(--accent) 9%, transparent);
}
.entry .no {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  font-weight: 700;
  line-height: 1.5;
}
.entry .ttl b {
  display: block;
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.2;
  color: var(--head);
}
.entry .ttl .dek {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-soft);
  margin-top: 3px;
}
.entry .end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-align: right;
  white-space: nowrap;
  line-height: 1.5;
}
.entry .end .date {
  color: var(--text-soft);
  text-transform: uppercase;
}
.entry .end .st {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.entry .end .st.pub {
  color: var(--accent);
}
.entry .end .st.pub .arr {
  transition: transform 0.15s;
}
a.entry:hover .end .st.pub .arr {
  transform: translateX(3px);
}
.entry .end .st.soon {
  color: var(--text-soft);
  border: 1.5px solid var(--hair-strong);
  border-radius: 2px;
  padding: 2px 7px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.entry.soon {
  opacity: 0.62;
}
.entry.soon:hover {
  background: none;
}

/* ---------- links (rail) ---------- */
.links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
a.linkrow {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--hair-strong);
  border-radius: 4px;
  padding: 11px 13px;
  font-family: var(--mono);
  font-size: 12px;
  text-decoration: none;
  color: var(--text);
  transition:
    border-color 0.12s,
    color 0.12s;
}
a.linkrow:hover {
  border-color: var(--accent);
  color: var(--head);
}
a.linkrow .k {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.06em;
}
a.linkrow .v {
  color: var(--text-soft);
}
a.linkrow .arr {
  margin-left: auto;
  color: var(--text-soft);
}
a.linkrow:hover .arr {
  color: var(--accent);
}

/* keep short rail metadata values on one line */
.rail .meta .row b {
  white-space: nowrap;
}

/* about lead paragraph spacing parity */
#about .main > p:first-of-type {
  margin-top: 4px;
}

@media (max-width: 560px) {
  .entry {
    grid-template-columns: auto 1fr;
  }
  .entry .end {
    grid-column: 2;
    text-align: left;
    margin-top: 6px;
  }
  .entry .end .st {
    margin-top: 4px;
  }
}

/* ============================================================
   SPLASH — Night Lab (illustrated CP-500, "enter the lab")
   ============================================================ */
.splash {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 58px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(
      46% 42% at 50% 42%,
      rgba(116, 208, 108, 0.16),
      rgba(7, 8, 9, 0) 70%
    ),
    #070809;
}
/* vignette + a gentle fade into the page surface at the bottom (lights coming up) */
.splash::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(
      120% 96% at 50% 44%,
      transparent 40%,
      rgba(0, 0, 0, 0.62) 100%
    ),
    linear-gradient(180deg, transparent 76%, var(--bg) 100%);
}
.splash-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1180px;
  padding: 18px 40px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.splash .kicker {
  color: #7bd673;
  justify-content: center;
  margin-bottom: 8px;
  white-space: nowrap;
}

/* the machine — sized to fit the viewport so the CTA stays visible */
.cp500 {
  position: relative;
  width: min(
    calc(780px * var(--mscale, 1)),
    92vw,
    calc((100vh - 260px) * 1.281)
  );
  max-width: 100%;
  aspect-ratio: 820/640;
  container-type: inline-size;
  margin: 0 auto;
}
.cp500 > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 26px 40px rgba(0, 0, 0, 0.5));
}
.cp500 .glow {
  position: absolute;
  left: 50%;
  top: 33%;
  width: 96%;
  height: 80%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 0;
  background: radial-gradient(
    closest-side,
    rgba(116, 208, 108, 0.5),
    rgba(116, 208, 108, 0) 72%
  );
  filter: blur(26px);
  opacity: 0.55;
  pointer-events: none;
}
.cp500 .glass {
  position: absolute;
  left: 16.6%;
  top: 13.4%;
  width: 40.2%;
  height: 40.4%;
  z-index: 1;
  overflow: hidden;
  background: radial-gradient(
    125% 130% at 50% 26%,
    #171810 0%,
    #0d0e08 68%,
    #070806 100%
  );
  box-shadow: inset 0 0 14cqw rgba(0, 0, 0, 0.85);
}
.cp500 .glass::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0 2px,
    rgba(0, 0, 0, 0.26) 2px 4px
  );
}
body[data-scan="off"] .cp500 .glass::after {
  display: none;
}
.cp500 .scr {
  position: relative;
  z-index: 1;
  padding: 8% 7% 0 11.5%;
  font-family: var(--mono);
  font-size: 1.78cqw;
  line-height: 1.42;
  white-space: pre;
  text-align: left;
}
.cp500 .bl {
  min-height: 1.42em;
}
.cp500 .b-title {
  color: #a6ec99;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.cp500 .b-dim {
  color: #5f9a59;
}
.cp500 .b-cmd {
  color: #e3a83f;
}
.cp500 .b-info {
  color: #7bd673;
}
.cp500 .b-active {
  color: #7bd673;
}
.cp500 .cur {
  display: inline-block;
  width: 0.62em;
  height: 1em;
  background: #e3a83f;
  vertical-align: -0.12em;
  animation: blink 1s steps(1) infinite;
}

/* enter-the-lab CTA */
.enter {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #0c0d08;
  background: #7bd673;
  text-decoration: none;
  padding: 13px 24px;
  border-radius: 4px;
  font-weight: 700;
  box-shadow: 0 0 0 0 rgba(123, 214, 108, 0.5);
  transition:
    box-shadow 0.25s,
    transform 0.12s,
    background 0.15s;
}
.enter:hover {
  background: #8fe086;
  box-shadow: 0 0 26px rgba(123, 214, 108, 0.45);
}
.enter:active {
  transform: translateY(1px);
}
.enter .ar {
  display: inline-block;
  animation: enterbob 1.5s ease-in-out infinite;
}
@keyframes enterbob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

/* scroll cue */
.scrollcue {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  z-index: 2;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
  opacity: 0.7;
  transition: opacity 0.3s;
}
.scrollcue.hide {
  opacity: 0;
}

/* lights-up reveal for content blocks (JS-armed so it's safe without JS) */
body.reveal-on .block,
body.reveal-on .refs {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.65s ease,
    transform 0.65s ease;
}
body.reveal-on .block.in,
body.reveal-on .refs.in {
  opacity: 1;
  transform: none;
}

@media (max-width: 760px) {
  .splash {
    min-height: auto;
    padding: 30px 0 50px;
  }
  .cp500 {
    width: min(560px, 92vw);
  }
}

/* ============ SMALTO CODE THEME ============ */
pre.code .smalto-keyword {
  color: #c9a227;
}
pre.code .smalto-string {
  color: #74d06c;
}
pre.code .smalto-comment {
  color: #5f9a59;
  font-style: italic;
}
pre.code .smalto-number {
  color: #d8732b;
}
pre.code .smalto-function,
pre.code .smalto-type {
  color: #a6ec99;
}
pre.code .smalto-operator,
pre.code .smalto-punctuation {
  color: #cfe6c8;
}
pre.code .smalto-variable {
  color: #cfe6c8;
}
pre.code .smalto-module {
  color: #a6ec99;
}
pre.code .smalto-constant,
pre.code .smalto-builtin {
  color: #d8732b;
}
pre.code .smalto-tag,
pre.code .smalto-attribute {
  color: #c9a227;
}
pre.code .smalto-selector,
pre.code .smalto-property {
  color: #74d06c;
}
pre.code .smalto-regex {
  color: #d8732b;
}
pre.code .smalto-directive,
pre.code .smalto-directive-hash {
  color: #c9a227;
  font-weight: 500;
}
