:root {
  --bg: #190f14;
  --bg-rgb: 25, 15, 20;
  --raised: #2a1b22;
  --text: #f3eeeb;
  --muted: #cbb8bf;
  --accent: #ed3330;
  --ink: #1a0c0e;
  --brass: #dcb66a;
  --line: rgba(243, 238, 235, 0.14);
  --line-strong: rgba(220, 182, 106, 0.45);
  --display: "Oswald", "Arial Narrow", sans-serif;
  --body: "Rubik", "Segoe UI", sans-serif;
  --nav-h: 4.25rem;
  --measure: 68ch;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--brass);
  text-underline-offset: 0.18em;
}

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

p,
li {
  max-width: var(--measure);
}

h1, h2, h3, h4,
.manifesto-lead,
.quote-line {
  max-width: none;
}

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--brass);
  color: var(--ink);
  padding: 0.55rem 0.9rem;
  font-family: var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.skip:focus {
  top: 0.6rem;
}

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}

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

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

.wrap {
  width: min(1180px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.kicker {
  margin: 0 0 0.7rem;
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brass);
}

h1, h2, .stack-title, .note strong, .step h3, .cell h3, .cmp-row h3 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 0.96;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(2.6rem, 4.5vw, 4.15rem);
  max-width: 18ch;
  text-wrap: balance;
}

h2 {
  margin: 0 0 0.9rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
  text-wrap: balance;
}

h3 {
  margin: 0 0 0.4rem;
  font-size: 1.45rem;
}

.lede,
.section-intro {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.section-intro {
  margin-top: 0;
}

.site-header,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(var(--bg-rgb), 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.nav-inner {
  width: min(1180px, calc(100% - 2.5rem));
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-family: var(--display);
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand:hover {
  color: var(--brass);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  font-family: var(--display);
  font-size: 0.92rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--brass);
}

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.nav-toggle .bar,
.nav-toggle .bar::before,
.nav-toggle .bar::after {
  display: block;
  width: 1.15rem;
  height: 1.5px;
  background: var(--text);
  position: relative;
}

.nav-toggle .bar::before,
.nav-toggle .bar::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle .bar::before { top: -6px; }
.nav-toggle .bar::after { top: 6px; }

.band {
  background: rgba(var(--bg-rgb), 0.78);
  border-top: 1px solid var(--line);
}

.band-alt {
  background: rgba(32, 20, 26, 0.9);
}

.pad {
  padding: clamp(3.25rem, 6vw, 5rem) 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.4rem 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.7rem 1.05rem;
  border: 1px solid transparent;
  text-decoration: none;
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  background: transparent;
  color: var(--text);
}

.btn-primary {
  background: var(--accent);
  color: var(--ink);
}

.btn-primary:hover {
  background: #ff5a52;
  color: var(--ink);
}

.btn-ghost {
  border-color: var(--line-strong);
  color: var(--brass);
}

.btn-ghost:hover {
  border-color: var(--text);
  color: var(--text);
}

.hero {
  background: rgba(var(--bg-rgb), 0.42);
  border-top: 0;
}

.hero-grid {
  min-height: calc(100svh - var(--nav-h));
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 1rem;
  align-items: stretch;
  padding: 0.75rem 0 0.85rem;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.25rem 1rem;
  background: rgba(25, 15, 20, 0.88);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-copy .lede + .lede {
  margin-top: 0.35rem;
}

.hero-facts {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  padding-top: 1.4rem;
}

.fact {
  margin: 0;
  padding: 0.75rem 0.7rem 0.8rem;
  border-top: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.03);
  min-height: 5.4rem;
}

.fact span {
  display: block;
  font-family: var(--display);
  font-size: 1.02rem;
  letter-spacing: 0.03em;
  line-height: 1.15;
  color: var(--text);
}

.fact small {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  max-width: none;
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(237, 51, 48, 0.16), transparent 42%),
    rgba(25, 15, 20, 0.55);
  border: 1px solid var(--line);
}

.hero-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(108%, 560px);
  height: auto;
  color: var(--brass);
  transform: translate(-50%, -50%);
}

.hero-ring .ticks { stroke: var(--brass); stroke-width: 1.2; }
.hero-ring .ring-a { fill: none; stroke: var(--brass); stroke-width: 1.4; }
.hero-ring .ring-b { fill: none; stroke: rgba(243, 238, 235, 0.55); stroke-width: 1; }
.hero-ring .ring-c { fill: none; stroke: var(--accent); stroke-width: 2; }
.hero-ring .strike { stroke: var(--accent); stroke-width: 2.4; fill: none; }

.stack {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, 430px);
  display: grid;
  gap: 0.5rem;
}

.stack-label {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--brass);
}

.note {
  background: #24161c;
  border: 1px solid var(--line);
  padding: 0.62rem 0.8rem 0.68rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.note-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.note-top svg {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.note-top time {
  margin-left: auto;
  color: var(--brass);
}

.note strong {
  display: block;
  margin: 0.22rem 0 0.12rem;
  font-size: 1.08rem;
}

.note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
  max-width: none;
}

.plat-grid,
.cell-grid,
.contact-grid,
.reach-grid {
  display: grid;
  gap: 1rem;
}

.plat-grid {
  grid-template-columns: 1fr 1fr;
}

.plat-card {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 460px;
  background: rgba(25, 15, 20, 0.72);
  border: 1px solid var(--line);
}

.plat-card:hover {
  border-color: var(--line-strong);
}

.plat-art {
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(circle at 50% 45%, rgba(220, 182, 106, 0.12), transparent 55%),
    #140c10;
  border-right: 1px solid var(--line);
}

.shell {
  width: min(100%, 210px);
  height: auto;
  color: var(--brass);
}

.plat-copy {
  padding: 1.35rem 1.2rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.plat-copy p:last-child {
  margin-bottom: 0;
}

.process-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) 1.4fr;
  gap: 2rem;
  align-items: start;
}

.process-side {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
}

.side-ring {
  width: min(100%, 300px);
  margin-top: 1rem;
  color: var(--brass);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.step {
  display: grid;
  grid-template-columns: 4.2rem 1fr;
  gap: 0.8rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line);
}

.step-no {
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.step p {
  margin: 0;
  color: var(--muted);
}

.plates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.4rem 0 1rem;
}

.plate {
  min-height: 280px;
  padding: 1rem 1rem 0.8rem;
  border: 1px solid var(--line);
  background: #140c10;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.plate svg {
  width: min(100%, 240px);
  justify-self: center;
  align-self: center;
  color: var(--brass);
}

.plate figcaption {
  font-family: var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  font-size: 0.85rem;
}

.cmp {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.cmp-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.7fr) 1fr 1fr;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.cmp-row h3 {
  font-size: 1.25rem;
  padding-top: 0.15rem;
}

.cmp-row p {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

.plat-tag {
  margin: 0;
  font-family: var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--accent);
  max-width: none;
}

.manifesto {
  background:
    linear-gradient(90deg, rgba(237, 51, 48, 0.18), transparent 28%),
    rgba(20, 12, 16, 0.92);
  border-top: 6px solid var(--accent);
}

.manifesto-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: 1.5rem;
  align-items: center;
}

.manifesto h2 {
  font-size: clamp(2.4rem, 4.6vw, 4.4rem);
  max-width: 16ch;
  text-transform: uppercase;
  line-height: 0.9;
}

.manifesto-mark {
  width: min(100%, 420px);
  justify-self: end;
  color: var(--brass);
}

.manifesto-lead {
  margin: 0.4rem 0 1rem;
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  max-width: 36ch;
  color: var(--text);
}

.membrane {
  width: 100%;
  height: auto;
  margin-top: 0.5rem;
}

.marquee-block .section-intro {
  margin-bottom: 1.4rem;
}

.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: rgba(20, 12, 16, 0.65);
}

.marquee + .marquee {
  border-top: 0;
}

.track {
  display: flex;
  width: max-content;
  animation: drift 48s linear infinite;
}

.track-b {
  animation-duration: 56s;
  animation-direction: reverse;
}

.group {
  display: flex;
  gap: 0.65rem;
  padding: 0.7rem;
}

.cap {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 3.4rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid var(--line);
  background: #1c1217;
  color: var(--text);
  white-space: nowrap;
  font-family: var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 1rem;
}

.cap svg {
  width: 22px;
  height: 22px;
  color: var(--brass);
  flex: none;
}

.marquee:hover .track,
.marquee:focus-within .track {
  animation-play-state: paused;
}

@keyframes drift {
  to { transform: translateX(-50%); }
}

.assist-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 1.25rem;
  align-items: stretch;
}

.chat {
  background: #140c10;
  border: 1px solid var(--line);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.chat-bar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.9rem;
}

.chat-bar strong {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chat-bar span {
  color: var(--brass);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bubble {
  max-width: 92%;
  margin: 0 0 0.7rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
}

.bubble p {
  margin: 0.25rem 0 0;
  max-width: none;
}

.bubble .who {
  margin: 0;
  font-family: var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--brass);
}

.bubble.from-user {
  margin-left: auto;
  background: #2a1a20;
  border-top: 2px solid var(--brass);
}

.bubble.from-assistant {
  background: #1a1014;
  border-top: 2px solid var(--accent);
}

.chat-foot {
  margin-top: auto;
  padding-top: 0.4rem;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: none;
}

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

.cell {
  min-height: 230px;
  padding: 1.1rem 1rem 1.15rem;
  border: 1px solid var(--line);
  background: rgba(20, 12, 16, 0.72);
  display: flex;
  flex-direction: column;
}

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

.cell svg {
  width: 52px;
  height: 52px;
  color: var(--brass);
  margin-bottom: 0.8rem;
}

.cell p {
  margin: 0;
  color: var(--muted);
}

.contact-band {
  background: var(--accent);
  color: var(--ink);
  border-top: 0;
}

.contact-band .kicker,
.contact-band h2,
.contact-band p,
.contact-band a {
  color: var(--ink);
}

.contact-band .btn-primary {
  background: var(--ink);
  color: var(--text);
}

.contact-band .btn-primary:hover {
  background: #3a2228;
  color: var(--text);
}

.contact-band .btn-ghost {
  border-color: var(--ink);
  color: var(--ink);
}

.contact-band .btn-ghost:hover {
  background: rgba(26, 12, 14, 0.08);
  color: var(--ink);
}

.contact-grid {
  grid-template-columns: 1.1fr 0.9fr;
  align-items: stretch;
}

.contact-copy h2 {
  max-width: 10ch;
}

.contact-card {
  background: var(--bg);
  color: var(--text);
  border: 1px solid rgba(26, 12, 14, 0.4);
  padding: 1.4rem 1.3rem;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}

.contact-card .kicker,
.contact-card a {
  color: var(--brass);
}

.contact-card p,
.contact-name {
  margin: 0;
  color: var(--text);
  max-width: none;
}

.contact-name {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mail-link {
  font-size: 1.15rem;
  text-decoration: none;
  border-bottom: 1px solid var(--brass);
  align-self: flex-start;
}

.card-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.8rem;
}

.site-footer {
  background: rgba(12, 8, 10, 0.94);
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 1.6rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
}

.footer-brand {
  margin: 0;
  font-family: var(--display);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 1.1rem;
}

.footer-note {
  margin: 0.3rem 0 0;
  color: var(--muted);
  max-width: 36ch;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  color: var(--text);
  text-decoration: none;
  font-family: var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.page-hero {
  background:
    radial-gradient(circle at 82% 40%, rgba(237, 51, 48, 0.18), transparent 26%),
    rgba(var(--bg-rgb), 0.55);
}

.page-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.7fr);
  gap: 1rem;
  align-items: center;
  padding: 2.2rem 0;
  min-height: 280px;
}

.page-hero h1 {
  max-width: 14ch;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
}

.date-line {
  margin: 0.8rem 0 0;
  color: var(--brass);
  font-family: var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.95rem;
}

.page-ring {
  width: min(100%, 280px);
  justify-self: end;
  color: var(--brass);
}

.doc {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.toc {
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  padding-top: 0.2rem;
}

.toc p {
  margin: 0 0 0.6rem;
  font-family: var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--brass);
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.45rem;
}

.toc a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

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

.prose h2 {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin-top: 2rem;
  scroll-margin-top: calc(var(--nav-h) + 0.8rem);
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p,
.prose li {
  color: var(--muted);
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.reach-grid {
  grid-template-columns: 0.85fr 1.15fr;
  align-items: stretch;
}

.identity,
.mail-form {
  border: 1px solid var(--line);
  background: rgba(20, 12, 16, 0.8);
  padding: 1.3rem;
  min-height: 420px;
}

.identity {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.mail-form {
  display: grid;
  gap: 0.85rem;
  align-content: start;
}

.mail-form label {
  display: grid;
  gap: 0.35rem;
  font-family: var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--brass);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #120b0e;
  color: var(--text);
  font: inherit;
  padding: 0.75rem 0.8rem;
}

textarea {
  min-height: 160px;
  resize: vertical;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

@media (max-width: 980px) {
  .doc {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }

  .toc ol {
    grid-template-columns: 1fr 1fr;
  }

  .cell-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 860px) {
  .hero-grid,
  .plat-grid,
  .process-grid,
  .assist-grid,
  .contact-grid,
  .reach-grid,
  .page-hero-grid,
  .plates,
  .cmp-row,
  .manifesto-grid {
    grid-template-columns: 1fr;
  }

  .hero-grid {
    min-height: 0;
    padding-top: 1rem;
  }

  .plat-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .plat-art {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    min-height: 250px;
  }

  .process-side {
    position: static;
  }

  .side-ring,
  .page-ring,
  .manifesto-mark {
    width: min(100%, 220px);
    justify-self: start;
  }

  .page-ring {
    justify-self: start;
  }

  .hero-facts {
    grid-template-columns: 1fr;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.4rem 1.25rem 1rem;
    background: #120b0e;
    border-bottom: 1px solid var(--line);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.8rem 0;
    border-top: 1px solid var(--line);
  }

  .footer-inner {
    flex-direction: column;
    align-items: start;
  }

  .identity,
  .mail-form,
  .chat {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .wrap,
  .nav-inner {
    width: calc(100% - 1.5rem);
  }

  .cell-grid,
  .toc ol {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: none;
  }
}

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

  .track {
    animation: none;
    width: auto;
    flex-wrap: wrap;
  }

  .marquee {
    overflow: visible;
  }

  .group[aria-hidden="true"] {
    display: none;
  }

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

  .note {
    animation: none !important;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .note {
    animation: arrive 0.75s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  }

  .note:nth-child(2) { animation-delay: 0.08s; }
  .note:nth-child(3) { animation-delay: 0.2s; }
  .note:nth-child(4) { animation-delay: 0.32s; }
  .note:nth-child(5) { animation-delay: 0.44s; }
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateX(36px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
