:root {
  --bg: #0a0d12;
  --bg-elevated: rgba(18, 24, 34, 0.82);
  --panel: rgba(16, 22, 31, 0.92);
  --text: #edf3ff;
  --muted: #99a7bf;
  --line: rgba(142, 176, 214, 0.18);
  --accent: #74f2ce;
  --accent-2: #7aa2ff;
  --warning: #ffd166;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 22px;
  --content-width: 1180px;
  --font-body: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-heading: Georgia, "Times New Roman", Times, serif;
  --nav-menu-max-height: 40rem;
}

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

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

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(122, 162, 255, 0.14), transparent 28rem),
    linear-gradient(180deg, #091018 0%, #07090d 100%);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 100% 4px, 4px 100%;
  opacity: 0.18;
}

h1,
h2,
h3,
h4,
h5,
h6,
.heading {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

p {
  margin: 0 0 1rem;
}

.body-text {
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
}

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

a {
  color: var(--accent-2);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover,
a:focus-visible {
  color: var(--accent);
}

:where(a, button, [role="button"], input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

button {
  font: inherit;
}

html.js [data-nav-menu] {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-0.25rem);
  transition:
    max-height 0.25s ease,
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0s linear 0.2s;
  will-change: max-height, opacity, transform;
}

html.js [data-nav-menu][data-open] {
  max-height: var(--nav-menu-max-height);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    max-height 0.25s ease,
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0s linear 0s;
}

[data-nav-toggle] {
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

.site-shell,
.archive-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.site-header,
.site-footer,
.section,
.archive-frame {
  width: min(calc(100% - 2rem), var(--content-width));
  margin: 0 auto;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.eyebrow,
.meta-kicker {
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 2rem 0 1rem;
  align-items: end;
}

.site-name,
.site-tagline {
  margin: 0;
}

.site-name {
  font-family: "Courier New", Courier, monospace;
  font-size: 0.82rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-tagline,
.site-footer {
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0 2rem;
  font-size: 0.92rem;
}

.homepage {
  padding-bottom: 3rem;
}

.home-nav,
.home-hero,
.home-archive-card,
.home-capture-card,
.home-scene-card {
  position: relative;
  overflow: hidden;
}

.home-nav {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
}

.home-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.home-nav-link {
  color: var(--text);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.9fr);
  gap: 1.5rem;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  margin-bottom: 3rem;
}

.home-hero::after,
.home-archive-card::after,
.home-capture-card::after,
.home-scene-card::after {
  content: "";
  position: absolute;
  inset: auto -10% -35% auto;
  width: 14rem;
  height: 14rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(116, 242, 206, 0.18), transparent 68%);
  pointer-events: none;
}

.home-hero-copy h1 {
  max-width: 11ch;
  margin-bottom: 1.25rem;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: clamp(3rem, 8vw, 5.75rem);
}

.home-hero-lede {
  max-width: 41rem;
  margin-bottom: 1rem;
  font-size: 1.14rem;
  color: #f4f8ff;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.75rem;
}

.home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.home-button-primary {
  color: #071016;
  background: linear-gradient(135deg, var(--accent) 0%, #96ffd7 100%);
  border-color: transparent;
  box-shadow: 0 18px 35px rgba(116, 242, 206, 0.2);
}

.home-button-secondary {
  color: var(--text);
  background: rgba(11, 15, 22, 0.72);
}

.home-hero-sidebar {
  display: grid;
  gap: 1rem;
}

.home-hero-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.home-stat-card,
.home-hero-note {
  padding: 1.1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(11, 16, 24, 0.72);
}

.home-stat-value {
  margin-bottom: 0.3rem;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
}

.home-stat-label {
  margin: 0;
  color: var(--muted);
}

.home-hero-note p:last-child {
  margin-bottom: 0;
}

.home-section {
  margin-bottom: 3rem;
}

.home-section-heading {
  margin-bottom: 1.4rem;
}

.home-section-heading h2 {
  max-width: 14ch;
  margin-bottom: 0.6rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.home-section-intro {
  max-width: 48rem;
}

.home-archive-card-grid,
.home-capture-grid,
.home-scene-grid {
  display: grid;
  gap: 1rem;
}

.home-archive-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-archive-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-height: 100%;
  padding: 1.25rem;
}

.home-archive-card h3,
.home-capture-copy h3,
.home-scene-card h2 {
  font-size: 1.55rem;
}

.home-archive-card-count {
  margin: 0;
  color: var(--warning);
  font-family: "Courier New", Courier, monospace;
}

.home-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.home-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 16, 23, 0.78);
  color: var(--text);
  font-family: "Courier New", Courier, monospace;
  font-size: 0.82rem;
}

.home-link {
  margin-top: auto;
  font-weight: 700;
}

.page-link {
  font-weight: 700;
}

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

.home-capture-card {
  margin: 0;
  display: grid;
}

.home-capture-image {
  display: block;
  background: #05070b;
}

.home-capture-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.home-capture-copy {
  padding: 1rem 1.1rem 1.2rem;
}

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

.home-scene-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.3rem;
}

.home-scene-card .home-tag-list {
  margin-top: 0.25rem;
}

.page-stack {
  display: grid;
  gap: 1rem;
  padding-bottom: 3rem;
}

.page-card {
  padding: clamp(1.4rem, 2.8vw, 2.2rem);
}

.page-card h1 {
  max-width: 12ch;
  margin-bottom: 0.75rem;
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.page-card h2 {
  margin-bottom: 0.35rem;
  font-size: 1.1rem;
  font-family: "Courier New", Courier, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.page-detail {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(10, 16, 23, 0.6);
}

.page-detail-value {
  margin: 0;
  color: var(--text);
  font-family: "Courier New", Courier, monospace;
}

.page-list {
  margin: 0;
  padding-left: 1.1rem;
}

.page-list li + li {
  margin-top: 0.45rem;
}

.page-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.2rem;
}

.page-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.75rem;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(10, 16, 23, 0.78);
  text-decoration: none;
}

.archive-pre {
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 12, 18, 0.92);
  color: var(--text);
  overflow-x: auto;
  white-space: pre-wrap;
}

@media (max-width: 1080px) {
  .home-archive-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 860px) {
  .site-header,
  .site-footer,
  .home-hero,
  .home-scene-grid {
    grid-template-columns: 1fr;
  }

  .site-header,
  .site-footer {
    flex-direction: column;
    align-items: start;
  }

  .home-hero-copy h1,
  .home-section-heading h2 {
    max-width: none;
  }

  .page-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .site-header,
  .site-footer,
  .section,
  .archive-frame {
    width: min(calc(100% - 1rem), var(--content-width));
  }

  .home-nav,
  .home-hero,
  .home-archive-card,
  .home-scene-card {
    padding-inline: 1rem;
  }

  .home-hero-stats,
  .home-archive-card-grid,
  .home-capture-grid,
  .home-scene-grid {
    grid-template-columns: 1fr;
  }

  .home-hero-copy h1 {
    font-size: clamp(2.5rem, 14vw, 3.5rem);
  }

  .home-section-heading h2 {
    font-size: clamp(1.8rem, 10vw, 2.6rem);
  }
}
