/*
  PROPOSITION A - "OutOS deep tech" multi-page exploration.
  Keeps the engineered-monochrome identity, adds depth: layered living
  backgrounds, scroll reveals, a persistent status rail, real content pages.
  Tokens from design/systems/outos.md. Monochrome only. No network assets.
*/
:root {
  --out-bg: #1c1c1c;
  --out-bg-deep: #101010;
  --out-panel: #262626;
  --out-panel-2: #303030;
  --out-line: rgba(245,245,240,0.16);
  --out-line-strong: rgba(245,245,240,0.34);
  --out-text: #F4F4F0;
  --out-muted: #B8B8B0;
  --out-dim: #7C7C76;
  --out-invert: #080808;
  --out-t: 0.2s ease;
  --r-sm: 2px;
  --r-md: 6px;
  --r-lg: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: clamp(13px, 12.25px + 0.098vw, 16px); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--out-text);
  background: var(--out-bg-deep);
  font-family: "Montserrat", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  line-height: 1.55;
  overflow-x: hidden;
}
.mono { font-family: "Cascadia Mono", "Roboto Mono", ui-monospace, monospace; }
.micro {
  color: var(--out-dim);
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 800;
}
i { font-style: normal; color: var(--out-dim); }
a { color: inherit; }

/* ================= living background (layered, parallax via JS) ========= */
.field {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: var(--out-bg-deep);
}
.field .stars-far,
.field .stars-near,
.field .twinkle {
  position: absolute;
  inset: -20% 0;
  pointer-events: none;
  will-change: transform;
}
.field .stars-far {
  background-image: radial-gradient(circle, rgba(245,245,240,0.12) 1px, transparent 1.5px);
  background-size: 210px 230px;
}
.field .stars-near {
  background-image: radial-gradient(circle, rgba(245,245,240,0.2) 1.2px, transparent 1.8px);
  background-size: 120px 135px;
  background-position: 60px 40px;
}
.field .twinkle {
  background-image: radial-gradient(circle, rgba(245,245,240,0.65) 1.3px, transparent 2.2px);
  background-size: 460px 380px;
  background-position: 90px 60px;
  animation: tw 5s ease-in-out infinite;
}
@keyframes tw { 0%, 100% { opacity: 0.12; } 50% { opacity: 0.85; } }
.field .rails {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, rgba(245,245,240,0.10) 0 1px, transparent 1px 330px);
}
.field .pulse {
  position: absolute;
  top: -90px;
  width: 1px;
  height: 90px;
  background: linear-gradient(180deg, transparent, rgba(245,245,240,0.8));
  animation: pulse-run 7s linear infinite;
}
.field .pulse.p1 { left: 18%; animation-duration: 7.4s; }
.field .pulse.p2 { left: 52%; animation-duration: 6.2s; animation-delay: 2.6s; }
.field .pulse.p3 { left: 84%; animation-duration: 8.4s; animation-delay: 1.2s; }
@keyframes pulse-run {
  0% { transform: translateY(0); opacity: 0; }
  8% { opacity: 1; }
  92% { opacity: 1; }
  100% { transform: translateY(calc(100vh + 180px)); opacity: 0; }
}
.field .vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 50%, rgba(8,8,8,0.6));
}

/* ================= chrome: nav ========================================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--out-line);
  background: rgba(16,16,16,0.92);
  backdrop-filter: blur(6px);
}
.nav .wordmark { line-height: 0; margin-right: 6px; }
.nav .wordmark img { height: 24px; width: auto; display: block; }
.nav .links {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.nav .links a {
  text-decoration: none;
  color: var(--out-muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  transition: color var(--out-t), border-color var(--out-t), background var(--out-t);
}
.nav .links a:hover { color: var(--out-text); border-color: var(--out-line); }
.nav .links a.on {
  color: var(--out-invert);
  background: var(--out-text);
}
.nav .rail {
  margin-left: auto;
  display: flex;
  gap: 14px;
  color: var(--out-dim);
  font-size: 0.7rem;
  white-space: nowrap;
}
.nav .rail b { color: var(--out-muted); font-weight: 600; }

/* ================= layout ============================================== */
.main {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 30px 0 40px;
  flex: 1;
}
.page-head {
  margin: 14px 0 26px;
  max-width: 70ch;
}
.page-head h1 {
  font-size: clamp(2rem, 1.2rem + 2.6vw, 3.6rem);
  line-height: 1;
  font-weight: 900;
  margin: 6px 0 12px;
}
.page-head p { color: var(--out-muted); max-width: 62ch; }

.section {
  margin: 26px 0;
  border: 1px solid var(--out-line);
  border-radius: var(--r-lg);
  background: rgba(28,28,28,0.92);
  padding: 22px;
}
.section > h2 {
  font-size: clamp(1.2rem, 1rem + 1vw, 1.8rem);
  font-weight: 800;
  line-height: 1.1;
  margin: 4px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--out-line);
}
.section .lead { color: var(--out-muted); max-width: 72ch; margin-bottom: 12px; }

/* fact rows */
.rows { display: grid; }
.row {
  display: grid;
  grid-template-columns: minmax(11rem, 17rem) minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  min-height: 40px;
  border-bottom: 1px solid var(--out-line);
  padding: 8px 0;
  font-size: 0.92rem;
}
.row:last-child { border-bottom: 0; }
.row span { color: var(--out-dim); text-transform: uppercase; font-size: 0.72rem; font-weight: 800; }
.row strong { font-weight: 600; overflow-wrap: anywhere; }
.row strong em { font-style: normal; color: var(--out-muted); font-weight: 400; }

/* step ladder */
.ladder { display: grid; gap: 0; counter-reset: step; }
.rung {
  display: flex;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--out-line);
}
.rung:first-child { border-top: 0; }
.rung .idx {
  flex: 0 0 auto;
  color: var(--out-dim);
  font-size: 0.8rem;
  padding-top: 3px;
}
.rung strong { display: block; font-size: 1rem; }
.rung p { color: var(--out-muted); font-size: 0.88rem; max-width: 78ch; }
.rung .tok {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--out-muted);
  border: 1px solid var(--out-line);
  border-radius: var(--r-sm);
  padding: 2px 8px;
  background: var(--out-bg-deep);
}

/* status badges for roadmap truth */
.badge {
  display: inline-block;
  font-family: "Cascadia Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  border: 1px solid var(--out-line-strong);
  vertical-align: middle;
}
.badge.proven { background: var(--out-text); color: var(--out-invert); }
.badge.partial { background: var(--out-panel-2); color: var(--out-text); }
.badge.planned { color: var(--out-dim); }

/* milestones */
.milestone {
  border-top: 1px solid var(--out-line);
  padding: 16px 0;
}
.milestone:first-of-type { border-top: 0; }
.milestone header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.milestone h3 { font-size: 1.1rem; font-weight: 800; }
.milestone ul {
  list-style: none;
  display: grid;
  gap: 5px;
}
.milestone li {
  color: var(--out-muted);
  font-size: 0.88rem;
  padding-left: 18px;
  position: relative;
}
.milestone li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 1px;
  background: var(--out-dim);
}

/* danger/never band */
.never {
  border: 1px double var(--out-line-strong);
  border-radius: var(--r-md);
  background: var(--out-bg-deep);
  padding: 14px 16px;
  margin-top: 14px;
}
.never strong { text-transform: uppercase; font-size: 0.8rem; }
.never ul { list-style: none; margin-top: 8px; display: grid; gap: 4px; }
.never li { color: var(--out-muted); font-size: 0.88rem; padding-left: 18px; position: relative; }
.never li::before { content: "\00d7"; position: absolute; left: 2px; color: var(--out-text); }

/* download console (home) */
.dl-console {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 26px;
  padding: 28px 26px;
  border: 1px solid var(--out-line);
  border-radius: var(--r-lg);
  background: rgba(16,16,16,0.94);
}
.dl-console::before,
.dl-console::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  opacity: 0.55;
}
.dl-console::before { top: -1px; left: -1px; border-top: 2px solid var(--out-text); border-left: 2px solid var(--out-text); }
.dl-console::after { bottom: -1px; right: -1px; border-bottom: 2px solid var(--out-text); border-right: 2px solid var(--out-text); }
.dl-copy h1 {
  margin: 6px 0 10px;
  font-size: clamp(2.1rem, 1.2rem + 3vw, 4.2rem);
  line-height: 0.98;
  font-weight: 900;
}
.dl-sub { max-width: 62ch; color: var(--out-muted); }
.dl-action {
  display: grid;
  align-content: start;
  gap: 10px;
  border-left: 1px solid var(--out-line);
  padding-left: 26px;
}
.download {
  display: grid;
  gap: 3px;
  min-height: 64px;
  align-content: center;
  border: 1px solid var(--out-line-strong);
  border-radius: var(--r-md);
  background: var(--out-text);
  color: var(--out-invert);
  padding: 12px 16px;
  text-decoration: none;
  font-weight: 900;
  font-size: 1.05rem;
  transition: transform var(--out-t), background var(--out-t);
}
.download:hover { transform: translateY(-1px); background: #fff; }
.download span { font-size: 0.72rem; font-weight: 700; font-family: "Cascadia Mono", ui-monospace, monospace; }
.download.unavailable {
  background: var(--out-panel);
  color: var(--out-dim);
  border-color: var(--out-line);
  cursor: not-allowed;
}
.dl-status { color: var(--out-muted); font-size: 0.78rem; min-height: 1.2em; }

/* cards linking to pages (home) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}
.pcard {
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--out-line);
  border-radius: var(--r-md);
  background: rgba(28,28,28,0.92);
  padding: 16px;
  text-decoration: none;
  transition: border-color var(--out-t), transform var(--out-t), background var(--out-t);
}
.pcard:hover { border-color: var(--out-line-strong); transform: translateY(-2px); background: var(--out-panel); }
.pcard strong { font-size: 1rem; font-weight: 800; }
.pcard p { color: var(--out-muted); font-size: 0.84rem; }
.pcard .go { color: var(--out-dim); font-size: 0.74rem; }

/* scroll reveal */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }

/* footer */
.foot {
  border-top: 1px solid var(--out-line);
  background: rgba(16,16,16,0.94);
  padding: 18px 24px 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.foot-main { display: grid; gap: 10px; min-width: 0; }
.foot-brand { display: flex; align-items: center; gap: 10px; color: var(--out-muted); font-size: 0.82rem; font-weight: 600; }
.foot-brand img { height: 16px; width: auto; opacity: 0.9; }
.foot-truth { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--out-dim); font-size: 0.74rem; }
.foot-note { color: var(--out-dim); font-size: 0.78rem; max-width: 96ch; }
.build-chip {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 10px;
  row-gap: 1px;
  border: 1px solid var(--out-line-strong);
  border-radius: var(--r-md);
  padding: 8px 12px;
  background: var(--out-bg-deep);
}
.build-chip span { color: var(--out-dim); font-size: 0.68rem; text-transform: uppercase; }
.build-chip strong { font-size: 0.78rem; font-weight: 600; white-space: nowrap; }

/* ================= calibration strip (verified values or dashes only) === */
.calib {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--out-line);
  background: rgba(16,16,16,0.88);
  font-family: "Cascadia Mono", "Roboto Mono", ui-monospace, monospace;
  font-size: 0.7rem;
}
.calib .cell {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 6px 16px;
  border-right: 1px solid var(--out-line);
  color: var(--out-dim);
  white-space: nowrap;
}
.calib .cell b { color: var(--out-muted); font-weight: 600; }
.calib .cell.warn { color: var(--out-text); background: var(--out-panel-2); }

/* channel nav idiom: ( 01 ) download with needle underline */
.nav .links a .ch { color: var(--out-dim); font-family: "Cascadia Mono", ui-monospace, monospace; font-weight: 400; margin-right: 4px; }
.nav .links a.on .ch { color: inherit; }
.nav .links a { position: relative; }
.nav .links a.on::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: -13px;
  height: 2px;
  background: var(--out-text);
}

/* ================= sample gate demo (how-it-works) ====================== */
.gate-demo {
  border: 1px double var(--out-line-strong);
  border-radius: var(--r-md);
  background: var(--out-bg-deep);
  padding: 18px;
  margin-top: 14px;
}
.gate-demo .cap { color: var(--out-dim); font-size: 0.74rem; margin-bottom: 10px; }
.gate-demo label {
  display: block;
  color: var(--out-dim);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.gate-demo input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--out-line-strong);
  border-radius: var(--r-md);
  background: var(--out-bg);
  color: var(--out-text);
  padding: 10px 12px;
  font: inherit;
  font-family: "Cascadia Mono", ui-monospace, monospace;
}
.gate-demo input:focus { outline: 2px solid var(--out-text); outline-offset: 2px; }
.gate-demo .verdict {
  margin-top: 10px;
  min-height: 1.4em;
  font-family: "Cascadia Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  color: var(--out-muted);
}
.gate-demo .verdict.ok { color: var(--out-text); }
.gate-demo .demo-btn {
  margin-top: 10px;
  min-height: 44px;
  border: 1px solid var(--out-line);
  border-radius: var(--r-md);
  background: var(--out-panel);
  color: var(--out-dim);
  padding: 9px 14px;
  font: inherit;
  font-weight: 900;
  cursor: not-allowed;
}
.gate-demo .demo-btn.armed {
  background: var(--out-text);
  color: var(--out-invert);
  border-color: var(--out-line-strong);
  cursor: pointer;
}
.refusals { margin-top: 14px; }
.refusals .row strong { font-family: "Cascadia Mono", ui-monospace, monospace; font-size: 0.8rem; }

/* ================= roadmap plates ====================================== */
.plates { display: grid; gap: 12px; margin-top: 4px; }
.plate-card {
  border: 1px solid var(--out-line);
  border-radius: var(--r-md);
  background: rgba(16,16,16,0.92);
  padding: 16px 18px;
}
.plate-card header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--out-line);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.plate-card h3 { font-size: 1.15rem; font-weight: 900; }
.plate-card .tok {
  font-family: "Cascadia Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  color: var(--out-dim);
  border: 1px solid var(--out-line);
  border-radius: var(--r-sm);
  padding: 2px 8px;
}
.plate-card p { color: var(--out-muted); font-size: 0.9rem; max-width: 80ch; }

/* ================= faq ================================================= */
details.qa {
  border: 1px solid var(--out-line);
  border-radius: var(--r-md);
  background: rgba(28,28,28,0.92);
  margin-bottom: 10px;
}
details.qa summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 13px 16px;
  font-weight: 700;
}
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary .ch { color: var(--out-dim); font-family: "Cascadia Mono", ui-monospace, monospace; font-size: 0.78rem; }
details.qa[open] summary { border-bottom: 1px solid var(--out-line); }
details.qa .a { padding: 13px 16px; color: var(--out-muted); font-size: 0.9rem; }
details.qa .a p + p { margin-top: 8px; }

/* ================= per-page background variants ======================== */
/* home: depth field */
.field.v-depth .rails, .field.v-depth .pulse { display: none; }
/* docs: rails only */
.field.v-rails .stars-far, .field.v-rails .stars-near, .field.v-rails .twinkle { display: none; }
/* roadmap: horizon floor */
.field .floor-wrap {
  position: absolute;
  left: -40%; right: -40%;
  top: 55%; bottom: -14%;
  perspective: 620px;
  overflow: hidden;
  display: none;
}
.field.v-horizon .floor-wrap { display: block; }
.field.v-horizon .rails, .field.v-horizon .pulse { display: none; }
.field .floor-wrap .floor {
  position: absolute;
  inset: 0;
  transform: rotateX(63deg);
  transform-origin: 50% 0%;
  background:
    repeating-linear-gradient(0deg, rgba(245,245,240,0.13) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, rgba(245,245,240,0.13) 0 1px, transparent 1px 64px);
  background-size: 64px 64px;
  animation: floor-drift 6s linear infinite;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 22%, #000 100%);
}
@keyframes floor-drift { 0% { background-position: 0 0; } 100% { background-position: 0 64px; } }
/* faq/limits: stillness = severity */
.field.v-still > * { display: none; }
.field.v-still { background: var(--out-bg-deep); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 920px) {
  .nav { flex-wrap: wrap; gap: 10px; }
  .nav .rail { display: none; }
  .dl-console { grid-template-columns: 1fr; gap: 18px; padding: 20px 16px; }
  .dl-action { border-left: 0; border-top: 1px solid var(--out-line); padding-left: 0; padding-top: 18px; }
  .card-grid { grid-template-columns: 1fr; }
  .row { grid-template-columns: 1fr; gap: 2px; }
  .foot { flex-direction: column; align-items: stretch; }
}
