/* =============================================================================
   DIE DIE GAMES — style.css
   Strategy: Committed dark. Punk/zine voice.
   Typeface: Archivo variable (400–900, expanded axis).
   Colors: OKLCH throughout — no #000, no #fff.
============================================================================= */

/* ──── TOKENS ──────────────────────────────────────────────────────────────── */
:root {
  /* Surface */
  --bg:           oklch(0.16 0.012 25);
  --bg-raised:    oklch(0.20 0.014 25);
  --bg-border:    oklch(0.24 0.014 25);

  /* Text */
  --text:         oklch(0.93 0.015 80);
  --muted:        oklch(0.65 0.012 50);
  --ink:          oklch(0.42 0.008 50);

  /* Brand */
  --red:          oklch(0.55 0.20 27);
  --red-hover:    oklch(0.60 0.22 27);

  /* Triyang */
  --yellow:       oklch(0.82 0.17 90);
  --yellow-dark:  oklch(0.35 0.06 90);
  --cyan:         oklch(0.75 0.14 195);
  --triyang-bg:   oklch(0.12 0.025 220);

  /* Sekant */
  --green:        oklch(0.42 0.09 145);
  --green-hover:  oklch(0.37 0.10 145);
  --green-text:   oklch(0.22 0.06 145);
  --green-sub:    oklch(0.32 0.04 145);
  --green-light:  oklch(0.94 0.025 145);
  --sekant-bg:    oklch(0.96 0.015 80);

  /* Type */
  --font: 'Archivo', system-ui, sans-serif;

  /* Easing */
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);

  /* Fluid space scale */
  --s-2xs: clamp(0.25rem, 0.5vw, 0.375rem);
  --s-xs:  clamp(0.5rem,  1vw,   0.75rem);
  --s-s:   clamp(0.75rem, 1.5vw, 1rem);
  --s-m:   clamp(1rem,    2.5vw, 1.5rem);
  --s-l:   clamp(1.5rem,  4vw,   2.5rem);
  --s-xl:  clamp(2rem,    6vw,   4rem);
  --s-2xl: clamp(3rem,    8vw,   5.5rem);
  --s-3xl: clamp(4rem,    11vw,  8rem);
}

/* ──── RESET ────────────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(1rem, 1vw + 0.6rem, 1.125rem);
  line-height: 1.65;
  overflow-x: hidden;
}

/* Film grain — subtle, pure CSS */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: overlay;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}

@media (prefers-contrast: more) {
  body::after { opacity: 0; }
}

img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; }

/* Focus ring — keyboard navigation */
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* ──── REVEALS ──────────────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(1.25rem);
  transition:
    opacity  0.75s var(--ease-expo),
    transform 0.75s var(--ease-expo);
}
.reveal.reveal--delay-1 { transition-delay: 0.10s; }
.reveal.reveal--delay-2 { transition-delay: 0.20s; }
.reveal.reveal--delay-3 { transition-delay: 0.32s; }

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ──── HERO ─────────────────────────────────────────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-2xl) var(--s-xl);
  position: relative;
  background-color: oklch(0.98 0.008 80);
  color: oklch(0.25 0.012 50);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red);
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s-m);
  width: 100%;
}

.hero__logo {
  width: clamp(200px, 38vw, 460px);
  height: auto;
}

.hero__sub {
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
  font-weight: 400;
  color: oklch(0.42 0.010 50);
  line-height: 1.5;
}

.hero__sub a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: oklch(0.55 0.20 27 / 0.5);
  transition: color 0.2s;
}
.hero__sub a:hover { color: var(--red); }

/* ──── ABOUT ────────────────────────────────────────────────────────────────── */
.about {
  padding: var(--s-3xl) var(--s-xl);
}

.about__inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-s);
}

@media (min-width: 640px) {
  .about__inner {
    grid-template-columns: 9rem 1fr;
    gap: var(--s-2xl);
    align-items: start;
  }
}

.about__label {
  font-size: 0.725rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--red);
  padding-top: 0.3em;
}

.about__body {
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  font-weight: 400;
  line-height: 1.7;
  max-width: 62ch;
  color: var(--text);
}

.about__body a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: oklch(0.55 0.20 27 / 0.5);
  transition: color 0.2s;
}
.about__body a:hover { color: var(--red); }

/* ──── GAME PANELS (shared) ─────────────────────────────────────────────────── */
.game__content {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-xl);
  align-items: center;
  position: relative;
  z-index: 1;
}

@media (min-width: 900px) {
  .game--triyang .game__content { grid-template-columns: 5fr 7fr; }
  .game--sekant  .game__content { grid-template-columns: 7fr 5fr; }
}

.game__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: var(--s-xs);
  display: block;
}

.game__title {
  font-size: clamp(2.5rem, 5vw + 0.5rem, 5.5rem);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.025em;
  font-stretch: 125%;
  margin-bottom: var(--s-s);
  overflow-wrap: break-word;
}

.game__sub {
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  font-weight: 700;
  margin-bottom: var(--s-s);
}

.game__desc {
  font-size: clamp(0.9rem, 1.1vw, 1rem);
  line-height: 1.7;
  max-width: 44ch;
  margin-bottom: var(--s-l);
}

.game__cta {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--s-s) var(--s-l);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  text-decoration: none;
  transition:
    transform  0.25s var(--ease-expo),
    background-color 0.2s;
  cursor: pointer;
}

.game__cta:hover { transform: translateY(-2px); }

.game__cta-url {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  margin-top: 1px;
}

.game__image-wrap { position: relative; }

.game__image-link {
  display: block;
  outline-offset: 4px;
}

.game__image {
  width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 20px 60px oklch(0 0 0 / 0.45);
  transition:
    transform  0.5s var(--ease-expo),
    box-shadow 0.5s var(--ease-expo);
}

.game__image-link:hover .game__image {
  transform: translateY(-4px);
  box-shadow: 0 28px 80px oklch(0 0 0 / 0.55);
}

.game--sekant .game__image {
  box-shadow: 0 20px 60px oklch(0.42 0.09 145 / 0.18);
}
.game--sekant .game__image-link:hover .game__image {
  box-shadow: 0 28px 80px oklch(0.42 0.09 145 / 0.28);
}

/* ──── TRIYANG ──────────────────────────────────────────────────────────────── */
.game--triyang {
  background-color: var(--triyang-bg);
  border-top: 4px solid var(--yellow);
  padding: var(--s-2xl) var(--s-xl);
  position: relative;
  overflow: hidden;
}

/* Subtle radar grid */
.game--triyang::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(oklch(0.82 0.17 90 / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, oklch(0.82 0.17 90 / 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
}

.game--triyang .game__label { color: var(--yellow); }
.game--triyang .game__title { color: var(--text); }
.game--triyang .game__sub   { color: var(--cyan); }
.game--triyang .game__desc  { color: oklch(0.78 0.015 200); }

.game--triyang .game__cta {
  background-color: var(--yellow);
  color: var(--triyang-bg);
}
.game--triyang .game__cta:hover    { background-color: oklch(0.88 0.16 90); }
.game--triyang .game__cta-url      { color: var(--yellow-dark); }

/* ──── SEKANT ───────────────────────────────────────────────────────────────── */
.game--sekant {
  background-color: var(--sekant-bg);
  border-top: 4px solid var(--green);
  padding: var(--s-2xl) var(--s-xl);
  color: var(--green-text);
  position: relative;
  overflow: hidden;
}

/* Topographic contour — generated by app.js (simplex + marching squares) */
.game__topo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.game__topo path {
  fill: none;
  stroke: oklch(0.55 0.045 155 / 0.3);
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-width: 1.2;
}

.game--sekant .game__label { color: var(--green); }
.game--sekant .game__title { color: oklch(0.24 0.07 145); }
.game--sekant .game__sub   { color: var(--green); }
.game--sekant .game__desc  { color: var(--green-sub); }

.game--sekant .game__cta {
  background-color: var(--green);
  color: var(--green-light);
}
.game--sekant .game__cta:hover    { background-color: var(--green-hover); }
.game--sekant .game__cta-url      { color: oklch(0.72 0.07 145); }

/* ──── FOOTER ───────────────────────────────────────────────────────────────── */
.footer {
  background-color: var(--bg-raised);
  border-top: 2px solid var(--bg-border);
  padding: var(--s-xl) var(--s-xl);
}

.footer__inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-m);
}

@media (min-width: 640px) {
  .footer__inner {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--s-l);
  }
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 0.45em;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.02em;
  flex: 1 0 auto;
}

.footer__skull {
  font-size: 1.2em;
  line-height: 1;
  color: var(--red);
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-m);
}

.footer__links a {
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s;
}
.footer__links a:hover { color: var(--red); }

.footer__copy {
  width: 100%;
  font-size: 0.7rem;
  color: var(--ink);
}
