:root {
  --paper: #f6f4ef;
  --ink: #151719;
  --muted: #62676b;
  --line: #d6d1c8;
  --panel: #ffffff;
  --field: #ece8df;
  --black: #111111;
  --yellow: #f0c84b;
  --cyan: #4fb6c6;
  --green: #6aa56a;
  --red: #d96b5f;
  --radius: 8px;
  --mono: "SFMono-Regular", "Cascadia Mono", Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
}
body::selection { background: var(--yellow); color: var(--black); }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 20;
  background: var(--black);
  color: #fff;
  padding: 8px 10px;
  border-radius: 4px;
}
.skip-link:focus { top: 12px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 62px;
  padding: 10px clamp(14px, 3%, 34px);
  background: rgba(246, 244, 239, 0.96);
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 800;
}
.mark {
  width: 18px;
  height: 18px;
  display: inline-block;
  background: linear-gradient(90deg, var(--yellow) 0 25%, var(--cyan) 25% 50%, var(--green) 50% 75%, var(--red) 75%);
  border: 1px solid var(--black);
}
.topnav {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
  min-width: 0;
  max-width: 100%;
}
.topnav a {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 0.72rem;
  white-space: nowrap;
}
.topnav a[aria-current="page"] {
  background: var(--black);
  border-color: var(--black);
  color: #fff;
}
.index-shell,
.page-shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3%, 38px);
}
.home-hero,
.utility-hero,
.article-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: clamp(18px, 4%, 48px);
  align-items: stretch;
  padding: 42px 0 36px;
  border-bottom: 1px solid var(--black);
}
.home-hero {
  min-height: 560px;
}
.hero-copy {
  display: grid;
  align-content: center;
}
.eyebrow,
.module-kicker,
.section-title p,
.change-row > span,
.card-head span,
.result-count,
.muted {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
}
h1,
h2,
h3,
p { overflow-wrap: anywhere; }
h1 {
  margin: 0;
  max-width: 980px;
  font-size: 5.6rem;
  line-height: 0.92;
  font-weight: 820;
  letter-spacing: 0;
}
.article-hero h1,
.utility-hero h1 {
  font-size: 4.4rem;
}
.lede {
  max-width: 780px;
  margin: 22px 0 0;
  font-size: 1.35rem;
  line-height: 1.28;
  color: #303236;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}
.hero-meta span {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 4px;
  padding: 7px 9px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
}
.home-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-content: center;
}
.utility-card,
.persona-card,
.module-card,
.opportunity-card,
.source-card,
.change-card {
  min-width: 0;
  border: 1px solid var(--black);
  border-radius: var(--radius);
  background: var(--panel);
}
.utility-card {
  min-height: 150px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 12px;
}
.utility-card span,
.status-badge,
.confidence {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid var(--black);
  border-radius: 4px;
  background: var(--yellow);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-style: normal;
}
.status-badge,
.confidence {
  max-width: 100%;
  min-width: 0;
  width: auto;
  white-space: normal;
  text-align: left;
  overflow-wrap: anywhere;
}
.utility-card b {
  display: block;
  font-size: 1.35rem;
  line-height: 1.05;
}
.utility-card em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 0.94rem;
}
.visual-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.visual-strip img,
.hero-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.visual-strip img {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--black);
  border-radius: var(--radius);
}
.hero-visual {
  position: relative;
  min-height: 360px;
  border: 1px solid var(--black);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--field);
}
.visual-label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--black);
  border-radius: 4px;
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}
.section-band,
.directory-panel {
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}
.split-band {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 28px;
}
.section-title {
  max-width: 720px;
  margin-bottom: 18px;
}
.section-title.compact {
  margin-bottom: 12px;
}
.section-title h2 {
  margin: 4px 0 0;
  font-size: 2.15rem;
  line-height: 1.02;
  letter-spacing: 0;
}
.persona-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.persona-card {
  padding: 13px;
  min-height: 330px;
}
.card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.card-head h3,
.module-card h3,
.source-card h3,
.change-card h3,
.change-row h3,
.opportunity-card h3 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.08;
  letter-spacing: 0;
}
.action-list {
  margin: 12px 0 0;
}
.action-list dt {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
}
.action-list dd {
  margin: 3px 0 0;
  color: #2d3033;
}
.boundary-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  padding: 13px;
  border: 1px solid var(--black);
  border-radius: var(--radius);
  background: var(--yellow);
}
.lab-banner {
  background: #fff1ec;
  border-color: var(--red);
}
.boundary-banner b {
  font-family: var(--mono);
  text-transform: uppercase;
  font-size: 0.78rem;
}
.boundary-banner span {
  flex: 1 1 280px;
}
.text-link,
.boundary-banner a,
.source-links a {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.change-list {
  display: grid;
  border-top: 1px solid var(--black);
}
.change-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.change-row p {
  margin: 3px 0 0;
  color: var(--muted);
}
.module-section {
  padding: 18px 0 4px;
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.module-card {
  min-height: 205px;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
}
.module-card p {
  margin: 0;
  color: var(--muted);
}
.module-card.is-hidden,
.opportunity-card.is-hidden,
.module-section.is-empty {
  display: none;
}
.directory-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(4, minmax(150px, 1fr)) auto;
  gap: 8px;
  align-items: end;
  margin: 12px 0 14px;
}
.directory-controls.slim {
  grid-template-columns: minmax(220px, 420px) minmax(180px, 260px);
  align-items: end;
}
.directory-controls label {
  display: grid;
  gap: 5px;
}
.directory-controls label span {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
}
input,
select,
.plain-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--black);
  border-radius: 4px;
  background: var(--panel);
  color: var(--ink);
  padding: 0 10px;
  font: inherit;
}
.plain-button {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.76rem;
  background: var(--field);
}
.result-count {
  min-height: 18px;
  margin: 8px 0 14px;
}
.opportunity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.opportunity-card {
  display: grid;
  gap: 12px;
  padding: 13px;
  min-height: 360px;
}
.opportunity-card * {
  min-width: 0;
}
.opportunity-card .meta-row,
.opportunity-card .tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.status-open { background: var(--green); }
.status-live { background: var(--cyan); }
.status-monitor { background: var(--field); }
.status-closed { background: var(--red); color: #fff; }
.opportunity-card p,
.source-card p,
.change-card p {
  margin: 0;
  color: #2d3033;
}
.opportunity-card dl {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0;
}
.opportunity-card dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
}
.opportunity-card dd {
  margin: 0;
}
.tag-row span {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 6px;
  background: var(--field);
  font-family: var(--mono);
  font-size: 0.68rem;
}
.official-link {
  width: max-content;
  max-width: 100%;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--black);
  border-radius: 4px;
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 0.76rem;
  background: var(--yellow);
}
.changelog-list {
  display: grid;
  gap: 10px;
}
.change-card {
  padding: 13px;
}
.change-card .source-links,
.source-card .source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.source-card {
  padding: 13px;
  min-height: 180px;
}
.article-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(20px, 4%, 58px);
  padding-top: 32px;
}
.article-layout.single-column {
  display: block;
}
.section-nav {
  position: sticky;
  top: 82px;
  align-self: start;
  display: grid;
  gap: 6px;
}
.section-nav a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.25;
}
.section-nav span {
  color: var(--muted);
}
.article-content {
  border-top: 1px solid var(--black);
}
.article-content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.article-section {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: clamp(14px, 3%, 42px);
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}
.section-index {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.82rem;
}
.section-body {
  max-width: 900px;
}
.section-body h2 {
  margin: 0 0 18px;
  font-size: 2.25rem;
  line-height: 1.02;
  letter-spacing: 0;
}
.section-body h3 {
  margin: 28px 0 9px;
  font-family: var(--mono);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0;
}
.section-body p,
.section-body li {
  font-size: 1.05rem;
  color: #2c2e31;
}
.section-body p {
  margin: 0 0 15px;
}
.section-body ul {
  display: grid;
  gap: 8px;
  margin: 16px 0 20px;
  padding: 0;
  list-style: none;
}
.section-body li {
  position: relative;
  padding-left: 26px;
}
.section-body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 11px;
  height: 11px;
  background: var(--yellow);
  border: 1px solid var(--black);
}
blockquote {
  margin: 18px 0;
  border-left: 4px solid var(--black);
  padding: 8px 0 8px 18px;
  font-size: 1.08rem;
  color: #2c2e31;
}
.prev-next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 42px 0 0;
}
.prev-next a {
  display: grid;
  gap: 8px;
  min-height: 108px;
  padding: 14px;
  border: 1px solid var(--black);
  border-radius: var(--radius);
  background: var(--panel);
}
.prev-next span {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
}
.prev-next b {
  font-size: 1.35rem;
  line-height: 1;
}
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 24px clamp(14px, 3%, 34px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
}
@media (max-width: 1100px) {
  h1 { font-size: 4.4rem; }
  .article-hero h1,
  .utility-hero h1 { font-size: 3.5rem; }
  .home-hero,
  .utility-hero,
  .article-hero,
  .split-band,
  .article-layout {
    grid-template-columns: 1fr;
  }
  .persona-grid,
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .directory-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .section-nav {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .topnav {
    justify-content: start;
  }
  .index-shell,
  .page-shell {
    padding: 14px;
  }
  h1,
  .article-hero h1,
  .utility-hero h1 {
    font-size: 3rem;
  }
  .lede {
    font-size: 1.08rem;
  }
  .home-panel,
  .persona-grid,
  .module-grid,
  .opportunity-grid,
  .source-grid,
  .visual-strip,
  .directory-controls,
  .directory-controls.slim,
  .section-nav,
  .prev-next {
    grid-template-columns: 1fr;
  }
  .home-hero,
  .utility-hero,
  .article-hero {
    min-height: auto;
    padding-top: 28px;
  }
  .hero-visual {
    min-height: 240px;
  }
  .persona-card,
  .opportunity-card {
    min-height: auto;
  }
  .article-section {
    grid-template-columns: 42px minmax(0, 1fr);
  }
  .opportunity-card dl {
    grid-template-columns: 1fr;
  }
  .change-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* defence.is v0.2 visual system: functional atlas + light glitch */
:root {
  --paper: #f7f2e8;
  --ink: #121417;
  --muted: #66645e;
  --line: #cfc7b8;
  --panel: #fffaf0;
  --field: #ebe4d6;
  --black: #101114;
  --yellow: #f2c744;
  --cyan: #00a8c7;
  --green: #5f9f62;
  --red: #ff4b1f;
  --magenta: #ff4fd8;
  --blue: #255fd6;
  --radius: 6px;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, "Segoe UI", Arial, sans-serif;
  --display: "Arial Narrow", "Roboto Condensed", "Inter Tight", "Segoe UI", Arial, sans-serif;
}

body {
  background:
    linear-gradient(rgba(18, 20, 23, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 20, 23, 0.03) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px, 42px 42px, auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.04), rgba(255,255,255,0.04) 1px, transparent 1px, transparent 4px),
    linear-gradient(90deg, transparent 0 72%, rgba(0,168,199,0.07), transparent 75%);
  mix-blend-mode: multiply;
}

.topbar {
  backdrop-filter: blur(12px);
  background: rgba(247, 242, 232, 0.92);
}

.wordmark span:last-child {
  letter-spacing: 0.02em;
}

.mark {
  position: relative;
  background: var(--panel);
}

.mark::before,
.mark::after {
  content: "";
  position: absolute;
  background: var(--red);
}

.mark::before {
  width: 10px;
  height: 2px;
  left: 3px;
  top: 7px;
}

.mark::after {
  width: 2px;
  height: 10px;
  left: 7px;
  top: 3px;
}

h1,
.section-title h2,
.utility-card b,
.prev-next b {
  font-family: var(--display);
  text-transform: uppercase;
}

.home-hero.instrument-hero {
  position: relative;
  grid-template-columns: minmax(0, 0.88fr) minmax(360px, 1.12fr);
  gap: clamp(18px, 3vw, 42px);
  min-height: 620px;
  padding: 34px 0 28px;
  overflow: hidden;
}

.home-hero.instrument-hero::before {
  content: "READY / ACTUALLY / CIVIC READINESS / DEFENCE.IS";
  position: absolute;
  top: 10px;
  right: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: rgba(18, 20, 23, 0.45);
  letter-spacing: 0.08em;
}

.hero-copy {
  align-content: start;
}

.brand-lock {
  max-width: 660px;
  width: min(100%, 660px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(2px 0 0 rgba(0,168,199,0.35)) drop-shadow(-2px 0 0 rgba(255,75,31,0.25));
}

.glitch-title {
  position: relative;
  display: inline-block;
  font-size: 6.8rem;
  line-height: 0.85;
  letter-spacing: 0;
}

.glitch-title::before,
.glitch-title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.glitch-title::before {
  color: var(--cyan);
  transform: translate(3px, 0);
  clip-path: inset(18% 0 57% 0);
  opacity: 0.55;
}

.glitch-title::after {
  color: var(--red);
  transform: translate(-3px, 0);
  clip-path: inset(62% 0 12% 0);
  opacity: 0.45;
}

.hero-thesis {
  max-width: 780px;
  margin: 20px 0 0;
  padding: 14px 0 0;
  border-top: 2px solid var(--black);
  font-size: 1.32rem;
  line-height: 1.24;
}

.instrument-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 520px;
  border: 1px solid var(--black);
  background:
    linear-gradient(90deg, rgba(0,168,199,0.12), transparent 18%, transparent 82%, rgba(255,75,31,0.12)),
    var(--panel);
}

.panel-rail,
.panel-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--black);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-footer {
  border-top: 1px solid var(--black);
  border-bottom: 0;
}

.porcupine-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 390px;
  padding: 20px;
  overflow: hidden;
}

.porcupine-stage::before {
  content: "";
  position: absolute;
  inset: 24px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.75;
}

.porcupine-stage img {
  position: relative;
  z-index: 1;
  width: min(100%, 760px);
  max-height: 390px;
  object-fit: contain;
  filter: drop-shadow(5px 0 0 rgba(0,168,199,0.25)) drop-shadow(-4px 0 0 rgba(255,75,31,0.2));
}

.callout-pin {
  position: absolute;
  z-index: 2;
  border: 1px solid var(--black);
  background: var(--red);
  color: #fff;
  padding: 5px 7px;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.pin-quill { right: 8%; top: 22%; }
.pin-core { left: 10%; bottom: 18%; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.icon-button,
.plain-button,
.official-link,
.topnav a {
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--black);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.icon-button:hover,
.plain-button:hover,
.official-link:hover,
.topnav a:hover,
.utility-card:hover,
.persona-card:hover,
.module-card:hover,
.opportunity-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 var(--black);
  text-decoration: none;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--black);
  background: var(--panel);
  font-family: var(--mono);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.icon-button.primary {
  background: var(--red);
  color: #fff;
}

.home-panel {
  align-content: stretch;
}

.utility-card,
.persona-card,
.module-card,
.opportunity-card,
.source-card,
.change-card,
.prev-next a,
.section-nav a {
  border-radius: 0;
  box-shadow: 2px 2px 0 rgba(18,20,23,0.18);
}

.utility-card {
  background:
    linear-gradient(135deg, rgba(255,75,31,0.1), transparent 28%),
    var(--panel);
}

.system-strip {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--black);
}

.shield-panel,
.thesis-panel {
  min-width: 0;
  border: 1px solid var(--black);
  background: var(--panel);
}

.shield-panel {
  display: grid;
  place-items: center;
  padding: 18px;
}

.shield-panel img {
  max-width: min(100%, 360px);
  height: auto;
  filter: drop-shadow(2px 0 0 rgba(0,168,199,0.22)) drop-shadow(-2px 0 0 rgba(255,79,216,0.18));
}

.thesis-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.thesis-cell {
  min-height: 148px;
  padding: 14px;
  border-left: 1px solid var(--black);
}

.thesis-cell:first-child {
  border-left: 0;
}

.thesis-cell span,
.route-memory span,
.verb-count span {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
}

.thesis-cell strong {
  display: block;
  margin-top: 8px;
  font-family: var(--display);
  font-size: 2rem;
  line-height: 0.95;
  text-transform: uppercase;
}

.route-board {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 12px;
}

.route-tabs {
  display: grid;
  gap: 7px;
  align-content: start;
}

.route-tab {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid var(--black);
  background: var(--panel);
  font-family: var(--mono);
  text-align: left;
  cursor: pointer;
}

.route-tab span {
  display: grid;
  place-items: center;
  align-self: stretch;
  background: var(--field);
  border-right: 1px solid var(--black);
}

.route-tab.is-active {
  background: var(--black);
  color: #fff;
}

.route-display {
  min-width: 0;
  border: 1px solid var(--black);
  background: var(--panel);
  padding: 16px;
}

.route-display h3 {
  margin: 0;
  font-size: 2.1rem;
  line-height: 0.95;
}

.route-doors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.route-door {
  min-height: 118px;
  padding: 12px;
  border: 1px solid var(--black);
  background: var(--field);
}

.route-door b {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.route-memory {
  margin-top: 12px;
  padding: 9px 10px;
  border: 1px dashed var(--black);
  background: rgba(255,255,255,0.55);
}

#reader-router .persona-grid {
  display: none;
}

.systems-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: 12px;
}

.layer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.layer-node {
  position: relative;
  min-height: 180px;
  padding: 14px;
  border: 1px solid var(--black);
  background: var(--panel);
  overflow: hidden;
}

.layer-node::after {
  content: "";
  position: absolute;
  inset: auto 10px 10px auto;
  width: 46px;
  height: 46px;
  border: 1px solid var(--black);
  background: var(--accent, var(--yellow));
  opacity: 0.85;
}

.layer-node h3 {
  margin: 0;
  max-width: 280px;
  font-size: 1.55rem;
  line-height: 0.98;
  text-transform: uppercase;
}

.layer-node p {
  margin: 10px 0 0;
  color: var(--muted);
}

.layer-node[data-layer="shield"] { --accent: var(--red); }
.layer-node[data-layer="nervous"] { --accent: var(--cyan); }
.layer-node[data-layer="bloodstream"] { --accent: var(--yellow); }
.layer-node[data-layer="fabric"] { --accent: var(--green); }

.porcupine-logic {
  display: grid;
  align-content: stretch;
  border: 1px solid var(--black);
  background: var(--black);
  color: var(--panel);
}

.porcupine-logic > div {
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.25);
}

.porcupine-logic > div:last-child {
  border-bottom: 0;
}

.porcupine-logic h3 {
  margin: 0;
  font-size: 2rem;
  line-height: 0.92;
}

.porcupine-logic p {
  color: rgba(255,250,240,0.78);
}

.verbs-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.verb-tile {
  min-height: 150px;
  display: grid;
  align-content: space-between;
  padding: 12px;
  border: 1px solid var(--black);
  background: var(--panel);
  cursor: pointer;
}

.verb-tile[aria-pressed="true"] {
  background: var(--black);
  color: var(--panel);
}

.verb-tile .verb-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--black);
  background: var(--red);
  color: #fff;
  font-family: var(--mono);
}

.verb-tile[aria-pressed="true"] .verb-icon {
  background: var(--cyan);
  color: var(--black);
  border-color: var(--panel);
}

.verb-tile b {
  font-family: var(--display);
  font-size: 1.38rem;
  line-height: 0.95;
  text-transform: uppercase;
}

.verb-tile em {
  font-style: normal;
  color: var(--muted);
}

.verb-tile[aria-pressed="true"] em {
  color: rgba(255,250,240,0.75);
}

.verb-count {
  margin-top: 12px;
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px dashed var(--black);
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.opportunity-card.signal-non-citizen {
  border-width: 2px;
  box-shadow: 0 0 0 4px rgba(0,168,199,0.16), 4px 4px 0 var(--black);
}

.route-signal {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid var(--black);
  background: var(--cyan);
  color: var(--black);
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.status-open,
.status-live {
  background: var(--cyan);
}

.status-monitor {
  background: var(--yellow);
}

.status-closed {
  background: var(--red);
}

.visual-strip {
  display: none;
}

@media (max-width: 1100px) {
  .home-hero.instrument-hero,
  .system-strip,
  .route-board,
  .systems-board {
    grid-template-columns: 1fr;
  }
  .verbs-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .glitch-title {
    font-size: 5.2rem;
  }
}

@media (max-width: 760px) {
  body {
    background-size: 30px 30px, 30px 30px, auto;
  }
  .home-hero.instrument-hero {
    min-height: auto;
  }
  .glitch-title {
    font-size: 3.15rem;
  }
  .instrument-panel {
    min-height: 420px;
  }
  .porcupine-stage {
    min-height: 300px;
  }
  .panel-rail,
  .panel-footer,
  .thesis-panel,
  .route-doors,
  .layer-grid,
  .verbs-grid {
    grid-template-columns: 1fr;
  }
  .thesis-panel {
    display: grid;
  }
  .thesis-cell,
  .thesis-cell:first-child {
    border-left: 0;
    border-top: 1px solid var(--black);
  }
  .thesis-cell:first-child {
    border-top: 0;
  }
  .callout-pin {
    position: static;
    justify-self: start;
    margin: 6px;
  }
}


/* --- v2 additions: deadline urgency + router deep-link --- */
.deadline-badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}
.deadline-badge.soon { color: #7a4a08; border-color: #e4c98e; background: #faf0da; font-weight: 700; }
.deadline-badge.past { color: #8c2f28; border-color: #e3b8b3; background: #f9e9e7; }
.route-live { margin-top: 10px; }
.route-live a {
  font-family: var(--mono);
  font-size: 0.8rem;
  border-bottom: 2px solid var(--yellow);
  padding-bottom: 2px;
}


/* --- v3 additions: Book in Ten Screens (chapter modules) --- */
.chapter-band { padding: 36px 0; border-bottom: 1px solid var(--line); }
.ch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(300px, 0.96fr);
  gap: clamp(18px, 4%, 46px);
  align-items: center;
}
.chapter-band.alt .ch-grid .ch-svg { order: -1; }
.ch-thesis { font-size: 1.18rem; font-weight: 650; margin: 6px 0 12px; }
.ch-takeaways { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 9px; }
.ch-takeaways li { padding-left: 20px; position: relative; }
.ch-takeaways li::before {
  content: "";
  position: absolute; left: 0; top: 7px;
  width: 10px; height: 10px;
  background: var(--yellow);
  border: 1.5px solid var(--ink);
}
.chapter-band.alt .ch-takeaways li::before { background: var(--cyan); }
.ch-links { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; }
.ch-links a {
  font-family: var(--mono); font-size: 0.74rem;
  padding: 6px 9px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--panel);
}
.ch-links a:hover { border-color: var(--ink); text-decoration: none; }
.ch-svg { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 14px 10px; }
.ch-svg svg { display: block; width: 100%; height: auto; }
.ch-svg figcaption { font-family: var(--mono); font-size: 0.72rem; color: var(--muted); margin-top: 8px; }
@media (max-width: 880px) {
  .ch-grid { grid-template-columns: 1fr; }
  .chapter-band.alt .ch-grid .ch-svg { order: 0; }
}


/* --- v4 additions: in-article figures --- */
.page-figure { margin: 26px 0 0; }
.page-figure img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.page-figure figcaption { font-family: var(--mono); font-size: 0.74rem; color: var(--muted); margin-top: 8px; }
