/* PINAPP — grid.css v4.5 — modernité Apple : tracking, radius, spacing, spring */
@import url('./css/fonts.css');

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

html {
  scroll-behavior: auto; /* Pinapp : zéro scroll animé (pas de smooth) */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip; /* aligné body — évite débordement horizontal global (iOS) */
}

body {
  font-family: var(--font-body, var(--font-apple-sans));
  font-size: var(--text-body, 1.0625rem);
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Repli si feuilles de variables / chemins absolus cassés (déploiement, sous-dossier) */
  color: var(--text-primary, #0f2e28);
  background-color: var(--bg-primary, #e8f2ef);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
}

html[data-theme='dark'] body {
  color: var(--text-primary, #e4f7f3);
  background-color: var(--bg-primary, #061a18);
}

/* Hero accueil — hauteur viewport mobile (barre d’URL iOS / Android) + encoches */
.pinapp-hero-viewport {
  min-height: min(72vh, 600px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding-top: max(3.5rem, calc(env(safe-area-inset-top, 0px) + 2.5rem));
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  padding-bottom: var(--space-5);
}
/* Accueil uniquement : plein viewport */
main.home-landing > .pinapp-hero-viewport,
.hero-fullscreen {
  min-height: 100svh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@supports not (min-height: 100svh) {
  main.home-landing > .pinapp-hero-viewport,
  .hero-fullscreen {
    min-height: 100vh;
  }
}

/* Voile lecture : contraste texte / fond (WCAG — Apple HIG) */
.pinapp-hero-viewport::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 120% 90% at 50% 100%, rgba(0, 200, 180, 0.1) 0%, transparent 50%),
    radial-gradient(
      ellipse 95% 75% at 50% 42%,
      rgba(8, 36, 34, 0.06) 0%,
      rgba(6, 40, 38, 0.32) 55%,
      rgba(4, 44, 42, 0.48) 100%
    );
}
html[data-theme='light'] .pinapp-hero-viewport::before,
body.mode-jour .pinapp-hero-viewport::before {
  background: radial-gradient(
    ellipse 95% 75% at 50% 42%,
    rgba(251, 245, 232, 0.15) 0%,
    rgba(251, 245, 232, 0.35) 55%,
    rgba(244, 236, 220, 0.55) 100%
  );
}

.pinapp-hero-viewport > .container {
  position: relative;
  z-index: 2;
}

.pinapp-hero-viewport .scroll-chevron {
  position: absolute;
  bottom: max(2rem, calc(env(safe-area-inset-bottom, 0px) + 1.25rem));
  opacity: 0.5;
}

/* Indicateur scroll hero (souvent en dehors du .container) */
.pinapp-hero-viewport .scroll-indicator {
  z-index: 3;
}

/* Accueil — règle zéro scroll (cf. .cursor/rules/pinapp-zero-scroll.mdc) */
@media (min-width: 1024px) {
  main.home-landing .pinapp-hero-viewport {
    min-height: auto;
    padding-top: max(2.5rem, calc(env(safe-area-inset-top, 0px) + 2rem));
    padding-bottom: var(--space-3);
  }
  main.home-landing #parcours.section {
    padding-top: var(--space-3);
    padding-bottom: var(--space-4);
  }
  main.home-landing #parcours .grid.grid-2 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-2);
  }
  main.home-landing #parcours .card {
    padding: var(--space-3);
  }
  main.home-landing #parcours h2 {
    margin-bottom: var(--space-2);
  }
  main.home-landing #parcours .home-landing__lead {
    margin-bottom: var(--space-4);
  }
}

@media (max-width: 767px) {
  main.home-landing .pinapp-hero-viewport {
    min-height: auto;
    padding-top: max(2.5rem, calc(env(safe-area-inset-top, 0px) + 2rem));
    padding-bottom: var(--space-3);
  }
  main.home-landing #parcours.section {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
  }
  main.home-landing #parcours .grid.grid-2 {
    gap: var(--space-2);
  }
  main.home-landing #parcours .home-landing__lead {
    margin-bottom: var(--space-4) !important;
  }
  input,
  textarea,
  select {
    font-size: max(1rem, 16px);
  }
}

button,
a,
.nav-link {
  -webkit-tap-highlight-color: rgba(62, 235, 214, 0.14);
}

html[data-theme='light'] button,
html[data-theme='light'] a,
html[data-theme='light'] .nav-link {
  -webkit-tap-highlight-color: rgba(10, 143, 130, 0.16);
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) button,
  html:not([data-theme]) a,
  html:not([data-theme]) .nav-link {
    -webkit-tap-highlight-color: rgba(10, 143, 130, 0.16);
  }
}

#cookie-banner {
  padding-bottom: max(var(--space-3), env(safe-area-inset-bottom, 0px)) !important;
  padding-left: max(var(--space-3), env(safe-area-inset-left, 0px)) !important;
  padding-right: max(var(--space-3), env(safe-area-inset-right, 0px)) !important;
}

/* Démos sectorielles — bandeau + plein écran mobile */
.demo-live-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  box-sizing: border-box;
  height: calc(36px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0
    env(safe-area-inset-left, 0px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(62, 235, 214, 0.85);
  background: rgba(4, 14, 22, 0.96);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

body.demo-page #contenu-principal.demo-main {
  padding: calc(36px + env(safe-area-inset-top, 0px) + var(--space-5)) var(--space-5) var(--space-5);
  min-height: 100vh;
  min-height: 100dvh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15; /* 1.1 trop serré sur certaines graisses — 1.15 proche du standard Apple */
  letter-spacing: -0.04em;
}

h3,
h4,
h5,
h6 {
  line-height: 1.2;
  letter-spacing: -0.025em;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}
a {
  color: inherit;
}
button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
}

input,
textarea {
  font: inherit;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: var(--space-2) var(--space-3);
}

/* Contenu au-dessus des calques body::before (fonds WebP + overlay) */
.stack-above-bg {
  position: relative;
  z-index: 1;
}

/* Ancre #contenu-principal : éviter que le titre passe sous la nav fixe */
main#contenu-principal {
  scroll-margin-top: calc(5.125rem + env(safe-area-inset-top, 0px));
}

/* --- Mobile d’abord (largeur type ~390px) --- */
.container {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 var(--space-3); /* 16px mobile — Apple minimum (était 8px) */
}

.section {
  position: relative;
  padding: var(--space-5) 0;
  isolation: isolate;
}

/* Orbes de lumière par section — bioluminescence Pandora pulsante */
.section::after {
  content: '';
  position: absolute;
  width: min(50vw, 32rem);
  height: min(50vw, 32rem);
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
  top: -10%;
  right: -10%;
  background: var(--accent-violet);
  animation: orb-section-violet 6s ease-in-out infinite;
}

.section:nth-of-type(even)::after {
  right: auto;
  left: -12%;
  top: 15%;
  background: var(--accent-teal);
  animation: orb-section-teal 7s ease-in-out infinite;
}

.section:nth-of-type(3n)::after {
  background: var(--accent-green);
  top: 35%;
  right: 3%;
  left: auto;
  animation: orb-section-green 5.5s ease-in-out infinite;
}

/* Mode clair : orbes ambre + jade Pandora */
html[data-theme='light'] .section::after,
body.mode-jour .section::after {
  background: rgba(255, 185, 60, 0.8);
  filter: blur(90px);
  animation: orb-section-ambre 7s ease-in-out infinite;
}

html[data-theme='light'] .section:nth-of-type(even)::after,
body.mode-jour .section:nth-of-type(even)::after {
  background: rgba(60, 200, 155, 0.75);
  animation: orb-section-jade 6.5s ease-in-out infinite;
}

html[data-theme='light'] .section:nth-of-type(3n)::after,
body.mode-jour .section:nth-of-type(3n)::after {
  background: rgba(195, 155, 245, 0.7);
  animation: orb-section-lavande 5.5s ease-in-out infinite;
}

@keyframes orb-section-violet {
  0%,
  100% {
    opacity: 0.2;
    transform: scale(1) translate(0, 0);
  }
  50% {
    opacity: 0.35;
    transform: scale(1.1) translate(-12px, 8px);
  }
}
@keyframes orb-section-teal {
  0%,
  100% {
    opacity: 0.18;
    transform: scale(1) translate(0, 0);
  }
  50% {
    opacity: 0.32;
    transform: scale(1.12) translate(10px, -6px);
  }
}
@keyframes orb-section-green {
  0%,
  100% {
    opacity: 0.12;
    transform: scale(1);
  }
  50% {
    opacity: 0.24;
    transform: scale(1.08) translate(6px, 10px);
  }
}
@keyframes orb-section-ambre {
  0%,
  100% {
    opacity: 0.14;
    transform: scale(1);
  }
  50% {
    opacity: 0.25;
    transform: scale(1.1) translate(-8px, 6px);
  }
}
@keyframes orb-section-jade {
  0%,
  100% {
    opacity: 0.12;
    transform: scale(1);
  }
  50% {
    opacity: 0.22;
    transform: scale(1.08) translate(10px, -4px);
  }
}
@keyframes orb-section-lavande {
  0%,
  100% {
    opacity: 0.1;
    transform: scale(1);
  }
  50% {
    opacity: 0.2;
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .section::after {
    animation: none !important;
    opacity: 0.15 !important;
  }
}

@media (max-width: 767px) {
  .section::after {
    display: none;
  }
}

.grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 1fr;
}

.grid-2,
.grid-3,
.grid-4 {
  grid-template-columns: 1fr;
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-card-lg);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 0 48px var(--glow-teal),
    0 0 96px var(--glow-teal-lg),
    0 8px 32px rgba(0, 0, 0, 0.14);
  padding: var(--space-4);
  transition:
    transform var(--t-spring),
    box-shadow var(--t-hover),
    border-color var(--t-hover);
}

/* Spécularité Apple : reflet de lumière sur le bord supérieur */
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 5%;
  right: 5%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.28) 30%,
    rgba(255, 255, 255, 0.44) 50%,
    rgba(255, 255, 255, 0.28) 70%,
    transparent
  );
  border-radius: 1px;
  pointer-events: none;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-3px) scale(1.004);
    border-color: rgba(62, 235, 214, 0.22);
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.12) inset,
      0 0 64px rgba(62, 235, 214, 0.14),
      0 0 120px rgba(107, 158, 255, 0.07),
      0 16px 48px rgba(0, 0, 0, 0.18);
  }
}

.card:active {
  transform: scale(0.985);
  transition: transform var(--t-press);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  padding: 0.8125rem var(--space-4);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--text-cta);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  -webkit-font-smoothing: antialiased;
  transition:
    transform var(--t-spring),
    box-shadow var(--t-hover),
    opacity var(--t-hover);
}

.btn-primary {
  position: relative;
  background: var(--violet, #7b4fe8);
  color: #ffffff;
  font-weight: 500;
  letter-spacing: 0.06em;
  border-radius: 100px;
  box-shadow: 0 0 24px rgba(123, 79, 232, 0.4);
}

body.mode-jour .btn-primary,
html[data-theme='light'] .btn-primary {
  background: var(--violet, #5b3fd8);
  color: #ffffff;
  box-shadow: 0 0 24px rgba(91, 63, 216, 0.35);
}

@media (hover: hover) {
  .btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px) scale(1.015);
    box-shadow:
      0 0 40px rgba(123, 79, 232, 0.6),
      0 8px 32px rgba(123, 79, 232, 0.28);
  }
}

.btn-secondary {
  background: rgba(62, 235, 214, 0.06);
  color: var(--accent-teal);
  border: 1px solid var(--border-card);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 0 20px rgba(62, 235, 214, 0.06);
}

@media (hover: hover) {
  .btn-secondary:hover {
    border-color: rgba(62, 235, 214, 0.35);
    box-shadow:
      0 0 28px rgba(62, 235, 214, 0.15),
      0 0 0 1px rgba(62, 235, 214, 0.12) inset;
    background: rgba(62, 235, 214, 0.08);
  }
}

html[data-theme='light'] .btn-secondary {
  background: rgba(0, 143, 134, 0.07);
  box-shadow:
    0 0 18px rgba(0, 143, 134, 0.09),
    0 0 0 1px rgba(212, 137, 110, 0.11) inset;
}

@media (hover: hover) {
  html[data-theme='light'] .btn-secondary:hover {
    border-color: rgba(0, 143, 134, 0.42);
    box-shadow:
      0 0 26px rgba(0, 143, 134, 0.16),
      0 0 0 1px rgba(212, 137, 110, 0.14) inset;
    background: rgba(0, 143, 134, 0.11);
  }
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) .btn-secondary {
    background: rgba(0, 143, 134, 0.07);
    box-shadow:
      0 0 18px rgba(0, 143, 134, 0.09),
      0 0 0 1px rgba(212, 137, 110, 0.11) inset;
  }
}

@media (prefers-color-scheme: light) and (hover: hover) {
  html:not([data-theme]) .btn-secondary:hover {
    border-color: rgba(0, 143, 134, 0.42);
    box-shadow:
      0 0 26px rgba(0, 143, 134, 0.16),
      0 0 0 1px rgba(212, 137, 110, 0.14) inset;
    background: rgba(0, 143, 134, 0.11);
  }
}

.label {
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-teal);
  text-shadow: 0 0 20px rgba(62, 235, 214, 0.2);
}

html[data-theme='light'] .label {
  color: var(--accent-teal);
  text-shadow:
    0 0 22px rgba(212, 137, 110, 0.28),
    0 0 18px rgba(0, 143, 134, 0.18);
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) .label {
    color: var(--accent-teal);
    text-shadow:
      0 0 22px rgba(212, 137, 110, 0.28),
      0 0 18px rgba(0, 143, 134, 0.18);
  }
}

/* --- Tablette --- */
@media (min-width: 768px) {
  .section {
    padding: var(--space-6) 0;
  }

  .container {
    padding: 0 var(--space-3);
  }

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

/* --- Bureau --- */
@media (min-width: 1024px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3000;
  isolation: isolate;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  background: var(--nav-bg);
  backdrop-filter: blur(28px) saturate(165%);
  -webkit-backdrop-filter: blur(28px) saturate(165%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    0 0 0 1px var(--border-card) inset,
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 8px 40px rgba(0, 0, 0, 0.1);
}

/* Apple : séparateur nav — ligne ultra-fine, quasi-invisible */
.nav::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.5px;
  background: linear-gradient(
    90deg,
    rgba(62, 235, 214, 0.07) 0%,
    rgba(62, 235, 214, 0.42) 30%,
    rgba(107, 158, 255, 0.32) 60%,
    rgba(123, 79, 232, 0.08) 100%
  );
  opacity: 0.6;
  pointer-events: none;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
  height: 3.25rem; /* 52px — place pour logo plus lisible */
}

.nav-logo,
.nav-trailing {
  flex-shrink: 0;
}

/* Logo marque officiel Pinapp — /assets/images/pinapp-logo.png */
.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.nav-logo-img {
  height: 2.75rem;
  width: auto;
  max-width: min(14.5rem, 62vw);
  object-fit: contain;
  object-position: left center;
}

@media (min-width: 768px) {
  .nav-logo-img {
    height: 3.125rem;
    max-width: 16rem;
  }
}

.page-hero-logo-img {
  height: auto;
  width: min(18rem, 85vw);
  max-height: 5.5rem;
  object-fit: contain;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 2rem;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
    flex: 1 1 auto;
    justify-content: center;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    gap: clamp(0.75rem, 1.5vw, 2rem);
    padding: 0 var(--space-1);
    scrollbar-width: thin;
  }

  .nav-links::-webkit-scrollbar {
    height: 3px;
  }

  .nav-links::-webkit-scrollbar-thumb {
    background: var(--border-card);
    border-radius: 100px;
  }
}

.nav-trailing {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem; /* 44px — HIG Apple */
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  transition:
    box-shadow var(--t-hover),
    border-color var(--t-hover),
    background var(--t-hover);
}

@media (hover: hover) {
  .theme-toggle:hover {
    border-color: rgba(62, 235, 214, 0.35);
    box-shadow: 0 0 24px rgba(62, 235, 214, 0.18);
    background: rgba(62, 235, 214, 0.1);
  }
}

.theme-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

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

html[data-theme='dark'] .theme-toggle .theme-icon-sun,
html[data-theme='light'] .theme-toggle .theme-icon-moon {
  display: block;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .theme-toggle .theme-icon-sun {
    display: block;
  }
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) .theme-toggle .theme-icon-moon {
    display: block;
  }
}

.burger {
  display: flex;
  width: 2.75rem; /* 44px — HIG Apple */
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  border-radius: var(--radius-input);
  border: 1px solid var(--border-card);
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  transition:
    box-shadow var(--t-hover),
    border-color var(--t-hover);
}

@media (hover: hover) {
  .burger:hover {
    border-color: rgba(107, 158, 255, 0.35);
    box-shadow: 0 0 28px rgba(107, 158, 255, 0.22);
  }
}

@media (min-width: 768px) {
  .burger {
    display: none;
  }
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 3500;
  background: var(--bg-overlay);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--t-standard),
    visibility var(--t-standard);
}

.mobile-drawer.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.mobile-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(22rem, 90vw);
  height: 100%;
  padding: calc(var(--space-5) + env(safe-area-inset-top, 0px)) var(--space-4)
    calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
  background: var(--bg-card);
  backdrop-filter: blur(40px) saturate(190%);
  -webkit-backdrop-filter: blur(40px) saturate(190%);
  border-left: 1px solid var(--border-card);
  box-shadow:
    -1px 0 0 rgba(255, 255, 255, 0.06) inset,
    -24px 0 80px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  transition: transform var(--t-enter);
  display: flex;
  flex-direction: column;
}

.mobile-drawer.open .mobile-drawer-panel {
  transform: translateX(0);
}

#drawerClose {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: 16px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #eef8ff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  z-index: 1;
}

/* Nav-links dans le drawer : forcer l'affichage (display:none par défaut sur mobile) */
.mobile-drawer .nav-links,
.mobile-drawer-panel .nav-links {
  display: flex !important;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  width: 100%;
  padding: 0;
  overflow: visible;
}

.mobile-drawer a,
.mobile-drawer-panel a {
  display: block;
  padding: var(--space-2) 0;
  text-decoration: none;
  font-size: 1.0625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  opacity: 0.85;
  width: 100%;
  min-height: 44px; /* HIG Apple : touch target minimum */
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.mobile-drawer a:last-child,
.mobile-drawer-panel a:last-child {
  border-bottom: none;
  margin-top: var(--space-2);
}

/* Bouton CTA dans drawer : full width */
.mobile-drawer .btn,
.mobile-drawer .btn-primary,
.mobile-drawer-panel .btn,
.mobile-drawer-panel .btn-primary {
  width: 100% !important;
  justify-content: center !important;
  margin-top: var(--space-3) !important;
  text-align: center !important;
}

.bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2800;
  min-height: 3.5rem;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  box-sizing: border-box;
  align-items: center;
  justify-content: space-around;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid var(--border-card);
  box-shadow:
    0 -8px 32px rgba(0, 0, 0, 0.15),
    0 -1px 0 rgba(62, 235, 214, 0.1);
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 767px) {
  .bottom-bar {
    display: flex;
  }
}

/* Tap target min 44px HIG Apple */
.bottom-bar a {
  text-decoration: none;
  opacity: 0.75;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem; /* = hauteur bottom-bar */
  padding: 0 0.5rem;
  gap: 2px;
}

@media (max-width: 767px) {
  .page-with-bottom-nav {
    padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* Loader */
#loader {
  position: fixed;
  inset: 0;
  z-index: 8000;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 45%, rgba(107, 158, 255, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(62, 235, 214, 0.08), transparent 50%),
    var(--bg-primary);
}

#loader::before {
  content: '';
  position: absolute;
  width: min(80vw, 24rem);
  height: min(80vw, 24rem);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(62, 235, 214, 0.06), transparent 65%);
  filter: blur(40px);
  pointer-events: none;
  animation: loader-pulse 3s ease-in-out infinite;
}

@keyframes loader-pulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

#loader svg,
#loader p {
  position: relative;
  z-index: 1;
}

#loader p {
  font-size: 0.6875rem;
  opacity: 0.4;
  margin-top: var(--space-2);
  letter-spacing: 0.1em;
}

/* Filtres réalisations */
.filter-btn {
  padding: 0.5rem 1.25rem;
  min-height: 44px; /* touch target iOS */
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  border: 1px solid var(--border-card);
  background: rgba(62, 235, 214, 0.03);
  color: var(--text-primary);
  box-shadow: 0 0 16px rgba(62, 235, 214, 0.04);
  transition:
    background var(--t-hover),
    border-color var(--t-hover),
    box-shadow var(--t-hover);
}

.filter-btn.active {
  border-color: var(--accent-teal);
  color: var(--accent-teal);
  background: rgba(62, 235, 214, 0.1);
  box-shadow:
    0 0 24px rgba(62, 235, 214, 0.2),
    0 0 0 1px rgba(62, 235, 214, 0.15) inset;
}

@media (hover: hover) {
  .filter-btn:hover:not(.active) {
    border-color: rgba(62, 235, 214, 0.25);
    box-shadow: 0 0 20px rgba(62, 235, 214, 0.1);
  }
}

/* Onboarding pills */
.pill-btn {
  padding: 0.625rem 1.25rem;
  min-height: 44px; /* touch target iOS */
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-card);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: rgba(107, 158, 255, 0.06);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition:
    border-color var(--t-hover),
    color var(--t-hover),
    box-shadow var(--t-hover),
    background var(--t-hover);
}

@media (hover: hover) {
  .pill-btn:hover {
    border-color: rgba(107, 158, 255, 0.45);
    box-shadow: 0 0 24px rgba(107, 158, 255, 0.2);
    background: rgba(107, 158, 255, 0.12);
  }
}

.pill-btn:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

/* Section problème : fond lisible en mode clair */
html[data-theme='light'] [data-chapter='probleme'] {
  background: linear-gradient(180deg, rgba(212, 137, 110, 0.09) 0%, rgba(94, 79, 212, 0.05) 100%);
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) [data-chapter='probleme'] {
    background: linear-gradient(180deg, rgba(212, 137, 110, 0.09) 0%, rgba(94, 79, 212, 0.05) 100%);
  }
}

/* Bloc Auralis : une colonne sur mobile */
.auralis-split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
}

@media (min-width: 768px) {
  .auralis-split {
    grid-template-columns: 1fr 1fr;
  }
}

/* Barres progression dashboard / client */
.progress-bar {
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-teal));
}

/* Listes pages offres / légal */
.prose ul {
  margin: var(--space-3) 0 var(--space-4);
  padding-left: 1.25rem;
  opacity: 0.85;
  line-height: 1.8;
}

.prose li {
  margin-bottom: var(--space-1);
}

.prose h2 {
  font-size: 1.5rem;
  margin: var(--space-5) 0 var(--space-2);
}

.prose h1 + p,
.prose .lead {
  font-size: 1.25rem;
  opacity: 0.7;
  margin-bottom: var(--space-4);
}

/* Pages démo : bandeau fixe */
body.demo-page {
  padding-top: 2.25rem;
}

/* Pied de page — liseré lumineux + relief */
footer {
  position: relative;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.12);
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 5%,
    var(--accent-teal) 35%,
    var(--accent-violet) 50%,
    var(--accent-green) 65%,
    transparent 95%
  );
  opacity: 0.55;
  pointer-events: none;
}

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

/* Accès clavier — lien d’évitement + focus visible */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-2);
  z-index: 10000;
  padding: var(--space-2) var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--accent-teal);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: max(var(--space-2), env(safe-area-inset-top, 0px));
  left: max(var(--space-2), env(safe-area-inset-left, 0px));
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

/* Second lien d’évitement : navigation principale */
.skip-link.skip-link--nav:focus {
  top: calc(max(var(--space-2), env(safe-area-inset-top, 0px)) + 2.85rem);
  left: max(var(--space-2), env(safe-area-inset-left, 0px));
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible,
.theme-toggle:focus-visible,
.burger:focus-visible,
.filter-btn:focus-visible,
.faq-trigger:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

.realisation-card:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: 4px;
}

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE MOBILE & TABLETTE — glass adapté, touch, typographie
   ════════════════════════════════════════════════════════════════════ */

/* ─── Touch : supprimer les effets hover (jamais de :hover sur touch) ─── */
@media (hover: none) {
  * {
    -webkit-tap-highlight-color: transparent;
  }

  .card:hover {
    transform: none;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.08) inset,
      0 8px 32px rgba(0, 0, 0, 0.14);
    border-color: var(--border-card);
  }
  .btn-primary:hover {
    transform: none;
  }
  .btn-secondary:hover {
    transform: none;
  }
  .nav-link:hover {
    opacity: 0.8;
  }
  .nav-link:hover::after {
    width: 0;
  }
  .filter-btn:hover:not(.active) {
    border-color: var(--border-card);
    box-shadow: none;
  }
  .pill-btn:hover {
    border-color: var(--border-card);
    box-shadow: none;
    background: rgba(107, 158, 255, 0.06);
  }

  /* Feedback tactile rapide sur les éléments interactifs */
  .card:active {
    transform: scale(0.97);
  }
  .btn:active {
    transform: scale(0.96);
  }
  .bottom-bar a:active,
  .bottom-bar .bottom-bar-cta:active {
    opacity: 0.88;
  }
  .bottom-bar .bottom-bar-cta:active {
    transform: scale(0.97);
  }
  #drawerClose:active {
    transform: scale(0.94);
  }
}

/* ─── Mobile (<768px) ─── */
@media (max-width: 767px) {
  /* Sections — très compact sur mobile */
  section {
    padding: var(--space-4) var(--space-3);
  }
  .section {
    padding: var(--space-4) 0;
  }
  /* sauf sections hero qui gardent leur padding propre */
  .pinapp-hero-viewport {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  /* Grilles — 1 colonne */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  /* Split section — empilé */
  .split-section {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  /* Le reflet spéculaire reste sur toutes les cards */
  .card::before {
    opacity: 0.8;
  }

  /* Padding card réduit */
  .card {
    padding: var(--space-3);
  }

  /* Boutons — pleine largeur sur petits écrans */
  .btn-block-mobile {
    width: 100%;
    justify-content: center;
  }

  /* Hero typographie — fluid (s'applique à TOUT h1 sur mobile) */
  h1,
  .hero-title,
  h1.hero-title {
    font-size: clamp(1.875rem, 8.5vw, 3rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* h2 sur mobile */
  h2 {
    font-size: clamp(1.5rem, 6vw, 2.25rem);
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* Taglines / sous-titres hero */
  .hero-lead {
    font-size: clamp(0.9375rem, 4vw, 1.125rem);
  }

  /* Pills — flex-wrap pour éviter overflow horizontal */
  .formation-grid,
  [class*='pills'],
  [class*='pill-row'],
  [class*='filter-row'] {
    flex-wrap: wrap;
  }

  /* Navigation sur mobile */
  nav.scrolled {
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    backdrop-filter: blur(20px) saturate(160%);
    background: var(--glass-nav);
    border-bottom: 1px solid var(--border-subtle);
  }

  /* Inputs — taille min 16px pour éviter le zoom Safari */
  input,
  textarea,
  select {
    font-size: max(1rem, 16px);
  }

  /* Tiroir mobile — effet verre préservé */
  .mobile-drawer-panel {
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    backdrop-filter: blur(40px) saturate(180%);
  }

  /* Footer colonnes */
  footer .grid-3,
  footer .grid-4 {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }
}

/* ─── Tablette (768px – 1023px) ─── */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Sections — padding horizontal via container uniquement */
  section {
    padding: var(--space-7) 0;
  }

  /* Grilles — 2 colonnes (y compris grid-2) */
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }

  /* Split section */
  .split-section {
    flex-direction: column;
    align-items: center;
    gap: 64px;
  }

  /* Cards — backdrop-filter préservé sur tablette (GPU suffisant) */
  .card {
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    backdrop-filter: blur(24px) saturate(160%);
    padding: var(--space-4);
  }

  /* Boutons — taille intermédiaire */
  .btn {
    padding: 0.875rem var(--space-4);
    font-size: 0.9375rem;
  }

  /* Hero */
  .hero-title,
  h1.hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
  }
}

/* ─── Très petits écrans (<400px) ─── */
@media (max-width: 399px) {
  section {
    padding: var(--space-4) var(--space-2);
  } /* 24px sides, 16px gutter */

  .hero-title,
  h1.hero-title {
    font-size: clamp(1.75rem, 8vw, 2.5rem);
    letter-spacing: -0.035em;
  }

  .card {
    padding: var(--space-3) var(--space-2);
    border-radius: var(--radius-card);
  }

  .btn {
    padding: 0.75rem var(--space-3);
    font-size: 0.875rem;
  }
}

/* ─── Orientation paysage sur petits écrans ─── */
@media (max-height: 500px) and (orientation: landscape) {
  /* Paysage court : barre un peu plus basse — logo réduit pour ne pas dépasser la hauteur fixée */
  .nav-inner {
    height: 2.96875rem;
  }
  .nav-logo-img {
    height: 2.375rem;
    max-width: min(12rem, 50vw);
  }
  @media (min-width: 768px) {
    .nav-logo-img {
      height: 2.625rem;
      max-width: 13.5rem;
    }
  }
  section {
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
  }
}

/* ─── Reduced motion — désactiver les animations lourdes ─── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .aurora-orb,
  canvas,
  .pinapp-particle,
  .holo-grid {
    display: none;
  }
}

/* ─── Fallback backdrop-filter (Safari ancien / Firefox sans flag) ─── */
@supports not (backdrop-filter: blur(1px)) {
  .card,
  [class*='card'] {
    background: rgba(6, 12, 28, 0.9);
  }
  nav.scrolled {
    background: rgba(4, 8, 18, 0.96);
  }
  .mobile-drawer-panel {
    background: rgba(4, 8, 18, 0.97);
  }
}

/* =====================================================
   FOOTER v5 — Pinapp Studio
   ===================================================== */

.site-footer {
  position: relative;
  padding: var(--space-7) 0 var(--space-5);
  overflow: hidden;
  border-top: 1px solid var(--separator, rgba(0, 180, 216, 0.06));
}
.site-footer .container {
  position: relative;
  text-align: center;
}

/* Signature — accord final */
.footer-signature {
  font-size: 1.0625rem;
  font-style: italic;
  font-family: var(--font-apple-serif);
  opacity: 0.55;
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
  color: var(--text);
}

/* Liens footer — contraste renforcé (WCAG / lisibilité type Apple footers) */
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  font-size: 14px;
  opacity: 0.88;
}
.footer-links a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: opacity var(--t-hover, 200ms);
}
.footer-links a:hover {
  opacity: 1;
}
html[data-theme='light'] .footer-links,
body.mode-jour .footer-links {
  opacity: 0.92;
}
html[data-theme='light'] .footer-links a,
body.mode-jour .footer-links a {
  color: rgba(26, 10, 46, 0.78);
}

/* Copyright */
.footer-copy {
  font-size: 11px;
  opacity: 0.35;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Watermark SVG */
.footer-watermark {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
/* =====================================================
   BLOCS SÉMANTIQUES v5 — couleurs Pandora par section
   ===================================================== */

.block-cyan {
  border-color: rgba(0, 229, 204, 0.18);
}
.block-violet {
  border-color: rgba(123, 79, 232, 0.22);
}
.block-vert {
  border-color: rgba(0, 210, 120, 0.18);
}
.block-ambre {
  border-color: rgba(255, 180, 60, 0.18);
}
.block-rose {
  border-color: rgba(255, 90, 120, 0.18);
}

.block-cyan::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 0%, rgba(0, 229, 204, 0.06) 0%, transparent 70%);
  pointer-events: none;
}
.block-violet::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 0%, rgba(123, 79, 232, 0.08) 0%, transparent 70%);
  pointer-events: none;
}
.block-vert::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 0%, rgba(0, 210, 120, 0.07) 0%, transparent 70%);
  pointer-events: none;
}
.block-ambre::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 180, 60, 0.07) 0%, transparent 70%);
  pointer-events: none;
}
.block-rose::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 90, 120, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

/* Jour — blocs légèrement plus foncés */
body.mode-jour .block-cyan {
  border-color: rgba(0, 140, 140, 0.2);
}
body.mode-jour .block-violet {
  border-color: rgba(91, 63, 216, 0.22);
}
body.mode-jour .block-vert {
  border-color: rgba(0, 150, 100, 0.2);
}
body.mode-jour .block-ambre {
  border-color: rgba(190, 130, 0, 0.2);
}
body.mode-jour .block-rose {
  border-color: rgba(200, 40, 80, 0.2);
}
/* ═══════════════════════════════════════════════════════════════
   COMPACITÉ — "pas trop de scroll"
   Réduction des marges internes de sections sans toucher le design
   ═══════════════════════════════════════════════════════════════ */

/* Titres de section — espacements resserrés */
.section h1,
.section h2 {
  margin-bottom: var(--space-2);
}
.section p.label {
  margin-bottom: var(--space-2);
}
/* Lead text sous les titres */
.section > .container > p:first-of-type,
.section [class*='lead'],
.section .hero-subtitle {
  margin-bottom: var(--space-4);
}

/* Grid gap réduit */
.section .grid {
  gap: var(--space-3);
}
@media (min-width: 768px) {
  .section .grid {
    gap: var(--space-4);
  }
}

/* Hero pages intérieures — padding vertical compact */
.pinapp-hero-viewport h1,
.pinapp-hero-viewport h2 {
  margin-bottom: var(--space-3);
}
.pinapp-hero-viewport p {
  margin-bottom: var(--space-3);
}

/* Footer compact */
@media (max-width: 767px) {
  .site-footer {
    padding: var(--space-5) 0 var(--space-4);
  }
}
