/* =====================================================================
   CERTAIN — MOTION PACK  (Etch global stylesheet "Motion")
   Tasteful, CSS-only motion. No JavaScript.
   Everything sits inside prefers-reduced-motion: no-preference, so
   visitors who ask their device for less motion get none of it.
   Delete this one stylesheet to remove every effect.
   ===================================================================== */

/* ---------------------------------------------------------------------
   00 · Motion tokens
   One place to tune speed, easing and the signature purple→cyan gradient.
   --------------------------------------------------------------------- */
:root {
  --m-ease: cubic-bezier(.65, 0, .35, 1);      /* smooth ease-in-out */
  --m-out:  cubic-bezier(.22, 1, .36, 1);      /* soft settle, for entrances */
  --m-fast: .35s;
  --m-slow: .7s;
  --m-grad: linear-gradient(90deg, var(--cz-secondary, #640078), var(--cz-accent, #00ffff));
  --m-grad-dark: linear-gradient(90deg, var(--cz-highlight, #713dad), var(--cz-accent, #00ffff)); /* brighter purple, reads on dark */
}

/* Registered so the glass glow position can animate smoothly (custom properties
   don't animate unless the browser knows they're a percentage). */
@property --m-gx { syntax: '<percentage>'; inherits: false; initial-value: 15%; }

/* Registered so these can animate smoothly (used by 13 ring and 18 glow). */
@property --m-ring   { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@property --m-ring-a { syntax: '<angle>';      inherits: false; initial-value: 0deg; }
@property --m-glow   { syntax: '<number>';     inherits: true;  initial-value: 0; }

/* =====================================================================
   SWITCHES — effects 13–19
   CSS effects: each block starts with  @media all {   = ON
                change it to            @media not all {   = OFF
   JavaScript effects (WPCodeBox snippet "Motion — JS effects") read these:
   ===================================================================== */
:root {
  --fx-countup: on;        /* 14 · hero stats count up      (on / off) */
  --fx-cursor-glow: on;    /* 18 · cursor glow, dark areas  (on / off) */
  --fx-cursor-trail: on;   /* 20 · cursor trail + shake logo (on / off) */
}

@media (prefers-reduced-motion: no-preference) {

  /* -------------------------------------------------------------------
     01 · Nav underline — purple→cyan, grows from the centre
     A 2px gradient bar sits under each top-level menu link at scaleX(0).
     On hover/focus/open/current page it eases out to full width from
     the middle (transform-origin: center).
     ------------------------------------------------------------------- */
  html .header-wrapper .nav__list > li > :is(a, button) {
    position: relative;                         /* anchor for the bar */
  }
  html .header-wrapper .nav__list > li > :is(a, button)::after {
    content: "";
    display: block;                             /* Mockup Styles hides this — switch back on */
    position: absolute;
    inset: auto 14px 3px 14px !important;       /* match the link's 14px side padding; !important beats the menu component's own hidden underline (top:64px) */
    height: 2px;
    border-radius: 2px;
    background: var(--m-grad) !important;       /* the component paints it solid purple otherwise */
    transform: scaleX(0);
    transform-origin: center;                   /* grow from the middle out */
    transition: transform var(--m-fast) var(--m-ease);
  }
  html .header-wrapper .nav__list > li > :is(a, button):is(:hover, :focus-visible)::after,
  html .header-wrapper .nav__list > li.is-open > button::after,
  html .header-wrapper .nav__list > li > :is(a[aria-current="page"], a.active-link)::after {
    transform: scaleX(1);
  }

  /* -------------------------------------------------------------------
     01b · Mobile menu underline — text width + 10px, grows left → right
     Mobile links are full width, so the link shrinks to its text
     (fit-content) with 10px extra on the right; the bar spans that box
     and grows from the left edge instead of the centre.
     ------------------------------------------------------------------- */
  html .header-wrapper .menu-wrapper.mobile .nav__list > li > :is(a, button) {
    width: fit-content;
    padding-right: 10px;                        /* the "+10px" — bar is text width + this */
  }
  html .header-wrapper .menu-wrapper.mobile .nav__list > li > :is(a, button)::after {
    inset: auto 0 2px 0 !important;             /* full width of the (now text-sized) link */
    transform-origin: left;                     /* left → right */
  }

  /* -------------------------------------------------------------------
     02 · Mega menu — columns drift in, one after another
     When a dropdown opens, each column fades up 8px with a 60ms stagger.
     Animation restarts every time the menu opens.
     ------------------------------------------------------------------- */
  .menu-dropdown.is-open > .menu-dropdown__content-wrapper .mega-menu__column {
    animation: m-fade-up .5s var(--m-out) both;
  }
  .menu-dropdown.is-open > .menu-dropdown__content-wrapper .mega-menu__column:nth-child(2) { animation-delay: 60ms; }
  .menu-dropdown.is-open > .menu-dropdown__content-wrapper .mega-menu__column:nth-child(3) { animation-delay: 120ms; }
  .menu-dropdown.is-open > .menu-dropdown__content-wrapper .mega-menu__column:nth-child(4) { animation-delay: 180ms; }
  .menu-dropdown.is-open > .menu-dropdown__content-wrapper .mega-menu__column:nth-child(n+5) { animation-delay: 240ms; }

  /* -------------------------------------------------------------------
     03 · Glass buttons — solid colour melts into lit purple→cyan glass
     On hover a glass layer fades in over the button: a soft cyan glow that
     drifts slowly from side to side, a white highlight on the top half, a
     hairline inner edge, and a blurred purple + cyan light underneath.
     Used on "Get Certified", the ISO finder button and filled pills.
     (Replaces the earlier light-sweep sheen — both together was too busy.)
     ------------------------------------------------------------------- */
  html .header-wrapper .header__action.is-cta,
  html .fbtn,
  html .pill.fill {
    position: relative;
    isolation: isolate;                         /* glass layer sits behind the text, above the button colour */
    transition: transform .3s var(--m-ease), box-shadow .45s var(--m-ease), background-color .45s var(--m-ease), color .3s var(--m-ease);
  }
  html .header-wrapper .header__action.is-cta::before,
  html .fbtn::before,
  html .pill.fill::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;                     /* same pill shape as the button */
    z-index: -1;
    pointer-events: none;
    background:
      radial-gradient(90% 170% at var(--m-gx) 115%, color-mix(in srgb, var(--cz-accent, #00ffff) 60%, transparent), transparent 70%),  /* the moving cyan glow */
      linear-gradient(180deg, rgb(255 255 255 / .30), rgb(255 255 255 / 0) 55%);                                                       /* glassy top highlight */
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / .22);   /* thin glass edge */
    opacity: 0;
    transition: opacity .45s var(--m-ease);
  }
  html .header-wrapper .header__action.is-cta:hover::before,
  html .fbtn:hover::before,
  html .pill.fill:hover::before {
    opacity: 1;
    animation: m-glass 3.2s var(--m-ease) infinite alternate;   /* glow drifts left ↔ right while hovered */
  }
  html .header-wrapper .header__action.is-cta:hover,
  html .fbtn:hover,
  html .pill.fill:hover {
    transform: translateY(-2px);
    box-shadow:
      0 10px 26px -10px color-mix(in srgb, var(--cz-secondary, #640078) 75%, transparent),   /* purple light underneath */
      0 16px 36px -14px color-mix(in srgb, var(--cz-accent, #00ffff) 55%, transparent);       /* cyan light, a little further out */
  }
  @keyframes m-glass { from { --m-gx: 15%; } to { --m-gx: 85%; } }

  /* -------------------------------------------------------------------
     04 · Hero entrance — calm, staggered arrival on page load
     Eyebrow, headline, intro, stats and the ISO finder fade up and come
     into focus (slight blur → sharp), 90ms apart.
     ------------------------------------------------------------------- */
  /* "html body" prefix: the hero's own record has an older fade-up (bcRise)
     on .hero .wrap>div:first-child>* — this needs to out-rank it. */
  html body .hero .wrap :is(.eyebrow, h1, .lede, .hstats, .hero-note, .finder) {
    animation: m-hero-in .9s var(--m-out) both;
  }
  html body .hero .wrap h1         { animation-delay: 90ms; }
  html body .hero .wrap .lede      { animation-delay: 180ms; }
  html body .hero .wrap .hstats    { animation-delay: 270ms; }
  html body .hero .wrap .hero-note { animation-delay: 330ms; }
  html body .hero .wrap .finder    { animation-delay: 240ms; animation-duration: 1.1s; }

  /* -------------------------------------------------------------------
     05 · Headline underline — the gradient draws itself
     Under "taken seriously." a purple→cyan line draws left to right once
     the headline has landed. Uses a background, so it wraps cleanly if
     the words break onto two lines.
     ------------------------------------------------------------------- */
  .hero h1 em {
    background-image: var(--m-grad-dark);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0% .08em;                  /* starts with no width */
    padding-bottom: .06em;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    animation: m-underline 1.1s var(--m-ease) .9s forwards;
  }

  /* -------------------------------------------------------------------
     06 · Scroll progress — hairline gradient bar at the top
     A 3px purple→cyan bar fills left to right as you scroll the page.
     Pure CSS scroll timeline; browsers without it just don't show it.
     ------------------------------------------------------------------- */
  @supports (animation-timeline: scroll()) {
    body::after {
      content: "";
      position: fixed;
      inset: var(--header-height, 0px) 0 auto 0;   /* sits just under the header nav (--header-height is set by the header script) */
      height: 3px;
      background: var(--m-grad);
      transform-origin: 0 50%;
      transform: scaleX(0);
      z-index: 9999;
      pointer-events: none;
      animation: m-progress linear both;
      animation-timeline: scroll(root);
    }
  }

  /* -------------------------------------------------------------------
     07 · Section headings — rise into view as you scroll
     Eyebrows and h2s fade up as they enter the screen (cards already
     do this via bcRise — this brings the headings in line).
     Skips the hero and sticky .split-head (scroll timelines never fire
     inside sticky elements, so the heading would stay hidden).
     ------------------------------------------------------------------- */
  @supports (animation-timeline: view()) {
    main section:not(.hero) :is(h2, .eyebrow):not(.split-head *) {
      animation: m-fade-up linear both;
      animation-timeline: view();
      animation-range: entry 5% entry 60%;
    }
  }

  /* -------------------------------------------------------------------
     08 · Logo strip — quiet until you look at it
     Client logos sit slightly faded and wake up (full strength, brand
     purple, 2px lift) on hover. The strip fades up as it scrolls in.
     ------------------------------------------------------------------- */
  .logos .lg {
    opacity: 1; /* a11y 5 Nov 2026: was .6, failed contrast */
    transition: opacity var(--m-fast) var(--m-ease),
                color var(--m-fast) var(--m-ease),
                transform var(--m-fast) var(--m-ease);
  }
  .logos .lg:hover {
    opacity: 1;
    color: light-dark(var(--cz-secondary, #640078), var(--primary));
    transform: translateY(-2px);
  }
  @supports (animation-timeline: view()) {
    .logos {                                    /* on the row, not each logo, so hover can still change opacity */
      animation: m-fade-up linear both;
      animation-timeline: view();
      animation-range: entry 10% entry 70%;
    }
  }

  /* -------------------------------------------------------------------
     09 · Standards rows — gradient edge grows from the centre
     The same signature move as the nav, turned vertical: a 3px
     purple→cyan bar grows from the middle of the row's left edge on hover.
     ------------------------------------------------------------------- */
  a.row:not(.static) {
    position: relative;
  }
  a.row:not(.static)::before {
    content: "";
    position: absolute;
    left: 0; top: 18%; bottom: 18%;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--cz-secondary, #640078), var(--cz-accent, #00ffff));
    transform: scaleY(0);
    transform-origin: center;
    transition: transform .45s var(--m-ease);
  }
  a.row:not(.static):is(:hover, :focus-visible)::before {
    transform: scaleY(1);
  }

  /* -------------------------------------------------------------------
     10 · Purple CTA — slow ambient light
     A soft cyan glow drifts very slowly behind the final call to action
     (18s loop), so the section feels lit rather than flat.
     ------------------------------------------------------------------- */
  .cta {
    position: relative;
    isolation: isolate;                         /* keeps the glow behind the text, above the bg */
    overflow: hidden;
  }
  .cta::before {
    content: "";
    position: absolute;
    width: 70%;
    aspect-ratio: 1;
    left: 15%; top: -35%;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--cz-accent, #00ffff) 18%, transparent), transparent);
    z-index: -1;
    pointer-events: none;
    animation: m-drift 18s var(--m-ease) infinite alternate;
  }

  /* -------------------------------------------------------------------
     11 · Process numbers — grey ghosts that light up in the gradient
     The big "01 02 03" behind each step are painted with a flowing
     purple→cyan gradient (background-clip: text). At rest a filter turns
     it black and opacity keeps it a faint grey ghost, as before.
     Desktop: hover the step → filter off, opacity up, gradient shows.
     Phones (no hover): the same happens as each number scrolls through
     the middle of the screen, then it fades back to grey.
     ------------------------------------------------------------------- */
  .proc .proc-ghost {
    background: linear-gradient(90deg, var(--cz-secondary, #640078), var(--cz-accent, #00ffff), var(--cz-secondary, #640078)) 0 0 / 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;                         /* let the gradient show through the digits */
    -webkit-text-fill-color: transparent;
    filter: grayscale(1) brightness(0);         /* at rest: plain dark ink... */
    opacity: .055;                              /* ...faded to the original ghost grey */
    transition: opacity .6s var(--m-ease), filter .6s var(--m-ease);
    animation: m-ghost-flow 6s linear infinite; /* gradient slowly flows (invisible while grey) */
  }
  @media (hover: hover) {
    .proc:hover .proc-ghost {
      filter: none;
      opacity: .55;
    }
  }
  @media (hover: none) {
    @supports (animation-timeline: view()) {
      .proc .proc-ghost {
        animation: m-ghost-flow 6s linear infinite, m-ghost-scroll linear both;
        animation-timeline: auto, view();       /* 1st runs on time, 2nd follows the scroll */
        animation-range: normal, cover 15% cover 85%;
      }
    }
  }

  @keyframes m-ghost-flow   { to { background-position: 200% 0; } }
  @keyframes m-ghost-scroll {
    0%, 100% { filter: grayscale(1) brightness(0); opacity: .055; }
    35%, 65% { filter: none; opacity: .55; }     /* fully lit while it's mid-screen */
  }

  /* -------------------------------------------------------------------
     12 · Cards — lift, gradient top line, soft tint and faint rings
     Every content card on the site. On hover the card rises 5px with a
     soft purple shadow, a purple→cyan line grows from the centre along
     its top edge (following the rounded corners), a faint lilac wash
     fades in from the top-left, and two thin rings (the Certain "O")
     appear in the bottom-right corner. Mouse/trackpad only — phones
     don't get stuck hover states.
     ------------------------------------------------------------------- */
  @media (hover: hover) {
    html :is(.icard, .featpost, .sisterpair__card, .prcard, .bcard, .cmcard, .tcard, .story-card, .team-card, .v2course, .ac-card, .ac-pair__card) {
      position: relative;
      isolation: isolate;                       /* keeps the tint behind the text but above the card colour */
      transition: translate .4s var(--m-ease), box-shadow .4s var(--m-ease), border-color .3s var(--m-ease);
    }
    html :is(.icard, .featpost, .sisterpair__card, .prcard, .bcard, .cmcard, .tcard, .story-card, .team-card, .v2course, .ac-card, .ac-pair__card):hover {
      transform: none;                          /* drop each card's old jump... */
      translate: 0 -5px;                        /* ...and use one consistent lift */
      box-shadow: 0 24px 44px -20px color-mix(in srgb, var(--cz-secondary, #640078) 32%, transparent);
    }
    /* Tint + rings (behind the content) */
    html :is(.icard, .featpost, .sisterpair__card, .prcard, .bcard, .cmcard, .tcard, .story-card, .team-card, .v2course, .ac-card, .ac-pair__card)::before {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;
      z-index: -1;
      pointer-events: none;
      background:
        radial-gradient(circle at 100% 100%,
          transparent 30px,
          color-mix(in srgb, var(--cz-secondary, #640078) 16%, transparent) 31px 32px,  /* inner ring, purple */
          transparent 33px 44px,
          color-mix(in srgb, var(--cz-accent, #00ffff) 34%, transparent) 45px 46px,    /* outer ring, cyan */
          transparent 47px),
        linear-gradient(155deg, color-mix(in srgb, var(--cz-highlight, #713dad) 9%, transparent), transparent 55%);  /* lilac wash */
      opacity: 0;
      transition: opacity .5s var(--m-ease);
    }
    /* Gradient top line (above everything, incl. card photos) */
    html :is(.icard, .featpost, .sisterpair__card, .prcard, .bcard, .cmcard, .tcard, .story-card, .team-card, .v2course, .ac-card, .ac-pair__card)::after {
      content: "";
      position: absolute;
      inset: 0;
      border-radius: inherit;                   /* so the line curves round the top corners */
      z-index: 2;
      pointer-events: none;
      background: var(--m-grad) top center / 0% 3px no-repeat;   /* starts with no width, centred */
      transition: background-size .55s var(--m-ease);
    }
    html :is(.icard, .featpost, .sisterpair__card, .prcard, .bcard, .cmcard, .tcard, .story-card, .team-card, .v2course, .ac-card, .ac-pair__card):hover::before { opacity: 1; }
    html :is(.icard, .featpost, .sisterpair__card, .prcard, .bcard, .cmcard, .tcard, .story-card, .team-card, .v2course, .ac-card, .ac-pair__card):hover::after  { background-size: 100% 3px; }
    html .prcard .prbadge { z-index: 3; }       /* "Most Popular" badge stays above the line */
  }


  /* =====================================================================
     13 · Hero "O" ring — the Certain ring draws itself, then breathes
     SWITCH: @media all = on · @media not all = off
     A thin purple→cyan ring (the "O" from the logo) traces itself in
     behind the headline on load (2.4s), then the gradient slowly turns
     (one lap / 14s) and the ring gently breathes (scale 1 → 1.04).
     ===================================================================== */
  @media all {
    html body .hero .wrap {
      isolation: isolate;                       /* ring sits behind the text, inside the hero */
      z-index: 1;                               /* above the cursor glow (18) */
    }
    html body .hero .wrap::before {
      content: "";
      position: absolute;
      z-index: -1;
      pointer-events: none;
      width: clamp(260px, 36vw, 540px);
      aspect-ratio: 1;
      border-radius: 50%;
      left: clamp(-140px, -7vw, -50px);
      top: 50%;
      translate: 0 -50%;
      /* one purple → cyan sweep, so you can see it travel round the ring */
      background: conic-gradient(from var(--m-ring-a), var(--cz-secondary, #640078) 0%, var(--cz-highlight, #713dad) 35%, var(--cz-accent, #00ffff) 70%, color-mix(in srgb, var(--cz-accent, #00ffff) 40%, var(--cz-secondary, #640078)) 85%, var(--cz-secondary, #640078) 100%);
      /* mask 1 = a 2px ring; mask 2 = a pie slice that grows 0 → 100% (the "drawing") */
      -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px)), conic-gradient(#000 var(--m-ring), transparent 0);
      -webkit-mask-composite: source-in;
      mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px)), conic-gradient(#000 var(--m-ring), transparent 0);
      mask-composite: intersect;
      opacity: .6;
      animation:
        m-ring-draw 2.4s var(--m-ease) .5s both,
        m-ring-spin 14s linear infinite,           /* one lap of the gradient every 14s */
        m-ring-breathe 7s var(--m-ease) 3s infinite alternate;
    }
    @keyframes m-ring-draw    { to { --m-ring: 100%; } }
    @keyframes m-ring-spin    { to { --m-ring-a: 360deg; } }
    @keyframes m-ring-breathe { to { scale: 1.04; } }
  }

  /* =====================================================================
     14 · Hero stats count up — 24hrs, £950, 13mo roll up from zero
     SWITCH: --fx-countup: on / off  (in SWITCHES at the top)
     JavaScript (WPCodeBox "Motion — JS effects") reads the number already
     on the page and counts to it, so if the client changes £950 the
     animation follows. No JS = the plain number shows.
     ===================================================================== */
  @media all {
    .hero .stat-v { font-variant-numeric: tabular-nums; }   /* digits same width = no wobble while counting */
  }

  /* =====================================================================
     15 · Photo curtain reveal — images wipe in as they scroll into view
     SWITCH: @media all = on · @media not all = off
     Card, article and team photos reveal top → bottom with a slight
     settle (scale 1.08 → 1). Browsers without scroll timelines just show
     the photo.
     ===================================================================== */
  @media all {
    @supports (animation-timeline: view()) {
      :is(.icard-photo, .fp-photo, .art-photo, .team-photo, .ph-photo > img) {
        animation: m-curtain linear both;
        animation-timeline: view();
        animation-range: entry 0% cover 30%;
      }
    }
    @keyframes m-curtain {
      from { clip-path: inset(0 0 100% 0); scale: 1.08; }
      to   { clip-path: inset(0 0 0 0);    scale: 1; }
    }
  }

  /* =====================================================================
     16 · Explore tabs — the purple pill slides to the tab you pick
     SWITCH: @media all = on · @media not all = off
     Instead of the colour jumping, one pill glides between tabs (CSS
     anchor positioning). Browsers without it keep the old jump.
     ===================================================================== */
  @media all {
    @supports (anchor-name: --m-tab) {
      .v2tabs__bar { position: relative; }
      .v2tabs__bar label { position: relative; z-index: 1; }        /* text above the pill */
      html .v2tabs:has(#t9:checked)  label[for=t9],
      html .v2tabs:has(#t14:checked) label[for=t14],
      html .v2tabs:has(#t45:checked) label[for=t45],
      html .v2tabs:has(#t27:checked) label[for=t27] {
        anchor-name: --m-tab;                   /* the chosen tab becomes the pill's target */
        background: transparent;                /* the pill paints the colour instead */
      }
      .v2tabs__bar::after {                     /* ::after = after the labels, so it can use them as anchors */
        content: "";
        position: absolute;
        position-anchor: --m-tab;
        top: anchor(top); bottom: anchor(bottom);
        left: anchor(left); right: anchor(right);
        border-radius: 99px;
        background: var(--p9, #500a77);
        z-index: 0;
        transition: left .45s var(--m-ease), right .45s var(--m-ease), top .45s var(--m-ease), bottom .45s var(--m-ease);
      }
    }
  }

  /* =====================================================================
     17 · FAQs — smooth open and close, + turns into ×
     SWITCH: @media all = on · @media not all = off
     Answers slide open instead of snapping (FAQ page and ISO pages).
     Browsers without ::details-content just snap, as before.
     ===================================================================== */
  @media all {
    :is(details.faqi, details.iso9-faq__item) { interpolate-size: allow-keywords; }   /* lets height animate to "auto" */
    @supports selector(::details-content) {
      :is(details.faqi, details.iso9-faq__item)::details-content {
        block-size: 0;
        overflow-y: clip;
        transition: block-size .45s var(--m-ease), content-visibility .45s allow-discrete;
      }
      :is(details.faqi, details.iso9-faq__item)[open]::details-content { block-size: auto; }
    }
    :is(.faqic, .iso9-faq__icon) { display: inline-block; transition: transform .35s var(--m-ease); }
    details[open] > summary :is(.faqic, .iso9-faq__icon) { transform: rotate(45deg); }
  }

  /* =====================================================================
     18 · Cursor glow — a soft cyan light follows the mouse on dark areas
     SWITCH: --fx-cursor-glow: on / off  (in SWITCHES at the top)
     Hero, dark sections and the purple CTA. JavaScript only passes the
     mouse position (--mx/--my) and adds .m-glow-on; the look is all here.
     Mouse/trackpad only; phones never see it.
     ===================================================================== */
  @media all {
    html body :is(.hero, .sec--dark.sec, .cta) { transition: --m-glow .6s var(--m-ease); }
    .m-glow-on { --m-glow: 1; }                 /* fades the glow in/out */
    html body :is(.sec--dark.sec, .cta) {
      background-image: radial-gradient(560px circle at var(--mx, 50%) var(--my, 50%),
        color-mix(in srgb, var(--cz-accent, #00ffff) calc(var(--m-glow) * 10%), transparent), transparent 70%);
    }
    html body .hero::after {                    /* hero already uses its background for the photo */
      content: "";
      position: absolute;
      inset: 0;
      z-index: 0;
      pointer-events: none;
      background: radial-gradient(620px circle at var(--mx, 50%) var(--my, 50%),
        color-mix(in srgb, var(--cz-accent, #00ffff) calc(var(--m-glow) * 12%), transparent), transparent 70%);
    }
  }

  /* =====================================================================
     19 · Film grain on the purple CTA — premium, not flat
     SWITCH: @media all = on · @media not all = off
     A very faint noise texture over the CTA (SVG noise, no image file).
     ===================================================================== */
  @media all {
    .cta::after {
      content: "";
      position: absolute;
      inset: 0;
      z-index: -1;                              /* behind the text, over the purple + glow */
      pointer-events: none;
      opacity: .14;
      mix-blend-mode: soft-light;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    }
  }


  /* =====================================================================
     20 · Cursor trail — little Certain logos follow the mouse.
          Shake the mouse and a big logo appears round it (like the Mac).
     SWITCH: --fx-cursor-trail: on / off  (in SWITCHES at the top)
     JavaScript (WPCodeBox snippet 21 "Motion — cursor trail") makes the
     rings and moves them; the look is all here. Mouse/trackpad only.
     ===================================================================== */
  @media all {
    :root { --ct-purple: var(--cz-secondary, #640078); --ct-cyan: #74f0fc; }  /* cyan eyeballed from the logo */

    /* Every ring = the Certain mark: thick "O", cyan right half, purple left half */
    .ct-ring {
      position: fixed; left: 0; top: 0;          /* JS moves it with transform */
      border-radius: 50%;
      pointer-events: none;                      /* never blocks clicks */
      z-index: 99999;
      background: conic-gradient(var(--ct-cyan) 0 50%, var(--ct-purple) 0 100%);  /* starts at 12 o'clock, clockwise */
      -webkit-mask: radial-gradient(farthest-side, transparent 46%, #000 47%);    /* the hole in the middle */
              mask: radial-gradient(farthest-side, transparent 46%, #000 47%);
      opacity: 0;                                /* hidden until the mouse moves */
      transition: opacity .3s;
      will-change: transform;
    }
    html.ct-on .ct-ring { opacity: var(--o, .5); }   /* each trail ring has its own strength */

    /* Big shake logo: colours sit on a child that turns, so the halves swirl */
    .ct-big { width: 96px; height: 96px; background: none; transition: none; }  /* JS fades this one */
    .ct-big::before {
      content: "";
      position: absolute; inset: 0;
      border-radius: 50%;
      background: conic-gradient(var(--ct-cyan) 0 50%, var(--ct-purple) 0 100%);
      animation: ct-turn 2.4s linear infinite;
    }
    @keyframes ct-turn { to { rotate: 360deg; } }
  }

  /* -------------------------------------------------------------------
     Keyframes
     ------------------------------------------------------------------- */
  @keyframes m-fade-up   { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  @keyframes m-hero-in   { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
  @keyframes m-underline { to { background-size: 100% .08em; } }
  @keyframes m-progress  { to { transform: scaleX(1); } }
  @keyframes m-drift     { from { transform: translate(-18%, 0) scale(1); } to { transform: translate(18%, 30%) scale(1.15); } }
}

