/* Flat Modern Preset - Solid colors, no shadows, clean edges, Material-like snappy */
/*
 * SELECTOR PATTERN: Use descendant selectors [data-preset="flat-modern"] [data-*]
 * This allows data-preset on <body> to cascade to all descendant elements.
 * Templates use data-attributes (data-elevation, data-btn, etc.) without needing
 * to repeat data-preset on every element.
 *
 * NOTE: All CSS custom properties are defined in tokens.css - no fallbacks needed.
 */

/* ==========================================================================
   1. BODY BACKGROUND — Pure white, zero texture
   ========================================================================== */
[data-preset="flat-modern"] {
    background-color: #ffffff;

    /* Flat modern corner overrides: clean medium radii */
    --corner-subtle: 4px;
    --corner-default: 8px;
    --corner-bold: 12px;
    --corner-pill: 9999px;
}

/* ==========================================================================
   2. HEADING TREATMENT — Medium weight, tight letter-spacing, clean sans-serif
   ========================================================================== */
[data-preset="flat-modern"] h1,
[data-preset="flat-modern"] h2 {
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0;
    line-height: var(--line-height-tight);
}

[data-preset="flat-modern"] h3,
[data-preset="flat-modern"] h4 {
    font-weight: var(--font-weight-medium);
    letter-spacing: 0;
    line-height: 1.3;
}

[data-preset="flat-modern"] h5,
[data-preset="flat-modern"] h6 {
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.01em;
}

/* ==========================================================================
   3. LINK STYLE — No underline, color change on hover, optional bottom border
   ========================================================================== */
/* On a stored solid section background with no stored link colour, the
   brand itself may not read (a mid-grey or a translucent dark stored
   colour can sink the raw brand under 4.5:1). --ink-pick
   picks a readable ink for that one case - the SAME formula every preset
   that needs this uses, thresholded against each preset's own near-white
   page instead of cinematic-dark's dark one (cinematic-dark.css section 9
   carries the original, full comment): composite the stored colour over
   the page in gamma sRGB (so a translucent stored colour reads as mixed
   with the page, the way a browser renders it), then threshold its WCAG
   luminance - white below 0.18, black above (each clears 4.5:1 against
   every stored colour this invariant measures; black rather than this
   preset's own softer ink, same choice cinematic-dark makes, so the
   formula stays identical across presets). With no colour stored the
   custom property is invalid and the link keeps following the brand as
   before; a stored link colour always wins. */
[data-preset="flat-modern"] :where([data-section][data-bg-type="solid"]) {
    --ink-pick-bg: color(from var(--section-bg) srgb calc(alpha * r + (1 - alpha) * 1) calc(alpha * g + (1 - alpha) * 1) calc(alpha * b + (1 - alpha) * 1) / 1);
}
[data-preset="flat-modern"] :where([data-section]) a:not([data-btn]):not(:where(nav:not([data-breadcrumb]) *)) {
    color: var(--link-color, var(--ink-pick, var(--color-primary)));
    text-decoration: none;
    transition: color var(--anim-fast) cubic-bezier(0.4, 0, 0.2, 1);
}

/* An abstract_ambient section is washed with the raw brand (base.css paints
   var(--color-primary) into its radial gradients), so a link inked with the
   brand sits on a patch of itself: 1.00:1 at the wash's centre. The preset's
   own page ink reads on that wash at least as well as the body text no preset
   leaves there; a stored link colour still wins. Underlined here so the link
   stays distinguishable from the text around it now that it shares its ink. */
[data-preset="flat-modern"] :where([data-section][data-bg-type="abstract_ambient"]) a:not([data-btn]):not(:where(nav:not([data-breadcrumb]) *)) {
    color: var(--link-color, var(--color-text));
    text-decoration: underline;
}

[data-preset="flat-modern"] :where([data-section][data-bg-type="abstract_ambient"]) a:not([data-btn]):not(:where(nav:not([data-breadcrumb]) *)):hover {
    color: var(--link-hover-color, var(--color-text));
}

[data-preset="flat-modern"] :where([data-section]) a:not([data-btn]):not(:where(nav:not([data-breadcrumb]) *)):hover {
    color: var(--link-hover-color, var(--color-secondary));
    border-bottom: 2px solid currentColor;
    padding-bottom: 1px;
}

[data-preset="flat-modern"] :where([data-section]) a:not([data-btn]):not(:where(nav:not([data-breadcrumb]) *)):active {
    opacity: 0.8;
}

/* ==========================================================================
   4. BUTTON TREATMENT — Medium corners, NO shadow, solid bg, quick snap hover
   ========================================================================== */
[data-preset="flat-modern"] [data-btn="primary"] {
    background: var(--color-primary);
    color: var(--color-text-inverted);
    border: none;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--corner-default);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.01em;
    box-shadow: none;
    transition: opacity var(--anim-fast) cubic-bezier(0.4, 0, 0.2, 1),
                transform var(--anim-fast) cubic-bezier(0.4, 0, 0.2, 1);
}

[data-preset="flat-modern"] [data-btn="primary"]:hover {
    opacity: 0.88;
}

[data-preset="flat-modern"] [data-btn="secondary"] {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--corner-default);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.01em;
    box-shadow: none;
    transition: background-color var(--anim-fast) cubic-bezier(0.4, 0, 0.2, 1),
                color var(--anim-fast) cubic-bezier(0.4, 0, 0.2, 1);
}

[data-preset="flat-modern"] [data-btn="secondary"]:hover {
    background: var(--color-primary);
    color: var(--color-text-inverted);
}

[data-preset="flat-modern"] [data-btn="primary"]:active {
    transform: scale(0.97);
    opacity: 1;
}

[data-preset="flat-modern"] [data-btn="secondary"]:active {
    transform: scale(0.97);
}

/* ==========================================================================
   5. CARD STYLE — No shadow, solid background, medium corners, thin border
   ========================================================================== */
[data-preset="flat-modern"] [data-card] {
    background: var(--card-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--corner-default);
    box-shadow: none;
}

/* ==========================================================================
   6. DIVIDER PERSONALITY — Very thin, low opacity
   ========================================================================== */
[data-preset="flat-modern"] hr {
    border: none;
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: var(--spacing-lg) 0;
}

/* ==========================================================================
   7. ANIMATION TIMING — Material-like snappy
   ========================================================================== */
[data-preset="flat-modern"] {
    --preset-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-preset="flat-modern"] *,
[data-preset="flat-modern"] *::before,
[data-preset="flat-modern"] *::after {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   8. SECTION TRANSITIONS — Clean, minimal separation, solid backgrounds
   ========================================================================== */
[data-preset="flat-modern"] [data-section-id] {
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

[data-preset="flat-modern"] [data-section-id]:nth-child(even) {
    background-color: var(--color-surface-sunken);
}

/* ==========================================================================
   9. ELEVATION INTERPRETATION — NONE (no shadows), use border/bg differentiation
   ========================================================================== */
[data-preset="flat-modern"] [data-elevation="sm"] {
    box-shadow: none;
    border: 1px solid var(--color-border);
}

/* :not([data-section="announcement"]): the announcement bar owns its own
   fill (announcement-bar.css's data-style rules: solid, gradient, glass,
   outlined), keyed to the tier and the operator's stored colour. Painting
   the preset's elevation fill there as well - with higher specificity than
   announcement-bar.css's un-prefixed selectors - would win the cascade and
   replace an unfilled (outlined) or gradient-ending (no stored accent) bar
   with a surface whose ink was never picked for it.
   :not([data-bg-type="transparent"]): a transparent section's inline
   style="--section-bg: <stored colour>" still carries the operator's
   colour in the custom property - base.css's `[data-bg-type="transparent"]
   { --section-bg: transparent }` cannot out-rank an inline style attribute,
   which always wins on specificity. var(--section-bg, ...) here would
   therefore paint the stored colour as the elevation fill even though the
   section asked to render transparent, re-exposing it (and, since the
   fallback ink on this page is the same stored dark colour, sinking
   contrast to 1:1). The section's own background: transparent rule (set
   directly, not through this custom property) already renders correctly;
   this selector must leave it alone. */
[data-preset="flat-modern"] [data-elevation="md"]:not([data-card]):not([data-section="announcement"]):not([data-bg-type="transparent"]) {
    box-shadow: none;
    border: 1px solid var(--color-border);
    background-color: var(--section-bg, var(--color-surface-elevated));
}

[data-preset="flat-modern"] [data-elevation="lg"]:not([data-card]):not([data-section="announcement"]):not([data-bg-type="transparent"]) {
    box-shadow: none;
    border: 2px solid var(--color-primary);
    background-color: var(--section-bg, var(--color-surface-elevated));
}

/* ==========================================================================
   10. CORNER RADIUS INTERPRETATION — Medium (4-12px)
   ========================================================================== */
[data-preset="flat-modern"] [data-corner-style="subtle"] {
    border-radius: var(--corner-subtle);
}

[data-preset="flat-modern"] [data-corner-style="default"] {
    border-radius: var(--corner-default);
}

[data-preset="flat-modern"] [data-corner-style="bold"] {
    border-radius: var(--corner-bold);
}

[data-preset="flat-modern"] [data-corner-style="pill"] {
    border-radius: var(--corner-pill);
}

/* ==========================================================================
   11. FOCUS RING STYLE — Clean outline, matches accent color
   ========================================================================== */
[data-preset="flat-modern"] :focus-visible {
    outline: 2px solid var(--color-border-focus);
    outline-offset: 2px;
}

/* ==========================================================================
   ACCESSIBILITY: High contrast support
   ========================================================================== */
@media (prefers-contrast: high) {
    [data-preset="flat-modern"] [data-card] {
        border-width: 2px;
    }

    [data-preset="flat-modern"] [data-btn="primary"],
    [data-preset="flat-modern"] [data-btn="secondary"] {
        border: 2px solid currentColor;
    }

    [data-preset="flat-modern"] :focus-visible {
        outline-width: 3px;
    }
}

/* ==========================================================================
   ACCESSIBILITY: Reduced motion support
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    [data-preset="flat-modern"] *,
    [data-preset="flat-modern"] *::before,
    [data-preset="flat-modern"] *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    [data-preset="flat-modern"] [data-btn]:hover,
    [data-preset="flat-modern"] [data-btn]:active {
        transform: none;
    }
}

/* ==========================================================================
   HEADER / FOOTER / NAV
   ========================================================================== */

[data-preset="flat-modern"] [data-component="site-header"] {
    border-bottom: 1px solid var(--color-border);
    box-shadow: none;
}

[data-preset="flat-modern"] [data-nav-item] {
    border-radius: var(--corner-default);
    font-weight: var(--font-weight-medium);
    transition: background var(--anim-fast) cubic-bezier(0.4, 0, 0.2, 1),
                color var(--anim-fast) cubic-bezier(0.4, 0, 0.2, 1);
}

[data-preset="flat-modern"] [data-nav-item]:hover {
    background: var(--color-surface-sunken);
    /* The hover pill is flat's own light surface, so it carries flat's ink
       (the stored header colours were chosen for the header, not the pill). */
    color: var(--color-text);
}

[data-preset="flat-modern"] [data-nav-item][data-active] {
    background: rgba(var(--color-primary-rgb), 0.1);
    /* Over the unscrolled transparent bar with nothing stored behind it, the
       pill sits on flat's own page, not the header colour: the preset's own
       page ink reads on the faint brand wash under every brand (the brand
       itself, even pulled toward the page ink, falls to 3.70:1 on white
       against the 6.70:1 a light chrome leaves, and a yellow brand to 2.07). */
    color: var(--color-text);
    font-weight: var(--font-weight-semibold);
}

/* Over a first section that stored its own solid or gradient colour, the
   operator's colours are behind the bar and the preset cannot see them from
   here (nor a photo hero's pixels: dark chrome's #FBBF24 reads 8.76:1 on a
   dark photo with no preset, the preset's page ink 1.21:1): the stored header ink stays (it was chosen to read there) and the
   brand wash that would lower it is dropped, hovered or not. */
[data-preset="flat-modern"] :where([data-component="site-header"][data-transparency="transparent"]:not([data-scrolled]):is(:has(~ main > [data-section-id]:first-child > [data-section]:is([data-bg-type="solid"], [data-bg-type="gradient"])[style*="--section-bg"]), :has(~ main > [data-section-id]:first-child > [data-section][data-bg-type="image"]))) [data-nav-item][data-active] {
    color: var(--header-active);
    background: transparent;
}

/* On a bar that paints the header colour (solid, blur, scrolled), the stored
   chrome is genuinely behind the pill, so the stored active ink is correct;
   pulling the brand toward the header text left a yellow brand on a light
   chrome at 2.93:1 against the 6.70:1 no preset leaves. The brand wash is
   dropped there too: it lies between the stored ink and the stored bar, and
   took a stored #B45309 on a white bar from 5.02:1 (no preset) to 4.48:1. */
[data-preset="flat-modern"] :where([data-component="site-header"]:not([data-transparency="transparent"]:not([data-scrolled]))) [data-nav-item][data-active] {
    color: var(--header-active);
    background: transparent;
}

[data-preset="flat-modern"] [data-submenu] {
    border: 1px solid var(--color-border);
    border-radius: var(--corner-default);
    box-shadow: none;
}

[data-preset="flat-modern"] [data-submenu-item]:hover {
    background: var(--color-surface-sunken);
}

[data-preset="flat-modern"] [data-component="site-footer"] {
    border-top: 1px solid var(--color-border);
}

[data-preset="flat-modern"] [data-social-links] a {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--corner-default);
    transition: background var(--anim-fast) cubic-bezier(0.4, 0, 0.2, 1);
}

[data-preset="flat-modern"] [data-social-links] a:hover {
    background: var(--color-primary);
    color: var(--color-text-inverted);
}

[data-preset="flat-modern"] [data-footer-links] a:hover {
    color: var(--color-primary);
}

[data-preset="flat-modern"] [data-mobile-menu] {
    border-left: 1px solid var(--color-border);
    box-shadow: none;
}

/* ==========================================================================
   12. ANIM-KIT TOKENS — 3-bin (subtle ≡ moderate), snappy minimal motion
   --------------------------------------------------------------------------
   Flat Modern collapses the four animation_level bins to three: subtle and
   moderate share the same short fade. Rich earns a fade-slide but stays
   brief. Consumers reference these via var(--anim-kit-<level>) on the
   per-element animation shorthand; the animation-level data-attribute
   selects which token is active for each section.
   ========================================================================== */
[data-preset="flat-modern"] {
    --anim-kit-none:     none;
    --anim-kit-subtle:   fm-fade var(--anim-fast) ease-out both;
    --anim-kit-moderate: fm-fade var(--anim-fast) ease-out both;
    --anim-kit-rich:     fm-fade-slide var(--anim-normal) ease-out both;
}

@keyframes fm-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fm-fade-slide {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Bind anim-kit to elements with auto-animate enter behavior. Selecting
   the active level happens at the section root via data-animation-level;
   the multiplier from base.css scales the resolved duration when present. */
[data-preset="flat-modern"] [data-animation-level="none"]     [data-auto-animate] { animation: var(--anim-kit-none); }
[data-preset="flat-modern"] [data-animation-level="subtle"]   [data-auto-animate] { animation: var(--anim-kit-subtle); }
[data-preset="flat-modern"] [data-animation-level="moderate"] [data-auto-animate] { animation: var(--anim-kit-moderate); }
[data-preset="flat-modern"] [data-animation-level="rich"]     [data-auto-animate] { animation: var(--anim-kit-rich); }

/* When animation-level multiplier is zero (none), suppress the kit entirely. */
[data-preset="flat-modern"] [data-animation-level="none"] [data-auto-animate] {
    animation-duration: 0ms;
}

/* ==========================================================================
   13. SUPPRESSION — atmosphere aurora/orbs/network → none
   --------------------------------------------------------------------------
   Flat Modern is a no-atmosphere aesthetic. Any section that requests an
   atmospheric overlay collapses to a clean surface: the wrapper layer and
   its child decoration elements are hidden. The network canvas is also
   removed so the runtime particle script's output is invisible.
   ========================================================================== */
[data-preset="flat-modern"] [data-atmosphere="aurora"]  [data-atmosphere-layer],
[data-preset="flat-modern"] [data-atmosphere="orbs"]    [data-atmosphere-layer],
[data-preset="flat-modern"] [data-atmosphere="network"] [data-atmosphere-layer],
[data-preset="flat-modern"] [data-atmosphere="aurora"]  [data-atmosphere-canvas],
[data-preset="flat-modern"] [data-atmosphere="orbs"]    [data-atmosphere-canvas],
[data-preset="flat-modern"] [data-atmosphere="network"] [data-atmosphere-canvas] {
    display: none;
}

/* ==========================================================================
   14. SUPPRESSION — bg_type atmospheric → solid surface
   --------------------------------------------------------------------------
   Sections that ask for an atmospheric background fall back to the preset's
   solid surface. The base atmospheric treatment leaves the fill empty; here
   we paint it and ensure any layer/canvas decoration is hidden so the
   section reads as a clean color block.
   ========================================================================== */
[data-preset="flat-modern"] [data-section][data-bg-type="atmospheric"] {
    background-color: var(--section-bg, var(--color-surface));
}

[data-preset="flat-modern"] [data-section][data-bg-type="atmospheric"] [data-atmosphere-layer],
[data-preset="flat-modern"] [data-section][data-bg-type="atmospheric"] [data-atmosphere-canvas] {
    display: none;
}

/* ==========================================================================
   15. SUPPRESSION — hero_treatment kinetic-text / layered-asymmetric → static-image
   --------------------------------------------------------------------------
   Flat Modern strips the more visceral hero compositions. Kinetic text and
   asymmetric layered heroes are styled identically to static-image: no
   layer offsets, no text motion, no compositional skew. The text renders
   in its natural flow; the media slot reads as a single rectangular image.
   ========================================================================== */
[data-preset="flat-modern"] [data-hero-treatment="kinetic-text"],
[data-preset="flat-modern"] [data-hero-treatment="layered-asymmetric"] {
    text-align: left;
}

[data-preset="flat-modern"] [data-hero-treatment="kinetic-text"] [data-text-reveal],
[data-preset="flat-modern"] [data-hero-treatment="kinetic-text"] [data-text-slide],
[data-preset="flat-modern"] [data-hero-treatment="layered-asymmetric"] [data-layer-offset] {
    animation: none;
    transform: none;
    opacity: 1;
}

[data-preset="flat-modern"] [data-hero-treatment="layered-asymmetric"] [data-hero-media],
[data-preset="flat-modern"] [data-hero-treatment="kinetic-text"]      [data-hero-media] {
    position: static;
    transform: none;
}

/* ==========================================================================
   16. SUPPORTED HERO TREATMENTS — minimal flourish, snappy fade-in
   ========================================================================== */
[data-preset="flat-modern"] [data-hero-treatment="static-image"],
[data-preset="flat-modern"] [data-hero-treatment="parallax-image"],
[data-preset="flat-modern"] [data-hero-treatment="full-bleed-typography"],
[data-preset="flat-modern"] [data-hero-treatment="video"] {
    box-shadow: none;
}

[data-preset="flat-modern"] [data-hero-treatment="full-bleed-typography"] h1,
[data-preset="flat-modern"] [data-hero-treatment="full-bleed-typography"] h2 {
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.01em;
}

/* Parallax stays subtle: clamp the translate amount via the multiplier. */
[data-preset="flat-modern"] [data-hero-treatment="parallax-image"] [data-bg-image] {
    transition: transform var(--anim-normal) ease-out;
}

/* ==========================================================================
   17. LAYOUT INTENSITY — even gutters, modest variation
   --------------------------------------------------------------------------
   Flat Modern values consistency over density variation. The effective
   multiplier is compressed to a 0.5x range centered on 1.0 so low/medium/
   high read as roughly equivalent gutters with only a hint of breathing
   room change.
   ========================================================================== */
[data-preset="flat-modern"] [data-layout-intensity] {
    --fm-intensity: calc(0.5 * var(--layout-intensity-multiplier) + 0.5);
}

[data-preset="flat-modern"] [data-layout-intensity] [data-section] {
    padding-top:    calc(var(--spacing-xl) * var(--fm-intensity));
    padding-bottom: calc(var(--spacing-xl) * var(--fm-intensity));
}

[data-preset="flat-modern"] [data-layout-intensity] [data-grid] {
    gap: calc(var(--spacing-lg) * var(--fm-intensity));
}

/* ==========================================================================
   18. GRID ASYMMETRY — symmetric is the house style
   ========================================================================== */
[data-preset="flat-modern"] [data-grid-asymmetry="symmetric"] {
    align-items: stretch;
}

[data-preset="flat-modern"] [data-grid-asymmetry="asymmetric"],
[data-preset="flat-modern"] [data-grid-asymmetry="broken-grid"] {
    /* Tame the variant: keep alignment clean, remove any rotational flair. */
    transform: none;
    align-items: stretch;
}

/* ==========================================================================
   19. COMPOSITION STYLE — supported, tamed
   ========================================================================== */
[data-preset="flat-modern"] [data-composition-style="balanced"],
[data-preset="flat-modern"] [data-composition-style="image-dominant"],
[data-preset="flat-modern"] [data-composition-style="text-dominant"] {
    /* Default flat treatment — nothing extra. */
}

[data-preset="flat-modern"] [data-composition-style="magazine-spread"],
[data-preset="flat-modern"] [data-composition-style="founder-portrait"] {
    /* Tame editorial flourishes: items sit in normal flow, no rotation or overlap. */
    transform: none;
}

/* ==========================================================================
   20. GALLERY LAYOUT MODES — clean grid first, all modes supported
   ========================================================================== */
[data-preset="flat-modern"] [data-section="gallery"][data-layout-mode="grid"] {
    gap: var(--spacing-md);
}

[data-preset="flat-modern"] [data-section="gallery"][data-layout-mode="masonry"] {
    column-gap: var(--spacing-md);
}

[data-preset="flat-modern"] [data-section="gallery"][data-layout-mode="carousel-horizontal"],
[data-preset="flat-modern"] [data-section="gallery"][data-layout-mode="carousel-vertical"] {
    gap: var(--spacing-md);
}

[data-preset="flat-modern"] [data-section="gallery"][data-layout-mode="scroll-triggered-sequence"] [data-gallery-item] {
    transition: opacity var(--anim-fast) ease-out;
}

[data-preset="flat-modern"] [data-section="gallery"][data-layout-mode] [data-gallery-item] {
    border-radius: var(--corner-default);
    box-shadow: none;
    border: 1px solid var(--color-border);
}

/* ==========================================================================
   21. TESTIMONIALS TREATMENTS — atmospheric-quote loses its glow
   ========================================================================== */
[data-preset="flat-modern"] [data-section="testimonials"][data-treatment="single-featured"],
[data-preset="flat-modern"] [data-section="testimonials"][data-treatment="carousel"],
[data-preset="flat-modern"] [data-section="testimonials"][data-treatment="grid"],
[data-preset="flat-modern"] [data-section="testimonials"][data-treatment="two-column-editorial"] {
    box-shadow: none;
}

[data-preset="flat-modern"] [data-section="testimonials"][data-treatment="atmospheric-quote"] {
    background: var(--section-bg, var(--color-surface));
    box-shadow: none;
    text-shadow: none;
}

[data-preset="flat-modern"] [data-section="testimonials"][data-treatment="atmospheric-quote"] [data-atmosphere-layer],
[data-preset="flat-modern"] [data-section="testimonials"][data-treatment="atmospheric-quote"] [data-atmosphere-glow],
[data-preset="flat-modern"] [data-section="testimonials"][data-treatment="atmospheric-quote"] [data-atmosphere-aurora] {
    display: none;
}

[data-preset="flat-modern"] [data-section="testimonials"][data-treatment="atmospheric-quote"] blockquote {
    color: var(--body-color, var(--color-text));
    font-weight: var(--font-weight-medium);
    border-left: 3px solid var(--color-primary);
    padding-left: var(--spacing-md);
}

/* ==========================================================================
   22. STATS TREATMENTS — all supported, snappy counter animation
   ========================================================================== */
[data-preset="flat-modern"] [data-section="stats-metrics"][data-treatment="cards"] [data-component="stat"],
[data-preset="flat-modern"] [data-section="stats-metrics"][data-treatment="circular"] [data-component="stat"],
[data-preset="flat-modern"] [data-section="stats-metrics"][data-treatment="single-metric-hero"] [data-component="stat"] {
    background: var(--color-surface);
    color: var(--color-text);
    --heading-color: var(--color-text);
    --body-color: var(--color-text);
    /* Links inside the panel take its ink, not the section's link colour. */
    --link-color: var(--color-text);
    --link-hover-color: var(--color-text);
    /* data-color stat values stay readable on this panel (stats-metrics.css). */
    --stat-tone-strength: 50%;
    --stat-tone-lmax: 0.55;
    --stat-tone-cmax: 0.2;
    border: 1px solid var(--color-border);
    border-radius: var(--corner-default);
    box-shadow: none;
}
[data-preset="flat-modern"] [data-section="stats-metrics"][data-treatment="cards"] [data-component="stat"] a:not([data-btn]),
[data-preset="flat-modern"] [data-section="stats-metrics"][data-treatment="circular"] [data-component="stat"] a:not([data-btn]),
[data-preset="flat-modern"] [data-section="stats-metrics"][data-treatment="single-metric-hero"] [data-component="stat"] a:not([data-btn]) {
    /* Links in a panel wear its ink, so they need a mark besides colour
       (WCAG 1.4.1): flat-modern's own bottom bar, not a second underline. */
    text-decoration-line: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
}
[data-preset="flat-modern"] [data-section="stats-metrics"][data-treatment="cards"] [data-component="stat"] a:not([data-btn]):hover,
[data-preset="flat-modern"] [data-section="stats-metrics"][data-treatment="circular"] [data-component="stat"] a:not([data-btn]):hover,
[data-preset="flat-modern"] [data-section="stats-metrics"][data-treatment="single-metric-hero"] [data-component="stat"] a:not([data-btn]):hover {
    border-bottom-width: 2px;
}

[data-preset="flat-modern"] [data-section="stats-metrics"][data-treatment="grid"] [data-component="stat"],
[data-preset="flat-modern"] [data-section="stats-metrics"][data-treatment="row"] [data-component="stat"] {
    border: none;
    background: transparent;
    box-shadow: none;
}

[data-preset="flat-modern"] [data-section="stats-metrics"][data-treatment="animated-counter-bar"] [data-stat-value] {
    transition: width var(--anim-fast) cubic-bezier(0.4, 0, 0.2, 1);
}

[data-preset="flat-modern"] [data-section="stats-metrics"][data-treatment] [data-stat-value] {
    font-weight: var(--font-weight-bold);
    letter-spacing: -0.01em;
}

/* ==========================================================================
   23. REDUCED MOTION — neutralize anim-kit, suppression rules already static
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    [data-preset="flat-modern"] {
        --anim-kit-none:     none;
        --anim-kit-subtle:   none;
        --anim-kit-moderate: none;
        --anim-kit-rich:     none;
    }

    [data-preset="flat-modern"] [data-auto-animate] {
        animation: none;
    }

    [data-preset="flat-modern"] [data-hero-treatment="parallax-image"] [data-bg-image] {
        transition: none;
        transform: none;
    }
}

/* ==========================================================================
   24. CTA TREATMENT — make the learned `data-cta-treatment` dimension express.
   data-cta-treatment ∈ {inline-band, full-bleed, card-stack, editorial-quote}
   on the call-to-action <section>; each value yields a distinct composition
   in this preset's clean, flat, geometric language.
   Unknown / absent values fall through to the default appearance.
   ========================================================================== */

/* inline-band — a flat full-width strip, heading and buttons in one row */
[data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="inline-band"] [data-cta-content] {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-lg);
    width: 100%;
    background: var(--color-surface-sunken);
    color: var(--color-text);
    --heading-color: var(--color-text);
    --body-color: var(--color-text);
    /* Links inside the panel take its ink, not the section's link colour. */
    --link-color: var(--color-text);
    --link-hover-color: var(--color-text);
    border-radius: var(--corner-default);
    box-shadow: none;
    padding: var(--spacing-lg) var(--spacing-xl);
    text-align: left;
}
[data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="inline-band"] [data-cta-content] a:not([data-btn]) {
    /* Links in a panel wear its ink, so they need a mark besides colour
       (WCAG 1.4.1): flat-modern's own bottom bar, not a second underline. */
    text-decoration-line: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
}
[data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="inline-band"] [data-cta-content] a:not([data-btn]):hover {
    border-bottom-width: 2px;
}
[data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="inline-band"] [data-cta-buttons] {
    margin-top: 0;
    flex-shrink: 0;
}

/* full-bleed — dominant solid primary slab filling the full content width
   (visibly wider than the bounded card-stack); section overflow:hidden clips a
   100vw breakout, so we fill the content area instead. */
[data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="full-bleed"] [data-cta-content] {
    display: flex;
    width: 100%;
    max-width: none;
    margin-inline: 0;
    align-items: center;
    text-align: center;
    /* Fallback: the brand slab is deepened toward ink so its white copy
       reads on any brand colour, light brands included (see @supports below).
       It is the slab's background-COLOUR, so it stays under the brand-colour
       layer the @supports block adds and shows if that layer cannot compute. */
    background: none;
    background-color: color-mix(in srgb, var(--color-primary) 40%, #111827);
    color: #ffffff;
    --heading-color: #ffffff;
    --body-color: #ffffff;
    /* Links inside the panel take its ink, not the section's link colour. */
    --link-color: #ffffff;
    --link-hover-color: #ffffff;
    /* Badges and the icon use the accent colour; on the slab it is the ink. */
    --accent-color: #ffffff;
    border-radius: 0;
    box-shadow: none;
    padding: var(--spacing-4xl) var(--spacing-xl);
}
[data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="full-bleed"] [data-cta-content] a:not([data-btn]) {
    /* Links in a panel wear its ink, so they need a mark besides colour
       (WCAG 1.4.1): flat-modern's own bottom bar, not a second underline. */
    text-decoration-line: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
}
[data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="full-bleed"] [data-cta-content] a:not([data-btn]):hover {
    border-bottom-width: 2px;
}
[data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="full-bleed"] [data-cta-content] h2 {
    color: #ffffff;
    font-size: calc(var(--h1-font-size) * 1.15);
}

/* Buttons on the slab: a brand-coloured button would vanish into a brand
   slab, so the primary button inverts to ink-on-slab-colour and the
   secondary (outline) button takes the slab's ink. */
[data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="full-bleed"] [data-cta-content] [data-btn="primary"],
[data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="full-bleed"] [data-cta-content] [data-btn="secondary"]:hover {
    background: #ffffff;
    color: color-mix(in srgb, var(--color-primary) 40%, #111827);
    border-color: #ffffff;
}
[data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="full-bleed"] [data-cta-content] [data-btn="secondary"] {
    color: #ffffff;
    border-color: #ffffff;
}

/* Where relative colour syntax is supported the slab keeps the brand colour
   itself (nudged 0.05 in OKLCH lightness away from the ink) and picks black or
   white ink by the brand's lightness: worst case 4.86:1 across a ~9,000-colour
   sweep of brand colours. The feature query tests the EXACT expressions used
   below, so an engine that parses relative colour but not these calc/clamp
   forms keeps the fallback slab and its white ink. */
@supports (color: oklch(from red clamp(0, (0.58 - l) * 100000, 1) 0 0)) and (color: oklch(from red calc(l + clamp(-0.05, (l - 0.58) * 100000, 0.05)) c h)) {
    [data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="full-bleed"] [data-cta-content] {
        --slab-ink: oklch(from var(--color-primary) clamp(0, (0.58 - l) * 100000, 1) 0 0);
        --slab-bg: oklch(from var(--color-primary) calc(l + clamp(-0.05, (l - 0.58) * 100000, 0.05)) c h);
        background-image: linear-gradient(var(--slab-bg), var(--slab-bg));
        color: var(--slab-ink);
        --heading-color: var(--slab-ink);
        --body-color: var(--slab-ink);
        /* Links inside the panel take its ink, not the section's link colour. */
        --link-color: var(--slab-ink);
        --link-hover-color: var(--slab-ink);
        --accent-color: var(--slab-ink);
    }
    [data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="full-bleed"] [data-cta-content] a:not([data-btn]) {
        /* Links in a panel wear its ink, so they need a mark besides colour
           (WCAG 1.4.1): flat-modern's own bottom bar, not a second underline. */
        text-decoration-line: none;
        border-bottom: 1px solid currentColor;
        padding-bottom: 1px;
    }
    [data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="full-bleed"] [data-cta-content] a:not([data-btn]):hover {
        border-bottom-width: 2px;
    }
    [data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="full-bleed"] [data-cta-content] h2 {
        color: var(--slab-ink);
    }
    [data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="full-bleed"] [data-cta-content] [data-btn="primary"],
    [data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="full-bleed"] [data-cta-content] [data-btn="secondary"]:hover {
        background: var(--slab-ink);
        color: var(--slab-bg);
        border-color: var(--slab-ink);
    }
    [data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="full-bleed"] [data-cta-content] [data-btn="secondary"] {
        color: var(--slab-ink);
        border-color: var(--slab-ink);
    }
}

/* card-stack — a bounded, soft-shadow card, centered, not full width */
[data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="card-stack"] [data-cta-content] {
    max-width: 40rem;
    margin-inline: auto;
    align-items: center;
    text-align: center;
    background: var(--color-surface);
    color: var(--color-text);
    --heading-color: var(--color-text);
    --body-color: var(--color-text);
    /* Links inside the panel take its ink, not the section's link colour. */
    --link-color: var(--color-text);
    --link-hover-color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--corner-bold);
    box-shadow: var(--elevation-md);
    padding: var(--spacing-2xl);
}
[data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="card-stack"] [data-cta-content] a:not([data-btn]) {
    /* Links in a panel wear its ink, so they need a mark besides colour
       (WCAG 1.4.1): flat-modern's own bottom bar, not a second underline. */
    text-decoration-line: none;
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
}
[data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="card-stack"] [data-cta-content] a:not([data-btn]):hover {
    border-bottom-width: 2px;
}

/* editorial-quote — asymmetric, bold primary left rule, oversized heading */
[data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="editorial-quote"] [data-cta-content] {
    align-items: flex-start;
    text-align: left;
    max-width: 46rem;
    background: transparent;
    border: none;
    border-left: 4px solid var(--color-primary);
    box-shadow: none;
    padding: var(--spacing-md) var(--spacing-2xl);
}
[data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="editorial-quote"] [data-cta-content] h2 {
    font-size: calc(var(--h1-font-size) * 1.25);
    letter-spacing: -0.01em;
    line-height: 1.1;
}

/* inline-band stacks vertically on phones (matches base 599px breakpoint) */
@media (max-width: 599px) {
    [data-preset="flat-modern"] [data-section="call-to-action"][data-cta-treatment="inline-band"] [data-cta-content] {
        flex-direction: column;
        text-align: center;
    }
}
