@font-face {
  font-family: "Chakra Petch";
  src: url("fonts/ChakraPetch-BoldItalic.woff2") format("woff2");
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Space Mono";
  src: url("fonts/SpaceMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Mono";
  src: url("fonts/SpaceMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Zen Kaku Gothic New";
  src: url("fonts/ZenKakuGothicNew-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* field */
  --paper:      #f5f5f2;  /* page field, slightly warm white */
  --panel:      #ffffff;  /* cards, strip rows, table zebra base */
  --ink:        #12141d;  /* prose, near-black with a blue cast */
  --muted:      #5c6270;  /* secondary text, captions */
  --rule:       #c9ccd6;  /* hairlines, table rules, card borders */
  --ghost:      #d4d7df;  /* ghost-type outlines, ghosted mark */

  /* the one saturated hue */
  --blue:       #1a2fc4;  /* royal blue: display type, ticks, links, active nav */
  --blue-press: #101f8e;  /* hover / active darkening */
  --blue-wash:  #e9ecfb;  /* 10%-tint fill: active-nav block, LAST chip bg */

  /* state chips — semantics unchanged, recolored for the white field */
  --done:       #0c7a3d;  --done-bg:   #e3f2e9;  /* step 1 only, ever */
  --open:       #9a6400;  --open-bg:   #faf0d9;
  --parked:     #646a76;  --parked-bg: #edeef2;
  --last:       #2f3ea8;  --last-bg:   var(--blue-wash);

  /* plots stay printouts */
  --plot:       #ffffff;  /* plot-card face */
  --plot-rule:  #c9ccd6;

  /* type stacks */
  --display: "Chakra Petch", ui-sans-serif, system-ui, sans-serif;
  --mono: "Space Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(26, 47, 196, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 47, 196, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
}

/* viewport frame — the monitor */
body::after {
  content: "";
  position: fixed;
  inset: 8px;
  border: 1.5px solid var(--blue);
  border-radius: 14px;
  pointer-events: none;
  z-index: 60;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  color: var(--blue-press);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

code,
.num,
table,
.chip,
.mark,
.step-n,
.card-k,
.card-v,
.step-copy,
.scalar,
dt,
dd,
.stamp,
.nav-wide a,
.nav-narrow a,
.nav-narrow summary,
.strip-go,
.step-actions button {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

code {
  font-size: 0.86em;
  color: var(--blue-press);
}

/* header + wordmark */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.75rem;
  border-bottom: 1px solid var(--rule);
  background: rgba(245, 245, 242, 0.94);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  color: var(--blue);
  text-decoration: none;
}

.mark-word {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  white-space: nowrap;
}

.mark-en {
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
}

.mark-jp {
  font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.mark:hover {
  text-decoration: none;
  color: var(--blue-press);
}

.mark-circles {
  --ring: 15px;
  position: relative;
  display: inline-block;
  width: var(--ring);
  height: var(--ring);
  border: 2px solid var(--blue);
  border-radius: 50%;
  flex-shrink: 0;
  margin-right: 22px;
}

.mark-circles::before,
.mark-circles::after {
  content: "";
  position: absolute;
  top: -2px;
  width: var(--ring);
  height: var(--ring);
  border: 2px solid var(--blue);
  border-radius: 50%;
}

.mark-circles::before {
  left: 9px;
}

.mark-circles::after {
  left: 18px;
}

.mark-circles-ghost,
.mark-circles-ghost::before,
.mark-circles-ghost::after {
  border-color: var(--ghost);
}

/* frame ticks */
.site-header::after,
.site-footer::after {
  position: fixed;
  z-index: 61;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--blue);
  white-space: nowrap;
}

.site-header::after {
  content: "scoo74 - sCO2 turbine";
  top: 14px;
  right: 22px;
}

.site-footer::after {
  content: "AGI Testbench 0.3.1";
  bottom: 14px;
  right: 22px;
}

.nav-wide {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.75rem;
  align-items: center;
}

.nav-wide a,
.nav-narrow a {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: border-color 120ms, background-color 120ms, box-shadow 120ms;
}

.nav-wide a:hover,
.nav-narrow a:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.nav-wide a[aria-current="page"],
.nav-narrow a[aria-current="page"] {
  color: #fff;
  background: var(--blue);
  padding: 0.14rem 0.45rem;
  text-decoration: none;
}

.nav-narrow {
  display: none;
}

.nav-narrow summary {
  cursor: pointer;
  color: var(--blue);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  list-style: none;
  border: 1px solid var(--blue);
  padding: 0.18rem 0.5rem;
}

.nav-narrow summary::-webkit-details-marker {
  display: none;
}

.nav-narrow nav {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.6rem;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.75rem 2.5rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--rule);
  padding: 0.7rem 1.75rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.foot-copy {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.stamp {
  display: none;
}

.banner {
  margin: 0 0 1.1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--blue);
  background: var(--panel);
  color: var(--ink);
  font-size: 0.92rem;
}

.banner strong {
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 700;
}

h1 {
  position: relative;
  isolation: isolate;
  z-index: 0;
  margin: 0.35rem 0 0.45rem;
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--blue);
  line-height: 0.95;
}

.outline-type {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--blue);
}

@supports not (-webkit-text-stroke: 1px black) {
  .outline-type {
    color: var(--blue);
    opacity: 0.35;
  }
}

h1[data-ghost]::before {
  content: attr(data-ghost);
  position: absolute;
  left: 1.2em;
  top: -0.62em;
  color: transparent;
  -webkit-text-stroke: 1.2px var(--ghost);
  font-size: 1.06em;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
  pointer-events: none;
  z-index: -1;
}

.lede {
  margin: 0 0 1rem;
  color: var(--muted);
}

.chip {
  display: inline-block;
  padding: 0.08rem 0.42rem;
  border: 1px solid currentColor;
  font-size: 0.68rem;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 0.1em;
  line-height: 1.3;
}

.chip-done {
  color: var(--done);
  background: var(--done-bg);
}

.chip-open {
  color: var(--open);
  background: var(--open-bg);
}

.chip-parked {
  color: var(--parked);
  background: var(--parked-bg);
}

.chip-last {
  color: var(--last);
  background: var(--last-bg);
}

/* Home: one laptop screen */
body.home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.home main {
  flex: 1;
  max-width: 1240px;
  padding: 0.3rem 1.75rem 0.2rem;
}

body.home h1 {
  font-size: 1.08rem;
  text-transform: none;
  letter-spacing: 0.02em;
  margin: 0 0 0.08rem;
}

body.home .lede {
  margin-bottom: 0.32rem;
  font-size: 0.84rem;
}

.strip {
  display: grid;
  gap: 0.16rem;
  margin: 0 0 0.4rem;
}

.strip-row {
  display: grid;
  grid-template-columns: 2rem 4.6rem 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.16rem 0.45rem;
  border: 1px solid var(--rule);
  background: var(--panel);
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms, background-color 120ms, box-shadow 120ms;
}

.strip-row:hover {
  border-color: var(--blue);
  box-shadow: 2px 2px 0 var(--blue);
  text-decoration: none;
  color: inherit;
}

.step-n {
  color: var(--muted);
  font-size: 0.8rem;
}

.strip-title {
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.strip-go {
  color: var(--blue);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.strip-go::after {
  content: " →";
}

.headline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.32rem;
}

.card {
  display: block;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--rule);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
  min-height: 4.15rem;
  transition: border-color 120ms, background-color 120ms, box-shadow 120ms;
}

.card:hover {
  border-color: var(--blue);
  box-shadow: 2px 2px 0 var(--blue);
  text-decoration: none;
  color: inherit;
}

.card-k {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--blue);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.card-v {
  font-size: 0.78rem;
  line-height: 1.35;
}

.caveat {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.74rem;
}

/* Inner pages */
.steps {
  display: grid;
  gap: 0.75rem;
}

.step {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--rule);
  background: var(--panel);
}

.step-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}

.step .step-n {
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--blue);
}

@supports not (-webkit-text-stroke: 1px black) {
  .step .step-n {
    color: var(--blue);
    opacity: 0.55;
    -webkit-text-stroke: 0;
  }
}

.step-copy {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
}

.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.15rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  border-top: 2px solid var(--blue);
}

th,
td {
  padding: 0.38rem 0.5rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.66rem;
}

tbody tr:hover {
  background: var(--blue-wash);
}

.scalars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.45rem;
  margin: 0 0 1.15rem;
}

.scalar {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--rule);
  background: var(--panel);
}

.scalar dt {
  margin: 0 0 0.2rem;
  color: var(--blue);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.scalar dd {
  margin: 0;
  font-size: 0.88rem;
}

h2 {
  margin: 1.4rem 0 0.55rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}

.note {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

figure {
  margin: 0 0 1.4rem;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
}

figure.cad img,
figure:not(:has(.plot-card)) img {
  border: 1px solid var(--rule);
}

.plot-card {
  background: var(--plot);
  border: 1px solid var(--plot-rule);
  border-top: 2px solid var(--blue);
  padding: 0.45rem;
}

.plot-card img {
  border: 0;
}

figcaption {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.locks td:first-child {
  width: 13rem;
  color: var(--blue);
  font-weight: 700;
  white-space: nowrap;
}

/* 404 hero — outlined 404, solid ghost */
.hero-404,
.hero-404 .num {
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(4rem, 18vw, 7rem);
  line-height: 0.9;
  letter-spacing: 0.02em;
}

.hero-404.outline-type,
.hero-404.outline-type .num {
  color: transparent;
  -webkit-text-stroke: 2.5px var(--blue);
}

.hero-404[data-ghost]::before {
  color: var(--blue);
  -webkit-text-stroke: 0;
  left: 0.32em;
  top: 0.16em;
  overflow: visible;
}

/* /step switcher + viewer */
.step-switcher {
  width: 100%;
}

.step-switcher th:last-child,
.step-switcher td:last-child {
  white-space: nowrap;
}

.step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
}

.step-actions button {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--panel);
  border: 1px solid var(--blue);
  padding: 0.22rem 0.5rem;
  cursor: pointer;
  transition: border-color 120ms, background-color 120ms, box-shadow 120ms;
}

.step-actions button:hover {
  background: var(--blue-wash);
}

.step-actions button[aria-pressed="true"] {
  background: var(--blue);
  color: #fff;
}

.step-view {
  position: relative;
  margin: 1.15rem 0 0;
  min-height: 65vh;
  border: 1.5px solid var(--blue);
  border-radius: 10px;
  background: var(--ink);
}

.step-view-status {
  position: relative;
  z-index: 2;
  padding: 1.1rem 1rem;
  color: var(--ghost);
  font-size: 0.92rem;
  background: var(--ink);
  border-radius: 10px;
}

.step-view-status.is-error {
  color: #ffffff;
}

.step-view-status.is-loading code {
  color: #ffffff;
}

.step-view-status a {
  color: #aab4ff;
}

.step-view-host {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.step-view-host.is-ready {
  position: relative;
  height: 65vh;
}

.step-view-host canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@media (min-width: 901px) {
  .site-header {
    padding-top: 1.35rem;
  }
}

@media (max-width: 900px) {
  .site-header::after {
    display: none;
  }

  .headline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strip-row {
    grid-template-columns: 2rem 4.6rem 1fr;
  }

  .strip-go {
    display: none;
  }

  .strip-title {
    white-space: normal;
  }

  .locks td:first-child {
    white-space: normal;
  }
}

@media (max-width: 720px) {
  body::after {
    inset: 5px;
    border-radius: 10px;
  }

  .nav-wide {
    display: none;
  }

  .nav-narrow {
    display: block;
  }

  .headline {
    grid-template-columns: 1fr;
  }

  body.home {
    display: block;
  }

  .site-footer {
    flex-wrap: wrap;
  }

  .step-view,
  .step-view-host.is-ready {
    min-height: 55vh;
    height: 55vh;
  }

  h1[data-ghost]::before {
    left: 0.45em;
    top: -0.42em;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
