/* =======================================================
   NEXILENSE THEME v1.1.0 — enhancements
   Loaded after main.css. Accessibility, reduced motion,
   no-JS safety, hero video, mobile menu and small fixes.
   ======================================================= */

/* Content must never stay invisible: reveal animations only run when JS is available. */
html:not(.js) .sr, html:not(.js) .sr-l, html:not(.js) .sr-r { opacity: 1 !important; transform: none !important; }

/* Skip link + visible keyboard focus */
.skip-link { position: fixed; left: 1rem; top: -100px; z-index: 30000; padding: .7rem 1.1rem; border-radius: 10px; background: var(--electric); color: #00131f; font-weight: 700; transition: top .2s; }
.skip-link:focus { top: 1rem; }
main#main:focus { outline: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--electric); outline-offset: 3px; border-radius: 6px;
}

/* Desktop dropdown also opens for keyboard users */
.has-dropdown:focus-within .dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.has-dropdown:focus-within .dd-arrow { transform: rotate(180deg); }

/* Mobile menu */
.mob-nav[hidden] { display: none !important; }
.mob-nav { max-height: calc(100vh - var(--nav-h)); overflow-y: auto; overscroll-behavior: contain; }
.mob-nav a { min-height: 44px; display: flex; align-items: center; }
.mob-nav a.mob-sub { padding-left: 1.1rem; font-size: .84rem; color: var(--white-30); }
.mob-nav a[aria-current="page"] { color: var(--electric); }
.ham-btn { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
.ham-btn.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.ham-btn.is-open span:nth-child(2) { opacity: 0; }
.ham-btn.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Hero background video */
#hero .hero-media { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
#hero .hero-poster, #hero .hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#hero .hero-video { opacity: 0; transition: opacity .8s ease; }
#hero .hero-video.is-playing { opacity: 1; }
#hero .hero-overlay { position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(2,4,9,calc(var(--hero-overlay, .7) + .1)) 0%, rgba(2,4,9,var(--hero-overlay, .7)) 55%, rgba(2,4,9,calc(var(--hero-overlay, .7) - .15)) 100%),
              linear-gradient(0deg, var(--ink) 0%, transparent 30%); }
#hero.has-hero-video .hero-dots { opacity: .35; }
#hero .hero-inner, #hero .hero-kpis, #hero .scroll-cue { position: relative; z-index: 1; }
[data-theme="light"] #hero .hero-overlay { background: linear-gradient(90deg, rgba(244,246,255,.92) 0%, rgba(244,246,255,.8) 60%, rgba(244,246,255,.6) 100%); }

/* Honeypot fields (bots fill them, people never see them) */
.nx-hp { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; opacity: 0 !important; }

/* Breadcrumb on service pages */
.svc-hero .post-breadcrumb { text-align: center; }
.post-breadcrumb a { color: var(--white-60); }
.post-breadcrumb a:hover { color: var(--electric); }

/* Form fields: clear error state */
[aria-invalid="true"] { border-color: var(--ember) !important; box-shadow: 0 0 0 3px var(--ember-dim) !important; }

/* Comfortable tap targets and no sideways scrolling on small screens */
@media (max-width: 768px) {
  .btn-primary, .btn-outline, .btn-px, .bc-filter, .nl-submit { min-height: 44px; }
  .hero-actions { flex-wrap: wrap; }
  .sv-card, .t-card, .rs-card, .px-card { transform: none !important; }
  img, video, iframe { max-width: 100%; }
  .whatsapp-btn { bottom: 1.25rem; right: 1.25rem; }
}

/* Respect "reduce motion": no animated backgrounds, parallax, ticker or reveal motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  #nx-canvas, #cursor-follower, #scanline { display: none !important; }
  .sr, .sr-l, .sr-r { opacity: 1 !important; transform: none !important; }
  .ticker-track { animation: none !important; }
  .hero-kpis { animation: none !important; opacity: 1 !important; }
}

/* Print: hide decoration */
@media print {
  #nx-canvas, #cursor-follower, #scanline, #scroll-prog, .whatsapp-btn, #nav, .mob-nav, .newsletter-section { display: none !important; }
}

/* ── Screen-reader-only text ─────────────────────────────── */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ── Hero video panel (right side on desktop, stacked on phones) ── */
#hero.hero-video-panel .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(360px, 520px); }
.hero-vpanel { margin: 0; position: relative; animation: hudIn 1.2s 2.2s var(--ease-expo, ease) both; }
.hvp-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; background: var(--ink-2, #0B0F1E);
  border: 1px solid var(--border, rgba(255,255,255,.07)); box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 0 1px rgba(0,204,255,.08), 0 0 60px rgba(139,92,246,.18); }
.hvp-poster, .hvp-video, .hvp-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.hvp-video { opacity: 0; transition: opacity .6s ease; }
.hero-vpanel.is-started .hvp-video { opacity: 1; }
.hero-vpanel.is-started .hvp-poster { visibility: hidden; }
.hvp-start { position: absolute; inset: 0; display: grid; place-items: center; width: 100%; height: 100%; background: linear-gradient(180deg, rgba(2,4,9,0) 40%, rgba(2,4,9,.45)); border: 0; cursor: pointer; padding: 0; }
.hvp-start-ico { width: 76px; height: 76px; border-radius: 50%; background: linear-gradient(135deg, var(--plasma, #8B5CF6), var(--electric, #00CCFF)); box-shadow: 0 0 40px rgba(0,204,255,.45); position: relative; transition: transform .25s ease; }
.hvp-start-ico::after { content: ""; position: absolute; left: 31px; top: 24px; border-style: solid; border-width: 14px 0 14px 22px; border-color: transparent transparent transparent #fff; }
.hvp-start:hover .hvp-start-ico, .hvp-start:focus-visible .hvp-start-ico { transform: scale(1.08); }
.hero-vpanel.is-started .hvp-start { display: none; }
.hvp-controls { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 8px; z-index: 2; }
.hvp-btn, .hero-bg-toggle { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(2,4,9,.65); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 0; }
.hvp-btn:hover, .hero-bg-toggle:hover { background: rgba(2,4,9,.85); border-color: var(--electric, #00CCFF); }
.ico-pause, .ico-play, .ico-sound-off, .ico-sound-on { display: block; width: 16px; height: 16px; position: relative; }
.ico-pause::before, .ico-pause::after { content: ""; position: absolute; top: 1px; width: 5px; height: 14px; background: currentColor; border-radius: 1px; }
.ico-pause::before { left: 2px; } .ico-pause::after { right: 2px; }
.ico-play::before { content: ""; position: absolute; left: 4px; top: 1px; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent currentColor; }
.ico-sound-off::before, .ico-sound-on::before { content: ""; position: absolute; left: 0; top: 4px; width: 6px; height: 8px; background: currentColor; clip-path: polygon(0 25%, 45% 25%, 100% 0, 100% 100%, 45% 75%, 0 75%); width: 10px; }
.ico-sound-off::after { content: "×"; position: absolute; right: -2px; top: -4px; font: 700 14px/1 system-ui, sans-serif; }
.ico-sound-on::after { content: ""; position: absolute; right: 0; top: 3px; width: 5px; height: 10px; border: 2px solid currentColor; border-left: 0; border-radius: 0 10px 10px 0; }
.hvp-caption { margin-top: .9rem; font-size: .85rem; color: var(--white-60, rgba(255,255,255,.6)); text-align: center; }
#hero > .hero-bg-toggle { position: absolute; left: 20px; bottom: 20px; z-index: 3; }
#hero .hero-media { pointer-events: none; }
@media (max-width: 1200px) {
  #hero.hero-video-panel .hero-inner { grid-template-columns: 1fr; }
  #hero.hero-video-panel .hero-vpanel { max-width: 640px; width: 100%; margin: 0 auto 2.5rem; animation: none; }
}
@media (max-width: 480px) {
  .hvp-frame { border-radius: 14px; }
  .hvp-start-ico { width: 64px; height: 64px; }
  .hvp-start-ico::after { left: 26px; top: 20px; border-width: 12px 0 12px 19px; }
}
[data-theme="light"] .hvp-frame { box-shadow: 0 20px 60px rgba(20,30,80,.18); }
@media (prefers-reduced-motion: reduce) { .hero-vpanel { animation: none; } .hvp-video { transition: none; } }
.hvp-controls[hidden], .hero-bg-toggle[hidden], .hvp-start[hidden] { display: none !important; }
