/* ==========================================================================
   ATELIER ZĀHIRA — Couche Web3 (néon / aurora / glass)
   Chargée APRÈS styles.css : n'altère pas la structure, ajoute la matière.
   ========================================================================== */

@property --w3-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@property --w3-shift { syntax: '<percentage>'; initial-value: 0%; inherits: false; }

:root {
  --w3-red: #ff2a2a;
  --w3-hot: #ff4a2e;
  --w3-magenta: #d0101f;
  --w3-violet: #8e0a16;
  --w3-ice: #c9d6ff;
  --w3-grad: linear-gradient(100deg, #ff2a2a 0%, #ff4a2e 30%, #d0101f 62%, #8e0a16 100%);
  --w3-grad-loop: linear-gradient(100deg, #ff2a2a, #ff4a2e, #d0101f, #8e0a16, #ff4a2e, #ff2a2a);
  --w3-conic: conic-gradient(from var(--w3-angle), #ff2a2a, #ff4a2e, #d0101f, #8e0a16, rgba(142, 10, 22, 0) 62%, rgba(255, 42, 42, 0) 80%, #ff2a2a);
  --w3-glow: 0 0 24px rgba(255, 42, 42, .45), 0 0 60px rgba(208, 16, 31, .18);
  --w3-ease: cubic-bezier(.16, 1, .3, 1);
}

::selection { background: rgba(255, 42, 42, .85); color: #fff; }

/* ---------- Fond : aurora vivante + grain + grille ---------- */
body { background-color: #060608; }

.liquid-orb { opacity: .42; filter: blur(90px); will-change: transform; }
.orb-one { background: radial-gradient(circle, #ff2a2a 0, #b3121f 45%, transparent 70%); }
.orb-two { background: radial-gradient(circle, #b0101c 0, #4a050b 45%, transparent 70%); opacity: .34; }
.orb-three { background: radial-gradient(circle, #d0101f 0, #6e0710 45%, transparent 70%); opacity: .3; }

.w3-grain {
  position: fixed; inset: -50%; z-index: 9990; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%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");
}

.w3-grid {
  position: fixed; left: -50%; right: -50%; bottom: -10vh; height: 70vh; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 74, 46, .22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(142, 10, 22, .18) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(520px) rotateX(62deg);
  transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, .7), transparent 75%);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, .7), transparent 75%);
  opacity: .55;
}

/* ---------- Barre de progression ---------- */
.w3-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 9995; pointer-events: none;
  background: var(--w3-grad); transform-origin: 0 50%; transform: scaleX(var(--w3-p, 0));
  box-shadow: 0 0 12px rgba(255, 74, 46, .8);
}

/* ---------- Curseur aura (desktop) ---------- */
.w3-cursor {
  position: fixed; top: 0; left: 0; z-index: 9; pointer-events: none;
  width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 42, 42, .16), rgba(208, 16, 31, .08) 35%, transparent 65%);
  mix-blend-mode: screen; opacity: 0; transition: opacity .5s;
  will-change: transform;
}
.w3-cursor.is-on { opacity: 1; }
.w3-dot {
  position: fixed; top: 0; left: 0; z-index: 9996; pointer-events: none;
  width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 12px #ff4a2e, 0 0 26px #d0101f;
  mix-blend-mode: difference; opacity: 0; transition: opacity .3s, width .3s var(--w3-ease), height .3s var(--w3-ease), margin .3s var(--w3-ease);
}
.w3-dot.is-on { opacity: 1; }
.w3-dot.is-hover { width: 44px; height: 44px; margin: -22px 0 0 -22px; background: rgba(255, 255, 255, .9); }

/* ---------- Texte dégradé animé ---------- */
h1 em, h2 em, h3 em, .drawer-title em,
.journal-full .journal-intro h1 em, .account-hero h1 em, .detail-hero h1 em, .legal-card h1 em,
.archive-section h2 em, .offers-intro h3 em {
  background: var(--w3-grad-loop);
  background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: w3-flow 8s linear infinite;
  filter: drop-shadow(0 0 22px rgba(255, 42, 42, .35));
}
.manifesto h2 em { filter: none; }

.eyebrow.red, .red { color: var(--w3-hot); text-shadow: 0 0 14px rgba(255, 74, 46, .55); }

.hero:after {
  -webkit-text-stroke: 1px transparent;
  background: var(--w3-grad-loop); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text;
  opacity: .16; animation: w3-flow 14s linear infinite;
}

/* ---------- Header ---------- */
.site-header.glass-panel {
  transition: height .4s var(--w3-ease), top .4s var(--w3-ease), box-shadow .4s, background .4s;
}
.site-header.glass-panel:after {
  content: ""; position: absolute; left: 22px; right: 22px; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, #ff2a2a, #d0101f, #8e0a16, transparent);
  background-size: 200% 100%; animation: w3-flow 6s linear infinite; opacity: .8;
}
.w3-scrolled .site-header.glass-panel {
  top: 10px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 74, 46, .12), 0 0 40px rgba(208, 16, 31, .08);
}
.site-header nav a { position: relative; transition: color .3s; }
.site-header nav a:after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 1px;
  background: var(--w3-grad); transform: scaleX(0); transform-origin: 0 50%;
  transition: transform .45s var(--w3-ease); box-shadow: 0 0 8px #ff4a2e;
}
.site-header nav a:hover { color: #fff; }
.site-header nav a:hover:after { transform: scaleX(1); }

.header-zahira-mark, .zahira-radar-mark { filter: drop-shadow(0 0 10px rgba(255, 42, 42, .45)); }

/* ---------- Boutons ---------- */
.button, .subscribe-action, .zahira-auth-submit, .acquisition-action, .login-action, .cart-action, #info-toggle, .account-action {
  transition: transform .35s var(--w3-ease), box-shadow .35s, background .35s, border-color .35s, color .35s !important;
}
.button-primary, .zahira-auth-submit, .acquisition-action {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--w3-grad-loop) !important; background-size: 250% 100% !important;
  animation: w3-flow 6s linear infinite;
  box-shadow: 0 10px 34px rgba(255, 42, 42, .35), 0 0 0 1px rgba(255, 255, 255, .14) inset !important;
  border-color: transparent !important; color: #fff !important;
}
.button-primary:before, .zahira-auth-submit:before, .acquisition-action:before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .9s var(--w3-ease);
}
.button-primary:hover:before, .zahira-auth-submit:hover:before, .acquisition-action:hover:before { transform: translateX(120%); }
.button-primary:hover, .zahira-auth-submit:hover:not(:disabled), .acquisition-action:hover {
  box-shadow: 0 14px 44px rgba(255, 42, 42, .55), 0 0 60px rgba(208, 16, 31, .3) !important;
}
.button-quiet:hover, .login-action:hover, .cart-action:hover, #info-toggle:hover, .account-action:hover {
  border-color: rgba(255, 74, 46, .7) !important;
  box-shadow: 0 0 0 1px rgba(255, 74, 46, .3), 0 0 26px rgba(255, 42, 42, .35) !important;
}
.cart-count { background: var(--w3-grad) !important; box-shadow: 0 0 12px rgba(255, 74, 46, .8); }

/* ---------- Hero ---------- */
.hero { isolation: isolate; }
.hero > *:not(.w3-hero-canvas) { position: relative; z-index: 1; }
.w3-hero-canvas {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse at 70% 45%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse at 70% 45%, #000 20%, transparent 78%);
  opacity: .9;
}
.hero-meta span:last-child { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta span:last-child:before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ff2a2a;
  box-shadow: 0 0 0 0 rgba(255, 42, 42, .6); animation: w3-ping 2s infinite;
}
.hero h1 .w3-line { display: block; overflow: hidden; padding-bottom: .04em; margin-bottom: -.04em; }
.hero h1 .w3-line > span { display: inline-block; transform: translateY(105%); transition: transform 1.2s var(--w3-ease); }
.w3-ready .hero h1 .w3-line > span { transform: none; }
.hero h1 .w3-line:nth-child(2) > span { transition-delay: .12s; }
.hero h1 .w3-line:nth-child(3) > span { transition-delay: .24s; }

.signal-disc {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 0 1px rgba(255, 74, 46, .25), 0 0 60px rgba(255, 42, 42, .35), 0 0 120px rgba(208, 16, 31, .15) !important;
  animation: w3-float 7s ease-in-out infinite;
}
.radar-sweep { filter: hue-rotate(0deg) saturate(1.3); }

/* ---------- Marquee ---------- */
.w3-marquee {
  position: relative; margin: 6px 18px 20px; overflow: hidden; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: linear-gradient(90deg, rgba(255, 42, 42, .1), rgba(208, 16, 31, .08), rgba(142, 10, 22, .1));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.w3-marquee-track { display: flex; width: max-content; animation: w3-marquee 38s linear infinite; }
.w3-marquee:hover .w3-marquee-track { animation-play-state: paused; }
.w3-marquee-track span {
  display: inline-flex; align-items: center; gap: 22px; padding: 14px 22px; white-space: nowrap;
  font: 500 12px/1 var(--mono); letter-spacing: .14em; color: rgba(236, 234, 228, .78);
}
.w3-marquee-track span:after { content: "✦"; color: var(--w3-hot); text-shadow: 0 0 10px var(--w3-hot); }
.w3-marquee-track b { font-weight: 500; background: var(--w3-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Bordures conic animées ---------- */
.offer-card, .product, .journal-entry, .system-card, .capability-grid article, .zahira-auth-card, .account-card, .legal-card, .atelier-cart-panel {
  position: relative; isolation: isolate;
}
.offer-card:before, .product:before, .journal-entry:before, .system-card:before, .zahira-auth-card:before {
  content: ""; position: absolute; inset: -1px; z-index: 2; pointer-events: none; border-radius: inherit; padding: 1px;
  background: var(--w3-conic);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .5s;
  animation: w3-spin 5s linear infinite;
}
.offer-card:hover:before, .product:hover:before, .journal-preview:hover .journal-entry:before,
.offer-card-featured:before, .system-card:before, .zahira-auth-card:before, .journal-entry-final:before { opacity: 1; }
.offer-card-featured { box-shadow: 0 20px 60px rgba(0, 0, 0, .35), 0 0 70px rgba(255, 42, 42, .22), inset 0 1px rgba(255, 255, 255, .17) !important; }

/* Badge "populaire" */
.offer-card-featured .offer-kicker:after {
  content: "★ POPULAIRE"; margin-left: 10px; padding: 4px 8px; border-radius: 999px;
  font-size: 9px; letter-spacing: .12em; color: #fff;
  background: var(--w3-grad); box-shadow: 0 0 16px rgba(255, 74, 46, .55);
}

/* ---------- Spotlight qui suit la souris ---------- */
.w3-spot { --mx: 50%; --my: 50%; }
.w3-spot > .w3-spot-layer {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit; opacity: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 74, 46, .16), rgba(142, 10, 22, .07) 40%, transparent 70%);
  transition: opacity .4s;
}
.w3-spot:hover > .w3-spot-layer { opacity: 1; }
.offer-card > *:not(.w3-spot-layer), .journal-entry > *:not(.w3-spot-layer), .capability-grid article > *:not(.w3-spot-layer) { position: relative; z-index: 1; }

/* ---------- Tilt 3D ---------- */
.w3-tilt { transform-style: preserve-3d; transition: transform .6s var(--w3-ease), opacity 1s var(--w3-ease), filter 1s var(--w3-ease), box-shadow .5s, background .35s !important; will-change: transform; }
.w3-tilt.is-tilting { transition: transform .12s linear, opacity 1s, filter 1s, box-shadow .5s !important; }

/* ---------- Produit : reflet holographique ---------- */
.product-cover-wrap { position: relative; overflow: hidden; }
.product-cover-wrap:after {
  content: ""; position: absolute; inset: -40%; pointer-events: none; mix-blend-mode: color-dodge; opacity: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 74, 46, .5) 45%, rgba(142, 10, 22, .5) 52%, rgba(255, 120, 80, .45) 58%, transparent 68%);
  transform: translateX(-60%); transition: transform 1.2s var(--w3-ease), opacity .5s;
}
.product:hover .product-cover-wrap:after { transform: translateX(60%); opacity: 1; }
.product-cover { transition: transform 1.2s var(--w3-ease), filter .6s; }
.product:hover .product-cover { transform: scale(1.05); filter: saturate(1.15) contrast(1.05); }
.status b { display: inline-block; transition: transform .4s var(--w3-ease); }
.product:hover .status b { transform: translateX(6px); }

/* ---------- Système Sambac ---------- */
.orbit-core { box-shadow: 0 0 40px rgba(255, 42, 42, .4), 0 0 90px rgba(208, 16, 31, .2) !important; }
.sambac-electron { box-shadow: 0 0 12px #fff, 0 0 22px #ff4a2e !important; }
.online i { box-shadow: 0 0 10px currentColor; }

/* ---------- Labels de section ---------- */
.section-label span:first-child {
  background: var(--w3-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 8px rgba(255, 74, 46, .6));
}

/* ---------- Manifeste : holo paper ---------- */
.manifesto { position: relative; isolation: isolate; }
.manifesto:before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .55;
  background:
    radial-gradient(60% 80% at var(--w3-shift) 20%, rgba(255, 74, 46, .22), transparent 60%),
    radial-gradient(50% 70% at calc(100% - var(--w3-shift)) 90%, rgba(142, 10, 22, .22), transparent 60%),
    radial-gradient(40% 60% at 50% 50%, rgba(255, 120, 80, .14), transparent 60%);
  animation: w3-holo 12s ease-in-out infinite alternate;
}
.manifesto h2 em { animation-duration: 10s; }
.manifesto-index span { transition: color .3s, letter-spacing .4s var(--w3-ease); }
.manifesto-index span:hover { color: #ff2a2a; letter-spacing: .2em; }

/* ---------- Journal ---------- */
.journal-entry-final { box-shadow: 0 0 60px rgba(255, 42, 42, .12); }
.journal-read b { display: inline-block; transition: transform .4s var(--w3-ease); }
.journal-preview:hover .journal-read b { transform: translateX(6px); }

/* ---------- Footer ---------- */
.footer-brand {
  background: var(--w3-grad-loop); background-size: 300% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: w3-flow 10s linear infinite;
}
.site-footer { position: relative; }
.site-footer:before {
  content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 74, 46, .6), rgba(142, 10, 22, .6), transparent);
}

/* ---------- Formulaires ---------- */
.zahira-auth-card input:focus, .account-profile-fields select:focus, .atelier-agent-input:focus {
  border-color: rgba(255, 74, 46, .8) !important;
  box-shadow: 0 0 0 3px rgba(255, 74, 46, .18), 0 0 24px rgba(208, 16, 31, .2) !important;
  outline: none;
}
.size-choice[aria-pressed="true"] { box-shadow: 0 0 0 1px rgba(255, 74, 46, .6), 0 0 22px rgba(255, 42, 42, .4); }

/* ---------- Agent ---------- */
.atelier-agent-toggle { box-shadow: 0 0 0 1px rgba(255, 74, 46, .35), 0 0 30px rgba(255, 42, 42, .45), 0 0 70px rgba(208, 16, 31, .2) !important; animation: w3-float 6s ease-in-out infinite; }

/* ---------- Révélation au scroll ---------- */
.w3-js .w3-reveal { opacity: 0; transform: translate3d(0, 42px, 0); filter: blur(10px); transition: opacity 1s var(--w3-ease), transform 1.1s var(--w3-ease), filter 1s var(--w3-ease); transition-delay: var(--w3-d, 0s); }
.w3-js .w3-reveal.is-in { opacity: 1; transform: none; filter: none; }

/* ---------- Scramble ---------- */
.w3-scrambling { color: var(--w3-hot) !important; }

/* ---------- Scrollbar ---------- */
html { scrollbar-color: #ff2a2a #0a0a0c; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0a0a0c; }
::-webkit-scrollbar-thumb { background: linear-gradient(#ff2a2a, #d0101f, #8e0a16); border-radius: 10px; border: 2px solid #0a0a0c; }

/* ---------- Keyframes ---------- */
@keyframes w3-flow { to { background-position: 300% 0; } }
@keyframes w3-spin { to { --w3-angle: 360deg; } }
@keyframes w3-holo { from { --w3-shift: 10%; } to { --w3-shift: 90%; } }
@keyframes w3-marquee { to { transform: translateX(-50%); } }
@keyframes w3-ping { 0% { box-shadow: 0 0 0 0 rgba(255, 42, 42, .6); } 80%, 100% { box-shadow: 0 0 0 9px rgba(255, 42, 42, 0); } }
@keyframes w3-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes w3-drift-a { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-8vw, 10vh) scale(1.15); } }
@keyframes w3-drift-b { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(10vw, -8vh) scale(.9); } }
@keyframes w3-drift-c { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-12vw, -12vh) scale(1.2); } }
@keyframes w3-grid { to { background-position: 0 64px, 0 0; } }

@media (prefers-reduced-motion: no-preference) {
  .orb-one { animation: w3-drift-a 22s ease-in-out infinite; }
  .orb-two { animation: w3-drift-b 26s ease-in-out infinite; }
  .orb-three { animation: w3-drift-c 30s ease-in-out infinite; }
  .w3-grid { animation: w3-grid 3s linear infinite; }
}

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .w3-cursor, .w3-dot { display: none; }
  .w3-grid { opacity: .35; height: 50vh; }
  .w3-marquee { margin: 4px 10px 14px; }
  .w3-marquee-track span { padding: 12px 16px; font-size: 11px; }
  .offer-card-featured .offer-kicker:after { font-size: 8px; }
}
@media (hover: none) { .w3-cursor, .w3-dot { display: none; } }

/* ---------- Accessibilité : mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .w3-js .w3-reveal { opacity: 1; transform: none; filter: none; }
  .hero h1 .w3-line > span { transform: none; }
  .w3-cursor, .w3-dot, .w3-hero-canvas { display: none; }
}

/* w3-redonly : fond sans teinte bleue */
body { background: radial-gradient(circle at 80% 9%, #2a0c0e 0, transparent 25%), radial-gradient(circle at 11% 44%, #1a0709 0, transparent 27%), #060606 !important; }

/* Curseur personnalisé désactivé */
.w3-cursor, .w3-dot { display: none !important; }
