/* ════════════════════════════════════════════════════════════════════
   Zeroday — page atmosphere (site-wide red-gradient rhythm)
   Source: ZeroDay Landing Page — Background Direction.

   The rhythm down a page:
     hero        highlight gradient, left or right      .atm-hero-r / .atm-hero-l
     section 1   subtle, same side as the hero          .atm-s1-r   / .atm-s1-l
     section 2   no-to-minimum                          .atm-min
     section 3   subtle, opposite side                  .atm-side-l / .atm-side-r
     section 4   no-to-minimum                          .atm-min
     section 5   dual gradient on the corners           .atm-dual
     section 6   no-to-minimum                          .atm-min
     CTA         central highlight                      .atm-cta
   Longer pages repeat from section 1 (side → min → opposite → min → dual → min).

   SEAMLESS RULE: every layer is an ellipse sized in % of the section box and placed so it
   has faded to the plain canvas before the section's top and bottom edges. Adjacent
   sections therefore always meet canvas-on-canvas — no bands at the seams — and the red
   breathes in and out down the page instead of switching per section. (The hero is the one
   exception: its glow may bleed up into the nav, never down.)

   Each class is a `background` plus one ::after grain overlay (the section becomes
   position:relative + isolation:isolate; nothing else about its layout changes). Built from the site tokens so
   the light theme gets a proportionally quieter version (--atm-str scales every alpha).
   ════════════════════════════════════════════════════════════════════ */

:root{
  --atm-str: 1;                       /* alpha multiplier: 1 dark, lower in light */
  --atm-deep: #5F0909;                /* the reference's deep red */
  --atm-none: linear-gradient(var(--xy-canvas), var(--xy-canvas));
  --atm-grain: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E");
}
html.xy-light{ --atm-str: .38; --atm-deep: #B23A2E; }

/* The atmosphere must run edge to edge: the subpages box their sections in a 1280px .frame,
   which cut the gradients off with hard vertical edges on wide screens (the landing already
   removes that cap in home-v2.css). */
.frame{ max-width: none; }

.atm{
  position: relative;
  isolation: isolate;                 /* keeps the grain's blend inside this section */
  background-color: var(--xy-canvas);
  background-image: var(--atm-a), var(--atm-b), var(--atm-base);
  background-repeat: no-repeat;
}
/* Grain — done the way the reference (and the MTTR / Security pages) do it: a separate
   overlay at 8% with soft-light blending over the gradient, so it reads as texture on the
   glow rather than speckle. z-index:-1 inside the isolated section = above the gradient,
   below every piece of content. */
.atm::after{
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  opacity: .08; mix-blend-mode: soft-light;
  background-image: var(--atm-grain);
}
html.xy-light .atm::after{ opacity: .05; }

/* ---- HERO — strongest side-based red moment. Fades out by ~90% of its height. ---- */
.atm-hero-r{
  --atm-a: radial-gradient(62% 52% at 82% 34%, color-mix(in srgb, var(--xy-red) calc(23% * var(--atm-str)), transparent), transparent 68%);
  --atm-b: radial-gradient(55% 34% at 60% 70%, color-mix(in srgb, var(--atm-deep) calc(19% * var(--atm-str)), transparent), transparent 72%);
  --atm-base: radial-gradient(84% 46% at 100% 42%, color-mix(in srgb, var(--atm-deep) calc(34% * var(--atm-str)), transparent), transparent 100%);
}
.atm-hero-l{
  --atm-a: radial-gradient(62% 52% at 18% 34%, color-mix(in srgb, var(--xy-red) calc(23% * var(--atm-str)), transparent), transparent 68%);
  --atm-b: radial-gradient(55% 34% at 40% 70%, color-mix(in srgb, var(--atm-deep) calc(19% * var(--atm-str)), transparent), transparent 72%);
  --atm-base: radial-gradient(84% 46% at 0% 42%, color-mix(in srgb, var(--atm-deep) calc(34% * var(--atm-str)), transparent), transparent 100%);
}

/* ---- SECTION 1 — same side as the hero, much more subtle; picks the glow back up just
        below the seam so the hero feels continuous ---- */
.atm-s1-r{
  --atm-a: radial-gradient(58% 42% at 96% 30%, color-mix(in srgb, var(--xy-red) calc(9.5% * var(--atm-str)), transparent), transparent 71%);
  --atm-b: radial-gradient(50% 36% at 84% 52%, color-mix(in srgb, var(--atm-deep) calc(8% * var(--atm-str)), transparent), transparent 74%);
  --atm-base: radial-gradient(70% 44% at 100% 40%, color-mix(in srgb, var(--atm-deep) calc(13% * var(--atm-str)), transparent), transparent 100%);
}
.atm-s1-l{
  --atm-a: radial-gradient(58% 42% at 4% 30%, color-mix(in srgb, var(--xy-red) calc(9.5% * var(--atm-str)), transparent), transparent 71%);
  --atm-b: radial-gradient(50% 36% at 16% 52%, color-mix(in srgb, var(--atm-deep) calc(8% * var(--atm-str)), transparent), transparent 74%);
  --atm-base: radial-gradient(70% 44% at 0% 40%, color-mix(in srgb, var(--atm-deep) calc(13% * var(--atm-str)), transparent), transparent 100%);
}

/* ---- NO-TO-MINIMUM — breathing room, content takes over ---- */
.atm-min{
  --atm-a: radial-gradient(50% 34% at 90% 40%, color-mix(in srgb, var(--xy-red) calc(1.8% * var(--atm-str)), transparent), transparent 76%);
  --atm-b: radial-gradient(46% 30% at 10% 64%, color-mix(in srgb, var(--atm-deep) calc(2% * var(--atm-str)), transparent), transparent 76%);
  --atm-base: var(--atm-none);
}

/* ---- SECTION 3 — opposite-side subtle gradient, centred on the section ---- */
.atm-side-l{
  --atm-a: radial-gradient(55% 44% at 2% 50%, color-mix(in srgb, var(--xy-red) calc(9.5% * var(--atm-str)), transparent), transparent 70%);
  --atm-b: radial-gradient(48% 36% at -4% 68%, color-mix(in srgb, var(--atm-deep) calc(9% * var(--atm-str)), transparent), transparent 74%);
  --atm-base: radial-gradient(64% 48% at 0% 50%, color-mix(in srgb, var(--atm-deep) calc(14% * var(--atm-str)), transparent), transparent 100%);
}
.atm-side-r{
  --atm-a: radial-gradient(55% 44% at 98% 50%, color-mix(in srgb, var(--xy-red) calc(9.5% * var(--atm-str)), transparent), transparent 70%);
  --atm-b: radial-gradient(48% 36% at 104% 68%, color-mix(in srgb, var(--atm-deep) calc(9% * var(--atm-str)), transparent), transparent 74%);
  --atm-base: radial-gradient(64% 48% at 100% 50%, color-mix(in srgb, var(--atm-deep) calc(14% * var(--atm-str)), transparent), transparent 100%);
}

/* ---- SECTION 5 — dual gradient on the corners (upper-left / lower-right); balanced and soft ---- */
.atm-dual{
  --atm-a: radial-gradient(50% 33% at 4% 26%, color-mix(in srgb, var(--xy-red) calc(8.5% * var(--atm-str)), transparent), transparent 72%);
  --atm-b: radial-gradient(52% 30% at 98% 74%, color-mix(in srgb, var(--atm-deep) calc(12% * var(--atm-str)), transparent), transparent 72%);
  --atm-base: radial-gradient(60% 40% at 0% 30%, color-mix(in srgb, var(--atm-deep) calc(11% * var(--atm-str)), transparent), transparent 100%),
              radial-gradient(60% 40% at 100% 72%, color-mix(in srgb, var(--atm-deep) calc(12% * var(--atm-str)), transparent), transparent 100%);
}

/* ---- CTA — central highlight; more pronounced than body sections, darker than the hero.
        Returns to canvas at the bottom so it meets the footer cleanly. ---- */
.atm-cta{
  --atm-a: radial-gradient(56% 44% at 50% 50%, color-mix(in srgb, var(--xy-red) calc(20.5% * var(--atm-str)), transparent), transparent 64%);
  --atm-b: radial-gradient(72% 30% at 50% 76%, color-mix(in srgb, var(--atm-deep) calc(27% * var(--atm-str)), transparent), transparent 69%);
  --atm-base: linear-gradient(180deg,
      var(--xy-canvas) 0%,
      color-mix(in srgb, var(--xy-canvas) calc(100% - 9% * var(--atm-str)),  var(--atm-deep)) 45%,
      color-mix(in srgb, var(--xy-canvas) calc(100% - 22% * var(--atm-str)), var(--atm-deep)) 78%,
      var(--xy-canvas) 100%);
}

/* ════════════════════════════════════════════════════════════════════
   SECTION GLOW. Additive; the cycle classes above are untouched.

   Three rules:
     1. Every section gets a glow, unless it already has a big red thing, is mostly cards /
        table / screenshot, or is the last section before the CTA. Then none (.atm-min).
     2. It sits where the eye should land first: the big number, the diagram, the START of
        a flow, the CTA.
     3. Hero and CTA are big and strong (their own classes above). Everything else is this
        one class — one size, one strength (the v4 side strength), same red pair.

   Position with four numbers on the section (% of the section box):
     --atm-x / --atm-y   centre of the thing the glow sits behind
     --atm-w / --atm-h   roughly that thing's width and height
   ════════════════════════════════════════════════════════════════════ */
.atm-glow{
  --atm-x: 50%; --atm-y: 50%; --atm-w: 60%; --atm-h: 60%;
  /* Radii follow the element (--atm-w/--atm-h) but never drop below a floor, so a glow centred on a
     small element (a tab, a clock) still reads at the same weight as one behind a big diagram. */
  --atm-a: radial-gradient(max(calc(var(--atm-w) * .55), 30%) max(calc(var(--atm-h) * .55), 26%) at var(--atm-x) var(--atm-y),
             color-mix(in srgb, var(--xy-red)   calc(9.5% * var(--atm-str)), transparent), transparent 70%);
  --atm-b: radial-gradient(max(calc(var(--atm-w) * .85), 44%) max(calc(var(--atm-h) * .85), 38%) at var(--atm-x) var(--atm-y),
             color-mix(in srgb, var(--atm-deep) calc(12% * var(--atm-str)), transparent), transparent 72%);
  --atm-base: radial-gradient(max(calc(var(--atm-w) * 1.2), 60%) max(calc(var(--atm-h) * 1.1), 50%) at var(--atm-x) var(--atm-y),
             color-mix(in srgb, var(--atm-deep) calc(9% * var(--atm-str)), transparent), transparent 80%);
}

/* v5 CTA band — one oval around the headline and buttons, centred on the section (rule 3).
   Same alphas as .atm-cta, no button-weighted band; radii are % of the section box.
   --atm-x / --atm-y move the oval when the CTA content is off-centre (.pg pages). */
.atm-cta-v5{
  --atm-a: radial-gradient(30% 44% at var(--atm-x, 50%) var(--atm-y, 50%), color-mix(in srgb, var(--xy-red) calc(18% * var(--atm-str)), transparent), transparent 100%);
  --atm-b: radial-gradient(40% 50% at var(--atm-x, 50%) var(--atm-y, 50%), color-mix(in srgb, var(--atm-deep) calc(25% * var(--atm-str)), transparent), transparent 100%);
  --atm-base: var(--atm-none);
}

/* v5 hero, centred — the hero strength (same alphas as .atm-hero-*) as one central glow, for heroes whose
   content is centred (a headline over a card grid). Fades to canvas before the bottom edge. */
.atm-hero-c{
  --atm-a: radial-gradient(44% 50% at 50% 42%, color-mix(in srgb, var(--xy-red) calc(23% * var(--atm-str)), transparent), transparent 68%);
  --atm-b: radial-gradient(58% 40% at 50% 60%, color-mix(in srgb, var(--atm-deep) calc(19% * var(--atm-str)), transparent), transparent 72%);
  --atm-base: radial-gradient(80% 60% at 50% 46%, color-mix(in srgb, var(--atm-deep) calc(34% * var(--atm-str)), transparent), transparent 84%);
}

/* Pages in the .pg scope (mttr / certified / security-teams) now run on the site canvas (#0E0E11) and brand
   red, so the glows use the same alphas as every other page — no compensation. */

/* .pg CTA bands are compact (~360px), so the oval's %-radii come out small; let it fill the band's
   height (radius 50% → reaches canvas exactly at the top/bottom edges) and widen it to match. */
.pg .atm-cta-v5{
  /* vertical radius = distance to the nearer edge, so the oval reaches canvas exactly at the band's top/bottom
     wherever --atm-y sits — no band at the seam with the footer */
  --atm-ry: min(var(--atm-y, 50%), calc(100% - var(--atm-y, 50%)));
  --atm-a: radial-gradient(38% var(--atm-ry) at var(--atm-x, 50%) var(--atm-y, 50%), color-mix(in srgb, var(--xy-red) calc(18% * var(--atm-str)), transparent), transparent 100%);
  --atm-b: radial-gradient(48% var(--atm-ry) at var(--atm-x, 50%) var(--atm-y, 50%), color-mix(in srgb, var(--atm-deep) calc(25% * var(--atm-str)), transparent), transparent 100%);
}
