/* deepmind portal v3 — T0 precision engineering layer */

body {
  background-color: var(--bg);
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero h1,
.page-hero h1 {
  letter-spacing: -0.035em;
}

.hero p,
.page-hero .lede {
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.card,
.eco-panel,
.code-card,
.apply-dialog,
.v3-card,
.term-pane,
.pipe-panel,
.persona-panel,
.calc,
.cfg-panel,
.docs-toc,
.posture-col,
.strip-box,
.keyrow,
.boundary-col,
.matrix-wrap {
  box-shadow: var(--rim-light);
}

/* dotted architectural grid on hero + architecture zone */

.hero,
#capabilities {
  position: relative;
  background-image:
    radial-gradient(ellipse 62% 78% at 50% 0%, transparent 30%, var(--bg) 82%),
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px;
  background-position: center top, 0 0;
}

/* 12-col asymmetric bento */

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.bento-cell {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 42%), var(--panel);
  box-shadow: var(--rim-light);
}

.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }

.v3-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

.v3-head {
  padding: 22px 22px 0;
}

.v3-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.v3-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.75;
}

.v3-head h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 600;
}

.v3-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.v3-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 16px 22px 22px;
}

.v3-note {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  opacity: 0.8;
}

/* buttons / tabs */

.v3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-elevated);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.v3-btn:hover { background: #202024; border-color: rgba(255, 255, 255, 0.26); }
.v3-btn:active { transform: translateY(1px); }

.v3-btn.is-primary {
  border-color: rgba(56, 208, 255, 0.42);
  background: rgba(56, 208, 255, 0.12);
  color: #cdf3ff;
}

.v3-btn.is-primary:hover { background: rgba(56, 208, 255, 0.2); }

.v3-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
}

.v3-tab {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.v3-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }

.v3-tab.is-active {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  box-shadow: var(--rim-light);
}

/* animated beam topology */

.hero-visual {
  position: relative;
  min-width: 0;
}

.beam {
  position: relative;
  width: 100%;
  aspect-ratio: 760 / 400;
  min-height: 350px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 50%, rgba(56, 208, 255, 0.05), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 55%),
    var(--panel);
  box-shadow: var(--rim-light), 0 30px 80px -50px rgba(0, 0, 0, 0.9);
  overflow: hidden;
}

.beam::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 38px 38px;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000, transparent 80%);
  pointer-events: none;
}

.beam-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.beam-wire {
  fill: none;
  stroke: rgba(255, 255, 255, 0.13);
  stroke-width: 1;
}

.beam-pulse {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 7 93;
  opacity: 0.9;
  animation: beamFlow 3.4s linear infinite;
}

.beam-pulse.is-out {
  stroke: rgba(52, 211, 153, 0.9);
  animation-duration: 3.8s;
}

@keyframes beamFlow {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}

.beam-node {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent), #141417;
  box-shadow: var(--rim-light);
}

.beam-node strong {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.beam-node span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.3;
  letter-spacing: 0.04em;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}

.beam-in { left: 2.1%; top: 25%; width: 23.5%; transform: translateY(-50%); }
.beam-in.is-2 { top: 50%; }
.beam-in.is-3 { top: 75%; }
.beam-out { right: 2.1%; top: 25%; width: 23.5%; transform: translateY(-50%); }
.beam-out.is-2 { top: 50%; }
.beam-out.is-3 { top: 75%; }

.beam-core {
  left: 36.8%;
  top: 50%;
  width: 26.4%;
  transform: translateY(-50%);
  padding: 14px 14px 13px;
  border-color: var(--line-strong);
  background:
    linear-gradient(180deg, rgba(56, 208, 255, 0.07), transparent 60%),
    var(--panel-elevated);
  text-align: center;
}

.beam-core strong { font-size: 12.5px; }

.beam-core .beam-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.beam-status .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.35);
}

.beam-status.is-live .dot {
  background: var(--green);
  animation: statusPulse 2.4s ease-out infinite;
}

.beam-status.is-degraded .dot { background: var(--amber); }
.beam-status.is-unknown .dot { background: var(--muted); }

@keyframes statusPulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.4); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.beam-mobile { display: none; }

/* terminal simulator */

.term {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 10px;
  flex: 1;
  min-height: 268px;
}

.term-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0c0c0e;
  overflow: hidden;
}

.term-pane-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.term-dots { display: inline-flex; gap: 4px; }
.term-dots i { width: 6px; height: 6px; border-radius: 50%; background: #3f3f46; }

.term-file {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.term-pane-head .v3-btn { height: 22px; margin-left: auto; padding: 0 8px; font-size: 10.5px; }

.term-code {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.term-code pre {
  margin: 0;
  padding: 12px 12px 16px;
  color: #d7dbe2;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.62;
  white-space: pre;
}

.term-code .c-key { color: #7bddff; }
.term-code .c-str { color: #a7e2a0; }
.term-code .c-com { color: #6b7280; }

.term-out-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.term-state {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.term-state.is-live { color: var(--green); }

.term-console {
  flex: 1;
  min-height: 150px;
  margin: 0;
  padding: 11px 12px 14px;
  overflow: auto;
  color: #cbd5e1;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.term-console .ln-ok { color: var(--green); }
.term-console .ln-hdr { color: #7bddff; }
.term-console .ln-dim { color: #71717a; }

.term-console .skeleton {
  display: block;
  height: 9px;
  margin: 7px 0;
  border-radius: 3px;
  background: linear-gradient(90deg, #1c1c20, #2a2a30, #1c1c20);
  background-size: 200% 100%;
  animation: shimmer 1s linear infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* payload stripper */

.strip-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.strip-box {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0c0c0e;
}

.strip-box-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.strip-box-head .tag {
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: 0.06em;
}

.tag-green { border-color: rgba(52, 211, 153, 0.35) !important; color: var(--green) !important; }
.tag-red { border-color: rgba(248, 113, 113, 0.35) !important; color: var(--red) !important; }

.strip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  font-family: var(--mono);
  font-size: 10.5px;
}

.strip-row:first-of-type { border-top: 0; }

.strip-field { color: #8b93a1; }
.strip-field b { color: #d7dbe2; font-weight: 500; }

.redact-chip {
  margin-left: auto;
  padding: 2px 7px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 4px;
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
  font-size: 9px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.meta-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 10.5px;
}

.meta-table td {
  padding: 4px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}

.meta-table tr:first-child td { border-top: 0; }
.meta-table td:first-child { color: #8b93a1; width: 46%; }
.meta-table td:last-child { text-align: right; }
.meta-table .ok { color: var(--green); }

/* key matrix */

.keymatrix { display: flex; flex-direction: column; gap: 8px; }

.keyrow {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.keyrow-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.keyid {
  font-family: var(--mono);
  font-size: 11.5px;
  color: #dbeafe;
}

.keyrole {
  margin-left: auto;
  color: var(--muted);
  font-size: 10.5px;
}

.keymeta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.02em;
}

.meter {
  height: 3px;
  margin-top: 6px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(56, 208, 255, 0.5), var(--accent));
}

.meter.is-warn i { background: linear-gradient(90deg, rgba(251, 191, 36, 0.5), var(--amber)); }

/* IDE config generator */

.cfg {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.cfg-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0c0c0e;
  overflow: hidden;
}

.cfg-ide-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.cfg-ide-head .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }

.cfg-ide-head .v3-btn { height: 22px; margin-left: auto; padding: 0 8px; font-size: 10.5px; }

.cfg-fields { margin: 0; padding: 10px 11px 12px; }

.cfg-fields > div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
  padding: 5px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

.cfg-fields > div:first-child { border-top: 0; }

.cfg-fields dt {
  color: #8b93a1;
  font-family: var(--mono);
  font-size: 10.5px;
}

.cfg-fields dd {
  margin: 0;
  min-width: 0;
  color: #d7dbe2;
  font-family: var(--mono);
  font-size: 10.5px;
  overflow-wrap: anywhere;
}

.cfg-steps {
  margin: 0;
  padding: 0 0 0 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.cfg-steps li { margin: 3px 0; }

/* pipeline inspector */

.pipe {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-top: 22px;
}

.pipe-rail { display: flex; flex-direction: column; gap: 8px; }

.pipe-step {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pipe-step:hover { border-color: var(--line-strong); }

.pipe-step.is-active {
  border-color: rgba(56, 208, 255, 0.34);
  background: linear-gradient(180deg, rgba(56, 208, 255, 0.06), transparent 70%), var(--panel-elevated);
  box-shadow: var(--rim-light);
}

.pipe-no {
  padding-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.pipe-step.is-active .pipe-no { color: var(--accent); }

.pipe-step strong { display: block; font-size: 13.5px; font-weight: 600; }

.pipe-step em {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  font-style: normal;
  line-height: 1.5;
}

.pipe-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c0c0e;
}

.pipe-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.pipe-panel-head .tag { margin-left: auto; }

.contract {
  display: grid;
  gap: 8px;
  margin: 0;
}

.contract-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
}

.contract-row:first-child { border-top: 0; }

.contract-row dt {
  color: #8b93a1;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contract-row dd {
  margin: 0;
  color: #d7dbe2;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
}

/* compatibility matrix */

.matrix-wrap {
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow-x: auto;
  max-width: 100%;
  min-width: 0;
}

.matrix {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 13px;
}

.matrix th,
.matrix td {
  padding: 11px 14px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.matrix thead th {
  border-top: 0;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.matrix td:first-child { color: var(--text); font-weight: 500; }
.matrix td code {
  color: #a9b3c1;
  font-family: var(--mono);
  font-size: 11px;
}

.matrix tr:hover td { background: rgba(255, 255, 255, 0.015); }

.state-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 4px;
  color: #6ee7b7;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.state-chip.is-cond {
  border-color: rgba(251, 191, 36, 0.3);
  color: #fcd34d;
}

/* persona switcher */

.persona {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
  margin-top: 22px;
}

.persona-tabs { display: flex; flex-direction: column; gap: 8px; }

.persona-tab {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.persona-tab:hover { color: var(--text); border-color: var(--line-strong); }

.persona-tab.is-active {
  border-color: var(--line-strong);
  background: var(--panel-elevated);
  color: var(--text);
  box-shadow: var(--rim-light);
}

.persona-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0c0c0e;
}

.persona-panel h3 { margin: 0 0 10px; font-size: 15px; }

.persona-list { margin: 0; padding: 0; list-style: none; }

.persona-list li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
  color: #cbd5e1;
  font-size: 12.5px;
  line-height: 1.6;
}

.persona-list li:first-child { border-top: 0; }

.persona-list b {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
}

/* posture matrix */

.posture {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.posture-col {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.posture-col h3 {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.posture-list { margin: 0; padding: 0; list-style: none; }

.posture-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.55;
}

.posture-list li:first-child { border-top: 0; }

.mini-state {
  align-self: start;
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.05em;
  text-align: center;
}

.mini-state.on { border-color: rgba(52, 211, 153, 0.32); color: #6ee7b7; }
.mini-state.todo { border-color: rgba(251, 191, 36, 0.32); color: #fcd34d; }

/* docs layout */

.page-body.is-docs {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.page-body.is-docs > * { grid-column: 2; }

.page-body.is-docs > .docs-toc {
  position: sticky;
  top: 96px;
  grid-column: 1;
  grid-row: 1 / span 60;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.docs-toc h2 {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.docs-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }

.docs-toc a {
  position: relative;
  display: block;
  padding: 5px 0 5px 20px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  counter-increment: toc;
}

.docs-toc a::before {
  content: counter(toc, decimal-leading-zero);
  position: absolute;
  left: 0;
  color: rgba(255, 255, 255, 0.24);
  font-family: var(--mono);
  font-size: 9.5px;
}

.docs-toc a:hover { color: var(--text); }

/* token calculator */

.calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: 18px;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 50%), var(--panel);
}

.calc-fields { display: grid; gap: 14px; }

.calc-field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
}

.calc-field output {
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
}

.calc-field input[type="range"] {
  width: 100%;
  height: 3px;
  margin: 0;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  accent-color: var(--accent);
  cursor: pointer;
}

.calc-results {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
  overflow: hidden;
}

.calc-result {
  padding: 11px 13px;
  background: #0c0c0e;
}

.calc-result dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calc-result dd {
  margin: 3px 0 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 19px;
  letter-spacing: -0.02em;
}

.calc-note {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

/* boundary table */

.boundary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.boundary-col {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.boundary-col h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.boundary-col.is-do h3 { color: #6ee7b7; }
.boundary-col.is-dont h3 { color: #fca5a5; }

.boundary-col ul { margin: 0; padding: 0; list-style: none; }

.boundary-col li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.07);
  color: #cbd5e1;
  font-size: 12.5px;
  line-height: 1.55;
}

.boundary-col li:first-child { border-top: 0; }
.boundary-col.is-do li::before { content: "+"; color: var(--green); font-family: var(--mono); }
.boundary-col.is-dont li::before { content: "−"; color: var(--red); font-family: var(--mono); }

/* shared heads */

.section-head p.section-sub {
  max-width: 640px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.page-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 4px;
}

.page-section-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.page-section-head span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* 404 refit */

.not-found-mark {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 50%, rgba(56, 208, 255, 0.08), transparent 70%),
    var(--panel);
  box-shadow: var(--rim-light);
}

.not-found-mark svg { width: 56px; height: 56px; color: rgba(255, 255, 255, 0.55); }

/* mobile beam list */

.beam-mobile {
  flex-direction: column;
  gap: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: var(--rim-light);
}

.bm-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0 9px 18px;
  color: var(--text);
  font-size: 12.5px;
}

.bm-row::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-strong);
  transform: translateY(-50%);
}

.bm-row:first-child::before { background: var(--accent); }
.bm-row.is-core::before { background: var(--accent); }

.bm-row + .bm-row { border-top: 1px dashed rgba(255, 255, 255, 0.06); }

.bm-row span {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9.5px;
}

/* responsive */

@media (max-width: 1080px) {
  .beam-node span { font-size: 9px; }
  .beam-core strong { font-size: 11.5px; }
}

@media (min-width: 961px) and (max-width: 1080px) {
  .beam { display: none; }
  .beam-mobile { display: flex; }
}

@media (max-width: 960px) {
  .bento-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .span-7, .span-5 { grid-column: auto; }
  .pipe { grid-template-columns: minmax(0, 1fr); }
  .persona { grid-template-columns: minmax(0, 1fr); }
  .posture { grid-template-columns: minmax(0, 1fr); }
  .calc { grid-template-columns: minmax(0, 1fr); }
  .boundary { grid-template-columns: minmax(0, 1fr); }
  .page-body.is-docs { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .page-body.is-docs > * { grid-column: auto; }
  .docs-toc { position: static; grid-column: auto; grid-row: auto; }
}

@media (max-width: 768px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .beam { display: none; }
  .beam-mobile { display: flex; }
  .term { grid-template-columns: minmax(0, 1fr); }
  .term-pane { min-height: 200px; }
}

@media (max-width: 560px) {
  .v3-head { padding: 18px 16px 0; }
  .v3-body { padding: 14px 16px 18px; }
  .term-console { font-size: 10px; }
  .calc-result dd { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  .beam-pulse,
  .beam-status.is-live .dot,
  .term-console .skeleton {
    animation: none !important;
  }
  .beam-pulse { opacity: 0.55; }
}

/* CSP-safe stack layer offsets (replaces inline --i) */
.stack-layer[data-layer="0"] { --i: 0; }
.stack-layer[data-layer="1"] { --i: 1; }
.stack-layer[data-layer="2"] { --i: 2; }
.stack-layer[data-layer="3"] { --i: 3; }

.legal-mail { margin-top: 10px; }
.legal-mail a { color: var(--text); }
