:root {
  --paper: #f1f3ec;
  --paper-2: #e5e8dd;
  --ink: #0b1415;
  --ink-2: #162427;
  --muted: #66706d;
  --line: rgba(11, 20, 21, 0.14);
  --dark-line: rgba(255, 255, 255, 0.14);
  --acid: #d7ff64;
  --acid-soft: #edffaf;
  --orange: #ff6b3d;
  --cyan: #77e8df;
  --white: #fbfcf7;
  --danger: #d94a3a;
  --radius: 22px;
  --display: "Arial Narrow", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --sans: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

::selection {
  color: var(--ink);
  background: var(--acid);
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 300;
  padding: 11px 16px;
  color: var(--ink);
  background: var(--acid);
  border-radius: 8px;
}

.skip-link:focus {
  top: 16px;
}

.site-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 4vw;
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 20, 21, 0.9);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font: 800 12px/1 var(--display);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
}

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

.brand-mark::before {
  width: 12px;
  height: 2px;
}

.brand-mark::after {
  width: 2px;
  height: 12px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.64);
  font-size: 11px;
  letter-spacing: 0.07em;
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--acid);
}

.hero {
  position: relative;
  min-height: 760px;
  display: flex;
  align-items: center;
  overflow: hidden;
  color: var(--white);
  background:
    radial-gradient(circle at 78% 42%, rgba(119, 232, 223, 0.14), transparent 28%),
    radial-gradient(circle at 8% 92%, rgba(215, 255, 100, 0.09), transparent 31%),
    linear-gradient(125deg, #091112 0%, #111d20 68%, #17292c 100%);
}

.hero::before {
  position: absolute;
  inset: 0;
  opacity: 0.11;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to right, transparent, #000 25%, #000 82%, transparent);
  content: "";
}

.hero::after {
  position: absolute;
  right: -30px;
  bottom: -78px;
  color: rgba(255, 255, 255, 0.035);
  font: 900 clamp(160px, 24vw, 340px)/0.8 var(--display);
  letter-spacing: -0.09em;
  content: "STPA";
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1420px, 92vw);
  margin: 110px auto 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(440px, 0.78fr);
  gap: clamp(36px, 5vw, 84px);
  align-items: center;
}

.eyebrow,
.section-kicker {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--acid);
  font: 800 10px/1.2 var(--display);
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 28px;
}

.eyebrow::before,
.section-kicker::before {
  width: 28px;
  height: 2px;
  background: currentColor;
  content: "";
}

h1 {
  margin: 0;
  font: 900 clamp(48px, 5.5vw, 86px)/0.98 var(--display);
  letter-spacing: -0.062em;
}

h1 span {
  display: block;
  color: var(--acid);
}

.hero-copy {
  max-width: 660px;
  margin: 28px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: clamp(14px, 1.15vw, 17px);
  line-height: 1.85;
}

.hero-copy strong {
  color: var(--white);
  font-weight: 600;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 30px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 13px;
  color: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-size: 9px;
  letter-spacing: 0.08em;
}

.hero-visual {
  position: relative;
  min-height: 510px;
  display: grid;
  place-items: center;
}

.scope-orbit {
  position: absolute;
  width: min(38vw, 520px);
  aspect-ratio: 1;
  border: 1px solid rgba(119, 232, 223, 0.14);
  border-radius: 50%;
  box-shadow:
    0 0 0 55px rgba(119, 232, 223, 0.025),
    0 0 0 112px rgba(119, 232, 223, 0.012);
}

.scope-card {
  position: relative;
  width: min(410px, 100%);
  padding: 28px;
  border: 1px solid rgba(215, 255, 100, 0.34);
  border-radius: 20px;
  background: rgba(8, 16, 17, 0.78);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(16px);
}

.scope-card small {
  display: block;
  margin-bottom: 13px;
  color: rgba(255, 255, 255, 0.42);
  font: 800 9px/1 var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.scope-card h2 {
  margin: 0;
  font: 800 27px/1.22 var(--display);
  letter-spacing: -0.03em;
}

.scope-card p {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.54);
  font-size: 12px;
  line-height: 1.72;
}

.scope-chain {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
}

.scope-node {
  min-height: 68px;
  display: grid;
  align-content: center;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.scope-node strong {
  font-size: 11px;
}

.scope-node span {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 8px;
}

.scope-node.fault {
  border-color: rgba(255, 107, 61, 0.5);
}

.scope-arrow {
  color: var(--acid);
  font-size: 19px;
}

.hero-index {
  position: absolute;
  z-index: 2;
  right: 4vw;
  bottom: 22px;
  color: rgba(255, 255, 255, 0.3);
  font: 800 8px/1 var(--display);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section {
  padding: clamp(78px, 9vw, 132px) 4vw;
}

.section.dark {
  color: var(--white);
  background: var(--ink-2);
}

.section.acid {
  background: var(--acid);
}

.wrap {
  width: min(1380px, 100%);
  margin: 0 auto;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.42fr);
  gap: 34px;
  align-items: end;
  margin-bottom: 48px;
}

.section-kicker {
  margin-bottom: 18px;
  color: var(--orange);
}

.dark .section-kicker {
  color: var(--acid);
}

.section-head h2 {
  max-width: 940px;
  margin: 0;
  font: 800 clamp(34px, 5vw, 70px)/1.06 var(--display);
  letter-spacing: -0.045em;
}

.section-head h2 span {
  display: block;
  color: var(--muted);
}

.dark .section-head h2 span {
  color: rgba(255, 255, 255, 0.3);
}

.section-lead {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.dark .section-lead {
  color: rgba(255, 255, 255, 0.52);
}

.scope-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.scope-cell {
  min-height: 218px;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
}

.scope-cell.featured {
  grid-column: span 2;
  color: var(--white);
  border-color: transparent;
  background: var(--ink);
}

.scope-cell small {
  display: block;
  margin-bottom: 48px;
  color: var(--orange);
  font: 800 9px/1 var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.scope-cell.featured small {
  color: var(--acid);
}

.scope-cell strong {
  display: block;
  font: 800 clamp(20px, 2.2vw, 30px)/1.25 var(--display);
  letter-spacing: -0.025em;
}

.scope-cell p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.scope-cell.featured p {
  color: rgba(255, 255, 255, 0.55);
}

.boundary-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.boundary-box {
  padding: 24px 26px;
  border-radius: 16px;
}

.boundary-box.in {
  color: var(--white);
  background: #263a3a;
}

.boundary-box.out {
  border: 1px dashed rgba(11, 20, 21, 0.28);
  background: rgba(255, 255, 255, 0.36);
}

.boundary-box strong {
  display: block;
  margin-bottom: 8px;
  font: 800 12px/1.2 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.boundary-box p {
  margin: 0;
  font-size: 11px;
  line-height: 1.72;
  opacity: 0.67;
}

.diagram-panel {
  padding: 17px;
  border: 1px solid var(--dark-line);
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.035);
}

.diagram-frame {
  overflow: hidden;
  border-radius: 18px;
  background: #f9faf5;
}

.diagram-frame svg {
  display: block;
  width: 100%;
  height: auto;
}

.diagram-note {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 9px 2px;
  color: rgba(255, 255, 255, 0.43);
  font-size: 9px;
  line-height: 1.5;
}

.diagram-note strong {
  color: var(--acid);
}

.context-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.context-card {
  padding: 22px;
  border: 1px solid var(--dark-line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.035);
}

.context-card small {
  color: var(--acid);
  font: 800 8px/1 var(--display);
  letter-spacing: 0.14em;
}

.context-card strong {
  display: block;
  margin-top: 12px;
  font-size: 14px;
}

.context-card p {
  margin: 8px 0 0;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  line-height: 1.65;
}

.doc-shell {
  display: grid;
  grid-template-columns: 265px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.doc-index {
  position: sticky;
  top: 94px;
  padding: 24px;
  color: var(--white);
  border-radius: 19px;
  background: var(--ink);
}

.doc-index small {
  display: block;
  margin-bottom: 22px;
  color: var(--acid);
  font: 800 9px/1 var(--display);
  letter-spacing: 0.16em;
}

.doc-index strong {
  display: block;
  font: 800 22px/1.2 var(--display);
}

.doc-index p {
  margin: 10px 0 22px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 10px;
  line-height: 1.65;
}

.doc-index nav {
  display: grid;
  gap: 5px;
}

.doc-index nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  color: rgba(255, 255, 255, 0.58);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
}

.doc-index nav a span {
  color: var(--orange);
  font-family: var(--mono);
}

.doc-main {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--white);
}

.doc-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: end;
  padding: 34px;
  color: var(--white);
  background:
    radial-gradient(circle at 100% 0%, rgba(215, 255, 100, 0.16), transparent 38%),
    var(--ink);
}

.doc-header small {
  display: block;
  margin-bottom: 15px;
  color: var(--acid);
  font: 800 9px/1 var(--display);
  letter-spacing: 0.15em;
}

.doc-header h3 {
  margin: 0;
  font: 800 clamp(26px, 3vw, 42px)/1.14 var(--display);
  letter-spacing: -0.035em;
}

.doc-code {
  color: rgba(255, 255, 255, 0.44);
  font: 700 9px/1.7 var(--mono);
  text-align: right;
}

.doc-body {
  padding: clamp(24px, 4vw, 42px);
}

.doc-section + .doc-section {
  margin-top: 44px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.doc-section h4 {
  margin: 0 0 15px;
  font: 800 23px/1.25 var(--display);
  letter-spacing: -0.02em;
}

.doc-section h4 span {
  margin-right: 10px;
  color: var(--orange);
  font-family: var(--mono);
  font-size: 12px;
}

.doc-section p,
.doc-section li {
  color: #53605d;
  font-size: 11px;
  line-height: 1.78;
}

.doc-section ul {
  margin: 12px 0 0;
  padding-left: 18px;
}

.interface-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-top: 20px;
}

.interface-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f4f5ef;
}

.interface-card small {
  color: var(--orange);
  font: 800 8px/1 var(--mono);
}

.interface-card strong {
  display: block;
  margin-top: 8px;
  font-size: 12px;
}

.interface-card span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.55;
}

.req-table-wrap {
  margin-top: 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.req-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  text-align: left;
}

.req-table th {
  padding: 11px 12px;
  color: var(--white);
  background: var(--ink);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.req-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 9px;
  line-height: 1.58;
}

.req-table tr:last-child td {
  border-bottom: 0;
}

.req-id {
  color: var(--orange);
  font-family: var(--mono);
  font-weight: 700;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--acid);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.note {
  margin-top: 14px;
  padding: 14px 16px;
  color: #59635f;
  border-left: 3px solid var(--orange);
  background: #f0f1eb;
  font-size: 9px;
  line-height: 1.65;
}

.arch-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 15px;
  align-items: stretch;
}

.arch-board {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.56);
}

.arch-board svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  background: #f9faf5;
}

.arch-list {
  display: grid;
  gap: 9px;
}

.arch-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 13px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.48);
}

.arch-item small {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: var(--orange);
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 800 9px/1 var(--mono);
}

.arch-item strong {
  display: block;
  font-size: 12px;
}

.arch-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.58;
}

.state-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
  margin-top: 15px;
}

.state-cell {
  position: relative;
  min-height: 108px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.48);
}

.state-cell::after {
  position: absolute;
  top: 25px;
  right: -10px;
  z-index: 2;
  color: var(--orange);
  content: "→";
}

.state-cell:last-child::after {
  display: none;
}

.state-cell small {
  color: var(--muted);
  font: 800 8px/1 var(--mono);
}

.state-cell strong {
  display: block;
  margin-top: 14px;
  font: 800 15px/1.2 var(--display);
}

.state-cell span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.5;
}

.stpa-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stpa-column {
  padding: 24px;
  border: 1px solid var(--dark-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.stpa-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
}

.stpa-column h3 {
  margin: 0;
  font: 800 21px/1.2 var(--display);
}

.stpa-column header span {
  color: var(--acid);
  font: 800 8px/1 var(--mono);
}

.stpa-item + .stpa-item {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stpa-item small {
  color: var(--orange);
  font: 800 8px/1 var(--mono);
}

.stpa-item strong {
  display: block;
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 11px;
  line-height: 1.58;
}

.stpa-item p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 9px;
  line-height: 1.62;
}

.safety-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
  gap: 15px;
  align-items: start;
}

.safety-requirements {
  display: grid;
  gap: 8px;
}

.safety-req {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.55);
}

.safety-req small {
  color: var(--orange);
  font: 800 8px/1 var(--mono);
}

.safety-req strong {
  display: block;
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.6;
}

.safety-req span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.55;
}

.safety-arch {
  position: sticky;
  top: 92px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
}

.safety-arch svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  background: #f9faf5;
}

.trace-table {
  width: 100%;
  margin-top: 28px;
  border-collapse: collapse;
  font-size: 9px;
}

.subhead {
  margin: 36px 0 12px;
  font: 800 22px/1.25 var(--display);
  letter-spacing: -0.02em;
}

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

.trace-table th {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.trace-table td:first-child,
.trace-table td:nth-child(2),
.trace-table td:nth-child(3) {
  color: var(--orange);
  font-family: var(--mono);
  white-space: nowrap;
}

.validation-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.section.acid .req-table-wrap {
  margin-bottom: 28px;
}

.test-card {
  min-height: 225px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid rgba(11, 20, 21, 0.18);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.26);
}

.test-card small {
  color: rgba(11, 20, 21, 0.53);
  font: 800 8px/1 var(--mono);
}

.test-card h3 {
  margin: 29px 0 9px;
  font: 800 19px/1.2 var(--display);
}

.test-card p {
  margin: 0;
  color: rgba(11, 20, 21, 0.64);
  font-size: 9px;
  line-height: 1.62;
}

.test-card strong {
  display: block;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid rgba(11, 20, 21, 0.16);
  font-size: 9px;
  line-height: 1.55;
}

.qa-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.qa-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.5);
}

.qa-card small {
  color: var(--orange);
  font: 800 8px/1 var(--mono);
}

.qa-card h3 {
  margin: 18px 0 10px;
  font: 800 17px/1.35 var(--display);
}

.qa-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.handoff {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 12px;
  margin-top: 44px;
}

.handoff > div {
  padding: 28px;
  border-radius: 18px;
}

.handoff .deliverables {
  color: var(--white);
  background: var(--ink);
}

.handoff .limits {
  border: 1px dashed rgba(11, 20, 21, 0.28);
  background: rgba(255, 255, 255, 0.45);
}

.handoff h3 {
  margin: 0 0 13px;
  font: 800 21px/1.25 var(--display);
}

.handoff ul {
  margin: 0;
  padding-left: 18px;
}

.handoff li {
  margin: 7px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
}

.handoff .deliverables li {
  color: rgba(255, 255, 255, 0.58);
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 4vw;
  color: rgba(255, 255, 255, 0.4);
  background: var(--ink);
  font-size: 9px;
  line-height: 1.6;
}

.footer strong {
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.08em;
}

.footer a {
  color: var(--acid);
}

.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--ink);
  border: 0;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 10px 30px rgba(11, 20, 21, 0.18);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.back-top.show {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

@media (max-width: 1080px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 420px;
  }

  .scope-grid,
  .validation-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stpa-board,
  .qa-grid {
    grid-template-columns: 1fr;
  }

  .arch-layout,
  .safety-grid,
  .doc-shell {
    grid-template-columns: 1fr;
  }

  .doc-index,
  .safety-arch {
    position: static;
  }

  .doc-index nav {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 760px) {
  .site-nav {
    min-height: 64px;
  }

  .nav-links li:not(:nth-child(4)) {
    display: none;
  }

  .hero {
    min-height: 720px;
  }

  .hero-inner {
    margin-top: 94px;
  }

  h1 {
    font-size: clamp(49px, 15vw, 76px);
  }

  .hero-visual {
    min-height: 350px;
  }

  .scope-card {
    padding: 22px;
  }

  .section-head,
  .context-grid,
  .scope-grid,
  .boundary-strip,
  .interface-grid,
  .state-rail,
  .qa-grid,
  .validation-grid,
  .handoff {
    grid-template-columns: 1fr;
  }

  .scope-cell.featured {
    grid-column: auto;
  }

  .scope-cell small {
    margin-bottom: 28px;
  }

  .doc-index nav {
    grid-template-columns: 1fr;
  }

  .doc-header {
    grid-template-columns: 1fr;
  }

  .doc-code {
    text-align: left;
  }

  .state-cell::after {
    top: auto;
    right: 22px;
    bottom: -15px;
    transform: rotate(90deg);
  }

  .trace-table {
    min-width: 760px;
  }

  .safety-grid > div:last-child {
    overflow-x: auto;
  }

  .diagram-note,
  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

@media print {
  @page {
    size: A4;
    margin: 14mm;
  }

  body {
    color: #111;
    background: #fff;
    font-size: 10pt;
  }

  .site-nav,
  .back-top,
  .hero-index,
  .hero-visual,
  .scope-orbit {
    display: none !important;
  }

  .hero,
  .section.dark,
  .doc-header,
  .doc-index,
  .scope-cell.featured,
  .boundary-box.in,
  .footer {
    color: #111 !important;
    background: #fff !important;
    border-color: #bbb !important;
  }

  .hero {
    min-height: auto;
  }

  .hero-inner {
    display: block;
    margin: 0;
    width: 100%;
  }

  .hero-copy,
  .dark .section-lead,
  .scope-cell.featured p,
  .context-card p,
  .diagram-note,
  .stpa-item p,
  .stpa-item strong,
  .handoff .deliverables li,
  .footer strong {
    color: #333 !important;
  }

  .section {
    padding: 12mm 0;
  }

  .scope-cell,
  .context-card,
  .stpa-column,
  .doc-main,
  .arch-board,
  .arch-item,
  .state-cell,
  .safety-req,
  .safety-arch,
  .test-card,
  .qa-card {
    break-inside: avoid;
    box-shadow: none !important;
  }

  .diagram-frame,
  .arch-board svg,
  .safety-arch svg {
    background: #fff !important;
  }

  a {
    color: #111 !important;
  }
}
