/* =========================================================
   Pro Cam Solutions — security blueprint experience (homepage hero)

   Layers, back to front, inside .sec-view:
     .sec-stage   the art: base still, state stills, detection film, poster, intro film
     .sec-scrim   gradient that keeps the copy legible
     .sec-spots   camera hotspots, placed with the same box as the stage
     copy, event label, camera panel, control bars

   data-state on the section: static (no script / reduced motion before script),
   film (intro playing), interactive (still with controls).
   ========================================================= */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.sec-hero {
  --sec-cyan: #48c3ff;
  --sec-amber: #ffb02e;
  --sec-ink: #0b1424;
  padding: 0;
  background: var(--sec-ink);
  overflow: hidden;
}
.sec-hero::before { display: none; }   /* the art carries its own grid */

.sec-view {
  position: relative;
  min-height: clamp(600px, calc(100svh - var(--header-h)), 1000px);
  overflow: hidden;
  display: flex;
  align-items: center;
  isolation: isolate;
}

/* ---------- the art ---------- */
.sec-stage, .sec-spots {
  position: absolute; inset: 0;        /* replaced by exact pixels once security.js has measured */
}
.sec-stage { z-index: 0; }
.sec-stage picture, .sec-layers { position: absolute; inset: 0; display: block; }
.sec-base, .sec-layer, .sec-poster, .sec-film, .sec-sim {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; max-width: none;
  object-fit: cover; object-position: 69% 50%;   /* matches FOCUS in security.js until it takes over */
}
.sec-hero[data-placed] .sec-stage :is(.sec-base, .sec-layer, .sec-poster, .sec-film, .sec-sim) { object-fit: fill; }

.sec-layer, .sec-film, .sec-sim { opacity: 0; transition: opacity .45s ease; }
.sec-layer.is-on, .sec-sim.is-on { opacity: 1; }
.sec-film.is-on { opacity: 1; transition-duration: .6s; }
.sec-poster { opacity: 0; }
.sec-hero[data-state="film"] .sec-poster { opacity: 1; }
.sec-hero[data-state="interactive"] .sec-film { transition-duration: .7s; }

.sec-scrim {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(8,14,26,.94) 0%, rgba(8,14,26,.82) 22%, rgba(8,14,26,.38) 42%, rgba(8,14,26,0) 58%),
    linear-gradient(180deg, rgba(8,14,26,.5) 0%, rgba(8,14,26,0) 18%, rgba(8,14,26,0) 76%, rgba(8,14,26,.72) 100%);
}

/* ---------- copy ---------- */
.sec-copy { position: relative; z-index: 3; width: 100%; padding-top: 40px; padding-bottom: 110px; pointer-events: none; }
.sec-copy > * { pointer-events: auto; max-width: 470px; }
.sec-copy .eyebrow { margin-bottom: 20px; }
.sec-hero h1 { font-size: clamp(2.2rem, 3.9vw, 3.35rem); line-height: 1.07; margin-bottom: 18px; max-width: 12.5ch; }
.sec-hero .lead { color: var(--text); opacity: .92; font-size: clamp(1.05rem, 1.4vw, 1.18rem); max-width: 25em; margin-bottom: 28px; }
.sec-hero .hero-cta { margin-bottom: 22px; }
.sec-note { font-size: .82rem; line-height: 1.5; color: #a9bbd4; max-width: 34em; }

/* ---------- hotspots ---------- */
.sec-spots { z-index: 2; pointer-events: none; opacity: 0; transition: opacity .5s ease; }
.sec-hero[data-state="interactive"] .sec-spots { opacity: 1; }
.sec-spot {
  position: absolute; transform: translate(-50%, -50%);
  width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  pointer-events: none; color: #fff; font: inherit;
  display: grid; place-items: center;
}
.sec-hero[data-state="interactive"] .sec-spot { pointer-events: auto; }
.sec-spot.is-out { display: none; }
.sec-spot-dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 .78rem/1 var(--ff-head);
  color: var(--sec-ink); background: #eaf6ff;
  box-shadow: 0 0 0 2px rgba(11,20,36,.85), 0 0 0 4px rgba(72,195,255,.55), 0 4px 14px rgba(0,0,0,.5);
  transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.sec-spot:hover .sec-spot-dot, .sec-spot:focus-visible .sec-spot-dot { transform: scale(1.12); background: #fff; }
.sec-spot:focus-visible { outline: none; }
.sec-spot:focus-visible .sec-spot-dot { box-shadow: 0 0 0 2px var(--sec-ink), 0 0 0 5px #fff; }
.sec-spot.is-selected .sec-spot-dot { background: var(--sec-cyan); box-shadow: 0 0 0 2px var(--sec-ink), 0 0 0 5px rgba(72,195,255,.9), 0 0 22px rgba(72,195,255,.7); }
.sec-spot-label {
  position: absolute; left: calc(50% + 20px); top: 50%; transform: translateY(-50%);
  white-space: nowrap; pointer-events: none;
  padding: 5px 10px; border-radius: 999px;
  font: 600 .84rem/1.1 var(--ff-head); letter-spacing: .01em; color: #fff;
  background: rgba(9,16,30,.86); border: 1px solid rgba(160,205,240,.34);
}
.sec-spot.is-left .sec-spot-label { left: auto; right: calc(50% + 20px); }
.sec-spot.is-low .sec-spot-label { top: calc(50% + 30px); left: calc(50% - 6px); }
.sec-spot.is-left.is-low .sec-spot-label { left: auto; right: calc(50% - 6px); }
.sec-spot.is-selected .sec-spot-label { border-color: var(--sec-cyan); background: rgba(9,26,48,.94); }
.sec-hero.has-selection .sec-spot:not(.is-selected) .sec-spot-label { opacity: .72; }
.sec-hero.is-simulating .sec-spots { opacity: .35; }

/* ---------- simulated event label ---------- */
.sec-event {
  position: absolute; z-index: 4;
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
  padding: 9px 14px; border-radius: 10px;
  font: 700 .95rem/1.1 var(--ff-head); color: #1c1203;
  background: var(--sec-amber); box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.sec-event-sub { font-weight: 600; }
.sec-event-dot { width: 9px; height: 9px; border-radius: 50%; background: #1c1203; }

/* ---------- camera panel ---------- */
.sec-panel {
  position: absolute; z-index: 5; right: clamp(16px, 3vw, 40px); bottom: 92px;
  width: min(360px, calc(100% - 32px));
  padding: 18px 44px 18px 20px; border-radius: var(--radius-sm);
  background: rgba(9,16,30,.94); border: 1px solid rgba(120,190,240,.42);
  box-shadow: 0 24px 60px -18px rgba(0,0,0,.75);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.sec-panel-kicker { font: 600 .74rem/1 var(--ff-head); letter-spacing: .14em; text-transform: uppercase; color: var(--sec-cyan); margin-bottom: 8px; }
.sec-panel-title { font-size: 1.2rem; line-height: 1.2; margin-bottom: 8px; color: #fff; }
.sec-panel-text { font-size: .96rem; line-height: 1.5; color: var(--text); }
.sec-panel-spec { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-strong); font-size: .82rem; line-height: 1.5; color: #a9bbd4; }
.sec-panel-close {
  position: absolute; top: 6px; right: 6px; width: 40px; height: 40px;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: none; color: #fff; cursor: pointer;
}
.sec-panel-close:hover { background: rgba(255,255,255,.1); }

/* ---------- control bars ---------- */
.sec-bar {
  position: absolute; z-index: 5; right: clamp(16px, 3vw, 40px); bottom: 26px;
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px;
}
.sec-btn {
  display: inline-flex; align-items: center; gap: 9px;
  min-height: 46px; padding: 0 18px; border-radius: 999px; cursor: pointer;
  font: 600 .92rem/1 var(--ff-head); color: #fff;
  background: rgba(9,16,30,.88); border: 1px solid rgba(160,205,240,.45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background-color .2s ease, border-color .2s ease;
}
.sec-btn:hover { background: rgba(20,40,70,.95); border-color: var(--sec-cyan); }
.sec-btn[aria-pressed="true"] { border-color: var(--sec-cyan); background: rgba(16,44,78,.95); }
.sec-btn[data-sec="simulate"][aria-pressed="true"] { border-color: var(--sec-amber); background: rgba(70,44,6,.95); }
.sec-btn-quiet { background: rgba(9,16,30,.6); border-color: rgba(160,205,240,.28); }
.sec-btn-state {
  min-width: 2.4em; padding: 4px 8px; border-radius: 999px; text-align: center;
  font-size: .76rem; letter-spacing: .06em; text-transform: uppercase;
  color: #b9c9de; background: rgba(255,255,255,.1);
}
.sec-btn[aria-pressed="true"] .sec-btn-state { color: var(--sec-ink); background: var(--sec-cyan); }
.sec-btn-icon { width: 12px; height: 14px; border-left: 4px solid currentColor; border-right: 4px solid currentColor; }
.sec-btn.is-paused .sec-btn-icon { width: 0; height: 0; border: 7px solid transparent; border-left: 12px solid currentColor; border-right: 0; }
.sec-hero :is(.sec-btn, .sec-panel-close):focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.sec-trust { position: relative; z-index: 1; padding-top: 26px; padding-bottom: 34px; }
.sec-trust .trust-strip { margin-top: 0; }

/* ---------- portrait cut: phones and upright tablets ----------
   The portrait film keeps its upper two fifths clear; the copy sits there, compact enough
   to stay above the property. */
@media (max-width: 767px), (orientation: portrait) and (max-width: 1099px) {
  .sec-view { min-height: clamp(700px, calc(100svh - var(--header-h)), 1100px); align-items: flex-start; }
  .sec-base, .sec-layer, .sec-poster, .sec-film, .sec-sim { object-position: 50% 62%; }
  .sec-scrim {
    background: linear-gradient(180deg, rgba(8,14,26,.96) 0%, rgba(8,14,26,.9) 30%, rgba(8,14,26,.35) 41%, rgba(8,14,26,0) 48%, rgba(8,14,26,0) 82%, rgba(8,14,26,.8) 100%);
  }
  .sec-copy { padding-top: clamp(18px, 3.4svh, 56px); padding-bottom: 0; }
  .sec-copy > * { max-width: 34rem; }
  .sec-hero h1 { font-size: clamp(1.62rem, 7.3vw, 3rem); max-width: none; margin-bottom: 10px; }
  .sec-hero .lead { font-size: clamp(.95rem, 2.4vw, 1.2rem); line-height: 1.42; margin-bottom: 14px; }
  .sec-copy .eyebrow { margin-bottom: 14px; }
  .sec-hero .hero-cta { flex-wrap: nowrap; gap: 10px; margin-bottom: 10px; }
  .sec-hero .hero-cta .btn { --btn-py: 12px; --btn-px: 18px; font-size: .95rem; white-space: nowrap; }
  .sec-note { font-size: .76rem; line-height: 1.4; }
  .sec-bar { left: 12px; right: 12px; bottom: 14px; justify-content: center; flex-wrap: nowrap; gap: 8px; }
  .sec-btn { min-height: 46px; padding: 0 15px; font-size: .88rem; white-space: nowrap; }
  .sec-panel { left: 12px; right: 12px; bottom: 72px; width: auto; }
  .sec-spot-label { font-size: .78rem; padding: 4px 8px; }
  .sec-event { font-size: .86rem; }
}
@media (max-width: 560px) {
  .sec-copy .eyebrow { display: none; }
  .sec-wide { display: none; }
  .sec-btn[data-sec="replay"] { padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .sec-layer, .sec-film, .sec-sim, .sec-spots, .sec-spot-dot, .sec-btn { transition: none; }
}
