/* =============================================================
   AissaGames — Official Website
   style.css — Core design system, layout & components
   Handcrafted. No frameworks. Vanilla CSS3.
   ============================================================= */

/* -------------------------------------------------------------
   1. Design Tokens (CSS Custom Properties)
   Dark luxury is the default theme. Light theme overrides
   live in dark.css under [data-theme="light"].
   ------------------------------------------------------------- */
:root {
  /* Brand palette */
  --emerald-900: #05231a;
  --emerald-800: #073a2a;
  --emerald-700: #0a4d38;
  --emerald-600: #0f6a4d;
  --emerald-500: #14855f;
  --emerald-400: #1fa877;
  --emerald-300: #3fd39b;
  --emerald-200: #7fe6bf;

  --navy-950: #050a18;
  --navy-900: #070d21;
  --navy-800: #0b1531;
  --navy-700: #101d42;
  --navy-600: #16295c;

  --gold-600: #b98a2e;
  --gold-500: #d8ab45;
  --gold-400: #e6c069;
  --gold-300: #f0d492;

  --ink-100: #f4f7fb;
  --ink-200: #dfe6f0;
  --ink-300: #b7c2d4;
  --ink-400: #8b98ad;

  /* Semantic (dark default) */
  --bg: #04060f;
  --bg-elevated: #070b19;
  --bg-gradient-1: #061027;
  --bg-gradient-2: #04160f;
  --bg-gradient-3: #04060f;

  --surface: rgba(16, 26, 54, 0.55);
  --surface-solid: #0a1129;
  --surface-border: rgba(127, 230, 191, 0.14);
  --surface-border-strong: rgba(127, 230, 191, 0.28);

  --text: var(--ink-100);
  --text-soft: var(--ink-300);
  --text-muted: var(--ink-400);

  --primary: var(--emerald-400);
  --primary-strong: var(--emerald-300);
  --secondary: var(--navy-700);
  --accent: var(--gold-400);

  --glow-primary: rgba(31, 168, 119, 0.45);
  --glow-accent: rgba(230, 192, 105, 0.35);

  /* Typography */
  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-display: "SF Pro Display", "Segoe UI", system-ui,
    -apple-system, "Helvetica Neue", Arial, sans-serif;

  --fs-hero: clamp(2.6rem, 6vw, 5rem);
  --fs-h1: clamp(2rem, 4.2vw, 3.2rem);
  --fs-h2: clamp(1.55rem, 3vw, 2.3rem);
  --fs-h3: clamp(1.2rem, 2vw, 1.5rem);
  --fs-body: 1.02rem;
  --fs-small: 0.9rem;

  --lh-tight: 1.12;
  --lh-snug: 1.35;
  --lh-body: 1.7;

  /* Spacing scale */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;
  --sp-10: 8rem;

  /* Radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 32px rgba(2, 6, 20, 0.5);
  --shadow-lg: 0 28px 70px rgba(2, 6, 20, 0.65);
  --shadow-glow: 0 0 40px var(--glow-primary);

  /* Layout */
  --container: 1200px;
  --container-wide: 1440px;
  --nav-h: 72px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 160ms;
  --dur: 320ms;
  --dur-slow: 640ms;

  --focus-ring: 0 0 0 3px rgba(63, 211, 155, 0.5);

  /* Native UI (form controls, scrollbars) match the dark theme by default. */
  color-scheme: dark;
}

/* -------------------------------------------------------------
   2. Reset & Base
   ------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 700px at 15% -10%, var(--bg-gradient-1), transparent 60%),
    radial-gradient(1000px 600px at 90% 0%, var(--bg-gradient-2), transparent 55%),
    linear-gradient(180deg, var(--bg-gradient-3), var(--bg));
  background-repeat: no-repeat;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--primary-strong);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}

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

ul,
ol {
  padding-left: 1.25rem;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

p {
  color: var(--text-soft);
}

strong {
  color: var(--text);
  font-weight: 600;
}

button {
  font-family: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid transparent; /* keep an outline in forced-colors mode */
  box-shadow: var(--focus-ring);
}

/* Give focus rings on otherwise square inline targets a small radius,
   while buttons, chips, and pills keep their own shape. */
a:focus-visible,
.nav__link:focus-visible {
  border-radius: var(--r-sm);
}

/* Windows High Contrast / forced-colors: show a real outline. */
@media (forced-colors: active) {
  :focus-visible {
    outline: 2px solid Highlight;
  }
}

/* Accessible skip link — hidden off-screen via transform so it never
   contributes to horizontal scroll, revealed on keyboard focus. */
.skip-link {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  background: var(--emerald-500);
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: 0 0 var(--r-sm) 0;
  font-weight: 600;
  transform: translateY(-130%);
  transition: transform var(--dur-fast) var(--ease);
}

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

/* -------------------------------------------------------------
   3. Layout helpers
   ------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}

.container--wide {
  max-width: var(--container-wide);
}

.section {
  padding-block: clamp(3.5rem, 8vw, 7rem);
  position: relative;
}

.section--tight {
  padding-block: clamp(2.5rem, 5vw, 4rem);
}

.grid {
  display: grid;
  gap: var(--sp-6);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--sp-3);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.section-head {
  max-width: 640px;
  margin-bottom: var(--sp-7);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.section-head--center .eyebrow::before {
  display: none;
}

.section-title {
  font-size: var(--fs-h2);
  margin-bottom: var(--sp-3);
}

.section-sub {
  font-size: 1.05rem;
  color: var(--text-soft);
}

.text-gradient {
  background: linear-gradient(120deg, var(--emerald-300), var(--gold-400) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* -------------------------------------------------------------
   4. Buttons
   ------------------------------------------------------------- */
.btn {
  --btn-bg: var(--emerald-500);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.6rem;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  color: #fff;
  background: var(--btn-bg);
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--dur-fast) var(--ease),
    box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn--primary {
  background: linear-gradient(135deg, var(--emerald-400), var(--emerald-600));
  box-shadow: 0 10px 30px rgba(15, 106, 77, 0.4), var(--shadow-glow);
}

.btn--primary:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(31, 168, 119, 0.5), 0 0 50px var(--glow-primary);
}

.btn--gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: #1a1204;
}

.btn--gold:hover {
  color: #1a1204;
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(216, 171, 69, 0.4);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--surface-border-strong);
  color: var(--text);
  backdrop-filter: blur(8px);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: var(--primary);
  background: rgba(31, 168, 119, 0.12);
  transform: translateY(-2px);
}

.btn--danger {
  background: linear-gradient(135deg, #d8492e, #a3241a);
}

.btn--danger:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(216, 73, 46, 0.4);
}

.btn--block {
  width: 100%;
}

.btn--lg {
  padding: 1.05rem 2rem;
  font-size: 1.05rem;
}

/* Ripple element injected by JS */
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
  z-index: -1;
  animation: ripple 600ms var(--ease-out);
}

/* -------------------------------------------------------------
   5. Glass card
   ------------------------------------------------------------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: var(--shadow-md);
  transition: transform var(--dur) var(--ease),
    border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(127, 230, 191, 0.25), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
  pointer-events: none;
}

.card--hover:hover {
  transform: translateY(-6px);
  border-color: var(--surface-border-strong);
  box-shadow: var(--shadow-lg);
}

.card--hover:hover::before {
  opacity: 1;
}

.card__icon {
  display: inline-grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: var(--r-md);
  margin-bottom: var(--sp-4);
  background: linear-gradient(135deg, rgba(31, 168, 119, 0.2), rgba(11, 21, 49, 0.5));
  border: 1px solid var(--surface-border);
  color: var(--primary-strong);
}

.card__icon svg {
  width: 26px;
  height: 26px;
}

.card__title {
  font-size: var(--fs-h3);
  margin-bottom: var(--sp-2);
}

.card__text {
  font-size: 0.98rem;
  color: var(--text-soft);
}

/* -------------------------------------------------------------
   6. Navbar
   ------------------------------------------------------------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.is-scrolled {
  background: rgba(4, 6, 15, 0.72);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom-color: var(--surface-border);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.nav__inner {
  width: 100%;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.brand:hover {
  color: var(--text);
}

.brand__mark {
  width: 38px;
  height: 38px;
  flex: none;
}

.brand__name b {
  color: var(--primary-strong);
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav__link {
  position: relative;
  display: inline-block;
  padding: 0.5rem 0.85rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-soft);
  border-radius: var(--r-sm);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.25rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--emerald-300), var(--gold-400));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}

.nav__link:hover,
.nav__link[aria-current="page"] {
  color: var(--text);
}

.nav__link:hover::after,
.nav__link[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Theme toggle */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: var(--r-pill);
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  transition: color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--surface-border-strong);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.theme-toggle .icon-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .icon-sun {
  display: block;
}

[data-theme="light"] .theme-toggle .icon-moon {
  display: none;
}

/* Hamburger */
.nav__toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--surface-border);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.03);
  position: relative;
}

.nav__toggle span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--dur) var(--ease), opacity var(--dur-fast) var(--ease);
}

.nav__toggle span:nth-child(1) {
  top: 15px;
}

.nav__toggle span:nth-child(2) {
  top: 21px;
}

.nav__toggle span:nth-child(3) {
  top: 27px;
}

.nav__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav__toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* -------------------------------------------------------------
   7. Hero
   ------------------------------------------------------------- */
.hero {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(3rem, 8vw, 6rem));
  padding-bottom: clamp(3rem, 8vw, 6rem);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.6;
}

.hero__orb--1 {
  width: 520px;
  height: 520px;
  top: -120px;
  left: -60px;
  background: radial-gradient(circle, rgba(31, 168, 119, 0.55), transparent 70%);
}

.hero__orb--2 {
  width: 460px;
  height: 460px;
  bottom: -160px;
  right: -40px;
  background: radial-gradient(circle, rgba(230, 192, 105, 0.32), transparent 70%);
}

.hero__orb--3 {
  width: 400px;
  height: 400px;
  top: 30%;
  right: 30%;
  background: radial-gradient(circle, rgba(22, 41, 92, 0.6), transparent 70%);
}

.hero__grid-overlay {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(127, 230, 191, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 230, 191, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 40%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 40%, transparent 75%);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero__content {
  max-width: 640px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem 0.4rem 0.5rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-bottom: var(--sp-5);
  backdrop-filter: blur(10px);
}

.hero__badge b {
  display: inline-grid;
  place-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--emerald-400), var(--emerald-600));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.hero__title {
  font-size: var(--fs-hero);
  line-height: 1.04;
  margin-bottom: var(--sp-5);
}

.hero__lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-soft);
  margin-bottom: var(--sp-6);
  max-width: 34ch;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  margin-bottom: var(--sp-6);
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(1.2rem, 3vw, 2.5rem);
}

.stat__num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--text);
}

.stat__num b {
  color: var(--accent);
}

.stat__label {
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Hero visual — Kharbga board */
.hero__visual {
  position: relative;
  display: grid;
  place-items: center;
}

.board-card {
  position: relative;
  width: min(100%, 440px);
  padding: var(--sp-6);
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--surface-border-strong);
  backdrop-filter: blur(22px) saturate(150%);
  box-shadow: var(--shadow-lg), 0 0 80px rgba(31, 168, 119, 0.15);
}

.board-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.board-card__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.board-card__tag {
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--r-pill);
  background: rgba(230, 192, 105, 0.14);
  border: 1px solid rgba(230, 192, 105, 0.3);
  color: var(--gold-300);
}

.board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  aspect-ratio: 1;
  padding: 8px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--emerald-800), var(--navy-800));
  border: 1px solid var(--surface-border);
}

.board__cell {
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  place-items: center;
  position: relative;
}

.board__cell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(127, 230, 191, 0.05);
}

.board__piece {
  width: 68%;
  height: 68%;
  border-radius: 50%;
}

.board__piece--a {
  background: radial-gradient(circle at 35% 30%, var(--gold-300), var(--gold-600));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 -3px 6px rgba(0, 0, 0, 0.3);
}

.board__piece--b {
  background: radial-gradient(circle at 35% 30%, var(--emerald-200), var(--emerald-600));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 -3px 6px rgba(0, 0, 0, 0.3);
}

/* -------------------------------------------------------------
   8. Feature / link grids
   ------------------------------------------------------------- */
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

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

/* Quick-link tiles */
.linktile {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
  text-decoration: none;
  color: var(--text);
}

.linktile:hover {
  color: var(--text);
}

.linktile__arrow {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform var(--dur) var(--ease), color var(--dur) var(--ease);
}

.card--hover:hover .linktile__arrow {
  transform: translateX(4px);
  color: var(--accent);
}

/* Featured game split */
.feature-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.feature-list {
  list-style: none;
  padding: 0;
  margin-top: var(--sp-5);
  display: grid;
  gap: var(--sp-3);
}

.feature-list li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  color: var(--text-soft);
}

.feature-list svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--primary-strong);
  margin-top: 2px;
}

/* Vision band */
.vision {
  position: relative;
  border-radius: var(--r-xl);
  padding: clamp(2.5rem, 6vw, 5rem);
  background:
    radial-gradient(600px 300px at 80% 0%, rgba(31, 168, 119, 0.14), transparent 60%),
    linear-gradient(135deg, rgba(11, 21, 49, 0.7), rgba(7, 58, 42, 0.55));
  border: 1px solid var(--surface-border-strong);
  overflow: hidden;
  backdrop-filter: blur(14px);
}

/* -------------------------------------------------------------
   9. Footer
   ------------------------------------------------------------- */
.footer {
  position: relative;
  margin-top: var(--sp-9);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--surface-border);
  background: linear-gradient(180deg, transparent, rgba(4, 8, 20, 0.6));
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: var(--sp-6);
  padding-bottom: var(--sp-7);
}

.footer__brand p {
  margin-top: var(--sp-4);
  max-width: 34ch;
  font-size: 0.92rem;
}

.footer__col h2 {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}

.footer__col ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.footer__col a {
  color: var(--text-soft);
  font-size: 0.94rem;
}

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

.footer__social {
  display: flex;
  gap: 0.6rem;
  margin-top: var(--sp-5);
}

.footer__social a {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  border: 1px solid var(--surface-border);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.02);
}

.footer__social a:hover {
  color: var(--accent);
  border-color: var(--surface-border-strong);
  transform: translateY(-2px);
}

.footer__social svg {
  width: 18px;
  height: 18px;
}

.footer__bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  align-items: center;
  justify-content: space-between;
  padding-block: var(--sp-5);
  border-top: 1px solid var(--surface-border);
  font-size: 0.86rem;
  color: var(--text-muted);
}

.footer__bar a {
  color: var(--text-soft);
}

.badge-version {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--surface-border);
  font-size: 0.78rem;
  color: var(--text-soft);
}

.badge-version::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald-400);
  box-shadow: 0 0 8px var(--emerald-400);
}

/* -------------------------------------------------------------
   10. Legal / document pages
   ------------------------------------------------------------- */
.page-head {
  padding-top: calc(var(--nav-h) + clamp(2.5rem, 6vw, 4rem));
  padding-bottom: clamp(2rem, 4vw, 3rem);
  position: relative;
}

.page-head__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  font-size: 0.86rem;
  color: var(--text-muted);
}

.page-head__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.02);
}

.doc-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.doc-toc {
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
  align-self: start;
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  backdrop-filter: blur(14px);
  max-height: calc(100vh - var(--nav-h) - 3rem);
  overflow-y: auto;
}

.doc-toc h2 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
}

.doc-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
  display: grid;
  gap: 0.2rem;
}

.doc-toc a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  color: var(--text-soft);
  border-left: 2px solid transparent;
}

.doc-toc a:hover,
.doc-toc a.is-active {
  color: var(--text);
  background: rgba(31, 168, 119, 0.08);
  border-left-color: var(--primary);
}

.doc-body {
  max-width: 78ch;
}

.doc-body h2 {
  font-size: var(--fs-h2);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-4);
  padding-top: 0.5rem;
  scroll-margin-top: calc(var(--nav-h) + 1.5rem);
}

.doc-body h2:first-of-type {
  margin-top: var(--sp-5);
}

.doc-body h3 {
  font-size: var(--fs-h3);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-3);
  color: var(--primary-strong);
}

.doc-body p,
.doc-body li {
  color: var(--text-soft);
}

.doc-body p {
  margin-bottom: var(--sp-4);
}

.doc-body ul,
.doc-body ol {
  margin-bottom: var(--sp-4);
  display: grid;
  gap: 0.5rem;
}

.doc-body a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(63, 211, 155, 0.4);
}

.doc-note {
  padding: var(--sp-5);
  border-radius: var(--r-md);
  border: 1px solid var(--surface-border-strong);
  background: rgba(31, 168, 119, 0.06);
  margin-bottom: var(--sp-5);
}

.doc-note--warn {
  border-color: rgba(216, 171, 69, 0.35);
  background: rgba(216, 171, 69, 0.07);
}

.doc-note--danger {
  border-color: rgba(216, 73, 46, 0.4);
  background: rgba(216, 73, 46, 0.08);
}

.doc-note strong {
  display: block;
  margin-bottom: 0.3rem;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--sp-5);
  font-size: 0.92rem;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--surface-border);
}

.doc-table th,
.doc-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--surface-border);
}

.doc-table th {
  background: rgba(11, 21, 49, 0.6);
  color: var(--text);
  font-weight: 600;
}

.doc-table td {
  color: var(--text-soft);
}

.doc-table tr:last-child td {
  border-bottom: none;
}

.table-scroll {
  overflow-x: auto;
}

/* -------------------------------------------------------------
   11. Forms
   ------------------------------------------------------------- */
.form-field {
  display: grid;
  gap: 0.4rem;
  margin-bottom: var(--sp-4);
}

.form-field label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.form-field label .req {
  color: var(--accent);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md);
  transition: border-color var(--dur-fast) var(--ease),
    box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-muted);
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(31, 168, 119, 0.05);
  box-shadow: var(--focus-ring);
}

.textarea {
  resize: vertical;
  min-height: 140px;
  line-height: 1.6;
}

.form-field .error-msg {
  font-size: 0.82rem;
  color: #f0916f;
  min-height: 1em;
}

.form-field.has-error .input,
.form-field.has-error .textarea {
  border-color: #d8492e;
}

.form-status {
  padding: var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--surface-border);
  font-size: 0.92rem;
  margin-top: var(--sp-4);
}

.form-status.is-success {
  border-color: var(--surface-border-strong);
  background: rgba(31, 168, 119, 0.1);
  color: var(--emerald-200);
}

.form-status[hidden] {
  display: none;
}

/* Contact info list */
.info-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--sp-4);
}

.info-list li {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
}

.info-list .info-ico {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: var(--r-md);
  background: rgba(31, 168, 119, 0.12);
  border: 1px solid var(--surface-border);
  color: var(--primary-strong);
}

.info-list .info-ico svg {
  width: 22px;
  height: 22px;
}

.info-list dt {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.info-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 500;
}

/* -------------------------------------------------------------
   12. FAQ / Support accordion
   ------------------------------------------------------------- */
.faq-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
}

.faq-search {
  position: relative;
  flex: 1 1 280px;
  max-width: 460px;
}

.faq-search svg {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.faq-search .input {
  padding-left: 2.6rem;
}

.faq-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  padding: 0.45rem 0.95rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-soft);
  font-size: 0.86rem;
  font-weight: 500;
  transition: all var(--dur-fast) var(--ease);
}

.chip:hover {
  border-color: var(--surface-border-strong);
  color: var(--text);
}

.chip.is-active {
  background: linear-gradient(135deg, var(--emerald-500), var(--emerald-700));
  border-color: transparent;
  color: #fff;
}

.faq-list {
  display: grid;
  gap: var(--sp-3);
}

.faq-item {
  border: 1px solid var(--surface-border);
  border-radius: var(--r-md);
  background: var(--surface);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease);
}

.faq-item.is-open {
  border-color: var(--surface-border-strong);
}

.faq-item[hidden] {
  display: none;
}

.faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: 1.15rem 1.35rem;
  background: none;
  border: none;
  text-align: left;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
}

.faq-q:hover {
  color: var(--primary-strong);
}

.faq-q__icon {
  flex: none;
  width: 22px;
  height: 22px;
  position: relative;
  transition: transform var(--dur) var(--ease);
}

.faq-q__icon::before,
.faq-q__icon::after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 2px;
}

.faq-q__icon::before {
  top: 10px;
  left: 2px;
  right: 2px;
  height: 2px;
}

.faq-q__icon::after {
  left: 10px;
  top: 2px;
  bottom: 2px;
  width: 2px;
  transition: transform var(--dur) var(--ease);
}

.faq-item.is-open .faq-q__icon::after {
  transform: scaleY(0);
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--dur-slow) var(--ease);
}

.faq-a__inner {
  padding: 0 1.35rem 1.35rem;
  color: var(--text-soft);
}

.faq-a__inner p + p {
  margin-top: var(--sp-3);
}

.faq-empty {
  text-align: center;
  padding: var(--sp-7);
  color: var(--text-muted);
}

.faq-empty[hidden] {
  display: none;
}

/* Category section titles in support */
.faq-cat {
  margin-top: var(--sp-7);
  margin-bottom: var(--sp-4);
  font-size: 1.1rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.faq-cat svg {
  width: 20px;
  height: 20px;
}

/* -------------------------------------------------------------
   13. Steps (delete-account, support)
   ------------------------------------------------------------- */
.steps {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: var(--sp-4);
}

.steps li {
  position: relative;
  padding: var(--sp-5) var(--sp-5) var(--sp-5) 4.5rem;
  border-radius: var(--r-md);
  border: 1px solid var(--surface-border);
  background: var(--surface);
  backdrop-filter: blur(12px);
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: var(--sp-5);
  top: var(--sp-5);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--emerald-400), var(--emerald-700));
  box-shadow: 0 6px 16px rgba(15, 106, 77, 0.4);
}

.steps li h3 {
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.steps li p {
  font-size: 0.94rem;
  margin: 0;
}

/* -------------------------------------------------------------
   14. 404
   ------------------------------------------------------------- */
.notfound {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  place-items: center;
  text-align: center;
  padding-block: var(--sp-9);
}

.notfound__code {
  font-family: var(--font-display);
  font-size: clamp(6rem, 22vw, 14rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.notfound__actions {
  display: flex;
  gap: var(--sp-4);
  justify-content: center;
  flex-wrap: wrap;
  margin-top: var(--sp-6);
}

/* -------------------------------------------------------------
   15. Utilities
   ------------------------------------------------------------- */
.muted { color: var(--text-muted); }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: var(--sp-4);
}

.tag {
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--surface-border);
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.02);
}

/* -------------------------------------------------------------
   16. Layout utilities
   Small, composable helpers that replace one-off inline styles
   so pages stay free of inline CSS (CSP-friendly).
   ------------------------------------------------------------- */
.page-title {
  font-size: var(--fs-h1);
}

.text-center {
  text-align: center;
}

.mx-auto {
  margin-inline: auto;
}

.eyebrow--center {
  justify-content: center;
}

/* Measure (max line length) helpers */
.mw-20 { max-width: 20ch; }
.mw-22 { max-width: 22ch; }
.mw-48 { max-width: 48ch; }
.mw-52 { max-width: 52ch; }
.mw-60 { max-width: 60ch; }

/* Spacing helpers (map to the spacing scale) */
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mb-5 { margin-bottom: var(--sp-5); }

.cta-center {
  justify-content: center;
}

.fine-print {
  font-size: 0.82rem;
}

.footer__bar--plain {
  border-top: none;
}

/* Two-column layout used on the contact page */
.contact-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
