/* ARCHON — The Computing Foundry
   Design System v1.2 · archon.css
   Tokens, themes, type presets and components for every ARCHON web surface.
   Two themes: Void (instrument, every docs page) and Paper (monograph). One signal color: Pour.
   Three families: Doto for headlines, Instrument Sans for every sentence, Geist Mono for data. */

:root {
  /* Neutrals, dark side */
  --void: #0C0B0A;      /* page ground, instrument theme */
  --carbon: #141311;    /* surface 1 */
  --graphite: #1D1B19;  /* surface 2 */
  --iron: #292724;      /* surface 3, hover */
  --slag: #3A3733;      /* strong rules on dark, decorative only */
  --seam: #24221F;      /* hairlines on dark docs, decorative only */
  --ash-6: #57524C;     /* glyph field, disabled, decorative only */
  --ash-5: #8A847B;     /* tertiary text on dark, 5.31:1 on void */
  --ash-4: #A29B92;     /* secondary text on dark, 7.15:1 on void */
  --ash-3: #C2BBB2;
  --bone: #ECE8E1;      /* primary text on dark, 16.10:1 on void */
  /* Neutrals, light side */
  --white: #FBFAF7;     /* raised surface on paper */
  --paper: #F3F1EC;     /* page ground, monograph theme */
  --paper-2: #E9E6DF;   /* surface on paper */
  --paper-3: #DAD6CD;   /* rules on paper, decorative only */
  --ink-4: #8C877F;     /* component borders on paper, 3.16:1 */
  --ink-3: #67625B;     /* tertiary text on paper, 5.35:1 */
  --ink-2: #4C4843;     /* secondary text on paper, 8.04:1 */
  --ink: #141311;       /* primary text on paper, 16.45:1 */
  /* Signal: Pour. Marks where to look or act. Never marks a verdict. */
  --pour: #FF6B1A;      /* fills; text and focus on dark, 6.90:1 on void */
  --pour-lite: #FF9A55; /* hover on dark */
  --pour-deep: #B03E0A; /* text, links and focus on paper, 5.26:1 */
  /* Thermal ramp: Glyph Field only, encodes heat during a cast */
  --t0: #1E1B19; --t1: #5A1E0E; --t2: #9C300C; --t3: #E2561A; --t4: #FF8A33; --t5: #FFBE6A; --t6: #FFF0D4;

  --f-dot: "Doto", "Geist Mono", ui-monospace, Menlo, monospace; /* headlines: a dot-matrix face, monospaced at 0.6 em */
  --f-display: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --f-read: "Instrument Sans", "Helvetica Neue", Arial, sans-serif; /* long-form reading is Instrument Sans too */
  --f-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px;
  --s-7: 48px; --s-8: 64px; --s-9: 96px; --s-10: 128px; --s-11: 192px;
  --r-0: 0; --r-1: 2px; --r-2: 6px;
  --container: 1280px;
  --measure: 51ch;      /* about 74 characters of Instrument Sans prose */

  --d-quick: 160ms; --d-move: 320ms; --d-explain: 640ms; --d-cast: 2400ms;
  --e-standard: cubic-bezier(.2, 0, 0, 1);
  --e-exit: cubic-bezier(.4, 0, 1, 1);
  --e-cast: cubic-bezier(.16, 1, .3, 1);
}

/* Themes set role tokens; components read roles, never raw neutrals */
.ax-void {
  background: var(--void); color: var(--bone);
  --bg: var(--void); --fg: var(--bone); --fg-2: var(--ash-4); --fg-3: var(--ash-5);
  --rule: var(--seam); --rule-strong: var(--ash-5); --surface: var(--carbon); --surface-2: var(--graphite); --surface-3: var(--iron);
  --link: var(--pour); --link-hover: var(--pour-lite); --focus: var(--pour); --accent-text: var(--pour);
}
.ax-paper {
  background: var(--paper); color: var(--ink);
  --bg: var(--paper); --fg: var(--ink); --fg-2: var(--ink-2); --fg-3: var(--ink-3);
  --rule: var(--paper-3); --rule-strong: var(--ink-4); --surface: var(--white); --surface-2: var(--paper-2); --surface-3: var(--paper-3);
  --link: var(--pour-deep); --link-hover: var(--ink); --focus: var(--pour-deep); --accent-text: var(--pour-deep);
}
.ax-carbon { background: var(--carbon); }
.ax-graphite { background: var(--graphite); }

.ax-root { font-family: var(--f-display); font-stretch: 100%; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
.ax-root *, .ax-root *::before, .ax-root *::after { box-sizing: border-box; }
.ax-root :is(p, h1, h2, h3, h4, h5, ul, ol, dl, dd, figure, pre, blockquote):where(:not([class*="dx-"])) { margin: 0; }
.ax-root ul, .ax-root ol { padding: 0; list-style: none; }
.ax-root ::selection { background: var(--pour); color: var(--void); }
.ax-root :focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* Layout */
.ax-wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding-left: 40px; padding-right: 40px; }
.ax-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
.ax-rule { border-top: 1px solid var(--rule); }
.ax-rule-strong { border-top: 1px solid var(--rule-strong); }
.ax-rule-dot { border-top: 1px dotted var(--rule-strong); }

/* Type presets. Archivo: headlines, interface, and long-form reading. Plex Mono: data, code, identifiers. */
.ax-wordmark { font-family: var(--f-display); font-weight: 800; font-stretch: 125%; letter-spacing: .06em; text-transform: uppercase; }
.ax-logo { display: block; flex: none; }
.ax-display { font-family: var(--f-dot); font-weight: 900; font-size: clamp(40px, 5.4vw, 80px); line-height: 1.02; letter-spacing: 0; text-wrap: balance; }
.ax-h1 { font-family: var(--f-dot); font-weight: 900; font-size: clamp(32px, 3.8vw, 54px); line-height: 1.04; letter-spacing: 0; text-wrap: balance; }
.ax-h2 { font-family: var(--f-dot); font-weight: 860; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.12; letter-spacing: 0; text-wrap: balance; }
.ax-h3 { font-weight: 500; font-size: 24px; line-height: 1.22; letter-spacing: -.012em; }
.ax-h4 { font-weight: 600; font-size: 18px; line-height: 1.32; letter-spacing: -.004em; }
.ax-lede { font-size: 21px; line-height: 1.5; letter-spacing: -.004em; color: var(--fg-2); text-wrap: pretty; }
.ax-body { font-size: 17px; line-height: 1.62; text-wrap: pretty; }
.ax-small { font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.ax-read { font-family: var(--f-display); font-size: 19px; line-height: 1.68; letter-spacing: -.002em; text-wrap: pretty; }
.ax-read-l { font-family: var(--f-display); font-weight: 500; font-size: clamp(24px, 2.5vw, 32px); line-height: 1.28; letter-spacing: -.016em; text-wrap: balance; }
.ax-label { font-family: var(--f-mono); font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.ax-micro { font-family: var(--f-mono); font-size: 11px; line-height: 14px; font-weight: 500; letter-spacing: .07em; text-transform: uppercase; color: var(--fg-3); }
.ax-mono { font-family: var(--f-mono); font-size: 14px; line-height: 1.6; }
.ax-num { font-variant-numeric: tabular-nums; }
.ax-fg2 { color: var(--fg-2); }
.ax-fg3 { color: var(--fg-3); }
.ax-accent { color: var(--accent-text); }

/* Links */
.ax-link { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; transition: color var(--d-quick) var(--e-standard); }
.ax-link:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
.ax-arrow-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--fg); text-decoration: none; font-weight: 500; font-size: 15px; border-bottom: 1px solid var(--rule-strong); transition: border-color var(--d-quick) var(--e-standard), color var(--d-quick) var(--e-standard); }
.ax-arrow-link:hover { color: var(--accent-text); border-color: var(--accent-text); }

/* Buttons. Dark text on Pour, always. */
.ax-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px; border: 1px solid transparent; border-radius: var(--r-1); font-family: var(--f-display); font-size: 15px; font-weight: 500; letter-spacing: .005em; line-height: 1; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color var(--d-quick) var(--e-standard), border-color var(--d-quick) var(--e-standard), color var(--d-quick) var(--e-standard); }
.ax-btn-primary { background: var(--pour); color: var(--void); }
.ax-btn-primary:hover { background: var(--pour-lite); }
.ax-btn-secondary { background: transparent; color: var(--fg); border-color: var(--rule-strong); }
.ax-btn-secondary:hover { border-color: var(--fg); background: var(--surface-2); }
.ax-btn-ink { background: var(--fg); color: var(--bg); }
.ax-btn-ink:hover { background: var(--fg-2); }
.ax-btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.ax-btn[disabled], .ax-btn.is-disabled { background: transparent; color: var(--fg-3); border-color: var(--rule); cursor: not-allowed; }

/* Navigation */
.ax-navlink { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; color: var(--fg-2); text-decoration: none; font-size: 15px; font-weight: 500; border-bottom: 1px solid transparent; transition: color var(--d-quick) var(--e-standard), border-color var(--d-quick) var(--e-standard); }
.ax-navlink:hover { color: var(--fg); }
.ax-navlink.is-active { color: var(--fg); border-bottom-color: var(--accent-text); }
.ax-navmenu { display: none; }

/* Chips, codes and registry IDs */
.ax-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--r-1); font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2); white-space: nowrap; }
.ax-code { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 5px; background: var(--fg); color: var(--bg); font-family: var(--f-mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; border-radius: var(--r-1); }
.ax-code-o { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 5px; border: 1px solid var(--fg-3); color: var(--fg); font-family: var(--f-mono); font-size: 11px; font-weight: 600; letter-spacing: .06em; border-radius: var(--r-1); }
.ax-rid { font-family: var(--f-mono); font-size: 12px; font-weight: 500; letter-spacing: .05em; color: var(--fg-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ax-rid b { color: var(--fg); font-weight: 600; }
.ax-ph { font-family: var(--f-mono); font-size: .92em; color: var(--fg-3); letter-spacing: .02em; }

/* Figure stamps: the border style carries the meaning, the word states it */
.ax-stamp { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 7px; border: 1px dashed currentColor; border-radius: var(--r-1); font-family: var(--f-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-2); white-space: nowrap; }
.ax-stamp-schematic { border-style: dashed; }
.ax-stamp-simulated { border-style: dotted; border-width: 2px; }
.ax-stamp-measured { border-style: solid; }

/* Figure plate with registration corners */
.ax-plate { position: relative; border: 1px solid var(--rule); background: var(--surface); }
.ax-plate::before { content: ""; position: absolute; inset: -5px; pointer-events: none;
  background:
    linear-gradient(var(--fg-3), var(--fg-3)) left top / 11px 1px no-repeat,
    linear-gradient(var(--fg-3), var(--fg-3)) left top / 1px 11px no-repeat,
    linear-gradient(var(--fg-3), var(--fg-3)) right top / 11px 1px no-repeat,
    linear-gradient(var(--fg-3), var(--fg-3)) right top / 1px 11px no-repeat,
    linear-gradient(var(--fg-3), var(--fg-3)) left bottom / 11px 1px no-repeat,
    linear-gradient(var(--fg-3), var(--fg-3)) left bottom / 1px 11px no-repeat,
    linear-gradient(var(--fg-3), var(--fg-3)) right bottom / 11px 1px no-repeat,
    linear-gradient(var(--fg-3), var(--fg-3)) right bottom / 1px 11px no-repeat; }
.ax-fig-pre { font-family: var(--f-mono); font-size: 13px; line-height: 19px; white-space: pre; color: var(--fg); overflow-x: auto; }

/* Evidence ledger: five dimensions, never one badge, never colored */
.ax-ledger { display: grid; grid-template-columns: minmax(96px, 128px) minmax(0, 1fr); border-top: 1px solid var(--rule-strong); }
.ax-ledger dt { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--rule); font-family: var(--f-mono); font-size: 11px; line-height: 18px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.ax-ledger dd { padding: 10px 0; border-bottom: 1px solid var(--rule); font-size: 15px; line-height: 20px; color: var(--fg); }
.ax-ev { display: inline-flex; align-items: center; height: 22px; padding: 0 6px; border: 1px solid var(--rule-strong); border-radius: var(--r-1); font-family: var(--f-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--fg); white-space: nowrap; }
.ax-ev-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* Code blocks stay on the instrument ground in both themes */
.ax-codeblock { background: var(--carbon); color: var(--bone); border: 1px solid var(--slag); border-radius: var(--r-1); padding: 20px 24px; font-family: var(--f-mono); font-size: 13.5px; line-height: 1.7; white-space: pre; overflow-x: auto; }
.ax-codeblock .c { color: var(--ash-5); }
.ax-codeblock .k { color: var(--pour); }
.ax-codeblock .p { color: var(--ash-4); }

/* Tables */
.ax-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ax-table th { text-align: left; font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); padding: 0 16px 10px 0; border-bottom: 1px solid var(--rule-strong); white-space: nowrap; }
.ax-table td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.ax-table tr.is-row:hover td { background: var(--surface-2); }

/* Form controls */
.ax-input { width: 100%; min-height: 44px; padding: 0 14px; background: var(--surface); color: var(--fg); border: 1px solid var(--rule-strong); border-radius: var(--r-1); font-family: var(--f-display); font-size: 15px; }
.ax-input::placeholder { color: var(--fg-3); }
.ax-check { display: flex; align-items: center; gap: 10px; min-height: 32px; font-size: 14px; color: var(--fg-2); cursor: pointer; }
.ax-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--fg); }

/* Tiles, cards and hover */
.ax-tile { display: block; color: inherit; text-decoration: none; transition: background-color var(--d-quick) var(--e-standard); }
.ax-tile:hover { background: var(--surface-2); }
.ax-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule); color: inherit; text-decoration: none; transition: border-color var(--d-quick) var(--e-standard); }
.ax-card:hover { border-color: var(--rule-strong); }

/* Sidenotes and pull rules for long-form pages */
.ax-sidenote { font-size: 14px; line-height: 1.5; color: var(--fg-2); border-top: 1px solid var(--rule); padding-top: 10px; }
.ax-sidenote b { font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; color: var(--fg-3); font-weight: 500; margin-right: 6px; }

/* Diagram primitives for page diagrams (canvas diagrams use placed elements) */
.ax-node { display: inline-flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 8px 12px; border: 1px solid var(--rule-strong); background: var(--surface); border-radius: var(--r-1); }
.ax-node-proposed { border-style: dashed; background: transparent; }
.ax-wire { flex: 1 1 24px; min-width: 24px; height: 0; border-top: 1.5px solid var(--fg-3); }
.ax-wire-proposed { border-top-style: dashed; }

/* Swatches */
.ax-swatch { height: 96px; border-radius: var(--r-1); border: 1px solid var(--rule); }

/* Motion */
@keyframes ax-caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.ax-caret { display: inline-block; width: .55em; height: 1em; background: var(--pour); vertical-align: -0.12em; animation: ax-caret 1.1s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) {
  .ax-root *, .ax-root *::before, .ax-root *::after { animation: none !important; transition: none !important; }
}

/* Responsive */
@media (max-width: 960px) {
  .ax-navlinks { display: none !important; }
  .ax-navmenu { display: inline-flex !important; }
  .ax-hide-md { display: none !important; }
}
@media (max-width: 760px) {
  .ax-wrap { padding-left: 20px; padding-right: 20px; }
  .ax-hide-sm { display: none !important; }
  .ax-stack-sm { flex-direction: column !important; align-items: stretch !important; }
  .ax-lede { font-size: 19px; }
  .ax-read { font-size: 18px; }
  .ax-codeblock { padding: 16px; font-size: 12.5px; }
}
