:root {
  color-scheme: light;
  --paper: #efe7d8;
  --paper-bright: #f8f3e9;
  --paper-deep: #d9c9b2;
  --ink: #211b17;
  --ink-soft: #62574e;
  --soot: #171311;
  --ember: #db6034;
  --ember-deep: #9e351f;
  --amber: #e9a04d;
  --sage: #768064;
  --rule: rgba(33, 27, 23, 0.24);
  --rule-light: rgba(33, 27, 23, 0.12);
  --serif: "Iowan Old Style", "Baskerville", "Times New Roman", serif;
  --mono: "SFMono-Regular", "Menlo", "Courier New", monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --header: 2.2rem;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  background: var(--paper);
  scroll-behavior: smooth;
}

html.snap-enabled {
  scroll-snap-type: y proximity;
}

html.snap-animating {
  scroll-behavior: auto;
  scroll-snap-type: none;
}

body {
  min-width: 20rem;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  z-index: 60;
  inset: 0;
  opacity: 0.24;
  background-image:
    repeating-linear-gradient(0deg, transparent 0, transparent 2px, rgba(33, 27, 23, 0.024) 3px),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 140 140' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.74' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.2'/%3E%3C/svg%3E");
  content: "";
  pointer-events: none;
  mix-blend-mode: multiply;
}

body::after {
  position: fixed;
  z-index: 74;
  inset: 0;
  background: rgba(23, 19, 17, 0.46);
  content: "";
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

body.mobile-menu-open {
  overflow: hidden;
}

body.mobile-menu-open::after {
  opacity: 1;
}

::selection {
  background: var(--ember);
  color: var(--paper-bright);
}

a {
  color: inherit;
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
}

button,
a,
summary {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}

.site-header {
  position: fixed;
  z-index: 80;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  min-height: var(--header);
  padding: 0 1.35rem;
  align-items: stretch;
  border-bottom: 1px solid var(--ink);
  background: rgba(239, 231, 216, 0.91);
  backdrop-filter: blur(15px) saturate(90%);
}

.brand {
  display: inline-flex;
  min-width: 8.7rem;
  gap: 0.55rem;
  align-items: center;
  font-weight: 700;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.flame {
  position: relative;
  width: 0.9rem;
  height: 1.05rem;
  flex: 0 0 auto;
}

.flame::before,
.flame::after {
  position: absolute;
  content: "";
  transform-origin: 50% 100%;
}

.flame::before {
  inset: 0.04rem 0.08rem 0;
  border-radius: 80% 20% 62% 38% / 70% 40% 60% 30%;
  background: var(--ember);
  transform: rotate(38deg);
  animation: breathe 3.8s ease-in-out infinite;
}

.flame::after {
  right: 0.28rem;
  bottom: 0.05rem;
  width: 0.3rem;
  height: 0.48rem;
  border-radius: 70% 30% 60% 40%;
  background: #ffd28d;
  transform: rotate(31deg);
}

.desktop-nav {
  display: flex;
  align-items: stretch;
}

.nav-group {
  position: relative;
  display: flex;
}

.nav-group summary,
.nav-link {
  display: inline-flex;
  height: 100%;
  padding: 0 0.85rem;
  align-items: center;
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
  list-style: none;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group summary:hover,
.nav-group[open] summary,
.nav-group.current summary,
.nav-link:hover,
.nav-link.current {
  background: var(--ink);
  color: var(--paper-bright);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  display: grid;
  width: 18rem;
  padding: 0.45rem;
  border: 1px solid var(--ink);
  background: var(--paper-bright);
  box-shadow: 0.7rem 0.7rem 0 var(--ink);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-0.45rem);
  visibility: hidden;
  transition: opacity 180ms ease, transform 260ms var(--ease), visibility 0s linear 260ms;
}

.nav-group[open] .nav-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
  transition-delay: 0s;
}

.nav-menu a {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid var(--rule-light);
  align-items: baseline;
  text-decoration: none;
}

.nav-menu a:last-child {
  border-bottom: 0;
}

.nav-menu a:hover {
  background: rgba(219, 96, 52, 0.12);
}

.nav-number {
  color: var(--ember-deep);
  font-size: 0.62rem;
}

.header-cta {
  display: inline-flex;
  margin-left: auto;
  padding: 0 1rem;
  border-right: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
  align-items: center;
  background: var(--ember);
  color: #fff7ea;
  font-weight: 700;
  text-decoration: none;
  transition: background 160ms ease;
}

.header-cta:hover,
.header-cta.current {
  background: var(--ember-deep);
}

.mobile-nav {
  display: none;
  margin-left: auto;
}

.mobile-nav summary {
  display: flex;
  height: 100%;
  padding: 0 0.9rem;
  border-right: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
  align-items: center;
  cursor: pointer;
  font-size: 0.72rem;
  list-style: none;
}

.mobile-nav summary::-webkit-details-marker {
  display: none;
}

.mobile-menu {
  position: fixed;
  top: var(--header);
  right: 0;
  left: 0;
  display: grid;
  padding: 0.65rem;
  border-bottom: 1px solid var(--ink);
  background: var(--paper-bright);
  box-shadow: 0 0.75rem 0 var(--ink);
}

.mobile-menu a {
  padding: 0.82rem;
  border-bottom: 1px solid var(--rule-light);
  text-decoration: none;
}

.mobile-menu a:last-child {
  border-bottom: 0;
}

.eyebrow,
.page-kicker,
.artifact-label {
  color: var(--ember-deep);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 0.92;
}

em {
  font-weight: 400;
}

.button {
  display: inline-flex;
  min-height: 3.35rem;
  padding: 0.75rem 1.25rem;
  border: 1px solid var(--ink);
  border-radius: 99rem;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 180ms var(--ease), background 180ms ease, color 180ms ease;
}

.button:hover {
  background: var(--ink);
  color: var(--paper-bright);
  transform: translateY(-2px);
}

.button.primary {
  border-color: var(--ember);
  background: var(--ember);
  color: #fff8ed;
}

.button.primary:hover {
  border-color: var(--ember-deep);
  background: var(--ember-deep);
}

.button:active,
.mobile-nav summary:active,
.mobile-menu a:active {
  transform: scale(0.98);
  transition-duration: 90ms;
}

.home {
  position: relative;
  display: grid;
  min-height: 100svh;
  padding: 5.3rem 1.5rem 3rem;
  place-items: center;
  overflow: hidden;
  text-align: center;
}

.home-inner {
  position: relative;
  z-index: 2;
  width: min(68rem, 100%);
}

.home h1 {
  max-width: 16ch;
  margin-right: auto;
  margin-bottom: 1.6rem;
  margin-left: auto;
  font-size: clamp(4rem, 7.8vw, 8.2rem);
}

.home-lede {
  max-width: 49rem;
  margin: 0 auto 2rem;
  color: var(--ink-soft);
  font-size: clamp(0.9rem, 1.55vw, 1.14rem);
}

.home-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
}

.home-note {
  margin: 1.2rem 0 0;
  color: var(--ink-soft);
  font-size: 0.65rem;
}

.hero-orbit {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: min(56rem, 78vw);
  aspect-ratio: 1;
  border: 1px solid rgba(33, 27, 23, 0.09);
  border-radius: 50%;
  transform: translate(-50%, -48%);
  pointer-events: none;
}

.hero-orbit::before,
.hero-orbit::after {
  position: absolute;
  border-radius: 50%;
  content: "";
}

.hero-orbit::before {
  inset: 11%;
  border: 1px solid rgba(33, 27, 23, 0.08);
}

.hero-orbit::after {
  top: 13%;
  right: 15%;
  width: 0.8rem;
  height: 0.8rem;
  background: var(--ember);
  box-shadow: 0 0 3rem 1.2rem rgba(219, 96, 52, 0.38);
  animation: orbit 13s linear infinite;
}

.manual-layout {
  display: grid;
  min-height: 100svh;
  padding-top: var(--header);
  grid-template-columns: 20rem minmax(0, 1fr);
}

.page-index {
  position: sticky;
  top: var(--header);
  height: calc(100svh - var(--header));
  padding: 1.8rem 2rem;
  border-right: 1px solid var(--rule-light);
  overflow-y: auto;
  background: rgba(239, 231, 216, 0.74);
}

.page-index h1 {
  margin-bottom: 1.6rem;
  font-size: 2.1rem;
}

.page-search {
  width: 100%;
  min-height: 3.1rem;
  margin-bottom: 1.8rem;
  padding: 0 1rem;
  border: 1px solid var(--rule);
  border-radius: 99rem;
  background: rgba(248, 243, 233, 0.42);
}

.search-status {
  min-height: 1.4em;
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.index-group {
  margin: 0 0 1.7rem;
}

.index-group strong {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
}

.index-group a {
  display: block;
  padding: 0.42rem 0 0.42rem 0.8rem;
  border-left: 1px solid var(--rule-light);
  color: var(--ink-soft);
  font-size: 0.78rem;
  text-decoration: none;
}

.index-group a[hidden],
.index-group[hidden] {
  display: none;
}

.index-group a:hover,
.index-group a.current {
  border-left-color: var(--ember);
  color: var(--ink);
  font-weight: 700;
}

.manual-content {
  width: min(65rem, 100%);
  padding: 5.5rem clamp(2rem, 7vw, 6rem) 8rem;
}

.manual-section {
  min-height: 76svh;
  padding-bottom: 7rem;
  scroll-margin-top: 4.5rem;
}

.manual-section:last-child {
  min-height: auto;
}

.manual-section h2 {
  max-width: 11ch;
  margin-bottom: 1.5rem;
  font-size: clamp(3.7rem, 7vw, 7rem);
}

.manual-section > p:not(.page-kicker) {
  max-width: 46rem;
  color: var(--ink-soft);
}

.artifact {
  margin-top: 2.5rem;
  border: 1px solid var(--ink);
  background: var(--paper-bright);
  box-shadow: 0.85rem 0.85rem 0 var(--ink);
}

.artifact-bar {
  display: flex;
  min-height: 2.5rem;
  padding: 0 0.9rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.artifact-body {
  padding: clamp(1.4rem, 4vw, 2.4rem);
}

.artifact-quote {
  padding: 1rem 1.2rem;
  border-left: 0.22rem solid var(--ember);
  background: #eee2d1;
  font-family: var(--serif);
  font-size: 1.25rem;
}

.data-grid {
  display: grid;
  margin-top: 1.4rem;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.data-grid div {
  padding: 0.8rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.data-grid span,
.status-grid span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.56rem;
  text-transform: uppercase;
}

.data-grid strong,
.status-grid strong {
  font-size: 0.7rem;
}

.timeline {
  position: relative;
  max-width: 47rem;
  margin-top: 2.5rem;
  padding-left: 2.2rem;
}

.timeline::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0.55rem;
  width: 1px;
  background: var(--rule);
  content: "";
}

.timeline-event {
  position: relative;
  margin-bottom: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--rule);
  background: rgba(248, 243, 233, 0.38);
}

.timeline-event::before {
  position: absolute;
  top: 1.35rem;
  left: -1.99rem;
  width: 0.65rem;
  height: 0.65rem;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: #8b8177;
  box-shadow: 0 0 0 1px var(--rule);
  content: "";
}

.timeline-event.current {
  border-color: var(--ember);
}

.timeline-event.current::before {
  background: var(--ember);
}

.timeline-meta {
  display: flex;
  margin-bottom: 0.4rem;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 0.59rem;
  text-transform: uppercase;
}

.timeline-event p {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.22rem;
  line-height: 1.2;
}

.stack {
  display: grid;
  max-width: 50rem;
  margin-top: 2.5rem;
  gap: 0.65rem;
}

.stack-card {
  display: grid;
  min-height: 6.5rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--ink);
  grid-template-columns: 5rem 1fr auto;
  gap: 1rem;
  align-items: center;
  background: var(--paper-bright);
  box-shadow: 0.4rem 0.4rem 0 rgba(33, 27, 23, 0.12);
}

.stack-card strong {
  font-family: var(--serif);
  font-size: 1.2rem;
}

.stack-card small {
  color: var(--ink-soft);
}

.stack-index {
  color: var(--ember-deep);
  font-size: 0.63rem;
}

.chapter {
  position: relative;
  display: grid;
  min-height: 100svh;
  padding: 5rem clamp(1.5rem, 7vw, 7rem) 3rem;
  place-items: center;
  overflow: clip;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.chapter.dark {
  background: var(--soot);
  color: var(--paper-bright);
}

.chapter-inner {
  width: min(76rem, 100%);
}

.chapter-split {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(22rem, 0.72fr);
  gap: clamp(3rem, 8vw, 8rem);
  align-items: center;
}

.chapter h1,
.chapter h2 {
  max-width: 10ch;
  margin-bottom: 1.5rem;
  font-size: clamp(4rem, 8vw, 8rem);
}

.dark .page-kicker {
  color: var(--amber);
}

.chapter-copy > p:not(.page-kicker) {
  max-width: 43rem;
  color: var(--ink-soft);
}

.dark .chapter-copy > p:not(.page-kicker) {
  color: #bdb1a7;
}

.model-switcher {
  display: flex;
  margin-bottom: 1rem;
  padding: 0.28rem;
  border: 1px solid currentColor;
  border-radius: 99rem;
}

.model-switcher button {
  flex: 1;
  min-height: 2.65rem;
  border: 0;
  border-radius: 99rem;
  background: transparent;
  cursor: pointer;
  font-size: 0.67rem;
}

.model-switcher button.active {
  background: var(--ink);
  color: var(--paper-bright);
}

.console {
  border: 1px solid var(--ink);
  background: var(--paper-bright);
  color: var(--ink);
  box-shadow: 0.9rem 0.9rem 0 var(--ember);
}

.console-body {
  padding: 2rem;
}

.console-model {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.model-glyph {
  display: grid;
  width: 3.3rem;
  height: 3.3rem;
  border-radius: 50%;
  place-items: center;
  background: var(--soot);
  color: var(--paper-bright);
  font-family: var(--serif);
  font-size: 1.35rem;
}

.console-model strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1;
}

.console-model small {
  color: var(--ink-soft);
}

.status-grid {
  display: grid;
  margin-top: 1.5rem;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.status-grid div {
  padding: 0.8rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.section-dots {
  position: fixed;
  z-index: 70;
  top: 50%;
  right: 1.25rem;
  display: grid;
  gap: 0.45rem;
  transform: translateY(-50%);
}

.section-dots a {
  width: 0.48rem;
  height: 0.48rem;
  border: 1px solid rgba(33, 27, 23, 0.38);
  border-radius: 50%;
  background: rgba(239, 231, 216, 0.72);
}

.section-dots a[aria-current="true"] {
  border-color: var(--ember);
  background: var(--ember);
  transform: scale(1.35);
}

.focus-page {
  display: grid;
  min-height: 100svh;
  padding: 6.5rem 1.5rem 4rem;
  place-items: center;
}

.focus-inner {
  width: min(55rem, 100%);
}

.focus-head {
  margin-bottom: 2.4rem;
  text-align: center;
}

.focus-head h1 {
  margin-bottom: 1rem;
  font-size: clamp(4rem, 8vw, 7rem);
}

.focus-head p {
  max-width: 43rem;
  margin-right: auto;
  margin-left: auto;
  color: var(--ink-soft);
}

.proposal {
  border: 1px solid var(--ink);
  background: var(--paper-bright);
  box-shadow: 0.9rem 0.9rem 0 var(--ember);
}

.proposal-body {
  padding: 2rem;
}

.proposal-label {
  display: flex;
  margin-bottom: 1.2rem;
  justify-content: space-between;
  color: var(--ink-soft);
  font-size: 0.6rem;
  text-transform: uppercase;
}

.proposal blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.05;
}

.proposal-evidence {
  margin: 1.4rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule-light);
  color: var(--ink-soft);
  font-size: 0.68rem;
}

.proposal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--ink);
}

.proposal-actions button {
  min-height: 3.5rem;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.proposal-actions button + button {
  border-left: 1px solid var(--ink);
}

.proposal-actions button:hover {
  background: rgba(219, 96, 52, 0.1);
}

.proposal-status {
  min-height: 2.6rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--rule-light);
  color: var(--ember-deep);
  font-size: 0.63rem;
}

.proposal.approved {
  box-shadow: 0.9rem 0.9rem 0 var(--sage);
}

.proposal.rejected {
  box-shadow: 0.9rem 0.9rem 0 #8b8177;
}

.principles {
  display: grid;
  margin-top: 2.5rem;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.principles article {
  padding: 1.2rem;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.principles h2 {
  font-size: 1.4rem;
}

.principles p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.72rem;
}

.access-card {
  padding: clamp(1.5rem, 5vw, 3rem);
  border: 1px solid var(--ink);
  background: var(--paper-bright);
  box-shadow: 1rem 1rem 0 var(--ink);
}

.access-card h1 {
  max-width: 9ch;
  font-size: clamp(3.8rem, 8vw, 6rem);
}

.access-card > p:not(.page-kicker) {
  max-width: 39rem;
  color: var(--ink-soft);
}

.access-actions {
  display: flex;
  margin-top: 1.8rem;
  gap: 0.8rem;
}

/* hand.computer-inspired subpages */
.feature-board {
  width: min(43rem, 100%);
  border: 1px solid var(--ink);
  background: rgba(248, 243, 233, 0.84);
  box-shadow: 1rem 1rem 0 var(--ember);
}

.feature-board.dark-board {
  border-color: rgba(248, 243, 233, 0.45);
  background: rgba(248, 243, 233, 0.06);
}

.feature-board-head {
  display: flex;
  min-height: 3rem;
  padding: 0 1rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid currentColor;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.feature-board-body {
  padding: clamp(1.3rem, 4vw, 2.5rem);
}

.receipt-row,
.permission-row,
.budget-row {
  display: grid;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule-light);
  align-items: center;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 1rem;
}

.dark .receipt-row,
.dark .permission-row,
.dark .budget-row {
  border-color: rgba(248, 243, 233, 0.16);
}

.receipt-row:last-child,
.permission-row:last-child,
.budget-row:last-child {
  border-bottom: 0;
}

.receipt-row span,
.permission-row span,
.budget-row span {
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.dark .receipt-row span,
.dark .permission-row span,
.dark .budget-row span {
  color: rgba(248, 243, 233, 0.62);
}

.receipt-row strong,
.permission-row strong,
.budget-row strong {
  font-size: 0.78rem;
}

.status-pill {
  padding: 0.18rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: 99rem;
  color: var(--sage);
  font-size: 0.61rem;
  white-space: nowrap;
}

.permission-row .denied {
  color: var(--ember);
}

.handbook-layout {
  display: grid;
  min-height: 100svh;
  padding-top: var(--header);
  grid-template-columns: 20rem minmax(0, 1fr);
  background: var(--paper-bright);
}

.handbook-sidebar {
  position: sticky;
  top: var(--header);
  height: calc(100svh - var(--header));
  padding: clamp(1.8rem, 3vw, 2.7rem) clamp(1.3rem, 2.7vw, 2.4rem);
  border-right: 1px solid var(--rule);
  overflow-y: auto;
  background: rgba(239, 231, 216, 0.5);
}

.handbook-sidebar h1 {
  margin: 0 0 1.7rem;
  font-family: var(--serif);
  font-size: clamp(2rem, 2.8vw, 2.45rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.handbook-search {
  display: block;
}

.handbook-search input {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1.15rem;
  border: 1px solid var(--rule);
  border-radius: 99rem;
  background: rgba(248, 243, 233, 0.74);
  color: var(--ink);
}

.handbook-search input::placeholder {
  color: rgba(98, 87, 78, 0.58);
}

.handbook-search-status {
  min-height: 1.2rem;
  margin: 0.4rem 0 0;
  color: var(--ink-soft);
  font-size: 0.62rem;
}

.handbook-nav {
  display: grid;
  margin-top: 1.25rem;
  gap: 1.65rem;
}

.handbook-group h2 {
  margin: 0 0 0.55rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0;
}

.handbook-group > div {
  display: grid;
  border-left: 1px solid var(--rule-light);
}

.handbook-group a {
  padding: 0.38rem 0.8rem;
  color: rgba(98, 87, 78, 0.72);
  font-size: 0.68rem;
  text-decoration: none;
  transition: color 180ms ease, transform 180ms ease;
}

.handbook-group a:hover,
.handbook-group a.current {
  color: var(--ink);
  transform: translateX(0.2rem);
}

.handbook-group a.current {
  font-weight: 700;
}

.handbook-content {
  width: min(59rem, 100%);
  padding: clamp(4.2rem, 8vw, 7rem) clamp(2.3rem, 7vw, 7rem) 12rem;
}

.handbook-section {
  padding-bottom: clamp(5.5rem, 10vw, 8rem);
  scroll-margin-top: calc(var(--header) + 2rem);
}

.handbook-section h2 {
  margin: 0 0 1.7rem;
  font-family: var(--serif);
  font-size: clamp(3rem, 4.5vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.handbook-section h3 {
  margin: 3.6rem 0 1.1rem;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.2vw, 2.7rem);
  line-height: 1;
  letter-spacing: -0.035em;
}

.handbook-section p {
  max-width: 48rem;
  margin: 0 0 1.45rem;
  color: var(--ink-soft);
  font-size: clamp(0.82rem, 1.3vw, 0.97rem);
  line-height: 1.75;
}

.handbook-lead p:first-of-type {
  color: var(--ink);
  font-size: clamp(0.95rem, 1.55vw, 1.12rem);
}

.handbook-callout {
  max-width: 48rem;
  margin: 2rem 0 0;
  padding: 1.4rem 1.55rem;
  border: 1px solid transparent;
  border-radius: 1rem;
  font-size: clamp(0.77rem, 1.15vw, 0.88rem);
  line-height: 1.65;
}

.handbook-callout strong {
  font-size: 0.68rem;
  text-transform: uppercase;
}

.handbook-callout.tip {
  background: rgba(255, 255, 255, 0.76);
}

.handbook-callout.warning {
  border-color: var(--ink-soft);
  background: rgba(239, 231, 216, 0.32);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.support-page {
  min-height: 100svh;
  padding: calc(var(--header) + clamp(3.6rem, 5vw, 4.2rem)) 1.25rem clamp(5rem, 9vw, 8rem);
  background: var(--paper-bright);
}

.support-stage {
  width: min(52rem, 100%);
  margin: 0 auto;
}

.support-head {
  text-align: center;
}

.support-head h1 {
  max-width: none;
  margin: 0 auto;
  font-size: clamp(3.8rem, 6.2vw, 5.2rem);
  line-height: 0.9;
  letter-spacing: -0.047em;
}

.support-head p {
  max-width: 38rem;
  margin-top: 1.25rem;
  margin-inline: auto;
  color: var(--ink-soft);
  font-size: clamp(0.82rem, 1.45vw, 1rem);
  line-height: 1.65;
}

.support-tabs {
  display: grid;
  max-width: 36rem;
  margin: clamp(2.2rem, 3vw, 2.5rem) auto 0;
  border-bottom: 1px solid var(--rule);
  grid-template-columns: 1fr 1fr;
}

.support-tabs button {
  padding: 0.9rem 0.8rem 1rem;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 700;
}

.support-tabs button.active {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--ember);
}

.support-form {
  display: grid;
  max-width: 36rem;
  margin: 2.3rem auto 0;
  padding: clamp(2rem, 4vw, 2.5rem);
  border: 1px solid var(--rule-light);
  border-radius: 1.8rem;
  background: rgba(255, 255, 255, 0.6);
  gap: 1.35rem;
}

.support-form label {
  display: grid;
  gap: 0.48rem;
  font-size: 0.72rem;
  font-weight: 700;
}

.support-form input,
.support-form textarea {
  width: 100%;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(33, 27, 23, 0.18);
  border-radius: 0.85rem;
  background: rgba(239, 231, 216, 0.58);
}

.support-form input {
  min-height: 4rem;
}

.support-form textarea {
  min-height: 11rem;
  resize: vertical;
}

.support-submit {
  min-height: 3.2rem;
  border: 1px solid var(--ink);
  border-radius: 99rem;
  background: var(--ink);
  color: var(--paper-bright);
  cursor: pointer;
}

.support-submit:disabled {
  cursor: wait;
  opacity: 0.68;
}

.support-honeypot {
  position: fixed;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.support-status {
  min-height: 1.5em;
  margin: 0;
  color: var(--ember-deep);
  font-size: 0.68rem;
  text-align: center;
}

.support-status[data-state="success"] {
  color: #41614d;
}

.support-status[data-state="error"] {
  color: var(--ember-deep);
}

.support-privacy {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.65rem;
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(1.6rem);
  transition: opacity 720ms ease, transform 880ms var(--ease);
}

.in-view .reveal,
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

@keyframes breathe {
  0%, 100% { transform: rotate(38deg) scale(1); }
  50% { transform: rotate(42deg) scale(0.9, 1.08); }
}

@keyframes orbit {
  from { transform: rotate(0deg) translateX(0.35rem) rotate(0deg); }
  to { transform: rotate(360deg) translateX(0.35rem) rotate(-360deg); }
}

@media (max-width: 920px) {
  :root {
    --header: 3rem;
  }

  html.snap-enabled {
    scroll-snap-type: none;
  }

  body::before {
    display: none;
  }

  .desktop-nav,
  .header-cta {
    display: none;
  }

  .site-header {
    min-height: calc(var(--header) + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
    padding-right: 0;
    padding-left: max(1.15rem, env(safe-area-inset-left));
  }

  .mobile-nav {
    display: block;
  }

  .brand,
  .mobile-nav summary {
    min-height: var(--header);
  }

  .mobile-nav summary {
    padding-right: max(0.95rem, env(safe-area-inset-right));
    padding-left: 0.95rem;
  }

  .mobile-menu {
    top: calc(var(--header) + env(safe-area-inset-top));
    max-height: calc(100dvh - var(--header) - env(safe-area-inset-top));
    padding-bottom: max(0.65rem, env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mobile-menu a {
    display: flex;
    min-height: 3rem;
    align-items: center;
  }

  .manual-layout {
    display: block;
    padding-top: var(--header);
  }

  .page-index {
    position: relative;
    top: auto;
    width: 100%;
    height: auto;
    padding: 1.5rem;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .page-index h1,
  .page-search {
    display: none;
  }

  .index-groups {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .index-group {
    display: contents;
  }

  .index-group strong {
    display: none;
  }

  .index-group a {
    flex: 0 0 auto;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--rule);
    border-radius: 99rem;
  }

  .manual-content {
    padding: 4rem 1.3rem 6rem;
  }

  .manual-section {
    min-height: auto;
    padding-bottom: 6rem;
  }

  .chapter {
    min-height: auto;
    padding: 7rem 1.3rem;
  }

  .chapter:first-of-type,
  .chapter:last-of-type {
    min-height: 100svh;
  }

  .chapter-split {
    grid-template-columns: 1fr;
  }

  .section-dots {
    display: none;
  }
}

@media (max-width: 560px) {
  .home {
    padding-right: 1.15rem;
    padding-left: 1.15rem;
  }

  .home h1 {
    font-size: clamp(3.35rem, 17vw, 5.5rem);
  }

  .home-actions,
  .access-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  input,
  textarea {
    font-size: 1rem;
  }

  .manual-section h2,
  .chapter h1,
  .chapter h2 {
    font-size: clamp(3rem, 14vw, 4.8rem);
  }

  .data-grid,
  .status-grid,
  .principles {
    grid-template-columns: 1fr;
  }

  .stack-card {
    grid-template-columns: 3.5rem 1fr;
  }

  .stack-card small {
    display: none;
  }

  .model-switcher {
    border-radius: 0;
    flex-direction: column;
  }

  .model-switcher button {
    border-radius: 0;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 920px) {
  .handbook-layout {
    display: block;
  }

  .handbook-sidebar {
    position: relative;
    top: auto;
    width: 100%;
    height: auto;
    padding: 1.7rem 1.3rem 1.4rem;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .handbook-sidebar h1 {
    margin-bottom: 1rem;
  }

  .handbook-nav {
    display: flex;
    margin: 1rem -1.3rem -0.15rem;
    padding: 0 1.3rem 0.85rem;
    overflow-x: auto;
    gap: 0.45rem;
    scroll-padding-inline: 1.3rem;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .handbook-nav::-webkit-scrollbar {
    display: none;
  }

  .handbook-group {
    display: contents;
  }

  .handbook-group h2 {
    display: none;
  }

  .handbook-group > div {
    display: contents;
    border-left: 0;
  }

  .handbook-group a {
    display: inline-flex;
    min-height: 2.75rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--rule);
    border-radius: 99rem;
    align-items: center;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .handbook-group a.current {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper-bright);
  }

  .handbook-content {
    width: min(48rem, 100%);
    padding: clamp(3.5rem, 8vw, 5.5rem) clamp(1.4rem, 6vw, 3.5rem) 8rem;
  }

  .feature-board {
    box-shadow: 0.65rem 0.65rem 0 var(--ember);
  }
}

@media (max-width: 620px) {
  .support-page {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .support-form {
    padding: 1.45rem;
    border-radius: 1.5rem;
  }

  .support-form input,
  .support-form textarea,
  .handbook-search input {
    font-size: 1rem;
    line-height: 1.4;
  }

  .focus-page,
  .support-page {
    padding-bottom: max(4rem, env(safe-area-inset-bottom));
  }

  .receipt-row,
  .permission-row,
  .budget-row {
    grid-template-columns: 1fr auto;
  }

  .receipt-row span,
  .permission-row span,
  .budget-row span {
    grid-column: 1 / -1;
  }

  .support-head h1 {
    font-size: clamp(3.2rem, 17vw, 4.8rem);
  }
}
