/* North Photography : ouverture du Store.
   Environ 22 s, fond noir, poudre d'or, bouton PASSER.
   Autonome : ce fichier + store-intro.js + dossier assets/. */

.npi {
  --ink: #000;
  --paper: #f4efe4;
  --gold: #e3c27a;
  --gold-soft: rgba(227, 194, 122, .6);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --lux: cubic-bezier(.16, 1, .3, 1);
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  font-family: "Schibsted Grotesk", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  clip-path: inset(0 0 0 0);
  user-select: none;
}
.npi *, .npi *::before, .npi *::after { box-sizing: border-box; }

/* ---------- couches ---------- */
.npi-stage { position: absolute; inset: 0; transition: opacity .6s var(--ease), filter .6s var(--ease), transform .8s var(--ease); }
.npi-gold-dust {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
  mix-blend-mode: screen; z-index: 2;
}
.npi-vignette {
  position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(ellipse 78% 72% at 50% 48%, transparent 42%, rgba(0, 0, 0, .82) 100%);
}
.npi-grain {
  position: absolute; inset: -60px; pointer-events: none; opacity: .05; z-index: 3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: npi-grain .9s steps(5) infinite;
}
@keyframes npi-grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-22px, 14px); }
  40% { transform: translate(18px, -26px); } 60% { transform: translate(-12px, -8px); }
  80% { transform: translate(26px, 20px); } 100% { transform: translate(0, 0); }
}

/* ---------- scènes ---------- */
.npi-scene {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .9s var(--ease), filter .9s var(--ease), transform 1.4s var(--lux), visibility 0s linear 1.4s;
}
.npi-scene[data-state="in"] { opacity: 1; visibility: visible; transition-delay: 0s; }
.npi-scene[data-state="out"] {
  opacity: 0; visibility: hidden; filter: blur(12px); transform: scale(1.04);
  transition: opacity .6s var(--ease), filter .6s var(--ease), transform .8s var(--ease), visibility 0s linear .8s;
}

/* texte qui monte derrière une fente */
.npi-mask { display: block; overflow: hidden; padding: .06em 0 .12em; }
.npi-rise { display: block; transform: translateY(112%); transition: transform 1.1s var(--lux) var(--d, 0s); }
[data-state="in"] > .npi-rise, [data-state="in"] .npi-rise { transform: none; }

/* métaux : le logo sert de pochoir à un dégradé qui balaie */
.npi-metal {
  background-size: 300% 100%; background-position: 100% 0;
  -webkit-mask: var(--m) center / contain no-repeat;
  mask: var(--m) center / contain no-repeat;
  opacity: 0; transition: opacity 1.1s var(--ease);
}
.npi-metal.is-solid { opacity: 1; animation: npi-sheen 3s var(--ease) both; }
.npi-metal.is-gone { opacity: 0; transition-duration: .35s; }
.npi-gold {
  background-image: linear-gradient(100deg, #6b4d1c 0%, #b8893b 16%, #f3d98f 32%, #fff8e1 42%, #e8c46a 50%, #a87a2e 62%, #f1d68c 76%, #fff3cf 84%, #7a5822 100%);
}
.npi-silver {
  background-image: linear-gradient(100deg, #8a8a8a 0%, #d4d4d4 26%, #ffffff 38%, #f1e2bf 46%, #ffffff 54%, #c9c9c9 68%, #8a8a8a 100%);
}
@keyframes npi-sheen { from { background-position: 100% 0; } to { background-position: 0% 0; } }

/* halo d'or derrière les logos North */
.npi-aura {
  position: absolute; left: 50%; top: 50%; width: min(120vw, 1200px); aspect-ratio: 2 / 1;
  transform: translate(-50%, -54%) scale(.6); opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(227, 186, 100, .16), rgba(160, 110, 40, .06) 38%, transparent 66%);
  transition: opacity 2.4s var(--ease), transform 4s var(--lux);
}
[data-state="in"] > .npi-aura { opacity: 1; transform: translate(-50%, -54%) scale(1); }

/* ---------- 1. ouverture North ---------- */
.npi-north { width: min(70vw, 540px); aspect-ratio: 2567 / 880; position: relative; }
.npi-line {
  display: block; width: min(56vw, 440px); height: 1px; margin: clamp(18px, 3.4vh, 30px) 0 clamp(14px, 2.4vh, 22px);
  background: linear-gradient(90deg, transparent, var(--gold) 25%, #fff6dc 50%, var(--gold) 75%, transparent);
  box-shadow: 0 0 16px 1px rgba(227, 194, 122, .6);
  transform: scaleX(0); opacity: 0;
  transition: transform 1.4s var(--lux), opacity .5s ease;
}
.npi-open.is-text .npi-line { transform: scaleX(1); opacity: 1; }
.npi-kicker {
  margin: 0; font: 400 11px/1.3 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: .55em; text-transform: uppercase; color: var(--gold); padding-left: .55em;
}
.npi-open .npi-kicker .npi-rise { transform: translateY(112%); }
.npi-open.is-text .npi-kicker .npi-rise { transform: none; transition-delay: .5s; }

/* ---------- 2 et 3. marques ---------- */
.npi-brand {
  justify-content: space-between;
  padding: clamp(34px, 8vh, 86px) 16px clamp(60px, 10vh, 104px);
}
.npi-brandmark { flex: none; position: relative; }
.npi-brandmark--sony { width: clamp(124px, 15vw, 196px); aspect-ratio: 1280 / 225.28; }
.npi-brandmark--bo { width: clamp(210px, 26vw, 340px); aspect-ratio: 170 / 14.7; }

.npi-spot {
  position: absolute; left: 50%; top: -10%; width: min(110vw, 1150px); height: 120%;
  transform: translateX(-50%); pointer-events: none; opacity: 0; z-index: 1; mix-blend-mode: screen;
  background:
    radial-gradient(ellipse 34% 44% at 50% 52%, rgba(255, 236, 196, .11), transparent 70%),
    linear-gradient(180deg, rgba(255, 238, 205, .08), transparent 78%);
  clip-path: polygon(43% 0, 57% 0, 90% 100%, 10% 100%);
  filter: blur(22px);
  transition: opacity 1.8s var(--ease) .2s;
}
.npi-brand[data-state="in"] .npi-spot { opacity: 1; }

/* scène du produit : les deux produits d'une marque se superposent et se relaient */
.npi-items {
  position: relative; flex: 0 1 auto; min-height: 0;
  width: min(94vw, 1040px); height: min(50vh, 540px);
  display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center;
}
.npi-item {
  grid-area: 1 / 1; position: relative; width: 100%; height: 100%; margin: 0;
  opacity: 0; visibility: hidden;
  filter: brightness(0) contrast(1.3) blur(8px); transform: scale(1.1);
  transition: opacity 1.2s var(--ease), filter 2.2s var(--ease), transform 3.6s var(--lux), visibility 0s linear 2.2s;
}
.npi-item[data-state="in"] {
  opacity: 1; visibility: visible; filter: brightness(1) contrast(1.04) blur(0); transform: none;
  transition-delay: 0s;
}
.npi-item[data-state="out"] {
  opacity: 0; visibility: hidden; filter: brightness(1.6) blur(14px); transform: scale(1.06) translateX(3%);
  transition: opacity .6s var(--ease), filter .6s var(--ease), transform .8s var(--ease), visibility 0s linear .8s;
}
.npi-item img {
  display: block; width: 100%; height: 100%; object-fit: contain;
  animation: npi-push 7s linear both;
}
@keyframes npi-push { from { transform: scale(1); } to { transform: scale(1.045); } }
.npi-item--reflect img { -webkit-box-reflect: below -3% linear-gradient(transparent 74%, rgba(255, 255, 255, .14)); }

.npi-halo {
  position: absolute; inset: -14%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 44%, rgba(212, 150, 96, .28), rgba(140, 86, 50, .09) 38%, transparent 64%);
  filter: blur(10px); transition: opacity 2s var(--ease) .3s;
}
.npi-item[data-state="in"] .npi-halo { opacity: 1; }

/* reflet de lumière (overlay : le noir reste noir) */
.npi-sheen {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay; opacity: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 245, 220, .55) 49%, rgba(255, 236, 190, .8) 50%, rgba(255, 245, 220, .55) 51%, transparent 62%);
  background-size: 300% 100%; background-position: 100% 0;
  /* le reflet ne touche que le produit : la photo elle-même lui sert de pochoir */
  -webkit-mask: var(--img) center / contain no-repeat;
  mask: var(--img) center / contain no-repeat;
}
.npi-item[data-state="in"] .npi-sheen { animation: npi-sweep 1.9s var(--ease) 1.2s both; }
@keyframes npi-sweep {
  0% { opacity: 0; background-position: 100% 0; } 15% { opacity: 1; }
  85% { opacity: 1; } 100% { opacity: 0; background-position: 0% 0; }
}

/* reflet anamorphique sur l'objectif */
.npi-flare { position: absolute; left: 53.7%; top: 63.5%; width: 0; height: 0; pointer-events: none; mix-blend-mode: screen; }
.npi-flare::before, .npi-flare::after { content: ""; position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); opacity: 0; }
.npi-flare::before {
  width: min(120vw, 1300px); height: 3px; border-radius: 50%;
  background: linear-gradient(90deg, transparent, rgba(255, 200, 120, .2) 30%, rgba(255, 240, 210, .95) 50%, rgba(255, 200, 120, .2) 70%, transparent);
  filter: blur(1.2px);
}
.npi-flare::after {
  width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 246, 225, .95), rgba(240, 190, 110, .35) 28%, transparent 66%);
}
.npi-item[data-state="in"] .npi-flare::before { animation: npi-flare-line 1.6s var(--ease) 1.5s both; }
.npi-item[data-state="in"] .npi-flare::after { animation: npi-flare-dot 1.6s var(--ease) 1.5s both; }
@keyframes npi-flare-line {
  0% { opacity: 0; transform: translate(-50%, -50%) scaleX(.1); }
  35% { opacity: .9; transform: translate(-50%, -50%) scaleX(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scaleX(1.15); }
}
@keyframes npi-flare-dot {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); }
  35% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.4); }
}

/* légendes : elles se relaient au même endroit */
.npi-caps { flex: none; display: grid; text-align: center; position: relative; z-index: 2; margin-top: clamp(10px, 2.4vh, 24px); }
.npi-cap { grid-area: 1 / 1; }
.npi-cap:not([data-state="in"]) .npi-rise { transform: translateY(112%); }
.npi-cap[data-state="out"] .npi-rise { transform: translateY(-112%); transition-duration: .55s; transition-delay: 0s; }
.npi-eyebrow {
  margin: 0; font: 400 10.5px/1.3 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: .42em; text-transform: uppercase; color: var(--gold); padding-left: .42em;
}
.npi-name {
  margin: .14em 0 .06em; font-family: "Cormorant Garamond", "Times New Roman", serif; font-weight: 300;
  font-size: clamp(34px, 5.2vw, 66px); line-height: 1; letter-spacing: .01em;
}
.npi-desc { margin: 0; font-size: clamp(12.5px, 1.1vw, 14.5px); letter-spacing: .06em; color: rgba(244, 239, 228, .64); }

/* ---------- 4. final ---------- */
.npi-north--fin { width: min(58vw, 420px); }
.npi-store {
  margin: clamp(12px, 2.4vh, 22px) 0 0; font-family: "Cormorant Garamond", "Times New Roman", serif;
  font-weight: 300; font-style: italic; font-size: clamp(56px, 10vw, 132px); line-height: .95; letter-spacing: -.01em;
}
.npi-store .npi-rise {
  background: linear-gradient(100deg, #b8893b 0%, #f3d98f 30%, #fff8e1 42%, #e8c46a 54%, #f6e2a8 70%, #b8893b 100%);
  background-size: 260% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding: 0 .08em;
}
.npi-fin[data-state="in"] .npi-store .npi-rise { animation: npi-sheen 3.4s var(--ease) 1.1s both; }
.npi-duo { display: flex; align-items: center; gap: clamp(16px, 3vw, 34px); margin-top: clamp(16px, 3vh, 28px); }
.npi-duo .npi-brandmark--sony { width: clamp(80px, 9vw, 116px); }
.npi-duo .npi-brandmark--bo { width: clamp(150px, 17vw, 216px); }
.npi-duo i { width: 1px; height: 18px; background: var(--gold-soft); opacity: 0; transition: opacity 1s var(--ease) 1.6s; }
.npi-fin[data-state="in"] .npi-duo i { opacity: 1; }

/* ---------- interface ---------- */
.npi-progress {
  position: absolute; left: 0; bottom: 0; height: 1px; width: 100%; z-index: 4;
  background: linear-gradient(90deg, rgba(227, 194, 122, .1), rgba(227, 194, 122, .85));
  transform-origin: left; transform: scaleX(0);
}
.npi.is-on .npi-progress { animation: npi-progress var(--dur, 20s) linear both; }
@keyframes npi-progress { to { transform: scaleX(1); } }

.npi-ctrl {
  position: absolute; right: max(16px, 2.6vw); bottom: max(16px, 3.2vh); z-index: 5;
  display: flex; align-items: center; gap: 10px;
}
.npi-sound svg { width: 15px; height: 15px; margin: -3px 7px -3px -3px; vertical-align: middle; }
.npi-sound .npi-wave { display: none; }
.npi-sound.is-on .npi-wave { display: inline; }
.npi-sound.is-on .npi-off { display: none; }
.npi-sound.is-on { color: #fff; border-color: rgba(227, 194, 122, .8); }
/* son bloqué par le navigateur : le bouton respire doucement pour inviter au clic */
.npi-sound.is-hint { animation: npi-hint 1.8s ease-in-out 1s infinite; }
@keyframes npi-hint {
  0%, 100% { box-shadow: 0 0 0 0 rgba(227, 194, 122, 0); border-color: rgba(227, 194, 122, .35); }
  50% { box-shadow: 0 0 18px 2px rgba(227, 194, 122, .35); border-color: rgba(227, 194, 122, .95); color: #fff; }
}
.npi-skip, .npi-sound {
  appearance: none; cursor: pointer; background: rgba(0, 0, 0, .35);
  color: rgba(244, 239, 228, .8); border: 1px solid rgba(227, 194, 122, .35); border-radius: 999px;
  padding: 8px 15px 8px 17px; font: 400 10.5px/1 "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: .32em; text-transform: uppercase;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .8s var(--ease) .8s, color .3s, border-color .3s, background .3s;
}
.npi.is-on .npi-skip, .npi.is-on .npi-sound { opacity: 1; }
.npi-skip:hover, .npi-sound:hover { color: #fff; border-color: rgba(227, 194, 122, .95); background: rgba(227, 194, 122, .12); }
.npi-skip:focus-visible, .npi-sound:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }

/* ---------- sortie : le noir se referme sur une ligne d'or ---------- */
.npi.is-exit .npi-stage { opacity: 0; filter: blur(8px); transform: scale(1.04); }
.npi.is-exit .npi-ctrl, .npi.is-exit .npi-progress { opacity: 0; transition: opacity .3s; }
.npi.is-close { clip-path: inset(50% 0 50% 0); transition: clip-path .66s cubic-bezier(.76, 0, .24, 1); }
.npi-seam {
  position: fixed; left: 0; right: 0; top: 50%; height: 1px; z-index: 2147483001; pointer-events: none;
  background: linear-gradient(90deg, transparent, #e3c27a 30%, #fff6dc 50%, #e3c27a 70%, transparent);
  box-shadow: 0 0 20px 2px rgba(227, 194, 122, .65);
  animation: npi-seam 1s cubic-bezier(.22, .61, .36, 1) both;
}
@keyframes npi-seam {
  0% { opacity: 0; transform: scaleX(.2); } 35% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(1); }
}

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .npi-brand { padding: 64px 16px 96px; }
  .npi-items { width: 100vw; height: min(46vh, 430px); }
  .npi-eyebrow { letter-spacing: .26em; padding-left: .26em; font-size: 10px; }
  .npi-ctrl { left: 50%; right: auto; transform: translateX(-50%); bottom: 22px; }
}

/* ---------- mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  .npi *, .npi { animation-duration: .01ms !important; transition-duration: .3s !important; transition-delay: 0s !important; }
  .npi-grain { animation: none; }
}
