/* PorcelanoDZ - interactive / premium effects layer.
 * Loaded after site.css. Effects are opt-in through classes and data attributes
 * wired by fx.js, and all motion is disabled under prefers-reduced-motion.
 * Effect vocabulary ported from the Pulse Gym project (aurora, grid, reveal,
 * counter, spotlight-tilt card, marquee, glow) plus extras for this site.
 */

:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --glass: rgba(29, 29, 27, .55);
  --glass-line: rgba(245, 235, 221, .12);
  --glow-corail: 0 10px 40px -10px rgba(242, 118, 94, .65);
}

body { background: var(--noir); }
main { background: var(--blanc); }
::selection { background: var(--corail); color: var(--noir); }

/* ---------- page intro + transitions */
.fx-loader {
  position: fixed; inset: 0; z-index: 200; background: var(--noir); display: grid; place-items: center;
  transition: opacity .6s var(--ease-out), visibility .6s;
}
.fx-loader img { width: 64px; animation: loader-pulse 1.1s var(--ease-out) infinite alternate; }
.fx-loader .bar { position: absolute; bottom: 0; left: 0; height: 2px; background: linear-gradient(90deg, var(--corail), var(--bleu)); width: 0; transition: width .8s var(--ease-out); }
.fx-loaded .fx-loader { opacity: 0; visibility: hidden; }
.fx-loaded .fx-loader .bar { width: 100%; }
@keyframes loader-pulse { from { opacity: .35; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .35s var(--ease-out) both vt-out; }
::view-transition-new(root) { animation: .45s var(--ease-out) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(16px); } }

/* ---------- scroll progress + glass header */
.fx-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 120; transform-origin: 0 50%; transform: scaleX(var(--p, 0));
  background: linear-gradient(90deg, var(--bordeaux), var(--corail), var(--bleu)); }
html[dir="rtl"] .fx-progress { transform-origin: 100% 50%; }
.site-header { transition: background .3s, backdrop-filter .3s, box-shadow .3s; }
.site-header.is-glass { background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); box-shadow: 0 1px 0 var(--glass-line); }
.nav a { position: relative; }
.nav a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 4px; height: 1px; background: var(--corail); transform: scaleX(0); transition: transform .3s var(--ease-out); }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a:hover, .nav a[aria-current="page"] { background: none; }

/* ---------- custom cursor (fine pointers only) */
.fx-cursor, .fx-cursor-dot { position: fixed; top: 0; left: 0; z-index: 150; pointer-events: none; border-radius: 50%; mix-blend-mode: difference; }
.fx-cursor { width: 38px; height: 38px; margin: -19px 0 0 -19px; border: 1px solid #f5ebdd; transition: width .25s var(--ease-out), height .25s var(--ease-out), margin .25s var(--ease-out), background .25s; }
.fx-cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: #f5ebdd; }
.fx-cursor.is-hover { width: 70px; height: 70px; margin: -35px 0 0 -35px; background: rgba(245, 235, 221, .9); }
@media (hover: none), (pointer: coarse) { .fx-cursor, .fx-cursor-dot { display: none; } }

/* ---------- backgrounds (aurora, grid, grain) */
.fx-dark { position: relative; isolation: isolate; overflow: hidden; background: var(--noir); color: var(--creme); }
.fx-aurora { position: absolute; inset: -25%; z-index: -2; pointer-events: none; filter: blur(70px); opacity: .55;
  background:
    radial-gradient(35% 40% at 20% 30%, rgba(242, 118, 94, .55), transparent 70%),
    radial-gradient(30% 35% at 80% 20%, rgba(49, 91, 140, .65), transparent 70%),
    radial-gradient(40% 40% at 60% 85%, rgba(121, 13, 22, .7), transparent 70%);
  animation: aurora-move 18s ease-in-out infinite alternate; }
@keyframes aurora-move {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(4%, -3%, 0) rotate(8deg) scale(1.08); }
  100% { transform: translate3d(-4%, 3%, 0) rotate(-6deg) scale(1.02); }
}
.fx-grid { position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .14;
  background-image: linear-gradient(rgba(245,235,221,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(245,235,221,.5) 1px, transparent 1px);
  background-size: 64px 64px; mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 30%, transparent 75%); }
.fx-grain::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: .06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- text effects */
.text-gradient { background: linear-gradient(100deg, var(--corail) 0%, #ffd2c2 35%, var(--corail) 55%, #8fb3dd 100%); background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: gradient-pan 6s linear infinite; }
@keyframes gradient-pan { to { background-position: 200% center; } }
.text-glow { text-shadow: 0 0 28px rgba(242, 118, 94, .45); }
.fx-split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; }
.fx-split .w > span { display: inline-block; transform: translateY(105%); transition: transform .9s var(--ease-out); transition-delay: calc(var(--i) * 60ms + 150ms); }
.fx-loaded .fx-split.is-in .w > span { transform: none; }

/* ---------- reveal (scroll) */
[data-reveal] { opacity: 0; transform: translate3d(0, 28px, 0); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); transition-delay: var(--d, 0ms); }
[data-reveal="left"] { transform: translate3d(-36px, 0, 0); }
[data-reveal="right"] { transform: translate3d(36px, 0, 0); }
[data-reveal="zoom"] { transform: scale(.94); }
[data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- glow + magnetic buttons */
.btn { position: relative; overflow: hidden; isolation: isolate; will-change: transform; }
.btn--primary { box-shadow: var(--glow-corail); }
.btn--primary::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease-out); }
.btn--primary:hover::before { transform: translateX(120%); }
.btn--ghost:hover { background: rgba(242, 118, 94, .12); border-color: var(--corail); color: inherit; }
.btn .arrow { transition: transform .3s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }
html[dir="rtl"] .btn .arrow { transform: scaleX(-1); }
html[dir="rtl"] .btn:hover .arrow { transform: scaleX(-1) translateX(4px); }
.glass { background: rgba(245, 235, 221, .06); border: 1px solid var(--glass-line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

/* ---------- spotlight + tilt cards */
.fx-tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0); transition: transform .35s var(--ease-out), box-shadow .35s; transform-style: preserve-3d; }
.fx-tilt.is-active { transition: transform .08s linear, box-shadow .35s; }
.fx-spot { position: relative; overflow: hidden; }
.fx-spot::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(242, 118, 94, .16), transparent 60%); }
.fx-spot:hover::before { opacity: 1; }
.fx-spot::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit; padding: 1px; opacity: 0; transition: opacity .3s;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), rgba(242, 118, 94, .9), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.fx-spot:hover::after { opacity: 1; }
.card, .product { transition: transform .35s var(--ease-out), box-shadow .35s; }
.card:hover, .product:hover { box-shadow: 0 24px 60px -20px rgba(29, 29, 27, .35); }
.product .thumb { transition: transform .8s var(--ease-out); }
.product:hover .thumb { transform: scale(1.06); }
.product .thumb-wrap { overflow: hidden; position: relative; }
.product .thumb-wrap .sheen { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%); transform: translateX(-100%); transition: transform .9s var(--ease-out); }
.product:hover .thumb-wrap .sheen { transform: translateX(100%); }

/* ---------- marquee */
.fx-marquee { display: flex; overflow: hidden; min-width: 0; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.fx-marquee .track { display: flex; min-width: max-content; animation: marquee 40s linear infinite; }
.fx-marquee:hover .track { animation-play-state: paused; }
.fx-marquee .item { text-decoration: none; display: flex; align-items: center; gap: 14px; padding-inline-end: 44px; white-space: nowrap; text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 600; }
.fx-marquee .item img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; }
@keyframes marquee { to { transform: translateX(-50%); } }
html[dir="rtl"] .fx-marquee .track { animation-name: marquee-rtl; }
@keyframes marquee-rtl { to { transform: translateX(50%); } }

/* ---------- hero: interactive 3D tile floor */
.hero-x { min-height: calc(100vh - 72px); min-height: calc(100svh - 72px); display: grid; grid-template-rows: 1fr auto; grid-template-columns: minmax(0, 1fr); }
.hero-x .wrap { position: relative; z-index: 2; display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; padding-top: 48px; padding-bottom: 48px; }
@media (max-width: 960px) { .hero-x .wrap { grid-template-columns: 1fr; } }
.hero-x h1 em { font-style: normal; }
.hero-x h1 { font-size: clamp(2.3rem, 4.6vw, 4.1rem); line-height: 1.02; letter-spacing: -.03em; margin-bottom: .35em; }
.hero-x .sub { font-size: 1.15rem; opacity: .75; max-width: 520px; }
.badge-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; font-size: .72rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.badge-pill .live { width: 7px; height: 7px; border-radius: 50%; background: var(--corail); box-shadow: 0 0 0 0 rgba(242,118,94,.7); animation: live 1.8s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 10px rgba(242,118,94,0); } 100% { box-shadow: 0 0 0 0 rgba(242,118,94,0); } }
.hero-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 36px; margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--glass-line); width: fit-content; }
.hero-stats dt { font-size: clamp(2rem, 4vw, 2.8rem); font-weight: 700; color: var(--corail); line-height: 1; }
.hero-stats dd { margin: 6px 0 0; font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; opacity: .6; }

.floor-stage { position: relative; aspect-ratio: 1; perspective: 1100px; }
.floor { position: absolute; inset: 6%; transform-style: preserve-3d; transform: rotateX(calc(58deg + var(--ty, 0deg))) rotateZ(calc(-32deg + var(--tx, 0deg))); transition: transform .6s var(--ease-out); }
.floor-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 3px; background: var(--grout, #8d8b88); padding: 3px; border-radius: 4px;
  box-shadow: 0 60px 120px -30px rgba(0,0,0,.8), 0 0 0 1px rgba(245,235,221,.08); }
.floor-grid.is-tall { grid-template-columns: repeat(5, 1fr); }
.floor-grid span { background: center/cover; transition: transform .45s var(--ease-out), translate .5s var(--ease-out), filter .5s, box-shadow .5s; backface-visibility: hidden; }
.floor-grid span.lift { translate: 0 0 22px; filter: brightness(1.12); box-shadow: 0 18px 30px -12px rgba(0,0,0,.55); }
.floor-light { position: absolute; inset: 0; pointer-events: none; border-radius: 4px; mix-blend-mode: soft-light;
  background: radial-gradient(45% 45% at var(--lx, 50%) var(--ly, 40%), rgba(255,255,255,.85), transparent 70%); }
.floor-reflect { position: absolute; inset: 0; pointer-events: none; border-radius: 4px;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.18) 50%, transparent 60%); background-size: 250% 100%; animation: reflect 7s ease-in-out infinite; }
@keyframes reflect { 0%, 100% { background-position: 120% 0; } 50% { background-position: -20% 0; } }
.floor-shadow { position: absolute; left: 12%; right: 12%; bottom: 2%; height: 14%; background: radial-gradient(closest-side, rgba(0,0,0,.6), transparent); filter: blur(12px); }
.floor-ui { position: absolute; z-index: 3; inset-inline: 0; bottom: -6px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.floor-ui button { width: 46px; height: 46px; border-radius: 12px; border: 2px solid transparent; background: center/cover; cursor: pointer; transition: transform .3s var(--ease-out), border-color .3s; box-shadow: 0 8px 20px -8px rgba(0,0,0,.7); }
.floor-ui button:hover { transform: translateY(-4px); }
.floor-ui button[aria-pressed="true"] { border-color: var(--corail); transform: translateY(-4px) scale(1.06); }
.floor-label { position: absolute; z-index: 3; top: 4%; inset-inline-end: 0; padding: 12px 16px; border-radius: 14px; font-size: .8rem; min-width: 170px; }
.floor-label strong { display: block; font-size: 1.05rem; color: var(--creme); }
.floor-label span { opacity: .65; }
.scroll-cue { position: absolute; z-index: 2; bottom: 86px; left: 50%; transform: translateX(-50%); width: 24px; height: 38px; border: 2px solid rgba(245,235,221,.35); border-radius: 14px; }
.scroll-cue::after { content: ""; position: absolute; left: 50%; top: 7px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--corail); animation: cue 1.8s var(--ease-out) infinite; }
@keyframes cue { to { transform: translateY(14px); opacity: 0; } }
@media (max-width: 960px) { .scroll-cue { display: none; } }
.hero-x .ticker { position: relative; z-index: 2; border-top: 1px solid var(--glass-line); background: rgba(0,0,0,.25); backdrop-filter: blur(8px); padding: 16px 0; color: rgba(245,235,221,.6); }
.hero-x .ticker .dot { color: var(--corail); }

/* ---------- dark sections (re-themed) */
.section--noir { position: relative; isolation: isolate; overflow: hidden; }
.section--noir .card, .fx-dark .card { background: rgba(245, 235, 221, .04); border: 1px solid var(--glass-line); color: var(--creme); box-shadow: none; }
.page-hero { position: relative; isolation: isolate; overflow: hidden; padding: 96px 0 80px; }
.page-hero h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); letter-spacing: -.02em; }

/* ---------- feature cards: number + icon glow */
.feature .icon { transition: transform .5s var(--ease-out), background .3s, color .3s; }
.feature:hover .icon { transform: rotate(-8deg) scale(1.08); background: var(--corail); color: var(--noir); }
.feature .num { position: absolute; top: 18px; inset-inline-end: 22px; font-size: 3rem; font-weight: 700; line-height: 1; color: rgba(29,29,27,.05); transition: color .3s; }
.feature:hover .num { color: rgba(242,118,94,.18); }

/* ---------- universes: parallax image + arrow */
.universe { background-size: cover; transition: transform .5s var(--ease-out); }
.universe .bg { position: absolute; inset: -8%; background: inherit; background-size: cover; background-position: center; transition: transform 1s var(--ease-out); }
.universe:hover .bg { transform: scale(1.08); }
.universe .go { position: absolute; z-index: 2; top: 16px; inset-inline-end: 16px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(245,235,221,.15); backdrop-filter: blur(6px); transition: background .3s, transform .4s var(--ease-out); }
.universe:hover .go { background: var(--corail); color: var(--noir); transform: rotate(-45deg); }
html[dir="rtl"] .universe:hover .go { transform: rotate(45deg) scaleX(-1); }
.universe .count { display: inline-block; margin-top: 4px; }

/* ---------- formats: 3D flip-up tiles */
.format .shape { transition: transform .6s var(--ease-out), box-shadow .6s; transform: perspective(600px) rotateX(18deg); }
.format:hover .shape { transform: perspective(600px) rotateX(0deg) translateY(-8px); box-shadow: 0 30px 50px -20px rgba(29,29,27,.5); }

/* ---------- counters band */
.stats-band { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
@media (max-width: 760px) { .stats-band { grid-template-columns: repeat(2, 1fr); } }
.stats-band div { padding: 26px; border-radius: var(--radius); }
.stats-band strong { display: block; font-size: clamp(2rem, 4vw, 3rem); line-height: 1; color: var(--corail); }
.stats-band span { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; opacity: .65; }

/* ---------- visualiser / calculator dark consoles */
.viz-panel, .totals { position: relative; }
.stage { box-shadow: 0 40px 80px -30px rgba(0,0,0,.6), inset 0 0 0 1px var(--glass-line); }
.stage .scanline { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, transparent, rgba(242,118,94,.25) 50%, transparent); height: 30%; animation: scan 2.2s linear infinite; }
@keyframes scan { from { transform: translateY(-100%); } to { transform: translateY(340%); } }
.progress { backdrop-filter: blur(3px); }
.totals { background: radial-gradient(120% 80% at 100% 0%, rgba(49,91,140,.45), transparent 60%), radial-gradient(100% 80% at 0% 100%, rgba(121,13,22,.5), transparent 60%), var(--noir); border: 1px solid var(--glass-line); }
.totals dd { font-variant-numeric: tabular-nums; }

/* ---------- inputs: focus glow */
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--corail); box-shadow: 0 0 0 4px rgba(242,118,94,.18); }

/* ---------- back to top */
.fx-top { position: fixed; z-index: 60; bottom: 92px; inset-inline-end: 30px; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--glass-line); background: var(--glass); color: var(--creme); backdrop-filter: blur(10px); cursor: pointer; opacity: 0; transform: translateY(10px); transition: .3s var(--ease-out); }
.fx-top.show { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  [data-reveal], .fx-split .w > span { opacity: 1 !important; transform: none !important; }
  .fx-cursor, .fx-cursor-dot { display: none; }
}
