/* 
 * Websly Theme System v3.0 - Global Tokens
 * These static tokens form the foundation for spacing, typography, radius, shadow, and motion.
 * They are defined before utility classes so that Tailwind can consume them seamlessly.
 */

:root {
    /* =========================================
     Typography Tokens (Fluid Clamps)
     ========================================= */
    --text-xs: clamp(0.7rem, 0.7rem + 0.1vw, 0.75rem);
    --text-sm: clamp(0.8rem, 0.8rem + 0.15vw, 0.875rem);
    --text-base-size: clamp(0.95rem, 0.9rem + 0.25vw, 1.125rem);
    --text-lg: clamp(1.1rem, 1rem + 0.5vw, 1.25rem);
    --text-xl: clamp(1.2rem, 1.1rem + 0.75vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
    --text-3xl: clamp(1.8rem, 1.5rem + 1.5vw, 2.5rem);
    --text-4xl: clamp(2rem, 1.8rem + 2vw, 3.5rem);
    --text-5xl: clamp(2.5rem, 2rem + 3vw, 4.5rem);
    --text-6xl: clamp(3rem, 2.5rem + 4vw, 6rem);
    --text-7xl: clamp(3.5rem, 3rem + 5vw, 8rem);

    /* =========================================
     Spacing Tokens (Inner Element Rhythm)
     ========================================= */
    --space-2xs: 0.25rem;
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;

    /* =========================================
     Section Spacing Tokens (Outer Paddings)
     ========================================= */
    --section-space-sm: clamp(2rem, 4vw, 4rem);
    --section-space-md: clamp(3rem, 6vw, 6rem);
    --section-space-lg: clamp(4rem, 8vw, 8rem);
    --section-space-xl: clamp(6rem, 12vw, 12rem);

    /* =========================================
     Radius Tokens
     ========================================= */
    --radius-none: 0px;
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-3xl: 3rem;
    --radius-4xl: 4rem;
    --radius-full: 9999px;

    /* =========================================
     Shadow & Elevation Tokens
     Using fallback hex for black, to be themed via RGBA where needed
     ========================================= */
    --shadow-none: none;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* A brand-colored diffuse glow - the color will be overridden dynamically per theme if needed,
     but we provide a default that uses the theme accent variable */
    --shadow-glow: 0 0 20px 0 color-mix(in srgb, var(--theme-accent) 40%, transparent);

    /* =========================================
     Motion Tokens
     ========================================= */
    --duration-fast: 0.15s;
    --duration-normal: 0.3s;
    --duration-slow: 0.5s;
    --ease-default: ease;
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Lordicon Integration */
lord-icon {
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
}

.dark {
    /* Dark mode shadow variations — heavier black for when drop shadows are used on elevated overlays */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

/* =========================================
   Universal Wrapper CSS Utilities
   These map the tokens directly to utility classes used by websly_get_wrapper_attrs()
   ========================================= */

/* Top Padding */
.ws-pt-none {
    padding-top: 0 !important;
}

.ws-pt-2xs {
    padding-top: var(--space-2xs);
}

.ws-pt-xs {
    padding-top: var(--space-xs);
}

.ws-pt-sm {
    padding-top: var(--space-sm);
}

.ws-pt-md {
    padding-top: var(--space-md);
}

.ws-pt-lg {
    padding-top: var(--space-lg);
}

.ws-pt-xl {
    padding-top: var(--space-xl);
}

.ws-pt-2xl {
    padding-top: var(--space-2xl);
}

.ws-pt-section-sm {
    padding-top: var(--section-space-sm);
}

.ws-pt-section-md {
    padding-top: var(--section-space-md);
}

.ws-pt-section-lg {
    padding-top: var(--section-space-lg);
}

.ws-pt-section-xl {
    padding-top: var(--section-space-xl);
}

/* Bottom Padding */
.ws-pb-none {
    padding-bottom: 0 !important;
}

.ws-pb-2xs {
    padding-bottom: var(--space-2xs);
}

.ws-pb-xs {
    padding-bottom: var(--space-xs);
}

.ws-pb-sm {
    padding-bottom: var(--space-sm);
}

.ws-pb-md {
    padding-bottom: var(--space-md);
}

.ws-pb-lg {
    padding-bottom: var(--space-lg);
}

.ws-pb-xl {
    padding-bottom: var(--space-xl);
}

.ws-pb-2xl {
    padding-bottom: var(--space-2xl);
}

.ws-pb-section-sm {
    padding-bottom: var(--section-space-sm);
}

.ws-pb-section-md {
    padding-bottom: var(--section-space-md);
}

.ws-pb-section-lg {
    padding-bottom: var(--section-space-lg);
}

.ws-pb-section-xl {
    padding-bottom: var(--section-space-xl);
}

/* Top Margin */
.ws-mt-none {
    margin-top: 0 !important;
}

.ws-mt-2xs {
    margin-top: var(--space-2xs);
}

.ws-mt-xs {
    margin-top: var(--space-xs);
}

.ws-mt-sm {
    margin-top: var(--space-sm);
}

.ws-mt-md {
    margin-top: var(--space-md);
}

.ws-mt-lg {
    margin-top: var(--space-lg);
}

.ws-mt-xl {
    margin-top: var(--space-xl);
}

.ws-mt-2xl {
    margin-top: var(--space-2xl);
}

/* Bottom Margin */
.ws-mb-none {
    margin-bottom: 0 !important;
}

.ws-mb-2xs {
    margin-bottom: var(--space-2xs);
}

.ws-mb-xs {
    margin-bottom: var(--space-xs);
}

.ws-mb-sm {
    margin-bottom: var(--space-sm);
}

.ws-mb-md {
    margin-bottom: var(--space-md);
}

.ws-mb-lg {
    margin-bottom: var(--space-lg);
}

.ws-mb-xl {
    margin-bottom: var(--space-xl);
}

.ws-mb-2xl {
    margin-bottom: var(--space-2xl);
}

/* Visibility Utilities */
@media (max-width: 767px) {
    .ws-hide-mobile {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .ws-hide-desktop {
        display: none !important;
    }
}

/* Radius Utilities */
.ws-radius-none {
    border-radius: var(--radius-none);
}

.ws-radius-sm {
    border-radius: var(--radius-sm);
}

.ws-radius-md {
    border-radius: var(--radius-md);
}

.ws-radius-lg {
    border-radius: var(--radius-lg);
}

.ws-radius-xl {
    border-radius: var(--radius-xl);
}

.ws-radius-2xl {
    border-radius: var(--radius-2xl);
}

.ws-radius-3xl {
    border-radius: var(--radius-3xl);
}

.ws-radius-4xl {
    border-radius: var(--radius-4xl);
}

.ws-radius-full {
    border-radius: var(--radius-full);
}

.ws-radius-pill {
    border-radius: var(--radius-full);
}

/* Shadow Utilities */
.ws-shadow-none {
    box-shadow: var(--shadow-none);
}

.ws-shadow-sm {
    box-shadow: var(--shadow-sm);
}

.ws-shadow-md {
    box-shadow: var(--shadow-md);
}

.ws-shadow-lg {
    box-shadow: var(--shadow-lg);
}

.ws-shadow-glow {
    box-shadow: var(--shadow-glow);
}

/* Elevation Aliases (v4.0 Schema) */
.ws-elevation-none {
    box-shadow: var(--shadow-none);
}

.ws-elevation-low {
    box-shadow: var(--shadow-sm);
}

.ws-elevation-normal {
    box-shadow: var(--shadow-md);
}

.ws-elevation-high {
    box-shadow: var(--shadow-lg);
}

.ws-elevation-glow {
    box-shadow: var(--shadow-glow);
}

/* Card Density Utilities */
.ws-card-density-cozy {
    padding: 1.25rem !important;
}

.ws-card-density-default {
    padding: 1.5rem !important;
}

.ws-card-density-spacious {
    padding: 2.5rem !important;
}

/* Grid Gaps matching density */
.ws-grid-gap-cozy {
    gap: 1rem !important;
}

.ws-grid-gap-default {
    gap: 1.5rem !important;
}

.ws-grid-gap-spacious {
    gap: 2.5rem !important;
}

/* Hover Effects */
.ws-hover-lift {
    transition: transform var(--duration-normal) var(--ease-smooth), box-shadow var(--duration-normal) var(--ease-smooth);
}

.ws-hover-lift:hover {
    transform: translateY(-4px);
}

.ws-hover-scale {
    transition: transform var(--duration-normal) var(--ease-smooth);
}

.ws-hover-scale:hover {
    transform: scale(1.02);
}

.ws-hover-shadow-bright {
    transition: box-shadow var(--duration-normal) var(--ease-smooth);
}

.ws-min-h-fullscreen {
    min-height: 100vh !important;
    min-height: 100dvh !important;
}

.ws-min-h-90vh {
    min-height: 90vh !important;
    min-height: 90dvh !important;
}

.ws-min-h-80vh {
    min-height: 80vh !important;
    min-height: 80dvh !important;
}

.ws-min-h-70vh {
    min-height: 70vh !important;
    min-height: 70dvh !important;
}

.ws-min-h-60vh {
    min-height: 60vh !important;
    min-height: 60dvh !important;
}

/* =========================================
   Typography Scaling Utilities
   ========================================= */
.ws-text-xs {
    font-size: var(--text-xs);
}

.ws-text-sm {
    font-size: var(--text-sm);
}

.ws-text-base {
    font-size: var(--text-base-size);
}

.ws-text-lg {
    font-size: var(--text-lg);
}

.ws-text-xl {
    font-size: var(--text-xl);
}

.ws-text-2xl {
    font-size: var(--text-2xl);
}

.ws-text-3xl {
    font-size: var(--text-3xl);
}

.ws-text-4xl {
    font-size: var(--text-4xl);
}

.ws-text-5xl {
    font-size: var(--text-5xl);
}

.ws-text-6xl {
    font-size: var(--text-6xl);
}

.ws-text-7xl {
    font-size: var(--text-7xl);
}

/* ── Fluid Typography Tokens (2026 Canonical) ──────────────────────────── */

/* Section content titles — used in non-hero sections */
.text-section-title {
    font-size: clamp(2rem, 4vw + 0.5rem, 4rem);
    line-height: 1.1;
    letter-spacing: -0.025em;
}

/* Section description / lead text */
.text-section-subtitle {
    font-size: clamp(1.0625rem, 1.25vw + 0.25rem, 1.375rem);
    line-height: 1.6;
}

.ws-italic {
    font-style: italic;
}

.ws-font-serif {
    font-family: var(--font-drama);
}

.ws-font-sans {
    font-family: var(--font-primary);
}

.ws-font-mono {
    font-family: var(--font-ui);
}

/* Hero display sizes — modern agency scale 2026 */

/* Massive statement text — used for hero-title variant */
.text-hero-title {
    font-size: clamp(3rem, 6vw + 0.5rem, 6.5rem);
    line-height: 1.0;
    letter-spacing: -0.04em;
}

/* Primary hero heading — default for hero H1 */
.text-fluid-h1 {
    font-size: clamp(2.75rem, 5vw + 0.5rem, 5.5rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
}

/* Secondary hero heading / large section titles */
.text-fluid-h2 {
    font-size: clamp(2rem, 3.5vw + 0.5rem, 4rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

/* Sub-section titles */
.text-fluid-h3 {
    font-size: clamp(1.5rem, 2vw + 0.5rem, 2.75rem);
    line-height: 1.2;
    letter-spacing: -0.015em;
}

.text-7xl {
    font-size: var(--text-7xl, 4.5rem);
}

.text-6xl {
    font-size: var(--text-6xl, 3.75rem);
}

.text-5xl {
    font-size: var(--text-5xl, 3rem);
}

.text-4xl {
    font-size: var(--text-4xl, 2.25rem);
}

.text-3xl {
    font-size: var(--text-3xl, 1.875rem);
}

.text-2xl {
    font-size: var(--text-2xl, 1.5rem);
}

.text-xl {
    font-size: var(--text-xl, 1.25rem);
}

.text-lg {
    font-size: var(--text-lg, 1.125rem);
}

.text-base {
    font-size: var(--text-base-size, 1rem);
}

.text-sm {
    font-size: var(--text-sm, 0.875rem);
}

.text-xs {
    font-size: var(--text-xs, 0.75rem);
}

.text-strong {
    color: var(--theme-text-strong);
}

.text-muted {
    color: var(--theme-text-muted);
}

.text-theme-text-strong {
    color: var(--theme-text-strong);
}

.text-theme-text-muted {
    color: var(--theme-text-muted);
}

.text-theme-text {
    color: var(--theme-text);
}

.text-theme-text-on-accent {
    color: var(--theme-text-on-accent, #fff);
}

/* =========================================
   vNext Decoupled Architecture Utilities
   These consume the structural variables set by Personalities / Global Tokens
   ========================================= */

/* --- 1. Spacing & Density (Section/Card) --- */
.ws-section-density-none {
    padding-top: 0;
    padding-bottom: 0;
}

.ws-section-density-compact {
    padding-top: var(--section-space-sm);
    padding-bottom: var(--section-space-sm);
}

.ws-section-density-default {
    padding-top: var(--section-space-md);
    padding-bottom: var(--section-space-md);
}

.ws-section-density-spacious {
    padding-top: var(--section-space-lg);
    padding-bottom: var(--section-space-lg);
}

.ws-section-density-hero {
    padding-top: var(--section-space-xl);
    padding-bottom: var(--section-space-xl);
}

.ws-card-density-none {
    padding: 0;
}

.ws-card-density-cozy {
    padding: var(--space-sm);
    gap: var(--space-sm);
}

.ws-card-density-default {
    padding: var(--space-md);
    gap: var(--space-md);
}

.ws-card-density-spacious {
    padding: var(--space-lg);
    gap: var(--space-lg);
}

/* --- 2. Surface Model (3-Axis) --- */

/* Axis A: Material */
.ws-mat-solid {
    background-color: var(--surface-bg-color, var(--theme-surface));
}

.ws-mat-glass {
    background-color: var(--surface-bg-glass, rgba(var(--bg-base-rgb), 0.50));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.ws-mat-transparent {
    background-color: transparent;
}

/* ── Ultra-Modern Materials (5.1 Extended Library) ────────────────────────── */

/* Satin: opaque fill + diagonal sheen band (premium fabric/brushed metal) */
.ws-mat-satin {
    background-color: var(--surface-bg-color, var(--theme-surface));
    background-image: linear-gradient(135deg,
            rgba(255, 255, 255, 0.10) 0%,
            rgba(255, 255, 255, 0.00) 45%,
            rgba(255, 255, 255, 0.07) 100%);
}

/* Shimmer: prismatic iridescent sheen with a whisper of brand accent */
.ws-mat-shimmer {
    background-color: var(--surface-bg-color, var(--theme-surface));
    background-image: linear-gradient(115deg,
            rgba(255, 255, 255, 0.00) 15%,
            rgba(255, 255, 255, 0.14) 38%,
            rgba(var(--theme-accent-rgb), 0.06) 50%,
            rgba(255, 255, 255, 0.00) 75%);
}

/* Chrome: metallic horizontal banding (polished steel / aluminium) */
.ws-mat-chrome {
    background-color: var(--surface-bg-color, var(--theme-surface));
    background-image: linear-gradient(180deg,
            rgba(255, 255, 255, 0.18) 0%,
            rgba(255, 255, 255, 0.04) 25%,
            rgba(0, 0, 0, 0.06) 55%,
            rgba(255, 255, 255, 0.12) 80%,
            rgba(255, 255, 255, 0.06) 100%);
}

/* Velvet: corner gradient vignette — deep fabric-like shadow and highlight */
.ws-mat-velvet {
    background-color: var(--surface-bg-color, var(--theme-surface));
    background-image:
        linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0%, transparent 42%),
        linear-gradient(315deg, rgba(0, 0, 0, 0.14) 0%, transparent 42%),
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.01) 0%, rgba(0, 0, 0, 0.10) 100%);
}

/* Mesh: dual radial accent glow — depth through brand colour gradients */
.ws-mat-mesh {
    background-color: var(--surface-bg-color, var(--theme-surface));
    background-image:
        radial-gradient(ellipse at 18% 82%, rgba(var(--theme-accent-rgb), 0.11) 0%, transparent 55%),
        radial-gradient(ellipse at 82% 18%, rgba(var(--theme-accent-rgb), 0.07) 0%, transparent 50%);
}

/* Mica: Windows 11-style acrylic — translucent, colour-saturated, brand-tinted */
.ws-mat-mica {
    background-color: var(--surface-bg-glass, rgba(var(--bg-base-rgb), 0.50));
    backdrop-filter: blur(28px) saturate(180%) brightness(1.04);
    -webkit-backdrop-filter: blur(28px) saturate(180%) brightness(1.04);
    background-image: linear-gradient(135deg,
            rgba(var(--theme-accent-rgb), 0.04) 0%,
            transparent 55%,
            rgba(var(--theme-accent-rgb), 0.02) 100%);
}

/* Frosted Dark: heavy glass — deep blur, saturation boost, rich frosted depth */
.ws-mat-frosted-dark {
    background-color: var(--surface-bg-glass, rgba(var(--bg-base-rgb), 0.50));
    backdrop-filter: blur(32px) saturate(150%);
    -webkit-backdrop-filter: blur(32px) saturate(150%);
    background-image: linear-gradient(180deg,
            rgba(255, 255, 255, 0.04) 0%,
            rgba(0, 0, 0, 0.06) 100%);
}

/* Axis B: Tone (Surface Ownership Model) 
   Visible materials (solid/glass) define a local contrast root for descendants.
   Transparent materials inherit context from the parent. */

/* 1. Standard Context: Base & Subtle (Forced Contrast Surfaces) */
:is(.ws-mat-solid, .ws-mat-satin, .ws-mat-shimmer, .ws-mat-chrome, .ws-mat-velvet, .ws-mat-mesh, .ws-mat-glass, .ws-mat-mica, .ws-mat-frosted-dark).ws-tone-base {
    /* Background Surface (Shadowed from Page) */
    --surface-bg-color: var(--page-bg-base);
    --surface-bg-glass: rgba(var(--page-bg-base-rgb), 0.50);
    --bg-base-rgb: var(--page-bg-base-rgb);
    --bg-surface-rgb: var(--page-bg-base-rgb);

    /* Text & Contrast Root (Local Tone Shadowing) */
    color: var(--text-base);
    --text-base: var(--page-text-base);
    --text-base-rgb: var(--page-text-base-rgb);
    --text-strong: var(--page-text-strong);
    --text-strong-rgb: var(--page-text-strong-rgb);
    --text-muted: var(--page-text-muted);
    --text-muted-rgb: var(--page-text-muted-rgb);

    /* Global Aliases for descendants */
    --theme-text: var(--text-base);
    --theme-text-rgb: var(--text-base-rgb);
    --theme-text-strong: var(--text-strong);
    --theme-text-muted: var(--text-muted);
    --ws-card-title: var(--text-strong);
    --ws-card-body: var(--text-base);
}


:is(.ws-mat-solid, .ws-mat-satin, .ws-mat-shimmer, .ws-mat-chrome, .ws-mat-velvet, .ws-mat-mesh, .ws-mat-glass, .ws-mat-mica, .ws-mat-frosted-dark).ws-tone-subtle {
    /* Background Surface (Shadowed from Page Surface) */
    --surface-bg-color: var(--page-bg-surface, var(--bg-surface));
    --surface-bg-glass: rgba(var(--page-bg-surface-rgb, var(--bg-surface-rgb)), 0.55);
    --bg-base-rgb: var(--page-bg-base-rgb);
    --bg-surface-rgb: var(--page-bg-surface-rgb, var(--bg-surface-rgb));

    /* Text & Contrast Root (Local Tone Shadowing) */
    color: var(--text-base);
    --text-base: var(--page-text-base);
    --text-base-rgb: var(--page-text-base-rgb);
    --text-strong: var(--page-text-strong);
    --text-strong-rgb: var(--page-text-strong-rgb);
    --text-muted: var(--page-text-muted);
    --text-muted-rgb: var(--page-text-muted-rgb);

    /* Global Aliases for descendants */
    --theme-text: var(--text-base);
    --theme-text-rgb: var(--text-base-rgb);
    --theme-text-strong: var(--text-strong);
    --theme-text-muted: var(--text-muted);
    --ws-card-title: var(--text-strong);
    --ws-card-body: var(--text-base);
}


/* 2. Inverse Context: Strong & Inverted (Flip contrast vs page mode) */
:is(.ws-mat-solid, .ws-mat-satin, .ws-mat-shimmer, .ws-mat-chrome, .ws-mat-velvet, .ws-mat-mesh, .ws-mat-glass, .ws-mat-mica, .ws-mat-frosted-dark).ws-tone-strong {
    --surface-bg-color: var(--theme-surface-strong);
    --surface-bg-glass: rgba(var(--bg-strong-rgb), 0.8);
    color: var(--theme-text-inverse);
    --text-base: var(--theme-text-inverse);
    --text-base-rgb: var(--theme-text-inverse-rgb);
    --text-strong: var(--theme-text-inverse);
    --text-muted: rgba(var(--theme-text-inverse-rgb), 0.7);
    --theme-text: var(--text-base);
    --theme-text-rgb: var(--text-base-rgb);
    --theme-text-strong: var(--text-strong);
    --theme-text-muted: var(--text-muted);
    --ws-card-title: var(--text-strong);
    --ws-card-body: var(--text-base);
}

:is(.ws-mat-solid, .ws-mat-satin, .ws-mat-shimmer, .ws-mat-chrome, .ws-mat-velvet, .ws-mat-mesh, .ws-mat-glass, .ws-mat-mica, .ws-mat-frosted-dark).ws-tone-inverted {
    --surface-bg-color: var(--page-text-base, var(--theme-text));
    --surface-bg-glass: rgba(var(--page-text-base-rgb, var(--text-base-rgb)), 0.8);
    color: var(--theme-surface);
    --text-base: var(--theme-surface);
    --text-base-rgb: var(--bg-base-rgb);
    --text-strong: var(--theme-surface);
    --text-muted: rgba(var(--bg-base-rgb), 0.7);
    --theme-text: var(--text-base);
    --theme-text-rgb: var(--text-base-rgb);
    --theme-text-strong: var(--text-base);
    --theme-text-muted: var(--text-muted);
    --ws-card-title: var(--text-base);
    --ws-card-body: var(--text-base);
}

/* 3. Accent Context: Branded Surface */
:is(.ws-mat-solid, .ws-mat-satin, .ws-mat-shimmer, .ws-mat-chrome, .ws-mat-velvet, .ws-mat-mesh, .ws-mat-glass, .ws-mat-mica, .ws-mat-frosted-dark).ws-tone-accent {
    --surface-bg-color: var(--theme-accent);
    --surface-bg-glass: rgba(var(--theme-accent-rgb), 0.8);
    color: var(--theme-text-on-accent);
    --text-base: var(--theme-text-on-accent);
    --text-base-rgb: var(--theme-text-on-accent-rgb);
    --text-strong: var(--theme-text-on-accent);
    --text-muted: rgba(var(--theme-text-on-accent-rgb), 0.8);
    --theme-text: var(--text-base);
    --theme-text-rgb: var(--text-base-rgb);
    --theme-text-strong: var(--text-base);
    --theme-text-muted: var(--text-muted);
    --ws-card-title: var(--text-base);
    --ws-card-body: var(--text-base);
}

/* 5. Elevated Tone — one step above subtle, readable text */
:is(.ws-mat-solid, .ws-mat-satin, .ws-mat-shimmer, .ws-mat-chrome, .ws-mat-velvet, .ws-mat-mesh, .ws-mat-glass, .ws-mat-mica, .ws-mat-frosted-dark).ws-tone-elevated {
    --surface-bg-color: var(--bg-subtle, var(--page-bg-surface));
    --surface-bg-glass: rgba(var(--bg-subtle-rgb, var(--page-bg-surface-rgb)), 0.65);
    --bg-base-rgb: var(--page-bg-base-rgb);
    --bg-surface-rgb: var(--bg-subtle-rgb, var(--page-bg-surface-rgb));

    color: var(--text-base);
    --text-base: var(--page-text-base);
    --text-base-rgb: var(--page-text-base-rgb);
    --text-strong: var(--page-text-strong);
    --text-strong-rgb: var(--page-text-strong-rgb);
    --text-muted: var(--page-text-muted);
    --text-muted-rgb: var(--page-text-muted-rgb);

    --theme-text: var(--text-base);
    --theme-text-rgb: var(--text-base-rgb);
    --theme-text-strong: var(--text-strong);
    --theme-text-muted: var(--text-muted);
    --ws-card-title: var(--text-strong);
    --ws-card-body: var(--text-base);
}

/* 6. Accent-Soft Tone — light accent wash, readable text, branded without full fill */
:is(.ws-mat-solid, .ws-mat-satin, .ws-mat-shimmer, .ws-mat-chrome, .ws-mat-velvet, .ws-mat-mesh, .ws-mat-glass, .ws-mat-mica, .ws-mat-frosted-dark).ws-tone-accent-soft {
    --surface-bg-color: var(--bg-accent-weak, var(--page-bg-surface));
    --surface-bg-glass: rgba(var(--theme-accent-rgb), 0.12);
    --bg-base-rgb: var(--page-bg-base-rgb);
    --bg-surface-rgb: var(--page-bg-base-rgb);

    color: var(--page-text-base);
    --text-base: var(--page-text-base);
    --text-base-rgb: var(--page-text-base-rgb);
    --text-strong: var(--page-text-strong);
    --text-strong-rgb: var(--page-text-strong-rgb);
    --text-muted: var(--page-text-muted);
    --text-muted-rgb: var(--page-text-muted-rgb);

    --theme-text: var(--text-base);
    --theme-text-rgb: var(--text-base-rgb);
    --theme-text-strong: var(--text-strong);
    --theme-text-muted: var(--text-muted);
    --ws-card-title: var(--text-strong);
    --ws-card-body: var(--text-base);
}

/* Pass-through (Transparent) */
.ws-mat-transparent.ws-tone-base {
    --surface-bg-color: transparent;
}

.ws-mat-transparent.ws-tone-subtle {
    --surface-bg-color: transparent;
}

.ws-mat-transparent.ws-tone-elevated {
    --surface-bg-color: transparent;
}

.ws-mat-transparent.ws-tone-strong {
    --surface-bg-color: transparent;
}

.ws-mat-transparent.ws-tone-accent {
    --surface-bg-color: transparent;
}

.ws-mat-transparent.ws-tone-accent-soft {
    --surface-bg-color: transparent;
}

.ws-mat-transparent.ws-tone-inverted {
    --surface-bg-color: transparent;
}

/* Axis C: Frame */
.ws-frame-none {
    border: none !important;
}

.ws-frame-subtle {
    border: 1px solid var(--theme-border-subtle, rgba(128, 128, 128, 0.18));
}

/* Dark mode: drop shadows are invisible on dark backgrounds.
   Replace with a white edge ring + faint accent glow (Material Design 3 / Linear pattern).
   Scoped only to frame classes — does not touch any other shadow consumers. */
.dark .ws-frame-subtle,
.dark.ws-frame-subtle {
    border-color: rgba(255, 255, 255, 0.10);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        0 0 24px rgba(var(--theme-accent-rgb), 0.08);
}

.ws-frame-strong {
    border: 2px solid var(--theme-border-strong, rgba(128, 128, 128, 0.40));
}

.dark .ws-frame-strong,
.dark.ws-frame-strong {
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.07),
        0 0 32px rgba(var(--theme-accent-rgb), 0.12);
}

.ws-frame-accent {
    border: 1px solid var(--theme-accent, rgba(var(--theme-accent-rgb), 1));
}

.ws-frame-glow {
    box-shadow: 0 0 18px var(--theme-glow-color, rgba(var(--theme-accent-rgb), 0.45));
    border: 1px solid var(--theme-glow-color, rgba(var(--theme-accent-rgb), 0.5));
}

.ws-frame-neon {
    box-shadow:
        0 0 10px var(--theme-glow-color, rgba(var(--theme-accent-rgb), 0.55)),
        0 0 28px var(--theme-glow-color, rgba(var(--theme-accent-rgb), 0.28)),
        inset 0 0 10px var(--theme-glow-color, rgba(var(--theme-accent-rgb), 0.06));
    border: 1px solid var(--theme-accent, rgba(var(--theme-accent-rgb), 0.85));
}

/* Dark mode: Tailwind shadow utilities use rgba(0,0,0,*) — invisible on dark backgrounds.
   Scoped ONLY to ws-mat-* surfaces (cards, sections) — never touches dropdowns, tooltips, or UI chrome.
   Replaces black depth shadows with a white-edge ring + diffuse white glow to communicate elevation. */
.dark [class*="ws-mat-"].shadow-sm  { box-shadow: 0 0 20px rgba(255,255,255,0.12), 0 0 40px rgba(255,255,255,0.06); }
.dark [class*="ws-mat-"].shadow     { box-shadow: 0 0 28px rgba(255,255,255,0.14), 0 0 56px rgba(255,255,255,0.07); }
.dark [class*="ws-mat-"].shadow-md  { box-shadow: 0 0 36px rgba(255,255,255,0.16), 0 0 72px rgba(255,255,255,0.08); }
.dark [class*="ws-mat-"].shadow-lg  { box-shadow: 0 0 48px rgba(255,255,255,0.18), 0 0 96px rgba(255,255,255,0.09); }
.dark [class*="ws-mat-"].shadow-xl  { box-shadow: 0 0 60px rgba(255,255,255,0.20), 0 0 120px rgba(255,255,255,0.10); }
.dark [class*="ws-mat-"].shadow-2xl { box-shadow: 0 0 80px rgba(255,255,255,0.22), 0 0 160px rgba(255,255,255,0.11); }

/* --- 3. Width & Height --- */
.ws-width-contained {
    max-width: var(--theme-max-width, 1280px);
    margin-left: auto;
    margin-right: auto;
}

.ws-width-full {
    width: 100%;
    max-width: none;
}

/* --- 4. Inner Container Constraints --- */
.ws-container-inner {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-md);
    padding-right: var(--space-md);
}

.ws-width-contained .ws-container-inner {
    max-width: var(--theme-max-width, 1280px);
}

.ws-width-full .ws-container-inner {
    max-width: none;
}

/* --- Badge Primitive --- */
.ws-badge-primitive {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.625rem;
    /* 10px */
    white-space: nowrap;
    border-radius: var(--radius-full);
    transition: all var(--duration-normal) var(--ease-smooth);
}

/* Sizes */
.ws-badge-sm {
    padding: 0.125rem 0.5rem;
    font-size: 0.5rem;
}

.ws-badge-md {
    padding: 0.25rem 0.75rem;
    font-size: 0.625rem;
}

.ws-badge-lg {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Position */
.ws-badge-absolute {
    position: absolute;
}

.ws-badge-relative {
    position: relative;
}

/* ── Badge Style Presets ────────────────────────────────────────────────────
   Self-contained: do NOT rely on inherited ws-mat- / ws-tone- variables.
   Each preset declares its own background, color, and border so it works
   correctly inside any surface context (sections, cards, hero, etc.).
   ─────────────────────────────────────────────────────────────────────── */

/* Default: accent solid (also applied when no preset class is present) */
.ws-badge-primitive:not([class*="ws-badge-preset-"]) {
    background-color: var(--theme-accent);
    color: var(--theme-text-on-accent, #fff);
    border: none;
}

.ws-badge-preset-accent {
    background-color: var(--theme-accent);
    color: var(--theme-text-on-accent, #fff);
    border: none;
}

.ws-badge-preset-glass {
    background-color: rgba(var(--theme-accent-rgb), 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--theme-accent);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.30);
}

.ws-badge-preset-glass-glow {
    background-color: rgba(var(--theme-accent-rgb), 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--theme-accent);
    border: 1px solid rgba(var(--theme-accent-rgb), 0.30);
    box-shadow: 0 0 14px rgba(var(--theme-accent-rgb), 0.45);
}

.ws-badge-preset-outline {
    background-color: transparent;
    color: var(--theme-accent);
    border: 1px solid var(--theme-accent);
}

.ws-badge-preset-muted {
    background-color: rgba(var(--text-base-rgb, 128, 128, 128), 0.10);
    color: var(--text-base);
    border: none;
}

.ws-badge-preset-strong {
    background-color: var(--theme-surface-strong, #111);
    color: var(--theme-text-inverse, #fff);
    border: none;
}

.ws-badge-preset-glow {
    background-color: var(--theme-accent);
    color: var(--theme-text-on-accent, #fff);
    border: none;
    box-shadow: 0 0 16px rgba(var(--theme-accent-rgb), 0.55);
}

.ws-badge-preset-gradient {
    background: linear-gradient(135deg, var(--theme-accent) 0%, var(--theme-accent-secondary, var(--theme-accent)) 100%);
    color: #fff;
    border: none;
}

.ws-badge-preset-text-only {
    background-color: transparent !important;
    color: currentColor;
    border: none !important;
    padding-left: 0;
    padding-right: 0;
}

.ws-badge-preset-soft-pill {
    background-color: rgba(var(--theme-accent-rgb), 0.08);
    color: var(--theme-accent);
    border-radius: 9999px !important;
    border: none;
}

.ws-badge-preset-neon-glow {
    background-color: transparent;
    color: var(--theme-accent);
    border: 1px solid var(--theme-accent);
    box-shadow: 0 0 8px var(--theme-accent), inset 0 0 4px var(--theme-accent);
}

.ws-badge-preset-glass-blur {
    background-color: rgba(var(--bg-surface-rgb, 255, 255, 255), 0.05);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    color: var(--text-base);
    border: 1px solid rgba(var(--text-base-rgb, 128, 128, 128), 0.1);
}

.ws-badge-preset-3d-tactile {
    background-color: var(--bg-surface);
    color: var(--theme-accent);
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1), -1px -1px 3px rgba(255,255,255,0.8);
}

/* =========================================
   5. Button Interaction Utilities (5.1)
   Decoupled motion behaviors governed by 5.1 Role Architecture.
   ========================================= */

.btn-interaction-none {}

.btn-interaction-scale {
    transition: transform var(--duration-fast) var(--ease-smooth);
}

.btn-interaction-scale:hover {
    transform: scale(1.05);
}

.btn-interaction-scale:active {
    transform: scale(0.96);
}

.btn-interaction-float {
    transition: transform var(--duration-normal) var(--ease-smooth), box-shadow var(--duration-normal) var(--ease-smooth);
}

.btn-interaction-float:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.btn-interaction-float:active {
    transform: translateY(-1px);
}

.btn-interaction-glow {
    transition: box-shadow var(--duration-normal) var(--ease-smooth), text-shadow var(--duration-normal) var(--ease-smooth);
}

.btn-interaction-glow:hover {
    box-shadow: 0 0 20px color-mix(in srgb, currentColor 40%, transparent);
    text-shadow: 0 0 10px currentColor;
}

/* Slide Right Interaction (requires hover-bg-slide child or background-position) */
.btn-interaction-slide-right {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    z-index: 1;
}

.btn-interaction-slide-right.hover-bg-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: currentColor;
    opacity: 0.1;
    transition: left var(--duration-normal) var(--ease-smooth);
    z-index: 0;
}

.btn-interaction-slide-right.hover-bg-slide:hover::before {
    left: 0;
}

/* =========================================
   6. Semantic Typography Roles (5.1)
   Maps global typography tokens to utility classes.
   ========================================= */

/* Role classes govern font-family, style, weight, tracking, line-height ONLY.
   Font-size is intentionally excluded — it is always set by the explicit utility
   class (text-fluid-h1, text-xl, etc.) or by a customizer-injected scoped rule.
   This prevents ws-type-* from shadowing fluid/utility size classes in the cascade. */
.ws-type-titles    { font-family: var(--ws-font-titles);    font-style: var(--style-titles);    font-weight: var(--ws-font-weight-titles, inherit);    letter-spacing: var(--ws-letter-spacing-titles, inherit);    line-height: var(--ws-line-height-titles, inherit); }
.ws-type-subtitles { font-family: var(--ws-font-subtitles); font-style: var(--style-subtitles); font-weight: var(--ws-font-weight-subtitles, inherit); letter-spacing: var(--ws-letter-spacing-subtitles, inherit); line-height: var(--ws-line-height-subtitles, inherit); }
.ws-type-body      { font-family: var(--ws-font-body);      font-style: var(--style-body);      font-weight: var(--ws-font-weight-body, inherit);      letter-spacing: var(--ws-letter-spacing-body, inherit);      line-height: var(--ws-line-height-body, inherit); }
.ws-type-buttons   { font-family: var(--ws-font-buttons);   font-style: var(--style-buttons);   font-weight: var(--ws-font-weight-buttons, inherit);   letter-spacing: var(--ws-letter-spacing-buttons, inherit);   line-height: var(--ws-line-height-buttons, inherit); }
.ws-type-navbar    { font-family: var(--ws-font-navbar);    font-style: var(--style-navbar);    font-weight: var(--ws-font-weight-navbar, inherit);    letter-spacing: var(--ws-letter-spacing-navbar, inherit);    line-height: var(--ws-line-height-navbar, inherit); }
.ws-type-badge     { font-family: var(--ws-font-badge);     font-style: var(--style-badge);     font-weight: var(--ws-font-weight-badge, inherit);     letter-spacing: var(--ws-letter-spacing-badge, inherit);    line-height: var(--ws-line-height-badge, inherit); }
.ws-type-label     { font-family: var(--ws-font-label);     font-style: var(--style-label);     font-weight: var(--ws-font-weight-label, inherit);     letter-spacing: var(--ws-letter-spacing-label, inherit);     line-height: var(--ws-line-height-label, inherit); }
.ws-type-other     { font-family: var(--ws-font-other);     font-style: var(--style-other);     font-weight: var(--ws-font-weight-other, inherit);     letter-spacing: var(--ws-letter-spacing-other, inherit);     line-height: var(--ws-line-height-other, inherit); }

/* =========================================
   7. Checkatrade Badge Block (Websly 5.1 Premier)
   ========================================= */
.ws-checkatrade-block {
    overflow: hidden;
}

.ws-checkatrade-flex-wrap {
    display: flex;
    align-items: center;
    gap: 2rem;
    width: 100%;
}

/* Layout: Inline Strip */
.ws-layout-inline-strip .ws-checkatrade-flex-wrap {
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: clamp(1rem, 2vw, 2rem) 0;
}

/* Layout: Feature Card */
.ws-layout-feature-card {
    display: flex;
    justify-content: center;
    align-items: center;
}
.ws-layout-feature-card .ws-checkatrade-flex-wrap {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
    padding: clamp(2rem, 5vw, 4rem);
    background: var(--bg-surface);
    border-radius: var(--radius-card, 1.5rem);
    border: 1px solid var(--border-subtle, rgba(128,128,128,0.15));
    max-width: 800px;
}

/* Layout: Trust Emblem (Logo Centric) */
.ws-layout-trust-emblem .ws-checkatrade-flex-wrap {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1.25rem;
}
.ws-layout-trust-emblem .ws-checkatrade-badge-container {
    padding: 2.5rem;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.ws-layout-trust-emblem .ws-checkatrade-logo-wrap {
    height: 70px;
}
.ws-layout-trust-emblem .ws-emblem-content {
    margin-top: 1rem;
}
.ws-layout-trust-emblem .ws-checkatrade-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    letter-spacing: -0.03em;
}


/* Content Styling */
.ws-checkatrade-title {
    font-family: var(--font-titles);
    font-size: clamp(1.25rem, 2.5vw, 1.875rem);
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: var(--theme-text);
    line-height: 1.2;
}

.ws-checkatrade-subtitle {
    font-size: clamp(0.875rem, 1vw, 1rem);
    opacity: 0.7;
    margin: 0;
    font-family: var(--font-body);
}

/* Badge Container — uses surface tokens for automatic dark/light adaptation */
.ws-checkatrade-badge-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.75rem;
    text-decoration: none !important;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    overflow: hidden;
    z-index: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle, rgba(128,128,128,0.15));
    border-radius: var(--radius-card, 1.5rem);
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    color: var(--text-base);
}

.ws-checkatrade-badge-container:hover {
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

/* Radius Profiles */
.ws-radius-sharp { border-radius: 4px; }
.ws-radius-curved { border-radius: 16px; }
.ws-radius-pill { border-radius: 100px; }

/* Elements */
.ws-checkatrade-tagline {
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--theme-text);
    opacity: 0.6;
    line-height: 1;
}

.ws-checkatrade-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: height 0.3s ease;
}
.ws-checkatrade-svg {
    height: 100%;
    max-height: 2.5rem;
    width: auto;
    display: block;
}
.ws-checkatrade-img {
    height: 100%;
    max-height: 4rem; /* Larger than before for better container use */
    width: auto;
    display: block;
    object-fit: contain;
}

/* ─────────────────────────────────────────────────────────────────────────────
   HERO ULTRA PREMIUM LAYOUTS — Adopted External Layout System
   Tokens and layout utilities for marquee-cinematic, bento-grid-hero,
   and editorial-magazine hero layouts.
   ───────────────────────────────────────────────────────────────────────────── */

/* Bento Grid Hero */
.ws-bento-card {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.ws-bento-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 56px -12px rgba(0, 0, 0, 0.18);
}
.ws-bento-card--main {
    background: color-mix(in srgb, var(--bg-theme-surface, rgba(15,15,20,0.92)) 85%, transparent);
}

/* Marquee strip — GPU composited for smooth animation */
.ws-marquee-strip {
    will-change: transform;
    overflow: hidden;
}
.ws-marquee-track {
    display: flex;
    will-change: transform;
}

/* Editorial Magazine — vertical line accent */
@media (min-width: 768px) {
    .ws-editorial-accent-col {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        padding-top: 0.75rem;
        flex-shrink: 0;
        width: 2px;
        min-height: 180px;
    }
}

/* Stat Split Hero — oversized gradient number */
.ws-stat-split-number {
    display: block;
    user-select: none;
    opacity: 0.92;
}

/* Terminal Cinematic — cursor blink */
@keyframes ws-terminal-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}
.ws-terminal-cursor {
    display: inline-block;
    width: 0.55em;
    height: 1.1em;
    background: var(--theme-accent);
    animation: ws-terminal-blink 1.2s step-end infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

/* Floating Island Hero — card hover lift */
.ws-floating-island-card {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.ws-floating-island-card:hover {
    transform: translateY(-4px);
}

/* --- Footer Global Badge --- */
.ws-footer-badge {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    display: inline-block;
}

.ws-footer-badge:hover {
    transform: translateY(-4px) scale(1.02);
    filter: brightness(1.1);
}

.ws-footer-badge img {
    display: block;
    height: auto;
    object-fit: contain;
}

/* Correction for specific layouts to ensure alignment */
.mb-6.flex.items-center.gap-6 > .ws-footer-badge {
    margin-top: 0 !important;
}

.flex.items-center.gap-4 > .ws-footer-badge {
    margin-top: 0 !important;
}

.flex.items-center.gap-6.mt-4.md\:mt-0 > .ws-footer-badge {
    margin-top: 0 !important;
}

.ws-badge-pos-bottom_center {
    margin-top: 3rem;
    opacity: 0.8;
}

.ws-badge-pos-bottom_center:hover {
    opacity: 1;
}
}