/* ============================================================
   E3 DRIVING SCHOOL - Premium motion layer
   Visual-only enhancements on top of style.css + editorial.css.
   Everything here is disabled under prefers-reduced-motion.
   ============================================================ */
:root {
  --fx-gold: #cfad69;
  --fx-gold-light: #ecd7a6;
  --fx-gold-deep: #9b793e;
  --fx-ease: cubic-bezier(.16, 1, .3, 1);
  --fx-spring: cubic-bezier(.34, 1.56, .64, 1);
}

@property --fx-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

::selection { background: var(--fx-gold); color: #111; }

/* ---------- Page transitions ---------- */
.fx-curtain {
  position: fixed;
  inset: 0;
  z-index: 10050;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(207,173,105,.18), transparent 60%),
    #0b0b0a;
  transform: scaleY(0);
  transform-origin: top;
}
.fx-curtain::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--fx-gold), transparent);
}
.fx-curtain.is-entering { transform: scaleY(1); transform-origin: bottom; animation: fxCurtainOut .75s var(--fx-ease) .05s forwards; }
.fx-curtain.is-leaving { transform-origin: bottom; animation: fxCurtainIn .45s var(--fx-ease) forwards; }
@keyframes fxCurtainOut { to { transform: scaleY(0); } }
@keyframes fxCurtainIn { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* ---------- Film grain ---------- */
.fx-grain {
  position: fixed;
  inset: -50%;
  z-index: 9990;
  pointer-events: none;
  opacity: .045;
  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='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: fxGrain 1.2s steps(6) infinite;
}
@keyframes fxGrain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-4%, 3%); }
  40% { transform: translate(3%, -5%); }
  60% { transform: translate(-6%, -2%); }
  80% { transform: translate(5%, 4%); }
  100% { transform: translate(0, 0); }
}

/* ---------- Custom cursor (fine pointers only) ---------- */
.fx-cursor, .fx-cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10040;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  transition: opacity .3s, width .35s var(--fx-ease), height .35s var(--fx-ease), margin .35s var(--fx-ease), background .3s, border-color .3s;
}
.fx-cursor {
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border: 1.5px solid rgba(207,173,105,.75);
}
.fx-cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; background: var(--fx-gold); }
.fx-cursor-on .fx-cursor, .fx-cursor-on .fx-cursor-dot { opacity: 1; }
.fx-cursor.is-hover {
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  background: rgba(207,173,105,.16);
  border-color: rgba(207,173,105,.35);
}
.fx-cursor.is-text { width: 4px; height: 28px; margin: -14px 0 0 -2px; border-radius: 2px; }
.fx-cursor.is-down { width: 26px; height: 26px; margin: -13px 0 0 -13px; }

/* ---------- Scroll progress ---------- */
#scroll-progress {
  height: 3px !important;
  background: linear-gradient(90deg, var(--fx-gold-deep), var(--fx-gold-light), var(--fx-gold)) !important;
  background-size: 200% 100% !important;
  box-shadow: 0 0 14px rgba(207,173,105,.7);
  animation: fxShimmerBg 3s linear infinite;
  transition: none !important;
}
@keyframes fxShimmerBg { to { background-position: -200% 0; } }

/* ---------- Loader ---------- */
#loading-screen { background: radial-gradient(circle at 50% 45%, #1d1a14, #0b0b0a 65%) !important; }
#loading-screen .loading-wheel { filter: drop-shadow(0 0 22px rgba(207,173,105,.45)); }
#loading-screen .loading-label {
  letter-spacing: .4em;
  text-transform: uppercase;
  font-size: .72rem;
  color: rgba(255,255,255,.6);
  animation: fxPulseText 1.4s ease-in-out infinite;
}
@keyframes fxPulseText { 50% { opacity: .35; } }

/* ---------- Navigation ---------- */
.navbar { transition: height .45s var(--fx-ease), background .45s, box-shadow .45s, transform .5s var(--fx-ease) !important; }
.navbar.fx-hidden { transform: translateY(-110%); }
.navbar.scrolled {
  background: rgba(11,11,10,.72) !important;
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(207,173,105,.18), 0 18px 40px rgba(0,0,0,.28) !important;
}
.nav-menu a:not(.btn-nav-book) { position: relative; }
.nav-menu a:not(.btn-nav-book) .fx-underline {
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 4px;
  height: 1.5px;
  background: var(--fx-gold);
  transition: left .4s var(--fx-ease), right .4s var(--fx-ease);
}
.nav-menu a:not(.btn-nav-book):hover .fx-underline,
.nav-menu a.active:not(.btn-nav-book) .fx-underline { left: 14px; right: 14px; }

/* ---------- Buttons: shine sweep + magnetic ---------- */
.btn, .btn-nav-book, .form-submit, .newsletter-row button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform .45s var(--fx-ease), background .3s, color .3s, box-shadow .4s, border-color .3s !important;
}
.btn::after, .btn-nav-book::after, .form-submit::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  z-index: -1;
  width: 70%;
  height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.55), transparent);
  transform: skewX(-20deg);
  transition: left .75s var(--fx-ease);
  pointer-events: none;
}
.btn:hover::after, .btn-nav-book:hover::after, .form-submit:hover::after { left: 150%; }
.btn-primary:hover, .btn-nav-book:hover, .form-submit:hover {
  box-shadow: 0 14px 34px -10px rgba(207,173,105,.75), 0 0 0 1px rgba(207,173,105,.4) !important;
}
.btn svg, .hero-text-link span { transition: transform .45s var(--fx-ease); }
.btn:hover svg, .hero-text-link:hover span { transform: translateX(4px); }
.btn-nav-book { animation: fxGlowPulse 3.2s ease-in-out infinite; }
@keyframes fxGlowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(207,173,105,0); }
  50% { box-shadow: 0 0 0 6px rgba(207,173,105,.16); }
}
.fx-magnetic { transition: translate .5s var(--fx-ease); }

/* ---------- Hero ---------- */
.hero-media { overflow: hidden; }
.hero-media img {
  animation: fxKenBurns 26s ease-in-out infinite alternate;
  will-change: scale, translate;
}
@keyframes fxKenBurns {
  from { scale: 1.02; }
  to { scale: 1.12; }
}
.hero-kicker > span:first-child {
  position: relative;
  overflow: hidden;
}
.hero.is-ready .hero-kicker > span:first-child { animation: fxDrawLine 1s var(--fx-ease) .15s both; transform-origin: left; }
@keyframes fxDrawLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hero.is-ready .hero-title span:first-child { animation: fxMaskUp 1.1s var(--fx-ease) .25s both !important; }
.hero.is-ready .hero-title span:last-child { animation: fxMaskUp 1.1s var(--fx-ease) .4s both !important; }
@keyframes fxMaskUp {
  from { clip-path: inset(0 0 100% 0); transform: translateY(40%); opacity: 0; }
  to { clip-path: inset(0 0 -10% 0); transform: none; opacity: 1; }
}
.hero-title span:last-child {
  background: linear-gradient(100deg, #fff 0%, #fff 40%, var(--fx-gold-light) 50%, #fff 60%, #fff 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 2px 18px rgba(0,0,0,.45));
}
.hero.is-ready .hero-title span:last-child { animation: fxMaskUp 1.1s var(--fx-ease) .4s both, fxTextSheen 6s ease-in-out 1.8s infinite !important; }
@keyframes fxTextSheen { 0%, 60% { background-position: 100% 0; } 100% { background-position: -150% 0; } }

.hero-action-dock {
  isolation: isolate;
  background: rgba(14,13,11,.55) !important;
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
}
.hero-action-dock::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  padding: 1px;
  border-radius: inherit;
  background: conic-gradient(from var(--fx-angle), transparent 0 70%, var(--fx-gold) 82%, transparent 92%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: fxSpin 6s linear infinite;
  pointer-events: none;
}
@keyframes fxSpin { to { --fx-angle: 360deg; } }

.hero-scroll-cue svg { animation: fxBob 1.8s ease-in-out infinite; }
@keyframes fxBob { 50% { transform: translateY(6px); } }

/* Sub-page heroes */
.page-hero-inner > * { will-change: transform; }
.fx-ready .page-hero-inner > * { animation: fxRiseIn 1s var(--fx-ease) both; }
.fx-ready .page-hero-inner > :nth-child(2) { animation-delay: .1s; }
.fx-ready .page-hero-inner > :nth-child(3) { animation-delay: .2s; }
.fx-ready .page-hero-inner > :nth-child(4) { animation-delay: .3s; }
.fx-ready .page-hero-inner > :nth-child(5) { animation-delay: .4s; }
@keyframes fxRiseIn {
  from { opacity: 0; transform: translateY(34px); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}
.page-hero h1 {
  background: linear-gradient(100deg, #fff 0%, #fff 42%, var(--fx-gold-light) 50%, #fff 58%, #fff 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fxRiseIn 1s var(--fx-ease) .1s both, fxTextSheen 7s ease-in-out 1.5s infinite !important;
}

/* ---------- Ambient orbs on dark sections ---------- */
.fx-orbs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.fx-orb {
  position: absolute;
  width: 42vmax;
  height: 42vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(207,173,105,.22), transparent 62%);
  filter: blur(10px);
  animation: fxFloat 18s ease-in-out infinite alternate;
}
.fx-orb:nth-child(1) { top: -30%; left: -12%; }
.fx-orb:nth-child(2) { bottom: -40%; right: -10%; animation-duration: 23s; animation-delay: -6s; background: radial-gradient(circle, rgba(236,215,166,.14), transparent 60%); }
@keyframes fxFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(8%, 6%) scale(1.12); }
  100% { transform: translate(-6%, 10%) scale(.94); }
}
.stats, .cta-band, .page-hero, footer { position: relative; }
.stats > .container, .cta-band > .container, footer > .container { position: relative; z-index: 1; }

/* ---------- Section headings ---------- */
.reveal-enabled .section-hd.rev h2,
.reveal-enabled .cta-band h2.rev {
  clip-path: inset(0 0 100% 0);
  transform: translateY(30px);
  transition: clip-path 1.1s var(--fx-ease) .1s, transform 1.1s var(--fx-ease) .1s;
}
.reveal-enabled .section-hd.rev.in h2,
.reveal-enabled .cta-band h2.rev.in { clip-path: inset(-10% 0 -10% 0); transform: none; }
.section-tag { position: relative; }
.reveal-enabled .section-hd.rev .section-tag { opacity: 0; transform: translateX(-14px); transition: opacity .8s var(--fx-ease), transform .8s var(--fx-ease); }
.reveal-enabled .section-hd.rev.in .section-tag { opacity: 1; transform: none; }
.reveal-enabled .section-hd.rev > p { opacity: 0; transform: translateY(16px); transition: opacity .9s var(--fx-ease) .3s, transform .9s var(--fx-ease) .3s; }
.reveal-enabled .section-hd.rev.in > p { opacity: 1; transform: none; }

/* ---------- Staggered reveals ---------- */
.reveal-enabled .rev, .reveal-enabled .rev-l, .reveal-enabled .rev-r {
  filter: blur(6px);
  transition: opacity 1s var(--fx-ease), transform 1s var(--fx-ease), filter 1s var(--fx-ease) !important;
}
.reveal-enabled .rev.in, .reveal-enabled .rev-l.in, .reveal-enabled .rev-r.in { filter: none; }
.fx-stagger > .rev:not([class*="delay-"]) { transition-delay: calc(var(--fx-i, 0) * 90ms) !important; }

.fx-js .fx-stagger > .fx-item {
  opacity: 0;
  translate: 0 36px;
  filter: blur(6px);
  transition: opacity 1s var(--fx-ease), translate 1s var(--fx-ease), filter 1s var(--fx-ease);
  transition-delay: calc(var(--fx-i, 0) * 90ms);
}
.fx-js .fx-stagger.fx-in > .fx-item { opacity: 1; translate: 0 0; filter: none; }

/* ---------- Interactive cards: tilt + spotlight ---------- */
.fx-card {
  position: relative;
  isolation: isolate;
  transform-style: preserve-3d;
  transition: transform .6s var(--fx-ease), box-shadow .6s var(--fx-ease), border-color .4s !important;
}
.fx-card:hover {
  box-shadow: 0 30px 60px -24px rgba(30,24,12,.35), 0 0 0 1px rgba(207,173,105,.45) !important;
  border-color: rgba(207,173,105,.55) !important;
}
.fx-spot {
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--fx-x, 50%) var(--fx-y, 50%), rgba(207,173,105,.2), transparent 45%);
  transition: opacity .5s;
}
.fx-card:hover .fx-spot { opacity: 1; }
.feat-icon, .course-icon, .value-icon, .info-icon, .contact-icon {
  transition: transform .6s var(--fx-spring), background .4s, color .4s, box-shadow .4s !important;
}
.fx-card:hover :is(.feat-icon, .course-icon, .value-icon, .info-icon, .contact-icon) {
  transform: translateZ(30px) rotate(-8deg) scale(1.1);
  box-shadow: 0 10px 24px -8px rgba(207,173,105,.8);
}
.fx-card:hover .course-price { color: var(--fx-gold-deep); }

/* ---------- Stats ---------- */
.stat-num {
  background: linear-gradient(180deg, #fff 30%, var(--fx-gold-light) 75%, var(--fx-gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 26px rgba(207,173,105,.25));
}
.stat-num * { -webkit-text-fill-color: transparent; }
.stat-item { transition: transform .6s var(--fx-ease), border-color .4s, background .4s; }
.stat-item:hover { transform: translateY(-6px); border-color: rgba(207,173,105,.5) !important; background: rgba(207,173,105,.06) !important; }

/* ---------- Ticker ---------- */
.road-ticker:hover .road-ticker-track { animation-play-state: paused; }

/* ---------- Testimonials & stories ---------- */
.test-track { transition: transform .9s var(--fx-ease) !important; }
.fx-js .test-slider.fx-in .stars svg { animation: fxStar .6s var(--fx-spring) both; }
.fx-js .test-slider .stars svg:nth-child(2) { animation-delay: .06s; }
.fx-js .test-slider .stars svg:nth-child(3) { animation-delay: .12s; }
.fx-js .test-slider .stars svg:nth-child(4) { animation-delay: .18s; }
.fx-js .test-slider .stars svg:nth-child(5) { animation-delay: .24s; }
@keyframes fxStar { from { transform: scale(0) rotate(-90deg); } to { transform: none; } }
.story-card img, .about-card img, .google-map-frame { transition: transform 1.2s var(--fx-ease), filter .8s; }
.story-card:hover img, .about-card:hover img { transform: scale(1.06); }
.test-dots .dot, .story-dots button { transition: width .5s var(--fx-ease), background .3s !important; }

/* ---------- Image reveal ---------- */
.fx-js .fx-img-reveal { clip-path: inset(8% 8% 8% 8% round 18px); transition: clip-path 1.4s var(--fx-ease); }
.fx-js .fx-img-reveal.fx-in { clip-path: inset(0 0 0 0 round 0); }

/* ---------- FAQ ---------- */
.faq-item { transition: border-color .4s, box-shadow .5s var(--fx-ease), transform .5s var(--fx-ease), background .4s !important; }
.faq-item:hover { transform: translateX(4px); border-color: rgba(207,173,105,.5) !important; }
.faq-item.open { box-shadow: 0 20px 44px -22px rgba(30,24,12,.35), inset 3px 0 0 var(--fx-gold) !important; }
.faq-a { transition: max-height .7s var(--fx-ease), padding .5s var(--fx-ease), opacity .5s !important; }
.faq-item:not(.open) .faq-a { opacity: 0; }
.faq-icon { transition: transform .55s var(--fx-spring), background .3s, color .3s !important; }

/* ---------- Forms & modal ---------- */
.form-input, .form-select, .form-textarea, .newsletter-row input {
  transition: border-color .35s, box-shadow .45s var(--fx-ease), background .35s, transform .35s !important;
}
.form-input:focus, .form-select:focus, .form-textarea:focus, .newsletter-row input:focus {
  border-color: var(--fx-gold) !important;
  box-shadow: 0 0 0 4px rgba(207,173,105,.18), 0 10px 26px -14px rgba(207,173,105,.6) !important;
}
.modal-overlay { transition: opacity .45s var(--fx-ease), visibility .45s !important; backdrop-filter: blur(10px); }
.modal-overlay .modal { transition: transform .7s var(--fx-spring), opacity .45s !important; transform: translateY(40px) scale(.94); opacity: 0; }
.modal-overlay.open .modal { transform: none; opacity: 1; }

/* ---------- Floating widgets ---------- */
.whatsapp-widget { transition: transform .5s var(--fx-spring), box-shadow .4s !important; }
.whatsapp-widget::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(37,211,102,.55);
  animation: fxRing 2.4s ease-out infinite;
  pointer-events: none;
}
.whatsapp-widget:hover { transform: translateY(-4px) scale(1.04); }
@keyframes fxRing { to { box-shadow: 0 0 0 16px rgba(37,211,102,0); } }

#back-to-top {
  background:
    conic-gradient(var(--fx-gold) calc(var(--fx-progress, 0) * 1turn), rgba(255,255,255,.12) 0) !important;
  transition: opacity .4s, transform .5s var(--fx-spring) !important;
}
#back-to-top::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background: #121210;
  z-index: 0;
}
#back-to-top svg { position: relative; z-index: 1; color: var(--fx-gold); }
#back-to-top:hover { transform: translateY(-4px) scale(1.06); }

/* ---------- Footer ---------- */
footer { overflow: hidden; }
footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--fx-gold), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: fxScan 6s linear infinite;
  z-index: 2;
}
@keyframes fxScan { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.foot-links a, .foot-legal a { background: linear-gradient(var(--fx-gold), var(--fx-gold)) 0 100% / 0 1px no-repeat; transition: background-size .45s var(--fx-ease), color .3s, transform .3s !important; }
.foot-links a:hover, .foot-legal a:hover { background-size: 100% 1px; }
.social-btn { transition: transform .5s var(--fx-spring), background .3s, color .3s, border-color .3s !important; }
.social-btn:hover { transform: translateY(-4px) rotate(-6deg); }

/* ---------- Reduced motion & touch ---------- */
@media (hover: none) {
  .fx-cursor, .fx-cursor-dot { display: none; }
}
@media (max-width: 900px) {
  .fx-grain { display: none; }
  .fx-orb { width: 70vmax; height: 70vmax; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-grain, .fx-cursor, .fx-cursor-dot, .fx-curtain, .fx-orbs { display: none !important; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .fx-js .fx-stagger > .fx-item, .fx-js .fx-img-reveal { opacity: 1; translate: none; filter: none; clip-path: none; }
}
