:root {
  --paper: #f7f7f5;
  --surface: #ffffff;
  --forest: #35654d;
  --forest-surface: #cfe9da;
  --forest-surface-strong: #b5dcc6;
  --ink: #202522;
  --muted: #66706a;
  --grid: rgba(58, 58, 56, 0.12);
  --grid-strong: rgba(58, 58, 56, 0.28);
  --mint: #63b987;
  --gold: #e5bf50;
  --coral: #e9795d;
  --content: 1200px;
  --page-padding: clamp(1.125rem, 4vw, 2rem);
  --section-space: clamp(4.5rem, 10vw, 7rem);
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans JP", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  font-size: 1rem;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 1rem;
  color: var(--surface);
  background: var(--forest);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  width: min(100% - (var(--page-padding) * 2), var(--content));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--grid-strong);
  background: rgba(247, 247, 245, 0.96);
}

.header-inner {
  display: flex;
  min-height: 4.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--forest);
  font-family: "Space Grotesk", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  color: var(--surface);
  background: var(--forest);
  font:
    700 0.78rem/1 "JetBrains Mono",
    Consolas,
    monospace;
}

.nav-list {
  display: flex;
  margin: 0;
  padding: 0;
  align-items: center;
  gap: clamp(1rem, 2.6vw, 2rem);
  list-style: none;
}

.nav-list a {
  font:
    600 0.72rem/1.2 "JetBrains Mono",
    Consolas,
    monospace;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.nav-list a:hover,
.nav-list a[aria-current="page"] {
  color: var(--forest);
  text-decoration: underline;
}

.menu-button {
  display: none;
  min-width: 2.75rem;
  min-height: 2.75rem;
  border: 1px solid var(--grid-strong);
  color: var(--forest);
  background: transparent;
  font:
    700 0.7rem/1 "JetBrains Mono",
    Consolas,
    monospace;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  padding: 0.72rem 1.2rem;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 1px solid var(--forest);
  color: var(--surface);
  background: var(--forest);
  font-weight: 700;
  text-decoration: none;
  transition:
    color 180ms ease-out,
    background-color 180ms ease-out;
}

.button:hover {
  color: var(--forest);
  background: transparent;
}

.button-secondary {
  color: var(--forest);
  background: transparent;
}

.button-secondary:hover {
  color: var(--surface);
  background: var(--forest);
}

.eyebrow,
.meta,
.status {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 1.5rem;
  color: var(--forest);
  font-weight: 700;
}

.hero {
  border-bottom: 1px solid var(--grid-strong);
}

.hero-grid {
  display: grid;
  min-height: min(48rem, calc(100vh - 4.5rem));
  grid-template-columns: minmax(0, 1.35fr) minmax(20rem, 0.65fr);
}

.hero-copy {
  display: flex;
  padding: clamp(5rem, 11vw, 9rem) clamp(1.5rem, 6vw, 5rem)
    clamp(4rem, 8vw, 7rem) 0;
  flex-direction: column;
  justify-content: center;
}

.hero h1,
.page-hero h1 {
  max-width: 12ch;
  margin: 0;
  color: var(--forest);
  font-family: "Space Grotesk", "Noto Sans JP", sans-serif;
  font-size: clamp(2.7rem, 7vw, 5.5rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.hero-lead {
  max-width: 43rem;
  margin: 2rem 0 0;
  padding-left: 1rem;
  border-left: 1px solid var(--forest);
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.hero-actions {
  display: flex;
  margin-top: 2.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.field-diagram {
  position: relative;
  min-height: 28rem;
  overflow: hidden;
  border-left: 1px solid var(--grid-strong);
  background: var(--forest-surface-strong);
}

.field-diagram::before {
  position: absolute;
  content: "";
  border: 1px solid rgba(53, 101, 77, 0.28);
}

.field-diagram::before {
  inset: 16%;
  border-radius: 50%;
}

.diagram-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(53, 101, 77, 0.12) 1px, transparent 1px) 0 0 /
      100% 50%,
    linear-gradient(90deg, rgba(53, 101, 77, 0.12) 1px, transparent 1px) 0 0 /
      50% 100%;
}

.diagram-node {
  position: absolute;
  width: 0.9rem;
  height: 0.9rem;
  border: 3px solid var(--forest);
  background: var(--mint);
}

.diagram-node:nth-child(1) {
  top: 18%;
  left: 20%;
}
.diagram-node:nth-child(2) {
  top: 48%;
  right: 16%;
  background: var(--gold);
}
.diagram-node:nth-child(3) {
  bottom: 17%;
  left: 34%;
  background: var(--coral);
}
.diagram-label {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  color: var(--forest);
}

.home-page .site-header {
  border-bottom-color: rgba(181, 220, 198, 0.22);
  background: rgba(5, 15, 13, 0.96);
}

.home-page .brand,
.home-page .nav-list a,
.home-page .menu-button {
  color: #edf7f1;
}

.home-page .brand-mark {
  color: #07120e;
  background: #7de0a8;
}

.home-page .nav-list .button {
  border-color: #7de0a8;
  color: #07120e;
  background: #7de0a8;
}

.home-page .nav-list .button:hover {
  color: #7de0a8;
  background: transparent;
}

.cinematic-hero {
  position: relative;
  min-height: max(42rem, calc(100svh - 4.5rem));
  overflow: hidden;
  border-bottom-color: rgba(125, 224, 168, 0.35);
  color: #f4faf6;
  background: #06100d;
  isolation: isolate;
}

.hero-film,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-film {
  z-index: -2;
  object-fit: cover;
  object-position: center;
}

.hero-shade {
  z-index: -1;
  background: rgba(2, 10, 8, 0.46);
}

.cinematic-hero-inner {
  display: grid;
  min-height: max(42rem, calc(100svh - 4.5rem));
  padding-block: clamp(1.5rem, 4vw, 2.5rem);
  grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.6fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 2rem clamp(2rem, 6vw, 6rem);
}

.hero-system-line {
  display: flex;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(197, 236, 214, 0.32);
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: rgba(237, 247, 241, 0.72);
  font: 600 0.65rem/1.4 "JetBrains Mono", Consolas, monospace;
  letter-spacing: 0.12em;
}

.cinematic-copy {
  max-width: 54rem;
  padding-bottom: clamp(1rem, 5vh, 4rem);
  align-self: end;
}

.cinematic-kicker {
  margin: 0 0 1rem;
  color: #8ce8b4;
  font: 700 0.68rem/1.4 "JetBrains Mono", Consolas, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.cinematic-hero h1 {
  max-width: none;
  margin: 0;
  color: #f4faf6;
  font-family: "Space Grotesk", "Arial Narrow", Arial, sans-serif;
  font-size: clamp(4.3rem, 12vw, 9.5rem);
  font-weight: 650;
  line-height: 0.82;
  letter-spacing: -0.075em;
  text-shadow: 0 0.15rem 1.5rem rgba(0, 0, 0, 0.32);
}

.cinematic-statement {
  margin: clamp(1.5rem, 4vw, 2.5rem) 0 0;
  color: #f4faf6;
  font-size: clamp(1.45rem, 3vw, 2.4rem);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: -0.035em;
}

.cinematic-lead {
  max-width: 36rem;
  margin: 1rem 0 0;
  color: rgba(237, 247, 241, 0.76);
  font-size: 0.95rem;
  line-height: 1.8;
}

.cinematic-actions {
  margin-top: 1.75rem;
  align-items: center;
}

.cinematic-button {
  border-color: #7de0a8;
  color: #07120e;
  background: #7de0a8;
}

.cinematic-button:hover {
  color: #9af1c0;
  background: rgba(7, 18, 14, 0.6);
}

.cinematic-text-link {
  min-height: 3rem;
  padding: 0.72rem 0.6rem;
  color: #edf7f1;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-underline-offset: 0.35em;
}

.hero-console {
  width: min(100%, 20rem);
  margin-bottom: clamp(1rem, 5vh, 4rem);
  padding: 1rem 1.1rem;
  border: 1px solid rgba(197, 236, 214, 0.34);
  background: rgba(5, 17, 13, 0.68);
  align-self: end;
  justify-self: end;
}

.hero-console p {
  display: flex;
  margin: 0;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(197, 236, 214, 0.16);
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font: 600 0.63rem/1.4 "JetBrains Mono", Consolas, monospace;
  letter-spacing: 0.08em;
}

.hero-console p:last-child {
  border-bottom: 0;
}

.hero-console span {
  color: rgba(237, 247, 241, 0.55);
}

.hero-console strong {
  color: #edf7f1;
  font-weight: 700;
}

.hero-console .hero-status {
  color: #8ce8b4;
}

.hero-side-stack {
  display: grid;
  width: min(100%, 20rem);
  margin-bottom: clamp(1rem, 5vh, 4rem);
  align-self: end;
  justify-self: end;
  gap: 0.75rem;
}

.hero-side-stack .hero-console {
  width: 100%;
  margin-bottom: 0;
}

.signal-counter,
.morph-counter {
  display: grid;
  min-height: 8.7rem;
  padding: 1.15rem 1.3rem;
  border: 0;
  color: #edf7f1;
  background: rgba(3, 12, 8, 0.74);
  text-align: left;
}

.signal-counter {
  cursor: pointer;
  transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.signal-counter:hover {
  background: rgba(10, 31, 20, 0.94);
  box-shadow: 0 1rem 2.4rem rgba(0, 0, 0, 0.3);
  transform: translateY(-0.25rem);
}

.signal-counter span,
.signal-counter small,
.morph-counter span,
.morph-counter small,
.beacon-heading span,
.signal-origin span,
.signal-origin small {
  color: #9af1c0;
  font: 700 0.65rem/1.3 "JetBrains Mono", Consolas, monospace;
  letter-spacing: 0.13em;
}

.signal-counter span,
.morph-counter span {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.signal-counter i,
.morph-counter i {
  width: 0.48rem;
  height: 0.48rem;
  background: #9af1c0;
  box-shadow: 0 0 1.1rem rgba(154, 241, 192, 0.92);
}

.signal-counter strong,
.morph-counter strong,
.signal-origin strong {
  color: #a9efc5;
  font: 500 clamp(2.2rem, 4vw, 3.55rem)/1 Consolas, monospace;
  letter-spacing: 0.07em;
}

.signal-counter small,
.morph-counter small {
  justify-self: end;
  color: #d8e3db;
}

.signal-counter[data-signal-state="online"] small { color: #9af1c0; }
.signal-counter[data-signal-state="offline"] small { color: #f0c66c; }
.signal-counter[data-signal-state="preview"] small { color: rgba(237, 247, 241, 0.58); }

.beacon-is-open {
  overflow: hidden;
}

.beacon-dimmer {
  position: fixed;
  z-index: 98;
  inset: 0;
  background: #020604;
  pointer-events: none;
  opacity: 0;
  transition: opacity 360ms ease-out;
}

.beacon-dimmer.is-opening,
.beacon-dimmer.is-open {
  opacity: 0.88;
}

.beacon-dimmer.is-closing {
  opacity: 0;
  transition: opacity 620ms 100ms ease-in;
}

.beacon-overlay {
  position: fixed;
  z-index: 99;
  inset: 0;
  display: grid;
  min-height: 100dvh;
  padding: clamp(1.5rem, 4vw, 4rem);
  grid-template: auto minmax(0, 1fr) auto / minmax(0, 1fr) auto;
  gap: 1.5rem;
  overflow-x: hidden;
  overflow-y: auto;
  color: #edf7f1;
  background: #06100c;
  isolation: isolate;
  clip-path: inset(var(--origin-top) var(--origin-right) var(--origin-bottom) var(--origin-left) round 2px);
  transition: clip-path 980ms cubic-bezier(0.32, 0, 0.2, 1);
  will-change: clip-path;
}

.beacon-overlay[hidden],
.beacon-dimmer[hidden] {
  display: none;
}

.beacon-overlay.is-opening,
.beacon-overlay.is-open {
  clip-path: inset(0 0 0 0 round 0);
}

.beacon-overlay.is-closing {
  pointer-events: none;
  clip-path: inset(var(--origin-top) var(--origin-right) var(--origin-bottom) var(--origin-left) round 2px);
  transition-duration: 680ms;
  transition-timing-function: cubic-bezier(0.55, 0.02, 0.82, 0.32);
}

.beacon-overlay:focus-visible { outline: none; }

.beacon-backdrop {
  position: absolute;
  z-index: -2;
  inset: 0;
  background-image: linear-gradient(rgba(2, 12, 8, 0.7), rgba(2, 12, 8, 0.84)), url("/assets/media/luckyfields-materializing-field-poster.jpg");
  background-position: center;
  background-size: cover;
}

.morph-counter {
  position: fixed;
  z-index: 8;
  top: var(--origin-top);
  left: var(--origin-left);
  width: var(--origin-width);
  height: var(--origin-height);
  background: rgba(10, 31, 20, 0.96);
  box-shadow: 0 0 2.6rem rgba(169, 231, 185, 0.22);
  pointer-events: none;
  opacity: 1;
  transform: scale(1);
  transition: opacity 620ms 80ms ease-out, transform 620ms 80ms ease-out;
}

.beacon-overlay:is(.is-opening, .is-open) .morph-counter { opacity: 0; transform: scale(1.035); }
.beacon-overlay.is-closing .morph-counter { opacity: 1; transform: scale(1); transition: opacity 540ms 80ms ease-in, transform 540ms 80ms ease-in; }

.beacon-heading,
.signal-origin,
.globe-shell,
.region-strip,
.beacon-controls {
  opacity: 0;
  transform: translateY(1.1rem) scale(0.98);
  transition: opacity 520ms 330ms ease-out, transform 520ms 330ms ease-out;
}

.beacon-overlay:is(.is-opening, .is-open) :is(.beacon-heading, .signal-origin, .globe-shell, .region-strip, .beacon-controls) { opacity: 1; transform: translateY(0) scale(1); }
.beacon-overlay.is-closing :is(.beacon-heading, .signal-origin, .globe-shell, .region-strip, .beacon-controls) { opacity: 0; transform: translateY(0.6rem) scale(0.985); transition: opacity 240ms ease-in, transform 240ms ease-in; }

.beacon-heading { grid-column: 1; }
.beacon-heading p { margin: 0 0 0.5rem; font: 700 clamp(1.7rem, 3vw, 3rem)/1.1 "Space Grotesk", Arial, sans-serif; letter-spacing: 0.03em; }
.beacon-stage { position: relative; display: grid; min-height: 0; grid-column: 1 / -1; grid-template-columns: minmax(12rem, 0.5fr) minmax(22rem, 1.4fr) minmax(5rem, 0.25fr); align-items: center; }
.signal-origin { position: relative; z-index: 2; display: grid; width: min(17rem, 100%); padding: 1.2rem 1.35rem; border: 1px solid rgba(169, 231, 185, 0.27); background: rgba(5, 14, 10, 0.82); }
.signal-origin small { margin-top: 0.7rem; color: rgba(237, 247, 241, 0.6); }
.globe-shell { position: relative; width: min(64vh, 41rem); max-width: 100%; justify-self: center; aspect-ratio: 1; }
.beacon-globe { position: relative; z-index: 1; width: 100%; height: 100%; cursor: grab; contain: layout paint size; touch-action: none; }
.beacon-globe:active { cursor: grabbing; }
.beacon-pulse { position: absolute; z-index: 0; inset: 8%; border: 1px solid rgba(154, 241, 192, 0.18); border-radius: 50%; box-shadow: 0 0 3rem rgba(154, 241, 192, 0.16), inset 0 0 3rem rgba(154, 241, 192, 0.1); pointer-events: none; animation: beacon-breathe 3.2s ease-in-out infinite; }
.beacon-pulse.is-paused { animation-play-state: paused; }
.region-strip { display: grid; margin: 0; padding: 0; grid-column: 1; grid-template-columns: repeat(5, 1fr); border: 1px solid rgba(169, 231, 185, 0.27); background: rgba(5, 14, 10, 0.82); }
.region-strip div { display: flex; min-height: 4rem; padding: 0.9rem 1rem; align-items: center; justify-content: center; gap: 0.7rem; }
.region-strip div + div { border-left: 1px solid rgba(169, 231, 185, 0.27); }
.region-strip dt,.region-strip dd { margin: 0; color: #9af1c0; font: 700 0.72rem/1.2 "JetBrains Mono", Consolas, monospace; letter-spacing: 0.07em; }
.beacon-controls { display: flex; grid-column: 2; grid-row: 3; gap: 0.7rem; }
.beacon-controls button { min-width: 7rem; min-height: 4rem; padding: 0.9rem 1.2rem; border: 1px solid rgba(169, 231, 185, 0.27); color: #edf7f1; background: rgba(5, 14, 10, 0.82); font: 700 0.72rem/1 "JetBrains Mono", Consolas, monospace; letter-spacing: 0.12em; cursor: pointer; }
.beacon-controls button:hover { border-color: #9af1c0; color: #9af1c0; }
.beacon-controls button:disabled { cursor: default; }

@keyframes beacon-breathe { 0%,100% { opacity: 0.48; transform: scale(0.985); } 45% { opacity: 1; transform: scale(1.015); } }

.film-controls {
  display: flex;
  grid-column: 2;
  align-items: center;
  justify-self: end;
  gap: 0.5rem;
}

.film-control {
  display: inline-flex;
  min-height: 2.4rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(197, 236, 214, 0.34);
  color: #edf7f1;
  background: rgba(5, 17, 13, 0.68);
  cursor: pointer;
  align-items: center;
  font: 700 0.62rem/1 "JetBrains Mono", Consolas, monospace;
  letter-spacing: 0.1em;
}

.film-control:hover,
.film-control[aria-pressed="true"] {
  border-color: #8ce8b4;
  color: #8ce8b4;
}

.section {
  padding-block: var(--section-space);
  border-bottom: 1px solid var(--grid-strong);
}

.section-heading {
  display: grid;
  margin-bottom: 3rem;
  grid-template-columns: minmax(0, 0.45fr) minmax(0, 1fr);
  gap: 2rem;
}

.section-heading h2,
.page-section h2 {
  margin: 0;
  color: var(--forest);
  font-family: "Space Grotesk", "Noto Sans JP", sans-serif;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.section-heading p {
  max-width: 44rem;
  margin: 0;
  color: var(--muted);
}

.bento {
  display: grid;
  border: 1px solid var(--grid-strong);
  background: var(--grid-strong);
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
}

.card {
  min-height: 19rem;
  padding: clamp(1.5rem, 4vw, 2rem);
  background: var(--paper);
}

.card-number {
  color: var(--muted);
}

.card h3 {
  margin: 3.5rem 0 1rem;
  color: var(--forest);
  font-size: 1.45rem;
}

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

.feature-grid {
  display: grid;
  border: 1px solid var(--grid-strong);
  background: var(--grid-strong);
  grid-template-columns: 1fr 1fr;
  gap: 1px;
}

.feature-panel {
  min-height: 22rem;
  padding: clamp(1.75rem, 5vw, 3rem);
  background: var(--surface);
}

.feature-panel h3 {
  max-width: 14ch;
  margin: 3rem 0 1rem;
  color: var(--forest);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1.2;
}

.status {
  display: inline-flex;
  padding: 0.35rem 0.7rem;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--grid-strong);
  font-weight: 700;
}

.status::before {
  width: 0.5rem;
  height: 0.5rem;
  background: var(--gold);
  content: "";
}

.status-live::before {
  background: var(--mint);
}

.directory-hero {
  padding-block: clamp(2.75rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--grid-strong);
}

.directory-hero h1 {
  margin: 0;
  color: var(--forest);
  font-family: "Space Grotesk", "Noto Sans JP", sans-serif;
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.directory-hero p:not(.eyebrow) {
  margin: 1rem 0 0;
  color: var(--muted);
}

.directory-section {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  border-bottom: 1px solid var(--grid-strong);
}

.directory-toolbar {
  display: flex;
  margin-bottom: 1.5rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.directory-toolbar > .meta {
  margin: 0;
  color: var(--muted);
}

.demo-direct-links {
  display: grid;
  margin: 0 0 1.5rem;
  border-top: 1px solid var(--grid-strong);
  grid-template-columns: minmax(10rem, 0.7fr) repeat(2, minmax(0, 1fr));
}

.demo-direct-links > * {
  min-height: 4.25rem;
  border-right: 1px solid var(--grid-strong);
  border-bottom: 1px solid var(--grid-strong);
}

.demo-direct-links > .meta {
  display: flex;
  margin: 0;
  padding: 1rem;
  align-items: center;
  border-left: 1px solid var(--grid-strong);
  color: var(--muted);
}

.demo-direct-links a {
  display: grid;
  padding: 0.8rem 1rem;
  color: var(--forest);
  text-decoration: none;
  grid-template-columns: 1fr auto;
  align-content: center;
}

.demo-direct-links a:hover,
.demo-direct-links a:focus-visible {
  color: var(--ink);
  background: var(--forest-surface);
}

.demo-direct-links a span { font-weight: 800; }
.demo-direct-links a small { color: var(--muted); grid-column: 1; }
.demo-direct-links a b { grid-column: 2; grid-row: 1 / 3; align-self: center; font-weight: 400; }

.filter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  min-height: 2.35rem;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--grid-strong);
  color: var(--forest);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}

.filter-chip[aria-pressed="true"] {
  color: var(--surface);
  background: var(--forest);
}

.filter-chip:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.45;
}

.filter-chip span {
  margin-left: 0.3rem;
  font-family: "JetBrains Mono", Consolas, monospace;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.showcase-gallery {
  position: relative;
  min-height: clamp(31rem, 62vw, 42rem);
  overflow: hidden;
  border: 1px solid var(--grid-strong);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.92), transparent 42%),
    linear-gradient(145deg, #dff3e8 0%, #f5f1df 52%, #f7dcd4 100%);
  isolation: isolate;
  perspective: 1200px;
}

.showcase-gallery::before {
  position: absolute;
  z-index: -1;
  right: -18%;
  bottom: -55%;
  left: -18%;
  height: 80%;
  border: 1px solid rgba(53, 101, 77, 0.18);
  border-radius: 50%;
  background:
    repeating-radial-gradient(
      ellipse at center,
      transparent 0 3rem,
      rgba(53, 101, 77, 0.1) 3rem calc(3rem + 1px)
    );
  content: "";
  transform: rotateX(68deg);
  transform-origin: center bottom;
}

.gallery-atmosphere span {
  position: absolute;
  z-index: -1;
  width: clamp(5rem, 11vw, 9rem);
  aspect-ratio: 1;
  border: 1px solid rgba(53, 101, 77, 0.22);
  border-radius: 50%;
  animation: gallery-drift 9s ease-in-out infinite alternate;
}

.gallery-atmosphere span:nth-child(1) {
  top: 12%;
  left: 7%;
}

.gallery-atmosphere span:nth-child(2) {
  top: 20%;
  right: 9%;
  width: clamp(3rem, 7vw, 5rem);
  animation-delay: -3s;
}

.gallery-atmosphere span:nth-child(3) {
  right: 17%;
  bottom: 10%;
  width: clamp(2rem, 4vw, 3.5rem);
  background: rgba(229, 191, 80, 0.18);
  animation-delay: -6s;
}

.gallery-viewport {
  min-height: inherit;
  perspective: 1200px;
}

.gallery-track {
  position: relative;
  min-height: inherit;
  transform-style: preserve-3d;
}

.gallery-card {
  --gallery-offset: 0;
  --gallery-distance: 0;
  --gallery-tilt-x: 0deg;
  --gallery-tilt-y: 0deg;
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: min(76rem, calc(100% - clamp(2rem, 8vw, 7rem)));
  min-height: clamp(23rem, 45vw, 31rem);
  overflow: hidden;
  border: 1px solid rgba(53, 101, 77, 0.38);
  background: rgba(255, 255, 255, 0.86);
  box-shadow:
    0 2rem 5rem rgba(32, 37, 34, calc(0.16 - var(--gallery-distance) * 0.04)),
    inset 0 1px rgba(255, 255, 255, 0.8);
  grid-template-columns: minmax(16rem, 0.85fr) minmax(20rem, 1.15fr);
  opacity: calc(1 - var(--gallery-distance) * 0.28);
  transform:
    translate3d(
      calc(-50% + var(--gallery-offset) * 62%),
      -50%,
      calc(var(--gallery-distance) * -16rem)
    )
    rotateX(var(--gallery-tilt-x)) rotateY(var(--gallery-tilt-y));
  transition:
    transform 650ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 400ms ease,
    box-shadow 400ms ease;
  transform-style: preserve-3d;
}

.gallery-card:not(.is-active) {
  pointer-events: none;
}

.gallery-visual {
  position: relative;
  display: flex;
  min-height: 100%;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  overflow: hidden;
  border-right: 1px solid rgba(53, 101, 77, 0.28);
  background: var(--forest);
  flex-direction: column;
  justify-content: space-between;
}

.gallery-visual::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 25% 100%;
  content: "";
}

.gallery-index {
  position: relative;
  color: var(--forest-surface);
  font: 700 clamp(2.5rem, 6vw, 5rem)/1 "Space Grotesk", Arial, sans-serif;
  letter-spacing: -0.08em;
}

.gallery-visual > p {
  position: relative;
  margin: 0;
  color: var(--forest-surface);
  font: 600 0.68rem/1.4 "JetBrains Mono", Consolas, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.inventory-visual {
  position: relative;
  display: grid;
  width: min(100%, 18rem);
  margin: auto;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.55rem;
  transform: rotateX(58deg) rotateZ(-30deg);
  transform-style: preserve-3d;
}

.inventory-visual span {
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: var(--forest-surface-strong);
  box-shadow: 0.35rem 0.55rem 0 rgba(20, 49, 34, 0.48);
}

.inventory-visual span:nth-child(3n + 1) {
  background: var(--mint);
}

.inventory-visual span:nth-child(5n) {
  background: var(--gold);
}

.reports-gallery-visual {
  background: #356e83;
}

.reports-visual {
  position: relative;
  width: min(100%, 18rem);
  height: 12rem;
  margin: auto;
  perspective: 45rem;
  transform: rotateX(8deg) rotateY(-12deg);
  transform-style: preserve-3d;
}

.reports-visual span {
  position: absolute;
  inset: 0.9rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background:
    linear-gradient(#356e83 0 0) 1.4rem 1.35rem / 38% 0.45rem no-repeat,
    repeating-linear-gradient(
      to bottom,
      transparent 0 1.55rem,
      rgba(53, 110, 131, 0.2) 1.55rem 1.62rem
    ),
    #f8fbfc;
  box-shadow: 0.7rem 1rem 1.5rem rgba(16, 51, 64, 0.28);
  transform: translate3d(-1.1rem, -0.7rem, -2rem) rotateZ(-6deg);
}

.reports-visual span:nth-child(2) {
  transform: translate3d(0.1rem, 0.2rem, 0) rotateZ(1deg);
}

.reports-visual span:nth-child(3) {
  background:
    linear-gradient(var(--coral) 0 0) 1.4rem 1.35rem / 38% 0.45rem no-repeat,
    repeating-linear-gradient(
      to bottom,
      transparent 0 1.55rem,
      rgba(53, 110, 131, 0.2) 1.55rem 1.62rem
    ),
    #fff;
  transform: translate3d(1.2rem, 1.1rem, 2rem) rotateZ(7deg);
}

.gallery-copy {
  display: flex;
  padding: clamp(1.5rem, 4vw, 3rem);
  flex-direction: column;
}

.gallery-card-body {
  margin-block: auto;
  padding-block: 2rem;
}

.gallery-kicker {
  margin: 0 0 0.8rem;
  color: var(--coral);
  font: 700 0.7rem/1.4 "JetBrains Mono", Consolas, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery-card-body h2 {
  margin: 0;
  color: var(--forest);
  font-family: "Space Grotesk", "Noto Sans JP", sans-serif;
  font-size: clamp(2rem, 4.2vw, 3.7rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.gallery-card-body > p:not(.gallery-kicker) {
  max-width: 35rem;
  margin: 1.25rem 0 0;
  color: var(--muted);
}

.gallery-card-footer {
  display: grid;
  padding-top: 1.25rem;
  border-top: 1px solid var(--grid);
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.gallery-link {
  display: inline-flex;
  min-height: 2.8rem;
  padding: 0.6rem 1rem;
  align-items: center;
  justify-content: center;
  color: var(--surface);
  background: var(--forest);
  font-weight: 700;
  text-decoration: none;
  gap: 0.5rem;
}

.gallery-link:hover {
  background: #254c39;
}

.gallery-controls {
  position: absolute;
  z-index: 5;
  right: 1.25rem;
  bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gallery-controls[hidden] {
  display: none;
}

.gallery-controls p {
  min-width: 5rem;
  margin: 0;
  color: var(--forest);
  text-align: center;
}

.gallery-controls button {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--forest);
  color: var(--forest);
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
  place-items: center;
}

.showcase-gallery[data-empty="true"] {
  display: none;
}

@keyframes gallery-drift {
  from {
    transform: translate3d(0, -0.4rem, 0);
  }
  to {
    transform: translate3d(0.8rem, 0.8rem, 0);
  }
}

.catalog-card {
  display: flex;
  min-height: 20rem;
  padding: 1.35rem;
  border: 1px solid var(--grid-strong);
  background: var(--surface);
  flex-direction: column;
}

.showcase-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.showcase-card-header .meta {
  color: var(--muted);
}

.catalog-card-body {
  margin-top: 2.25rem;
}

.catalog-card-body h2 {
  margin: 0;
  color: var(--forest);
  font-family: "Space Grotesk", "Noto Sans JP", sans-serif;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.catalog-card-body > p {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.catalog-tags {
  display: flex;
  margin: 1.25rem 0 0;
  padding: 0;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
}

.catalog-tags li {
  padding: 0.2rem 0.55rem;
  background: var(--forest-surface);
  color: var(--forest);
  font-size: 0.75rem;
}

.catalog-card-footer {
  display: grid;
  margin-top: auto;
  padding-top: 1.75rem;
  border-top: 1px solid var(--grid);
  gap: 0.65rem;
}

.catalog-card-footer .text-link {
  margin-top: 0;
}

.catalog-domain {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.catalog-empty {
  margin: 0;
  padding: 2rem;
  border: 1px dashed var(--grid-strong);
  color: var(--muted);
  text-align: center;
}

.text-link {
  display: inline-flex;
  margin-top: 2rem;
  color: var(--forest);
  font-weight: 700;
  gap: 0.5rem;
}

.page-hero {
  padding-block: clamp(5rem, 11vw, 8rem);
  border-bottom: 1px solid var(--grid-strong);
}

.page-hero p:not(.eyebrow) {
  max-width: 48rem;
  margin: 2rem 0 0;
  color: var(--muted);
  font-size: 1.1rem;
}

.page-section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  border-bottom: 1px solid var(--grid-strong);
}

.content-grid {
  display: grid;
  margin-top: 2.5rem;
  border: 1px solid var(--grid-strong);
  background: var(--grid-strong);
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
}

.content-block {
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--surface);
}

.content-block h3 {
  margin-top: 0;
  color: var(--forest);
}

.prose {
  max-width: 48rem;
}

.prose h2 {
  margin-top: 3rem;
  color: var(--forest);
  font-size: 1.65rem;
}

.prose ul {
  padding-left: 1.4rem;
}

.notice {
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--gold);
  background: rgba(229, 191, 80, 0.12);
}

.site-footer {
  padding-block: 3rem;
  color: var(--ink);
  background: var(--forest-surface);
}

.site-footer .brand {
  color: var(--forest);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 2rem;
}

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

.footer-links a {
  color: inherit;
}

.copyright {
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.copyright a {
  color: inherit;
  text-decoration-color: transparent;
  text-underline-offset: 0.25em;
}

.copyright a:hover {
  text-decoration-color: currentColor;
}

/* Home resolves the cinematic opening with one compact contact signal. */
.home-contact-strip {
  border-bottom: 1px solid rgba(181, 220, 198, 0.2);
  color: #eef8f1;
  background: #07100d;
}

.home-contact-inner {
  display: grid;
  min-height: 13rem;
  align-items: center;
  grid-template-columns: minmax(10rem, 0.75fr) minmax(20rem, 1.8fr) auto;
  gap: clamp(1.5rem, 4vw, 5rem);
}

.home-contact-inner .eyebrow {
  margin: 0;
  color: rgba(238, 248, 241, 0.58);
}

.home-contact-inner h2 {
  margin: 0;
  color: #f4faf6;
  font-size: clamp(1.65rem, 3vw, 2.75rem);
}

.home-contact-inner div p {
  margin: 0.65rem 0 0;
  color: rgba(238, 248, 241, 0.66);
}

.home-contact-button {
  min-width: 9.5rem;
  justify-content: space-between;
  border-color: #9ee7b8;
  color: #07100d;
  background: #9ee7b8;
}

.home-contact-button:hover {
  color: #07100d;
  background: #c4f3d4;
}

/* Contact continues the cinematic surface below its opening section. */
.contact-page main > .page-section {
  border-bottom-color: rgba(181, 220, 198, 0.2);
  color: #eef8f1;
  background: #07100d;
}

.contact-page .page-section h2,
.contact-page .content-block h3 {
  color: #f4faf6;
}

.contact-page .page-section p,
.contact-page .content-block li {
  color: rgba(238, 248, 241, 0.66);
}

.contact-page .content-grid {
  border-color: rgba(181, 220, 198, 0.22);
  background: rgba(181, 220, 198, 0.22);
}

.contact-page .content-block {
  background: #101e19;
}

.contact-page .notice a:not(.button) {
  color: #9ee7b8;
}

.contact-page .button {
  border-color: #9ee7b8;
  color: #07100d;
  background: #9ee7b8;
}

.contact-page .button:hover {
  color: #07100d;
  background: #c4f3d4;
}

.contact-page .notice {
  border-left-color: #e5bf50;
  background: #101e19;
}

.home-page .site-footer,
.contact-page .site-footer {
  border-top: 1px solid rgba(181, 220, 198, 0.2);
  color: #eef8f1;
  background: #09130f;
}

.home-page .site-footer .brand,
.contact-page .site-footer .brand {
  color: #c9f1d7;
}

.home-page .site-footer .brand-mark,
.contact-page .site-footer .brand-mark {
  color: #07100d;
  background: #9ee7b8;
}

.home-page .site-footer .copyright,
.contact-page .site-footer .copyright {
  color: rgba(238, 248, 241, 0.58);
}

@media (max-width: 800px) {
  .home-contact-inner {
    min-height: 0;
    padding-top: 2.75rem;
    padding-bottom: 2.75rem;
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .home-contact-button {
    min-width: min(100%, 11rem);
    justify-self: start;
  }
  .menu-button {
    display: inline-grid;
    place-items: center;
  }
  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    right: 0;
    left: 0;
    display: none;
    padding: 1rem var(--page-padding) 1.5rem;
    border-bottom: 1px solid var(--grid-strong);
    background: var(--paper);
  }
  .home-page .site-nav {
    border-bottom-color: rgba(181, 220, 198, 0.22);
    background: #081511;
  }
  .site-nav[data-open="true"] {
    display: block;
  }
  .nav-list {
    align-items: stretch;
    flex-direction: column;
  }
  .nav-list a {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
  }
  .hero-grid {
    min-height: auto;
    grid-template-columns: 1fr;
  }
  .cinematic-hero,
  .cinematic-hero-inner {
    min-height: max(43rem, calc(100svh - 4.5rem));
  }
  .cinematic-hero-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 1.25rem;
  }
  .hero-system-line span:last-child {
    display: none;
  }
  .cinematic-copy {
    padding-bottom: 0;
  }
  .hero-console {
    width: 100%;
    margin-bottom: 0;
    grid-row: 3;
    justify-self: stretch;
  }
  .hero-side-stack { width: 100%; margin-bottom: 0; grid-row: 3; justify-self: stretch; }
  .hero-side-stack .hero-console { grid-row: auto; }
  .signal-counter { min-height: 7.6rem; }
  .demo-direct-links { grid-template-columns: 1fr 1fr; }
  .demo-direct-links > .meta { grid-column: 1 / -1; min-height: 2.8rem; }
  .film-controls {
    grid-column: 1;
    grid-row: 4;
  }
  .hero-copy {
    padding-right: 0;
  }
  .field-diagram {
    min-height: 23rem;
    border-top: 1px solid var(--grid-strong);
    border-left: 0;
  }
  .section-heading {
    grid-template-columns: 1fr;
  }
  .bento {
    grid-template-columns: 1fr;
  }
  .card {
    min-height: auto;
  }
  .card h3 {
    margin-top: 2rem;
  }
  .feature-grid,
  .content-grid {
    grid-template-columns: 1fr;
  }
  .directory-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .showcase-gallery {
    min-height: 46rem;
  }
  .gallery-card {
    width: calc(100% - 2rem);
    min-height: 40rem;
    grid-template-columns: 1fr;
  }
  .gallery-visual {
    min-height: 14rem;
    border-right: 0;
    border-bottom: 1px solid rgba(53, 101, 77, 0.28);
  }
  .inventory-visual {
    position: absolute;
    top: 50%;
    right: 8%;
    width: 11rem;
    margin: 0;
    transform: translateY(-50%) rotateX(58deg) rotateZ(-30deg);
  }
  .gallery-card-footer {
    grid-template-columns: 1fr;
  }
  .gallery-controls {
    right: 50%;
    bottom: 0.2rem;
    transform: translateX(50%);
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .demo-direct-links { grid-template-columns: 1fr; }
  .demo-direct-links > .meta { grid-column: auto; }
}

@media (max-width: 820px) {
  .beacon-overlay { padding: 1.25rem; grid-template: auto auto auto auto / 1fr; }
  .beacon-stage { min-height: 0; grid-template-columns: 1fr; }
  .signal-origin { position: absolute; z-index: 3; bottom: 0; left: 0; width: 12rem; }
  .signal-origin strong { font-size: 2.25rem; }
  .globe-shell { width: min(88vw, 32rem); }
  .region-strip { grid-template-columns: 1fr 1fr; }
  .region-strip div + div { border-left: 0; }
  .region-strip div:nth-child(even) { border-left: 1px solid rgba(169, 231, 185, 0.27); }
  .region-strip div:nth-child(n + 3) { border-top: 1px solid rgba(169, 231, 185, 0.27); }
  .region-strip div:last-child { grid-column: 1 / -1; }
  .beacon-controls { grid-column: 1; grid-row: 4; justify-self: end; }
}

@media (max-width: 560px) {
  .cinematic-hero h1 {
    font-size: clamp(3.7rem, 21vw, 6.1rem);
  }
  .cinematic-lead {
    max-width: 28rem;
    font-size: 0.88rem;
  }
  .hero-console p:nth-child(2) {
    display: none;
  }
  .catalog-grid {
    grid-template-columns: 1fr;
  }
  .showcase-gallery {
    min-height: 42rem;
  }
  .gallery-card {
    width: calc(100% - 1.5rem);
    min-height: 34rem;
    transform: translate3d(-50%, -50%, 0);
  }
  .gallery-card:not(.is-active) {
    visibility: hidden;
    opacity: 0;
  }
  .gallery-copy {
    padding: 1rem;
  }
  .gallery-card-body {
    padding-block: 1rem;
  }
  .gallery-card-body h2 {
    font-size: 2rem;
  }
  .gallery-visual {
    min-height: 10rem;
  }
  .inventory-visual {
    right: 5%;
    width: 9rem;
  }
  .reports-visual {
    position: absolute;
    top: 50%;
    right: 5%;
    width: 9rem;
    height: 7rem;
    margin: 0;
    transform: translateY(-50%) rotateX(8deg) rotateY(-12deg);
  }
  .gallery-controls {
    bottom: 0.75rem;
  }
  .catalog-domain {
    display: none;
  }
}

@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;
  }
  .gallery-card {
    transform:
      translate3d(calc(-50% + var(--gallery-offset) * 62%), -50%, 0);
  }
}

/* Spatial chapter system: Works, Gallery, Apps, About */
.chapter-page {
  --chapter-night: #07100d;
  --chapter-panel: rgba(8, 17, 14, 0.92);
  --chapter-line: rgba(181, 220, 198, 0.32);
  --chapter-mint: #9ee7b8;
}

.chapter-page .site-header {
  border-bottom-color: rgba(181, 220, 198, 0.2);
  color: #eef8f1;
  background: rgba(7, 16, 13, 0.96);
}

.chapter-page .site-header .brand,
.chapter-page .site-header .nav-list a:not(.button) {
  color: #eef8f1;
}

.chapter-page .site-header .brand-mark,
.chapter-page .site-header .button {
  color: #07100d;
  background: var(--chapter-mint);
}

.chapter-page .site-header .nav-list a[aria-current="page"] {
  color: var(--chapter-mint);
}

.chapter-page .menu-button {
  border-color: var(--chapter-line);
  color: #eef8f1;
}

.chapter-hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(38rem, 72vw, 49rem);
  overflow: hidden;
  color: #eef8f1;
  background-color: var(--chapter-night);
  background-position: center;
  background-size: cover;
}

.chapter-hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: rgba(3, 9, 7, 0.42);
  content: "";
}

.chapter-hero::after {
  position: absolute;
  z-index: 0;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--chapter-mint);
  box-shadow: 0 0 1.5rem rgba(158, 231, 184, 0.7);
  content: "";
}

.chapter-hero-works { background-image: url("/assets/media/chapters/works.webp"); }
.chapter-hero-gallery { background-image: url("/assets/media/chapters/gallery.webp"); }
.chapter-hero-apps { background-image: url("/assets/media/chapters/apps.webp"); }
.chapter-hero-about { background-image: url("/assets/media/chapters/about.webp"); }

.chapter-stage {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: clamp(38rem, 72vw, 49rem);
  padding-block: clamp(3rem, 8vw, 6rem);
  align-items: center;
  grid-template-columns: minmax(8rem, 0.42fr) minmax(24rem, 1fr) minmax(11rem, 0.38fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  perspective: 1200px;
}

.chapter-stage::before,
.chapter-stage::after {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(181, 220, 198, 0.12);
  content: "";
  pointer-events: none;
}

.chapter-stage::before {
  inset: 8% 5% 8% 13%;
}

.chapter-stage::after {
  inset: 13% 1% 4% 18%;
  border-color: rgba(181, 220, 198, 0.08);
}

.chapter-number {
  margin: 0;
  color: rgba(238, 248, 241, 0.21);
  font-family: "Space Grotesk", "Arial Narrow", sans-serif;
  font-size: clamp(7rem, 15vw, 13rem);
  font-weight: 700;
  line-height: 0.78;
  letter-spacing: -0.08em;
  text-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.35);
}

.chapter-card {
  --spatial-x: 0deg;
  --spatial-y: 0deg;
  position: relative;
  max-width: 42rem;
  padding: clamp(2rem, 5vw, 4.25rem);
  border: 1px solid var(--chapter-line);
  background: var(--chapter-panel);
  box-shadow: 1.5rem 2rem 4rem rgba(0, 0, 0, 0.36);
  transform: rotateX(var(--spatial-x)) rotateY(var(--spatial-y)) translateZ(1rem);
  transform-style: preserve-3d;
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 180ms ease-out;
}

.chapter-card::after {
  position: absolute;
  top: 1rem;
  right: -0.55rem;
  bottom: -0.55rem;
  width: 0.55rem;
  border-right: 1px solid rgba(158, 231, 184, 0.55);
  border-bottom: 1px solid rgba(158, 231, 184, 0.55);
  content: "";
  pointer-events: none;
}

.chapter-card:hover {
  border-color: rgba(158, 231, 184, 0.7);
  box-shadow: 1.75rem 2.3rem 4.5rem rgba(0, 0, 0, 0.42);
}

.chapter-signal {
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  margin-bottom: 2.25rem;
  background: var(--chapter-mint);
  box-shadow: 0 0 1rem rgba(158, 231, 184, 0.55);
}

.chapter-card .eyebrow {
  color: var(--chapter-mint);
}

.chapter-card h1 {
  max-width: 12ch;
  margin: 0.9rem 0 0;
  color: #f4faf6;
  font-size: clamp(2.8rem, 5.5vw, 5.25rem);
  line-height: 1.03;
  letter-spacing: -0.055em;
}

.chapter-works .chapter-card h1 {
  max-width: none;
  font-size: clamp(2.8rem, 4.8vw, 4.6rem);
}

.chapter-card > p:not(.eyebrow) {
  max-width: 34rem;
  margin: 1.5rem 0 0;
  color: rgba(238, 248, 241, 0.72);
  font-size: clamp(0.92rem, 1.4vw, 1.06rem);
}

.chapter-link {
  display: flex;
  min-height: 3.25rem;
  margin-top: 2.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(181, 220, 198, 0.24);
  align-items: center;
  justify-content: space-between;
  color: var(--chapter-mint);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.chapter-link span {
  transition: transform 180ms ease;
}

.chapter-link:hover span {
  transform: translateY(0.25rem);
}

.chapter-telemetry {
  margin: 0;
  padding: 1rem;
  border-top: 1px solid var(--chapter-line);
  border-bottom: 1px solid var(--chapter-line);
  background: rgba(4, 12, 9, 0.58);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chapter-telemetry div {
  display: grid;
  padding-block: 0.55rem;
  border-bottom: 1px solid rgba(181, 220, 198, 0.12);
  grid-template-columns: auto 1fr;
  gap: 1rem;
}

.chapter-telemetry div:last-child { border-bottom: 0; }
.chapter-telemetry dt { color: rgba(238, 248, 241, 0.62); }
.chapter-telemetry dd { margin: 0; color: var(--chapter-mint); text-align: right; }

.chapter-page .directory-section,
.chapter-page .gallery-directory,
.chapter-page .page-section {
  position: relative;
  border-bottom-color: rgba(181, 220, 198, 0.16);
  color: rgba(238, 248, 241, 0.78);
  background: #09120f;
}

.chapter-page .directory-section,
.chapter-page .gallery-directory {
  box-shadow: inset 0 1px rgba(158, 231, 184, 0.14);
}

.chapter-page .page-section + .page-section {
  background: #0c1713;
}

.chapter-page .directory-toolbar > .meta,
.chapter-page .gallery-count,
.chapter-page .content-block p,
.chapter-page .content-block li,
.chapter-page .prose p,
.chapter-page .notice p,
.chapter-page .catalog-domain,
.chapter-page .showcase-card-header .meta {
  color: rgba(238, 248, 241, 0.62);
}

.chapter-page .demo-direct-links,
.chapter-page .demo-direct-links > * {
  border-color: rgba(181, 220, 198, 0.22);
}

.chapter-page .demo-direct-links > .meta,
.chapter-page .demo-direct-links a small { color: rgba(238, 248, 241, 0.54); }

.chapter-page .demo-direct-links a {
  color: #c9f1d7;
  background: #0d1915;
}

.chapter-page .demo-direct-links a:hover,
.chapter-page .demo-direct-links a:focus-visible {
  color: #f4faf6;
  background: #14251e;
}

.chapter-page .filter-chip {
  border-color: rgba(181, 220, 198, 0.26);
  color: rgba(238, 248, 241, 0.72);
  background: #0d1915;
}

.chapter-page .filter-chip:hover:not(:disabled) {
  border-color: rgba(158, 231, 184, 0.68);
  color: #f4faf6;
}

.chapter-page .filter-chip[aria-pressed="true"] {
  border-color: var(--chapter-mint);
  color: #07100d;
  background: var(--chapter-mint);
}

.chapter-page .showcase-gallery {
  border-color: rgba(181, 220, 198, 0.26);
  background: #0d1915;
}

.chapter-page .showcase-gallery::before {
  border-color: rgba(158, 231, 184, 0.16);
  opacity: 0.52;
}

.chapter-page .gallery-atmosphere span {
  border-color: rgba(158, 231, 184, 0.22);
}

.chapter-page .gallery-card {
  border-color: rgba(181, 220, 198, 0.34);
  background: rgba(11, 23, 19, 0.96);
  box-shadow:
    0 2rem 5rem rgba(0, 0, 0, calc(0.34 - var(--gallery-distance) * 0.05)),
    inset 0 1px rgba(158, 231, 184, 0.08);
}

.chapter-page .gallery-visual {
  border-right-color: rgba(181, 220, 198, 0.22);
  background: #183c2b;
}

.chapter-page .reports-gallery-visual {
  background: #1c4656;
}

.chapter-page .gallery-kicker {
  color: #e8b89e;
}

.chapter-page .gallery-card-body h2,
.chapter-page .content-block h2,
.chapter-page .content-block h3,
.chapter-page .prose h2 {
  color: #f4faf6;
}

.chapter-page .page-section > .container > h2 {
  color: var(--chapter-mint);
}

.chapter-page .gallery-card-body > p:not(.gallery-kicker) {
  color: rgba(238, 248, 241, 0.66);
}

.chapter-page .gallery-card-footer {
  border-top-color: rgba(181, 220, 198, 0.18);
}

.chapter-page .gallery-link {
  color: #07100d;
  background: var(--chapter-mint);
}

.chapter-page .gallery-link:hover {
  background: #c4f3d4;
}

.chapter-page .catalog-tags li {
  color: #c9f1d7;
  background: rgba(158, 231, 184, 0.12);
}

.chapter-page .gallery-controls p {
  color: rgba(238, 248, 241, 0.72);
}

.chapter-page .gallery-controls button {
  border-color: rgba(158, 231, 184, 0.5);
  color: var(--chapter-mint);
  background: rgba(7, 16, 13, 0.9);
}

.chapter-page .content-grid {
  border-color: rgba(181, 220, 198, 0.2);
  background: rgba(181, 220, 198, 0.2);
}

.chapter-page .content-block {
  min-height: 15rem;
  background: #101e19;
}

.chapter-page .content-block:nth-child(even) {
  background: #0d1915;
}

.chapter-page .status {
  border-color: rgba(158, 231, 184, 0.34);
  color: var(--chapter-mint);
  background: rgba(158, 231, 184, 0.08);
}

.chapter-page .notice {
  border: 1px solid rgba(229, 191, 80, 0.26);
  border-left: 4px solid var(--gold);
  color: #f4faf6;
  background: #171b12;
}

.chapter-page .site-footer {
  border-top: 1px solid rgba(158, 231, 184, 0.18);
  color: rgba(238, 248, 241, 0.72);
  background: #07100d;
}

.chapter-page .site-footer .brand {
  color: #eef8f1;
}

.chapter-page .site-footer .brand-mark {
  color: #07100d;
  background: var(--chapter-mint);
}

.chapter-page .site-footer .copyright {
  color: rgba(238, 248, 241, 0.48);
}

@media (max-width: 840px) {
  .chapter-page .site-nav {
    border-bottom-color: rgba(181, 220, 198, 0.2);
    background: #07100d;
  }

  .chapter-stage {
    min-height: 43rem;
    padding-block: 2.5rem;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    gap: 1.25rem;
  }

  .chapter-stage::before { inset: 5% 2% 9% 8%; }
  .chapter-stage::after { inset: 9% -2% 5% 13%; }

  .chapter-number {
    font-size: clamp(5rem, 24vw, 8rem);
  }

  .chapter-card {
    width: min(92%, 38rem);
    margin-top: -1.5rem;
    margin-left: auto;
    padding: clamp(1.5rem, 7vw, 2.5rem);
    transform: none;
  }

  .chapter-card h1 { font-size: clamp(2.5rem, 12vw, 4.3rem); }

  .chapter-telemetry {
    width: min(82%, 24rem);
    margin-left: auto;
  }
}

@media (max-width: 560px) {
  .chapter-hero,
  .chapter-stage { min-height: 39rem; }

  .chapter-hero { background-position: 58% center; }
  .chapter-hero-apps,
  .chapter-hero-about { background-position: 62% center; }

  .chapter-card { width: 94%; }
  .chapter-works .chapter-card h1,
  .chapter-apps .chapter-card h1 { font-size: clamp(2.35rem, 10.5vw, 3.25rem); }
  .chapter-card::after { display: none; }
  .chapter-signal { margin-bottom: 1.25rem; }
  .chapter-card > p:not(.eyebrow) { font-size: 0.88rem; }
  .chapter-link { margin-top: 1.4rem; }
  .chapter-telemetry { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .chapter-card { transform: none !important; }
}
