/* ============================================================
   AÏZIYA — Système de thèmes
   Directions esthétiques : luxe minimal, mode d'auteur, éditorial.
   Polices chargées dans index.html (<head>) → rendu plus rapide.
   ============================================================ */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "kern";
  transition: background-color .35s ease, color .35s ease;
}

/* ---------- VARIABLES BASE (toutes les directions) ---------- */
:root {
  --font-serif: "Cormorant Garamond", "Times New Roman", serif;
  --font-sans-bold: "Archivo", "Helvetica Neue", sans-serif;
  --font-body: "Inter Tight", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --max-w: 1440px;
  --gutter: clamp(20px, 4vw, 64px);
}

/* =========================================================
   DIRECTION 1 — ATELIER (cream + ink, serif éditorial)
   Inspiration: Loewe, Hermès, artisanat luxe
   ========================================================= */
[data-theme="atelier"] {
  --paper: #f1ece2;
  --paper-2: #e8e1d3;
  --paper-3: #ded5c3;
  --ink: #1a1814;
  --ink-2: #4a463d;
  --ink-3: #87806f;
  --line: #d4ccb9;
  --accent: #a8553a;
  --accent-2: #c97c5d;
  --hero-display-font: var(--font-serif);
  --hero-display-weight: 400;
  --hero-display-tracking: -0.02em;
  --hero-display-italic: italic;
  --tag-case: uppercase;
  --tag-tracking: 0.18em;
}

/* =========================================================
   DIRECTION 2 — STUDIO (blanc/noir massif, bold sans)
   Inspiration: Jacquemus, Off-White, branding contemporain
   ========================================================= */
[data-theme="studio"] {
  --paper: #ffffff;
  --paper-2: #f4f2ee;
  --paper-3: #e9e6df;
  --ink: #0a0a0a;
  --ink-2: #2a2a2a;
  --ink-3: #6a6a6a;
  --line: #e2dfd8;
  --accent: #e8d600;
  --accent-2: #ff5e1f;
  --hero-display-font: var(--font-sans-bold);
  --hero-display-weight: 900;
  --hero-display-tracking: -0.05em;
  --hero-display-italic: normal;
  --tag-case: uppercase;
  --tag-tracking: 0.12em;
}

/* =========================================================
   DIRECTION 3 — NOIR (sombre cinématographique)
   Inspiration: Document Journal, Saint Laurent, éditorial nuit
   ========================================================= */
[data-theme="noir"] {
  --paper: #0d0c0a;
  --paper-2: #161412;
  --paper-3: #221f1a;
  --ink: #ede7d8;
  --ink-2: #b8b1a0;
  --ink-3: #7a7466;
  --line: #2e2a23;
  --accent: #c4a878;
  --accent-2: #d9bf90;
  --hero-display-font: var(--font-serif);
  --hero-display-weight: 300;
  --hero-display-tracking: -0.025em;
  --hero-display-italic: italic;
  --tag-case: uppercase;
  --tag-tracking: 0.2em;
}

/* =========================================================
   DIRECTION 4 — PRISM (SaaS dark + glassmorphism)
   Inspiration: Linear, Vercel, Arc, Stripe, Framer
   ========================================================= */
[data-theme="prism"] {
  --paper: #050510;
  --paper-2: #0b0b1a;
  --paper-3: #14142a;
  --ink: #ffffff;
  --ink-2: rgba(255,255,255,0.72);
  --ink-3: rgba(255,255,255,0.48);
  --line: rgba(255,255,255,0.09);
  --line-2: rgba(255,255,255,0.16);
  --accent: #a78bfa;
  --accent-2: #38bdf8;
  --accent-3: #f472b6;
  --accent-4: #fb923c;
  --hero-display-font: "Instrument Serif", "Cormorant Garamond", serif;
  --hero-display-weight: 400;
  --hero-display-tracking: -0.025em;
  --hero-display-italic: normal;
  --tag-case: uppercase;
  --tag-tracking: 0.12em;

  --glass-bg: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  --glass-border: rgba(255,255,255,0.09);
  --glow-violet: 0 0 80px rgba(167,139,250,0.35);
  --glow-cyan: 0 0 80px rgba(56,189,248,0.25);
}

[data-theme="prism"] body { color-scheme: dark; }

/* AURORA BACKGROUND — only for prism */
[data-theme="prism"] .aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
[data-theme="prism"] .aurora::before,
[data-theme="prism"] .aurora::after,
[data-theme="prism"] .aurora .blob {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.55;
  will-change: transform;
}
[data-theme="prism"] .aurora::before {
  top: -10%; left: -15%;
  width: 70vw; height: 70vw;
  background: radial-gradient(circle, var(--accent), transparent 60%);
  animation: blobA 22s ease-in-out infinite alternate;
}
[data-theme="prism"] .aurora::after {
  top: 30%; right: -20%;
  width: 60vw; height: 60vw;
  background: radial-gradient(circle, var(--accent-2), transparent 60%);
  animation: blobB 28s ease-in-out infinite alternate;
}
[data-theme="prism"] .aurora .blob {
  bottom: -20%; left: 30%;
  width: 50vw; height: 50vw;
  background: radial-gradient(circle, var(--accent-3), transparent 60%);
  animation: blobC 26s ease-in-out infinite alternate;
}
@keyframes blobA {
  from { transform: translate(0,0) scale(1); }
  to { transform: translate(8vw,4vh) scale(1.15); }
}
@keyframes blobB {
  from { transform: translate(0,0) scale(1); }
  to { transform: translate(-6vw,8vh) scale(0.92); }
}
@keyframes blobC {
  from { transform: translate(0,0) scale(1); }
  to { transform: translate(-4vw,-6vh) scale(1.1); }
}

/* Noise overlay for grain */
[data-theme="prism"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(rgba(255,255,255,0.012) 1px, transparent 1px);
  background-size: 3px 3px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
}
[data-theme="prism"] .app-shell {
  background: transparent;
  position: relative;
  z-index: 2;
}

/* GLASS primitives ---------------------------------------- */
.glass {
  background: var(--glass-bg, rgba(0,0,0,0.02));
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid var(--glass-border, var(--line));
  border-radius: 24px;
}
[data-theme="atelier"] .glass,
[data-theme="studio"] .glass,
[data-theme="noir"] .glass {
  background: var(--paper);
  backdrop-filter: none;
  border-radius: 0;
}

.glow-violet { box-shadow: var(--glow-violet, none); }
.glow-cyan   { box-shadow: var(--glow-cyan, none); }

/* Gradient text */
[data-theme="prism"] .gradient-text {
  background: linear-gradient(120deg, #fff 0%, #c4b5fd 30%, #67e8f9 60%, #f9a8d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="prism"] .gradient-text-warm {
  background: linear-gradient(120deg, #fff 0%, #fbbf24 50%, #fb7185 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Pill button for prism */
[data-theme="prism"] .btn {
  border-radius: 999px;
  border-color: rgba(255,255,255,0.16);
  padding: 14px 26px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-transform: none;
}
[data-theme="prism"] .btn-accent {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #050510;
  border-color: transparent;
  box-shadow: 0 8px 32px -8px rgba(167,139,250,0.5), inset 0 1px 0 rgba(255,255,255,0.3);
}
[data-theme="prism"] .btn-accent:hover {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #050510;
  filter: brightness(1.1);
  box-shadow: 0 12px 40px -8px rgba(167,139,250,0.7), inset 0 1px 0 rgba(255,255,255,0.4);
  transform: translateY(-1px);
}
[data-theme="prism"] .btn-ghost {
  background: rgba(255,255,255,0.04);
  color: var(--ink);
  border-color: rgba(255,255,255,0.12);
  backdrop-filter: blur(12px);
}
[data-theme="prism"] .btn-ghost:hover {
  background: rgba(255,255,255,0.08);
  color: var(--ink);
}

/* topbar in prism */
[data-theme="prism"] .topbar {
  background: rgba(5,5,16,0.6);
  border-bottom-color: var(--line);
  backdrop-filter: blur(20px) saturate(1.3);
}
[data-theme="prism"] .topbar .wordmark {
  font-family: var(--hero-display-font);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.02em;
}
[data-theme="prism"] .topbar nav button {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-2);
}
[data-theme="prism"] .topbar nav button:hover { color: var(--ink); }
[data-theme="prism"] .topbar nav button.active::after { display: none; }
[data-theme="prism"] .topbar nav button.active {
  color: var(--ink);
}

/* image-slot in prism */
[data-theme="prism"] image-slot {
  background: rgba(255,255,255,0.025);
  border-radius: 16px;
  overflow: hidden;
  color: rgba(255,255,255,0.65);
}
[data-theme="prism"] image-slot::part(frame) {
  background: rgba(255,255,255,0.03);
}
[data-theme="prism"] image-slot::part(empty) {
  color: rgba(255,255,255,0.7);
}
[data-theme="prism"] image-slot::part(ring) {
  border-color: rgba(255,255,255,0.18);
}

/* select / textarea / input in prism */
[data-theme="prism"] .field,
[data-theme="prism"] input.field,
[data-theme="prism"] select.field,
[data-theme="prism"] textarea.field {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--ink);
  border-radius: 12px;
}
[data-theme="prism"] .field:focus { outline: 1px solid var(--accent); }

[data-theme="prism"] ::selection {
  background: rgba(167,139,250,0.45);
  color: #fff;
}

.app-shell {
  min-height: 100vh;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

/* TOP BAR ----------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px var(--gutter);
  /* Respecte la barre d'état / l'encoche en mode app installée (viewport-fit=cover). */
  padding-top: calc(18px + env(safe-area-inset-top));
  padding-left: calc(var(--gutter) + env(safe-area-inset-left));
  padding-right: calc(var(--gutter) + env(safe-area-inset-right));
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--paper);
  z-index: 50;
  backdrop-filter: blur(8px);
}

/* Stepper du studio (étapes 01→04) — responsive */
.aiziya-stepper { padding: 32px var(--gutter); }
.aiziya-step { padding: 20px 24px; }
.aiziya-step-n { font-size: 11px; letter-spacing: 0.14em; white-space: nowrap; }
.aiziya-step-label {
  font-family: var(--hero-display-font);
  font-weight: var(--hero-display-weight);
  font-style: var(--hero-display-italic);
  font-size: 28px;
  letter-spacing: var(--hero-display-tracking);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
@media (max-width: 720px) {
  .aiziya-stepper { padding: 14px var(--gutter); }
  .aiziya-step { padding: 11px 8px; gap: 3px; }
  .aiziya-step-n { font-size: 8px; letter-spacing: 0.06em; }
  .aiziya-step-label { font-size: 14px; }
}
@media (max-width: 380px) {
  .aiziya-step-label { font-size: 12.5px; }
  .aiziya-step { padding: 10px 6px; }
}

.topbar .wordmark {
  font-family: var(--hero-display-font);
  font-weight: var(--hero-display-weight);
  letter-spacing: var(--hero-display-tracking);
  font-style: var(--hero-display-italic);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}
[data-theme="studio"] .topbar .wordmark { font-size: 24px; letter-spacing: -0.04em; }
.topbar nav {
  display: flex;
  gap: 28px;
  align-items: center;
}
.topbar nav button {
  background: none;
  border: none;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tag-tracking);
  text-transform: var(--tag-case);
  color: var(--ink-2);
  cursor: pointer;
  position: relative;
}
.topbar nav button:hover { color: var(--ink); }
.topbar nav button.active { color: var(--ink); }
.topbar nav button.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ink);
}

/* TAGS / EYEBROWS --------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--tag-tracking);
  text-transform: var(--tag-case);
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--ink-3);
}

/* BUTTONS ----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  padding: 14px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--paper); color: var(--ink); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--paper);
}
[data-theme="studio"] .btn-accent { color: #0a0a0a; }
.btn-accent:hover { background: transparent; color: var(--ink); border-color: var(--ink); }

.btn .arrow {
  display: inline-block;
  transition: transform .25s ease;
}
.btn:hover .arrow { transform: translateX(4px); }

/* DISPLAY TYPE ------------------------------------------ */
.display {
  font-family: var(--hero-display-font);
  font-weight: var(--hero-display-weight);
  letter-spacing: var(--hero-display-tracking);
  font-style: var(--hero-display-italic);
  line-height: 0.92;
  margin: 0;
}
[data-theme="studio"] .display { line-height: 0.85; }

.serif-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

/* IMAGE SLOT styling layer ------------------------------ */
image-slot {
  --slot-bg: var(--paper-2);
  --slot-border: var(--line);
  --slot-color: var(--ink-3);
  background: var(--paper-2);
  position: relative;
}

/* PANEL / CARD ------------------------------------------ */
.panel {
  border: 1px solid var(--line);
  background: var(--paper);
}

/* DOTTED DIVIDER ---------------------------------------- */
.divider-dots {
  height: 1px;
  background-image: linear-gradient(to right, var(--line) 50%, transparent 50%);
  background-size: 8px 1px;
  width: 100%;
}

/* SCROLLBAR --------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

/* SELECT TEXT ------------------------------------------- */
::selection {
  background: var(--accent);
  color: var(--paper);
}
[data-theme="studio"] ::selection { color: #0a0a0a; }

/* =========================================================
   MOBILE OPTIMIZATIONS — tablette & smartphone
   ========================================================= */

/* Tablette : ≤ 1024px */
@media (max-width: 1024px) {
  .topbar {
    padding: 14px 20px;
    padding-top: calc(14px + env(safe-area-inset-top));
    padding-left: calc(20px + env(safe-area-inset-left));
    padding-right: calc(20px + env(safe-area-inset-right));
  }
  .topbar nav { gap: 18px; }
  .topbar nav button { font-size: 10px; }
}

/* Mobile + small-laptop : ≤ 960px — switch to hamburger */
@media (max-width: 960px) {
  /* Hide desktop nav, show hamburger in its place */
  .topbar nav.desktop-nav { display: none; }
  .topbar .mobile-only { display: inline-flex !important; }
  .topbar .desktop-only { display: none !important; }
  .topbar {
    padding: 14px 20px;
    padding-top: calc(14px + env(safe-area-inset-top));
    padding-left: calc(20px + env(safe-area-inset-left));
    padding-right: calc(20px + env(safe-area-inset-right));
    min-height: calc(60px + env(safe-area-inset-top));
  }
}

/* Mobile : ≤ 720px */
@media (max-width: 720px) {
  :root {
    --gutter: 18px;
  }

  .topbar {
    padding: 12px 18px;
    padding-top: calc(12px + env(safe-area-inset-top));
    padding-left: calc(18px + env(safe-area-inset-left));
    padding-right: calc(18px + env(safe-area-inset-right));
    min-height: calc(56px + env(safe-area-inset-top));
  }
  .topbar .wordmark { font-size: 18px; }

  /* Buttons : larger touch targets, comfortable typography */
  .btn {
    padding: 14px 22px;
    font-size: 11px;
    min-height: 44px;
  }
  [data-theme="prism"] .btn {
    padding: 13px 22px;
    font-size: 13px;
  }

  /* Smaller scrollbar */
  ::-webkit-scrollbar { width: 6px; height: 6px; }

  /* Eyebrow text doesn't wrap awkwardly */
  .eyebrow { font-size: 10px; }

  /* Image-slot tap is unaffected; just ensure no overflow */
  image-slot { max-width: 100%; }

  /* Tweaks panel pinned bottom on mobile to avoid covering content */
  .tweaks-panel { width: calc(100% - 24px) !important; right: 12px !important; bottom: 12px !important; top: auto !important; max-height: 70vh; }
}

/* Default: hide mobile-only elements on desktop */
.topbar .mobile-only { display: none; }

/* Mobile nav drawer (always present in DOM, animated on toggle) */
/* Bottom-sheet menu (mobile UX 2026) — slides up from bottom */
.mobile-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: auto;
  width: 100%;
  max-height: 86vh;
  background: var(--paper);
  border-top: 1px solid var(--line-2, var(--line));
  border-radius: 26px 26px 0 0;
  z-index: 200;
  transform: translateY(100%);
  transition: transform .42s cubic-bezier(.22,1,.36,1);
  display: flex;
  flex-direction: column;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 60px -20px rgba(0,0,0,0.5);
  overflow-y: auto;
}
.mobile-drawer.open { transform: translateY(0); }
/* Grab handle */
.mobile-drawer .drawer-grab {
  width: 42px; height: 5px; flex: none;
  border-radius: 5px; background: var(--line-2, var(--line));
  margin: 6px auto 14px;
}

/* Sticky CTA dock (mobile only, landing) */
.cta-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
  display: none; gap: 12px; align-items: center;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transform: translateY(130%);
  transition: transform .4s cubic-bezier(.22,1,.36,1);
}
.cta-dock.show { transform: translateY(0); }
.cta-dock .dock-info { flex: 1; line-height: 1.2; min-width: 0; }
.cta-dock .dock-info b { display: block; font-size: 14px; color: var(--ink); }
.cta-dock .dock-info small {
  font-family: var(--font-mono); font-size: 9px;
  color: var(--ink-3); letter-spacing: .05em;
}
.cta-dock .btn { flex: 0 0 auto; }
@media (max-width: 720px) { .cta-dock { display: flex; } }
[data-theme="prism"] .mobile-drawer {
  background: rgba(11,11,26,0.96);
  backdrop-filter: blur(40px) saturate(1.4);
  -webkit-backdrop-filter: blur(40px) saturate(1.4);
  border-left-color: rgba(255,255,255,0.08);
}
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s;
}
.mobile-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-drawer .nav-item {
  background: none;
  border: none;
  text-align: left;
  padding: 14px 12px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 48px;
  transition: background .15s;
}
.mobile-drawer .nav-item:hover,
.mobile-drawer .nav-item.active {
  background: var(--paper-2);
}
[data-theme="prism"] .mobile-drawer .nav-item:hover,
[data-theme="prism"] .mobile-drawer .nav-item.active {
  background: rgba(255,255,255,0.06);
}
.mobile-drawer .nav-item .arrow { color: var(--ink-3); font-size: 14px; }

/* Hamburger button */
.hamburger {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink);
  transition: border-color .15s;
}
.hamburger:hover { border-color: var(--ink-2); }
.hamburger svg { display: block; }

/* Responsive footer for landing-prism */
@media (max-width: 900px) {
  footer .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 28px !important;
  }
  footer .footer-brand-col {
    grid-column: 1 / -1 !important;
  }
}
@media (max-width: 520px) {
  footer .footer-grid {
    grid-template-columns: 1fr !important;
  }
  footer .footer-bottom {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  footer .footer-wordmark {
    font-size: clamp(72px, 28vw, 200px) !important;
  }
}

/* Safe-area for notched devices */
@supports (padding: max(0px)) {
  .topbar {
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(var(--gutter), env(safe-area-inset-right));
  }
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Mobile typography refinement */
@media (max-width: 720px) {
  h1.display, .display { line-height: 0.98; }
  /* Stack hero CTAs full-width on small screens */
  .hero-cta-row { width: 100%; flex-direction: column !important; }
  .hero-cta-row .btn { width: 100% !important; justify-content: center; }
}

/* =========================================================
   Responsive grid overrides for landing-prism
   (inline-styled, hence !important)
   ========================================================= */
@media (max-width: 1024px) {
  [data-screen-label="01 Landing"] section > div[style*="repeat(12"] {
    grid-template-columns: repeat(6, 1fr) !important;
    grid-template-rows: auto !important;
    grid-auto-rows: minmax(180px, auto) !important;
  }
  [data-screen-label="01 Landing"] section > div[style*="repeat(12"] > * {
    grid-column: span 6 !important;
    grid-row: auto !important;
  }
  [data-screen-label="01 Landing"] section > div[style*="repeat(4, 1fr)"]:not(image-slot div) {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 720px) {
  /* Hero h1 — extra restraint */
  [data-screen-label="01 Landing"] h1 {
    font-size: clamp(38px, 11vw, 56px) !important;
  }
  /* Bento → 1-col stack */
  [data-screen-label="01 Landing"] section > div[style*="repeat(12"] {
    grid-template-columns: 1fr !important;
  }
  [data-screen-label="01 Landing"] section > div[style*="repeat(12"] > * {
    grid-column: 1 / -1 !important;
  }
  /* repeat(3) / repeat(4) → 1 col */
  [data-screen-label="01 Landing"] section > div[style*="repeat(3, 1fr)"],
  [data-screen-label="01 Landing"] section > div[style*="repeat(4, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }
  /* Stats banner */
  [data-screen-label="01 Landing"] section > div[style*="grid"][style*="repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
    text-align: left !important;
  }
  /* Section padding */
  [data-screen-label="01 Landing"] section {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
  /* Reduce massive padding */
  [data-screen-label="01 Landing"] section[style*="padding"] {
    padding-top: clamp(40px, 8vw, 60px) !important;
    padding-bottom: clamp(40px, 8vw, 60px) !important;
  }
  /* Pricing → horizontal scroll-snap carousel (overrides the 1-col stack above) */
  [data-screen-label="01 Landing"] section > div.pricing-grid {
    display: flex !important;
    grid-template-columns: none !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 14px !important;
    margin: 56px -18px 0 !important;
    padding: 4px 18px 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  [data-screen-label="01 Landing"] section > div.pricing-grid::-webkit-scrollbar { display: none; }
  [data-screen-label="01 Landing"] section > div.pricing-grid > * {
    scroll-snap-align: center;
    flex: 0 0 82%;
  }
}

/* Final CTA card — soften padding on mobile */
@media (max-width: 720px) {
  footer { padding-left: 18px !important; padding-right: 18px !important; }
}

/* =========================================================
   Mobile — Auth modal as bottom-sheet + onboarding safeguards
   ========================================================= */
@media (max-width: 720px) {
  /* Auth: dock the panel to the bottom like a sheet */
  .auth-overlay {
    align-items: end !important;
    padding: 0 !important;
  }
  .auth-panel {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    max-height: 92dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(28px + env(safe-area-inset-bottom)) !important;
  }
  /* Prevent iOS auto-zoom on focus (inputs must be ≥16px) */
  .auth-panel input { font-size: 16px !important; }
  /* Stack name / brand fields */
  .auth-2col { grid-template-columns: 1fr !important; }
  /* Bigger close target */
  .auth-panel > button[aria-label="Fermer"] { width: 40px !important; height: 40px !important; }

  /* Onboarding: never overflow short screens, respect safe-area */
  .onboarding-card {
    max-height: 90dvh;
    overflow-y: auto;
    margin-bottom: env(safe-area-inset-bottom);
  }
}

/* =========================================================
   Mobile — Dashboard + Studio (core product) responsive
   ========================================================= */
@media (max-width: 720px) {
  /* STUDIO — stack 12-col layout grids and their spanning children */
  [data-screen-label^="02 Studio"] [style*="repeat(12, 1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  [data-screen-label^="02 Studio"] [style*="repeat(12, 1fr)"] > * {
    grid-column: 1 / -1 !important;
  }
  /* STUDIO — collapse fixed-width sidebars to a single column */
  [data-screen-label^="02 Studio"] [style*="160px 1fr"],
  [data-screen-label^="02 Studio"] [style*="180px 1fr"],
  [data-screen-label^="02 Studio"] [style*="120px 1fr"],
  [data-screen-label^="02 Studio"] [style*="380px 1fr"],
  [data-screen-label^="02 Studio"] [style*="80px 120px 1fr"],
  [data-screen-label^="02 Studio"] [style*="64px 100px 1fr auto"] {
    grid-template-columns: 1fr !important;
  }
  /* STUDIO — 3-col card rows become 1 col (avoid cramped thirds) */
  [data-screen-label^="02 Studio"] [style*="repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
  /* STUDIO — tighten outer gutter */
  .screen[data-screen-label^="02 Studio"] {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* DASHBOARD — header stacks, stat band becomes 2 columns */
  [data-screen-label="00 Dashboard"] [style*="1.4fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  [data-screen-label="00 Dashboard"] [style*="repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .screen[data-screen-label="00 Dashboard"] {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
}

/* =========================================================
   Mobile — Mock "studio live" du hero : empilé pour lisibilité
   ========================================================= */
@media (max-width: 720px) {
  .hero-bento {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    gap: 10px !important;
  }
  .hero-bento > div {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
    height: auto !important;
    min-height: 92px;
    padding: 14px !important;
  }
  /* Le nom de campagne (display) : un cran plus petit pour ne jamais déborder */
  .hero-bento > div > div > div[style*="font-size: 48"] {
    font-size: 34px !important;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-theme="prism"] .aurora::before,
  [data-theme="prism"] .aurora::after,
  [data-theme="prism"] .aurora .blob {
    animation: none;
  }
}
/* ============================================================
   STUDIO — responsive mobile (grilles empilées sur petit écran)
   Les grilles inline 12-colonnes / vidéo / storyboard passent en
   une colonne. Le !important neutralise les styles inline sur mobile.
   ============================================================ */
@media (max-width: 760px) {
  .aiziya-grid12 { grid-template-columns: 1fr !important; gap: 20px !important; }
  .aiziya-grid12 > * { grid-column: auto !important; }
  .aiziya-vidrow { grid-template-columns: 1fr !important; gap: 24px !important; }
  .aiziya-vidrow > * { min-width: 0 !important; }
  .aiziya-sbframe { grid-template-columns: 1fr !important; gap: 4px !important; padding: 16px 0 !important; }
}
