/* NVS — enhancement layer. Loaded after styles.css on every page.
   Uses only the existing brand tokens from styles.css. */

:root { --fx-red: #e2685a; --fx-ease: cubic-bezier(.2, .8, .2, 1); }

/* ---------- Page transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fx-out .18s ease both; }
::view-transition-new(root) { animation: fx-in .32s var(--fx-ease) both; }
@keyframes fx-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes fx-in { from { opacity: 0; transform: translateY(8px); } }
.site-header { view-transition-name: site-header; }
::view-transition-old(site-header), ::view-transition-new(site-header) { animation: none; }
main { animation: fx-in .45s var(--fx-ease) both; }
html.fx-leaving main { opacity: 0; transform: translateY(-6px); transition: opacity .18s ease, transform .18s ease; }

/* ---------- Navigation ---------- */
.desktop-nav > a, .desktop-nav .nav-link { position: relative; }
.desktop-nav > a::after, .desktop-nav .nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 26px; height: 2px; border-radius: 2px;
  background: var(--cyan); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--fx-ease);
}
.desktop-nav > a:hover::after, .desktop-nav > a.is-active::after,
.desktop-nav .nav-link:hover::after, .desktop-nav .nav-link.is-active::after { transform: scaleX(1); }
.nav-overlay:not([hidden]) nav a { animation: fx-in .4s var(--fx-ease) both; }
.nav-overlay:not([hidden]) nav a:nth-child(2) { animation-delay: .04s; }
.nav-overlay:not([hidden]) nav a:nth-child(3) { animation-delay: .08s; }
.nav-overlay:not([hidden]) nav a:nth-child(4) { animation-delay: .12s; }
.nav-overlay:not([hidden]) nav a:nth-child(5) { animation-delay: .16s; }
.nav-overlay:not([hidden]) nav a:nth-child(6) { animation-delay: .2s; }

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px;
}

/* ---------- Network map behind heroes ---------- */
.hero, .page-hero { position: relative; isolation: isolate; }
.fx-network {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 85% 80% at 65% 45%, #000 35%, transparent 85%);
          mask-image: radial-gradient(ellipse 85% 80% at 65% 45%, #000 35%, transparent 85%);
  opacity: 0; animation: fx-fade 1.2s .2s ease forwards;
}
.page-hero .fx-network { opacity: 0; animation-name: fx-fade-soft; }
@keyframes fx-fade { to { opacity: 1; } }
@keyframes fx-fade-soft { to { opacity: .7; } }
.hero .hero-glow { z-index: -2; }

/* ---------- Scroll reveal ---------- */
.fx-reveal { opacity: 0; }
.fx-reveal.fx-in { opacity: 1; animation: fx-rise .7s var(--fx-ease) var(--fx-delay, 0ms) backwards; }
@keyframes fx-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* ---------- Card hover: lift + glow that follows the cursor ---------- */
@property --fx-a { syntax: "<number>"; inherits: false; initial-value: 0; }
.fx-glow {
  --fx-a: 0;
  background-image: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(103, 189, 224, calc(.16 * var(--fx-a))), transparent 65%);
  transition: --fx-a .35s ease, transform .35s var(--fx-ease), border-color .35s ease, box-shadow .35s ease, background-color .3s ease, padding .3s ease;
}
.fx-glow:hover { --fx-a: 1; }
.light .fx-glow { background-image: radial-gradient(280px circle at var(--mx, 50%) var(--my, 50%), rgba(47, 150, 140, calc(.12 * var(--fx-a))), transparent 65%); }
.card.fx-glow:hover, .feature-card.fx-glow:hover, .rely-card.fx-glow:hover, .advantage-grid article.fx-glow:hover {
  border-color: rgba(103, 189, 224, .42);
  box-shadow: 0 22px 50px rgba(0, 0, 0, .22), 0 0 0 1px rgba(103, 189, 224, .12), 0 0 36px rgba(103, 189, 224, .1);
}
.card .icon, .feature-card .icon, .rely-card .icon { transition: transform .4s var(--fx-ease), box-shadow .4s ease, background .4s ease; }
.card:hover .icon, .feature-card:hover .icon, .rely-card:hover .icon {
  transform: translateY(-2px) rotate(-6deg); background: rgba(47, 150, 140, .2); box-shadow: 0 0 22px rgba(47, 150, 140, .35);
}

/* ---------- Subtle brand glow ---------- */
.btn:not(.btn-ghost):not(.btn-dark) { position: relative; }
.hero .btn:not(.btn-ghost)::after, .cta-band .btn::after, .fx-cta::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 0 rgba(229, 169, 59, .45); animation: fx-btn-glow 3.2s ease-out 1.5s infinite;
}
@keyframes fx-btn-glow { 0% { box-shadow: 0 0 0 0 rgba(229, 169, 59, .45); } 60%, 100% { box-shadow: 0 0 0 12px rgba(229, 169, 59, 0); } }
.status-card { transition: box-shadow .5s ease, border-color .5s ease; }
.status-card:hover { border-color: rgba(103, 189, 224, .35); box-shadow: var(--shadow), 0 0 50px rgba(103, 189, 224, .12); }

/* ---------- Simulated SOC dashboard ---------- */
.socd {
  position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(180deg, rgba(32, 47, 54, .95), rgba(24, 36, 42, .98)); color: var(--text);
  box-shadow: var(--shadow), 0 0 60px rgba(103, 189, 224, .08); font-size: 13px;
}
.socd::after {
  content: ""; position: absolute; left: 0; right: 0; height: 90px; top: -90px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(103, 189, 224, .07), transparent); animation: fx-scan 5s linear infinite;
}
@keyframes fx-scan { to { top: 100%; } }
.socd-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.socd-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a4c55; }
.socd-bar i:nth-child(1) { background: var(--fx-red); } .socd-bar i:nth-child(2) { background: var(--gold); } .socd-bar i:nth-child(3) { background: var(--cyan); }
.socd-live { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; color: var(--sky); font-weight: 600; }
.socd-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sky); animation: fx-blink 1.2s ease-in-out infinite; }
@keyframes fx-blink { 50% { opacity: .25; } }
.socd-metrics { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.socd-metrics div { padding: 10px 16px; }
.socd-metrics div + div { border-left: 1px solid var(--line); }
.socd-metrics small { display: block; color: var(--muted); font-size: 11px; line-height: 1.3; }
.socd-metrics strong { display: block; margin-top: 2px; font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.socd-body { display: grid; grid-template-columns: 1fr 150px; }
.socd-queue { list-style: none; margin: 0; padding: 8px; height: 262px; overflow: hidden; display: flex; flex-direction: column; gap: 6px; }
.socd-item {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px 9px 12px;
  border-radius: 10px; background: rgba(255, 255, 255, .03); border-left: 3px solid transparent; transition: background .8s ease;
}
.socd-item.sev-crit { border-left-color: var(--fx-red); } .socd-item.sev-high { border-left-color: var(--gold); }
.socd-item.sev-med { border-left-color: var(--sky); } .socd-item.sev-low { border-left-color: rgba(154, 166, 172, .5); }
.socd-item.is-new { background: rgba(103, 189, 224, .09); animation: fx-slide .5s var(--fx-ease); }
@keyframes fx-slide { from { opacity: 0; transform: translateX(-14px); } }
.socd-id { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.socd-title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #dfe7ea; font-weight: 500; }
.socd-title small { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-size: 11px; font-weight: 400; }
.socd-tag { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.socd-tag.benign { color: #8fd6cd; background: rgba(47, 150, 140, .18); }
.socd-tag.fp { color: #c2ccd0; background: rgba(154, 166, 172, .16); }
.socd-tag.triage { color: #f7d9a0; background: rgba(229, 169, 59, .18); }
.socd-tag.esc { color: #ffc7bf; background: rgba(226, 104, 90, .22); }
.socd-side { padding: 12px 14px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.socd-side small { color: var(--muted); font-size: 11px; }
.socd-bars { display: grid; gap: 8px; }
.socd-bars span { display: grid; gap: 3px; }
.socd-bars em { display: block; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .07); position: relative; overflow: hidden; }
.socd-bars em::after { content: ""; position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--v, 0)); transition: transform .8s var(--fx-ease); background: var(--sky); border-radius: inherit; }
.socd-bars [data-b="benign"] em::after { background: var(--cyan); }
.socd-bars [data-b="fp"] em::after { background: #9aa6ac; }
.socd-bars [data-b="triage"] em::after { background: var(--gold); }
.socd-bars [data-b="esc"] em::after { background: var(--fx-red); }
.socd-bars b { font-size: 11px; font-weight: 500; color: #c5ccd3; }
.socd-spark { width: 100%; height: 36px; }
.socd-spark polyline { fill: none; stroke: var(--sky); stroke-width: 1.5; vector-effect: non-scaling-stroke; }

/* ---------- Home: SOC training teaser band ---------- */
.fx-soc-band { position: relative; overflow: hidden; }
.fx-soc-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 56px; align-items: center; }
.fx-soc-band h2 { font-size: clamp(34px, 4.6vw, 56px); }
.fx-soc-band p.lede { margin: 20px 0 28px; max-width: 520px; color: #c5ccd3; }
.fx-soc-points { list-style: none; margin: 0 0 30px; padding: 0; display: grid; gap: 10px; }
.fx-soc-points li { display: flex; gap: 12px; align-items: baseline; color: #dfe7ea; }
.fx-soc-points li::before { content: ""; flex: 0 0 8px; height: 8px; transform: translateY(-1px) rotate(45deg); border-radius: 2px; background: var(--cyan); }
.fx-soc-band .fx-glowline { position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--sky), var(--gold), transparent); opacity: .5; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .fx-soc-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .socd-body { grid-template-columns: 1fr; }
  .socd-side { display: none; }
  .socd-item { grid-template-columns: 1fr auto; }
  .socd-id { display: none; }
  .socd-metrics strong { font-size: 15px; }
  .socd-queue { height: 250px; }
}

/* ---------- Reduced motion: everything static ---------- */
@media (prefers-reduced-motion: reduce) {
  main, .fx-network, .fx-reveal.fx-in, .socd::after, .socd-live::before, .socd-item.is-new,
  .hero .btn::after, .cta-band .btn::after, .fx-cta::after, .nav-overlay nav a { animation: none !important; }
  .fx-network { opacity: .8 !important; }
  .fx-reveal { opacity: 1 !important; transform: none !important; }
  .fx-glow, .card .icon { transition: none !important; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
}
