/* SPECULUM / style
 *
 * Built only from the Atlas Systems brand tokens. No new colours, no new
 * families, no rounded corners. The field is the one loud element on the
 * page and everything around it stays quiet.
 */

:root {
  --bg: #0a0a0f;
  --bg-1: #111118;
  --bg-2: #1a1a24;
  --border: rgba(255, 255, 255, 0.08);
  --border-hi: rgba(255, 255, 255, 0.16);
  --text: #e8e8e0;
  --text-dim: #aaa9a0;
  --text-faint: #555560;
  --accent: #f5a623;
  --accent-hi: #f7b84a;
  --accent-dim: rgba(245, 166, 35, 0.12);
  --grid: rgba(255, 255, 255, 0.03);
  --ok: #4ade80;
  --bad: #e24b4a;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --serif: "DM Serif Display", Georgia, serif;
  --max: 1100px;
  --prose: 720px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 80px 80px;
  color: var(--text-dim);
  font: 400 14px/1.6 var(--mono);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); text-decoration: underline; }

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

code {
  color: var(--text);
  background: var(--bg-2);
  border: 1px solid var(--border);
  padding: 0 4px;
  font-size: 0.92em;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------------------------------------------------------------- head */

.masthead {
  height: 56px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.85);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.eyebrow {
  margin: 0 auto;
  width: 100%;
  max-width: var(--max);
  padding: 0 24px;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.eyebrow span { color: var(--text-faint); margin: 0 6px; }

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px 96px;
}

/* --------------------------------------------------------------- intro */

.intro { padding: 64px 0 32px; max-width: var(--prose); }

.snapshot-label {
  margin: 0 0 14px;
  color: var(--text-faint);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  font: 400 clamp(44px, 8vw, 76px)/1 var(--serif);
  color: var(--text);
  margin: 0 0 20px;
  letter-spacing: -0.01em;
}

.thesis {
  font: italic 400 clamp(19px, 2.6vw, 25px)/1.35 var(--serif);
  color: var(--accent);
  margin: 0 0 22px;
}

.lede { margin: 0 0 26px; color: var(--text-dim); }

.stats {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: 0.03em;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

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

.field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 8px 0 72px;
}

.field-canvas {
  position: relative;
  background: var(--bg);
  min-height: 660px;
}

#spc-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 660px;
  cursor: crosshair;
  touch-action: pan-y;
}

.clock, .count {
  position: absolute;
  left: 14px;
  margin: 0;
  max-width: calc(100% - 28px);
  padding: 3px 8px;
  background: rgba(10, 10, 15, 0.72);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.05em;
  pointer-events: none;
}

.clock { bottom: 42px; color: var(--accent); }
.count { bottom: 14px; color: var(--text-faint); }

.reduced {
  position: absolute;
  inset: auto 16px 74px 16px;
  background: var(--bg-1);
  border: 1px solid var(--border-hi);
  padding: 14px 16px;
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.reduced p { margin: 0; }

/* ---------------------------------------------------------------- rail */

.rail {
  background: var(--bg-1);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.controls { border-bottom: 1px solid var(--border); }

.control { padding: 16px; }
.control + .control { border-top: 1px solid var(--border); }

.label {
  margin: 0 0 10px;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.label .sample {
  text-transform: none;
  letter-spacing: 0.02em;
  color: var(--text-faint);
  opacity: 0.7;
  float: right;
}

.btns { display: flex; flex-wrap: wrap; gap: 6px; }

.btns button, .reduced button {
  font: 400 11.5px/1 var(--mono);
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  padding: 7px 11px;
  cursor: pointer;
  letter-spacing: 0.04em;
}

.btns button:hover, .reduced button:hover {
  border-color: var(--border-hi);
  color: var(--text);
}

.btns button[aria-pressed="true"] {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.hint {
  margin: 10px 0 0;
  font-size: 10.5px;
  line-height: 1.5;
  color: var(--text-faint);
}

.detail {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  min-height: 210px;
}

.detail h3 {
  margin: 0 0 8px;
  font: 400 17px/1.2 var(--serif);
  color: var(--accent);
  word-break: break-all;
}

.detail .spc-meta {
  margin: 0 0 10px;
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.03em;
}

.detail .spc-note {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.detail .spc-source {
  margin: 0 0 12px;
  color: var(--text-faint);
  font-size: 10px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.detail .spc-sub {
  margin: 10px 0 4px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.detail ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 11.5px;
  color: var(--text-dim);
}

.detail ul li::before { content: "\00b7 "; color: var(--text-faint); }

.detail .spc-idle { margin: 0; font-size: 12px; color: var(--text-faint); }

.ledger-wrap {
  padding: 16px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ledger {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 11px;
  line-height: 1.75;
  overflow: hidden;
  flex: 1;
  min-height: 190px;
  -webkit-mask-image: linear-gradient(180deg, #000 68%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 68%, transparent 100%);
}

.ledger li {
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ledger .spc-t { color: var(--text-faint); margin-right: 10px; }

/* --------------------------------------------------------------- prose */

.prose { max-width: var(--prose); }

.prose h2 {
  font: 400 26px/1.2 var(--serif);
  color: var(--text);
  margin: 44px 0 14px;
}

.prose p { margin: 0 0 16px; }

.table-wrap {
  margin-top: 32px;
  border: 1px solid var(--border);
  background: var(--bg-1);
}

.table-wrap summary {
  padding: 13px 16px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.table-wrap summary:hover { color: var(--accent); }
.table-wrap[open] summary { border-bottom: 1px solid var(--border); }

#spc-table { overflow-x: auto; }

table { border-collapse: collapse; width: 100%; font-size: 11.5px; }

th, td {
  text-align: left;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--text-faint);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
  white-space: nowrap;
}

td { color: var(--text-dim); }
td:first-child { color: var(--text); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }

.flag-ok { color: var(--ok); }
.flag-assumed { color: var(--bad); }

footer {
  border-top: 1px solid var(--border);
  padding: 22px 24px;
}

footer p {
  max-width: var(--max);
  margin: 0 auto;
  font-size: 11px;
  color: var(--text-faint);
}

/* --------------------------------------------------------------- small */

@media (max-width: 900px) {
  .field { grid-template-columns: minmax(0, 1fr); }
  .field-canvas, #spc-canvas { min-height: 460px; }
  .rail { border-top: 1px solid var(--border); }
  .detail { min-height: 0; }
  .ledger { min-height: 120px; }
  main { padding: 0 16px 72px; }
  .eyebrow { padding: 0 16px; }
  .intro { padding: 44px 0 26px; }
}

/* ------------------------------------------------------- clarity pass v2 */

:root {
  --max: 1360px;
  --rail: 340px;
}

.field {
  grid-template-columns: minmax(0, 1fr) var(--rail);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "bar bar"
    "canvas rail";
  height: clamp(620px, 72vh, 760px);
  margin-top: 16px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.24);
}

.field-bar {
  grid-area: bar;
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 14px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.field-bar p { margin: 0; }
.field-bar strong {
  color: var(--text);
  font-weight: 500;
  margin-right: 10px;
}
.field-bar span { color: var(--text-faint); }

.field-canvas {
  grid-area: canvas;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}

#spc-canvas { min-height: 0; }

.clock,
.count {
  left: 16px;
  padding: 4px 8px;
  background: rgba(10, 10, 15, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.clock { bottom: 44px; }
.count {
  bottom: 14px;
  max-width: calc(100% - 32px);
}

.rail {
  grid-area: rail;
  min-height: 0;
  overflow: hidden;
  background: rgba(17, 17, 24, 0.96);
}

.controls { flex: none; }
.control { padding: 14px 16px; }
.label { margin-bottom: 8px; }
.btns { gap: 7px; }

.btns button,
.reduced button {
  min-height: 30px;
  border-color: rgba(255, 255, 255, 0.11);
}

.btns button[aria-pressed="true"] {
  box-shadow: inset 0 -1px 0 var(--accent);
}

.detail {
  flex: none;
  min-height: 168px;
  max-height: 238px;
  overflow: auto;
  padding: 18px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
}

.detail h3 {
  font-size: 19px;
  word-break: normal;
  overflow-wrap: anywhere;
}

.detail .spc-idle {
  margin: 0 0 8px;
  color: var(--text-dim);
}

.detail .spc-idle-note {
  margin: 0;
  max-width: 28ch;
  color: var(--text-faint);
  font-size: 10.5px;
  line-height: 1.55;
}

.ledger-wrap {
  min-height: 0;
  padding: 14px 16px 16px;
  border-top: 0;
}

.ledger {
  min-height: 0;
  overflow: hidden;
  line-height: 1.4;
  -webkit-mask-image: linear-gradient(180deg, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 78%, transparent 100%);
}

.ledger li {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 5px 0;
  white-space: normal;
  border-top: 1px solid rgba(255, 255, 255, 0.035);
  color: var(--text-dim);
}

.ledger li:first-child { border-top-color: rgba(245, 166, 35, 0.18); }
.ledger .spc-t { margin: 0; font-size: 10px; }
.ledger .spc-path {
  min-width: 0;
  overflow-wrap: anywhere;
  color: rgba(232, 232, 224, 0.74);
}
.ledger li:first-child .spc-path { color: var(--text); }

@media (max-width: 1080px) and (min-width: 901px) {
  :root { --rail: 310px; }
  .field { height: clamp(600px, 70vh, 720px); }
}

@media (max-width: 900px) {
  .field {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "bar"
      "canvas"
      "rail";
    height: auto;
  }

  .field-canvas,
  #spc-canvas {
    height: clamp(480px, 68vh, 640px);
    min-height: 0;
  }

  .rail { overflow: visible; }
  .detail { max-height: none; }
  .ledger { max-height: 300px; }
}

@media (max-width: 560px) {
  .field-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .field-canvas,
  #spc-canvas { height: 500px; }
  .count { max-width: calc(100% - 24px); }
}
