:root {
  color-scheme: dark;
  --bg: #191817;
  --bg-soft: #23211f;
  --surface: #2b2926;
  --surface-raised: #35312d;
  --text: #f4efe6;
  --muted: #c7bfb3;
  --subtle: #9d9489;
  --line: #4b453e;
  --accent: #f0b35a;
  --accent-strong: #ffcf7a;
  --accent-ink: #24180c;
  --mint: #8fd6b3;
  --rose: #e49393;
  --blue: #9bbbe8;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --focus: 0 0 0 3px rgba(255, 207, 122, 0.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(240, 179, 90, 0.12), transparent 34rem),
    linear-gradient(180deg, #1f1d1b 0%, var(--bg) 45%, #151412 100%);
  color: var(--text);
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  opacity: 0.12;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 34px 34px;
}

a {
  color: inherit;
  text-decoration-color: rgba(240, 179, 90, 0.65);
  text-underline-offset: 0.18em;
}

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

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

button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 20;
  transform: translateY(-180%);
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  background: var(--accent-strong);
  color: var(--accent-ink);
  font-weight: 800;
}

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

.site-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 1rem 0 0.75rem;
  backdrop-filter: blur(16px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 56px;
  padding: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  background: rgba(35, 33, 31, 0.84);
  box-shadow: 0 10px 38px rgba(0, 0, 0, 0.18);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 900;
  text-decoration: none;
}

.brand-icon {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.82rem;
  line-height: 1;
}

.nav-toggle,
.ghost-button,
.filter-button,
.button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.nav-toggle {
  padding: 0.65rem 0.8rem;
  background: var(--surface-raised);
  color: var(--text);
}

.nav-links {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 78px;
  display: none;
  grid-template-columns: 1fr;
  gap: 0.3rem;
  padding: 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  background: var(--surface);
}

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

.nav-links a {
  padding: 0.7rem 0.8rem;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.prototype-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 0;
  padding: 0.8rem;
  border: 1px dashed rgba(255, 207, 122, 0.45);
  border-radius: var(--radius);
  background: rgba(240, 179, 90, 0.1);
}

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

.ghost-button {
  flex: 0 0 auto;
  padding: 0.45rem 0.7rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.hero {
  display: grid;
  gap: 1.5rem;
  min-height: auto;
  align-items: center;
  padding: clamp(1rem, 3vw, 2rem) 0 clamp(1.5rem, 5vw, 3rem);
}

.text-hero,
.game-hero {
  min-height: auto;
  padding-top: clamp(3rem, 10vw, 6rem);
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  max-width: 12ch;
  font-size: clamp(3rem, 11vw, 6.2rem);
  letter-spacing: 0;
}

.text-hero h1,
.game-hero h1 {
  max-width: 11ch;
  font-size: clamp(2.7rem, 12vw, 6.2rem);
}

h2 {
  font-size: clamp(2rem, 7vw, 4rem);
}

h3 {
  font-size: 1.18rem;
}

.hero-tagline {
  margin: 1rem 0 0;
  color: var(--accent-strong);
  font-size: clamp(1.25rem, 5vw, 2rem);
  font-weight: 900;
}

.hero-intro {
  max-width: 62ch;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.78rem 1rem;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover,
.filter-button:hover,
.ghost-button:hover,
.nav-toggle:hover {
  animation: polite-wobble 260ms ease;
}

.button.primary {
  background: var(--accent-strong);
  color: var(--accent-ink);
}

.button.secondary {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.button.small {
  min-height: 38px;
  padding: 0.55rem 0.7rem;
  font-size: 0.92rem;
}

.button.disabled,
.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.diagnostic-panel,
.game-card,
.principle-grid article,
.detail-grid article,
.timeline li,
.prose-section {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  background: rgba(43, 41, 38, 0.78);
  box-shadow: var(--shadow);
}

.diagnostic-panel {
  max-width: 380px;
  padding: 1rem;
}

.panel-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--subtle);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.status-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 0 0 0 6px rgba(143, 214, 179, 0.14);
}

.random-status {
  min-height: 1.6em;
  margin: 1.3rem 0 0.8rem;
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 900;
}

.meter {
  height: 0.7rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.meter span {
  display: block;
  width: 73%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--accent-strong));
  animation: fake-loading 4.5s ease-in-out infinite;
}

.micro-copy {
  margin: 0.8rem 0 0;
  color: var(--subtle);
  font-size: 0.92rem;
}

.section {
  padding: clamp(2.25rem, 8vw, 5rem) 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 1.5rem;
}

.section-heading p:not(.eyebrow) {
  margin: 0.8rem 0 0;
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 1rem;
}

.filter-button {
  min-height: 40px;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.filter-button.is-active {
  background: var(--text);
  color: #1f1d1b;
}

.game-grid,
.principle-grid,
.detail-grid,
.screenshot-grid {
  display: grid;
  gap: 1rem;
}

.game-card {
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease;
}

.game-card:hover {
  transform: translateY(-3px) rotate(-0.3deg);
  border-color: rgba(255, 207, 122, 0.34);
}

.game-card.is-hidden {
  display: none;
}

.game-screenshot-link {
  display: block;
  aspect-ratio: 16 / 9;
  min-height: 180px;
  max-height: 320px;
  overflow: hidden;
  background: var(--surface-raised);
}

.game-screenshot {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
  object-position: center;
  transition: transform 220ms ease, filter 220ms ease;
}

.game-screenshot-link:hover .game-screenshot {
  transform: scale(1.025);
  filter: saturate(1.08) contrast(1.04);
}

.empty-filter-message {
  margin: 1rem 0 0;
  padding: 1rem;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.placeholder-art {
  display: flex;
  min-height: 190px;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 1rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent),
    repeating-linear-gradient(-8deg, rgba(255, 255, 255, 0.05) 0 12px, transparent 12px 24px),
    var(--surface-raised);
}

.placeholder-art span,
.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 900;
}

.placeholder-art span {
  min-height: 28px;
  padding: 0.35rem 0.55rem;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
}

.cargo-art {
  background-color: #5a4a38;
}

.nod-art {
  background-color: #323846;
}

.idea-art {
  background-color: #493b3f;
}

.card-body {
  padding: 1rem;
}

.card-title-row {
  display: grid;
  gap: 0.65rem;
  align-items: start;
}

.card-body p,
.principle-grid p,
.detail-grid p,
.prose-section p {
  color: var(--muted);
}

.badge {
  min-height: 28px;
  padding: 0.3rem 0.58rem;
  background: rgba(143, 214, 179, 0.16);
  color: #bdf0d4;
}

.badge.alt {
  background: rgba(155, 187, 232, 0.16);
  color: #c4d9f7;
}

.badge.warm {
  background: rgba(240, 179, 90, 0.17);
  color: #ffd995;
}

.split-section {
  display: grid;
  gap: 1rem;
  align-items: start;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.split-section > p {
  margin: 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.principle-grid article,
.detail-grid article,
.prose-section {
  padding: 1rem;
}

.screenshot-placeholder {
  display: grid;
  min-height: 210px;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(240, 179, 90, 0.13), transparent),
    var(--surface);
  color: var(--muted);
  font-weight: 900;
}

.prose-section {
  max-width: 820px;
}

.signature {
  color: var(--accent-strong);
  font-weight: 900;
}

.timeline {
  display: grid;
  gap: 0.8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  padding: 1rem;
}

.timeline time {
  display: block;
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 900;
}

.timeline p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.site-footer {
  display: grid;
  gap: 1rem;
  padding: 2rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--subtle);
}

.site-footer p {
  margin: 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

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

@keyframes polite-wobble {
  0% { transform: rotate(0deg) translateY(0); }
  35% { transform: rotate(-1.6deg) translateY(-1px); }
  70% { transform: rotate(1.2deg) translateY(0); }
  100% { transform: rotate(0deg) translateY(0); }
}

@keyframes fake-loading {
  0%, 100% { width: 61%; }
  50% { width: 86%; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (min-width: 720px) {
  .nav-toggle {
    display: none;
  }

  .nav-links {
    position: static;
    display: flex;
    align-items: center;
    width: auto;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr) 360px;
  }

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

  .game-card.featured {
    grid-column: span 2;
  }

  .featured {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(240px, 0.92fr);
    gap: 1rem;
    align-items: center;
    padding: 1rem;
  }

  .featured .placeholder-art,
  .featured .game-screenshot-link {
    width: 100%;
    min-height: 0;
    border-radius: var(--radius);
  }

  .featured .card-body {
    min-width: 0;
    padding: 0;
  }

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

  .detail-grid,
  .split-section,
  .site-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer nav {
    justify-content: flex-end;
  }
}

@media (min-width: 980px) {
  .principle-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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