/* Shared website foundations. Media illustrations keep their own content palette. */
:root {
  --paper: #000;
  --ink: #fff;
  --charcoal: #fff;
  --muted: #999;
  --rule: #1b1b1b;
  --control: #1b1b1b;
  --hover: #333;
  --text-reading: #d0d0d0;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'Instrument Sans', sans-serif;
  --left: 288px;
  --width: 560px;
  --prose-width: 488px;
  --page-top: 160px;
  --section-row-height: 58px;
  --control-height: 32px;
  --marker-size: 7px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --type-heading: 400 24px/30px var(--sans);
  --type-section: 400 20px/26px var(--sans);
  --type-body: 400 15px/23px var(--sans);
  --type-meta: 400 10px/12.5px var(--mono);
  --type-machine-heading: 400 16px/23px var(--mono);
  --type-machine-prose: 400 12px/20px var(--mono);
  --button-font: var(--type-meta);
  --button-tracking: 1px;
  --button-surround: #1b1b1b;
  --button-face: #000;
  --button-hover: #2a2a2a;
  --button-pressed: #111;
  --button-face-hover: #111;
  --button-face-pressed: #080808;
  --button-inset: 4px;
  --button-radius: 5px;
  --button-inner-radius: 3px;
}

/* Reset and document defaults. */
* { box-sizing: border-box; }
html { background: var(--paper); scrollbar-gutter: stable; }
body { margin: 0; color: var(--ink); font: 400 12px/1.3 var(--mono); letter-spacing: 1.2px; -webkit-font-smoothing: antialiased; overflow-x: clip; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; border: 0; padding: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, figure, ul { margin: 0; }
h1, h2, h3 { font-weight: 400; }
ul { list-style: none; padding: 0; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }
::selection { background: #333; color: var(--ink); }

/* Rails, identity and homepage sections. */
.page-shell { position: relative; margin-left: var(--left); width: var(--width); padding: var(--page-top) 0 128px; min-height: 100svh; }
.guides { position: absolute; left: -16px; top: 0; height: 100%; width: calc(100% + 32px); border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); pointer-events: none; z-index: -1; overflow: hidden; }
.identity { position: fixed; left: 96px; top: calc(var(--page-top) + 6px); display: block; width: 128px; height: 16px; z-index: 2; }
.identity img, .toggle-icon img, .copy-icon { display: block; filter: brightness(0) invert(1); }
.statement { font: var(--type-heading); letter-spacing: 0; margin-bottom: var(--space-6); }
.rule { position: relative; height: 1px; background: var(--rule); margin-left: -16px; width: calc(100% + 32px); pointer-events: none; }
.full-rule { overflow: hidden; height: 13px; margin-top: -6px; margin-bottom: -6px; background: linear-gradient(to bottom, transparent 6px, var(--rule) 6px, var(--rule) 7px, transparent 7px); width: 100vw; margin-left: calc(-1 * var(--left)); }
.section-toggle { display: flex; align-items: center; justify-content: flex-start; gap: var(--space-3); width: 100%; height: var(--section-row-height); text-align: left; font: var(--type-section); letter-spacing: 0; }
.section-toggle::before { content: ''; width: var(--marker-size); height: var(--marker-size); flex: none; background: var(--ink); }
.section-toggle:hover { color: #aaa; }
.toggle-icon { width: 24px; height: 26px; display: flex; align-items: center; justify-content: center; margin-left: auto; flex: none; }
.section-content { max-width: var(--prose-width); padding-bottom: var(--space-8); }
.copy-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.human .copy-stack p, .human .focus-list { font: var(--type-body); letter-spacing: 0; text-transform: none; color: var(--muted); }
.eyebrow { font: var(--type-meta); letter-spacing: 1px; text-transform: uppercase; color: var(--ink); }
.human .eyebrow { font: 400 11px/16px var(--mono); }
.information { display: grid; grid-template-columns: 244px 212px; gap: var(--space-8); margin-top: var(--space-8); }
.information .eyebrow { margin-bottom: var(--space-4); }
.focus-list { font: 400 12px/15.6px var(--mono); letter-spacing: 1.2px; }
.human .focus-list { color: var(--ink); }
.contacts { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.work-action { margin-top: var(--space-6); }
.lower { padding-top: var(--space-12); display: flex; flex-direction: column; gap: var(--space-12); }
.wave { position: relative; width: 100%; aspect-ratio: 560/300; isolation: isolate; overflow: hidden; border-radius: 8px; background: #142327; }

/* Actions, copy feedback and persistent view selection. */
.control, .machine-links a { background: var(--button-surround); color: var(--ink); border: 0; border-radius: var(--button-radius); font: var(--button-font); letter-spacing: var(--button-tracking); text-transform: uppercase; transition: background 150ms ease; min-height: var(--control-height); }
.control { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); padding: 0 var(--space-4); white-space: nowrap; }
.control:hover, .machine-links a:hover { background: var(--button-hover); }
.control:active, .machine-links a:active { background: var(--button-pressed); }
.control:disabled { color: var(--muted); cursor: default; background: var(--button-surround); opacity: .55; }
.copy-icon { flex: none; }
.copy-label { position: relative; display: block; }
.copy-label .original { display: block; }
.feedback { position: absolute; inset: 0; text-align: left; visibility: hidden; }
.copy.is-copied .original { visibility: hidden; }
.copy.is-copied .feedback { visibility: visible; }
.view-mode { position: fixed; left: 96px; bottom: 44px; display: flex; gap: 2px; align-items: center; padding: var(--button-inset); height: var(--control-height); background: var(--button-surround); border-radius: var(--button-radius); z-index: 10; font: var(--button-font); letter-spacing: var(--button-tracking); color: var(--paper); text-transform: uppercase; }
.view-mode a { display: flex; align-items: center; padding: 0 8px; gap: 7px; height: 100%; color: var(--muted); border-radius: var(--button-inner-radius); transition: background 150ms ease, color 150ms ease; }
.view-mode a[aria-current] { background: var(--button-face); color: var(--ink); }
.view-mode a:hover { color: var(--ink); background: var(--button-face-hover); }
.view-mode a:active { background: var(--button-face-pressed); }
.view-mode a:focus-visible { outline-offset: 3px; }
.indicator { display: none; }
.view-mode a[aria-current] .indicator { display: block; width: var(--marker-size); height: var(--marker-size); background: var(--ink); }

/* Footer and Machine studio brief. */
.footer-wrap { padding-bottom: var(--space-12); }
.footer-wrap footer { margin-top: var(--space-6); }
footer { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); font: var(--type-meta); letter-spacing: var(--button-tracking); text-transform: uppercase; }
footer small { font: inherit; color: var(--muted); white-space: nowrap; }
.socials { display: flex; gap: 20px; align-items: center; color: var(--ink); }
.socials a { display: flex; align-items: center; min-height: 32px; }
.socials a:hover { text-decoration: underline; text-underline-offset: 4px; }
.machine .page-shell { padding-top: 80px; }
.machine .identity { top: 86px; }
.machine main { display: flex; flex-direction: column; gap: var(--space-6); font: 400 12px/15.6px var(--mono); letter-spacing: 1.2px; }
.brief-header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); }
.brief-header .eyebrow { margin-bottom: var(--space-1); }
.machine .brief-header > div > p { font: inherit; }
.brief-section { display: flex; flex-direction: column; gap: var(--space-2); }
.machine .copy-stack { gap: var(--space-3); color: var(--muted); }
.machine .focus-list { font: inherit; color: var(--muted); }
.system-title { font: inherit; }
.machine-links { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-3); }
.machine-links a { display: flex; flex-wrap: wrap; gap: var(--space-1); padding: 8px 12px; width: 100%; }
.machine-links a span { color: var(--muted); overflow-wrap: anywhere; }
.updated { color: var(--muted); }

/* Accessible utilities and clipboard fallback. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 12px; left: 12px; transform: translateY(-200%); background: var(--paper); z-index: 100; padding: 8px 12px; }
.skip-link:focus { transform: none; }
.copy-dialog { max-width: calc(100% - 40px); width: 440px; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); padding: var(--space-6); font: var(--type-body); }
.copy-dialog::backdrop { background: #1f1f1f44; }
.copy-dialog h2 { font-size: 20px; margin-bottom: var(--space-3); }
.copy-dialog textarea { display: block; width: 100%; height: 160px; margin: var(--space-4) 0; background: var(--control); border: 1px solid var(--rule); font: 13px/20px var(--mono); padding: var(--space-3); color: var(--ink); }

@media (min-width: 1000px) {
  /* Rules begin at the content rail and never cross the identity rail. */
  .full-rule { margin-left: -16px; width: calc(100vw - var(--left) + 16px); }
}
@media (min-width: 1700px) {
  :root { --left: calc((100vw - 1508px)/2 + 288px); }
  .identity, .view-mode { left: calc((100vw - 1508px)/2 + 96px); }
}
@media (max-width: 999px) {
  :root { --left: 20px; --width: min(560px, calc(100vw - 40px)); --control-height: 44px; }
  html { scrollbar-gutter: auto; }
  .page-shell, .machine .page-shell { margin: 0 auto; padding: var(--space-8) 0 calc(112px + env(safe-area-inset-bottom)); min-height: 100svh; }
  .guides { display: none; }
  .identity, .machine .identity { position: static; margin-bottom: var(--space-8); }
  .statement { margin-bottom: var(--space-8); }
  .rule, .full-rule { margin-left: 0; width: 100%; }
  .section-content { max-width: none; }
  .lower { padding-top: var(--space-8); gap: var(--space-8); }
  .wave { aspect-ratio: 350/210; border-radius: 6px; }
  .footer-wrap { padding-bottom: 0; }
  .footer-wrap > .rule { display: none; }
  .footer-wrap footer { margin-top: 0; }
  footer, .socials a, .control { min-height: 44px; }
  .view-mode { left: 20px; bottom: calc(46px + env(safe-area-inset-bottom)); }
  .brief-header { flex-wrap: wrap; }
  .machine-links a { min-height: 44px; align-items: center; padding: 8px 12px; }
}
@media (max-width: 599px) {
  :root { --button-tracking: .6px; }
  .information { grid-template-columns: 1fr; }
  .brief-header { flex-direction: column; }
  .machine-links a { display: block; }
  .machine-links a span { display: block; margin-top: var(--space-1); }
  .wave { margin: 0; }
  .socials { gap: var(--space-4); }
  footer { gap: var(--space-3); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
