/* ==========================================================================
   Averra Security — sections.css
   Page sections in story order. Scroll-driven values arrive as CSS custom
   properties (--p, --wipe, --x) set by js/main.js.
   ========================================================================== */

/* ---- Header ---------------------------------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  transition: background-color var(--t-med) var(--ease), border-color var(--t-med) var(--ease),
              backdrop-filter var(--t-med) var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled {
  background: rgba(10,15,20,.72);
  border-color: var(--line);
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
}
.nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { height: 34px; width: auto; }
.nav__links { display: flex; gap: 6px; }
.nav__links a {
  padding: 10px 14px; border-radius: 999px; font-size: .92rem; font-weight: 600; color: var(--fg-2);
  transition: color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.nav__links a:hover { color: var(--fg); background: rgba(148,163,184,.08); }
.nav__cta { display: flex; align-items: center; gap: 10px; }
.lang {
  min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  font-size: .85rem; font-weight: 700; color: var(--fg-2);
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.lang:hover { color: var(--green-soft); border-color: var(--green); }
.lang--menu { align-self: flex-start; margin-top: 12px; }
.nav__burger { display: none; width: 44px; height: 44px; border-radius: 12px; place-items: center; }
.nav__burger span { display: block; width: 20px; height: 2px; background: var(--fg); margin: 5px 0; transition: transform var(--t-med) var(--ease), opacity var(--t-fast); }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: var(--header-h) 0 auto 0; z-index: 99;
  padding: 12px var(--gutter) 24px; display: none; flex-direction: column; gap: 4px;
  background: rgba(10,15,20,.96); border-bottom: 1px solid var(--line);
  transform: translateY(-8px); opacity: 0;
  transition: transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease);
}
.mobile-menu a { padding: 14px 6px; font-weight: 600; border-bottom: 1px solid var(--line); }
.mobile-menu.is-open { transform: none; opacity: 1; }

/* ---- Hero: sticky command centre --------------------------------- */
.hero { position: relative; height: 340vh; }
.hero__stage {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  display: grid; grid-template-rows: auto minmax(0, 1fr); align-items: start;
  padding-top: calc(var(--header-h) + 3vh);
}
.hero__glow {
  position: absolute; inset: -20% -10% auto -10%; height: 70%; pointer-events: none;
  background: radial-gradient(50% 50% at 50% 40%, rgba(63,211,122,.14), transparent 70%);
  filter: blur(20px);
}
.hero__copy {
  position: relative; z-index: 2; text-align: center; margin-inline: auto;
  max-width: 62rem; padding-inline: var(--gutter);
  opacity: var(--copy-o, 1);
  transform: translate3d(0, calc(var(--copy-y, 0) * 1px), 0);
  will-change: opacity, transform;
}
.hero__title {
  font-size: var(--fs-hero); font-weight: 800; line-height: .98; letter-spacing: -0.04em;
  text-wrap: balance;
}
.hero__title .line { display: block; }
@media (min-width: 761px) { .hero__title .line { white-space: nowrap; } }
.hero__sub { margin: 1.4rem auto 0; max-width: 34em; font-size: var(--fs-lead); color: var(--fg-2); }
.hero__cta { display: flex; justify-content: center; gap: 12px; margin-top: 2rem; flex-wrap: wrap; }

/* Intro sequence — the one orchestrated page-load moment */
.hero__title .line, .hero__sub, .hero__cta { opacity: 0; transform: translateY(18px); filter: blur(8px); }
.is-ready .hero__title .line { animation: intro 1.1s var(--ease) forwards; }
.is-ready .hero__title .line:nth-child(2) { animation-delay: .12s; }
.is-ready .hero__sub { animation: intro 1.1s var(--ease) .3s forwards; }
.is-ready .hero__cta { animation: intro 1.1s var(--ease) .42s forwards; }
@keyframes intro { to { opacity: 1; transform: none; filter: blur(0); } }

.cc-wrap {
  position: relative; z-index: 1; height: 100%; min-height: 0; display: grid; place-items: center;
  perspective: 1600px; padding: 3vh var(--gutter) 2vh;
}
.cc {
  position: relative;
  width: min(1180px, 100%);
  aspect-ratio: 16 / 9.4;
  max-height: 100%;
  /* js/main.js fits the panel to the available height so it never clips */
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, #0F1720, #0B1219);
  border: 1px solid var(--line-strong);
  box-shadow: 0 60px 120px -50px rgba(0,0,0,.9), 0 0 0 1px rgba(63,211,122,.05), 0 30px 90px -40px rgba(63,211,122,.25);
  transform: translate3d(0, calc(var(--cc-y, 0) * 1px), 0) rotateX(calc(var(--cc-rx, 8) * 1deg)) scale(var(--cc-s, .94));
  transform-origin: 50% 30%;
  will-change: transform;
  opacity: 0;
}
.is-ready .cc { animation: ccIn 1.4s var(--ease) .25s forwards; }
@keyframes ccIn { from { opacity: 0; transform: translate3d(0, 60px, 0) rotateX(14deg) scale(.9); } to { opacity: 1; } }
.cc__bar {
  height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 18px; border-bottom: 1px solid var(--line);
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: .06em; color: var(--fg-2);
}
.cc__bar b { color: var(--fg); }
.cc__bar .grp { display: inline-flex; align-items: center; gap: 14px; }
.cc__body { position: absolute; inset: 44px 0 0 0; padding: 12px; }

/* Tiles are absolutely positioned so layout states can be tweened */
.tile {
  position: absolute; transition: inset var(--t-slow) var(--ease-io), opacity var(--t-med) var(--ease), transform var(--t-slow) var(--ease-io);
  will-change: inset, opacity;
}
.tile--c1 { inset: 12px calc(50% + 6px) calc(50% + 6px) 12px; }
.tile--c2 { inset: 12px 12px calc(50% + 6px) calc(50% + 6px); }
.tile--c3 { inset: calc(50% + 6px) calc(50% + 6px) 12px 12px; }
.tile--st { inset: calc(50% + 6px) 12px 12px calc(50% + 6px); }
.tile .feed { position: absolute; inset: 0; aspect-ratio: auto; border-radius: var(--r-md); }
.cc__status { position: absolute; inset: 0; padding: 16px 18px; border-radius: var(--r-md); background: var(--bg-3); border: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.cc__status .stat__val { font-size: clamp(1.2rem, 2vw, 1.9rem); }

/* Stage 1: CAM 02 takes the whole body */
.cc[data-stage="1"] .tile--c2, .cc[data-stage="2"] .tile--c2 { inset: 12px; }
.cc[data-stage="1"] .tile--c1, .cc[data-stage="1"] .tile--c3, .cc[data-stage="1"] .tile--st,
.cc[data-stage="2"] .tile--c1, .cc[data-stage="2"] .tile--c3, .cc[data-stage="2"] .tile--st,
.cc[data-stage="3"] .tile--c1, .cc[data-stage="3"] .tile--c3, .cc[data-stage="3"] .tile--st { opacity: 0; transform: scale(.96); pointer-events: none; }
/* Zoom of the scene inside CAM 02 */
.tile--c2 .scene, .tile--c2 .fig, .tile--c2 .det, .tile--c2 .zone { transition: transform var(--t-slow) var(--ease-io); }
.cc[data-stage="1"] .tile--c2 .feed > .scene-zoom, .cc[data-stage="2"] .tile--c2 .feed > .scene-zoom { transform: scale(1.16) translateY(2%); }
.scene-zoom { position: absolute; inset: 0; transform-origin: 62% 70%; transition: transform var(--t-slow) var(--ease-io); will-change: transform; }
/* Stage 2: detection */
.cc[data-stage="2"] .tile--c2 .det, .cc[data-stage="3"] .tile--c2 .det { opacity: 1; transform: scale(1); }
.cc[data-stage="2"] .tile--c2 .det .det__scan::after { animation: scan 900ms var(--ease) 1 forwards; }
.cc[data-stage="2"] .tile--c2 .meta, .cc[data-stage="3"] .tile--c2 .meta { opacity: 1; transform: none; }
/* Stage 3: dashboard panel joins */
.tile--dash { inset: 12px 12px 12px 100%; opacity: 0; }
.cc[data-stage="3"] .tile--c2 { inset: 12px calc(36% + 6px) 12px 12px; }
.cc[data-stage="3"] .tile--dash { inset: 12px 12px 12px calc(64% + 6px); opacity: 1; }
.cc__dash { position: absolute; inset: 0; border-radius: var(--r-md); background: var(--bg-3); border: 1px solid var(--line); padding: 16px 18px; display: grid; align-content: start; gap: 14px; overflow: hidden; }
.cc__dash h3 { font-size: var(--fs-small); font-weight: 700; color: var(--fg-2); }
.cc__dash .risk { margin-top: 6px; }
.cc__dash .evt { padding: 8px 0; }

.hero__hint {
  position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-micro); color: var(--fg-3);
  opacity: var(--copy-o, 1);
}
.hero__hint i { width: 1px; height: 26px; background: linear-gradient(180deg, var(--green), transparent); animation: hint 1.8s var(--ease-io) infinite; }
@keyframes hint { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* ---- See what others miss: raw → AI wipe ------------------------- */
.miss { position: relative; height: 240vh; }
.miss__stage { position: sticky; top: 0; height: 100vh; height: 100svh; display: grid; align-items: center; padding-top: var(--header-h); }
.miss__grid { display: grid; grid-template-columns: 1.45fr .8fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.miss__feed { aspect-ratio: 16 / 9.6; border-radius: var(--r-lg); }
.miss__raw { position: absolute; inset: 0; filter: saturate(.15) contrast(1.05) brightness(.8); }
.miss__raw::after { /* video noise */
  content: ""; position: absolute; inset: 0; opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='120' height='120' filter='url(%23n)' opacity='.55'/></svg>");
}
.miss__ai { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--wipe, 0%)) 0 0); will-change: clip-path; }
.miss__ai .det, .miss__ai .zone, .miss__ai .trail { opacity: 1; transform: none; }
.miss__edge { position: absolute; top: 0; bottom: 0; left: var(--wipe, 0%); width: 2px; background: var(--green); box-shadow: 0 0 18px 2px rgba(63,211,122,.6); z-index: 6; transform: translateX(-1px); }
.miss__lbl { position: absolute; z-index: 7; bottom: 12px; padding: 5px 9px; border-radius: 6px; font-size: var(--fs-micro); font-weight: 800; letter-spacing: .06em; background: rgba(10,15,20,.75); border: 1px solid var(--line); }
.miss__lbl--raw { left: 12px; color: var(--fg-2); }
.miss__lbl--ai { right: 12px; color: var(--green); border-color: rgba(63,211,122,.35); }
.miss__side { display: grid; gap: 1.6rem; }
.miss__list { display: grid; gap: 8px; }
.miss__item {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(15,23,32,.6);
  opacity: .28; transform: translateX(10px); transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.miss__item.is-on { opacity: 1; transform: none; border-color: rgba(63,211,122,.35); }
.miss__item .ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(63,211,122,.1); color: var(--green); }
.miss__item b { display: block; font-size: .95rem; }
.miss__item small { color: var(--fg-2); font-size: var(--fs-small); }
.miss__item .val { font-size: var(--fs-small); color: var(--fg-2); font-variant-numeric: tabular-nums; }
.miss__item.is-on .val { color: var(--green); }
.miss__flow { display: flex; align-items: center; gap: 10px; font-size: var(--fs-small); color: var(--fg-2); font-weight: 600; }
.miss__flow em { font-style: normal; color: var(--fg); }
.miss__flow svg { width: 16px; height: 16px; color: var(--green); }

/* ---- From video to intelligence: particle pipeline ---------------- */
.pipe { overflow: hidden; }
.pipe__head { text-align: center; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.pipe__head .lead { margin-inline: auto; }
.pipe__stage { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: clamp(1rem, 3vw, 2.5rem); align-items: center; }
.pipe__canvas { position: absolute; inset: -10% 0; width: 100%; height: 120%; pointer-events: none; z-index: 2; }
.pipe__col { position: relative; z-index: 1; }
.pipe__col h3 { margin-top: 1.1rem; font-size: 1.05rem; font-weight: 700; }
.pipe__col p { color: var(--fg-2); font-size: var(--fs-small); margin-top: .35rem; max-width: 30em; }
.pipe__core {
  aspect-ratio: 1; max-width: 240px; margin-inline: auto; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: radial-gradient(circle at 50% 50%, rgba(63,211,122,.18), rgba(63,211,122,.02) 60%, transparent 70%);
}
.pipe__core::before, .pipe__core::after {
  content: ""; position: absolute; inset: 14%; border-radius: 50%; border: 1px solid rgba(63,211,122,.35);
  animation: ring 3.6s var(--ease-io) infinite;
}
.pipe__core::after { inset: 28%; animation-delay: -1.8s; }
@keyframes ring { 0%, 100% { transform: scale(1); opacity: .5; } 50% { transform: scale(1.06); opacity: 1; } }
.pipe__core img { width: 38%; height: auto; filter: drop-shadow(0 8px 24px rgba(63,211,122,.4)); }
.pipe__core .core-lbl { position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%); font-size: var(--fs-micro); font-weight: 800; letter-spacing: .08em; color: var(--green); white-space: nowrap; }
.pipe__dash { padding: 16px; display: grid; gap: 12px; }
.pipe__dash .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pipe__dash .stat__val { font-size: 1.5rem; }
.pipe__step { position: absolute; top: -34px; left: 0; font-size: var(--fs-small); font-weight: 700; color: var(--green); }

/* ---- Features: interactive dashboard ------------------------------ */
.fx__grid > *, .miss__grid > *, .map__grid > *, .alert__grid > * { min-width: 0; }
.fx__grid { display: grid; grid-template-columns: .9fr 1.5fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.fx__list { display: grid; gap: 4px; margin-top: 2rem; }
.fx__btn {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; text-align: left;
  padding: 16px 18px; border-radius: var(--r-md); border: 1px solid transparent;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.fx__btn b { display: block; font-size: 1.05rem; font-weight: 700; }
.fx__btn small { display: block; color: var(--fg-2); font-size: var(--fs-small); margin-top: 2px; max-height: 0; overflow: hidden; opacity: 0; transition: max-height var(--t-med) var(--ease), opacity var(--t-med) var(--ease); }
.fx__btn .prog { width: 3px; height: 36px; border-radius: 2px; background: var(--line); overflow: hidden; }
.fx__btn .prog i { display: block; width: 100%; height: 100%; background: var(--grad); transform: scaleY(0); transform-origin: top; }
.fx__btn[aria-selected="true"] { background: rgba(15,23,32,.9); border-color: var(--line-strong); }
.fx__btn[aria-selected="true"] small { max-height: 60px; opacity: 1; }
.fx__btn[aria-selected="true"] .prog i { animation: prog var(--cycle, 4.2s) linear forwards; }
.fx.is-paused .fx__btn .prog i { animation-play-state: paused; }
@keyframes prog { to { transform: scaleY(1); } }
.fx__btn:hover { background: rgba(15,23,32,.6); }

.fx__view { position: relative; aspect-ratio: 16 / 10.5; border-radius: var(--r-lg); }
.fx__cam { position: absolute; inset: 52px 30% 16px 16px; border-radius: var(--r-md); transition: inset var(--t-slow) var(--ease-io); }
.fx__side { position: absolute; inset: 52px 16px 16px calc(70% + 12px); display: grid; align-content: start; gap: 10px; transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease); }
.fx__side .panel { padding: 12px; }
.fx__side .stat__val { font-size: 1.3rem; }
.fx__layer { position: absolute; inset: 0; opacity: 0; transition: opacity var(--t-med) var(--ease); pointer-events: none; }
.fx[data-mode="detect"]   .fx__layer--detect,
.fx[data-mode="alerts"]   .fx__layer--alerts,
.fx[data-mode="behavior"] .fx__layer--behavior,
.fx[data-mode="monitor"]  .fx__layer--monitor,
.fx[data-mode="events"]   .fx__layer--events,
.fx[data-mode="central"]  .fx__layer--central { opacity: 1; }
.fx[data-mode="detect"] .fx__layer--detect .det, .fx[data-mode="behavior"] .fx__layer--behavior .trail,
.fx[data-mode="monitor"] .fx__layer--monitor .zone { opacity: 1; transform: none; }
.fx[data-mode="detect"] .fx__layer--detect .det .det__scan::after { animation: scan 900ms var(--ease) 1 forwards; }
.fx__toast { position: absolute; top: 14px; right: 14px; width: min(300px, 60%); transform: translateY(-12px); opacity: 0; transition: transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease); }
.fx[data-mode="alerts"] .fx__toast { transform: none; opacity: 1; }
.fx__timeline { position: absolute; left: 12px; right: 12px; bottom: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(10,15,20,.8); border: 1px solid var(--line); }
.fx__timeline .tl { position: relative; height: 6px; border-radius: 3px; background: rgba(148,163,184,.15); margin-top: 8px; }
.fx__timeline .tl i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--green); left: var(--l); width: var(--w); }
.fx__timeline .tl i.warn { background: var(--amber); }
.fx__timeline small { font-size: var(--fs-micro); color: var(--fg-2); font-weight: 700; letter-spacing: .04em; }
.fx__evts { position: absolute; left: 12px; bottom: 12px; display: grid; gap: 6px; }
.fx__chip { padding: 6px 10px; border-radius: 6px; font-size: var(--fs-micro); font-weight: 700; background: rgba(10,15,20,.85); border: 1px solid var(--line); color: var(--fg); display: inline-flex; gap: 8px; align-items: center; transform: translateX(-10px); opacity: 0; transition: transform var(--t-med) var(--ease), opacity var(--t-med) var(--ease); }
.fx[data-mode="events"] .fx__chip { transform: none; opacity: 1; }
.fx[data-mode="events"] .fx__chip:nth-child(2) { transition-delay: 120ms; }
.fx[data-mode="events"] .fx__chip:nth-child(3) { transition-delay: 240ms; }
.fx__chip .dot { width: 6px; height: 6px; animation: none; box-shadow: none; }
/* Central: camera grid replaces the single feed */
.fx[data-mode="central"] .fx__cam { inset: 52px 30% 16px 16px; }
.fx__central { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; padding: 8px; background: var(--bg-2); border-radius: var(--r-md); }
.fx__central .feed { aspect-ratio: auto; }
.fx__central svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fx__central svg line { stroke: var(--green); stroke-width: 1.5; stroke-dasharray: 6 8; animation: dashmove 1.4s linear infinite; }
.fx__central svg circle { fill: var(--bg-2); stroke: var(--green); stroke-width: 2; }
@keyframes dashmove { to { stroke-dashoffset: -28; } }
.fx__hud { position: absolute; top: 14px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-micro); font-weight: 700; letter-spacing: .05em; color: var(--fg-2); }
.fx__hud b { color: var(--fg); }

/* ---- Security map ---------------------------------------------------- */
.map__grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.map__sites { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.6rem; }
.map__sites span { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: var(--fs-small); color: var(--fg-2); }
.map__log { margin-top: 1.6rem; }
.map__log .evt { font-size: var(--fs-small); }
.map__log .evt.is-new { animation: rowIn var(--t-med) var(--ease); }
@keyframes rowIn { from { opacity: 0; transform: translateY(-6px); } }
.map__view { position: relative; aspect-ratio: 1.15; border-radius: var(--r-lg); padding: 0; }
.map__view svg { width: 100%; height: 100%; }
.map__view .wall { fill: rgba(148,163,184,.04); stroke: rgba(148,163,184,.35); stroke-width: 1.2; }
.map__view .room { fill: rgba(148,163,184,.03); stroke: rgba(148,163,184,.18); stroke-width: 1; }
.map__view .link { fill: none; stroke: rgba(63,211,122,.35); stroke-width: 1.2; stroke-dasharray: 3 7; animation: dashmove 1.6s linear infinite; }
.map__view .cam { fill: var(--bg-2); stroke: var(--green); stroke-width: 2; transition: stroke var(--t-fast), fill var(--t-fast); }
.map__view .cam.is-alert { stroke: var(--red); fill: rgba(248,113,113,.2); }
.map__view .halo { fill: none; stroke: var(--red); stroke-width: 1.5; opacity: 0; }
.map__view .cam.is-alert + .halo { animation: halo 1.4s var(--ease) infinite; }
@keyframes halo { 0% { r: 8; opacity: .9; } 100% { r: 26; opacity: 0; } }
.map__view .lbl { fill: var(--fg-2); font-size: 10px; font-weight: 700; letter-spacing: .06em; font-family: var(--font); }
.map__view .hub { fill: rgba(63,211,122,.1); stroke: var(--green); stroke-width: 1.5; }
.map__view .hub-lbl { fill: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .1em; font-family: var(--font); }
.map__view .packet { fill: var(--red); filter: drop-shadow(0 0 6px rgba(248,113,113,.8)); opacity: 0; }
.map__view .zone-r { fill: rgba(248,113,113,.06); stroke: rgba(248,113,113,.45); stroke-dasharray: 4 4; }
.map__view .fov { fill: rgba(63,211,122,.07); }

/* ---- Alert experience ------------------------------------------------ */
.alert__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.steps { display: grid; gap: 0; margin-top: 2rem; position: relative; }
.steps::before { content: ""; position: absolute; left: 15px; top: 16px; bottom: 16px; width: 2px; background: var(--line); }
.step { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 16px; padding: 12px 0; opacity: .38; transition: opacity var(--t-med) var(--ease); }
.step__n { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); border: 2px solid var(--line-strong); font-size: var(--fs-micro); font-weight: 800; z-index: 1; transition: border-color var(--t-med), background-color var(--t-med), color var(--t-med); }
.step b { display: block; font-weight: 700; }
.step small { color: var(--fg-2); font-size: var(--fs-small); }
.step .lat { font-variant-numeric: tabular-nums; font-size: var(--fs-micro); color: var(--fg-3); margin-left: 8px; }
.step.is-on { opacity: 1; }
.step.is-on .step__n { border-color: var(--green); background: var(--green); color: var(--green-ink); }

.alert-card { position: relative; border-radius: var(--r-lg); padding: 0; overflow: hidden; transform: translateY(24px) scale(.98); opacity: 0; transition: transform var(--t-slow) var(--ease), opacity var(--t-slow) var(--ease); }
.alert-card.is-on { transform: none; opacity: 1; }
.alert-card__top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: var(--fs-micro); font-weight: 800; letter-spacing: .08em; }
.alert-card__top .live { display: inline-flex; align-items: center; gap: 8px; color: var(--red); }
.prio { padding: 4px 9px; border-radius: 5px; background: rgba(248,113,113,.14); color: var(--red); }
.alert-card__feed { margin: 14px 18px 0; aspect-ratio: 16 / 8; }
.alert-card__body { padding: 16px 18px 18px; display: grid; gap: 14px; }
.alert-card__title { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.alert-card__meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; font-size: var(--fs-small); color: var(--fg-2); }
.alert-card__meta b { display: block; color: var(--fg); font-variant-numeric: tabular-nums; }
.alert-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.alert-card__ack { display: none; align-items: center; gap: 8px; color: var(--green); font-weight: 700; font-size: var(--fs-small); }
.alert-card.is-acked .alert-card__ack { display: inline-flex; }
.alert-card.is-acked .live { color: var(--green); }
.alert-card.is-acked .prio { background: rgba(63,211,122,.14); color: var(--green); }
.alert-card.is-acked .alert-card__actions .btn--primary { display: none; }

/* ---- Human + AI ------------------------------------------------------ */
.human { text-align: center; overflow: hidden; }
.human__title { font-size: clamp(2.4rem, 7vw, 6rem); font-weight: 800; letter-spacing: -.045em; line-height: .96; }
.human__title span { display: block; }
.human__title span:last-child { color: var(--green); }
.human__lead { margin: 1.5rem auto 0; max-width: 40em; }
.human__viz { position: relative; margin: clamp(3rem, 6vw, 5rem) auto 0; max-width: 980px; display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: 14px; align-items: center; }
.human__grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.human__grid i { aspect-ratio: 1; border-radius: 2px; background: rgba(148,163,184,.18); transition: background-color var(--t-slow) var(--ease), opacity var(--t-slow) var(--ease); }
.human__grid--noise i { animation: flicker 3s linear infinite; animation-delay: calc(var(--d) * 1s); }
@keyframes flicker { 0%, 100% { opacity: .35; } 50% { opacity: .9; } }
.human__grid--filter i { opacity: .12; }
.human__grid--filter i.keep { opacity: 1; background: rgba(63,211,122,.55); }
.human__grid--focus i { opacity: 0; }
.human__grid--focus i.keep { opacity: 1; background: var(--green); box-shadow: 0 0 14px rgba(63,211,122,.6); }
.human__cap { margin-top: 12px; font-size: var(--fs-small); color: var(--fg-2); font-weight: 600; }
.human__arrow { width: 28px; height: 28px; color: var(--green); }

/* ---- Use cases: horizontal sticky ---------------------------------- */
.uc { position: relative; height: calc(100vh * 4); }
.uc__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: grid; align-content: center; padding-top: var(--header-h); }
.uc__head { margin-bottom: 1.8rem; display: flex; justify-content: space-between; align-items: end; gap: 2rem; }
.uc__prog { display: flex; gap: 6px; }
.uc__prog i { width: 26px; height: 3px; border-radius: 2px; background: var(--line-strong); }
.uc__prog i.is-on { background: var(--green); }
.uc__track { display: flex; gap: clamp(1rem, 2vw, 1.6rem); padding-left: var(--gutter); will-change: transform; transform: translate3d(calc(var(--x, 0) * 1px), 0, 0); }
.uc__card { flex: 0 0 min(760px, 78vw); border-radius: var(--r-xl); padding: clamp(1.2rem, 2.4vw, 2rem); display: grid; grid-template-columns: 1.2fr .8fr; gap: 1.4rem; align-items: center; }
.uc__card .feed { aspect-ratio: 16 / 10; }
.uc__card h3 { font-size: clamp(1.5rem, 2.6vw, 2.2rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.uc__card p { color: var(--fg-2); margin-top: .8rem; font-size: .95rem; }
.uc__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 1.1rem; }
.uc__tags span { font-size: var(--fs-micro); font-weight: 700; padding: 6px 10px; border-radius: 6px; background: rgba(63,211,122,.1); color: var(--green); border: 1px solid rgba(63,211,122,.2); }
.uc__card .det { opacity: 1; transform: none; }
.uc__card .zone { opacity: 1; }

/* ---- Dashboard --------------------------------------------------------- */
.dash__panel { border-radius: var(--r-xl); }
.dash__stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.dash__stats .stat { padding: 22px 24px; border-right: 1px solid var(--line); }
.dash__stats .stat:last-child { border-right: 0; }
.dash__body { display: grid; grid-template-columns: 1.4fr 1fr; }
.dash__cams { padding: 20px 24px; border-right: 1px solid var(--line); display: grid; gap: 14px; }
.dash__cams .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dash__cams .feed { aspect-ratio: 16 / 9; }
.dash__cams .det { opacity: 1; transform: none; }
.dash__right { display: grid; align-content: start; }
.dash__block { padding: 18px 24px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.dash__block:last-child { border-bottom: 0; }
.dash__block h3 { font-size: var(--fs-small); color: var(--fg-2); font-weight: 700; }
.dash__status { display: inline-flex; align-items: center; gap: 8px; color: var(--green); font-weight: 800; }
.dash__bars-lbl { display: flex; justify-content: space-between; font-size: var(--fs-micro); color: var(--fg-3); }

/* ---- Trust --------------------------------------------------------------- */
.trust__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 3vw, 2.5rem); margin-top: 2.5rem; }
.trust__item { position: relative; padding-top: 1.4rem; border-top: 1px solid var(--line-strong); }
.trust__item::before { content: ""; position: absolute; top: -1px; left: 0; width: 48px; height: 2px; background: var(--grad); }
.trust__item h3 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.trust__item p { color: var(--fg-2); margin-top: .7rem; font-size: .95rem; max-width: 28em; }
.trust__note { margin-top: 2.5rem; color: var(--fg-3); font-size: var(--fs-small); max-width: 50em; }

/* ---- Final CTA ------------------------------------------------------------ */
.cta { position: relative; overflow: hidden; text-align: center; padding-block: clamp(7rem, 14vw, 12rem); }
.cta__bg { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(4, 1fr); gap: 10px; padding: 24px; pointer-events: none; }
.cta__bg i {
  border-radius: 8px; border: 1px solid rgba(63,211,122,.14); background: rgba(15,23,32,.4);
  opacity: .6; transform: translate3d(0,0,0) scale(1);
  transition: transform 1.6s var(--ease), opacity 1.6s var(--ease);
  transition-delay: calc(var(--d) * 30ms);
}
.cta.is-in .cta__bg i { transform: translate3d(var(--tx), var(--ty), 0) scale(.15); opacity: 0; }
.cta__mark { width: clamp(72px, 9vw, 110px); height: auto; margin: 0 auto 2rem; opacity: 0; transform: scale(.6); transition: opacity 1.2s var(--ease) .5s, transform 1.2s var(--ease) .5s; filter: drop-shadow(0 20px 40px rgba(63,211,122,.35)); }
.cta.is-in .cta__mark { opacity: 1; transform: none; }
.cta__title { font-size: clamp(2.6rem, 7vw, 6rem); font-weight: 800; letter-spacing: -.045em; line-height: .96; }
.cta .lead { margin: 1.4rem auto 0; }
.cta__btns { display: flex; justify-content: center; gap: 12px; margin-top: 2.4rem; flex-wrap: wrap; }
.cta__glow { position: absolute; inset: auto -10% -40% -10%; height: 60%; background: radial-gradient(50% 50% at 50% 50%, rgba(63,211,122,.16), transparent 70%); filter: blur(30px); pointer-events: none; }

/* ---- Contact block ---------------------------------------------------------- */
.contact {
  font-style: normal; margin: 3rem auto 0; max-width: 980px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: start;
}
.contact__item {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: rgba(15,23,32,.55);
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
a.contact__item:hover { border-color: rgba(63,211,122,.45); background: rgba(15,23,32,.85); }
.contact__item--wide { grid-column: 1 / -1; justify-content: center; }
.contact__ic { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(63,211,122,.1); color: var(--green); }
.contact__ic svg { width: 17px; height: 17px; }
.contact__item small { display: block; font-size: var(--fs-micro); color: var(--fg-3); font-weight: 600; }
.contact__item b { display: block; font-size: .9rem; font-weight: 700; color: var(--fg); white-space: nowrap; }
.contact__item--wide b { white-space: normal; }
.contact__item > span:last-child { min-width: 0; }

/* ---- Footer ---------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding-block: 2.5rem; }
.footer__grid { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; font-size: var(--fs-small); color: var(--fg-2); }
.footer__grid img { height: 28px; width: auto; }
.footer__links { display: flex; gap: 18px; }
.footer__links a:hover { color: var(--fg); }
.footer__contact { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer__contact a:hover { color: var(--green-soft); }
.footer__copy { flex-basis: 100%; color: var(--fg-3); }

/* ==========================================================================
   Responsive — mobile gets its own layouts, not a shrunken desktop
   ========================================================================== */
@media (max-width: 1024px) {
  .fx__grid, .map__grid, .alert__grid { grid-template-columns: 1fr; }
  .miss__grid { grid-template-columns: 1fr; }
  .miss__side { grid-template-columns: 1fr; }
  .miss__list { grid-template-columns: 1fr 1fr; }
  .dash__body { grid-template-columns: 1fr; }
  .dash__cams { border-right: 0; border-bottom: 1px solid var(--line); }
  .trust__grid { grid-template-columns: 1fr; }
  .fx__list { grid-template-columns: repeat(3, 1fr); }
  .fx__btn small { display: none; }
}

@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .nav__links, .nav__cta .btn--primary { display: none; }
  .nav__burger { display: grid; }
  .mobile-menu { display: flex; pointer-events: none; }
  .mobile-menu.is-open { pointer-events: auto; }

  /* Hero: shorter scroll, panel fills width, copy compact */
  .hero { height: 260vh; }
  .hero__stage { padding-top: calc(var(--header-h) + 2vh); }
  .hero__sub { font-size: 1rem; }
  .hero__cta .btn { width: 100%; max-width: 320px; }
  .cc-wrap { padding: 2vh 0 4vh; perspective: none; }
  .cc { aspect-ratio: 9 / 13; width: min(100%, 92vw); border-radius: var(--r-lg); transform: none !important; }
  .cc__bar .grp:last-child { display: none; }
  /* Mobile grid: 2 rows of feeds stacked, status hidden */
  .tile--c1 { inset: 12px 12px auto 12px; height: 26%; }
  .tile--c2 { inset: calc(26% + 24px) 12px auto 12px; height: 26%; }
  .tile--c3 { inset: calc(52% + 36px) 12px 12px 12px; height: auto; }
  .tile--st { display: none; }
  .cc[data-stage="1"] .tile--c2, .cc[data-stage="2"] .tile--c2 { inset: 12px; height: auto; }
  .cc[data-stage="3"] .tile--c2 { inset: 12px 12px calc(38% + 6px) 12px; height: auto; }
  .tile--dash { inset: 100% 12px 12px 12px; }
  .cc[data-stage="3"] .tile--dash { inset: calc(62% + 6px) 12px 12px 12px; }
  .cc__dash .evt:nth-child(n+4) { display: none; }

  .miss { height: auto; }
  .miss__stage { position: static; height: auto; padding-top: 0; }
  .miss__side .lead { display: none; }
  .miss__list { grid-template-columns: 1fr; gap: 6px; }
  .miss__item { padding: 10px 12px; }
  .miss__item small { display: none; }

  .pipe__stage { grid-template-columns: 1fr; gap: 2.5rem; }
  .pipe__canvas { display: none; }
  .pipe__core { max-width: 180px; }

  .fx__list { grid-template-columns: 1fr; margin-top: 1.2rem; }
  .fx__list { display: flex; overflow-x: auto; gap: 6px; scroll-snap-type: x mandatory; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .fx__btn { flex: 0 0 auto; scroll-snap-align: start; padding: 10px 14px; }
  .fx__btn .prog { display: none; }
  .fx__btn b { font-size: .9rem; white-space: nowrap; }
  .fx__view { aspect-ratio: 4 / 5; }
  .fx__cam { inset: 44px 12px 42% 12px; }
  .fx__side { inset: auto 12px 12px 12px; grid-template-columns: 1fr 1fr; }
  .fx[data-mode="central"] .fx__cam { inset: 44px 12px 42% 12px; }

  .map__view { aspect-ratio: 1; }
  .steps { margin-top: 1.2rem; }
  .alert-card__meta { grid-template-columns: 1fr 1fr; }

  .human__viz { grid-template-columns: 1fr; gap: 6px; }
  .human__arrow { transform: rotate(90deg); margin: 0 auto; }
  .human__grid { grid-template-columns: repeat(12, 1fr); }

  /* Use cases stack vertically on mobile */
  .uc { height: auto; }
  .uc__stage { position: static; height: auto; overflow: visible; padding-top: 0; display: block; }
  .uc__prog { display: none; }
  .uc__track { flex-direction: column; padding-left: 0; transform: none !important; }
  .uc__card { flex: none; grid-template-columns: 1fr; }

  .dash__stats { grid-template-columns: 1fr 1fr; }
  .dash__stats .stat:nth-child(2) { border-right: 0; }
  .dash__stats .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .dash__cams .grid { grid-template-columns: 1fr; }

  .cta__bg { grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(8, 1fr); }
  .contact { grid-template-columns: 1fr; }
  .footer__grid { flex-direction: column; align-items: flex-start; }
}

/* Devices without hover: no cycling pause on hover */
@media (hover: none) { .fx.is-paused .fx__btn .prog i { animation-play-state: running; } }

/* ==========================================================================
   Arabic / RTL
   ========================================================================== */
[dir="rtl"] body, body[dir="rtl"] { --font: "Cairo", "Manrope", system-ui, sans-serif; }
[dir="rtl"] { --font: "Cairo", "Manrope", system-ui, sans-serif; }
[dir="rtl"] .hero__title, [dir="rtl"] .h2, [dir="rtl"] .human__title, [dir="rtl"] .cta__title, [dir="rtl"] .uc__card h3, [dir="rtl"] .alert-card__title, [dir="rtl"] .trust__item h3 { letter-spacing: 0; line-height: 1.18; }
[dir="rtl"] .hero__title { font-size: clamp(2.3rem, 5vw, 4.8rem); }
[dir="rtl"] .lead, [dir="rtl"] p { line-height: 1.85; }
[dir="rtl"] .fx__btn { text-align: right; }
[dir="rtl"] .steps::before { left: auto; right: 15px; }
[dir="rtl"] .miss__flow svg, [dir="rtl"] .human__arrow { transform: scaleX(-1); }
[dir="rtl"] .uc__track { padding-left: 0; padding-right: var(--gutter); }
[dir="rtl"] .feed__bar, [dir="rtl"] .cc__bar, [dir="rtl"] .fx__hud, [dir="rtl"] .panel__head, [dir="rtl"] .alert-card__top { direction: ltr; }
[dir="rtl"] .contact__item b, [dir="rtl"] .footer__contact a[dir="ltr"] { text-align: right; }
[dir="rtl"] .contact__item--wide b { text-align: center; }
[dir="rtl"] .contact__item--wide { text-align: center; }
[dir="rtl"] .kicker::before { order: -1; }
@media (max-width: 760px) { [dir="rtl"] .human__arrow { transform: rotate(90deg) scaleX(-1); } }
