:root {
  --paper: #10100e;
  --paper-2: #161613;
  --ink: #e7e2d4;
  --muted: #948e80;
  --faint: #6e695d;
  --rule: #2f2d27;
  --rule-strong: #6d6759;
  --brass: #c4a56a;
  --construct: #6a8894;
  --revision: #c45c38;
  --ai: #7fa0ab;
  --grid: rgba(199, 189, 164, 0.045);
  --sheet-gap: 10px;
  --zone: 22px;
  --gutter: clamp(1.1rem, 3.2vw, 2.75rem);
  --font-sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-cond: "IBM Plex Sans Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;
  --max: 1180px;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.7'/%3E%3C/svg%3E");
}

a {
  color: var(--brass);
  text-decoration: none;
}

a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

:focus-visible {
  outline: 1px solid var(--brass);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 50;
  padding: 0.5rem 0.8rem;
  background: var(--paper-2);
  border: 1px solid var(--brass);
  color: var(--ink);
}

.skip:focus {
  top: 1rem;
}

.sheet {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - (var(--sheet-gap) * 2));
  margin: var(--sheet-gap);
  padding: calc(var(--zone) + 10px) var(--gutter) var(--zone);
  border: 1.5px solid var(--rule-strong);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
  box-shadow:
    0 0 0 6px var(--paper),
    0 0 0 7px var(--rule);
}

.sheet-frame {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 2;
}

.zones {
  position: absolute;
  display: flex;
  justify-content: space-around;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

.zones-x {
  left: var(--zone);
  right: var(--zone);
  height: var(--zone);
  align-items: center;
}

.zones-x.top { top: 0; border-bottom: 1px solid var(--rule); }
.zones-x.bottom { bottom: 0; border-top: 1px solid var(--rule); }

.zones-y {
  top: var(--zone);
  bottom: var(--zone);
  width: var(--zone);
  flex-direction: column;
  align-items: center;
}

.zones-y.left { left: 0; border-right: 1px solid var(--rule); }
.zones-y.right { right: 0; border-left: 1px solid var(--rule); }

.tick {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1px solid var(--brass);
}

.tick-tl { top: 5px; left: 5px; border-right: 0; border-bottom: 0; }
.tick-tr { top: 5px; right: 5px; border-left: 0; border-bottom: 0; }
.tick-bl { bottom: 5px; left: 5px; border-right: 0; border-top: 0; }
.tick-br { bottom: 5px; right: 5px; border-left: 0; border-top: 0; }

.mast {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule-strong);
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
}

.brand:hover { color: inherit; text-decoration: none; }

.brand img {
  width: 42px;
  height: 42px;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.brand-name {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.brand-meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-index a {
  color: var(--muted);
  text-decoration: none;
}

.nav-index a:hover,
.nav-index a[aria-current="location"] {
  color: var(--ink);
  text-decoration: none;
}

.nav-index a[aria-current="location"]::before {
  content: "▸ ";
  color: var(--brass);
}

.wrap {
  position: relative;
  z-index: 3;
  max-width: var(--max);
  margin: 0 auto;
}

.hero {
  padding: clamp(2.2rem, 7vh, 4.5rem) 0 clamp(2.5rem, 8vh, 5.5rem);
}

.plate-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin: 0 0 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.plate-meta span { white-space: nowrap; }

.identity {
  position: relative;
  padding: 0.4rem 0 1.4rem;
}

.identity::before,
.identity::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--construct) 0 12px,
    transparent 12px 16px,
    var(--construct) 16px 18px,
    transparent 18px 22px
  );
  opacity: 0.45;
}

.identity::before { top: 0; }
.identity::after { bottom: 0; }

.wordmark {
  margin: 0;
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: clamp(2.7rem, 12vw, 8.4rem);
  line-height: 0.88;
  letter-spacing: -0.03em;
  text-transform: lowercase;
  overflow-wrap: anywhere;
}

.scale {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.scale span { margin-right: 0.7rem; }

.scale i {
  display: block;
  width: 22px;
  height: 7px;
  border: 1px solid var(--rule-strong);
  border-left: 0;
}

.scale i:first-of-type { border-left: 1px solid var(--rule-strong); }
.scale i:nth-of-type(odd) { background: var(--ink); }

.legal {
  margin: 0.85rem 0 0;
  font-family: var(--font-cond);
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brass);
}

.lede {
  max-width: 38rem;
  margin: 1.35rem 0 0;
  color: var(--ink);
  font-size: 1.12rem;
}

.spec-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 2.6rem;
  background: var(--rule);
  border: 1px solid var(--rule-strong);
}

.spec {
  background: var(--paper);
  padding: 1rem 1.15rem 1.15rem;
}

.spec dt {
  margin: 0 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.spec dd {
  margin: 0;
  font-family: var(--font-cond);
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.section {
  padding: clamp(2.2rem, 6vh, 4rem) 0;
  border-top: 1px solid var(--rule);
}

.section-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1.6rem;
}

.section-id {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.1rem;
  height: 3.1rem;
  border: 1px solid var(--brass);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--brass);
}

.section-title {
  margin: 0;
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.4vw, 2.15rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}

.section-ref {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.notes-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem 3rem;
}

.prose p { margin: 0 0 1rem; color: var(--ink); }
.prose p:last-child { margin-bottom: 0; }

.note-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--rule);
}

.note-list li {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.8rem;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.95rem;
}

.note-list li:last-child { border-bottom: 0; }

.note-list b {
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--brass);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

.show-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule-strong);
}

.show {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.25rem 1.2rem 1.3rem;
  background: var(--paper);
  color: inherit;
  text-decoration: none;
}

a.show:hover {
  color: inherit;
  text-decoration: none;
  background: var(--paper-2);
}

.show-kicker {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.show h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-cond);
  font-size: 1.55rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
}

.show p {
  margin: 0 0 1.2rem;
  color: var(--muted);
  flex: 1;
}

.show-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.show-links a { color: var(--brass); }

.on-hold {
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 7px,
    rgba(196, 92, 56, 0.09) 7px,
    rgba(196, 92, 56, 0.09) 8px
  );
}

.hold-flag {
  color: var(--revision);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.2rem;
  margin-bottom: 1rem;
}

.legend {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.layers {
  display: flex;
  border: 1px solid var(--rule-strong);
}

.layers button {
  appearance: none;
  margin: 0;
  padding: 0.45rem 0.85rem;
  border: 0;
  border-right: 1px solid var(--rule-strong);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
}

.layers button:last-child { border-right: 0; }

.layers button[aria-pressed="true"] {
  background: var(--brass);
  color: #16140f;
}

.layers button:hover:not([aria-pressed="true"]) {
  color: var(--ink);
  background: var(--paper-2);
}

.group-label {
  margin: 1.6rem 0 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.works {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule-strong);
}

.work {
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.15rem 1.2rem;
  background: var(--paper);
  color: inherit;
  text-decoration: none;
  min-height: 11.5rem;
}

a.work:hover {
  color: inherit;
  text-decoration: none;
  background: var(--paper-2);
}

.work-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.kind {
  color: var(--ai);
}

.kind-natural { color: var(--brass); }

.work h3 {
  margin: 0 0 0.3rem;
  font-family: var(--font-cond);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.work .host {
  margin: 0 0 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}

.work p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.connect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule-strong);
}

.connect {
  display: flex;
  flex-direction: column;
  min-height: 9.5rem;
  padding: 1.1rem 1.15rem 1.2rem;
  background: var(--paper);
  color: inherit;
  text-decoration: none;
}

a.connect:hover {
  color: inherit;
  text-decoration: none;
  background: var(--paper-2);
}

.connect-kicker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.connect strong {
  margin-top: 1.1rem;
  font-family: var(--font-cond);
  font-size: 1.25rem;
  font-weight: 600;
}

.connect-url {
  margin-top: auto;
  padding-top: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  line-height: 1.4;
  color: var(--brass);
  overflow-wrap: anywhere;
}

.title-block {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: 1.4fr 1.1fr 0.8fr 0.7fr;
  margin: 2.4rem calc(var(--gutter) * -1) 0;
  border-top: 1.5px solid var(--rule-strong);
  background: var(--paper-2);
}

.tb {
  padding: 0.85rem 1.1rem 1rem;
  border-right: 1px solid var(--rule);
}

.tb:last-child { border-right: 0; }

.tb span {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.tb strong {
  font-family: var(--font-cond);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.page-error {
  padding: clamp(3rem, 12vh, 7rem) 0 4rem;
}

.page-error h1 {
  margin: 0 0 0.6rem;
  font-family: var(--font-cond);
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 0.95;
}

.page-error p {
  max-width: 32rem;
  color: var(--muted);
}

.page-error .back {
  display: inline-block;
  margin-top: 1.5rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--brass);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  text-decoration: none;
}

.page-error .back:hover {
  background: var(--brass);
  color: #16140f;
}

@media (max-width: 980px) {
  .spec-row,
  .show-grid,
  .works,
  .connect-grid {
    grid-template-columns: 1fr 1fr;
  }

  .notes-grid { grid-template-columns: 1fr; }
  .title-block { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .sheet {
    margin: 6px;
    padding: 18px 1rem 0;
    box-shadow:
      0 0 0 4px var(--paper),
      0 0 0 5px var(--rule);
  }

  .zones,
  .tick { display: none; }

  .spec-row,
  .show-grid,
  .works,
  .connect-grid,
  .title-block {
    grid-template-columns: 1fr;
  }

  .section-head {
    grid-template-columns: auto 1fr;
  }

  .section-ref { display: none; }

  .title-block { margin-left: -1rem; margin-right: -1rem; }

  .wordmark { letter-spacing: -0.04em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media print {
  body { background: #fff; color: #111; }
  body::before,
  .sheet-frame { display: none; }
  .sheet {
    margin: 0;
    border-color: #111;
    box-shadow: none;
    background: #fff;
  }
  a { color: inherit; text-decoration: underline; }
  .title-block { background: #fff; }
}
