/* D20 Atlas — Landing
   Glassmorphic dark theme, mirrored from FantasyMap/src/theme.js */

:root {
  /* Core palette — keep in sync with FantasyMap GLASS_COLORS */
  --primary: #7f43c6;
  --secondary: #0fbfe8;
  --paper: #1c3b63;
  --black: #000000;
  --white: #ffffff;

  /* Glass opacity steps (theme.js: subtle/light/medium/strong) */
  --glass-subtle: rgba(255, 255, 255, 0.03);
  --glass-light: rgba(255, 255, 255, 0.08);
  --glass-medium: rgba(255, 255, 255, 0.12);
  --glass-strong: rgba(255, 255, 255, 0.16);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);

  --paper-glass: rgba(28, 59, 99, 0.16);
  --paper-glass-strong: rgba(28, 59, 99, 0.55);

  --text: rgba(255, 255, 255, 0.92);
  --text-dim: rgba(255, 255, 255, 0.62);
  --text-faint: rgba(255, 255, 255, 0.42);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --max-w: 1140px;
  --nav-h: 68px;

  --font: "Roboto", "Helvetica", "Arial", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--black);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient aurora behind everything — the "map under glass" feel */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(48% 42% at 18% 8%, rgba(127, 67, 198, 0.4), transparent 70%),
    radial-gradient(42% 38% at 84% 22%, rgba(15, 191, 232, 0.24), transparent 70%),
    radial-gradient(60% 50% at 50% 100%, rgba(28, 59, 99, 0.55), transparent 72%);
  filter: blur(20px);
  pointer-events: none;
}

/* Faint hex/grid weave — nods to the app's Hex module */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.028) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 20%, transparent 80%);
  pointer-events: none;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- Shared primitives ---------- */

.wrap {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.glass {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: var(--glass-medium);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.glass-dark {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--paper-glass-strong);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--secondary);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 191, 232, 0.1);
  border: 1px solid rgba(15, 191, 232, 0.22);
}

.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 10px var(--secondary);
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

h2 {
  font-size: clamp(1.75rem, 3.4vw, 2.6rem);
}

.section {
  padding: clamp(72px, 10vw, 128px) 0;
}

.section-head {
  max-width: 660px;
  margin-bottom: 56px;
}

.section-head h2 {
  margin: 18px 0 14px;
}

.section-head p {
  color: var(--text-dim);
  font-size: 1.05rem;
}

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

/* Buttons — mirrors theme.js MuiButton "glass" variant */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: rgba(127, 67, 198, 0.16);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-color: rgba(127, 67, 198, 0.45);
  color: var(--white);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
  background: rgba(127, 67, 198, 0.34);
  transform: translateY(-1px);
  box-shadow: 0 12px 40px rgba(127, 67, 198, 0.3);
}

.btn-ghost {
  background: var(--glass-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--glass-medium);
  transform: translateY(-1px);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.875rem;
}

/* Skip link — visible only on keyboard focus */
.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--paper);
  border: 1px solid rgba(127, 67, 198, 0.5);
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 16px;
}

/* ---------- Nav ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease),
    backdrop-filter 0.3s var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(28, 59, 99, 0.5);
  border-bottom: 1px solid rgba(127, 67, 198, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.nav .wrap {
  display: flex;
  align-items: center;
  gap: 32px;
}

/* Text-only wordmark — no logo mark. The name does the work. */
.brand {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: 0.01em;
  background: linear-gradient(100deg, var(--white) 30%, var(--secondary) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: opacity 0.2s var(--ease);
}

.brand:hover {
  opacity: 0.82;
}

.nav-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  list-style: none;
}

.nav-links a {
  font-size: 0.925rem;
  color: var(--text-dim);
  transition: color 0.2s var(--ease);
}

.nav-links a:hover {
  color: var(--white);
}

.nav-cta {
  flex: none;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  color: var(--text);
}

/* ---------- Hero ---------- */

.hero {
  padding: calc(var(--nav-h) + clamp(64px, 9vw, 110px)) 0 clamp(48px, 7vw, 88px);
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.4rem, 6.4vw, 4.35rem);
  /* First element in the hero now that the eyebrow is gone — the section
     padding already supplies the space above. */
  margin: 0 auto 22px;
  max-width: 15ch;
}

.hero h1 .grad {
  background: linear-gradient(100deg, var(--primary) 10%, var(--secondary) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .lede {
  font-size: clamp(1.02rem, 1.8vw, 1.2rem);
  color: var(--text-dim);
  max-width: 60ch;
  margin: 0 auto;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 34px;
}

.hero-note {
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* Hero screenshot frame */
.shot {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--paper-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(127, 67, 198, 0.12);
}

.shot::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 40%);
}

/* The frame sets the crop, not the file — one screenshot can fill slots of
   different shapes without shipping a second copy of the bytes. */
.shot img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.shot.ratio-16-10 img {
  aspect-ratio: 16 / 10;
}

/* ---------- Dual-screen composition (DM window → player window) ----------
   The same screenshot rendered twice, tilted on a shared vanishing point so
   the pair reads as one machine driving another. Both <img> share a src, so
   this costs one network request. */

.dual-screen {
  position: relative;
  aspect-ratio: 1 / 1;
  perspective: 1400px;
  perspective-origin: 60% 40%;
}

.dual-screen .screen {
  position: absolute;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--paper-glass-strong);
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.dual-screen .screen img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

/* The controlling window sits back and higher, turned slightly away. */
.screen-dm {
  top: 0;
  left: 0;
  width: 76%;
  transform: rotateY(15deg) rotateX(6deg) rotateZ(-1.5deg);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.5);
}

/* The player window sits forward, overlapping — the surface being driven. */
.screen-player {
  right: 0;
  bottom: 0;
  width: 72%;
  transform: rotateY(15deg) rotateX(6deg) rotateZ(-1.5deg) translateZ(90px);
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.62), 0 0 0 1px rgba(15, 191, 232, 0.22);
}

/* Cyan tint so the mirrored copy reads as the players' screen, not a duplicate. */
.screen-player::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, rgba(15, 191, 232, 0.2), rgba(127, 67, 198, 0.12));
  mix-blend-mode: screen;
  pointer-events: none;
}

.screen-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.screen-player .screen-tag {
  color: var(--secondary);
  border-color: rgba(15, 191, 232, 0.4);
}

/* The signal running from one window to the other. */
.screen-beam {
  position: absolute;
  top: 46%;
  left: 34%;
  width: 32%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--secondary), transparent);
  transform: rotate(34deg);
  opacity: 0.65;
  filter: blur(0.4px);
  animation: beam 3.2s var(--ease) infinite;
}

@keyframes beam {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 0.8;
  }
}

/* Hovering the pair brings both screens level — the "one truth" payoff. */
.dual-screen:hover .screen-dm,
.dual-screen:hover .screen-player {
  transform: rotateY(8deg) rotateX(3deg);
}

@media (prefers-reduced-motion: reduce) {
  .screen-beam {
    animation: none;
  }
  .dual-screen .screen {
    transition: none;
  }
}

/* Below the split's breakpoint the tilt costs more room than it earns. */
@media (max-width: 900px) {
  .dual-screen {
    aspect-ratio: 4 / 3;
    perspective: none;
  }
  .screen-dm,
  .screen-player,
  .dual-screen:hover .screen-dm,
  .dual-screen:hover .screen-player {
    transform: none;
  }
  .screen-dm {
    width: 82%;
  }
  .screen-player {
    width: 78%;
  }
  .screen-beam {
    display: none;
  }
}

/* ---------- Spatial audio diagram ----------
   Top-down view of the table. Node coordinates mirror the five POSITIONS the
   soundboard actually exposes: centre, front L/R, back L/R. */

.audio-stage {
  position: relative;
  aspect-ratio: 16 / 13;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--paper-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--glass-shadow);
}

/* Concentric rings, faded at the edge so the diagram has no hard border. */
.stage-floor {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 50% 50%, transparent 0 17%, rgba(255, 255, 255, 0.07) 17.4% 17.9%, transparent 18.3%),
    radial-gradient(circle at 50% 50%, transparent 0 29%, rgba(255, 255, 255, 0.055) 29.4% 29.9%, transparent 30.3%),
    radial-gradient(circle at 50% 50%, transparent 0 41%, rgba(255, 255, 255, 0.04) 41.4% 41.9%, transparent 42.3%),
    radial-gradient(circle at 50% 40%, rgba(127, 67, 198, 0.22), transparent 62%);
  mask-image: radial-gradient(circle at 50% 50%, #000 55%, transparent 92%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 55%, transparent 92%);
}

.listener {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  white-space: nowrap;
}

/* The emitter dot. The ::after ring is the sound leaving it. */
.node i {
  position: relative;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 14px rgba(15, 191, 232, 0.8);
}

.node i::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--secondary);
  animation: emit 2.8s var(--ease) infinite;
}

/* Staggered so the eye travels around the table instead of seeing one flash. */
.node-c { top: 15%; left: 50%; }
.node-fl { top: 27%; left: 17%; }
.node-fl i::after { animation-delay: 0.55s; }
.node-fr { top: 27%; left: 83%; }
.node-fr i::after { animation-delay: 1.1s; }
.node-bl { top: 80%; left: 24%; }
.node-bl i::after { animation-delay: 1.65s; }
.node-br { top: 80%; left: 76%; }
.node-br i::after { animation-delay: 2.2s; }

/* Back speakers sit further away, so their labels read quieter. */
.node-bl,
.node-br {
  opacity: 0.78;
}

@keyframes emit {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  70%,
  100% {
    transform: scale(3.4);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .node i::after {
    animation: none;
    opacity: 0.45;
  }
}

.hero-shot {
  margin-top: clamp(44px, 6vw, 72px);
}

/* Fake window chrome on the hero shot */
.shot-chrome {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.28);
}

.shot-chrome .lights {
  display: flex;
  gap: 6px;
}

.shot-chrome .lights span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.shot-chrome .url {
  margin-left: 10px;
  font-size: 0.75rem;
  color: var(--text-faint);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}

/* ---------- Stats strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--glass-border);
  margin-top: 28px;
}

.stat {
  background: rgba(28, 59, 99, 0.4);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 26px 20px;
  text-align: center;
}

.stat .n {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat .l {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-top: 4px;
}

/* ---------- Feature grid ---------- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  padding: 30px 28px;
  border-radius: var(--radius-lg);
  background: var(--glass-medium);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    120% 90% at 0% 0%,
    rgba(127, 67, 198, 0.16),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  pointer-events: none;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(127, 67, 198, 0.4);
  box-shadow: 0 16px 48px rgba(127, 67, 198, 0.18);
}

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

.card .icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  background: rgba(127, 67, 198, 0.18);
  border: 1px solid rgba(127, 67, 198, 0.32);
  color: var(--secondary);
}

.card h3 {
  font-size: 1.1rem;
  margin-bottom: 9px;
}

.card p {
  color: var(--text-dim);
  font-size: 0.94rem;
}

/* ---------- Split showcase rows ---------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.split + .split {
  margin-top: clamp(64px, 8vw, 112px);
}

.split.reverse .split-text {
  order: 2;
}

.split h3 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  margin: 16px 0 14px;
}

.split p {
  color: var(--text-dim);
}

.checks {
  list-style: none;
  margin-top: 22px;
  display: grid;
  gap: 11px;
}

.checks li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 0.94rem;
  color: var(--text-dim);
}

.checks svg {
  flex: none;
  margin-top: 3px;
  color: var(--secondary);
}

/* ---------- Steps ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  counter-reset: step;
}

.step {
  padding: 28px 26px;
  border-radius: var(--radius-lg);
  background: var(--glass-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

.step .num {
  counter-increment: step;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--white);
  background: rgba(127, 67, 198, 0.3);
  border: 1px solid rgba(127, 67, 198, 0.5);
  margin-bottom: 16px;
}

.step .num::before {
  content: counter(step);
}

.step h3 {
  font-size: 1.02rem;
  margin-bottom: 8px;
}

.step p {
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* ---------- FAQ ---------- */

.faq {
  display: grid;
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

.faq details {
  border-radius: var(--radius);
  background: var(--glass-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.faq details[open] {
  background: var(--glass-medium);
  border-color: rgba(127, 67, 198, 0.32);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 22px;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--secondary);
  border-bottom: 2px solid var(--secondary);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.3s var(--ease);
}

.faq details[open] summary::after {
  transform: rotate(-135deg) translateY(-2px);
}

.faq .answer {
  padding: 0 22px 20px;
  color: var(--text-dim);
  font-size: 0.94rem;
}

/* ---------- Final CTA ---------- */

.cta-panel {
  position: relative;
  text-align: center;
  padding: clamp(48px, 7vw, 82px) 32px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: rgba(28, 59, 99, 0.5);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(127, 67, 198, 0.28);
  box-shadow: var(--glass-shadow);
}

.cta-panel::before {
  content: "";
  position: absolute;
  inset: -50% -10%;
  background: radial-gradient(45% 55% at 50% 40%, rgba(127, 67, 198, 0.32), transparent 70%);
  pointer-events: none;
}

.cta-panel > * {
  position: relative;
}

.cta-panel p {
  color: var(--text-dim);
  max-width: 52ch;
  margin: 14px auto 0;
}

.cta-panel .hero-actions {
  margin-top: 30px;
}

/* ---------- Footer ---------- */

.footer {
  border-top: 1px solid var(--glass-border);
  padding: 48px 0 40px;
  margin-top: clamp(72px, 9vw, 110px);
}

.footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
}

.footer-bottom {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--glass-border);
}

.credit {
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* The one outbound link we actually want to stand out */
.credit a {
  font-weight: 600;
  color: var(--text-dim);
  padding-bottom: 1px;
  border-bottom: 1px solid rgba(15, 191, 232, 0.35);
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.credit a:hover {
  color: var(--secondary);
  border-bottom-color: var(--secondary);
}

/* Email link stays hidden until JS assembles the address */
.footer-links a[hidden] {
  display: none;
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--text-faint);
  transition: color 0.2s var(--ease);
}

.footer-links a:hover {
  color: var(--text);
}

.footer .copy {
  font-size: 0.82rem;
  color: var(--text-faint);
}

/* ---------- Legal pages ---------- */

.legal {
  padding: calc(var(--nav-h) + 56px) 0 40px;
}

.legal .wrap {
  max-width: 780px;
}

.legal h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  margin: 18px 0 10px;
}

/* ES/EN toggle. Both language versions are equally authoritative; the current
   one is a plain <span> so there is nothing to click back to itself. */
.lang-switch {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  font-size: 0.82rem;
}

.lang-switch > * {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
}

.lang-switch span {
  background: var(--glass-light);
  color: var(--text);
}

.legal .lang-switch a:not(.btn) {
  color: var(--text-dim);
  border-bottom: 1px solid var(--glass-border);
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.legal .lang-switch a:not(.btn):hover {
  color: var(--secondary);
  background: var(--glass-subtle);
}

/* Language-precedence note — set apart from the body prose. */
.legal .note {
  margin-top: 30px;
  padding: 14px 18px;
  border-left: 2px solid var(--glass-strong);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--glass-subtle);
  font-size: 0.88rem;
  color: var(--text-dim);
}

.legal .updated {
  color: var(--text-faint);
  font-size: 0.85rem;
}

.legal h2 {
  font-size: 1.25rem;
  margin: 44px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--glass-border);
}

.legal h3 {
  font-size: 1rem;
  margin: 24px 0 8px;
  color: var(--secondary);
}

.legal p,
.legal li {
  color: var(--text-dim);
  font-size: 0.96rem;
}

.legal p + p {
  margin-top: 14px;
}

.legal ul,
.legal ol {
  margin: 14px 0 0 22px;
  display: grid;
  gap: 9px;
}

.legal a:not(.btn) {
  color: var(--secondary);
  border-bottom: 1px solid rgba(15, 191, 232, 0.35);
}

.legal a:not(.btn):hover {
  border-bottom-color: var(--secondary);
}

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

/* Identification block — the LSSI titular details */
.legal .identity {
  margin-top: 20px;
  padding: 24px 26px;
  border-radius: var(--radius-lg);
  background: var(--glass-light);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
}

.legal .identity dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 20px;
  font-size: 0.94rem;
}

.legal .identity dt {
  color: var(--text-faint);
}

.legal .identity dd {
  color: var(--text);
}

.legal table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.legal th,
.legal td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-dim);
  vertical-align: top;
}

.legal th {
  color: var(--text);
  font-weight: 600;
}

.legal-nav {
  display: flex;
  gap: 18px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--glass-border);
  font-size: 0.9rem;
}

@media (max-width: 560px) {
  .legal .identity dl {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }

  .legal .identity dd {
    margin-bottom: 10px;
  }
}

/* ---------- Scroll reveal ---------- */

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */

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

  .nav-toggle {
    display: block;
  }

  .nav.open {
    height: auto;
    padding-bottom: 16px;
  }

  .nav.open .wrap {
    flex-wrap: wrap;
  }

  .nav.open .nav-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-left: 0;
    gap: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--glass-border);
  }

  .nav.open .nav-links a {
    display: block;
    padding: 10px 4px;
  }

  .nav.open .nav-cta {
    display: inline-flex;
    width: 100%;
  }

  .split,
  .split.reverse .split-text {
    grid-template-columns: 1fr;
    order: 0;
  }

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

@media (max-width: 520px) {
  .btn {
    width: 100%;
  }

  .hero-actions {
    flex-direction: column;
  }
}

/* ---------- Motion / print ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 3px;
  border-radius: 4px;
}
