*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --wrap: 74rem;
  --gutter: clamp(1.1rem, 3.2vw, 2.25rem);
  --header-h: 4rem;
  --wash-steel: rgba(31, 84, 122, 0.30);
  --wash-beacon: rgba(240, 110, 43, 0.22);
}
:root:where(:has(> head > meta[name="color-scheme"][content="light"]), [data-theme="light"]) {
  --wash-steel: rgba(31, 84, 122, 0.14);
  --wash-beacon: rgba(240, 110, 43, 0.12);
}

html {
  height: 100%;
  overflow: hidden;
  overflow: clip;
  background: var(--rfs-bg);
  color: var(--rfs-text);
  font-family: var(--rfs-font-sans);
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--rfs-bg);
  color: var(--rfs-text);
}

.rfs-scroll-region { scroll-padding-top: 1.5rem; }
@media (prefers-reduced-motion: no-preference) {
  .rfs-scroll-region { scroll-behavior: smooth; }
}

::selection {
  background: color-mix(in oklab, var(--rfs-beacon) 32%, transparent);
  color: var(--rfs-text);
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}
.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 90;
  padding: 0.65rem 1rem;
  border-radius: var(--rfs-radius-sm);
  background: var(--rfs-surface);
  border: 2px solid var(--rfs-focus);
  color: var(--rfs-text);
  font-weight: 600;
  text-decoration: none;
}

:where(a, button, input, select, textarea, [tabindex="0"]):focus-visible {
  outline: 2px solid var(--rfs-focus);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

code, pre, kbd, samp { font-family: var(--rfs-font-mono); }
p code, li code, td code, dd code {
  font-size: 0.84em;
  padding: 0.08em 0.36em;
  border-radius: 4px;
  background: var(--rfs-code-bg);
  border: 1px solid var(--rfs-line);
  color: var(--rfs-text);
  overflow-wrap: anywhere;
}

.hdr {
  flex: none;
  position: relative;
  z-index: var(--rfs-z-nav);
  background: var(--rfs-rail);
  border-bottom: 1px solid var(--rfs-line);
}
.hdr-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.85rem;
  min-block-size: var(--header-h);
  padding-block: 0.45rem;
}
.brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--rfs-text);
  text-decoration: none;
  font: 800 1.48rem/1 var(--rfs-font-display);
  letter-spacing: 0.055em;
  text-transform: uppercase;
}
.brand img { display: block; border-radius: 7px; }

.nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: safe center;
  gap: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-block-size: 2.35rem;
  padding: 0.3rem 0.62rem;
  border-radius: var(--rfs-radius-sm);
  color: var(--rfs-mute);
  text-decoration: none;
  font: 500 0.84rem/1 var(--rfs-font-sans);
  transition: color var(--rfs-dur-fast) var(--rfs-ease), background-color var(--rfs-dur-fast) var(--rfs-ease);
}
.nav-link:hover { color: var(--rfs-text); background: var(--rfs-surface); }

.theme-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-block-size: 2.35rem;
  padding: 0.35rem 0.78rem 0.35rem 0.55rem;
  border-radius: var(--rfs-radius-sm);
  border: 1px solid var(--rfs-line-strong);
  background: var(--rfs-surface);
  color: var(--rfs-text);
  font: 600 0.72rem/1 var(--rfs-font-sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--rfs-dur-fast) var(--rfs-ease);
}
.theme-toggle:hover { border-color: var(--rfs-beacon); }
.theme-toggle .sw {
  position: relative;
  width: 24px;
  height: 14px;
  border-radius: 99px;
  background: var(--rfs-raised);
  border: 1px solid var(--rfs-line-strong);
}
.theme-toggle .sw::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rfs-beacon);
  transition: transform var(--rfs-dur-fast) var(--rfs-ease);
}
.theme-toggle .t-light { display: none; }
:root:where(:has(> head > meta[name="color-scheme"][content="light"]), [data-theme="light"]) .theme-toggle .sw::after {
  transform: translateX(10px);
  background: var(--rfs-steel-ink);
}
:root:where(:has(> head > meta[name="color-scheme"][content="light"]), [data-theme="light"]) .theme-toggle .t-dark { display: none; }
:root:where(:has(> head > meta[name="color-scheme"][content="light"]), [data-theme="light"]) .theme-toggle .t-light { display: inline; }

::view-transition-group(root) { animation: none; }
::view-transition-old(root) { animation: none; mix-blend-mode: normal; z-index: 1; }
::view-transition-new(root) {
  animation: rfs-vt-circle 480ms var(--rfs-ease-in-out) both;
  mix-blend-mode: normal;
  z-index: 2;
}
@keyframes rfs-vt-circle {
  from { clip-path: circle(0px at var(--vt-x, 50%) var(--vt-y, 50%)); }
  to { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 50%) var(--vt-y, 50%)); }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-new(root) { animation: none; }
}

.hero-band {
  position: relative;
  border-bottom: 1px solid var(--rfs-line);
  background:
    radial-gradient(58% 68% at 10% 100%, var(--wash-steel) 0%, transparent 72%),
    radial-gradient(54% 66% at 92% 100%, var(--wash-beacon) 0%, transparent 72%),
    var(--rfs-bg);
  padding-block: clamp(2.4rem, 5vw, 4rem) clamp(2.4rem, 5vw, 3.75rem);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1.75rem, 3.5vw, 3rem);
  align-items: center;
}
.hero-copy {
  display: grid;
  gap: 1.05rem;
  align-content: start;
  min-width: 0;
}

.specimen {
  border-radius: var(--rfs-radius-md);
  border: 1px solid var(--rfs-line);
  background: var(--rfs-surface);
  overflow: hidden;
  min-width: 0;
}
.top-beam {
  block-size: 3px;
  background: var(--rfs-horizon-rule);
}
.spec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--rfs-rail);
  border-bottom: 1px solid var(--rfs-line);
}
.spec-meta {
  font: 500 0.72rem/1 var(--rfs-font-mono);
  color: var(--rfs-mute);
  font-variant-numeric: tabular-nums;
}
.spec-body {
  padding: 1rem;
  display: grid;
  gap: 0.9rem;
}
.treemap-demo {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 0.45rem;
  min-block-size: 11.25rem;
}
.tm-right {
  display: grid;
  grid-template-rows: 1.15fr 1fr;
  gap: 0.45rem;
}
.tm-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.tm-tile {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 0.2rem;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border-radius: var(--rfs-radius-sm);
  border: 1px solid var(--rfs-line);
  background: var(--rfs-raised);
  color: var(--rfs-text);
  cursor: pointer;
  font-family: var(--rfs-font-sans);
  transition: border-color var(--rfs-dur-fast) var(--rfs-ease), background-color var(--rfs-dur-fast) var(--rfs-ease);
}
.tm-tile:hover { border-color: var(--rfs-steel-ink); }
.tm-tile.is-steel {
  background: color-mix(in oklab, var(--rfs-steel) 26%, var(--rfs-raised));
  border-color: color-mix(in oklab, var(--rfs-steel-ink) 40%, var(--rfs-line));
}
.tm-tile.is-beacon {
  background: color-mix(in oklab, var(--rfs-beacon) 22%, var(--rfs-raised));
  border-color: color-mix(in oklab, var(--rfs-beacon-ink) 48%, var(--rfs-line));
}
.tm-tile[aria-pressed="true"] {
  border-color: var(--rfs-beacon-ink);
  box-shadow: inset 0 0 0 1px var(--rfs-beacon-ink);
}
.tm-name {
  font: 600 0.8rem/1.2 var(--rfs-font-mono);
  color: var(--rfs-text);
  overflow-wrap: anywhere;
}
.tm-size {
  font: 600 0.76rem/1 var(--rfs-font-mono);
  color: var(--rfs-mute);
  font-variant-numeric: tabular-nums;
}
.tm-tile.is-beacon .tm-size { color: var(--rfs-beacon-ink); }

.spec-readout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--rfs-radius-sm);
  border: 1px solid var(--rfs-line);
  background: var(--rfs-code-bg);
}
.spec-readout-main {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}
.spec-readout-path {
  font: 600 0.78rem/1.3 var(--rfs-font-mono);
  color: var(--rfs-text);
  overflow-wrap: anywhere;
}
.spec-readout-note {
  font-size: 0.8rem;
  color: var(--rfs-mute);
}
.spec-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}
.spec-stat {
  padding: 0.55rem 0.65rem;
  border-radius: var(--rfs-radius-sm);
  border: 1px solid var(--rfs-line);
  background: var(--rfs-code-bg);
  display: grid;
  gap: 0.2rem;
}
.spec-stat span {
  font: 500 0.68rem/1.1 var(--rfs-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rfs-mute);
}
.spec-stat strong {
  font: 600 0.94rem/1.15 var(--rfs-font-mono);
  font-variant-numeric: tabular-nums;
}
.spec-stat .t-ok { color: var(--rfs-signal); }
.spec-stat .t-warn { color: var(--rfs-accent); }
.spec-stat .t-steel { color: var(--rfs-steel-ink); }

main { display: grid; gap: 0; }
.sections {
  padding-block: clamp(2.5rem, 5vw, 3.75rem) 2.5rem;
  display: grid;
  gap: clamp(3rem, 5.5vw, 4.5rem);
}
section { min-width: 0; }

h1 {
  margin: 0;
  font: 800 clamp(3rem, 2.2rem + 3vw, 4.75rem)/0.94 var(--rfs-font-display);
  letter-spacing: 0.055em;
  text-transform: uppercase;
  text-wrap: balance;
}
h2 {
  margin: 0;
  font: 800 clamp(1.55rem, 1.25rem + 1vw, 2.1rem)/1.05 var(--rfs-font-display);
  letter-spacing: 0.055em;
  text-transform: uppercase;
  text-wrap: balance;
}
p { margin: 0; text-wrap: pretty; }

.eyebrow {
  font: 600 0.74rem/1.2 var(--rfs-font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rfs-steel-ink);
}
.hero-rule {
  inline-size: 5.5rem;
  block-size: 3px;
  border-radius: 2px;
  background: var(--rfs-horizon-rule);
}
.lede {
  max-width: 60ch;
  color: var(--rfs-mute);
  font-size: 1rem;
  line-height: 1.62;
}
.release-meta {
  font: 400 0.8rem/1.6 var(--rfs-font-mono);
  color: var(--rfs-mute);
}
.release-meta a { color: var(--rfs-steel-ink); text-decoration: none; }
.release-meta a:hover { text-decoration: underline; }
.mono {
  font-family: var(--rfs-font-mono);
  font-variant-numeric: tabular-nums;
  font-variant-ligatures: none;
}

.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; }
.stack { display: grid; gap: 0.9rem; align-content: start; min-width: 0; }
.stack-lg { display: grid; gap: 1.35rem; align-content: start; min-width: 0; }

.section-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem 1.25rem;
}

.rfs-segmented { flex: none; min-width: 0; }
.rfs-seg-indicator {
  transition: transform var(--rfs-dur-detent) var(--rfs-ease-detent);
}
.rfs-segmented > button {
  padding-inline: 0.9rem;
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .rfs-seg-indicator { transition: none; }
}

.pipeline-frame {
  border: 1px solid var(--rfs-line);
  border-radius: var(--rfs-radius-md);
  background: var(--rfs-surface);
  overflow: hidden;
  min-width: 0;
}
.pipeline-scroll { overflow-x: auto; }
.pipeline-svg {
  width: 100%;
  height: auto;
  display: block;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.mode-card {
  min-width: 0;
  gap: 0.55rem;
}
.mode-card .val {
  font: 600 0.92rem/1.45 var(--rfs-font-mono);
  color: var(--rfs-text);
  overflow-wrap: anywhere;
}
.mode-card .note {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--rfs-mute);
  overflow-wrap: anywhere;
}

.rules-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.rules-table th,
.rules-table td {
  padding: 0.72rem 0.9rem;
  text-align: left;
  border-bottom: 1px solid var(--rfs-line);
  vertical-align: top;
}
.rules-table th {
  font: 600 0.72rem/1.2 var(--rfs-font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rfs-mute);
  background: var(--rfs-code-bg);
}
.rules-table tbody tr:last-child td { border-bottom: 0; }
.rules-table td:first-child { font-weight: 600; color: var(--rfs-text); min-width: 9.5rem; }
.rules-table td:nth-child(2) { overflow-wrap: break-word; }
.rules-table td:nth-child(3),
.rules-table td:nth-child(4),
.rules-table td:nth-child(5) { white-space: nowrap; }

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}
.two-col-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 2.25rem;
  align-items: start;
}

.spec-list {
  margin: 0;
  display: grid;
  gap: 0.8rem;
  min-width: 0;
}
.spec-list > div {
  display: grid;
  gap: 0.25rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--rfs-line);
  min-width: 0;
}
.spec-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.spec-list dt {
  font: 600 0.88rem/1.35 var(--rfs-font-mono);
  color: var(--rfs-text);
  overflow-wrap: anywhere;
}
.spec-list dd {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--rfs-mute);
  overflow-wrap: anywhere;
}

.guard-list {
  margin: 0;
  display: grid;
  border-top: 1px solid var(--rfs-line);
}
.guard-row {
  display: grid;
  gap: 0.25rem;
  padding-block: 0.72rem;
  border-bottom: 1px solid var(--rfs-line);
}
.guard-row:last-child { border-bottom: 0; padding-bottom: 0; }
.guard-row dt {
  font: 600 0.76rem/1.2 var(--rfs-font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--rfs-text);
}
.guard-row dd {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--rfs-mute);
  overflow-wrap: anywhere;
}

.plain-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.65rem;
  color: var(--rfs-mute);
  font-size: 0.92rem;
  line-height: 1.58;
  min-width: 0;
}
.plain-list li { overflow-wrap: anywhere; }
.plain-list strong { color: var(--rfs-text); }

.rfs-code-head .rfs-btn-copy-morph {
  min-block-size: 2rem;
  padding: 0.28rem 0.65rem;
  font-size: 0.74rem;
}
.tok-warn { color: var(--rfs-accent); font-weight: 600; }

footer {
  border-top: 1px solid var(--rfs-line);
  padding-block: 1.5rem 2.75rem;
  display: grid;
  gap: 0.6rem;
  color: var(--rfs-mute);
  font-size: 0.86rem;
}
footer a { color: var(--rfs-text); text-decoration: none; }
footer a:hover { text-decoration: underline; }
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.15rem;
}

@media (max-width: 60em) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 56em) {
  .mode-grid,
  .two-col,
  .two-col-top { grid-template-columns: minmax(0, 1fr); }
  .nav { order: 3; flex: 1 0 100%; justify-content: flex-start; border-top: 1px solid var(--rfs-line); padding-top: 0.35rem; }
}
@media (max-width: 44em) {
  .pipeline-svg { min-width: 46rem; }
}
@media (max-width: 36em) {
  .rfs-segmented { width: 100%; }
  .rfs-segmented > button { padding-inline: 0.45rem; font-size: 0.72rem; }
  .treemap-demo { grid-template-columns: 1fr; }
  .spec-stats { grid-template-columns: 1fr; }
  .rules-table { table-layout: fixed; }
  .rules-table th,
  .rules-table td { padding: 0.55rem 0.5rem; font-size: 0.82rem; }
  .rules-table th:first-child,
  .rules-table td:first-child { width: 30%; min-width: 0; }
  .rules-table th:nth-child(4),
  .rules-table td:nth-child(4) { width: 6.2rem; }
  .rules-table th:nth-child(3),
  .rules-table td:nth-child(3),
  .rules-table th:nth-child(5),
  .rules-table td:nth-child(5) { display: none; }
}
@media (pointer: coarse) {
  .nav-link,
  .theme-toggle,
  .rfs-segmented > button,
  .rfs-code-head .rfs-btn-copy-morph { min-block-size: 2.75rem; }
}
