/* ==========================================================================
   JPO ESTM — Feuille de style (mobile-first)
   1. Variables  2. Base  3. En-tête  4. Accueil  5. Stands  7. Pied de page  8. Fiche  9. Animations  10. Tablette / ordinateur
   ========================================================================== */

/* 1. Variables — charte graphique ESTM */
:root {
  --navy: #103477;
  --green: #079957;
  --blue: #087DC4;
  --white: #fff;
  --sky: #EEF5FC;
  --yellow: #F2C629;

  --font-title: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-card: 22px;
  --radius-banner: 18px;
  --shadow-card: 0 10px 26px rgba(16, 52, 119, .18);
  --shadow-soft: 0 6px 20px rgba(16, 52, 119, .10);

  --gutter: clamp(16px, 4.5vw, 32px);
  --header-h: 72px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* 2. Base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--white); color: var(--navy);
  font-family: var(--font-text); font-size: 16px; line-height: 1.5; font-weight: 400;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2 { font-family: var(--font-title); margin: 0; line-height: 1.08; }
p { margin: 0; }

.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico--sm { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }
.bar { display: block; width: 38px; height: 4px; border-radius: 4px; }
.bar--green { background: var(--green); }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 10px; font-weight: 600; transition: top .2s; }
.skip:focus { top: 12px; }

/* 3. En-tête */
.header { position: fixed; inset: 0 0 auto 0; z-index: 50; transition: background .3s, box-shadow .3s; padding-top: env(safe-area-inset-top, 0px); }
.header.is-scrolled { background: rgba(255,255,255,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 2px 18px rgba(16,52,119,.10); }
.header__inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); padding: 0 var(--gutter); max-width: 1240px; margin: 0 auto; }
.header__logo img { width: 104px; height: auto; }

.burger { width: 44px; height: 44px; display: grid; place-items: center; background: transparent; border: 0; border-radius: 12px; }
.burger__bars { position: relative; width: 24px; height: 18px; }
.burger__bars i { position: absolute; left: 0; width: 100%; height: 2.5px; border-radius: 2px; background: var(--navy); transition: transform .3s var(--ease), opacity .2s, top .3s var(--ease); }
.burger__bars i:nth-child(1) { top: 0; }
.burger__bars i:nth-child(2) { top: 7.5px; }
.burger__bars i:nth-child(3) { top: 15px; }
.burger[aria-expanded="true"] i:nth-child(1) { top: 7.5px; transform: rotate(45deg); }
.burger[aria-expanded="true"] i:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] i:nth-child(3) { top: 7.5px; transform: rotate(-45deg); }

.menu { position: absolute; top: calc(var(--header-h) - 8px + env(safe-area-inset-top, 0px)); right: var(--gutter); width: min(300px, calc(100vw - 2 * var(--gutter))); background: var(--white); border-radius: 18px; padding: 8px; box-shadow: 0 16px 40px rgba(16,52,119,.22); border: 1px solid #E1ECF7; display: flex; flex-direction: column; opacity: 0; transform: translateY(-8px) scale(.98); transform-origin: top right; transition: opacity .25s var(--ease), transform .25s var(--ease); }
.menu[hidden] { display: none; }
.menu.is-open { opacity: 1; transform: none; }
.menu a { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; font-weight: 600; font-size: 16px; transition: background .2s; }
.menu a .ico { color: var(--green); }
.menu a:hover { background: var(--sky); }

/* 4. Accueil */
.hero { position: relative; min-height: clamp(470px, 122vw, 600px); overflow: hidden; background: var(--white); }
.hero__photo { position: absolute; inset: 0; }
.hero__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 72% 30%; }
.hero__photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #fff 0%, rgba(255,255,255,.94) 34%, rgba(255,255,255,.55) 56%, rgba(255,255,255,0) 82%), linear-gradient(180deg, rgba(255,255,255,.8) 0%, rgba(255,255,255,0) 22%); }
.hero__wave { position: absolute; left: 0; bottom: -1px; width: 100%; height: 15%; min-height: 54px; }
.hero__content { position: relative; z-index: 2; padding: calc(var(--header-h) + 54px) var(--gutter) 0; max-width: 1240px; margin: 0 auto; }
.hero__label { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--navy); opacity: .85; }
.hero__label .bar { width: 22px; height: 3px; }
.hero__title { margin-top: 16px; font-size: clamp(38px, 11.6vw, 46px); font-weight: 800; color: var(--navy); letter-spacing: -.025em; }
.hero__title span { display: block; color: var(--green); }
.hero__text { margin-top: 20px; font-size: 16px; font-weight: 500; line-height: 1.55; max-width: 22ch; }
.scroll-hint { display: inline-flex; align-items: center; gap: 12px; margin-top: clamp(36px, 12vw, 64px); font-size: 10px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; line-height: 1.5; }
.scroll-hint svg { width: 18px; height: 27px; }

/* 5. Stands */
.stands { max-width: 1240px; margin: 0 auto; padding: 12px var(--gutter) 8px; }
.stands__head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.stands__head .bar { margin-bottom: 10px; }
.stands__head h2 { font-size: clamp(30px, 8.4vw, 36px); font-weight: 800; letter-spacing: -.02em; }
.dots { display: flex; gap: 8px; padding-bottom: 10px; }
.dots i { width: 8px; height: 8px; border-radius: 8px; background: #C9D9EC; transition: width .3s var(--ease), background .3s; }
.dots i.is-active { width: 24px; background: var(--green); }

.stands__grid > li { display: flex; min-width: 0; }
.stands__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 3.5vw, 18px); }
.stand { --accent: var(--green); position: relative; display: flex; flex-direction: column; justify-content: flex-end; width: 100%; aspect-ratio: 1 / 1.03; padding: 0; border: 0; border-radius: var(--radius-card); overflow: hidden; overflow: clip; text-align: left; color: #fff; background: var(--navy); box-shadow: 0 1px 2px rgba(16,52,119,.14), 0 14px 28px -10px rgba(16,52,119,.38); isolation: isolate; transition: transform .35s var(--ease), box-shadow .35s var(--ease); -webkit-tap-highlight-color: transparent; }
.stand::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); pointer-events: none; }
.stand__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.stand::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10,36,84,0) 25%, rgba(10,36,84,.55) 58%, rgba(8,28,70,.92) 100%); }
.stand__body { position: relative; display: block; padding: 14px 54px 14px 14px; }
.stand__icon { width: 30px; height: 30px; margin-bottom: 8px; color: #fff; stroke-width: 1.5; }
.stand__logo { width: 40px; height: 40px; object-fit: contain; border-radius: 50%; }
.stand__badge { position: absolute; z-index: 1; top: 12px; right: 12px; padding: 5px 10px; border-radius: 999px; background: rgba(8,28,70,.38); border: 1px solid rgba(255,255,255,.28); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .01em; line-height: 1.2; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.stand__badge--soon { background: rgba(255,255,255,.94); border-color: transparent; color: var(--navy); }
.stand__line { display: block; width: 28px; height: 3px; border-radius: 3px; background: var(--accent); margin-bottom: 8px; }
.stand__name { display: block; font-family: var(--font-title); font-weight: 700; font-size: clamp(16px, 4.8vw, 21px); line-height: 1.15; letter-spacing: -.01em; text-wrap: balance; }
.stand__desc { display: block; margin-top: 4px; font-size: clamp(12px, 3.4vw, 14px); font-weight: 400; line-height: 1.35; color: rgba(255,255,255,.88); text-wrap: pretty; }
.stand__go { position: absolute; right: 12px; bottom: 12px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--accent); background: rgba(8,28,70,.32); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); color: #fff; transition: transform .3s var(--ease), background .3s; }
.stand__go .ico { width: 18px; height: 18px; }
.stand:active { transform: scale(.98); }
.stand:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* 7. Pied de page */
.footer { padding: 26px var(--gutter) calc(26px + env(safe-area-inset-bottom, 0px)); text-align: center; }
.footer__brand { display: flex; align-items: center; justify-content: center; gap: 14px; font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; }
.footer__brand::before, .footer__brand::after { content: ""; width: 34px; height: 1px; background: var(--blue); opacity: .6; }
.footer__tag { margin-top: 8px; font-size: 9.5px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase; color: var(--navy); opacity: .85; }
.footer__tag i { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--c); margin: 0 8px; vertical-align: middle; }

/* 8. Fiche / choix de destination (feuille basse sur mobile) */
.sheet { border: 0; padding: 0; background: transparent; width: 100%; max-width: 520px; margin: auto auto 0; max-height: 92dvh; overflow: visible; }
.sheet::backdrop { background: rgba(8,28,70,.55); backdrop-filter: blur(3px); }
.sheet[open]::backdrop { animation: fade .25s var(--ease); }
.sheet[open] .sheet__panel { animation: sheet-in .35s var(--ease); }
.sheet__panel { --accent: var(--green); position: relative; background: #fff; border-radius: 26px 26px 0 0; padding: 30px 24px calc(26px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -12px 40px rgba(16,52,119,.25); border-top: 5px solid var(--accent); }
.sheet__close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--sky); }
.sheet__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--navy); color: #fff; margin-bottom: 14px; box-shadow: inset 0 -3px 0 var(--accent); }
.sheet__icon img { width: 38px; height: 38px; object-fit: contain; border-radius: 50%; }
.sheet__title { font-size: 26px; font-weight: 800; }
.sheet__desc { margin-top: 6px; font-weight: 500; font-size: 16px; }
.sheet__details { margin-top: 12px; font-size: 14px; color: #3B5688; }
.sheet__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 15px; background: var(--navy); color: #fff; transition: transform .2s var(--ease), background .2s; }
.btn--ghost { background: var(--sky); color: var(--navy); }
.btn:hover { transform: translateY(-1px); }
.btn .ico { width: 20px; height: 20px; }
.sheet__note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--sky); font-size: 14px; font-weight: 500; }
.sheet__note .ico { flex: none; color: var(--blue); }

/* 9. Animations discrètes */
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes page-in { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }
.js.is-ready .hero__content { animation: page-in .6s var(--ease) both; }
.js.is-loading .hero__content { opacity: 0; }
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s var(--ease), transform .55s var(--ease); transition-delay: calc(var(--i, 0) * 80ms); }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (hover: hover) and (pointer: fine) {
  .stand:hover { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(16,52,119,.26); }
  .stand:hover .stand__img { transform: scale(1.03); }
  .stand:hover .stand__go { transform: translateX(3px); background: rgba(8,28,70,.6); }
  }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* 10. Tablette et ordinateur */
@media (min-width: 600px) {
  .sheet { margin: auto; }
  .sheet__panel { border-radius: 26px; padding-bottom: 28px; }
  .hero__text { font-size: 18px; }
}
@media (min-width: 768px) {
  :root { --header-h: 84px; }
  .header__logo img { width: 128px; }
  .hero { min-height: 560px; }
  .hero__photo img { object-position: 60% 35%; }
  .hero__photo::after { background: linear-gradient(90deg, #fff 0%, rgba(255,255,255,.94) 26%, rgba(255,255,255,0) 62%), linear-gradient(180deg, rgba(255,255,255,.7) 0%, rgba(255,255,255,0) 18%); }
  .hero__title { font-size: clamp(48px, 7vw, 64px); }
  .hero__label { font-size: 12px; }
  .stands__grid { gap: 20px; }
  .stand__body { padding: 18px 64px 18px 18px; }
  .stand__name { font-size: 24px; }
  .stand__desc { font-size: 15px; }
  .stand__go { width: 44px; height: 44px; right: 16px; bottom: 16px; }
}
@media (min-width: 1000px) {
  .hero { min-height: 640px; }
  .stands { padding-top: 28px; }
  .stands__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; }
  .stand { aspect-ratio: 4 / 5; }
  .stand__name { font-size: 22px; }
  .stand__desc { font-size: 14px; }
}

/* 11. Écran de chargement */
html.is-loading { overflow: hidden; }
.loader { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: #fff; opacity: 1; visibility: visible; transition: opacity .5s var(--ease), visibility 0s linear .5s; animation: loader-failsafe .4s ease 5s forwards; }
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__inner { display: flex; flex-direction: column; align-items: center; gap: 26px; padding: 24px; }
.loader__logo { width: min(58vw, 240px); height: auto; overflow: visible; animation: logo-float 2.4s ease-in-out 1.3s infinite; }
.loader__ring { stroke-dasharray: 100; stroke-dashoffset: 100; animation: ring-draw 1.1s var(--ease) .15s forwards; }
.loader__text { opacity: 0; transform-box: fill-box; transform-origin: center; animation: text-in .7s var(--ease) .65s forwards; }
.loader__bar { position: relative; width: min(34vw, 120px); height: 3px; border-radius: 3px; background: #E1ECF7; overflow: hidden; opacity: 0; animation: fade .4s ease 1s forwards; }
.loader__bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 40%; border-radius: 3px; background: var(--green); animation: bar-run 1.2s ease-in-out infinite; }
@keyframes ring-draw { to { stroke-dashoffset: 0; } }
@keyframes text-in { from { opacity: 0; transform: translateY(10px) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes logo-float { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes bar-run { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@keyframes loader-failsafe { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  .loader__ring { stroke-dashoffset: 0; }
  .loader__text, .loader__bar { opacity: 1; }
  .loader__bar::after { width: 100%; }
}
