/* =====================================================================
   AG CINEMA — couche cinematographique experimentale (CSS)
   Curseur custom, particules hero, etats de revelation.
   Tout est gate : desactive sur tactile + prefers-reduced-motion.
   ===================================================================== */

/* ── Curseur custom ─────────────────────────────────────────────── */
@media (hover: hover) and (pointer: fine) {
	html.ag-cine-has-cursor,
	html.ag-cine-has-cursor body { cursor: none; }
	html.ag-cine-has-cursor a,
	html.ag-cine-has-cursor button,
	html.ag-cine-has-cursor input,
	html.ag-cine-has-cursor textarea,
	html.ag-cine-has-cursor select,
	html.ag-cine-has-cursor [role="button"] { cursor: none; }
}
.ag-cine-cursor {
	position: fixed; top: 0; left: 0;
	width: 38px; height: 38px;
	margin: -19px 0 0 -19px;
	border: 1.5px solid rgba(212,180,92,.7);
	border-radius: 50%;
	pointer-events: none;
	z-index: 2147483646;
	transition: width .28s cubic-bezier(.16,1,.3,1), height .28s cubic-bezier(.16,1,.3,1),
		margin .28s cubic-bezier(.16,1,.3,1), background .28s ease, border-color .28s ease;
	will-change: transform;
}
.ag-cine-cursor-dot {
	position: fixed; top: 0; left: 0;
	width: 6px; height: 6px;
	margin: -3px 0 0 -3px;
	background: #F37A1F;
	border-radius: 50%;
	pointer-events: none;
	z-index: 2147483647;
	box-shadow: 0 0 10px rgba(243,122,31,.7);
	will-change: transform;
}
.ag-cine-cursor.is-hover {
	width: 64px; height: 64px;
	margin: -32px 0 0 -32px;
	background: rgba(212,180,92,.10);
	border-color: rgba(212,180,92,.9);
}
.ag-cine-cursor.is-down { width: 28px; height: 28px; margin: -14px 0 0 -14px; }

/* ── Particules hero ────────────────────────────────────────────── */
.ag-cine-particles {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
}
.ag-hero__content { position: relative; z-index: 2; }

/* Les couches parallaxe du hero : transition douce au reset souris */
.ag-hero__orb--1, .ag-hero__orb--2, .ag-hero__circles {
	will-change: transform;
}

/* ── Garde-fous ─────────────────────────────────────────────────── */
@media (hover: none), (pointer: coarse) {
	.ag-cine-cursor, .ag-cine-cursor-dot { display: none !important; }
	html.ag-cine-has-cursor, html.ag-cine-has-cursor body,
	html.ag-cine-has-cursor * { cursor: auto !important; }
}
@media (prefers-reduced-motion: reduce) {
	.ag-cine-cursor, .ag-cine-cursor-dot, .ag-cine-particles { display: none !important; }
	html.ag-cine-has-cursor, html.ag-cine-has-cursor body { cursor: auto !important; }
}

/* =====================================================================
   STAGE CINEMATOGRAPHIQUE (pin + fondu) — chapitres qui se fondent sur
   place + numero geant en filigrane. Fallback empile si JS/pin absent.
   ===================================================================== */
.ag-cine-stage { position: relative; background: #0c0c0e; }
.ag-cine-stage__pin { position: relative; }
.ag-cine-stage__inner { position: relative; z-index: 2; }
.ag-cine-stage__ghosts { display: none; }
.ag-cine-stage__step {
	display: block; color: var(--color-gold); font-weight: 700;
	font-size: .82rem; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 16px;
}
.ag-cine-stage__chapter h3 {
	font-family: var(--font-serif); color: #fff; line-height: 1.05;
	font-size: clamp(1.9rem, 4.6vw, 3.4rem); margin: 0 0 18px;
}
.ag-cine-stage__chapter p {
	color: var(--color-text-secondary); line-height: 1.7;
	font-size: clamp(1rem, 1.5vw, 1.22rem); max-width: 46ch; margin: 0;
}
.ag-cine-stage__dots { display: none; }

/* Fallback (pas de JS / mobile / reduced) : chapitres empiles, espaces */
.ag-cine-stage:not(.is-cinematic) .ag-cine-stage__pin { padding: 90px 0; }
.ag-cine-stage:not(.is-cinematic) .ag-cine-stage__chapter { padding: 34px 0; border-top: 1px solid rgba(255,255,255,.07); }
.ag-cine-stage:not(.is-cinematic) .ag-cine-stage__chapter:first-child { border-top: 0; }

/* Mode cinematique (JS desktop) : plein ecran epingle, fondu enchaine */
.ag-cine-stage.is-cinematic .ag-cine-stage__pin {
	height: 100vh; overflow: hidden; display: flex; align-items: center;
}
.ag-cine-stage.is-cinematic .ag-cine-stage__ghosts { display: block; position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.ag-cine-stage.is-cinematic .ag-cine-stage__ghost {
	position: absolute; top: 50%; right: 2vw; transform: translateY(-50%) scale(.92);
	font-family: var(--font-serif); font-weight: 800; line-height: .8;
	font-size: 64vh;
	background: linear-gradient(135deg, rgba(212,180,92,.32), rgba(243,122,31,.16));
	-webkit-background-clip: text; background-clip: text;
	-webkit-text-fill-color: transparent; color: transparent;
	opacity: 0; transition: opacity .8s cubic-bezier(.16,1,.3,1), transform .8s cubic-bezier(.16,1,.3,1);
}
.ag-cine-stage.is-cinematic .ag-cine-stage__ghost.is-active { opacity: 1; transform: translateY(-50%) scale(1); }
.ag-cine-stage.is-cinematic .ag-cine-stage__chapters { position: relative; min-height: 46vh; }
.ag-cine-stage.is-cinematic .ag-cine-stage__chapter {
	position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
	opacity: 0; transform: translateY(38px); pointer-events: none;
	transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
}
.ag-cine-stage.is-cinematic .ag-cine-stage__chapter.is-active { opacity: 1; transform: none; pointer-events: auto; }
.ag-cine-stage.is-cinematic .ag-cine-stage__dots { display: flex; gap: 12px; margin-top: 44px; }
.ag-cine-stage.is-cinematic .ag-cine-stage__dots span { width: 34px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.16); transition: background .4s ease; }
.ag-cine-stage.is-cinematic .ag-cine-stage__dots span.is-active { background: linear-gradient(90deg, #D4B45C, #F37A1F); }

/* Intro persistante (titre "On ne te vend rien") */
.ag-cine-stage__intro { position: relative; z-index: 2; margin-bottom: 30px; }
.ag-cine-stage__lead { font-family: var(--font-serif); color: #fff; line-height: 1.1; font-size: clamp(1.5rem, 3.2vw, 2.4rem); margin: 14px 0 0; }
.ag-cine-stage__lead em { color: var(--color-gold); font-style: italic; }

/* Fond image (Naples) — visible seulement en mode cinematique */
.ag-cine-stage__bg { display: none; }
.ag-cine-stage.is-cinematic .ag-cine-stage__bg { display: block; position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.ag-cine-stage.is-cinematic .ag-cine-stage__bgimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); transform-origin: 60% 50%; will-change: transform; }
.ag-cine-stage.is-cinematic .ag-cine-stage__veil {
	position: absolute; inset: 0;
	background:
		radial-gradient(ellipse at 28% 50%, rgba(0,0,0,.4), transparent 62%),
		linear-gradient(90deg, rgba(8,8,10,.94) 0%, rgba(8,8,10,.75) 42%, rgba(8,8,10,.42) 100%);
}
.ag-cine-stage.is-cinematic .ag-cine-stage__inner { position: relative; z-index: 2; }
/* Fallback : sur fond image non-cinematique, on garde le fond sombre du theme */
.ag-cine-stage--bg:not(.is-cinematic) { background: #0c0c0e; }

/* =====================================================================
   CINESCENE — UN SEUL pin : fond image FIXE + slides en fondu enchaine
   (origine -> principe -> etapes 1-4). Fallback empile si pas de pin.
   ===================================================================== */
.ag-cinescene { position: relative; background: #0a0a0c; }
.ag-cinescene.is-cinematic { z-index: 1; } /* reste derriere la section qui remonte */
.ag-cinescene__stage { position: relative; }

/* === EMPILEMENT (stacking) : chaque section reste collee en haut pendant
   que la suivante remonte et la recouvre. Sections opaques + z-index
   croissant (defini inline dans le template) + coin haut arrondi + ombre. === */
.ag-stackover {
	position: sticky; top: 0; min-height: 100vh;
	display: flex; flex-direction: column; justify-content: center;
	border-radius: 28px 28px 0 0; box-shadow: 0 -34px 70px rgba(0,0,0,.5);
}
/* Derniere section (un footer suit) : remonte mais ne se fige pas */
.ag-stackover--flat { position: relative; top: auto; min-height: 0; }
/* Sections a pin manuel (cinescene / hscroll) : meme look de "carte qui remonte" */
.ag-cinescene.is-cinematic .ag-cinescene__stage,
.ag-hscroll.is-cinematic .ag-hscroll__pin { border-radius: 28px 28px 0 0; box-shadow: 0 -34px 70px rgba(0,0,0,.5); }

/* === Empilement AUTOMATIQUE (tout le site) : applique par JS aux sections
   de contenu. Fond rendu opaque (anti-transparence), coin haut arrondi +
   ombre = "carte qui remonte". Le sticky (--hold) n'est mis que sur les
   sections assez hautes pour ne pas creer de vide sur les pages courtes. === */
.ag-autostack {
	position: relative;
	background-color: var(--color-bg, #0a0a0c);
	border-radius: 28px 28px 0 0;
	box-shadow: 0 -34px 70px rgba(0,0,0,.5);
}
.ag-autostack--hold { position: sticky; top: 0; }

.ag-cinescene__bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.ag-cinescene__bgimg { width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; transform: scale(1.06); transform-origin: 60% 50%; will-change: transform; }
.ag-cinescene__veil {
	position: absolute; inset: 0;
	background:
		radial-gradient(ellipse at 30% 45%, rgba(0,0,0,.35), transparent 62%),
		linear-gradient(90deg, rgba(8,8,10,.92) 0%, rgba(8,8,10,.7) 46%, rgba(8,8,10,.4) 100%);
}
.ag-cinescene__inner { position: relative; z-index: 2; }
.ag-cinescene__title { font-family: var(--font-serif); color: #fff; line-height: 1.05; font-size: clamp(1.7rem, 3.6vw, 2.8rem); margin: 12px 0 16px; }
.ag-cinescene__title em { color: var(--color-gold); font-style: italic; }
.ag-cinescene__lead { color: rgba(255,255,255,.84); font-size: clamp(.98rem, 1.25vw, 1.08rem); line-height: 1.6; max-width: 48ch; margin: 0 0 13px; }
.ag-cinescene__slide .ag-btn-outline { margin-top: 8px; }
.ag-cinescene__step-label { display: block; color: var(--color-gold); font-weight: 700; font-size: .8rem; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 12px; }
.ag-cinescene__slide h3 { font-family: var(--font-serif); color: #fff; line-height: 1.08; font-size: clamp(1.7rem, 3.8vw, 2.9rem); margin: 0 0 14px; }
.ag-cinescene__slide--step p { color: rgba(255,255,255,.82); font-size: clamp(1rem, 1.35vw, 1.15rem); line-height: 1.65; max-width: 46ch; margin: 0; }
.ag-cinescene__ghosts { display: none; }
.ag-cinescene__dots { display: none; }

/* Fallback (pas de JS / mobile / reduced) : slides empiles, fond en backdrop */
.ag-cinescene:not(.is-cinematic) .ag-cinescene__slide { padding: 56px 0; border-top: 1px solid rgba(255,255,255,.08); }
.ag-cinescene:not(.is-cinematic) .ag-cinescene__slide:first-child { border-top: 0; }

/* Mode cinematique (JS desktop) : epinglage manuel (absolute -> fixed ->
   absolute bas) pilote par le scroll. Aucun spacer GSAP = aucun saut. */
.ag-cinescene.is-cinematic .ag-cinescene__stage {
	position: absolute; top: 0; left: 0; width: 100%; height: 100vh;
	overflow: hidden; display: flex; align-items: center;
}
.ag-cinescene.is-cinematic.is-fixed .ag-cinescene__stage { position: fixed; top: 0; }
.ag-cinescene.is-cinematic.is-after .ag-cinescene__stage { position: absolute; top: auto; bottom: 0; }
.ag-cinescene.is-cinematic .ag-cinescene__ghosts { display: block; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.ag-cinescene.is-cinematic .ag-cinescene__ghost {
	position: absolute; top: 50%; right: 2vw; transform: translateY(-50%) scale(.92);
	font-family: var(--font-serif); font-weight: 800; line-height: .8; font-size: 58vh;
	background: linear-gradient(135deg, rgba(212,180,92,.32), rgba(243,122,31,.16));
	-webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
	opacity: 0; transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
}
.ag-cinescene.is-cinematic .ag-cinescene__ghost.is-active { opacity: 1; transform: translateY(-50%) scale(1); }
.ag-cinescene.is-cinematic .ag-cinescene__slides { position: relative; min-height: 54vh; }
.ag-cinescene.is-cinematic .ag-cinescene__slide {
	position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
	opacity: 0; transform: translateY(38px); pointer-events: none;
	transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1);
}
.ag-cinescene.is-cinematic .ag-cinescene__slide.is-active { opacity: 1; transform: none; pointer-events: auto; }
.ag-cinescene.is-cinematic .ag-cinescene__dots { display: flex; gap: 10px; position: absolute; left: 0; right: 0; bottom: 5vh; justify-content: center; z-index: 3; }
.ag-cinescene.is-cinematic .ag-cinescene__dots span { width: 30px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.16); transition: background .4s ease; }
.ag-cinescene.is-cinematic .ag-cinescene__dots span.is-active { background: linear-gradient(90deg, #D4B45C, #F37A1F); }

@media (max-width: 1024px) {
	.ag-cinescene__lead, .ag-cinescene__slide--step p { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
	.ag-cinescene__slide { opacity: 1 !important; transform: none !important; }
}

/* =====================================================================
   SCROLL HORIZONTAL — epinglage MANUEL (pas de pin GSAP) : le stage passe
   en fixed pendant la traversee, la piste glisse selon la progression.
   ===================================================================== */
.ag-hscroll { position: relative; padding: 0; }
.ag-hscroll__pin { position: relative; overflow: hidden; }
.ag-hscroll__track { display: flex; gap: 30px; padding: 50px 6vw; }
.ag-hscroll.is-cinematic .ag-hscroll__pin { position: absolute; top: 0; left: 0; width: 100%; height: 100vh; display: flex; align-items: center; overflow: hidden; }
.ag-hscroll.is-cinematic.is-fixed .ag-hscroll__pin { position: fixed; top: 0; }
.ag-hscroll.is-cinematic.is-after .ag-hscroll__pin { position: absolute; top: auto; bottom: 0; }
.ag-hscroll.is-cinematic .ag-hscroll__track { padding: 0 7vw; will-change: transform; }
.ag-hscroll__head { flex: 0 0 auto; width: min(420px, 78vw); align-self: center; }
.ag-hscroll__title { font-family: var(--font-serif); font-size: clamp(1.8rem, 3.5vw, 2.8rem); color: #fff; margin: 14px 0 16px; line-height: 1.1; }
.ag-hscroll__title em { color: var(--color-gold); font-style: italic; }
.ag-hscroll__lead { color: var(--color-text-secondary); font-size: 1.05rem; line-height: 1.6; }
.ag-hscroll__lead span { display: inline-block; margin-top: 8px; color: var(--color-gold); font-weight: 700; }
.ag-hscroll__card {
	flex: 0 0 auto; width: 340px; min-height: 60vh;
	display: flex; flex-direction: column; justify-content: flex-end;
	padding: 36px 32px;
	background: rgba(255,255,255,.03);
	border: 1px solid rgba(212,180,92,.18); border-radius: 22px;
	transition: border-color .4s ease, transform .4s ease, box-shadow .4s ease;
}
.ag-hscroll__card:hover { border-color: rgba(212,180,92,.45); transform: translateY(-6px); box-shadow: 0 30px 70px rgba(0,0,0,.45); }
.ag-hscroll__ic { font-size: 2.6rem; margin-bottom: auto; }
.ag-hscroll__card h3 { font-family: var(--font-serif); font-size: 1.5rem; color: #fff; margin: 24px 0 12px; }
.ag-hscroll__card p { color: var(--color-text-secondary); font-size: .98rem; line-height: 1.6; margin: 0; }
.ag-hscroll__card--cta { background: linear-gradient(160deg, rgba(212,180,92,.14), rgba(243,122,31,.06)); border-color: rgba(212,180,92,.4); }
.ag-hscroll__card--cta .ag-btn-gold { margin-top: 20px; }

/* Fallback (pas de JS / mobile) : scroll horizontal natif avec snap */
.ag-hscroll:not(.is-cinematic) .ag-hscroll__track { overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.ag-hscroll:not(.is-cinematic) .ag-hscroll__card { scroll-snap-align: center; }
@media (max-width: 1024px) {
	.ag-hscroll__head { width: 80vw; }
	.ag-hscroll__card { width: 76vw; min-height: 0; }
}
/* =====================================================================
   ZOOM COVER — fond image qui se rapproche au scroll (on "avance" dedans)
   ===================================================================== */
.ag-zoomcover { position: relative; height: 100vh; overflow: hidden; background: #0a0a0c; }
.ag-zoomcover__media { position: absolute; inset: 0; z-index: 0; }
.ag-zoomcover__img {
	position: absolute; inset: 0; width: 100%; height: 100%;
	object-fit: cover; transform: scale(1.08); transform-origin: 50% 50%;
	will-change: transform;
}
.ag-zoomcover__veil {
	position: absolute; inset: 0;
	background:
		radial-gradient(ellipse at 30% 50%, rgba(0,0,0,.35), transparent 60%),
		linear-gradient(90deg, rgba(8,8,10,.92) 0%, rgba(8,8,10,.72) 40%, rgba(8,8,10,.35) 100%);
}
.ag-zoomcover__content {
	position: relative; z-index: 2; height: 100%;
	max-width: var(--container-w, 1200px); margin: 0 auto; padding: 0 clamp(20px, 5vw, 64px);
	display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
	max-width: 1200px;
}
.ag-zoomcover__title {
	font-family: var(--font-serif); color: #fff; line-height: 1.04;
	font-size: clamp(2.2rem, 6vw, 4.4rem); margin: 16px 0 22px; max-width: 16ch;
}
.ag-zoomcover__title em { color: var(--color-gold); font-style: italic; }
.ag-zoomcover__text { color: rgba(255,255,255,.82); font-size: clamp(1rem, 1.5vw, 1.2rem); line-height: 1.7; max-width: 46ch; margin: 0 0 18px; }
.ag-zoomcover__content .ag-btn-outline { margin-top: 14px; }

@media (max-width: 1024px) {
	.ag-zoomcover { height: auto; min-height: 86vh; }
	.ag-zoomcover__content { padding-top: 90px; padding-bottom: 90px; }
}

/* =====================================================================
   3D sur les cartes du scroll horizontal (items qui se placent en 3D)
   ===================================================================== */
.ag-hscroll.is-3d .ag-hscroll__card { will-change: transform; backface-visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
	.ag-hscroll__track { transform: none !important; }
	.ag-cine-stage__chapter { opacity: 1 !important; transform: none !important; }
	.ag-zoomcover__img { transform: scale(1.02) !important; }
}
