﻿:root {
  --bg: #120d0c;
  --surface: rgba(34, 24, 20, 0.92);
  --line: rgba(205, 173, 120, 0.22);
  --line-strong: rgba(205, 173, 120, 0.45);
  --text: #f2e8d8;
  --text-muted: #c7b59d;
  --accent: #c8a56d;
  --accent-strong: #f1d39b;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  --container: min(1120px, calc(100vw - 40px));
  --narrow: min(760px, calc(100vw - 40px));
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(120, 29, 44, 0.28), transparent 34%),
    linear-gradient(180deg, #21110f 0%, #120d0c 38%, #0d0909 100%);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  line-height: 1.75;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 8px 12px;
  background: var(--accent);
  color: #140d0b;
  transform: translateY(-150%);
  z-index: 100;
}

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

.container {
  width: var(--container);
  margin: 0 auto;
}

.narrow {
  width: var(--narrow);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(18px);
  background: rgba(12, 8, 8, 0.76);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 78px;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.brand-mark {
  font-size: 1.5rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-sub {
  color: var(--text-muted);
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px 18px;
  font-size: 0.95rem;
}

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

.site-nav a:hover,
.site-nav a.is-current {
  color: var(--accent-strong);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  padding: 10px 14px;
  font: inherit;
}

.site-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.site-search input {
  min-width: 240px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
}

.site-search button {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.site-search input::placeholder {
  color: var(--text-muted);
}

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

.hero,
.page-hero {
  padding: 84px 0 48px;
}

.hero {
  padding-top: 0;
}

.hero-grid,
.split-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 32px;
  align-items: center;
}

.hero-copy h1,
.page-hero h1,
.section-heading h2 {
  margin: 0 0 14px;
  line-height: 1.15;
}

.hero-copy h1,
.page-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.6rem);
}

.page-hero h1 {
  font-size: clamp(2.15rem, 4.5vw, 3.4rem);
}

.hero-visual {
  position: relative;
  width: 100%;
  min-height: 620px;
  margin: 0;
  border-left: 0;
  border-right: 0;
}

.hero-visual .media-image {
  min-height: 620px;
  border-bottom: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 5vw, 48px);
  background: linear-gradient(180deg, rgba(10, 8, 8, 0.12) 0%, rgba(10, 8, 8, 0.34) 48%, rgba(8, 6, 6, 0.84) 100%);
}

.hero-overlay .hero-copy {
  max-width: min(620px, 100%);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.lead {
  margin: 0 0 16px;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  color: var(--accent-strong);
}

.body-copy,
.section-heading p,
.prose-card p,
.feature-card p,
.link-card span,
.review-card p,
.timeline-item p,
.faq-item p,
.info-value,
.notice-text {
  color: var(--text-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero-actions .button {
  flex: 0 1 auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
}

.button-primary {
  background: linear-gradient(135deg, #b88e54, #f0cb8b);
  color: #190f0d;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.03);
}

.section {
  padding: 56px 0;
}

.section-dark {
  background: linear-gradient(180deg, rgba(72, 20, 28, 0.18), rgba(12, 8, 8, 0.24));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-heading {
  text-align: center;
  max-width: 740px;
  margin: 0 auto 28px;
}

.section-heading.left {
  text-align: left;
  margin-left: 0;
}

.card-grid {
  display: grid;
  gap: 20px;
}

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

.feature-card,
.prose-card,
.note-box,
.review-card,
.timeline-item,
.faq-item,
.table-card,
.info-box,
.quote-panel,
.link-card,
.media-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.feature-card,
.prose-card,
.note-box,
.review-card,
.timeline-item,
.faq-item,
.info-box,
.quote-panel {
  padding: 24px;
}

.feature-card {
  overflow: hidden;
}

.feature-card h2,
.feature-card h3,
.link-card strong,
.document-panel h2,
.artifact-card h2,
.case-card h2 {
  line-height: 1.35;
}

.link-list {
  display: grid;
  gap: 14px;
}

.link-list.compact .link-card {
  padding: 18px 20px;
}

.link-card {
  display: grid;
  gap: 6px;
  padding: 20px 22px;
}

.link-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.media-card {
  overflow: hidden;
}

.media-image {
  display: block;
  width: 100%;
  min-height: 320px;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
}

.card-image,
.link-card-image,
.gallery-image,
.notice-image {
  display: block;
  width: 100%;
  object-fit: cover;
}

.card-image {
  aspect-ratio: 4 / 3;
  width: calc(100% + 48px);
  margin: -24px -24px 18px;
  border-bottom: 1px solid var(--line);
}

.link-card-image {
  aspect-ratio: 16 / 9;
  width: calc(100% + 44px);
  margin: -20px -22px 10px;
  border-bottom: 1px solid var(--line);
}

.gallery-image {
  aspect-ratio: 4 / 5;
}

.gallery-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.gallery-trigger:hover .gallery-image,
.gallery-trigger:focus-visible .gallery-image {
  filter: brightness(1.04);
}

.gallery-trigger:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: -2px;
}

.gallery-popup-caption {
  display: none;
}

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

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 6, 0.78);
  backdrop-filter: blur(10px);
}

.gallery-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 18px;
  background: rgba(11, 9, 9, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.46);
}

.gallery-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.gallery-lightbox-image {
  display: block;
  width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
  background: #090909;
}

.gallery-lightbox-caption {
  margin-top: 14px;
  color: var(--text-muted);
  line-height: 1.8;
}

.notice-image {
  width: 96px;
  height: 72px;
  flex: 0 0 auto;
  border: 1px solid rgba(214, 176, 114, 0.18);
}

.media-card figcaption {
  padding: 14px 18px 18px;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.media-card.tall .media-placeholder {
  min-height: 420px;
}

.media-placeholder {
  min-height: 320px;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 28px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(130, 29, 47, 0.28), rgba(20, 14, 13, 0.86)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 10px,
      rgba(0, 0, 0, 0.05) 10px,
      rgba(0, 0, 0, 0.05) 20px
    );
  border-bottom: 1px solid var(--line);
}

.media-label {
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.notice-band {
  padding: 18px 0;
}

.notice-band-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 20px 24px;
  background: linear-gradient(90deg, rgba(98, 22, 33, 0.48), rgba(22, 12, 11, 0.92));
  border: 1px solid rgba(214, 176, 114, 0.28);
}

.notice-kicker,
.notice-link,
.footer-brand,
.footer-heading,
.quote-attribution {
  color: var(--accent-strong);
}

.notice-link {
  margin-left: auto;
}

.section-actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.quote-panel {
  position: relative;
}

.quote-mark {
  margin: 0;
  font-size: 4rem;
  line-height: 0.8;
  color: var(--accent);
}

.footer-grid,
.footer-simple {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}

.footer-grid > * {
  flex: 1 1 220px;
  min-width: 0;
}

.site-footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--line);
}

.page-location {
  padding: 18px 0;
}

.page-location .container {
  display: flex;
  justify-content: flex-end;
}

.page-location p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  letter-spacing: 0.16em;
}

.site-disclaimer {
  padding: 18px 0 28px;
  border-top: 1px solid var(--line);
}

.site-disclaimer .container {
  display: grid;
  gap: 4px;
}

.site-disclaimer p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.7;
}

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

.footer-links li + li {
  margin-top: 8px;
}

.search-layout {
  display: grid;
  gap: 24px;
}

.search-form-card,
.search-card,
.search-empty {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.search-form input {
  flex: 1 1 320px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
}

.search-form button {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.search-count {
  color: var(--accent-strong);
}

.search-results {
  display: grid;
  gap: 16px;
}

.search-card h2,
.search-empty h2 {
  margin-top: 0;
}

.search-url {
  color: var(--accent);
  font-family: Consolas, monospace;
}

.eerie-page {
  background:
    radial-gradient(circle at top, rgba(87, 0, 20, 0.24), transparent 24%),
    radial-gradient(circle at 80% 10%, rgba(13, 66, 76, 0.14), transparent 18%),
    linear-gradient(180deg, #09090b 0%, #050507 40%, #020304 100%);
}

.eerie-noise-page {
  background:
    linear-gradient(rgba(3, 5, 7, 0.78), rgba(2, 3, 4, 0.9)),
    radial-gradient(circle at top, rgba(87, 0, 20, 0.18), transparent 24%),
    url("../../img/background_noise.jpg") center top / cover fixed no-repeat,
    linear-gradient(180deg, #09090b 0%, #050507 40%, #020304 100%);
}

.eerie-noise-page::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.05) 0 1px,
      rgba(0, 0, 0, 0) 1px 3px
    ),
    linear-gradient(
      90deg,
      rgba(120, 190, 205, 0.12),
      rgba(255, 255, 255, 0.03) 35%,
      rgba(255, 80, 80, 0.12) 70%,
      rgba(255, 255, 255, 0.02)
    );
  animation: noise-pulse 5s infinite steps(2, end);
}

.eerie-noise-page::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(
      180deg,
      rgba(255, 0, 64, 0) 0%,
      rgba(255, 0, 64, 0.08) 48%,
      rgba(255, 255, 255, 0.12) 50%,
      rgba(255, 0, 64, 0.1) 52%,
      rgba(255, 0, 64, 0) 100%
    );
  mix-blend-mode: screen;
  animation: noise-flash 5s infinite linear;
}

.eerie-page .page-hero {
  padding-top: 96px;
}

.eerie-page .eyebrow {
  color: #86aeb5;
}

.eerie-page .lead {
  color: #d9d2c3;
}

.eerie-page .prose-card,
.eerie-page .feature-card,
.eerie-page .note-box,
.eerie-page .review-card,
.eerie-page .timeline-item,
.eerie-page .faq-item,
.eerie-page .table-card,
.eerie-page .info-box,
.eerie-page .quote-panel,
.eerie-page .link-card,
.eerie-page .media-card,
.eerie-page .search-form-card,
.eerie-page .search-card,
.eerie-page .search-empty,
.document-panel,
.artifact-card,
.case-card,
.code-block,
.chip-row {
  background: rgba(9, 12, 15, 0.92);
  border-color: rgba(116, 146, 155, 0.22);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.46);
}

.eerie-page .site-header {
  background: rgba(4, 6, 8, 0.84);
}

.eerie-page .site-nav a:hover,
.eerie-page .site-nav a.is-current,
.eerie-page .footer-brand,
.eerie-page .footer-heading,
.eerie-page .quote-attribution,
.eerie-page .search-count,
.eerie-page .notice-kicker,
.eerie-page .notice-link {
  color: #9fc0c7;
}

.eerie-page .media-placeholder {
  background:
    linear-gradient(135deg, rgba(29, 47, 53, 0.35), rgba(8, 10, 12, 0.94)),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 12px,
      rgba(0, 0, 0, 0.08) 12px,
      rgba(0, 0, 0, 0.08) 24px
    );
}

.document-layout,
.artifact-grid,
.case-grid {
  display: grid;
  gap: 20px;
}

.document-layout {
  grid-template-columns: 1.15fr 0.85fr;
}

.artifact-grid,
.case-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.document-panel,
.artifact-card,
.case-card {
  padding: 24px;
}

.document-panel h2,
.artifact-card h2,
.case-card h2 {
  margin-top: 0;
}

.code-block {
  padding: 16px 18px;
  border: 1px solid rgba(116, 146, 155, 0.22);
  font-family: Consolas, monospace;
  color: #cfd7d9;
  white-space: pre-wrap;
  overflow-x: auto;
  word-break: break-word;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(116, 146, 155, 0.22);
}

.eerie-noise-page .document-panel,
.eerie-noise-page .artifact-card,
.eerie-noise-page .case-card,
.eerie-noise-page .media-card {
  background: rgba(5, 8, 11, 0.94);
  backdrop-filter: blur(2px);
}

.eerie-noise-page .glitch-title {
  position: relative;
  animation: title-glitch 5s infinite linear;
}

.eerie-noise-page .document-panel,
.eerie-noise-page .artifact-card,
.eerie-noise-page .case-card {
  animation: card-glitch 5s infinite linear;
  transform-origin: center center;
}

.eerie-noise-page .artifact-card:nth-child(2n),
.eerie-noise-page .case-card:nth-child(2n) {
  animation-name: card-glitch-alt;
}

.eerie-noise-page .site-header,
.eerie-noise-page .site-footer {
  background:
    linear-gradient(rgba(4, 6, 8, 0.84), rgba(4, 6, 8, 0.9)),
    url("../../img/background_noise.jpg") center center / cover no-repeat;
}

@keyframes noise-pulse {
  0%, 90%, 100% {
    opacity: 0;
    transform: translate3d(0, 0, 0) skewX(0deg);
  }

  92% {
    opacity: 0.24;
    transform: translate3d(-1.6%, 0.2%, 0) skewX(-1.2deg);
  }

  94% {
    opacity: 0.14;
    transform: translate3d(1.25%, -0.15%, 0) skewX(0.8deg);
  }

  96% {
    opacity: 0.3;
    transform: translate3d(-1.1%, 0.1%, 0) skewX(-0.6deg);
  }

  97% {
    opacity: 0.18;
    transform: translate3d(0.8%, -0.1%, 0) skewX(0.4deg);
  }

  98% {
    opacity: 0.1;
    transform: translate3d(-0.4%, 0, 0) skewX(0deg);
  }
}

@keyframes noise-flash {
  0%, 91%, 100% {
    opacity: 0;
    transform: translateY(0);
  }

  92% {
    opacity: 0.18;
    transform: translateY(-0.4%);
  }

  95% {
    opacity: 0.1;
    transform: translateY(0.25%);
  }

  97% {
    opacity: 0.22;
    transform: translateY(-0.15%);
  }
}

@keyframes title-glitch {
  0%, 91%, 100% {
    transform: translate3d(0, 0, 0);
    text-shadow:
      0 0 12px rgba(130, 189, 201, 0.16),
      0 0 0 rgba(255, 70, 70, 0),
      0 0 0 rgba(120, 210, 255, 0);
  }

  92% {
    transform: translate3d(-2px, 1px, 0);
    text-shadow:
      -3px 0 rgba(255, 70, 70, 0.34),
      3px 0 rgba(120, 210, 255, 0.3),
      0 0 18px rgba(130, 189, 201, 0.22);
  }

  94% {
    transform: translate3d(2px, -1px, 0);
    text-shadow:
      2px 0 rgba(255, 70, 70, 0.26),
      -2px 0 rgba(120, 210, 255, 0.24),
      0 0 14px rgba(130, 189, 201, 0.18);
  }

  96% {
    transform: translate3d(-1px, 0, 0);
    text-shadow:
      -2px 0 rgba(255, 70, 70, 0.22),
      2px 0 rgba(120, 210, 255, 0.2),
      0 0 12px rgba(130, 189, 201, 0.16);
  }
}

@keyframes card-glitch {
  0%, 91%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    filter: saturate(1);
  }

  92% {
    transform: translate3d(3px, -1px, 0) rotate(-0.1deg);
    filter: saturate(1.08);
  }

  94% {
    transform: translate3d(-2px, 1px, 0) rotate(0.08deg);
    filter: saturate(0.96);
  }

  96% {
    transform: translate3d(1px, 0, 0) rotate(-0.04deg);
    filter: saturate(1.04);
  }
}

@keyframes card-glitch-alt {
  0%, 91%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    filter: brightness(1);
  }

  92% {
    transform: translate3d(-4px, 1px, 0) rotate(0.12deg);
    filter: brightness(1.05);
  }

  95% {
    transform: translate3d(2px, -1px, 0) rotate(-0.08deg);
    filter: brightness(0.97);
  }

  97% {
    transform: translate3d(-1px, 0, 0) rotate(0.04deg);
    filter: brightness(1.02);
  }
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(159, 192, 199, 0.3);
  color: #c8dadd;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.mono-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text-muted);
}

.mono-list li + li {
  margin-top: 8px;
}

.artifact-caption {
  color: #97aaaf;
  font-size: 0.92rem;
}

.glitch-title {
  text-shadow: 0 0 12px rgba(130, 189, 201, 0.16);
  letter-spacing: 0.04em;
}

.faq-list,
.timeline,
.review-grid,
.gallery-grid {
  display: grid;
  gap: 18px;
}

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

.timeline {
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line-strong);
}

.timeline-item {
  position: relative;
  margin-left: 28px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -35px;
  top: 30px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(200, 165, 109, 0.12);
}

.timeline-date,
.info-label {
  margin: 0 0 8px;
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.table-card {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  word-break: keep-all;
}

.stack {
  display: grid;
  gap: 18px;
}

@media (max-width: 960px) {
  .hero-grid,
  .split-grid,
  .card-grid-three,
  .review-grid,
  .gallery-grid,
  .document-layout,
  .artifact-grid,
  .case-grid {
    grid-template-columns: 1fr;
  }

  .site-nav {
    display: none;
    width: 100%;
    order: 3;
    padding-bottom: 16px;
    gap: 10px;
  }

  .site-nav.is-open {
    display: grid;
  }

  .site-nav a {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

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

  .header-inner {
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 0;
  }

  .site-search {
    width: 100%;
    order: 4;
    margin-left: 0;
  }

  .site-search input {
    min-width: 0;
    flex: 1 1 auto;
  }

  .notice-link {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .container,
  .narrow {
    width: calc(100vw - 24px);
  }

  .hero,
  .page-hero,
  .section {
    padding: 40px 0;
  }

  .hero-visual,
  .hero-visual .media-image {
    min-height: 440px;
  }

  .hero-overlay {
    padding: 24px 0;
  }

  .hero-copy h1,
  .page-hero h1 {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .lead {
    font-size: 1.05rem;
  }

  .body-copy {
    font-size: 0.98rem;
  }

  .media-placeholder {
    min-height: 240px;
  }

  .media-image {
    min-height: 240px;
  }

  .card-image {
    width: calc(100% + 40px);
    margin: -20px -20px 18px;
  }

  .link-card {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 10px 14px;
    align-items: start;
    padding: 16px;
  }

  .link-card-image {
    grid-row: 1 / span 2;
    width: 104px;
    aspect-ratio: 1 / 1;
    margin: 0;
    border-bottom: 0;
  }

  .gallery-image {
    aspect-ratio: 4 / 3;
  }

  .gallery-lightbox {
    padding: 12px;
  }

  .gallery-lightbox-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    padding: 14px;
  }

  .gallery-lightbox-image {
    max-height: calc(100vh - 210px);
  }

  .notice-band-inner {
    align-items: flex-start;
    padding: 18px;
  }

  .notice-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .notice-link {
    width: 100%;
    margin-left: 0;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .button,
  .section-actions .button {
    width: 100%;
  }

  .site-search {
    flex-wrap: nowrap;
    gap: 10px;
  }

  .site-search input,
  .search-form input {
    width: 100%;
    flex-basis: 100%;
  }

  .site-search input {
    flex: 1 1 auto;
    width: auto;
  }

  .site-search button {
    width: auto;
    flex: 0 0 auto;
    max-width: 80px;
    min-width: 72px;
  }

  .search-form button {
    width: 100%;
    flex-basis: 100%;
  }

  .link-card,
  .search-card,
  .search-empty,
  .search-form-card,
  .document-panel,
  .artifact-card,
  .case-card,
  .code-block,
  .chip-row {
    overflow-wrap: anywhere;
  }

  .code-block,
  .status-chip,
  .timeline-date,
  .info-label {
    font-size: 0.82rem;
  }

  th,
  td {
    padding: 12px 14px;
    font-size: 0.92rem;
  }

  .page-location {
    padding: 14px 0;
  }

  .page-location p,
  .site-disclaimer p {
    letter-spacing: 0.08em;
  }

  .feature-card,
  .prose-card,
  .note-box,
  .review-card,
  .timeline-item,
  .faq-item,
  .info-box,
  .quote-panel {
    padding: 20px;
  }
}
