/* GuardAgent motion layer: logo intro, 3D hero, page transitions, scroll reveals and Exploit Watch rankings.
   No library: CSS animations, the Web Animations API and the browser's View Transitions.
   Intros play once per visit (html.intro-logo / html.intro-hero are set by a tiny script in <head>), so returning
   to a page never waits on an animation. Everything has a reduced-motion fallback at the bottom. */
:root { --ease-out: cubic-bezier(.16, 1, .3, 1); --ease-spring: cubic-bezier(.34, 1.56, .64, 1); }

/* ---------- Logo ---------- */
.mark-fx { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; perspective: 300px; flex: none; }
.mark-fx > * { grid-area: 1 / 1; }
.mark-fx img { width: 34px; height: 34px; transform-origin: 50% 60%; }
.mark-fx svg { width: 42px; height: 42px; overflow: visible; pointer-events: none; opacity: 0; }
.mark-fx .outline { fill: none; stroke: var(--guard); stroke-width: 1.6; stroke-linejoin: round; stroke-dasharray: 130; stroke-dashoffset: 130; }
.mark-fx .sheen { width: 34px; height: 34px; pointer-events: none;
  -webkit-mask: url(/logo-mark@2x.png) center / contain no-repeat; mask: url(/logo-mark@2x.png) center / contain no-repeat;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.95) 50%, transparent 65%) -60px 0 / 200% 100% no-repeat; }
.mark-fx .ring { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--guard); opacity: 0; }
.wordmark { display: inline-flex; overflow: hidden; padding-bottom: .06em; margin-bottom: -.06em; }
.wordmark span { display: inline-block; }
.brand:hover .mark-fx .sheen, .brand:focus-visible .mark-fx .sheen { animation: sheen .9s ease both; }
html.intro-logo .mark-fx svg { opacity: 1; animation: outline-out .5s ease 1.25s forwards; }
html.intro-logo .mark-fx .outline { animation: draw 1s var(--ease-out) forwards; }
html.intro-logo .mark-fx img { animation: mark-in .9s var(--ease-spring) .35s both; }
html.intro-logo .mark-fx .sheen { animation: sheen 1s ease 1.1s both; }
html.intro-logo .mark-fx .ring { animation: ring 1.1s var(--ease-out) 1.15s both; }
html.intro-logo .wordmark span { animation: letter .6s var(--ease-out) both; animation-delay: calc(.55s + var(--i) * 35ms); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes outline-out { to { opacity: 0; transform: scale(1.15); } }
@keyframes mark-in { from { opacity: 0; transform: rotateY(-100deg) scale(.55); filter: brightness(2.2); } to { opacity: 1; transform: none; filter: none; } }
@keyframes sheen { from { background-position: -60px 0; } to { background-position: 60px 0; } }
@keyframes ring { 0% { opacity: .8; transform: scale(.9); } 100% { opacity: 0; transform: scale(2.1); } }
@keyframes letter { from { transform: translateY(110%); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- 3D hero ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero::before { content: ""; position: absolute; left: -20%; right: -20%; bottom: -38%; height: 90%; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(10,124,90,.2) 1px, transparent 1px), linear-gradient(90deg, rgba(10,124,90,.2) 1px, transparent 1px);
  background-size: 56px 56px; transform: perspective(600px) rotateX(64deg); transform-origin: 50% 0;
  -webkit-mask: linear-gradient(to bottom, transparent, #000 30%, #000 60%, transparent); mask: linear-gradient(to bottom, transparent, #000 30%, #000 60%, transparent); }
.hero::after { content: ""; position: absolute; right: 4%; top: 8%; width: 640px; height: 640px; z-index: -1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(10,124,90,.16), rgba(10,124,90,.05) 40%, transparent 68%); }
.stage { position: relative; perspective: 1400px; }
.alerts { transform-style: preserve-3d; transform: rotateY(calc(-16deg + var(--ry, 0deg))) rotateX(calc(7deg + var(--rx, 0deg))); transition: transform .5s var(--ease-out); }
.alerts .alerts-cap { transform: translateZ(40px); }
.alerts .alert-card { opacity: 1; animation: none; transform: translateZ(var(--z, 0px));   /* replaces the old fade-in from site.css */
  box-shadow: 0 1px 0 rgba(14,26,43,.04), 0 30px 60px -28px rgba(14,26,43,.45), 0 0 0 1px rgba(10,124,90,.05); }
.alerts .alert-card.high { --z: 90px; box-shadow: 0 0 0 1px rgba(180,65,14,.18), 0 40px 70px -30px rgba(180,65,14,.45), 0 10px 30px -10px rgba(14,26,43,.18); }
.alerts .alert-card.later { --z: 45px; }
.hero-emblem { position: absolute; z-index: -1; right: -90px; top: 42%; width: 440px; height: 440px; margin-top: -260px; pointer-events: none; transform-style: preserve-3d; }
.hero-emblem img { width: 100%; height: 100%; opacity: .42; filter: saturate(1.15) drop-shadow(0 30px 60px rgba(10,124,90,.35)); transform: translateZ(-160px); animation: emblem-float 7s ease-in-out infinite; }
@keyframes emblem-float { 0%, 100% { transform: translateZ(-160px) rotateY(-12deg) translateY(0); } 50% { transform: translateZ(-160px) rotateY(12deg) translateY(-14px); } }
.hero h1 .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.hero h1 .w > span { display: inline-block; }
@media (max-width: 900px) {   /* gentler angle on phones and tablets so the text stays easy to read */
  .alerts { transform: rotateY(-7deg) rotateX(4deg); }
  .alerts .alert-card.high { --z: 40px; } .alerts .alert-card.later { --z: 20px; }
  .hero-emblem { width: 300px; height: 300px; right: -70px; margin-top: -200px; }
}
/* First visit to the home page in a session: the intro */
html.intro-hero .hero::before { animation: floor-in 1.6s var(--ease-out) .1s both; }
html.intro-hero .hero::after { animation: fade 1.4s ease .2s both; }
html.intro-hero .alerts .alert-card { animation: card-in 1.1s var(--ease-out) both; }
html.intro-hero .alerts .alert-card.high { animation-delay: .5s; }
html.intro-hero .alerts .alert-card.later { animation-delay: .68s; }
html.intro-hero .alerts .alert-card.last { animation-delay: .86s; }
html.intro-hero .alerts .alerts-cap { animation: fade .8s ease .9s both; }
html.intro-hero .hero-emblem { animation: emblem-in 1.6s var(--ease-out) .25s both; }
html.intro-hero .hero h1 .w > span { animation: rise .9s var(--ease-out) both; animation-delay: calc(.15s + var(--i) * 55ms); }
html.intro-hero .hero .lede, html.intro-hero .hero .hero-cta, html.intro-hero .hero .hero-note { animation: up .8s var(--ease-out) both; }
html.intro-hero .hero .lede { animation-delay: .55s; } html.intro-hero .hero .hero-cta { animation-delay: .68s; } html.intro-hero .hero .hero-note { animation-delay: .8s; }
@keyframes floor-in { from { opacity: 0; transform: perspective(600px) rotateX(80deg) translateY(120px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes card-in { from { opacity: 0; transform: translateZ(-420px) translateY(60px) rotateX(-18deg); } to { opacity: 1; transform: translateZ(var(--z, 0px)); } }
@keyframes emblem-in { from { opacity: 0; transform: scale(.6) rotateY(60deg); } }
@keyframes rise { from { transform: translateY(105%) rotate(3deg); } to { transform: none; } }
@keyframes up { from { opacity: 0; transform: translateY(18px); } }
/* A light sweep across the main button, three times then it stops */
.hero .btn-primary { position: relative; overflow: hidden; }
.hero .btn-primary::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%) -200% 0 / 200% 100% no-repeat; animation: btn-sheen 3.2s ease 2s 3; }
@keyframes btn-sheen { 0% { background-position: -200% 0; } 35%, 100% { background-position: 200% 0; } }

/* ---------- Scroll reveals (only added by motion.js to things below the fold, so nothing visible ever hides) ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease-out), transform .8s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Page transitions: native cross-page View Transitions, so clicks are never delayed ----------
   The old page blurs away, a green panel with the shield shows through, and the new page wipes in from the left.
   The header stays put. Browsers without support just load the page normally. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.site-head { view-transition-name: site-head; }
::view-transition { background: url(/logo-mark@2x.png) center / 84px no-repeat, linear-gradient(120deg, #0a7c5a, #075a41 55%, #0c1726); }
::view-transition-group(root) { animation-duration: .75s; }
::view-transition-old(root) { animation: vt-out .28s ease both; }
::view-transition-new(root) { animation: vt-in .55s cubic-bezier(.7, 0, .2, 1) .2s both; }
::view-transition-group(site-head) { animation: none; }
::view-transition-old(site-head) { display: none; }
::view-transition-new(site-head) { animation: none; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-14px) scale(.985); filter: blur(4px); } }
@keyframes vt-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- Exploit Watch rankings ---------- */
.rank-wrap { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; margin: 18px 0 44px; }
@media (max-width: 900px) { .rank-wrap { grid-template-columns: 1fr; } }
.rank { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px 14px; box-shadow: 0 20px 40px -30px rgba(14,26,43,.35); }
.rank-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.rank h3 { font-size: 1.08rem; }
.seg { display: inline-flex; background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { font: 500 .8rem var(--font); border: 0; background: none; padding: 5px 12px; border-radius: 999px; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: 0 1px 3px rgba(14,26,43,.15); }
.seg button:focus-visible { outline: 2px solid var(--guard); outline-offset: 1px; }
.rank ol { list-style: none; margin: 0; padding: 0; }
.rank li { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 4px 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.rank li:first-child { border-top: 0; }
.rank .pos { font: 600 .82rem var(--mono); color: var(--muted); }
.rank li:first-child .pos { color: var(--alert); }
.rank .name { font-weight: 600; font-size: .95rem; min-width: 0; }
.rank .name a { color: inherit; text-decoration: none; }
.rank .name a:hover { text-decoration: underline; }
.rank .name small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.rank .val { font: 500 .9rem var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.rank .bar { grid-column: 2 / 4; height: 8px; border-radius: 99px; background: var(--paper); overflow: hidden; }
.rank .bar i { display: block; height: 100%; width: var(--w); border-radius: 99px; transform-origin: left; background: linear-gradient(90deg, #f2a27e, var(--alert)); }
.rank.nets .bar i { background: linear-gradient(90deg, #7cc7ad, var(--guard)); }
.rank .mv { font: 500 .7rem var(--mono); margin-left: 6px; }
.rank .mv.up { color: var(--alert); } .rank .mv.down { color: var(--guard); }
.rank .rank-empty { display: block; color: var(--muted); font-size: .92rem; padding: 14px 0; }
.rank-foot { font-size: .8rem; color: var(--muted); margin-top: 8px; }
.rank.pending li { opacity: 0; } .rank.pending .bar i { transform: scaleX(0); }
.rank.play li { animation: up .7s var(--ease-out) both; animation-delay: calc(.1s + var(--i) * 110ms); }
.rank.play .bar i { animation: grow 1.2s var(--ease-out) both; animation-delay: calc(.2s + var(--i) * 110ms); }
@keyframes grow { from { transform: scaleX(0); } }
.xw-live::before { animation: live-pulse 1.6s ease-out infinite; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(180,65,14,.55); } 100% { box-shadow: 0 0 0 10px rgba(180,65,14,0); } }

/* ---------- Reduced motion: same layout, nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .alerts, .alerts .alert-card, .alerts .alerts-cap { transform: none !important; }
  .alerts .alert-card { opacity: 1 !important; }
  .hero-emblem img { transform: none; }
  .mark-fx svg, .mark-fx .ring, .mark-fx .sheen { display: none; }
  .reveal { opacity: 1; transform: none; }
  .rank.pending li { opacity: 1; } .rank.pending .bar i { transform: none; }
}
@media print { .hero::before, .hero::after, .hero-emblem { display: none; } .alerts, .alerts .alert-card { transform: none !important; } }
