:root {
  --bg: #f8f9fa;
  --bg-alt: #ffffff;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --ink: #0f172a;
  --muted: #475569;
  --accent: #15803d;
  --accent-hover: #166534;
  --accent-bg: #f0fdf4;
  --accent-border: #bbf7d0;
  --badge-bg: #e2e8f0;
  --badge-text: #1e293b;
  --code-bg: #f1f5f9;
  --line: #cbd5e1;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090a0f;
    --bg-alt: #11131a;
    --card-bg: #161822;
    --card-border: #26293b;
    --ink: #f1f5f9;
    --muted: #94a3b8;
    --accent: #4ade80;
    --accent-hover: #86efac;
    --accent-bg: #052e16;
    --accent-border: #14532d;
    --badge-bg: #1e293b;
    --badge-text: #cbd5e1;
    --code-bg: #1e2230;
    --line: #26293b;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    'Inter',
    system-ui,
    -apple-system,
    sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

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

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

code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

.container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 16px;
}

/* Hero */
header.hero {
  padding: 4rem 16px 3rem;
  text-align: center;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
}

.hero-content {
  max-width: 48rem;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 1rem;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
  color: var(--muted);
  margin-bottom: 2rem;
  font-weight: 400;
}

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: 2px solid var(--accent);
}

@media (prefers-color-scheme: dark) {
  .btn-primary {
    color: #090a0f;
  }
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .btn-primary:hover {
    color: #090a0f;
  }
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--line);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero-links {
  font-size: 0.95rem;
  color: var(--muted);
}

/* Sections */
section {
  padding: 3.5rem 0;
  border-bottom: 1px solid var(--line);
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
}

.section-intro {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 44rem;
  margin: 0 0 2rem;
}

/* Stats / Feature Grid */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.stat-card {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 0.25rem;
}

.stat-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

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

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

figure {
  margin: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

figure img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--card-border);
}

figcaption {
  padding: 1.25rem;
  font-size: 0.95rem;
  color: var(--muted);
}

figcaption strong {
  color: var(--ink);
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

/* Deep Dive Cards */
.feature-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.feature-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.feature-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.feature-list li strong {
  color: var(--ink);
}

/* Footer */
footer {
  padding: 3rem 16px;
  background: var(--bg-alt);
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-links a {
  font-weight: 600;
}

@font-face {
  font-family: Inter;
  src: url('assets/inter-variable.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('assets/jetbrains-mono-variable.ttf') format('truetype');
  font-weight: 100 800;
  font-display: swap;
}
.skip {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--bg-alt);
  padding: 12px;
  z-index: 10;
}
.skip:focus {
  top: 12px;
}
.section-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 24px;
  margin-top: 32px;
}
.path {
  overflow-wrap: anywhere;
  font-family: 'JetBrains Mono', monospace;
  padding: 20px;
  background: var(--code-bg);
  border-radius: 8px;
}
.grid-2 {
  align-items: start;
}
@media (max-width: 400px) {
  .grid-2,
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .btn:hover {
    transform: none;
  }
}

/* Development archive: reuse the showcase's colours, cards and button styles. */
.history-index {
  margin-bottom: 32px;
}
.history-release summary,
.history-index summary {
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  padding: 12px 0;
  min-height: 44px;
}
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}
.history-release-body {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.history-event .history-label {
  color: var(--ink);
  font-weight: 700;
  margin: 20px 0 10px;
}
.history-changes {
  padding-left: 24px;
  color: var(--muted);
}
.history-changes li {
  margin-bottom: 12px;
}
.history-period-note {
  padding: 12px 16px;
  border-left: 3px solid var(--accent-border);
}
.history-era {
  scroll-margin-top: 24px;
  padding-block: 24px 8px;
}
.history-era h3 {
  font-size: 1.4rem;
  line-height: 1.4;
}
.history-anchor {
  scroll-margin-top: 24px;
}
.history-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 32px;
  font-size: 0.9rem;
}
.history-timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 24px;
  border-left: 3px solid var(--accent-border);
}
.history-event {
  position: relative;
  margin-bottom: 24px;
  scroll-margin-top: 24px;
}
.history-event::before {
  content: '';
  position: absolute;
  left: -33px;
  top: 30px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
}
.history-event h3,
.history-menu h3,
.history-note h3 {
  font-size: 1.3rem;
  line-height: 1.35;
  margin: 0 0 12px;
}
.history-event p,
.history-menu p,
.history-note p {
  color: var(--muted);
}
.history-event figure {
  max-width: 720px;
  margin-top: 24px;
}
.history-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px 28px;
  margin-top: 40px;
}
.history-menu {
  min-width: 0;
  scroll-margin-top: 24px;
}
.history-menu figure a {
  display: block;
}
.history-menu figure a:focus-visible {
  outline-offset: -6px;
}
.history-event figure a:focus-visible {
  outline-offset: -6px;
}
@media (max-width: 700px) {
  .history-menu-grid {
    grid-template-columns: 1fr;
  }
  .history-timeline {
    padding-left: 16px;
  }
  .history-event::before {
    left: -25px;
  }
  .history-event {
    padding: 20px;
  }
  .history-event .hero-badge {
    border-radius: 8px;
  }
}
