/* ==========================================================================
   Tawssil Maroc — couche visuelle premium (3D, verre, lumière, mouvement)
   Chargée après styles.css
   ========================================================================== */
:root { --font-display: "Sora", "Inter", system-ui, sans-serif; --glass: rgba(255,255,255,.07); --glass-line: rgba(255,255,255,.14); }
h1, h2, h3, .brand-word { font-family: var(--font-display); }
h1 { letter-spacing: -.035em; }
h2 { letter-spacing: -.03em; }

/* progress */
.scroll-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 300; background: linear-gradient(90deg, var(--amber), var(--teal), var(--blue)); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- header sur hero sombre ---------- */
body.has-dark-hero .site-header:not(.is-scrolled) { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
body.has-dark-hero .site-header:not(.is-scrolled) .brand-word, body.has-dark-hero .site-header:not(.is-scrolled) .nav a { color: #fff; }
body.has-dark-hero .site-header:not(.is-scrolled) .nav a:hover { background: rgba(255,255,255,.08); }
body.has-dark-hero .site-header:not(.is-scrolled) .nav a[aria-current="page"] { background: rgba(255,255,255,.12); color: #fff; }
body.has-dark-hero .site-header:not(.is-scrolled) .btn--ghost { --fg: #fff; border-color: rgba(255,255,255,.3); }
body.has-dark-hero .site-header:not(.is-scrolled) .menu-btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); color: #fff; }
body.has-dark-hero .site-header { position: fixed; inset-inline: 0; top: var(--bar-h, 0px); }
body.has-dark-hero .site-header.is-scrolled { top: 0; }
body.has-dark-hero main { margin-top: 0; }

/* ---------- fond « mesh » animé ---------- */
.mesh { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.mesh i { position: absolute; width: 46vmax; height: 46vmax; border-radius: 50%; filter: blur(70px); opacity: .55; animation: blob 18s ease-in-out infinite alternate; }
.mesh i:nth-child(1) { background: #1769E0; top: -18vmax; inset-inline-start: -10vmax; }
.mesh i:nth-child(2) { background: #0DC9BF; top: 10%; inset-inline-end: -16vmax; opacity: .35; animation-duration: 22s; animation-delay: -6s; }
.mesh i:nth-child(3) { background: #FFB547; bottom: -26vmax; inset-inline-start: 30%; opacity: .18; animation-duration: 26s; animation-delay: -12s; }
@keyframes blob { 0% { transform: translate(0,0) scale(1); } 50% { transform: translate(6vmax,4vmax) scale(1.12); } 100% { transform: translate(-4vmax,7vmax) scale(.92); } }
.grain { position: absolute; inset: 0; pointer-events: none; opacity: .06; 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='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* sol en perspective (grille 3D) */
.floor { position: absolute; inset-inline: -20%; bottom: -2px; height: 46%; perspective: 520px; pointer-events: none; mask-image: linear-gradient(to top, #000 10%, transparent 92%); -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 92%); }
.floor::before { content: ""; position: absolute; inset: 0 0 -60% 0; transform: rotateX(68deg); transform-origin: 50% 0; background-image: linear-gradient(rgba(13,201,191,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(13,201,191,.5) 1px, transparent 1px); background-size: 64px 64px; animation: floor 4s linear infinite; }
@keyframes floor { to { background-position: 0 64px, 0 0; } }

/* ---------- HERO 3D ---------- */
.hero { background: radial-gradient(120% 90% at 70% 0%, #17396f 0%, #0B1F42 55%, #071530 100%); color: #B9CAE4; padding-block: calc(var(--header-h) + clamp(40px, 7vw, 90px)) clamp(80px, 10vw, 140px); isolation: isolate; }
html[dir] .hero { background: radial-gradient(120% 90% at 70% 0%, #17396f 0%, #0B1F42 55%, #071530 100%); }
.hero > .wrap { position: relative; z-index: 2; }
.hero h1 { color: #fff; font-size: clamp(2.4rem, 6.4vw, 4.6rem); line-height: 1.02; }
.hero .lead { color: #B9CAE4; font-size: 1.15rem; }
.hero .eyebrow { color: var(--teal); background: rgba(13,201,191,.1); border: 1px solid rgba(13,201,191,.25); padding: 7px 14px 7px 12px; border-radius: 999px; }
.hero .eyebrow::before { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(13,201,191,.6); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(13,201,191,.6); } 100% { box-shadow: 0 0 0 10px rgba(13,201,191,0); } }
.hero .btn--ghost { --fg: #fff; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.04); backdrop-filter: blur(6px); }
.hero .btn--ghost:hover { border-color: #fff; }
.hero-signature { color: #fff !important; font-family: var(--font) !important; direction: ltr !important; font-weight: 600; opacity: .9; }
.grad-anim { background: linear-gradient(90deg, #FFB547, #0DC9BF 35%, #5AA0FF 65%, #FFB547); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: gradmove 7s linear infinite; }
@keyframes gradmove { to { background-position: -250% 0; } }
.hero-trust { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 30px; font-size: .9rem; color: #9FB4D6; }
.hero-trust span { display: inline-flex; gap: 8px; align-items: center; }
.hero-trust .ic { width: 18px; height: 18px; color: var(--teal); }

/* split words */
[data-split].split-ready .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
[data-split].split-ready .w > span { display: inline-block; transform: translateY(110%) rotate(4deg); opacity: 0; transition: transform .9s cubic-bezier(.2,.8,.2,1), opacity .9s; transition-delay: calc(var(--i) * 70ms); }
[data-split].split-in .w > span { transform: none; opacity: 1; }
[data-split] .accent { display: inline; }
[data-split] .accent .w > span { background: linear-gradient(95deg, #2FE3D7, #6FB0FF); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-split].split-ready .accent { background: none; animation: none; }

/* scène */
.hero3d { --rx: 0deg; --ry: 0deg; position: relative; width: 100%; max-width: 600px; aspect-ratio: 1; margin-inline: auto; perspective: 1200px; }
.hero3d .stage { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .6s cubic-bezier(.2,.8,.2,1); }
.hero3d canvas.globe { position: absolute; inset: 0; width: 100%; height: 100%; }
.glass { background: linear-gradient(140deg, rgba(255,255,255,.14), rgba(255,255,255,.04)); border: 1px solid var(--glass-line); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); box-shadow: 0 30px 60px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.18); border-radius: 22px; color: #fff; }
.trk { position: absolute; inset-inline-end: -2%; bottom: 6%; width: 58%; max-width: 300px; padding: 18px; transform: translateZ(90px); animation: floaty 6s ease-in-out infinite; }
.trk small { color: #9FB4D6; font-size: .72rem; }
.trk .code { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; letter-spacing: .02em; }
.trk .tag { display: inline-block; font-size: .66rem; font-weight: 600; color: var(--amber); background: rgba(255,181,71,.14); padding: 3px 9px; border-radius: 999px; margin-top: 6px; }
.trk .line { height: 6px; border-radius: 6px; background: rgba(255,255,255,.12); margin: 14px 0 12px; overflow: hidden; position: relative; }
.trk .line::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 62%; border-radius: 6px; background: linear-gradient(90deg, var(--amber), var(--teal)); animation: grow 3.2s ease-in-out infinite alternate; }
.trk ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .78rem; }
.trk li { display: flex; align-items: center; gap: 9px; color: #9FB4D6; }
.trk li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); flex: none; }
.trk li.d { color: #fff; } .trk li.d::before { background: var(--teal); border-color: var(--teal); }
.trk li.n { color: #fff; font-weight: 600; } .trk li.n::before { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(255,181,71,.2); }
.chip3d { position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: .8rem; font-weight: 600; animation: floaty 7s ease-in-out infinite; }
.chip3d .ic { width: 18px; height: 18px; color: var(--teal); }
.chip3d.k1 { inset-inline-start: 0; top: 14%; transform: translateZ(60px); }
.chip3d.k2 { inset-inline-end: 4%; top: 6%; transform: translateZ(40px); animation-delay: -3s; }
.chip3d.k2 .ic { color: var(--amber); }

/* cube colis 3D */
.cube { --s: 110px; position: absolute; width: var(--s); height: var(--s); transform-style: preserve-3d; }
.cube .spin { position: absolute; inset: 0; transform-style: preserve-3d; animation: cube 14s linear infinite; }
.cube .f { position: absolute; inset: 0; border-radius: 6px; background: linear-gradient(135deg, #FFC86B, #F0A332); box-shadow: inset 0 0 0 1px rgba(122,78,0,.2); }
.cube .f::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 42%; width: 16%; background: rgba(255,240,210,.55); }
.cube .f.t::after, .cube .f.b::after { inset: 42% 0 auto 0; width: auto; height: 16%; }
.cube .f.fr { transform: translateZ(calc(var(--s) / 2)); }
.cube .f.bk { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(135deg, #E59A2A, #C77C12); }
.cube .f.rt { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(135deg, #F2A93C, #D98A1C); }
.cube .f.lt { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(135deg, #F7B954, #E09422); }
.cube .f.t { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); background: linear-gradient(135deg, #FFD88E, #FFC062); }
.cube .f.b { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); background: #B86F0E; }
.cube .f.fr::before { content: ""; position: absolute; inset-inline-start: 12%; bottom: 14%; width: 30%; height: 22%; border-radius: 3px; background: rgba(16,42,86,.18); }
@keyframes cube { from { transform: rotateX(-22deg) rotateY(0deg); } to { transform: rotateX(-22deg) rotateY(360deg); } }
.cube .shadow { position: absolute; inset-inline: 5%; bottom: -60%; height: 26%; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.45), transparent); transform: rotateX(90deg) translateZ(calc(var(--s) * -.9)); filter: blur(4px); }
.hero3d .cube { inset-inline-start: 6%; bottom: 14%; transform: translateZ(140px); animation: bob 5s ease-in-out infinite; }
@keyframes bob { 50% { translate: 0 -16px; } }

/* ---------- marquee ---------- */
.marquee { position: relative; z-index: 3; margin-top: -1px; background: linear-gradient(90deg, var(--blue), var(--teal)); color: #fff; overflow: hidden; transform: rotate(-1.6deg) scale(1.03); box-shadow: 0 20px 40px rgba(16,42,86,.25); }
.marquee .track { display: flex; width: max-content; gap: 46px; padding: 16px 0; animation: marq 32s linear infinite; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.marquee span { display: inline-flex; align-items: center; gap: 14px; }
.marquee span i { width: 10px; height: 10px; background: var(--amber); transform: rotate(45deg); border-radius: 2px; }
@keyframes marq { to { transform: translateX(-50%); } }

/* ---------- bloc suivi : bordure lumineuse animée ---------- */
@property --ang { syntax: "<angle>"; initial-value: 0deg; inherits: false; }
.track-band { margin-top: 64px !important; }
.glow-border { position: relative; border: 0 !important; background: #fff; }
.glow-border::before { content: ""; position: absolute; inset: -2px; border-radius: inherit; padding: 2px; background: conic-gradient(from var(--ang), transparent 0 60%, var(--teal), var(--blue), var(--amber), transparent 95%); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: ang 5s linear infinite; pointer-events: none; }
@keyframes ang { to { --ang: 360deg; } }

/* ---------- cartes 3D ---------- */
.tilt { transform-style: preserve-3d; transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .3s, border-color .3s; will-change: transform; }
.tilt .glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 0%), rgba(255,255,255,.55), transparent 45%); opacity: 0; transition: opacity .3s; mix-blend-mode: soft-light; }
.tilt:hover .glare { opacity: 1; }
.card.tilt:hover { box-shadow: 0 30px 60px rgba(16,42,86,.18); }
.card .card-ic { transform: translateZ(40px); transition: transform .4s; box-shadow: 0 10px 24px rgba(23,105,224,.15); }
.card:hover .card-ic { transform: translateZ(60px) scale(1.06) rotate(-4deg); }
.card h3 { transform: translateZ(24px); }
.card { background: linear-gradient(#fff, #fff) padding-box, linear-gradient(140deg, var(--line), var(--line)) border-box; border: 1px solid transparent; }
.card:hover { background: linear-gradient(#fff, #fff) padding-box, linear-gradient(140deg, var(--teal), var(--blue), var(--amber)) border-box; border-color: transparent; }
.magnetic { transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .2s; }
.btn { position: relative; overflow: hidden; }
.btn::before { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg); transition: inset-inline-start .6s; pointer-events: none; }
.btn:hover::before { inset-inline-start: 130%; }

/* ---------- parcours (colis qui avance au scroll) ---------- */
.route { --p: 0; position: relative; }
.route .rail { display: none; }
@media (min-width: 1000px) {
  .route .rail { display: block; position: absolute; top: 52px; inset-inline: 10%; height: 4px; border-radius: 4px; background: var(--line); }
  .route .rail::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: calc(var(--p) * 100%); border-radius: 4px; background: linear-gradient(90deg, var(--amber), var(--teal), var(--blue)); box-shadow: 0 0 18px rgba(13,201,191,.6); }
  .route .rail .cube { --s: 38px; top: -48px; inset-inline-start: calc(var(--p) * 100%); margin-inline-start: -19px; }
  .route .rail .cube .spin { animation-duration: 6s; }
  .route.steps::before, .route.steps::after { display: none; }
  .route .step .step-ic { transition: background .4s, color .4s, transform .4s, box-shadow .4s; }
  .route .step.on .step-ic { background: var(--navy); color: #fff; transform: translateY(-4px) scale(1.08); box-shadow: 0 14px 30px rgba(16,42,86,.25); }
}
.route .step.on .step-ic { background: var(--navy); color: #fff; }
.steps.route.is-visible .step-ic { background: initial; color: initial; }
.steps.route .step.on .step-ic { background: var(--navy); color: #fff; }

/* ---------- e-commerce 3D ---------- */
.ev3d { perspective: 1400px; }
.ev3d .ev { transform: rotateY(-14deg) rotateX(8deg); transform-style: preserve-3d; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.ev3d:hover .ev { transform: rotateY(-4deg) rotateX(2deg); }
.ev3d .ev-shop { transform: translateZ(30px); }
.ev3d .ev-order { transform: translateZ(110px); }
.ev3d .cube { --s: 64px; inset-inline-end: 6%; top: -2%; transform: translateZ(160px); }
.section--navy { position: relative; overflow: hidden; isolation: isolate; }
.section--navy > .wrap { position: relative; z-index: 2; }

/* ---------- carte isométrique (zones) ---------- */
.iso { position: relative; width: 100%; max-width: 540px; aspect-ratio: 1.1; margin-inline: auto; perspective: 1100px; }
.iso-plane { position: absolute; inset: 8% 6%; border-radius: 34px; transform: rotateX(58deg) rotateZ(-38deg); transform-style: preserve-3d; background:
  radial-gradient(circle at 30% 30%, rgba(13,201,191,.25), transparent 50%),
  linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 34px 34px,
  linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px) 0 0 / 34px 34px, linear-gradient(140deg, #17396f, #0B1F42);
  box-shadow: 0 60px 80px rgba(16,42,86,.35), inset 0 0 0 1px rgba(255,255,255,.08); }
.iso-plane svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.iso-plane .ln { stroke: var(--teal); stroke-width: 2; stroke-dasharray: 6 8; fill: none; animation: dash 2.4s linear infinite; opacity: .8; }
.pin { position: absolute; transform-style: preserve-3d; transform: translate(-50%, -50%); }
.pin .pole { position: absolute; left: -2px; bottom: 0; width: 4px; height: 70px; border-radius: 4px; background: linear-gradient(to top, var(--amber), rgba(255,181,71,0)); transform-origin: bottom; transform: rotateX(-90deg); box-shadow: 0 0 14px rgba(255,181,71,.8); }
.pin .pole::after { content: ""; position: absolute; top: -6px; left: -4px; width: 12px; height: 12px; border-radius: 50%; background: #FFD27F; box-shadow: 0 0 16px 4px rgba(255,181,71,.7); }
.pin .head { position: absolute; left: 50%; bottom: 0; width: 26px; height: 26px; margin-left: -13px; transform-origin: bottom; transform: rotateX(-90deg) translateY(-54px) rotateY(38deg); }
.pin .head svg { width: 26px; height: 26px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.4)); }
.pin .dot { position: absolute; width: 14px; height: 14px; border-radius: 50%; left: -7px; top: -7px; background: rgba(255,181,71,.4); animation: pulse 2.4s ease-out infinite; }
.pin.p2 .dot { animation-delay: -.8s; } .pin.p3 .dot { animation-delay: -1.6s; }

/* ---------- bento + projecteur ---------- */
.spotlight { position: relative; }
.spotlight::before { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(520px circle at var(--mx, -999px) var(--my, -999px), rgba(13,201,191,.14), transparent 45%); }
.why-item { position: relative; overflow: hidden; transition: transform .3s, border-color .3s, background .3s; }
.why-item:hover { border-color: rgba(13,201,191,.4); background: rgba(255,255,255,.07); transform: translateY(-4px); }
.why-item .card-ic { box-shadow: 0 0 30px rgba(13,201,191,.25); }

/* ---------- CTA ---------- */
.cta { background: radial-gradient(120% 120% at 50% 0%, #17396f, #0B1F42 60%, #071530); }
.cta .cube { --s: 70px; z-index: 0; opacity: .9; }
.cta .cube.c1 { inset-inline-start: 7%; top: 18%; animation: bob 6s ease-in-out infinite; }
.cta .cube.c2 { --s: 46px; inset-inline-end: 9%; bottom: 16%; animation: bob 7s ease-in-out infinite -2s; }
.cta .cube.c3 { --s: 30px; inset-inline-end: 18%; top: 14%; animation: bob 5s ease-in-out infinite -1s; }
@media (max-width: 760px) { .cta .cube { display: none; } }

/* ---------- page hero (pages intérieures) ---------- */
.page-hero { background: radial-gradient(120% 90% at 80% 0%, #17396f, #0B1F42 60%, #071530); padding-top: calc(var(--header-h) + clamp(48px, 7vw, 88px)); isolation: isolate; }
.page-hero::after { display: none; }
.page-hero > .wrap { position: relative; z-index: 2; }
.page-hero .cube { --s: 84px; inset-inline-end: 9%; top: 50%; margin-top: -20px; z-index: 1; animation: bob 6s ease-in-out infinite; }
@media (max-width: 900px) { .page-hero .cube { --s: 46px; top: auto; bottom: 30px; inset-inline-end: 24px; } }

/* ---------- footer watermark ---------- */
.site-footer { position: relative; overflow: hidden; }
.site-footer::after { content: "tawssil"; position: absolute; inset-inline-end: -2%; bottom: -6%; font-family: var(--font-display); font-weight: 800; font-size: clamp(6rem, 18vw, 16rem); letter-spacing: -.06em; color: rgba(255,255,255,.03); pointer-events: none; line-height: 1; }

/* forms cards légèrement en relief */
.form-card { box-shadow: 0 30px 70px rgba(16,42,86,.1); }
.section--soft { background: radial-gradient(900px 400px at 100% 0%, rgba(13,201,191,.08), transparent 60%), radial-gradient(900px 400px at 0% 100%, rgba(23,105,224,.07), transparent 60%), var(--soft); }

@media (max-width: 959px) {
  .hero3d { max-width: 440px; }
  .trk { width: 64%; inset-inline-end: 0; bottom: 2%; }
  .hero3d .cube { --s: 74px; inset-inline-start: 4%; bottom: 10%; }
  .chip3d.k2 { display: none; }
  .marquee { transform: rotate(-2deg) scale(1.05); }
}
@media (max-width: 480px) { .chip3d.k1 { top: 4%; } .trk { padding: 14px; } }
@media (prefers-reduced-motion: reduce) { .mesh i, .floor::before, .marquee .track, .cube .spin, .glow-border::before { animation: none !important; } }

.card--cta { background: linear-gradient(150deg, #17396f, #0B1F42) padding-box, linear-gradient(140deg, var(--teal), var(--blue), var(--amber)) border-box !important; color: #B9CAE4; }
.card--cta h3 { color: #fff; } .card--cta p { color: #B9CAE4; }
.card--cta .btn { align-self: flex-start; margin-top: 6px; }
html, body { overflow-x: clip; }
