:root {
  --bg: #050608;
  --ink: #e6e3db;
  --ink-dim: rgba(230, 227, 219, 0.72);
  --hair: rgba(230, 227, 219, 0.1);
  --amber: #d9a441;
  --amber-hi: #f0c374;
  --pad: 100px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; background: var(--bg); }

body {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--amber); text-decoration: none; border-bottom: 1px solid rgba(217, 164, 65, 0.35); }
a:hover { color: var(--amber-hi); border-bottom-color: var(--amber-hi); }
::selection { background: rgba(217, 164, 65, 0.25); }

.page {
  max-width: 1440px;
  margin: 0 auto;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------- bars */

.topbar, .bottombar {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 18px;
  padding: 22px var(--pad) 18px;
  border-bottom: 1px solid var(--hair);
}
.bottombar { border-bottom: none; border-top: 1px solid var(--hair); padding: 22px var(--pad) 40px; }

.mark { font-size: 12px; letter-spacing: 0.32em; color: rgba(230, 227, 219, 0.72); }
.bottombar .mark { font-size: 11px; letter-spacing: 0.3em; color: rgba(230, 227, 219, 0.6); }
.imprint { font-size: 8.5px; letter-spacing: 0.26em; color: rgba(230, 227, 219, 0.4); }
.bottombar .imprint { color: rgba(230, 227, 219, 0.34); }
.tag-right { margin-left: auto; font-size: 8.5px; letter-spacing: 0.24em; color: rgba(230, 227, 219, 0.32); }
/* The way into the manual. Set at the imprint's weight so the bar stays an
   identity line rather than becoming navigation; it is a link, so it takes
   the site's hover colour. */
.topbar .docs-entry {
  font-size: 8.5px;
  letter-spacing: 0.26em;
  color: rgba(230, 227, 219, 0.5);
  border-bottom: none;
}
.topbar .docs-entry:hover { color: var(--amber-hi); }
.bottombar .tag-right { color: rgba(230, 227, 219, 0.28); }

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  width: 100%;
  height: 600px;
  overflow: hidden;
}
.hero canvas { display: block; width: 100%; height: 100%; cursor: default; }
.hero.has-target canvas { cursor: pointer; }

.grain {
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(230, 227, 219, 0.05) 0.5px, rgba(0, 0, 0, 0) 0.6px);
  background-size: 3px 3px;
}
.hero-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(96% 82% at 44% 56%, rgba(0, 0, 0, 0) 42%, rgba(3, 3, 5, 0.9) 100%);
}

.mass-label {
  position: absolute;
  transform: translate(-50%, -100%);
  font-size: 9.5px;
  letter-spacing: 0.26em;
  color: rgba(230, 227, 219, 0.44);
  pointer-events: none;
  white-space: nowrap;
}
.mass-label.mini-pc { color: rgba(230, 227, 219, 0.38); }

.captions { position: absolute; inset: 0; pointer-events: none; }
.caption {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  white-space: nowrap;
}
.caption .name {
  font-size: 9.5px; font-weight: 500; letter-spacing: 0.18em;
  color: rgba(230, 227, 219, 0.82); text-shadow: 0 0 7px rgba(5, 6, 8, 0.98);
}
.caption .status { font-size: 8.5px; letter-spacing: 0.22em; text-shadow: 0 0 7px rgba(5, 6, 8, 0.98); }

.hover-tip {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: none;
  white-space: nowrap;
  font-size: 10px; letter-spacing: 0.18em; color: #f5cf8b;
  background: rgba(5, 6, 8, 0.88); padding: 4px 9px;
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  .hover-tip.visible { display: block; }
}

.pin-panel {
  position: absolute;
  display: none;
  flex-direction: column; gap: 6px;
  background: rgba(7, 8, 11, 0.94);
  border-left: 1px solid rgba(230, 227, 219, 0.4);
  padding: 10px 14px;
  min-width: 186px;
  max-width: calc(100% - 24px);
}
.pin-panel.visible { display: flex; }
.pin-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.pin-title { font-size: 9.5px; letter-spacing: 0.2em; color: rgba(230, 227, 219, 0.9); }
.pin-close { font-size: 11px; color: rgba(230, 227, 219, 0.5); cursor: pointer; background: none; border: none; font-family: inherit; padding: 0; }
.pin-close:hover { color: var(--ink); }
.pin-row { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; font-size: 9.5px; letter-spacing: 0.12em; }
.pin-row .pn { color: rgba(230, 227, 219, 0.72); }
.pin-row .ps { letter-spacing: 0.2em; font-size: 8.5px; }
.pin-empty { font-size: 9.5px; letter-spacing: 0.1em; color: rgba(230, 227, 219, 0.5); }

.hero-status {
  position: absolute; left: var(--pad); bottom: 20px;
  display: flex; align-items: baseline; gap: 12px;
  font-size: 9.5px; letter-spacing: 0.2em; color: rgba(230, 227, 219, 0.4);
  pointer-events: none;
}
.hero-status .dot { color: rgba(230, 227, 219, 0.2); }

/* ---------------------------------------------------------------- thesis */

.thesis {
  padding: 64px var(--pad) 60px;
  border-bottom: 1px solid var(--hair);
}
.thesis p {
  margin: 0;
  font-size: 39px; line-height: 1.16; letter-spacing: -0.005em;
  color: var(--ink); max-width: 820px;
}

/* ---------------------------------------------------------------- strip */

.strip {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--hair);
}
.strip canvas { display: block; width: 100%; height: 84px; }
.strip-caption {
  display: flex; align-items: baseline; gap: 14px;
  padding: 9px var(--pad) 11px;
  font-size: 8.5px; letter-spacing: 0.24em; color: rgba(230, 227, 219, 0.34);
}
.strip-caption .mk { color: rgba(230, 227, 219, 0.6); letter-spacing: 0.3em; }
.strip-caption .dot { color: rgba(230, 227, 219, 0.2); }
.strip-caption .feed { margin-left: auto; }

/* ---------------------------------------------------------------- sections */

section { padding: 104px var(--pad) 0; }

.section-head {
  display: flex; align-items: baseline; gap: 20px; padding-bottom: 44px;
}
.section-head .no { font-size: 9.5px; letter-spacing: 0.24em; color: rgba(230, 227, 219, 0.34); }
.section-head .title { font-size: 11px; letter-spacing: 0.28em; color: rgba(230, 227, 219, 0.78); }
.section-head .rule { flex: 1; height: 1px; background: var(--hair); }

.prose {
  display: flex; flex-direction: column; gap: 26px;
  max-width: 660px;
  font-size: 13.5px; line-height: 1.95; letter-spacing: 0.015em;
  color: rgba(230, 227, 219, 0.76);
}
.prose .dim { color: rgba(230, 227, 219, 0.58); }

/* ---------------------------------------------------------- grammar */

.grammar-intro {
  font-size: 12px; line-height: 1.9; letter-spacing: 0.04em;
  color: rgba(230, 227, 219, 0.5); max-width: 560px; padding-bottom: 36px;
}

.terms { display: flex; flex-direction: column; }
.term {
  display: flex; gap: 56px; align-items: flex-start;
  padding: 34px 0; border-top: 1px solid var(--hair);
}
.terms .term:last-child { border-bottom: 1px solid var(--hair); }

.term-fig {
  position: relative; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(230, 227, 219, 0.08);
  width: 420px;
}
.term-fig canvas { display: block; width: 100%; aspect-ratio: 420 / 230; }
.fig-tag { position: absolute; bottom: 12px; font-size: 8px; letter-spacing: 0.2em; color: rgba(230, 227, 219, 0.42); pointer-events: none; }
.fig-tag.left { left: 14px; }
.fig-tag.right { right: 14px; }

.term-body { display: flex; flex-direction: column; gap: 14px; max-width: 520px; padding-top: 4px; }
.term-head { display: flex; align-items: baseline; gap: 14px; }
.term-head .no { font-size: 9.5px; letter-spacing: 0.22em; color: rgba(230, 227, 219, 0.34); }
.term-head .name { font-size: 12.5px; letter-spacing: 0.24em; color: var(--ink); }
.term-head .spec { margin-left: auto; font-size: 8.5px; letter-spacing: 0.2em; color: rgba(230, 227, 219, 0.28); }
.term-body p { margin: 0; font-size: 13px; line-height: 1.95; letter-spacing: 0.015em; color: rgba(230, 227, 219, 0.74); }
.term-body p.aside { font-size: 11px; line-height: 1.85; letter-spacing: 0.04em; color: rgba(230, 227, 219, 0.46); }

/* ---------------------------------------------------------- observation */

.obs-lede {
  margin: 0 0 40px;
  font-size: 31px; line-height: 1.28; letter-spacing: -0.003em;
  color: var(--ink); max-width: 900px;
}

.obs-columns { display: flex; gap: 88px; align-items: flex-start; padding-bottom: 56px; flex-wrap: wrap; }
.obs-col-main {
  display: flex; flex-direction: column; gap: 24px; max-width: 600px;
  font-size: 13px; line-height: 1.95; letter-spacing: 0.015em; color: rgba(230, 227, 219, 0.72);
}
.obs-col-aside {
  display: flex; flex-direction: column; gap: 12px; max-width: 340px;
  border-left: 1px solid rgba(230, 227, 219, 0.14); padding-left: 26px;
}
.obs-col-aside .label { font-size: 9px; letter-spacing: 0.24em; color: rgba(230, 227, 219, 0.34); }
.obs-col-aside .body { font-size: 12px; line-height: 1.9; letter-spacing: 0.03em; color: rgba(230, 227, 219, 0.66); }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.obs-table-full {
  display: grid;
  grid-template-columns: 262px repeat(4, minmax(140px, 1fr));
  border-top: 1px solid rgba(230, 227, 219, 0.14);
  min-width: 900px;
}
.obs-table-full .h {
  padding: 13px 0 12px; font-size: 8.5px; letter-spacing: 0.22em;
  color: rgba(230, 227, 219, 0.5); border-bottom: 1px solid var(--hair);
}
.obs-table-full .h.row-label { color: rgba(230, 227, 219, 0.34); }
.obs-table-full .row-name {
  padding: 15px 0 14px; border-bottom: 1px solid rgba(230, 227, 219, 0.07);
  display: flex; flex-direction: column; gap: 4px;
}
.obs-table-full .row-name .n { font-size: 11px; letter-spacing: 0.16em; color: rgba(230, 227, 219, 0.86); }
.obs-table-full .row-name .s { font-size: 9px; letter-spacing: 0.1em; color: rgba(230, 227, 219, 0.34); }
.obs-table-full .cell {
  padding: 15px 8px 14px 0; border-bottom: 1px solid rgba(230, 227, 219, 0.07);
  font-size: 9.5px; letter-spacing: 0.16em;
}

.obs-footnotes { display: flex; gap: 64px; padding-top: 26px; flex-wrap: wrap; }
.obs-footnotes p {
  margin: 0; font-size: 10.5px; line-height: 1.9; letter-spacing: 0.03em;
  color: rgba(230, 227, 219, 0.42); max-width: 470px;
}

/* compact data-grid: mobile landscape (190px label column, abbreviated headers/values) */
.obs-table-compact {
  grid-template-columns: 190px repeat(4, 1fr);
  border-top: 1px solid rgba(230, 227, 219, 0.14);
}
.obs-table-compact .h { padding: 11px 0 10px; font-size: 8px; letter-spacing: 0.2em; color: rgba(230, 227, 219, 0.5); border-bottom: 1px solid var(--hair); }
.obs-table-compact .h.row-label { color: rgba(230, 227, 219, 0.34); }
.obs-table-compact .row-name { padding: 13px 0 12px; border-bottom: 1px solid rgba(230, 227, 219, 0.07); display: flex; flex-direction: column; gap: 3px; }
.obs-table-compact .row-name .n { font-size: 10px; letter-spacing: 0.14em; color: rgba(230, 227, 219, 0.86); }
.obs-table-compact .row-name .s { font-size: 8px; letter-spacing: 0.08em; color: rgba(230, 227, 219, 0.34); }
.obs-table-compact .cell { padding: 13px 6px 12px 0; border-bottom: 1px solid rgba(230, 227, 219, 0.07); font-size: 8.5px; letter-spacing: 0.14em; }

/* stacked source cards: mobile portrait, key/value pairs instead of a wide grid */
.obs-stacked-head { display: flex; align-items: baseline; gap: 12px; padding-bottom: 6px; }
.obs-stacked-head span:first-child { font-size: 8px; letter-spacing: 0.2em; color: rgba(230, 227, 219, 0.34); }
.obs-stacked-head .rule { flex: 1; height: 1px; background: var(--hair); }
.obs-source { padding: 18px 0 16px; border-bottom: 1px solid rgba(230, 227, 219, 0.08); display: flex; flex-direction: column; gap: 11px; }
.obs-source .n { font-size: 11px; letter-spacing: 0.16em; color: rgba(230, 227, 219, 0.86); }
.obs-source .s { font-size: 8.5px; letter-spacing: 0.08em; color: rgba(230, 227, 219, 0.34); }
.obs-source-name { display: flex; flex-direction: column; gap: 3px; }
.obs-source-grid { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 8.5px; letter-spacing: 0.16em; }
.obs-source-grid .k { color: rgba(230, 227, 219, 0.4); }

/* ---------------------------------------------------------- not-shown */

.not-shown { display: flex; flex-direction: column; }
.ns-row {
  display: flex; gap: 56px; align-items: baseline;
  padding: 26px 0; border-top: 1px solid var(--hair);
}
.not-shown .ns-row:last-child { border-bottom: 1px solid var(--hair); }
.ns-row .ns-label { width: 262px; flex-shrink: 0; font-size: 12px; letter-spacing: 0.22em; color: rgba(230, 227, 219, 0.82); }
.ns-row .ns-body { font-size: 12.5px; line-height: 1.9; letter-spacing: 0.02em; color: rgba(230, 227, 219, 0.66); max-width: 760px; }

/* ---------------------------------------------------------- laboratory */

.lab-columns { display: flex; gap: 88px; align-items: flex-start; padding-bottom: 104px; flex-wrap: wrap; }
.lab-main { display: flex; flex-direction: column; gap: 24px; max-width: 640px; font-size: 13.5px; line-height: 1.95; letter-spacing: 0.015em; color: rgba(230, 227, 219, 0.76); }
.lab-main .dim { color: rgba(230, 227, 219, 0.58); }
.lab-aside {
  display: flex; flex-direction: column; gap: 16px;
  border-left: 1px solid rgba(230, 227, 219, 0.14); padding-left: 26px; min-width: 260px;
}
.lab-field { display: flex; flex-direction: column; gap: 5px; }
.lab-field .k { font-size: 9px; letter-spacing: 0.24em; color: rgba(230, 227, 219, 0.34); }
.lab-field .v { font-size: 11px; letter-spacing: 0.18em; color: rgba(230, 227, 219, 0.78); }
.lab-field .v.state { color: rgba(240, 195, 116, 0.85); }
.lab-field .v.dist { color: rgba(230, 227, 219, 0.5); }

/* ---------------------------------------------------------- footer field */

.quiet {
  position: relative; margin-top: 104px; overflow: hidden;
}
.quiet canvas { display: block; width: 100%; height: 240px; }
.quiet-fade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(5, 6, 8, 0.55) 0%, rgba(5, 6, 8, 0) 40%, rgba(5, 6, 8, 0.9) 100%);
}
.quiet-label {
  position: absolute; left: var(--pad); top: 44px;
  font-size: 12px; letter-spacing: 0.2em; color: rgba(230, 227, 219, 0.5);
  pointer-events: none;
}

/* ================================================================ mobile shared (both mobile breakpoints) */

.pin-divider { display: none; height: 1px; background: rgba(230, 227, 219, 0.12); }

@media (max-width: 900px) {
  .hero { height: auto; }
  .strip canvas { height: auto; }
  .quiet canvas { height: auto; }

  .pin-panel {
    left: auto; top: auto;
    max-width: none;
    min-width: 0;
  }
  .pin-divider { display: block; }
}

/* full data-grid table shows by default (desktop); mobile breakpoints below swap it out */
.obs-table-compact,
.obs-table-stacked { display: none; }

/* ================================================================ mobile landscape (601px - 900px) */

@media (max-width: 900px) and (min-width: 601px) {
  :root { --pad: 40px; }

  .hero { aspect-ratio: 844 / 300; }
  .thesis { padding: 32px var(--pad) 30px; }
  .thesis p { font-size: 28px; max-width: 640px; }

  .strip canvas { aspect-ratio: 844 / 56; }
  .strip-caption { font-size: 8px; gap: 12px; padding: 7px var(--pad) 9px; }

  section { padding: 60px var(--pad) 0; }
  .section-head { padding-bottom: 30px; }
  .grammar-intro { font-size: 11.5px; max-width: 480px; padding-bottom: 28px; }

  .term { gap: 32px; padding: 28px 0; }
  .term-fig { width: 300px; }
  .term-fig canvas { aspect-ratio: 360 / 200; }

  .obs-lede { font-size: 24px; padding-bottom: 32px; }
  .obs-columns { gap: 44px; padding-bottom: 44px; }
  .obs-col-main { max-width: 440px; font-size: 12.5px; }
  .obs-col-aside { width: 240px; max-width: 240px; padding-left: 20px; }

  .obs-table-full { display: none; }
  .obs-table-compact { display: grid; }

  .not-shown .ns-row { gap: 32px; padding: 22px 0; }
  .ns-row .ns-label { width: 190px; font-size: 10.5px; }
  .ns-row .ns-body { font-size: 12px; }

  .lab-columns { gap: 44px; padding-bottom: 76px; }
  .lab-main { max-width: 440px; font-size: 13px; }
  .lab-aside { width: 240px; min-width: 0; padding-left: 20px; }

  .quiet { margin-top: 64px; }
  .quiet canvas { aspect-ratio: 844 / 170; }
  .quiet-label { top: 32px; font-size: 11px; }

  .mass-label { font-size: 8.5px; letter-spacing: 0.24em; }
  .caption { gap: 2px; }
  .caption .name { font-size: 8.5px; letter-spacing: 0.16em; }
  .caption .status { font-size: 8px; letter-spacing: 0.2em; }

  /* right-side selection sheet, matching the approved landscape artboard */
  .pin-panel {
    right: 0; bottom: 0; top: 0; left: auto;
    width: 214px;
    border-left: 1px solid rgba(230, 227, 219, 0.22); border-top: none;
    padding: 14px 18px; gap: 10px;
  }
  .pin-row { flex-direction: column; align-items: flex-start; gap: 3px; }
  .pin-row .ps { margin-left: 0; }
}

/* ================================================================ mobile portrait (<= 600px) */

@media (max-width: 600px) {
  :root { --pad: 22px; }

  .topbar .tag-right, .bottombar .tag-right { display: none; }

  .hero { aspect-ratio: 390 / 560; }

  .thesis { padding: 34px var(--pad) 32px; }
  .thesis p { font-size: 25px; }

  .strip canvas { aspect-ratio: 390 / 60; }
  .strip-caption { font-size: 8px; gap: 10px; }
  .strip-caption .dot, .strip-caption .feed { display: none; }

  section { padding: 56px var(--pad) 0; }
  .section-head { padding-bottom: 28px; }
  .grammar-intro { font-size: 11.5px; padding-bottom: 26px; }

  .term { flex-direction: column; gap: 18px; padding: 26px 0; }
  .term-fig { width: 100%; }
  .term-fig canvas { aspect-ratio: 346 / 190; }
  .term-body { max-width: none; padding-top: 0; }

  .obs-lede { font-size: 21px; padding-bottom: 30px; }
  .obs-columns { flex-direction: column; gap: 32px; padding-bottom: 0; }
  .obs-col-aside { border-left: none; border-top: 1px solid rgba(230, 227, 219, 0.14); padding-left: 0; padding-top: 18px; max-width: none; width: auto; margin-bottom: 28px; }

  .obs-table-full { display: none; }
  .obs-table-stacked { display: block; }

  .ns-row { flex-direction: column; gap: 12px; padding: 22px 0; }
  .ns-row .ns-label { width: auto; font-size: 11px; }

  .lab-columns { flex-direction: column; gap: 20px; padding-bottom: 76px; }
  .lab-aside { border-left: none; border-top: 1px solid rgba(230, 227, 219, 0.14); padding-left: 0; padding-top: 18px; min-width: 0; width: auto; margin-top: 28px; }

  .quiet { margin-top: 60px; }
  .quiet canvas { aspect-ratio: 390 / 180; }
  .quiet-label { top: 30px; font-size: 10.5px; }

  .mass-label { font-size: 8.5px; letter-spacing: 0.24em; }
  .caption { gap: 2px; }
  .caption .name { font-size: 8.5px; letter-spacing: 0.14em; }
  .caption .status { font-size: 8px; letter-spacing: 0.18em; }

  /* bottom selection sheet, matching the approved portrait artboard */
  .pin-panel {
    left: 0; right: 0; bottom: 0; top: auto;
    width: auto;
    border-left: none; border-top: 1px solid rgba(230, 227, 219, 0.22);
    padding: 12px 22px 13px; gap: 8px;
  }
}
