/* ─── RESET ───────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

/* ─── TOKENS ──────────────────────────────────────────── */
:root {
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Syne", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t: 0.22s var(--ease);
  --r: 14px;
  --r-sm: 8px;
  --r-lg: 20px;
}

[data-theme="dark"] {
  --bg: #070e09;
  --bg2: #0c1810;
  --bg3: #132118;
  --bg4: #1a2e1e;
  --accent: #00e676;
  --accent2: #69f0ae;
  --accent-dim: rgba(0, 230, 118, 0.1);
  --accent-glow: rgba(0, 230, 118, 0.22);
  --text: #dff5e6;
  --muted: #7aad8a;
  --border: rgba(0, 230, 118, 0.09);
  --border2: rgba(0, 230, 118, 0.2);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  --header-bg: rgba(7, 14, 9, 0.85);
}

[data-theme="light"] {
  --bg: #f5f9f7;
  --bg2: #ffffff;
  --bg3: #edf5f1;
  --bg4: #e1f0e8;
  --accent: #00a846;
  --accent2: #00c853;
  --accent-dim: rgba(0, 168, 70, 0.09);
  --accent-glow: rgba(0, 168, 70, 0.18);
  --text: #1a2e1e;
  --muted: #4a6856;
  --border: rgba(0, 168, 70, 0.11);
  --border2: rgba(0, 168, 70, 0.22);
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.07);
  --header-bg: rgba(245, 249, 247, 0.9);
}

/* Teintes des thèmes du sélecteur de modules */
[data-theme="dark"] {
  --tone-color: #ff7eb6;
  --tone-surface: #5cc8ff;
  --tone-motion: #ffc857;
  --tone-comp: #b39dff;
  --tone-layout: #00e676;
}

[data-theme="light"] {
  --tone-color: #d6336c;
  --tone-surface: #0b7fc0;
  --tone-motion: #b7791f;
  --tone-comp: #6d4fd6;
  --tone-layout: #00a846;
}

/* ─── BASE ────────────────────────────────────────────── */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  transition:
    background var(--t),
    color var(--t);
  overflow-x: hidden;
}

/* Fond en carreaux (identique à la page QR) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 230, 118, 0.025) 1px, transparent 1px),
    linear-gradient(rgba(0, 230, 118, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}

[data-theme="light"] body::before {
  background:
    linear-gradient(90deg, rgba(0, 200, 83, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(0, 200, 83, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* ─── HEADER ──────────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.7rem 1rem 0;
  pointer-events: none;
}

.header-inner {
  pointer-events: auto;
  max-width: 1280px;
  height: 54px;
  margin: 0 auto;
  padding: 0 0.6rem 0 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--border2);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  padding-right: 0.4rem;
  border-radius: 999px;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  transition:
    transform 0.4s var(--ease),
    box-shadow var(--t);
}

.logo:hover .logo-mark {
  transform: rotate(-8deg) scale(1.06);
  box-shadow:
    0 0 0 4px var(--accent-dim),
    0 0 18px var(--accent-glow);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.logo-text span {
  color: var(--accent);
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  background: var(--accent-dim);
  border: 1px solid var(--border2);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
  transition: background var(--t);
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--accent-glow);
}

.theme-toggle svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* Montre la lune en dark, le soleil en light */
[data-theme="dark"] #icon-sun {
  display: none;
}

[data-theme="light"] #icon-moon {
  display: none;
}

#theme-label {
  display: none;
  color: var(--muted);
}

@media (min-width: 560px) {
  .theme-toggle {
    width: auto;
    padding: 0 0.85rem 0 0.7rem;
  }

  #theme-label {
    display: inline;
  }
}

/* ─── MAIN ────────────────────────────────────────────── */
main {
  flex: 1;
  position: relative;
  z-index: 1;
}

/* ─── LANG SWITCHER ────────────────────────────────────── */
.lang-switcher {
  display: flex;
  gap: 0.15rem;
  align-items: center;
  padding: 0.18rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.lang-btn {
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--mono);
  transition:
    color var(--t),
    background var(--t);
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.active {
  color: var(--bg);
  background: var(--accent);
}

/* ─── HERO ────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow-x: clip;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.8rem 1.25rem 2.6rem;
  display: grid;
  gap: 2.6rem;
  align-items: center;
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 3rem;
    padding-top: 3.6rem;
    padding-bottom: 3.2rem;
  }
}

.hero-copy > * {
  animation: rise 0.6s var(--ease) both;
}

.hero-copy > :nth-child(2) {
  animation-delay: 0.07s;
}

.hero-copy > :nth-child(3) {
  animation-delay: 0.14s;
}

.hero-copy > :nth-child(4) {
  animation-delay: 0.21s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.hero-label {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  background: var(--accent-dim);
  border: 1px solid var(--border2);
  border-radius: 99px;
  padding: 0.25rem 0.75rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
}

.hero-label::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.4;
    transform: scale(0.65);
  }
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin-bottom: 1.1rem;
}

.hero-copy h1 .accent {
  color: var(--accent);
  position: relative;
  display: inline-block;
}

.hero-copy h1 .accent::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.08em;
  height: 0.34em;
  background: var(--accent-glow);
  filter: blur(18px);
  z-index: -1;
  opacity: 0.8;
}

.hero-copy > p {
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  color: var(--muted);
  max-width: 540px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem 2.2rem;
  margin-top: 2rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--border);
  max-width: 540px;
}

.hero-stats li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hero-stats strong {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
}

.hero-stats span {
  font-size: 0.74rem;
  color: var(--muted);
}

/* Scène décorative : un aperçu de ce que fabrique le site */
.hero-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 540px;
  margin-inline: auto;
  aspect-ratio: 1 / 0.88;
}

@media (min-width: 960px) {
  .hero-stage {
    margin-inline: auto 0;
  }
}

.hero-stage::before {
  content: "";
  position: absolute;
  inset: -4% -6%;
  z-index: -2;
  background-image: radial-gradient(var(--border2) 1px, transparent 1.3px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(
    ellipse 70% 70% at 50% 50%,
    #000 30%,
    transparent 75%
  );
  mask-image: radial-gradient(
    ellipse 70% 70% at 50% 50%,
    #000 30%,
    transparent 75%
  );
}

.orb {
  position: absolute;
  z-index: -1;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(38px);
  opacity: 0.7;
  animation: drift 16s ease-in-out infinite alternate;
}

[data-theme="light"] .orb {
  opacity: 0.45;
}

.orb-a {
  width: 52%;
  left: 4%;
  top: 2%;
  background: radial-gradient(circle at 35% 35%, var(--accent), transparent 70%);
}

.orb-b {
  width: 46%;
  right: 2%;
  top: 24%;
  background: radial-gradient(
    circle at 40% 40%,
    var(--tone-color),
    transparent 70%
  );
  animation-delay: -5s;
}

.orb-c {
  width: 44%;
  left: 22%;
  bottom: -2%;
  background: radial-gradient(circle, var(--tone-surface), transparent 70%);
  animation-delay: -9s;
}

@keyframes drift {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(4%, -5%) scale(1.12);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.stage-glass {
  position: absolute;
  left: 2%;
  top: 9%;
  width: 55%;
  height: 46%;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  border-radius: 22px;
  background: color-mix(in srgb, var(--bg2) 38%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 16%, transparent);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  box-shadow:
    var(--shadow),
    inset 0 1px 0 color-mix(in srgb, #fff 22%, transparent);
  animation: bob 7s ease-in-out infinite;
}

.sg-dots {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 0.3rem;
}

.sg-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--text) 35%, transparent);
}

.sg-line {
  height: 7px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--text) 22%, transparent);
}

.sg-line.w70 {
  width: 70%;
}

.sg-line.w45 {
  width: 45%;
}

.sg-slider {
  position: relative;
  margin-top: auto;
  height: 4px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--text) 18%, transparent);
}

.sg-slider span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 62%;
  border-radius: inherit;
  background: var(--accent);
}

.sg-slider span::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateY(-50%);
  box-shadow: 0 0 0 4px var(--accent-dim);
}

.stage-btn {
  position: absolute;
  right: 5%;
  top: 13%;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bg);
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  box-shadow:
    0 10px 30px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  animation: bob 5.5s ease-in-out -2s infinite;
}

.stage-code {
  position: absolute;
  right: 0;
  bottom: 3%;
  width: 74%;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.sc-bar {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 0.7rem;
  border-bottom: 1px solid var(--border);
}

.sc-bar i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.sc-bar i:nth-child(1) {
  background: var(--tone-color);
}

.sc-bar i:nth-child(2) {
  background: var(--tone-motion);
}

.sc-bar i:nth-child(3) {
  background: var(--accent);
}

.sc-bar span {
  margin-left: 0.4rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  color: var(--muted);
}

.sc-body {
  padding: 0.7rem 0.85rem;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 0.64rem;
  line-height: 1.7;
  white-space: pre;
  color: var(--text);
}

.sc-body .k {
  color: var(--accent);
}

.sc-body .p {
  color: var(--tone-surface);
}

.sc-body .v {
  color: var(--tone-motion);
}

.sc-body .caret {
  display: inline-block;
  width: 6px;
  height: 1em;
  vertical-align: text-bottom;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

.stage-ring {
  position: absolute;
  left: 7%;
  bottom: 9%;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--accent),
    var(--tone-surface),
    var(--tone-color),
    var(--accent)
  );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 7px),
    #000 calc(100% - 6px)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - 7px),
    #000 calc(100% - 6px)
  );
  animation: spin 9s linear infinite;
}

/* ─── MODULES : SÉLECTEUR PAR THÈMES ──────────────────── */
.modules-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.25rem 3rem;
  scroll-margin-top: 5rem;
}

.modules-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.4rem 1.5rem;
  margin-bottom: 1.4rem;
}

.modules-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.modules-intro {
  font-size: 0.85rem;
  color: var(--muted);
}

.modules-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

@media (min-width: 700px) {
  .modules-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1040px) {
  .modules-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Chaque thème porte sa teinte via --tone */
.theme-panel[data-tone="color"] {
  --tone: var(--tone-color);
}

.theme-panel[data-tone="surface"] {
  --tone: var(--tone-surface);
}

.theme-panel[data-tone="motion"] {
  --tone: var(--tone-motion);
}

.theme-panel[data-tone="components"] {
  --tone: var(--tone-comp);
}

.theme-panel[data-tone="layout"] {
  --tone: var(--tone-layout);
}

.theme-panel[data-tone="other"] {
  --tone: var(--accent);
}

.theme-panel {
  --tone: var(--accent);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.05rem 0.85rem 0.85rem;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  transition:
    border-color var(--t),
    box-shadow var(--t);
}

.theme-panel::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -70px;
  z-index: -1;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--tone) 26%, transparent),
    transparent 70%
  );
  transition: transform 0.6s var(--ease);
}

.theme-panel:hover {
  border-color: color-mix(in srgb, var(--tone) 35%, transparent);
}

.theme-panel:hover::before {
  transform: scale(1.3);
}

.theme-panel:has(.module-card.active) {
  border-color: color-mix(in srgb, var(--tone) 55%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--tone) 30%, transparent);
}

.reveal {
  animation: rise 0.55s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.theme-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0 0.25rem;
}

.theme-index {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--tone);
}

.theme-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.theme-count {
  margin-left: auto;
  min-width: 1.5rem;
  padding: 0.05rem 0.4rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 12%, transparent);
  border-radius: 99px;
}

.theme-desc {
  margin-bottom: 0.55rem;
  padding: 0 0.25rem;
  font-size: 0.74rem;
  color: var(--muted);
}

.theme-list {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.module-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.45rem 0.55rem;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r);
  transition:
    background var(--t),
    border-color var(--t),
    transform var(--t);
}

.module-card:hover:not(:disabled) {
  background: color-mix(in srgb, var(--tone) 9%, transparent);
  border-color: color-mix(in srgb, var(--tone) 26%, transparent);
  transform: translateX(2px);
}

.module-card.active {
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  border-color: var(--tone);
}

.module-card.soon {
  opacity: 0.5;
  cursor: not-allowed;
}

.module-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 14%, transparent);
  border-radius: 11px;
  transition:
    background var(--t),
    color var(--t),
    transform var(--t);
}

.module-card:hover:not(:disabled) .module-icon {
  transform: scale(1.08) rotate(-4deg);
}

.module-card.active .module-icon {
  color: var(--bg);
  background: var(--tone);
}

.module-icon svg,
.gen-title .icon svg {
  display: block;
}

.module-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.module-name {
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.25;
}

.module-desc {
  overflow: hidden;
  font-size: 0.7rem;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.module-go {
  display: flex;
  color: var(--tone);
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity var(--t),
    transform var(--t);
}

.module-card:hover .module-go,
.module-card.active .module-go,
.module-card:focus-visible .module-go {
  opacity: 1;
  transform: none;
}

.badge {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.11rem 0.38rem;
  border-radius: 99px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border2);
}

.badge.soon {
  background: var(--bg3);
  color: var(--muted);
  border-color: var(--border);
}

/* Case « surprends-moi » */
.shuffle-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  min-height: 150px;
  padding: 1.2rem;
  text-align: center;
  color: var(--text);
  background: transparent;
  border: 1px dashed var(--border2);
  border-radius: var(--r-lg);
  transition:
    background var(--t),
    border-color var(--t);
}

.shuffle-card:hover {
  background: var(--accent-dim);
  border-style: solid;
  border-color: var(--accent);
}

.shuffle-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  font-size: 1.45rem;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 15px;
  transition: transform 0.5s var(--ease);
}

.shuffle-card:hover .shuffle-icon {
  transform: rotate(180deg) scale(1.08);
}

.shuffle-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.shuffle-text strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.shuffle-text span {
  font-size: 0.74rem;
  color: var(--muted);
}

/* L'outline global force border-radius: 4px — on garde les formes */
.logo:focus-visible,
.lang-btn:focus-visible,
.theme-toggle:focus-visible {
  border-radius: 999px;
}

.module-card:focus-visible {
  border-radius: var(--r);
}

.shuffle-card:focus-visible {
  border-radius: var(--r-lg);
}

/* Quand on choisit un module, le générateur ne se cache pas derrière le header */
.generator-zone {
  scroll-margin-top: 5.2rem;
}

@media (prefers-reduced-motion: reduce) {
  .hero-copy > *,
  .reveal,
  .orb,
  .stage-glass,
  .stage-btn,
  .stage-ring,
  .sc-body .caret,
  .hero-label::before {
    animation: none;
  }

  .module-card,
  .module-icon,
  .module-go,
  .theme-panel::before,
  .shuffle-icon {
    transition: none;
  }
}

/* ─── GENERATOR ZONE ──────────────────────────────────── */
.generator-zone {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.placeholder-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--bg2);
  border: 1px dashed var(--border2);
  border-radius: var(--r-lg);
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  padding: 2rem 1.5rem;
  text-align: center;
}

/* Grille légère en fond, façon "canevas" */
.placeholder-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(
    ellipse 60% 70% at 50% 45%,
    black 0%,
    transparent 75%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 60% 70% at 50% 45%,
    black 0%,
    transparent 75%
  );
  opacity: 0.6;
}

/* Halo lumineux respirant derrière l'icône */
.placeholder-panel::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 260px;
  height: 260px;
  transform: translate(-50%, -58%);
  z-index: -1;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  filter: blur(4px);
  animation: phGlow 4.5s ease-in-out infinite;
}

@keyframes phGlow {
  0%,
  100% {
    opacity: 0.55;
    transform: translate(-50%, -58%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -58%) scale(1.12);
  }
}

.placeholder-panel .ph-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid var(--border2);
  font-size: 1.8rem;
  color: var(--accent);
  opacity: 1;
  animation: phFloat 3.4s ease-in-out infinite;
}

@keyframes phFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.placeholder-panel h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  opacity: 1;
}

.placeholder-panel p {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.65;
}

.generator-panel {
  display: none;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  animation: fadeIn 0.22s var(--ease);
}

.generator-panel.visible {
  display: block;
}

.generator-panel.loading .panel-inner {
  pointer-events: none;
  opacity: 0.55;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}

.gen-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.gen-title .icon {
  font-size: 1.15rem;
  line-height: 1;
  display: flex;
  color: var(--accent);
}

.gen-title h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.panel-inner {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .panel-inner {
    grid-template-columns: 270px 1fr;
  }
}

.panel-controls {
  padding: 1.1rem;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 768px) {
  .panel-controls {
    border-bottom: none;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    max-height: 500px;
  }
}

.controls-heading {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.panel-preview {
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  /* Empêche le panel de déborder de la colonne grid */
  min-width: 0;
  overflow: hidden;
}

.preview-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.preview-canvas {
  /* width:100% + min-width:0 : le canvas colle à son parent,
         il ne grandit JAMAIS pour accueillir un enfant trop large */
  width: 100%;
  min-width: 0;
  min-height: 240px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.code-output {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.code-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.code-output-header span {
  font-family: var(--mono);
  font-size: 0.67rem;
  color: var(--muted);
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--accent-dim);
  border: 1px solid var(--border2);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 600;
  transition: background var(--t);
}

.copy-btn:hover {
  background: var(--accent-glow);
}

.copy-btn.copied {
  color: var(--accent2);
}

.code-output pre {
  padding: 0.85rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text);
  overflow-x: auto;
  line-height: 1.65;
  max-height: 200px;
  tab-size: 2;
}

/* ─── FORM ELEMENTS ───────────────────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin-bottom: 0.8rem;
}

.field label {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.field input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: var(--bg4);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
}

.field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 0 3px var(--accent-dim);
  transition: box-shadow var(--t);
}

.field input[type="range"]:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.field input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  border: 2px solid var(--border2);
  border-radius: 7px;
  background: none;
  cursor: pointer;
  padding: 2px;
}

.field select {
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.78rem;
  padding: 0.42rem 0.65rem;
  outline: none;
  transition: border-color var(--t);
  cursor: pointer;
}

.field select:focus {
  border-color: var(--accent);
}

.range-value {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
}

.color-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.field-hint {
  font-size: 0.68rem;
  color: var(--muted);
}

/* ─── SPINNER ─────────────────────────────────────────── */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── FOOTER ──────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.25rem;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-inner p {
  font-size: 0.72rem;
  color: var(--muted);
}

.accent-txt {
  color: var(--accent);
  font-weight: 600;
}

/* ─── UTILS ───────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border2);
  border-radius: 99px;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: var(--bg);
  padding: 0.42rem 0.9rem;
  border-radius: var(--r-sm);
  font-weight: 600;
  font-size: 0.8rem;
  z-index: 9999;
  transition: top var(--t);
}

.skip-link:focus {
  top: 0.5rem;
}

.copy-to-clipboard-button {
  display: none;
}
