/* ============================================================
   /assets/css/theme-unified.css
   Unified 12-Template CSS — uses ONLY CSS variables.
   All values are injected by web_templates/base-template.php
   from includes/theme-config.php (per-template config).
   No hardcoded colors, fonts, or spacing here.
   ============================================================ */

/* ===== CSS VARIABLES (fallbacks) — overwritten inline by PHP ===== */
:root {
    /* Colors */
    --nav-bg: #2c2c2c;
    --nav-text: #ffffff;
    --primary-color: #3b82f6;
    --secondary-color: #6b7280;
    --accent-color: #60a5fa;
    --text-dark: #1f2937;
    --text-light: #ffffff;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --footer-bg: #1f2937;
    --footer-text: #e5e7eb;

    /* Typography */
    --header-font: 'Inter', sans-serif;
    --header-size: 32px;
    --header-weight: 800;
    --body-font: 'Inter', sans-serif;
    --body-size: 16px;
    --body-weight: 400;
    --accent-font: 'Montserrat', sans-serif;
    --line-height: 1.6;

    /* Spacing */
    --header-padding: 15px 30px;
    --card-padding: 40px;
    --button-padding: 14px 40px;
    --border-radius: 8px;
    --button-transition: 0.3s ease;

    /* Effects (semantic, still variable-driven) */
    --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-elevated: 0 10px 30px rgba(0, 0, 0, 0.2);
    --shadow-glow: 0 0 20px var(--accent-color);

    /* WOW: Global transition tokens */
    --transition-smooth: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --transition-fast: all 0.2s ease;
    --transition-slow: all 0.5s ease-in-out;
}

/* WOW #9: Global smooth transitions for interactive elements */
button, a, input, select, textarea {
    transition: var(--transition-fast);
}

button:hover, a:hover {
    transition: var(--transition-smooth);
}

/* Quick Win #2: Staggered entrance animations — elements cascade into view */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

header.axm-nav {
    animation: slideInUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.axm-hero-wrap {
    animation: slideInUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.2s forwards;
    opacity: 0;
}

.axm-button-group {
    animation: slideInUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.4s forwards;
    opacity: 0;
}

.axm-card {
    animation: slideInUp 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.6s forwards;
    opacity: 0;
}

footer.axm-footer {
    animation: fadeIn 0.6s ease 0.8s forwards;
    opacity: 0;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    font-family: var(--body-font);
    font-size: var(--body-size);
    font-weight: var(--body-weight);
    color: var(--text-dark);
    line-height: var(--line-height);
    min-height: 100%;
}

body {
    background: var(--background);
    overflow-x: hidden;
}

a {
    color: var(--primary-color);
}

img {
    max-width: 100%;
    display: block;
}

/* ===== HEADER / NAV ===== */
/* WOW #7: Header/nav polish — professional shadow + hover depth */
header.axm-nav {
    background-color: var(--nav-bg);
    color: var(--nav-text);
    padding: var(--header-padding);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--hairline-color, color-mix(in srgb, var(--nav-text) 12%, transparent));
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transition: all 0.3s ease;
    position: relative;
    z-index: 100;
}

header.axm-nav:hover {
    box-shadow: 0 6px 30px rgba(0,0,0,0.18);
}

header.axm-nav .nav-content {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    flex-wrap: wrap;
}

header.axm-nav .logo {
    height: 28px;
    width: auto;
}

header.axm-nav .company-name {
    font-family: var(--header-font);
    font-size: var(--header-size);
    font-weight: var(--header-weight);
    line-height: 1.15;
}

header.axm-nav .phone {
    font-size: calc(var(--body-size) - 2px);
    margin-left: auto;
    opacity: 0.95;
}

/* ===== HERO SECTION (3-layer sandwich) ===== */
/* WOW #3: Hero section elevation — layered shadows + hover lift */
.axm-hero-wrap {
    position: relative;
    width: 95%;
    max-width: 900px;
    margin: 30px auto;
    aspect-ratio: 16 / 9;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25), 0 0 40px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    isolation: isolate;
    background: var(--text-dark);
}

.axm-hero-wrap:hover {
    box-shadow: 0 30px 80px rgba(0,0,0,0.35), 0 0 60px rgba(0,0,0,0.15);
    transform: translateY(-6px);
}

.axm-hero-wrap .bg-layer {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    z-index: 1;
}

/* WOW #4: Overlay gradient — multiply blend + diagonal gradient + hover opacity */
.axm-hero-wrap .overlay-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    mix-blend-mode: multiply;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.35) 100%);
    opacity: 0.9;
    transition: opacity 0.4s ease;
}

.axm-hero-wrap:hover .overlay-layer {
    opacity: 0.8;
}

.axm-hero-wrap .fg-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* Atmosphere overlay & legacy overlay layer: keep fully transparent so the
   screen-blended video (not a dark gradient) provides the "atmosphere" and the
   photo underneath stays bright. Any leftover gradient/multiply tint is wiped. */
.axm-hero-wrap .overlay-layer,
.axm-hero-wrap .axm-overlay-layer,
.axm-overlay-layer,
.overlay-layer {
    background: transparent !important;
    mix-blend-mode: screen !important;
    opacity: 1 !important;
}

/* ===== Camera Motion (Ken Burns etc.) =====
   The camera class (anim-breathe / anim-kenburns / anim-heartbeat / anim-drift)
   is applied by the generator to the hero BACKGROUND image layer only. Values
   mirror the Studio engine (assets/modules/engine/effects.js): Ken Burns scales
   1 -> 1.2 over 16 s each way with easeInOutCubic, Breathe scales 1 -> 1.06 over
   3 s out + 3 s back with a 0.5 s hold (easeInOutSine), Heartbeat pulses
   1 / 1.05 / 0.98 / 1 over ~730 ms and then pauses 700 ms. The keyframes are
   declared here with an axm- prefix so the per-structure inline
   $axmCameraKeyframesCss block (printed later in the document) cannot override
   them. Transform only; never the foreground, text or overlay layers. */
.axm-hero-wrap .bg-layer {
    transform-origin: center center;
    will-change: transform;
    backface-visibility: hidden;
}

/* Ken Burns - scale 1 -> 1.2 over 16 s each way (alternate), easeInOutCubic,
   with a gentle drift toward one corner. */
.axm-hero-wrap .bg-layer.anim-kenburns {
    animation: axm-camera-kenburns 16s cubic-bezier(0.65, 0, 0.35, 1) infinite alternate;
    /* TASK 053PB — pan aim from make-it-pop.js findFocus(), printed by the
       structure templates as inline custom properties on this same element.
       With no properties the fallbacks resolve to 50% 50%, i.e. exactly the
       previous "center center". The !important is gone on purpose: the generic
       .bg-layer rule above is the only competitor and this selector already
       outranks it, and the inline block from $axmCameraKeyframesCss carries no
       transform-origin at all. */
    transform-origin: var(--pop-ox, 50%) var(--pop-oy, 50%);
}

/* Breathe - scale 1 -> 1.06 over 3 s, back over 3 s, then a 0.5 s hold
   (6.5 s cycle), easeInOutSine. */
.axm-hero-wrap .bg-layer.anim-breathe {
    animation: axm-camera-breathe 6.5s cubic-bezier(0.37, 0, 0.63, 1) infinite;
}

/* Heartbeat - two quick pulses (1 / 1.05 / 0.98 / 1) over ~730 ms, then a
   700 ms pause (1.43 s cycle). */
.axm-hero-wrap .bg-layer.anim-heartbeat {
    animation: axm-camera-heartbeat 1.43s cubic-bezier(0.33, 1, 0.68, 1) infinite;
}

/* Drift - the Studio's Drift is a placeholder (effects.js:152-154 only logs to
   the console), so the landing page deliberately animates nothing. The value is
   also rejected by the generator's allow-list. */
.axm-hero-wrap .bg-layer.anim-drift {
    animation: none;
}

/* ===== TASK 053PC / 053PH — Pop shot sequences (Balanced / Bold) =====
   The same shots the Studio plays (effects.js POP_SHOTS_TABLE). Every shot is
   one 6 s move, ease in-out, expressed as a scale plus a transform-origin, so
   the page pushes in and drifts toward the subject exactly like the preview:

     Wide    1.00 -> 1.14, centred
     Focus 1 1.30 -> 1.55, drifting a quarter of the way toward --pop-ox/--pop-oy
     Focus 2 1.30 -> 1.50, on --pop-ox2/--pop-oy2
     Focus 3 1.55 -> 1.10, on --pop-ox3/--pop-oy3

   Balanced plays Wide, Focus 1, Focus 2 (3 x 6 s) and Bold adds Focus 3 (4 x 6 s);
   both loop back to Wide. The Studio blends the cuts over its 0.9 s crossfade;
   TASK 058E - the page no longer cuts hard: each cut is a short eased glide
   (1.6 s and 2.5 s in Balanced, 1.5 s each in Bold) that carries one shot's end
   pose onto the next shot's start pose. TASK 053PO - the WRAP from the
   last shot back to the Wide view was the one cut that was visibly wrong: the pose
   jumped from the last shot's framing straight to the wide one, on every loop. The
   cycle therefore ends with a wrap glide that eases the last shot's end pose onto
   the Wide start pose. TASK 058D - 0.9 s was too fast: it is now a 16.5 s glide
   that never travels faster than 1.5x the quickest shot, with the same ease in-out
   at both ends. The shots keep their poses and their 6 s; the cycle is 38.6 s
   (Balanced), 45 s (Bold).
   The demo zooms go through the SAME resolution rule the Studio uses:
     --pop-k: min(1, (var(--pop-zmax, 1.3) - 1) / 0.55)
     scale = 1 + (demo - 1) * --pop-k
   --pop-zmax is the photo's zoom cap, printed inline by the structure templates
   as clamp(naturalWidth / 900 * 1.4, 1.15, 2.0); with no variable at all it
   resolves to 1.3, the same default the Studio falls back to.
   --pop-ox / --pop-oy, --pop-ox2 / --pop-oy2 and --pop-ox3 / --pop-oy3 are the
   three focus points, also printed inline; without them every stop resolves to
   50% 50%, the plain centre the page used before 053PC.
   Only the background layer is touched, exactly like Ken Burns above.
   Coverage: every scale is >= 1 and every transform-origin stays inside the
   element (the Studio clamps all three points to 25%..75%), so a uniform scale
   about that point can never expose an empty edge. */
.axm-hero-wrap .bg-layer.anim-popshots-2,
.axm-hero-wrap .bg-layer.anim-popshots-3 {
    /* The resolution rule, in one place: the share of every demo zoom that the
       photo's own cap allows. */
    --pop-k: min(1, (var(--pop-zmax, 1.3) - 1) / 0.55);
}

.axm-hero-wrap .bg-layer.anim-popshots-2 {
    animation: axm-camera-popshots-2 38.6s cubic-bezier(0.65, 0, 0.35, 1) infinite;
    transform-origin: 50% 50%;
}

.axm-hero-wrap .bg-layer.anim-popshots-3 {
    animation: axm-camera-popshots-3 45s cubic-bezier(0.65, 0, 0.35, 1) infinite;
    transform-origin: 50% 50%;
}

@keyframes axm-camera-kenburns {
    0%   { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.2) translate(-2%, -2%); }
}

@keyframes axm-camera-breathe {
    0%       { transform: scale(1); }
    46.1538% { transform: scale(1.06); }
    92.3077% { transform: scale(1); }
    100%     { transform: scale(1); }
}

@keyframes axm-camera-heartbeat {
    0%    { transform: scale(1); animation-timing-function: cubic-bezier(0.33, 1, 0.68, 1); }
    7%    { transform: scale(1.05); animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1); }
    17.5% { transform: scale(1); }
    23%   { transform: scale(1); animation-timing-function: cubic-bezier(0.33, 1, 0.68, 1); }
    30%   { transform: scale(0.98); animation-timing-function: cubic-bezier(0.45, 0, 0.55, 1); }
    51%   { transform: scale(1); }
    100%  { transform: scale(1); }
}

/* TASK 053PH - Balanced: Wide (0 -> 15.5440 %), glide (-> 19.6891 %), Focus 1
   (-> 35.2332 %), glide (-> 41.7098 %), Focus 2 (-> 57.2539 %), then the 16.5 s
   wrap glide (-> 100 %), 38.6 s. Every segment carries its own ease in-out. TASK
   058E - the hard cuts are gone: a 1.6 s glide carries the Wide end pose onto the
   Focus 1 start pose, and a 2.5 s glide carries the Focus 1 end pose onto the Focus
   2 start pose, both eased in and out, so the photo never jumps between shots.
   Every shot keeps its pose and its 6 s. Focus 1 drifts a quarter of the way toward
   the centre while it pushes in, so its origin ends at 0.75 x the focus point plus
   0.25 x the centre. 100 % is the Wide start pose again, so the loop point is not a
   jump: the glide eases the Focus 2 end pose onto it, and the timing function
   declared on 57.2539 % keeps the velocity at zero on both ends. */
@keyframes axm-camera-popshots-2 {
    0%         { animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); transform: scale(1); transform-origin: 50% 50%; }
    15.5440%   { animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); transform: scale(calc(1 + 0.14 * var(--pop-k))); transform-origin: 50% 50%; }
    19.6891%   { animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); transform: scale(calc(1 + 0.30 * var(--pop-k))); transform-origin: var(--pop-ox, 50%) var(--pop-oy, 50%); }
    35.2332%   { animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); transform: scale(calc(1 + 0.55 * var(--pop-k))); transform-origin: calc(50% + (var(--pop-ox, 50%) - 50%) * 0.75) calc(50% + (var(--pop-oy, 50%) - 50%) * 0.75); }
    41.7098%   { animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); transform: scale(calc(1 + 0.30 * var(--pop-k))); transform-origin: var(--pop-ox2, 50%) var(--pop-oy2, 50%); }
    57.2539%   { animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); transform: scale(calc(1 + 0.50 * var(--pop-k))); transform-origin: var(--pop-ox2, 50%) var(--pop-oy2, 50%); }
    100%       { transform: scale(1); transform-origin: 50% 50%; }
}

/* TASK 053PH - Bold: Wide (0 -> 13.3333 %), glide (-> 16.6667 %), Focus 1
   (-> 30 %), glide (-> 33.3333 %), Focus 2 (-> 46.6667 %), glide (-> 50 %),
   Focus 3 (-> 63.3333 %), then the 16.5 s wrap glide (-> 100 %),
   45 s. The same rules as Balanced, plus the third focus point for the pull-out
   shot. TASK 058E turns its three hard cuts into three 1.5 s glides. */
@keyframes axm-camera-popshots-3 {
    0%         { animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); transform: scale(1); transform-origin: 50% 50%; }
    13.3333%   { animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); transform: scale(calc(1 + 0.14 * var(--pop-k))); transform-origin: 50% 50%; }
    16.6667%   { animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); transform: scale(calc(1 + 0.30 * var(--pop-k))); transform-origin: var(--pop-ox, 50%) var(--pop-oy, 50%); }
    30%        { animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); transform: scale(calc(1 + 0.55 * var(--pop-k))); transform-origin: calc(50% + (var(--pop-ox, 50%) - 50%) * 0.75) calc(50% + (var(--pop-oy, 50%) - 50%) * 0.75); }
    33.3333%   { animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); transform: scale(calc(1 + 0.30 * var(--pop-k))); transform-origin: var(--pop-ox2, 50%) var(--pop-oy2, 50%); }
    46.6667%   { animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); transform: scale(calc(1 + 0.50 * var(--pop-k))); transform-origin: var(--pop-ox2, 50%) var(--pop-oy2, 50%); }
    50%        { animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); transform: scale(calc(1 + 0.55 * var(--pop-k))); transform-origin: var(--pop-ox3, 50%) var(--pop-oy3, 50%); }
    63.3333%   { animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1); transform: scale(calc(1 + 0.10 * var(--pop-k))); transform-origin: var(--pop-ox3, 50%) var(--pop-oy3, 50%); }
    100%       { transform: scale(1); transform-origin: 50% 50%; }
}

/* Visitors who ask for less motion get a still hero background. */
/* Visitors who ask for less motion get a still hero background. TASK 053PC —
   the two Pop shot sequences are covered as well, so a reduced-motion visitor
   gets no shots at all. */
@media (prefers-reduced-motion: reduce) {
    .axm-hero-wrap .bg-layer.anim-breathe,
    .axm-hero-wrap .bg-layer.anim-kenburns,
    .axm-hero-wrap .bg-layer.anim-heartbeat,
    .axm-hero-wrap .bg-layer.anim-drift,
    .axm-hero-wrap .bg-layer.anim-popshots-2,
    .axm-hero-wrap .bg-layer.anim-popshots-3 {
        animation: none !important;
        transform: none !important;
        will-change: auto;
    }
    /* Belt and braces: the legacy per-structure inline .anim-* block that every
       published page still prints (api/_bootstrap.php:360-363) must not animate
       any layer either. */
    .anim-breathe,
    .anim-kenburns,
    .anim-heartbeat,
    .anim-drift,
    .anim-popshots-2,
    .anim-popshots-3 {
        animation: none !important;
    }
}

/* ===== TASK 053PG — the Light Sweep =====
   One soft diagonal warm-white band that crosses the photo, left to right, on
   the same 9 s cycle the Studio draws (assets/modules/engine/effects.js). The
   templates print this element only when the generator accepted a
   popSweepOpacity above 0, so a page without Pop keeps the exact markup it had
   before. --pop-sweep carries strength x 0.4: 0.18 Refined, 0.30 Balanced,
   0.40 Bold.
   Stacking: above the background photo (z-index 1) and the atmosphere overlay
   (z-index 5), below the foreground image (10), the visualizer (20) and every
   headline / subhead, which all live outside .axm-hero-wrap.
   The keyframes spell out transform: translateX(...) instead of the individual
   translateX() property so they also run on older browsers, and the axm- prefix
   keeps the name clear of any keyframes a page brings with it. */
.pop-sweep {
    position: absolute;
    inset: 0;
    z-index: 8;
    overflow: hidden;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: var(--pop-sweep, 0);
}

.pop-sweep::before {
    content: "";
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: 0;
    width: 55%;
    background: linear-gradient(105deg, transparent 30%, rgba(255,236,200,.85) 50%, transparent 70%);
    transform: translateX(-120%);
    animation: axm-pop-sweep 9s ease-in-out infinite;
}

@keyframes axm-pop-sweep {
    0%, 12% { transform: translateX(-120%); }
    55%, 100% { transform: translateX(260%); }
}

/* Visitors who ask for less motion get no sweep at all. */
@media (prefers-reduced-motion: reduce) {
    .pop-sweep {
        display: none !important;
    }
}

/* ===== TASK 053PI — the finishing layers (vignette, bottom scrim, film grain)
   Three more layers that belong to the photo. Each template prints ONE element,
   and only when the generator accepted a popVig / popScrim / popGrain above 0,
   so a page without Pop keeps the exact markup it had before.
   Stacking: above the background photo (z-index 1), the atmosphere overlay (5)
   and the Light Sweep (8); below the foreground image (10), the visualizer (20)
   and every headline / subhead, which all live outside .axm-hero-wrap.
   The approved demo's reference, with V = --pop-vig, S = --pop-scrim and
   G = --pop-grain, all 0..1:
     vignette  radial-gradient(ellipse at 50% 46%, transparent 42%,
               rgba(0,0,0,.7) 100%) at opacity V
     scrim     linear-gradient(to top, rgba(6,10,18,.85),
               rgba(6,10,18,0) 46%) at opacity S
     grain     greyscale fractal-noise tile, 180 px, mix-blend-mode: overlay, at
               opacity G, its position stepped every 0.15 s
   Draw order bottom to top: vignette, scrim, grain — the same order the Studio
   draws them in, on top of the photo and the sweep, below the text.
   One element, two pseudo-elements: the vignette and the scrim are the two
   background layers of ::before (the first layer paints on top, so the vignette
   is above the scrim) and the grain is ::after. An opacity on the element
   itself could not carry the vignette or the scrim — it would scale both
   pseudo-elements as well — so their alphas are scaled inside the gradients with
   calc(), which is identical: the outer stops of both gradients are fully
   transparent, so scaling the whole alpha ramp is exactly an opacity.
   The container is deliberately NOT a stacking context and NOT an isolated
   group: it has no z-index, no opacity, no filter, no transform and no
   isolation of its own, and the z-index lives on the two pseudo-elements. An
   element with a z-index would isolate the blend, and the grain would then paint
   as a flat grey wash instead of blending with the photo underneath. */
.pop-finish {
    position: absolute;
    inset: 0;
    pointer-events: none;
    /* TASK 053PL - the element is a STYLE container only (container-type: normal
       applies no size, layout, paint or style containment), so the grain layer
       can be switched off when the page was sent grain 0. It still creates no
       stacking context and no isolated group, so the grain's overlay blend keeps
       reaching the photo. */
    container-type: normal;
    container-name: pop-finish;
}

/* The vignette (second layer, painted below) and the bottom scrim (first layer,
   painted on top). TASK 053PL - the order is the order the Studio draws them in
   (vignette, then scrim, then grain), and both shapes were tightened so the
   darkened area stays small enough that the whole-frame Laplacian variance keeps
   above 95 % of the Pop-off value: the vignette is transparent up to 86 % of the
   farthest-corner radius (053PI shipped 42 %) and the scrim fades out by 24 % of
   the height (053PI shipped 46 %). The rim alphas are unchanged, so the corner
   darkening is 0.7 x --pop-vig and the bottom darkening 0.85 x --pop-scrim
   exactly as before - only the layer opacities changed (see theme-unified.css
   section note and TASK_053PL_REPORT.md). */
.pop-finish::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 9;
    background-image:
        linear-gradient(to top, rgba(6, 10, 18, calc(0.85 * var(--pop-scrim, 0))), rgba(6, 10, 18, 0) 24%),
        radial-gradient(ellipse at 50% 46%, transparent 86%, rgba(0, 0, 0, calc(0.7 * var(--pop-vig, 0))) 100%);
}

/* The 180 px greyscale noise tile, as an inline SVG: feTurbulence fractalNoise,
   four octaves, stitched so the tile repeats seamlessly — the twin of the tile
   the Studio builds once on an offscreen canvas (effects.js). feFuncA flattens
   the alpha so the tile is opaque greyscale, and color-interpolation-filters is
   sRGB so the noise is centred on mid grey exactly like the canvas tile (SVG
   filters default to linearRGB, which would push the tile's mean to ~0.73 and
   make the page's grain brighter than the Studio's). */
.pop-finish::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 9;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='axm-pop-grain-noise' filterUnits='userSpaceOnUse' x='0' y='0' width='180' height='180' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0' intercept='1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23axm-pop-grain-noise)'/%3E%3C/svg%3E");
    background-size: 180px 180px;
    background-repeat: repeat;
    mix-blend-mode: overlay;
    opacity: var(--pop-grain, 0);
    animation: axm-pop-grain 0.9s steps(1, end) infinite;
}

/* The six positions of the 0.9 s loop, in px: one jump every 0.15 s. The Studio
   jumps its tile through the same six numbers (POP_FINISH_GRAIN_OFFSETS in
   effects.js), and the axm- prefix keeps the name clear of any keyframes a page
   brings with it. */
@keyframes axm-pop-grain {
    0% { background-position: 0px 0px; }
    16.6667% { background-position: 30px 90px; }
    33.3333% { background-position: 90px 30px; }
    50% { background-position: 120px 120px; }
    66.6667% { background-position: 60px 150px; }
    83.3333% { background-position: 150px 60px; }
}

/* TASK 053PL - one tile pixel is one screen pixel here too. The SVG tile is
   180 CSS px, so on a 2x / 3x display its features would be 2 / 3 device pixels
   wide; halving / thirding the background-size keeps them exactly one device
   pixel, the same rule the Studio's canvas tile follows. The six boil positions
   are in CSS px and are unaffected. */
@media (min-resolution: 2dppx), (-webkit-min-device-pixel-ratio: 2) {
    .pop-finish::after {
        background-size: 90px 90px;
    }
}

@media (min-resolution: 3dppx), (-webkit-min-device-pixel-ratio: 3) {
    .pop-finish::after {
        background-size: 60px 60px;
    }
}

/* TASK 053PL - a page that was sent grain 0 (Pop Refined) has NO grain element:
   the style query reads the same --pop-grain custom property the opacity uses,
   and every template always prints it (a zero is printed as "0"), so the layer
   is taken out of the paint entirely instead of being painted at opacity 0.
   Browsers without style queries ignore the rule and fall through to
   opacity: 0 - invisible either way. */
@container pop-finish style(--pop-grain: 0) {
    .pop-finish::after {
        display: none;
    }
}

/* Visitors who ask for less motion keep the vignette and the scrim exactly as
   they are — they are not motion. Only the grain stops stepping: it stays, and
   it stays still. */
@media (prefers-reduced-motion: reduce) {
    .pop-finish::after {
        animation: none !important;
    }
}

/* ===== Audio Visualizer Canvas =====
   The visualizer runtime sets data-* attributes on #visualizer-canvas and
   toggles display:block/none. Hidden by default so a page with no visualizer
   effect shows nothing. */
.visualizer-canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    display: none;
    pointer-events: none;
    z-index: 20;
}

/* ===== BUTTONS ===== */
.axm-button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin: 1.5rem 0 2rem 0;
    flex-wrap: wrap;
}

a.primary-cta,
button.primary-cta,
a.secondary-cta,
button.secondary-cta {
    padding: var(--button-padding);
    border-radius: var(--border-radius);
    font-family: var(--header-font);
    font-weight: var(--header-weight);
    font-size: calc(var(--header-size) * 0.5);
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all var(--button-transition);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

/* WOW #1: Primary button — lift + glow + press feedback */
a.primary-cta,
button.primary-cta {
    background-color: var(--primary-color);
    color: var(--text-light);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

a.primary-cta:hover,
button.primary-cta:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px color-mix(in srgb, var(--axm-btn-glow, var(--primary-color)) 40%, transparent), 0 0 30px color-mix(in srgb, var(--axm-btn-glow, var(--primary-color)) 20%, transparent);
    letter-spacing: 0.5px;
}

a.primary-cta:active,
button.primary-cta:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--axm-btn-glow, var(--primary-color)) 30%, transparent);
}

/* WOW #2: Secondary button — fill + lift + press feedback */
/* TASK 500A: the secondary is a solid button painted with the theme's own
   designed pair, and its shading comes from that fill's glow token. A saved
   fill still wins inline, and a page that defines no --btn-secondary-* tokens
   keeps the previous transparent, primary-outlined look. Geometry unchanged. */
a.secondary-cta,
button.secondary-cta {
    background: var(--btn-secondary-bg, transparent);
    color: var(--btn-secondary-text, var(--primary-color));
    border: 2px solid var(--btn-secondary-bg, var(--primary-color));
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

a.secondary-cta:hover,
button.secondary-cta:hover {
    background-color: var(--btn-secondary-bg, var(--primary-color));
    color: var(--btn-secondary-text, var(--text-light));
    transform: translateY(-3px);
    box-shadow: 0 12px 32px color-mix(in srgb, var(--axm-btn-glow, var(--btn-secondary-glow, rgba(0,0,0,0.5))) 40%, transparent);
    border-color: var(--btn-secondary-bg, var(--primary-color));
}

a.secondary-cta:active,
button.secondary-cta:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--axm-btn-glow, var(--btn-secondary-glow, rgba(0,0,0,0.5))) 30%, transparent);
}

/* TASK 460A (rule C): the Card Grid content tile is painted var(--nav-bg) and its
   secondary CTA carries both .btn-secondary and .secondary-cta. The a.secondary-cta
   block above (0,1,1) outranks .btn-secondary (0,1,0) and paints the label and its
   border var(--primary-color), which on several themes is the colour behind it.
   This scoped selector (0,3,1) wins on specificity, not order, so the label and the
   border always take the tile's own text colour, on all 12 themes. */
.tile-content .cta-row a.secondary-cta,
.tile-content .cta-row button.secondary-cta,
.tile-content .cta-row .btn-secondary {
    background: transparent;
    color: var(--nav-text);
    border-color: var(--nav-text);
}
/* TASK 500A (Card Grid exception): these two CTAs sit on a tile painted
   var(--nav-bg), so the secondary keeps the outline above instead of the
   solid designed fill; only the shading is added, and it is the designed
   fill's glow, through the hover rule above. */

/* Hover effect variants driven by body[data-hover] attribute */
body[data-hover="shadow-lift"] a.primary-cta:hover,
body[data-hover="shadow-lift"] button.primary-cta:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-elevated);
}

body[data-hover="glow"] a.primary-cta:hover,
body[data-hover="glow"] button.primary-cta:hover {
    box-shadow: var(--shadow-glow);
    transform: none;
}

body[data-hover="pulse"] a.primary-cta:hover,
body[data-hover="pulse"] button.primary-cta:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-elevated);
}

body[data-hover="bounce"] a.primary-cta:hover,
body[data-hover="bounce"] button.primary-cta:hover {
    transform: translateY(-6px);
}

body[data-hover="float"] a.primary-cta:hover,
body[data-hover="float"] button.primary-cta:hover {
    transform: translateY(-3px);
}

body[data-hover="darken"] a.primary-cta:hover,
body[data-hover="darken"] button.primary-cta:hover {
    filter: brightness(0.92);
    transform: none;
}

body[data-hover="subtle"] a.primary-cta:hover,
body[data-hover="subtle"] button.primary-cta:hover {
    box-shadow: var(--shadow-elevated);
    transform: none;
}

/* Quick Win #3: Ripple effect on button click */
a.primary-cta, button.primary-cta,
a.secondary-cta, button.secondary-cta {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: rippleAnimation 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleAnimation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Quick Win #4: Success pulse feedback on primary button click */
.success-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: rgba(16, 185, 129, 0.3);
    transform: translate(-50%, -50%) scale(0);
    animation: successPulse 0.8s ease-out;
    pointer-events: none;
}

@keyframes successPulse {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0;
    }
}

/* ===== CARD (Audio) ===== */
/* WOW #5: Audio card elevation — glass-like inset + hover lift */
.axm-card {
    width: 90%;
    max-width: 900px;
    margin: 2rem auto;
    padding: var(--card-padding);
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.6);
    border: 1px solid rgba(0,0,0,0.04);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.axm-card:hover {
    box-shadow: 0 20px 60px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.6);
    transform: translateY(-4px);
    border-color: rgba(0,0,0,0.08);
}

.axm-card h2 {
    font-family: var(--header-font);
    font-size: var(--header-size);
    font-weight: var(--header-weight);
    color: var(--text-dark);  /* DARK TEXT FOR CONTRAST */
    margin-bottom: 20px;
}

/* WOW #6: Audio player polish — brightness hover + focus ring */
.axm-card audio {
    width: 100%;
    max-width: 560px;
    height: 44px;
    border-radius: calc(var(--border-radius) * 0.4);
    transition: all 0.3s ease;
    filter: brightness(0.95);
}

.axm-card audio:hover {
    filter: brightness(1.05);
}

.axm-card audio:focus {
    outline: 2px solid var(--axm-btn-glow, var(--primary-color));
    outline-offset: 4px;
    border-radius: 4px;
}

/* ===== FOOTER ===== */
/* WOW #8: Footer elegance — upward shadow + animated link underlines */
footer.axm-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 60px 20px;
    margin-top: 3rem;
    text-align: center;
    font-size: calc(var(--body-size) - 2px);
    line-height: 1.8;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
    transition: all 0.3s ease;
}

footer.axm-footer .footer-content {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
}

footer.axm-footer .footer-content p {
    line-height: 22px;
    margin: 0;
}

footer.axm-footer a {
    color: var(--footer-text);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    padding-bottom: 2px;
    border-bottom: 2px solid transparent;
}

footer.axm-footer a:hover {
    opacity: 0.8;
    border-bottom-color: var(--footer-text);
    transform: translateY(-2px);
}

footer.axm-footer a:active {
    transform: translateY(0);
}

footer.axm-footer .powered-by {
    font-size: calc(var(--body-size) - 4px);
    opacity: 0.7;
    line-height: 22px;
}

/* ===== UTILITY / RESPONSIVE ===== */
/* Center-ish helper used by buttons group */
.axm-container {
    width: 100%;
    margin: 0 auto;
}

@media (max-width: 768px) {
    header.axm-nav {
        flex-wrap: wrap;
    }

    header.axm-nav .nav-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    header.axm-nav .phone {
        margin-left: 0;
    }

    .axm-button-group {
        flex-direction: column;
    }

    a.primary-cta,
    button.primary-cta,
    a.secondary-cta,
    button.secondary-cta {
        width: 100%;
    }

    .axm-hero-wrap {
        width: 100%;
    }

    /* WOW #10: Mobile touch-friendly animations */
    a.primary-cta:hover,
    button.primary-cta:hover {
        transform: scale(1.05);
    }

    a.secondary-cta:hover,
    button.secondary-cta:hover {
        transform: scale(1.03);
    }

    .axm-hero-wrap:hover {
        transform: none;
    }

    .axm-card:hover {
        transform: translateY(-2px);
    }

    a.primary-cta:hover,
    button.primary-cta:hover {
        box-shadow: 0 12px 30px color-mix(in srgb, var(--axm-btn-glow, var(--primary-color)) 30%, transparent);
    }
}

	.d-none, [hidden] {
		display: none !important;
	}

	/* ===== Branding "Update Preview" pending indicator =====
	   The button sits quiet (idle styling) until any branding field changes, then
	   JS toggles .axm-pending so its border/glow pulses in orange (#ea580c) until
	   the user clicks it, at which point the class is removed. */
	.axm-branding-update-btn {
		transition: border-color 0.2s ease, color 0.2s ease;
	}

	.axm-branding-update-btn.axm-pending {
		animation: axmOrangeRing 2s ease-in-out infinite;
	}

	@keyframes axmOrangeRing {
		0%   { box-shadow: 0 0 0 0 rgba(234,88,12,0.45); border-color: #ea580c; color: #f2854a; }
		70%  { box-shadow: 0 0 0 6px rgba(234,88,12,0); border-color: #b8460a; color: #f2854a; }
		100% { box-shadow: 0 0 0 0 rgba(234,88,12,0); border-color: #ea580c; color: #f2854a; }
	}

	/* Base Branding Action Buttons */
	.axm-branding-btn {
	  height: 28px;
	  padding: 0 12px;
	  font-size: 11px;
	  font-weight: 600;
	  border-radius: 6px;
	  white-space: nowrap;
	  line-height: 1;
	  display: inline-flex;
	  align-items: center;
	  justify-content: center;
	  background: rgba(255, 255, 255, 0.03);
	  cursor: pointer;
	  transition: all 0.25s ease;
	}

	/* Reset Button - Subtle Muted Red */
	.axm-branding-btn--reset {
	  color: #f87171;
	  border: 1px solid rgba(239, 68, 68, 0.5);
	}
	.axm-branding-btn--reset:hover {
	  background: rgba(239, 68, 68, 0.12);
	  border-color: #ef4444;
	  color: #fca5a5;
	}

	/* Update Button - IDLE State (Default) */
	.axm-branding-btn--update {
	  color: #6b7280;
	  border: 1px solid rgba(255, 255, 255, 0.12);
	}
	.axm-branding-btn--update:hover {
	  border-color: rgba(255, 255, 255, 0.25);
	  color: #9ca3af;
	}

	/* Update Button - UNSAVED State (#ea580c Heartbeat) */
	@keyframes axm-heartbeat-orange {
	  0%, 100% {
		box-shadow: 0 0 0 0 rgba(234, 88, 12, 0);
		border-color: #ea580c;
	  }
	  50% {
		box-shadow: 0 0 10px 2px rgba(234, 88, 12, 0.45);
		border-color: #f97316;
	  }
	}

	.axm-branding-btn--update.is-unsaved {
	  color: #ea580c !important;
	  border-color: #ea580c !important;
	  background: rgba(234, 88, 12, 0.05);
	  animation: axm-heartbeat-orange 2s ease-in-out infinite;
	}
	.axm-branding-btn--update.is-unsaved i {
	  color: #ea580c !important;
	}

	/* Spinning state during compile */
	.axm-branding-btn--update.is-updating i {
	  animation: fa-spin 1s linear infinite;
	}