/* n3rdlabs.dev: brand palette from the pixel-flask logo (brand/n3rdlabs-logo-1280.png). Mint is the
   working accent; amber is reserved for brand flourishes (the 3, bubbles, the @). Geist + Geist Mono
   (self-hosted, OFL) for type; the wordmark itself is an image cut from the logo artwork. */

@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0e100f;
  --bg-raised: #141715;
  --bg-hover: #181c1a;
  --line: #232825;
  --line-strong: #343b37;
  --grid: rgba(237, 230, 211, 0.035);
  --text: #ede6d3;
  --soft: #b0aa9a;
  --dim: #868274;
  --accent: #5cff9d;
  --accent-hover: #b6ffd3;
  --accent-ink: #0e100f;
  --amber: #ffb020;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 24px;
}

body {
  position: relative;
  margin: 0;
  min-height: 100dvh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Film grain. Fixed and non-interactive so it never repaints with scrolling content. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

a {
  color: inherit;
}

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

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -80px;
  z-index: 60;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font: 500 0.875rem/1 var(--mono);
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

/* Graph paper behind the top of the page, fading out toward the edges. */
.grid-bg {
  position: absolute;
  inset: 0 0 auto;
  height: min(1000px, 120vh);
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: center top;
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 68% 30%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse 75% 70% at 68% 30%, #000 15%, transparent 72%);
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 22px;
}

.brand {
  display: inline-flex;
  align-items: flex-end;
  gap: 12px;
  text-decoration: none;
}

/* 2px per logo pixel keeps every cell whole on 1x screens. */
.mark {
  width: 28px;
  height: 38px;
  flex: none;
  overflow: visible;
}

.wordmark {
  display: block;
  width: auto;
  height: 18px;
  margin-bottom: 2px;
}

/* Brand rule: the 3 in n3rdlabs is always amber, wherever the name appears as text. */
.three {
  color: var(--amber);
}

/* The three bubbles rise a pixel at a time and pop, offset so one is always moving. */
.mark .bubble {
  animation: bubble 3s steps(1, end) infinite;
}

.mark .bubble-2 {
  animation-delay: -1s;
}

.mark .bubble-3 {
  animation-delay: -2s;
}

@keyframes bubble {
  0% {
    transform: translateY(0);
    opacity: 1;
  }
  35% {
    transform: translateY(-1px);
    opacity: 1;
  }
  65% {
    transform: translateY(-2px);
    opacity: 1;
  }
  85% {
    transform: translateY(-2px);
    opacity: 0;
  }
}

.nav {
  display: flex;
  gap: clamp(18px, 3vw, 36px);
}

.nav a {
  padding-block: 8px;
  color: var(--soft);
  text-decoration: none;
  font: 500 0.75rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.3s var(--ease);
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-raised);
  box-shadow: inset 0 1px 0 rgba(237, 230, 211, 0.04);
  color: var(--soft);
  font: 500 0.6875rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dot {
  position: relative;
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}

.dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--accent);
  animation: ping 2.4s var(--ease) infinite;
}

@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  70%,
  100% {
    transform: scale(3.2);
    opacity: 0;
  }
}

/* ---------- Shared type ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
  color: var(--dim);
  font: 500 0.75rem/1.2 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 20px;
  height: 1px;
  flex: none;
  background: var(--accent);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  max-width: 13ch;
  font-size: clamp(2.6rem, 6.2vw, 4.75rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

h1 span {
  color: var(--soft);
}

h2 {
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.section-note {
  margin: 0;
  max-width: 46ch;
  color: var(--soft);
  text-wrap: pretty;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: 500 0.9375rem/1 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.3s var(--ease),
    background-color 0.3s var(--ease),
    border-color 0.3s var(--ease),
    color 0.3s var(--ease);
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s var(--ease);
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(237, 230, 211, 0.28);
}

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

.btn-primary:hover svg {
  transform: translateX(3px);
}

.btn-ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--text);
  font: 500 0.875rem/1 var(--mono);
}

.btn-ghost:hover {
  border-color: var(--dim);
  background: var(--bg-raised);
}

/* ---------- Hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: end;
  gap: clamp(40px, 6vw, 88px);
  padding-block: clamp(56px, 9vw, 112px) clamp(64px, 9vw, 112px);
}

.lede {
  margin: 28px 0 0;
  max-width: 54ch;
  color: var(--soft);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-wrap: pretty;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
}

/* Instrument panel on the right of the hero. */
.readout {
  margin-bottom: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(237, 230, 211, 0.025), rgba(237, 230, 211, 0) 40%),
    var(--bg-raised);
  box-shadow:
    inset 0 1px 0 rgba(237, 230, 211, 0.05),
    0 40px 80px -40px rgba(3, 6, 4, 0.9);
  font-family: var(--mono);
}

.readout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.readout-live {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--soft);
}

.readout-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-bottom: 1px solid var(--line);
}

/* Labels can wrap to two lines; pin the numbers to the bottom so they stay on one baseline. */
.readout-stats div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 18px;
}

.readout-stats div + div {
  border-left: 1px solid var(--line);
}

.readout-stats dt {
  color: var(--dim);
  font-size: 0.6875rem;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.readout-stats dd {
  margin: 8px 0 0;
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.scope {
  position: relative;
  height: 112px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background-image:
    linear-gradient(rgba(237, 230, 211, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237, 230, 211, 0.04) 1px, transparent 1px);
  background-size: 100% 28px, 40px 100%;
  background-position: 0 -1px, -1px 0;
}

.scope svg {
  display: block;
  width: 100%;
  height: 100%;
}

.scope-axis {
  stroke: var(--line-strong);
  stroke-dasharray: 3 5;
  vector-effect: non-scaling-stroke;
}

.trace {
  animation: sweep 6s linear infinite;
}

.trace path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

@keyframes sweep {
  to {
    transform: translateX(-200px);
  }
}

.scope-label {
  position: absolute;
  top: 9px;
  left: 12px;
  color: var(--dim);
  font-size: 0.625rem;
  letter-spacing: 0.12em;
}

.readout-bench {
  padding: 14px 0 10px;
}

.readout-sub {
  margin: 0 0 6px;
  padding-inline: 18px;
  color: var(--dim);
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.readout-bench ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.readout-bench li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 7px 18px;
  font-size: 0.8125rem;
}

.readout-bench .code {
  color: var(--dim);
}

/* Status chips: filled dot = live, hollow ring = in progress, square = personal build. */
.st {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  font: 500 0.6875rem/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.st::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: none;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.st-live {
  color: var(--accent);
}

.st-live::before {
  background: currentColor;
}

.st-personal::before {
  border-radius: 1px;
}

/* ---------- Sections ---------- */

.section {
  padding-block: clamp(72px, 10vw, 128px);
}

.section-rule {
  border-top: 1px solid var(--line);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  gap: 24px 48px;
  margin-bottom: clamp(36px, 5vw, 60px);
}

.section-head .section-note {
  justify-self: end;
}

/* ---------- Experiments index ---------- */

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

.exp-list > li {
  border-bottom: 1px solid var(--line);
}

.exp {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 0.9fr) minmax(0, 1.8fr) 13rem;
  grid-template-areas: "code name body meta";
  align-items: start;
  gap: 14px 32px;
  padding: 30px 14px;
  border-radius: 12px;
  text-decoration: none;
  transition:
    background-color 0.35s var(--ease),
    transform 0.3s var(--ease);
}

a.exp:hover {
  background: var(--bg-hover);
}

a.exp:active {
  transform: translateY(1px);
}

.exp-code {
  grid-area: code;
  color: var(--dim);
  font: 500 0.75rem/2.1 var(--mono);
  letter-spacing: 0.06em;
}

.exp-name {
  grid-area: name;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.03em;
  transition: color 0.3s var(--ease);
}

a.exp:hover .exp-name {
  color: var(--accent);
}

.exp-body {
  grid-area: body;
}

.exp-desc {
  display: block;
  max-width: 62ch;
  color: var(--soft);
  text-wrap: pretty;
}

.exp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.exp-tags span {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--dim);
  font: 500 0.6875rem/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.exp-meta {
  grid-area: meta;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  padding-top: 7px;
  text-align: right;
}

.exp-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--soft);
  font: 400 0.8125rem/1.3 var(--mono);
  transition: color 0.3s var(--ease);
}

.exp-go.is-muted {
  color: var(--dim);
}

.exp-go svg {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s var(--ease);
}

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

a.exp:hover .exp-go svg {
  transform: translate(2px, -2px);
}

/* ---------- Lodge spotlight ---------- */

/* Lodge is the flagship, so it gets its own room on the page in its own colours (from the Lodge logo). */
.lodge {
  --plum: #300d2a;
  --plum-deep: #150a13;
  --coral: #fc5933;
  --coral-hover: #ff7655;
  --lodge-cream: #fde7cd;
  padding-block: clamp(72px, 10vw, 128px);
  border-top: 1px solid #2a1525;
  border-bottom: 1px solid #2a1525;
  background:
    radial-gradient(ellipse 60% 70% at 78% 30%, rgba(252, 89, 51, 0.1), transparent 70%),
    linear-gradient(180deg, var(--plum-deep), #110a10);
}

.lodge-inner {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(40px, 6vw, 88px);
}

.lodge-eyebrow {
  color: #b9909f;
}

.lodge-eyebrow::before {
  background: var(--coral);
}

.lodge-title {
  color: var(--lodge-cream);
  font-size: clamp(3rem, 8vw, 5.75rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.lodge-lede {
  margin: 24px 0 0;
  max-width: 56ch;
  color: #d9c3b8;
  font-size: 1.0625rem;
  line-height: 1.65;
  text-wrap: pretty;
}

.lodge-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
}

.lodge-features li {
  padding: 20px 0;
  border-top: 1px solid #3a1d33;
}

.lodge-features h3 {
  color: var(--lodge-cream);
  font-size: 1.0625rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.lodge-features h3::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 10px 2px 0;
  background: var(--coral);
}

.lodge-features p {
  margin: 8px 0 0;
  color: #bfa8a6;
  font-size: 0.9375rem;
  text-wrap: pretty;
}

.lodge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.btn-lodge {
  background: var(--coral);
  color: #22081d;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-lodge:hover {
  background: var(--coral-hover);
}

.btn-lodge:hover svg {
  transform: translateX(3px);
}

.btn-ghost-lodge {
  border-color: #4a2742;
  color: var(--lodge-cream);
}

.btn-ghost-lodge:hover {
  border-color: #7a4a6c;
  background: rgba(48, 13, 42, 0.6);
}

.lodge-art {
  margin: 0;
}

.lodge-frame {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid #3f1d38;
  border-radius: 24px;
  background: radial-gradient(circle at 50% 38%, #4a1640 0%, var(--plum) 62%);
  box-shadow:
    inset 0 1px 0 rgba(253, 231, 205, 0.08),
    0 40px 80px -40px rgba(10, 2, 8, 0.9);
}

.lodge-frame img {
  width: 78%;
  height: auto;
}

.lodge-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.lodge-tags span {
  padding: 6px 9px;
  border: 1px solid #3a1d33;
  border-radius: 6px;
  color: #b9909f;
  font: 500 0.6875rem/1 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lodge-tags .st {
  color: var(--accent);
}

.tag-flagship {
  border-color: rgba(252, 89, 51, 0.5) !important;
  color: #fc8a6c !important;
}

/* ---------- Websites ---------- */

.web {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px clamp(48px, 7vw, 112px);
}

.web-head h2 {
  margin-bottom: 20px;
}

.web-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 32px;
}

.reply-time {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--soft);
  font: 400 0.8125rem/1.5 var(--mono);
}

.web-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.web-list li {
  padding: 24px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.web-num {
  display: block;
  margin-bottom: 18px;
  color: var(--accent);
  font: 500 0.8125rem/1 var(--mono);
  letter-spacing: 0.06em;
}

.web-list h3 {
  font-size: 1.125rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.web-list p {
  margin: 8px 0 0;
  color: var(--soft);
  font-size: 0.9375rem;
  text-wrap: pretty;
}

/* ---------- How the lab runs ---------- */

.section-lab {
  background: linear-gradient(180deg, rgba(237, 230, 211, 0.012), transparent 60%);
}

.lab {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 48px clamp(48px, 7vw, 112px);
}

.lab-head {
  position: sticky;
  top: 40px;
  align-self: start;
}

.lab-head h2 {
  margin-bottom: 20px;
}

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

.principles li {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr);
  gap: 8px 20px;
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.principles li:last-child {
  border-bottom: 1px solid var(--line);
}

.p-num {
  color: var(--accent);
  font: 500 0.8125rem/1.9 var(--mono);
  letter-spacing: 0.06em;
}

.principles h3 {
  font-size: 1.25rem;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.principles p {
  margin: 8px 0 0;
  max-width: 56ch;
  color: var(--soft);
  text-wrap: pretty;
}

/* ---------- Contact ---------- */

.contact {
  padding-block: clamp(80px, 12vw, 160px);
}

.contact-title {
  max-width: 26ch;
  color: var(--soft);
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.mail {
  position: relative;
  display: inline-block;
  margin-top: 28px;
  font: 600 clamp(1.9rem, 7.4vw, 6rem)/1.05 var(--sans);
  letter-spacing: -0.05em;
  text-decoration: none;
  overflow-wrap: anywhere;
}


.mail::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.06em;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}

.mail:hover::after {
  transform: scaleX(1);
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 36px;
}

.copy {
  min-width: 10.5rem;
}

.copy.is-done {
  border-color: var(--accent);
  color: var(--accent);
}

.copy-status {
  margin: 0;
  color: var(--dim);
  font: 400 0.8125rem/1.4 var(--mono);
}

.contact-note {
  margin: 28px 0 0;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 32px;
  padding-block: 28px;
  color: var(--dim);
  font: 400 0.8125rem/1.5 var(--mono);
}

.footer a {
  color: var(--soft);
  text-underline-offset: 3px;
  transition: color 0.3s var(--ease);
}

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

/* ---------- 404 ---------- */

.lost {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: 48px;
  min-height: calc(100dvh - 160px);
  padding-block: 64px;
}

.lost-code {
  color: var(--accent);
  font: 600 clamp(5rem, 16vw, 11rem)/0.9 var(--mono);
  letter-spacing: -0.06em;
}

/* ---------- Motion ---------- */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.rise {
  animation: rise 1s var(--ease) both;
}

.d1 {
  animation-delay: 0.07s;
}

.d2 {
  animation-delay: 0.14s;
}

.d3 {
  animation-delay: 0.21s;
}

/* site.js hides only what starts below the fold, then reveals it on scroll. Without JS everything shows. */
.js [data-reveal]:not(.is-in) {
  opacity: 0;
  transform: translateY(18px);
}

.js [data-reveal] {
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
}

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

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

  .trace,
  .dot::after,
  .mark .bubble {
    animation: none;
  }

  .js [data-reveal]:not(.is-in) {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .exp {
    grid-template-columns: 5.5rem minmax(0, 1fr) auto;
    grid-template-areas:
      "code name meta"
      ". body body";
  }

  .exp-meta {
    flex-direction: row;
    align-items: center;
    gap: 18px;
    padding-top: 6px;
  }
}

/* Five nav links plus the pill stop fitting below this width. */
@media (max-width: 860px) {
  .status-pill {
    display: none;
  }
}

@media (max-width: 900px) {
  .hero,
  .lab,
  .lost,
  .lodge-inner,
  .web {
    grid-template-columns: minmax(0, 1fr);
  }

  .lodge-art {
    max-width: 420px;
  }

  .hero {
    align-items: start;
  }

  .readout {
    max-width: 520px;
  }

  .lab-head {
    position: static;
  }

  .section-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .section-head .section-note {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .status-pill,
  .nav-optional {
    display: none;
  }

  .exp {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "code meta"
      "name name"
      "body body";
    gap: 10px 16px;
    padding: 24px 4px;
  }

  .exp-code {
    line-height: 1.4;
  }

  .exp-meta {
    padding-top: 0;
  }

  .exp-go-label {
    display: none;
  }

  .exp-go.is-muted {
    display: none;
  }

  .readout-stats div {
    padding: 14px 12px;
  }

  .readout-stats dt {
    font-size: 0.625rem;
  }

  .principles li {
    grid-template-columns: minmax(0, 1fr);
    padding: 24px 0;
  }

  .lodge-features,
  .web-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .web-list li {
    padding: 20px;
  }

  .footer-inner {
    flex-direction: column;
  }
}
