/* ── Design tokens ─────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;600;700;800&family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

:root {
  --bg:      #050a0e;
  --surface: #090f15;
  --border:  oklch(0.25 0.06 195);
  --text:    oklch(0.88 0.03 195);
  --muted:   oklch(0.55 0.04 195);
  --accent:  oklch(0.75 0.22 145);   /* neon green */
  --cyan:    oklch(0.75 0.18 195);   /* neon cyan  */
  --cell-sparse:  rgb(0, 255, 160);
  --cell-stable:  rgb(0, 237, 207);
  --cell-crowded: rgb(0, 220, 255);
  --dead:    #050a0e;
  --grid:    oklch(0.18 0.05 195);
  --btn-h:   44px;
  --radius:  4px;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Space Grotesk', system-ui, sans-serif;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  cursor: crosshair;
}

/* ── App shell ─────────────────────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;             /* dynamic viewport height – handles iOS Safari bar */
}

/* ── Header ────────────────────────────────────────────────────────────────── */
header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 44px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

header h1 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: var(--accent);
}

.stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--muted);
}

.stats span { white-space: nowrap; }
.stats b    { color: var(--text); }

/* ── Canvas wrapper ────────────────────────────────────────────────────────── */
#canvas-wrap {
  flex: 1 1 0;
  overflow: hidden;           /* canvas fills this exactly; no scroll            */
  min-height: 0;
}

#game-canvas {
  display: block;
  touch-action: none;         /* disable browser pan/zoom so touch events fire   */
  cursor: crosshair;
}

/* ── Controls bar ──────────────────────────────────────────────────────────── */
#controls {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--btn-h);
  min-width: var(--btn-h);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
  white-space: nowrap;
}

button:active,
button.active {
  background: color-mix(in srgb, var(--accent) 15%, var(--bg));
  border-color: var(--accent);
  color: var(--accent);
}

/* Play button is wider and more prominent */
#btn-play {
  min-width: 56px;
  font-size: 18px;
}

/* Pattern preset dropdown */
#pattern-select {
  -webkit-appearance: none;
  appearance: none;
  height: var(--btn-h);
  padding: 0 28px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2394a3b8'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  color: var(--text);
  font: inherit;
  font-size: 13px;
;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.1s;
}

#pattern-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Speed row ─────────────────────────────────────────────────────────────── */
.speed-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.speed-row label {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

#speed-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}

#speed-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

#speed-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

#speed-label {
  font-size: 12px;
  color: var(--muted);
  min-width: 44px;
  text-align: right;
}

/* ── Desktop tweaks (landscape or wide screen) ─────────────────────────────── */
@media (min-width: 600px) {
  header h1 { font-size: 15px; }

  #controls {
    flex-direction: row;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
  }

  .btn-row  { gap: 8px; }
  .speed-row { flex: 1; gap: 12px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Landing / Intro screen — Neon Dark Theme
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Scanline overlay ───────────────────────────────────────────────────────── */
#landing::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    oklch(0.0 0 0 / 0.05) 2px,
    oklch(0.0 0 0 / 0.05) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* ── Grid background ────────────────────────────────────────────────────────── */
#landing::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(oklch(0.18 0.05 195) 1px, transparent 1px),
    linear-gradient(90deg, oklch(0.18 0.05 195) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 70%);
}

/* ── Wrapper ────────────────────────────────────────────────────────────────── */
#landing {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 1;
  transition: opacity 0.6s ease;
}

#landing.landing--fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ── Background canvas ──────────────────────────────────────────────────────── */
#landing-bg {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0.38;
  pointer-events: none;
  z-index: 1;
}

/* ── Content card ───────────────────────────────────────────────────────────── */
.landing-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 40px 24px 44px;
  max-width: 900px;
  width: 100%;
  text-align: center;
}

/* ── Title ──────────────────────────────────────────────────────────────────── */
.landing-title {
  font-family: var(--mono);
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.95;
  color: var(--text);
  text-shadow:
    0 0 40px oklch(0.75 0.22 145 / 0.25),
    0 0 80px oklch(0.75 0.22 145 / 0.1);
  animation: landingFadeUp 0.9s ease both;
}

.landing-title br + * { color: var(--accent); text-shadow: 0 0 30px var(--accent); }

.landing-subtitle {
  font-family: var(--sans);
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  font-weight: 400;
  color: oklch(0.78 0.04 195);
  margin-top: -12px;
  max-width: 420px;
  line-height: 1.7;
  padding: 12px 18px;
  border-left: 2px solid oklch(0.75 0.18 195 / 0.5);
  background: oklch(0.04 0.02 195 / 0.4);
  text-align: left;
  animation: landingFadeUp 0.9s 0.15s ease both;
}

/* ── Rule cards row ─────────────────────────────────────────────────────────── */
.rule-cards {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  animation: landingFadeUp 0.9s 0.3s ease both;
}

/* ── Individual rule card ────────────────────────────────────────────────────── */
.rule-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 24px 22px;
  background: oklch(0.07 0.03 195 / 0.8);
  border: 1px solid var(--border);
  border-radius: 0;
  backdrop-filter: blur(8px);
  transition: border-color 0.3s, background 0.3s;
  position: relative;
  overflow: hidden;
}

.rule-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s;
}

.rule-card:hover { border-color: oklch(0.45 0.15 145); background: oklch(0.09 0.04 195 / 0.9); }
.rule-card:hover::after { transform: scaleX(1); }

/* ── Canvas inside rule card ────────────────────────────────────────────────── */
.rule-canvas {
  display: block;
  width: 80px;
  height: 80px;
  image-rendering: pixelated;
}

/* ── Card text ───────────────────────────────────────────────────────────────── */
.rule-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 0 10px var(--accent);
}

.rule-desc {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 400;
  color: oklch(0.7 0.04 195);
  line-height: 1.6;
  max-width: 200px;
}

/* ── Pattern type showcase ───────────────────────────────────────────────────── */
.pattern-showcase {
  width: 100%;
  animation: landingFadeUp 0.9s 0.45s ease both;
}

.showcase-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.showcase-label::before,
.showcase-label::after {
  content: '';
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: var(--border);
}

.pattern-type-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
}

.pattern-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  background: oklch(0.07 0.03 195 / 0.7);
  border: 1px solid var(--border);
  border-radius: 0;
  min-width: 100px;
  transition: border-color 0.2s;
}

.pattern-type-card:hover { border-color: oklch(0.45 0.15 145); }

.pattern-type-card--wide {
  flex-basis: 100%;
}

.demo-canvas {
  display: block;
  image-rendering: pixelated;
}

.pattern-type-name {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-shadow: 0 0 8px var(--accent);
}

.pattern-type-desc {
  font-family: var(--sans);
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.4;
  max-width: 130px;
}

@media (min-width: 600px) {
  .pattern-type-card--wide {
    flex-basis: auto;
  }
}

/* ── Play button ─────────────────────────────────────────────────────────────── */
.landing-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 16px 56px;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;

  background: var(--accent);
  color: #050a0e;
  border: none;
  border-radius: 0;
  clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
  box-shadow:
    0 0 20px oklch(0.75 0.22 145 / 0.4),
    0 0 50px oklch(0.75 0.22 145 / 0.15);
  transition: background 0.25s, box-shadow 0.25s, transform 0.15s;
  animation: landingFadeUp 0.9s 0.6s ease both;
}

.landing-btn:hover:not(:disabled) {
  background: var(--cyan);
  box-shadow:
    0 0 28px oklch(0.75 0.18 195 / 0.6),
    0 0 60px oklch(0.75 0.18 195 / 0.25);
  transform: translateY(-2px);
}

.landing-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.landing-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── Animations ─────────────────────────────────────────────────────────────── */
@keyframes landingFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Desktop layout ─────────────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .landing-title { font-size: clamp(2.5rem, 6vw, 4.5rem); }
  .landing-subtitle { font-size: 0.95rem; text-align: left; }

  .rule-cards {
    flex-direction: row;
    justify-content: center;
    gap: 2px;
  }

  .rule-card {
    flex: 1;
    max-width: 260px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   Design handoff: full neon landing page
   ═══════════════════════════════════════════════════════════════════════════ */

#landing {
  display: block;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

#landing::before {
  position: fixed;
  z-index: 6;
}

#landing::after {
  display: none;
}

#landing-bg {
  position: fixed;
  opacity: 0.38;
}

.landing-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 16px clamp(20px, 5vw, 48px);
  border-bottom: 1px solid oklch(0.2 0.06 195 / 0.55);
  background: oklch(0.04 0.02 195 / 0.78);
  backdrop-filter: blur(14px);
}

.nav-logo {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 20px var(--accent);
}

.nav-logo span {
  color: var(--muted);
  font-weight: 300;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(16px, 4vw, 36px);
}

.nav-links a,
.landing-link,
.nav-play {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  width: auto;
  height: auto;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover,
.landing-link:hover,
.nav-play:hover {
  color: var(--cyan);
}

.landing-hero,
.landing-cta {
  position: relative;
  z-index: 3;
  min-height: 700px;
  height: 100svh;
  display: grid;
  place-items: center;
  padding: 96px 20px 72px;
  overflow: hidden;
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  z-index: 4;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: fadeIn 1.2s 1s ease both;
}

.scroll-text {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s infinite;
}

.landing-grid-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 28%, transparent 76%);
}

.landing-content,
.cta-content {
  position: relative;
  z-index: 4;
  width: min(920px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 0;
  text-align: center;
}

.hero-tag,
.section-tag {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent);
}

.hero-tag {
  border: 1px solid oklch(0.45 0.18 145 / 0.45);
  padding: 7px 16px;
  background: oklch(0.04 0.02 195 / 0.45);
  animation: landingFadeUp 0.8s ease both;
}

.landing-title {
  font-size: clamp(3.25rem, 10vw, 7rem);
  line-height: 0.9;
  color: var(--text);
  text-shadow:
    0 0 60px oklch(0.75 0.22 145 / 0.3),
    0 0 120px oklch(0.75 0.22 145 / 0.1);
  animation: fadeSlideUp 0.9s 0.15s ease both, glitch 6s 1s infinite;
}

.landing-title span {
  color: var(--accent);
  font-style: normal;
  text-shadow: 0 0 40px var(--accent);
}

.landing-title em {
  color: var(--cyan);
  font-style: normal;
  text-shadow: 0 0 40px var(--cyan);
}

.landing-subtitle {
  max-width: 560px;
  margin-top: 0;
  text-align: left;
  font-size: clamp(1rem, 2vw, 1.25rem);
  background: oklch(0.04 0.02 195 / 0.46);
  animation: fadeSlideUp 0.9s 0.3s ease both;
}

.hero-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  animation: fadeSlideUp 0.9s 0.45s ease both;
}

.landing-btn {
  gap: 10px;
  min-height: 54px;
  padding: 16px 38px;
  font-size: 13px;
}

.landing-link {
  border-bottom: 1px solid var(--border);
  padding-bottom: 3px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: clamp(22px, 6vw, 48px);
  flex-wrap: wrap;
  animation: fadeSlideUp 0.9s 0.6s ease both;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 92px;
}

.stat-num {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  text-shadow: 0 0 16px var(--accent);
}

.stat-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.landing-section {
  position: relative;
  z-index: 4;
  padding: clamp(72px, 10vw, 120px) clamp(20px, 5vw, 48px);
  border-top: 1px solid var(--border);
  background: oklch(0.06 0.025 195 / 0.92);
}

.landing-section:nth-of-type(odd) {
  background: oklch(0.035 0.018 195 / 0.92);
}

.section-inner {
  width: min(1200px, 100%);
  margin: 0 auto;
}

.section-tag {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cyan);
  text-shadow: 0 0 12px var(--cyan);
  margin-bottom: 16px;
}

.section-tag::before {
  content: '';
  width: 32px;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.section-title {
  font-family: var(--mono);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 48px;
}

.rule-cards,
.steps-row,
.pattern-type-cards {
  display: grid;
  gap: 2px;
}

.rule-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  animation: none;
}

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

.pattern-type-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rule-card,
.step,
.pattern-type-card {
  align-items: flex-start;
  text-align: left;
  min-width: 0;
  max-width: none;
  min-height: 220px;
  padding: 32px;
  background: oklch(0.07 0.03 195 / 0.76);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.rule-card {
  display: flex;
}

.rule-canvas-wrap {
  align-self: flex-end;
  opacity: 0.72;
}

.rule-number {
  font-family: var(--mono);
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  color: oklch(0.19 0.06 195);
}

.rule-title,
.pattern-type-name,
.step-num {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent);
}

.rule-desc,
.step-desc,
.pattern-type-desc,
.cta-sub {
  max-width: 32ch;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: oklch(0.7 0.04 195);
  line-height: 1.65;
}

.step {
  position: relative;
}

.step-title {
  margin: 24px 0 12px;
  font-family: var(--sans);
  font-size: 1.35rem;
  color: var(--text);
}

.known-patterns {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 48px;
  padding: 32px;
  border: 1px solid var(--border);
  background: oklch(0.07 0.03 195 / 0.55);
}

.known-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 8px;
}

.known-copy {
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

.known-items {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.known-items span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

.known-items i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulseDot 1.5s infinite;
}

.pattern-type-card {
  align-items: center;
  text-align: center;
  min-height: 190px;
}

.demo-canvas,
.rule-canvas {
  image-rendering: pixelated;
}

.landing-cta {
  min-height: 72svh;
  border-top: 1px solid var(--border);
  background: oklch(0.04 0.02 195 / 0.94);
}

#cta-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0.3;
  pointer-events: none;
}

.cta-title {
  font-family: var(--mono);
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 0.95;
}

.cta-title span {
  color: var(--accent);
  text-shadow: 0 0 40px var(--accent);
}

.landing-footer {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(20px, 5vw, 48px);
  border-top: 1px solid var(--border);
  background: var(--bg);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.2); }
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

@keyframes glitch {
  0%, 90%, 100% {
    transform: none;
    text-shadow:
      0 0 60px oklch(0.75 0.22 145 / 0.3),
      0 0 120px oklch(0.75 0.22 145 / 0.1);
  }
  92% {
    transform: translateX(-3px) skewX(-1deg);
    text-shadow: -3px 0 var(--cyan), 3px 0 oklch(0.7 0.2 345 / 0.5);
  }
  94% {
    transform: translateX(3px) skewX(1deg);
    text-shadow: 3px 0 var(--accent), -3px 0 oklch(0.7 0.2 345 / 0.5);
  }
}

@media (max-width: 900px) {
  .rule-cards,
  .steps-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .landing-hero {
    padding-top: 72px;
  }

  .rule-cards,
  .steps-row {
    grid-template-columns: 1fr;
  }

  .rule-card,
  .step,
  .pattern-type-card {
    min-height: 0;
    padding: 26px;
  }

  .landing-footer {
    flex-direction: column;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .landing-title,
  .hero-tag,
  .landing-subtitle,
  .hero-cta,
  .hero-stats,
  .landing-btn {
    animation: none;
  }
}
