/* =========================================================
   AKUZNETSOV.SPACE — design tokens
   ========================================================= */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(2.75rem, 0.75rem + 6.5vw, 7rem);

  /* Spacing (4px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 1000px;
  --content-wide: 1280px;
  --content-full: 100%;

  /* Fonts */
  --font-display: 'Clash Display', 'Segoe UI', sans-serif;
  --font-body: 'Satoshi', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;
}

/* ---------- DARK (default) — akuznetsov.space ---------- */
:root,
[data-theme='dark'] {
  --color-bg: #0a0910;
  --color-surface: #100e19;
  --color-surface-2: #16131f;
  --color-surface-offset: #1c1826;
  --color-surface-offset-2: #241f30;
  --color-surface-dynamic: #2c2638;
  --color-divider: #2a2534;
  --color-border: #383049;

  --color-text: #eeecf4;
  --color-text-muted: #9a93ab;
  --color-text-faint: #655d78;
  --color-text-inverse: #0a0910;

  /* Primary accent — magenta/fuchsia */
  --color-primary: #ff3ea5;
  --color-primary-hover: #ff64b7;
  --color-primary-active: #d4227f;
  --color-primary-highlight: #3a1b30;

  /* Secondary accent — cyan */
  --color-accent: #33e6d8;
  --color-accent-hover: #6bf0e5;
  --color-accent-active: #1fb8ad;
  --color-accent-highlight: #123330;

  --color-warning: #ffb84d;
  --color-warning-highlight: #3a2c14;
  --color-error: #ff5c7a;
  --color-error-highlight: #3a1620;
  --color-success: #4ee08a;
  --color-success-highlight: #123322;

  --shadow-sm: 0 1px 2px oklch(0 0 0 / 0.4);
  --shadow-md: 0 8px 24px oklch(0 0 0 / 0.5);
  --shadow-lg: 0 20px 48px oklch(0 0 0 / 0.6);
  --glow-primary: 0 0 32px oklch(from var(--color-primary) l c h / 0.35);
  --glow-accent: 0 0 32px oklch(from var(--color-accent) l c h / 0.3);
}

/* ---------- LIGHT ---------- */
[data-theme='light'] {
  --color-bg: #f5f3fa;
  --color-surface: #ffffff;
  --color-surface-2: #fbfaff;
  --color-surface-offset: #efecf7;
  --color-surface-offset-2: #e6e1f2;
  --color-surface-dynamic: #ddd6ed;
  --color-divider: #e0dced;
  --color-border: #d2caea;

  --color-text: #1c1826;
  --color-text-muted: #625c74;
  --color-text-faint: #9a93ab;
  --color-text-inverse: #f5f3fa;

  --color-primary: #d4227f;
  --color-primary-hover: #b81a6c;
  --color-primary-active: #931458;
  --color-primary-highlight: #f8d9ec;

  --color-accent: #0f9b90;
  --color-accent-hover: #0c8177;
  --color-accent-active: #086961;
  --color-accent-highlight: #d3f2ef;

  --color-warning: #b3690a;
  --color-warning-highlight: #f6e4c8;
  --color-error: #d13355;
  --color-error-highlight: #f8d7de;
  --color-success: #1f9354;
  --color-success-highlight: #d4f2e0;

  --shadow-sm: 0 1px 2px oklch(0.2 0.02 300 / 0.08);
  --shadow-md: 0 8px 24px oklch(0.2 0.02 300 / 0.1);
  --shadow-lg: 0 20px 48px oklch(0.2 0.02 300 / 0.14);
  --glow-primary: 0 0 32px oklch(from var(--color-primary) l c h / 0.18);
  --glow-accent: 0 0 32px oklch(from var(--color-accent) l c h / 0.16);
}

/* =========================================================
   Global helpers
   ========================================================= */

.container {
  max-width: var(--content-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
.container--default {
  max-width: var(--content-default);
}
.container--narrow {
  max-width: var(--content-narrow);
}

section {
  padding-block: clamp(var(--space-12), 7vw, var(--space-24));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
}
.eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  box-shadow: 0 0 8px var(--color-accent);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-title {
  font-size: var(--text-2xl);
  margin-block: var(--space-3) var(--space-4);
}
.section-sub {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  max-width: 60ch;
}

.gradient-text {
  background: linear-gradient(in oklab, var(--color-primary), var(--color-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  min-height: 44px;
  white-space: nowrap;
  text-decoration: none;
}
.btn--primary {
  background: linear-gradient(120deg, var(--color-primary), #c930d0 60%, var(--color-accent) 130%);
  color: #ffffff;
  box-shadow: var(--glow-primary);
}
.btn--primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 40px oklch(from var(--color-primary) l c h / 0.5);
}
.btn--ghost {
  background: oklch(from var(--color-text) l c h / 0.04);
  border-color: oklch(from var(--color-text) l c h / 0.14);
  color: var(--color-text);
}
.btn--ghost:hover {
  background: oklch(from var(--color-text) l c h / 0.08);
  border-color: oklch(from var(--color-accent) l c h / 0.5);
  color: var(--color-accent);
}

/* =========================================================
   Header / Nav
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: oklch(from var(--color-bg) l c h / 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid oklch(from var(--color-text) l c h / 0.08);
  transition:
    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-header--hidden {
  transform: translateY(-100%);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--color-text);
  text-decoration: none;
  flex-shrink: 0;
}
.logo svg {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.main-nav a {
  position: relative;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
}
.main-nav a:hover {
  color: var(--color-text);
  background: oklch(from var(--color-text) l c h / 0.06);
}
.main-nav a[aria-current='page'] {
  color: var(--color-bg);
  background: linear-gradient(120deg, var(--color-primary), var(--color-accent));
}
[data-theme='light'] .main-nav a[aria-current='page'] {
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  border: 1px solid oklch(from var(--color-text) l c h / 0.1);
}
.theme-toggle:hover {
  color: var(--color-accent);
  border-color: oklch(from var(--color-accent) l c h / 0.4);
}

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text);
}

@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
  }
  .main-nav {
    position: fixed;
    inset: 68px var(--space-4) auto var(--space-4);
    flex-direction: column;
    align-items: stretch;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-2);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition:
      opacity 0.2s ease,
      transform 0.2s ease,
      visibility 0.2s;
  }
  .main-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .main-nav a {
    padding: var(--space-3) var(--space-4);
  }
}

/* =========================================================
   Hero
   ========================================================= */

.hero {
  position: relative;
  padding-block: clamp(var(--space-16), 12vw, var(--space-32)) clamp(var(--space-12), 8vw, var(--space-20));
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 30% 0%, oklch(from var(--color-primary) l c h / 0.22), transparent 60%),
    linear-gradient(180deg, oklch(from var(--color-bg) l c h / 0.4) 0%, var(--color-bg) 92%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: var(--space-12);
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.hero-title {
  font-size: var(--text-hero);
  margin-block: var(--space-5) var(--space-6);
}
.hero-lede {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  max-width: 52ch;
  margin-bottom: var(--space-8);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.hero-visual {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  aspect-ratio: 4/3;
  border: 1px solid oklch(from var(--color-text) l c h / 0.1);
  box-shadow: var(--shadow-lg);
}
.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, transparent 40%, oklch(from var(--color-bg) l c h / 0.65));
  pointer-events: none;
}
.hero-visual-badge {
  position: absolute;
  bottom: var(--space-4);
  left: var(--space-4);
  right: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: oklch(from var(--color-surface) l c h / 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid oklch(from var(--color-text) l c h / 0.1);
  border-radius: var(--radius-lg);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  z-index: 1;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--color-error);
  box-shadow: 0 0 10px var(--color-error);
  flex-shrink: 0;
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* Stats strip */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-16);
  padding-top: var(--space-10);
  border-top: 1px solid oklch(from var(--color-text) l c h / 0.08);
}
.stat-item .stat-num {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-text);
}
.stat-item .stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
@media (max-width: 700px) {
  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================================================
   Cards / grids
   ========================================================= */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-6);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}
.link-card:hover {
  border-color: oklch(from var(--color-primary) l c h / 0.5);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.link-card .icon-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--color-primary-highlight);
  color: var(--color-primary);
}
.link-card h3 {
  font-size: var(--text-lg);
}
.link-card p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.section-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-10);
}
@media (max-width: 860px) {
  .section-grid-3 {
    grid-template-columns: 1fr;
  }
}

.section-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-10);
  max-width: var(--content-default);
  margin-inline: auto;
}
@media (max-width: 700px) {
  .section-grid-2 {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  border-top: 1px solid oklch(from var(--color-text) l c h / 0.08);
  padding-block: var(--space-12);
  margin-top: var(--space-12);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  align-items: center;
  justify-content: space-between;
}
.footer-links {
  display: flex;
  gap: var(--space-5);
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
}
.footer-links a:hover {
  color: var(--color-accent);
}
.footer-social {
  display: flex;
  gap: var(--space-3);
}
.footer-social a {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
.footer-social a:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.footer-copy {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  width: 100%;
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid oklch(from var(--color-text) l c h / 0.06);
}

/* =========================================================
   Page hero (interior pages)
   ========================================================= */

.page-hero {
  position: relative;
  padding-block: clamp(var(--space-14), 8vw, var(--space-20)) clamp(var(--space-10), 6vw, var(--space-16));
  overflow: hidden;
  text-align: center;
}
.page-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
}
.page-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
}
.page-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, oklch(from var(--color-bg) l c h / 0.35) 0%, var(--color-bg) 96%);
}
.page-hero h1 {
  font-size: var(--text-2xl);
  margin-block: var(--space-3) var(--space-3);
}
.page-hero p {
  color: var(--color-text-muted);
  font-size: var(--text-base);
  max-width: 56ch;
  margin-inline: auto;
}

/* =========================================================
   GAMES PAGE
   ========================================================= */

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-8);
}
.filter-chip {
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
}
.filter-chip:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.filter-chip.is-active {
  background: linear-gradient(120deg, var(--color-primary), var(--color-accent));
  color: #fff;
  border-color: transparent;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-10);
}
@media (max-width: 980px) {
  .game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 620px) {
  .game-grid {
    grid-template-columns: 1fr;
  }
}

.game-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4/5;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}
.game-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.game-card:hover img {
  transform: scale(1.06);
}
.game-card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-5);
  background: linear-gradient(0deg, oklch(0.05 0 0 / 0.92) 0%, oklch(0.05 0 0 / 0.15) 55%, transparent 80%);
}
.game-card-status {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  margin-bottom: auto;
  color: #fff;
}
.status-playing {
  background: oklch(from var(--color-success) l c h / 0.85);
}
.status-modding {
  background: oklch(from var(--color-primary) l c h / 0.85);
}
.status-backlog {
  background: oklch(from var(--color-text-muted) l c h / 0.6);
}
.game-card h3 {
  font-size: var(--text-lg);
  color: #fff;
}
.game-card .game-meta {
  font-size: var(--text-xs);
  color: oklch(1 0 0 / 0.7);
  margin-top: var(--space-1);
}
.game-progress {
  margin-top: var(--space-3);
  height: 5px;
  border-radius: var(--radius-full);
  background: oklch(1 0 0 / 0.15);
  overflow: hidden;
}
.game-progress > span {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

.tag-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-top: var(--space-3);
}
.tag {
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  background: oklch(1 0 0 / 0.12);
  color: #fff;
}

/* =========================================================
   CATS PAGE
   ========================================================= */

.cat-grid {
  columns: 3 280px;
  column-gap: var(--space-6);
  margin-top: var(--space-10);
}
.cat-grid figure {
  break-inside: avoid;
  margin-bottom: var(--space-6);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  position: relative;
}
.cat-grid img {
  width: 100%;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.cat-grid figure:hover img {
  transform: scale(1.04);
}
.cat-grid figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4) var(--space-4) var(--space-3);
  background: linear-gradient(0deg, oklch(0.05 0 0 / 0.85), transparent);
  color: #fff;
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.paw-count {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  color: oklch(1 0 0 / 0.85);
}

.fact-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  margin-top: var(--space-16);
}
@media (max-width: 780px) {
  .fact-strip {
    grid-template-columns: 1fr;
  }
}
.fact-card {
  padding: var(--space-6);
  text-align: center;
}
.fact-card .fact-icon {
  width: 44px;
  height: 44px;
  margin-inline: auto var(--space-4);
  color: var(--color-primary);
}
.fact-card h3 {
  font-size: var(--text-base);
  margin-bottom: var(--space-2);
}
.fact-card p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* =========================================================
   Scroll reveal
   ========================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}
