/**
 * Theme Name: BespokeForge
 * Description: The Precision Console - Durable web systems, engineered infrastructure
 * Version: 4.0.0 (Design Overhaul)
 * Author: BespokeForge LTD
 */

/* ==========================================================================
   DESIGN SYSTEM 2.0
   Minimal • Modern • Reliable yet Youthful
   Inspired by: OLIV, Studio 9 Design, Arkitect
   ========================================================================== */

/* Typography: Outfit - modern geometric sans-serif for clean, professional look */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    /* ═══════════════════════════════════════════════════════════════════════
       TYPOGRAPHY
       ═══════════════════════════════════════════════════════════════════════ */
    --bf-font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --bf-font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --bf-font-system: var(--bf-font-sans);

    /* Fluid Typography Scale - Original responsive scaling */
    --bf-font-size-4xl: clamp(2.25rem, 1.5rem + 3.5vw, 4rem);
    --bf-font-size-3xl: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem);
    --bf-font-size-2xl: clamp(1.5rem, 1.3rem + 1vw, 2rem);
    --bf-font-size-xl: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
    --bf-font-size-lg: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
    --bf-font-size-base: 1rem;
    --bf-font-size-sm: 0.875rem;
    --bf-font-size-xs: 0.75rem;

    /* Legacy mapping for compatibility */
    --bf-text-4xl: var(--bf-font-size-4xl);
    --bf-text-3xl: var(--bf-font-size-3xl);
    --bf-text-2xl: var(--bf-font-size-2xl);
    --bf-text-xl: var(--bf-font-size-xl);
    --bf-text-lg: var(--bf-font-size-lg);
    --bf-text-base: var(--bf-font-size-base);
    --bf-text-sm: var(--bf-font-size-sm);
    --bf-text-xs: var(--bf-font-size-xs);

    /* ═══════════════════════════════════════════════════════════════════════
       COLORS - Light Mode (Warm, Minimal)
       ═══════════════════════════════════════════════════════════════════════ */
    --bf-color-bg: #FAFAFA;
    --bf-color-bg-rgb: 250, 250, 250;
    --bf-color-surface: #FFFFFF;
    --bf-color-surface-rgb: 255, 255, 255;
    --bf-color-surface-secondary: #F4F4F5;
    --bf-color-surface-secondary-rgb: 244, 244, 245;
    --bf-color-border: #E4E4E7;
    --bf-color-text: #18181B;
    --bf-color-text-rgb: 24, 24, 27;
    --bf-color-text-secondary: #52525B;
    --bf-color-text-muted: #71717A;

    /* Accent: Teal - Reliable, trustworthy, youthful */
    --bf-color-accent: #0D9488;
    --bf-color-accent-light: #14B8A6;
    --bf-color-accent-dark: #0F766E;
    --bf-color-primary: var(--bf-color-text);

    /* Legacy color mapping */
    --bf-background: var(--bf-color-bg);
    --bf-surface: var(--bf-color-surface);
    --bf-surface-alt: var(--bf-color-surface-secondary);
    --bf-text-primary: var(--bf-color-text);
    --bf-text-secondary: var(--bf-color-text-secondary);
    --bf-text-tertiary: var(--bf-color-text-muted);
    --bf-border: var(--bf-color-border);
    --bf-border-strong: #D4D4D8;
    --bf-accent: var(--bf-color-accent);
    --bf-accent-90: var(--bf-color-accent-light);
    --bf-accent-80: var(--bf-color-accent-light);
    --bf-accent-subtle: rgba(13, 148, 136, 0.08);
    --bf-success: #10B981;
    --bf-notice: #F59E0B;

    /* ═══════════════════════════════════════════════════════════════════════
       SPACING - More generous whitespace
       ═══════════════════════════════════════════════════════════════════════ */
    --bf-space-4xs: 0.25rem;
    --bf-space-3xs: 0.375rem;
    --bf-space-2xs: 0.5rem;
    --bf-space-xs: 0.75rem;
    --bf-space-sm: 1rem;
    --bf-space-md: 1.5rem;
    --bf-space-lg: 2rem;
    --bf-space-xl: 3rem;
    --bf-space-2xl: 4rem;
    --bf-space-3xl: 6rem;
    --bf-space-4xl: 8rem;
    --bf-space-5xl: 10rem;

    /* Legacy Spacing mapping */
    --bf-space-quarter: var(--bf-space-xs);
    --bf-space-half: var(--bf-space-sm);
    --bf-space-1: var(--bf-space-md);
    --bf-space-2: var(--bf-space-lg);
    --bf-space-3: var(--bf-space-xl);
    --bf-space-4: var(--bf-space-2xl);

    /* Fluid Spacing Utilities */
    --fluid-side-padding-min: 1.5rem;
    --fluid-side-padding-max: 6rem;
    --section-padding: clamp(4rem, 8vw, 8rem);

    /* ═══════════════════════════════════════════════════════════════════════
       EFFECTS
       ═══════════════════════════════════════════════════════════════════════ */
    /* Radius - Slightly larger for softer feel */
    --bf-radius-xs: 0.25rem;
    --bf-radius-sm: 0.5rem;
    --bf-radius-md: 0.75rem;
    --bf-radius-lg: 1rem;
    --bf-radius-xl: 1.5rem;
    --bf-radius-2xl: 2rem;
    --bf-radius-full: 9999px;

    /* Shadows - Soft Neumorphic (from style guide) */
    --bf-shadow-sm: -3px -3px 6px rgba(255, 255, 255, 0.7), 3px 3px 6px rgba(22, 27, 29, 0.06);
    --bf-shadow-md: -5px -5px 10px rgba(255, 255, 255, 0.7), 5px 5px 10px rgba(22, 27, 29, 0.08);
    --bf-shadow-lg: -10px -10px 20px rgba(255, 255, 255, 0.7), 10px 10px 20px rgba(22, 27, 29, 0.1);
    --bf-shadow-xl: -20px -20px 40px rgba(255, 255, 255, 0.7), 20px 20px 40px rgba(22, 27, 29, 0.12);
    --bf-shadow-card: 0 4px 20px rgba(22, 27, 29, 0.06);

    /* Focus Ring */
    --bf-ring: var(--bf-accent);
    --bf-ring-offset: 2px;

    /* Transitions */
    --bf-transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --bf-transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    --bf-line: 1px solid var(--bf-border);
    --bf-gradient-surface: linear-gradient(180deg, var(--bf-surface) 0%, var(--bf-background) 100%);
    --bf-gradient-accent: linear-gradient(135deg, var(--bf-color-accent) 0%, var(--bf-color-accent-dark) 100%);

    /* Container */
    --bf-container: 1200px;
    --bf-container-narrow: 780px;
}

/* ==========================================================================
   DARK MODE - Rich, refined
   ========================================================================== */
[data-theme="dark"] {
    --bf-color-bg: #09090B;
    --bf-color-bg-rgb: 9, 9, 11;
    --bf-color-surface: #18181B;
    --bf-color-surface-rgb: 24, 24, 27;
    --bf-color-surface-secondary: #27272A;
    --bf-color-surface-secondary-rgb: 39, 39, 42;
    --bf-color-text: #FAFAFA;
    --bf-color-text-rgb: 250, 250, 250;
    --bf-color-text-secondary: #A1A1AA;
    --bf-color-text-muted: #71717A;
    --bf-color-border: #3F3F46;

    /* Brighter teal for dark mode visibility */
    --bf-color-accent: #2DD4BF;
    --bf-color-accent-light: #5EEAD4;
    --bf-color-accent-dark: #14B8A6;

    /* Legacy mapping */
    --bf-background: var(--bf-color-bg);
    --bf-surface: var(--bf-color-surface);
    --bf-surface-alt: var(--bf-color-surface-secondary);
    --bf-text-primary: var(--bf-color-text);
    --bf-text-secondary: var(--bf-color-text-secondary);
    --bf-text-tertiary: var(--bf-color-text-muted);
    --bf-border: var(--bf-color-border);
    --bf-border-strong: #52525B;
    --bf-accent: var(--bf-color-accent);
    --bf-accent-subtle: rgba(45, 212, 191, 0.12);

    /* Shadows for dark mode - subtle glow effect */
    --bf-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4), 0 0 1px rgba(255, 255, 255, 0.05);
    --bf-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 2px rgba(255, 255, 255, 0.05);
    --bf-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 4px rgba(255, 255, 255, 0.05);
    --bf-shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6), 0 0 8px rgba(255, 255, 255, 0.03);
    --bf-shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);

    --bf-gradient-surface: linear-gradient(180deg, #18181B 0%, #09090B 100%);
    --bf-gradient-accent: linear-gradient(135deg, var(--bf-color-accent) 0%, var(--bf-color-accent-dark) 100%);
}

/* Ensure global inheritance even if applied to html or body */
[data-theme="dark"] body {
    background-color: var(--bf-background);
    color: var(--bf-text-primary);
}


/* ==========================================================================
   BASE ELEMENTS - With Complete Mobile Reset
   ========================================================================== */

/* CRITICAL: Universal box-sizing reset - prevents elements from exceeding container */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Prevent horizontal overflow at document level */
html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    /* Ensure document never exceeds viewport */
    max-width: 100vw;
}

/* All block elements respect container width */
img,
picture,
video,
canvas,
svg,
iframe,
embed,
object {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Prevent text from forcing container width */
p,
h1,
h2,
h3,
h4,
h5,
h6,
li,
td,
th,
label,
span,
a {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Grid and flex items must not overflow - THIS IS KEY */
.bento-grid>*,
.grid>*,
.grid-2>*,
.grid-3>*,
.grid-12>*,
.pillar-grid>*,
.diagnostics-grid>*,
.footer-grid>*,
.flex>*,
.hero-cta>* {
    min-width: 0;
    max-width: 100%;
}

/* Lenis Recommended Styles */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}


body {
    background-color: var(--bf-background);
    color: var(--bf-text-primary);
    font-family: var(--bf-font-system);
    line-height: 1.6;
    margin: 0;
    width: 100%;
    overflow-x: hidden;
    /* CRITICAL FIX: Double protection */
    transition: background-color 0.3s ease, color 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.015;
    z-index: 9999;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   TYPOGRAPHY - Bold, Modern, Reliable
   ========================================================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--bf-font-display);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--bf-text-primary);
    margin-bottom: var(--bf-space-md);
}

h1 {
    font-size: var(--bf-text-4xl);
    font-weight: 700;
    letter-spacing: -0.03em;
}

h2 {
    font-size: var(--bf-text-3xl);
    font-weight: 700;
}

h3 {
    font-size: var(--bf-text-2xl);
}

h4 {
    font-size: var(--bf-text-xl);
}

h5 {
    font-size: var(--bf-text-lg);
}

h6 {
    font-size: var(--bf-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

p {
    color: var(--bf-text-secondary);
    margin-bottom: var(--bf-space-md);
    max-width: 65ch;
    line-height: 1.7;
}

.lead {
    font-size: var(--bf-text-xl);
    line-height: 1.6;
    color: var(--bf-text-secondary);
}

.label {
    font-size: var(--bf-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--bf-text-tertiary);
    text-align: inherit;
    max-width: none;
}

a {
    color: var(--bf-accent);
    text-decoration: none;
    transition: color var(--bf-transition-fast), opacity var(--bf-transition-fast);
}

a:hover {
    opacity: 0.8;
}

/* ==========================================================================
   CONTAINER & SECTIONS
   ========================================================================== */

/* Center any class that smells like a container */
[class*="container"] {
    margin-left: auto;
    margin-right: auto;
}

.container {
    width: 100%;
    max-width: var(--bf-container);
    margin: 0 auto;
    padding-inline: clamp(var(--fluid-side-padding-min), 4vw, var(--fluid-side-padding-max));
}

.container-narrow {
    width: 100%;
    max-width: var(--bf-container-narrow);
}

/* Base section utilities */
.section {
    padding: clamp(var(--section-l-padding-min), calc(var(--section-l-padding-min) + 2.5vw), var(--section-l-padding-max)) 0;
}

.section-compact {
    padding: var(--bf-space-3) 0;
}

.section-flush {
    padding: var(--bf-space-2) 0;
}


/* Fluid section spacing scale */
.section-xxl {
    padding: clamp(var(--section-xxl-padding-min), calc(var(--section-xxl-padding-min) + 4vw), var(--section-xxl-padding-max)) 0;
}

.section-xl {
    padding: clamp(var(--section-xl-padding-min), calc(var(--section-xl-padding-min) + 3vw), var(--section-xl-padding-max)) 0;
}

.section-l {
    padding: clamp(var(--section-l-padding-min), calc(var(--section-l-padding-min) + 2.5vw), var(--section-l-padding-max)) 0;
}

.section-m {
    padding: clamp(var(--section-m-padding-min), calc(var(--section-m-padding-min) + 2vw), var(--section-m-padding-max)) 0;
}

.section-s {
    padding: clamp(var(--section-s-padding-min), calc(var(--section-s-padding-min) + 1.5vw), var(--section-s-padding-max)) 0;
}

.section-xs {
    padding: clamp(var(--section-xs-padding-min), calc(var(--section-xs-padding-min) + 1vw), var(--section-xs-padding-max)) 0;
}

.section-xxs {
    padding: clamp(var(--section-xxs-padding-min), calc(var(--section-xxs-padding-min) + 0.5vw), var(--section-xxs-padding-max)) 0;
}

.section-header {
    padding: clamp(var(--section-header-padding-min), calc(var(--section-header-padding-min) + 0.5vw), var(--section-header-padding-max)) 0;
}

/* ===========================
   HOMEPAGE – Center only titles for:
   - Outcomes section (4th)
   - Pricing section (7th)
   - Retainers block
   =========================== */

/* Outcomes heading (section 4) */
.home #primary>section:nth-of-type(4) .label,
.home #primary>section:nth-of-type(4) h2 {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* Pricing heading (section 7) */
.home #primary>section:nth-of-type(7) .label,
.home #primary>section:nth-of-type(7) h2,
.home #primary>section:nth-of-type(7) .lead {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* Retainers block inside Pricing */
.home #primary>section:nth-of-type(7) .mt-3,
.home #primary>section:nth-of-type(7) .mt-3 .label,
.home #primary>section:nth-of-type(7) .mt-3 p {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}




/* ==========================================================================
   GRIDS - Fluid Intrinsic Design (no fixed breakpoints needed)
   ========================================================================== */
.grid {
    display: grid;
    gap: var(--bf-space-2);
}

/* Fluid grids using auto-fit and minmax for natural reflow */
.grid-12 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 80px), 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

/* ==========================================================================
   BENTO GRIDS - Fluid Intrinsic Design
   ========================================================================== */
.bento-grid {
    display: grid;
    gap: var(--bf-space-1);
}

/* 2-column grid that stacks on narrow viewports */
.bento-2x2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    grid-template-rows: auto;
}

/* 3-column grid: items stay ~300px min, naturally reflow to 2 or 1 column */
.bento-3 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

/* 4-column grid: items stay ~220px min, naturally reflow */
.bento-4 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.bento-featured {
    /* On wide viewports: 2fr 1fr layout, stacks on narrow */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    grid-template-rows: auto;
}

/* Featured first item gets more visual weight when there's enough space */
@supports (grid-template-columns: subgrid) {
    .bento-featured .bento-item:first-child {
        grid-row: auto;
    }
}

.bento-asymmetric {
    /* Fluid 3-column that naturally reflows */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    grid-template-rows: auto;
}

/* Large items span 2 columns only when there's room */
.bento-asymmetric .bento-item.large {
    grid-column: span 1;
    /* Default to 1 */
}

@media (min-width: 640px) {
    .bento-asymmetric .bento-item.large {
        grid-column: span 2;
    }
}

.bento-asymmetric .bento-item.tall {
    grid-row: auto;
    /* Remove forced spanning */
}

.bento-item {
    background: var(--bf-surface);
    border-radius: var(--bf-radius-xl);
    padding: var(--bf-space-xl);
    transition: all var(--bf-transition);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--bf-border);
}

.bento-item:hover {
    border-color: var(--bf-border-strong);
    box-shadow: var(--bf-shadow-md);
}

[data-theme="dark"] .bento-item:hover {
    box-shadow: var(--bf-shadow-lg);
}

.bento-item.accent {
    background: var(--bf-accent);
    color: #ffffff;
}

.bento-item.accent .label,
.bento-item.accent p {
    color: rgba(255, 255, 255, 0.8);
}

.bento-item.accent h3,
.bento-item.accent h4,
.bento-item.accent h5 {
    color: #ffffff;
}

/* FIX: Accent card contrast for lists and links */
.bento-item.accent li,
.bento-item.accent ul,
.bento-item.accent ol {
    color: rgba(255, 255, 255, 0.9);
}

.bento-item.accent a:not(.btn) {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bento-item.accent a:not(.btn):hover {
    opacity: 0.8;
}

/* ==========================================================================
   PRICING COMPONENTS
   ========================================================================== */
.pricing-price {
    font-size: var(--bf-text-2xl);
    font-weight: 700;
    color: var(--bf-text-primary);
    line-height: 1.2;
    margin: var(--bf-space-sm) 0;
}

.pricing-price-alt {
    font-size: var(--bf-text-sm);
    color: var(--bf-text-tertiary);
    margin-bottom: var(--bf-space-md);
}

.bento-item.accent .pricing-price {
    color: #ffffff;
}

.bento-item.accent .pricing-price-alt {
    color: rgba(255, 255, 255, 0.7);
}

/* Pricing Features List */
.pricing-features {
    list-style: none;
    padding: 0;
    margin: var(--bf-space-lg) 0;
}

.pricing-features li {
    padding: var(--bf-space-sm) 0;
    border-bottom: 1px solid var(--bf-border);
    font-size: var(--bf-text-sm);
    display: flex;
    align-items: center;
    gap: var(--bf-space-sm);
}

.pricing-features li::before {
    content: '✓';
    color: var(--bf-success);
    font-weight: 700;
    flex-shrink: 0;
}

.pricing-features li:last-child {
    border-bottom: none;
}

/* Accent variant for pricing features */
.bento-item.accent .pricing-features li {
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

.bento-item.accent .pricing-features li::before {
    color: rgba(255, 255, 255, 0.9);
}

.bento-item.subtle {
    background: var(--bf-surface-alt, var(--bf-surface));
}

[data-theme="dark"] .bento-item.subtle {
    background: var(--bf-surface-alt);
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.flex {
    display: flex;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-column {
    flex-direction: column;
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.gap-xs {
    gap: var(--bf-space-xs);
}

.gap-sm {
    gap: var(--bf-space-sm);
}

.gap-md {
    gap: var(--bf-space-md);
}

.gap-lg {
    gap: var(--bf-space-lg);
}

.gap-xl {
    gap: var(--bf-space-xl);
}

/* Compatibility */
.gap-1 {
    gap: var(--bf-space-1);
}

.gap-2 {
    gap: var(--bf-space-2);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-xs {
    margin-bottom: var(--bf-space-xs);
}

.mb-sm {
    margin-bottom: var(--bf-space-sm);
}

.mb-md {
    margin-bottom: var(--bf-space-md);
}

.mb-lg {
    margin-bottom: var(--bf-space-lg);
}

.mb-xl {
    margin-bottom: var(--bf-space-xl);
}

/* Compatibility */
.mb-1 {
    margin-bottom: var(--bf-space-1);
}

.mb-2 {
    margin-bottom: var(--bf-space-2);
}

.mb-3 {
    margin-bottom: var(--bf-space-3);
}

.mb-4 {
    margin-bottom: var(--bf-space-4);
}

.mt-xs {
    margin-top: var(--bf-space-xs);
}

.mt-sm {
    margin-top: var(--bf-space-sm);
}

.mt-md {
    margin-top: var(--bf-space-md);
}

.mt-lg {
    margin-top: var(--bf-space-lg);
}

.mt-xl {
    margin-top: var(--bf-space-xl);
}

/* Compatibility */
.mt-1 {
    margin-top: var(--bf-space-1);
}

.mt-2 {
    margin-top: var(--bf-space-2);
}

.mt-3 {
    margin-top: var(--bf-space-3);
}

/* Extended Spacing Utilities */
.mt-2xl {
    margin-top: var(--bf-space-2xl);
}

.mt-3xl {
    margin-top: var(--bf-space-3xl);
}

.mt-4xl {
    margin-top: var(--bf-space-4xl);
}

.mb-2xl {
    margin-bottom: var(--bf-space-2xl);
}

.mb-3xl {
    margin-bottom: var(--bf-space-3xl);
}

.mb-4xl {
    margin-bottom: var(--bf-space-4xl);
}

.pt-xs {
    padding-top: var(--bf-space-xs);
}

.pt-sm {
    padding-top: var(--bf-space-sm);
}

.pt-md {
    padding-top: var(--bf-space-md);
}

.pt-lg {
    padding-top: var(--bf-space-lg);
}

.pt-xl {
    padding-top: var(--bf-space-xl);
}

.pt-2xl {
    padding-top: var(--bf-space-2xl);
}

.pb-xs {
    padding-bottom: var(--bf-space-xs);
}

.pb-sm {
    padding-bottom: var(--bf-space-sm);
}

.pb-md {
    padding-bottom: var(--bf-space-md);
}

.pb-lg {
    padding-bottom: var(--bf-space-lg);
}

.pb-xl {
    padding-bottom: var(--bf-space-xl);
}

.pb-2xl {
    padding-bottom: var(--bf-space-2xl);
}

.px-xs {
    padding-left: var(--bf-space-xs);
    padding-right: var(--bf-space-xs);
}

.px-sm {
    padding-left: var(--bf-space-sm);
    padding-right: var(--bf-space-sm);
}

.px-md {
    padding-left: var(--bf-space-md);
    padding-right: var(--bf-space-md);
}

.px-lg {
    padding-left: var(--bf-space-lg);
    padding-right: var(--bf-space-lg);
}

.px-xl {
    padding-left: var(--bf-space-xl);
    padding-right: var(--bf-space-xl);
}

.py-xs {
    padding-top: var(--bf-space-xs);
    padding-bottom: var(--bf-space-xs);
}

.py-sm {
    padding-top: var(--bf-space-sm);
    padding-bottom: var(--bf-space-sm);
}

.py-md {
    padding-top: var(--bf-space-md);
    padding-bottom: var(--bf-space-md);
}

.py-lg {
    padding-top: var(--bf-space-lg);
    padding-bottom: var(--bf-space-lg);
}

.py-xl {
    padding-top: var(--bf-space-xl);
    padding-bottom: var(--bf-space-xl);
}

/* Text Utilities */
.text-muted {
    color: var(--bf-text-tertiary);
}

.text-accent {
    color: var(--bf-accent);
}

.text-success {
    color: var(--bf-success);
}

.text-sm {
    font-size: var(--bf-text-sm);
}

.text-xs {
    font-size: var(--bf-text-xs);
}

.text-lg {
    font-size: var(--bf-text-lg);
}

.text-xl {
    font-size: var(--bf-text-xl);
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.uppercase {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* List Utilities */
.list-none {
    list-style: none;
    padding-left: 0;
}

.list-disc {
    list-style-type: disc;
}

.list-decimal {
    list-style-type: decimal;
}

.pl-md {
    padding-left: var(--bf-space-md);
}

.pl-lg {
    padding-left: var(--bf-space-lg);
}

/* Width Utilities */
.w-full {
    width: 100%;
}

.w-auto {
    width: auto;
}

.max-w-md {
    max-width: 28rem;
}

.max-w-lg {
    max-width: 32rem;
}

.max-w-xl {
    max-width: 36rem;
}

.max-w-2xl {
    max-width: 42rem;
}

.max-w-3xl {
    max-width: 48rem;
}

/* Column Span Utilities */
.col-span-2 {
    grid-column: span 2;
}

.col-span-3 {
    grid-column: span 3;
}

.col-span-full {
    grid-column: 1 / -1;
}

.row-span-2 {
    grid-row: span 2;
}

.row-span-3 {
    grid-row: span 3;
}

/* Opacity Utilities */
.opacity-50 {
    opacity: 0.5;
}

.opacity-70 {
    opacity: 0.7;
}

.opacity-80 {
    opacity: 0.8;
}

.opacity-90 {
    opacity: 0.9;
}

/* Transition Utility */
.transition {
    transition: all var(--bf-transition-fast);
}

/* Responsive Grid Modifiers */
@media (max-width: 992px) {
    .col-span-2--on-l {
        grid-column: span 2;
    }

    .col-span-1--on-l {
        grid-column: span 1;
    }

    .hidden--on-l {
        display: none;
    }
}

@media (max-width: 768px) {
    .col-span-2--on-m {
        grid-column: span 2;
    }

    .col-span-1--on-m {
        grid-column: span 1;
    }

    .col-span-full--on-m {
        grid-column: 1 / -1;
    }

    .hidden--on-m {
        display: none;
    }

    .text-center--on-m {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .col-span-1--on-s {
        grid-column: span 1;
    }

    .col-span-full--on-s {
        grid-column: 1 / -1;
    }

    .hidden--on-s {
        display: none;
    }

    .stack--on-s {
        flex-direction: column;
    }
}

/* ==========================================================================
   CARDS
   ========================================================================== */
.card {
    background: var(--bf-surface);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-md);
    padding: var(--bf-space-2);
    transition: all var(--bf-transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bf-gradient-dark);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--bf-transition);
}

.card:hover {
    border-color: var(--bf-border-strong);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.card:hover::before {
    transform: scaleX(1);
}

/* ==========================================================================
   BUTTONS - Clean, Minimal
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--bf-space-xs);
    padding: var(--bf-space-sm) var(--bf-space-lg);
    font-family: var(--bf-font-sans);
    font-size: var(--bf-text-sm);
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--bf-border-strong);
    border-radius: var(--bf-radius-full);
    background: transparent;
    color: var(--bf-text-primary);
    cursor: pointer;
    transition: all var(--bf-transition-fast);
}

.btn:hover {
    background: var(--bf-text-primary);
    color: var(--bf-background);
    border-color: var(--bf-text-primary);
}

/* Primary - filled dark */
.btn-primary {
    background: var(--bf-text-primary);
    color: var(--bf-background);
    border-color: var(--bf-text-primary);
}

.btn-primary:hover {
    background: transparent;
    color: var(--bf-text-primary);
}

/* Accent - teal brand color */
.btn-accent {
    background: var(--bf-accent);
    color: #FFFFFF;
    border-color: var(--bf-accent);
}

.btn-accent:hover {
    background: var(--bf-color-accent-dark);
    border-color: var(--bf-color-accent-dark);
}

/* Featured Alt - for accent backgrounds */
.btn-featured-alt {
    background: var(--bf-background);
    color: var(--bf-text-primary);
    border-color: var(--bf-background);
}

.btn-featured-alt:hover {
    background: transparent;
    color: var(--bf-background);
    border-color: var(--bf-background);
}

[data-theme="dark"] .btn-featured-alt {
    background: var(--bf-background);
    color: var(--bf-text-primary);
    border-color: var(--bf-background);
}

[data-theme="dark"] .btn-featured-alt:hover {
    background: transparent;
    color: var(--bf-text-primary);
    border-color: var(--bf-text-primary);
}

/* Ghost - minimal, underlined on hover */
.btn-ghost {
    border-color: transparent;
    padding: var(--bf-space-xs) 0;
    border-radius: 0;
    background: transparent;
}

.btn-ghost:hover {
    background: transparent;
    color: var(--bf-accent);
    border-color: transparent;
    border-bottom: 1px solid var(--bf-accent);
}

/* Small variant */
.btn-sm {
    padding: var(--bf-space-xs) var(--bf-space-md);
    font-size: var(--bf-text-xs);
}

/* Large variant */
.btn-lg {
    padding: var(--bf-space-md) var(--bf-space-xl);
    font-size: var(--bf-text-base);
}

.btn-ghost:hover {
    color: var(--bf-accent);
    transform: none;
}

.btn-ghost::after {
    content: '→';
    margin-left: var(--bf-space-half);
    transition: transform var(--bf-transition-fast);
}

.btn-ghost:hover::after {
    transform: translateX(4px);
}

/* Secondary Button */
.btn-secondary {
    background: var(--bf-surface-alt);
    color: var(--bf-text-primary);
    border-color: var(--bf-border);
}

.btn-secondary::before {
    background: var(--bf-text-primary);
}

.btn-secondary:hover {
    color: var(--bf-surface);
    border-color: var(--bf-text-primary);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    border-color: var(--bf-border-strong);
}

.btn-outline:hover {
    background: var(--bf-surface-alt);
    transform: none;
}

.btn-outline::before {
    display: none;
}

/* Destructive Button */
.btn-destructive {
    background: #ef4444;
    color: #ffffff;
    border-color: #ef4444;
}

.btn-destructive::before {
    background: #dc2626;
}

.btn-destructive:hover {
    color: #ffffff;
    border-color: #dc2626;
}

/* Link Button */
.btn-link {
    background: transparent;
    border: none;
    color: var(--bf-accent);
    text-decoration: underline;
    text-underline-offset: 4px;
    padding: var(--bf-space-xs) 0;
}

.btn-link::before {
    display: none;
}

.btn-link:hover {
    color: var(--bf-text-primary);
    transform: none;
}

/* Focus Ring Styles (shadcn-inspired) */
.btn:focus-visible,
.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 var(--bf-ring-offset) var(--bf-background), 0 0 0 calc(var(--bf-ring-offset) + 2px) var(--bf-ring);
}

/* ============ TAX CALCULATOR TABS ============ */
.calc-tabs {
    display: flex;
    justify-content: center;
    gap: var(--bf-space-sm);
    padding: var(--bf-space-xs);
    background: var(--bf-surface-alt);
    border-radius: var(--bf-radius-lg);
}

.calc-tabs .btn {
    flex: 1;
    max-width: 200px;
    padding: var(--bf-space-sm) var(--bf-space-lg);
    border-radius: var(--bf-radius-md);
    border: none;
    background: transparent;
    color: var(--bf-text-secondary);
    font-weight: 600;
}

.calc-tabs .btn::before {
    display: none;
}

.calc-tabs .btn::after {
    display: none;
}

.calc-tabs .btn:hover {
    color: var(--bf-text-primary);
    background: var(--bf-surface);
    transform: none;
}

.calc-tabs .btn.active {
    background: var(--bf-surface);
    color: var(--bf-text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.header-spacer {
    height: 72px;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(var(--bf-color-bg-rgb), 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--bf-space-1) 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.3s ease,
        box-shadow 0.3s ease,
        padding 0.3s ease;
}

.site-header.scrolled {
    box-shadow: 0 4px 30px rgba(34, 32, 78, 0.08);
    padding: var(--bf-space-half) 0;
}

.site-header.scrolled .site-logo {
    font-size: var(--bf-text-base);
}

.site-header.scrolled .main-nav a {
    font-size: var(--bf-text-xs);
}

.site-header.header-hidden {
    transform: translateY(-100%);
}

[data-theme="dark"] .site-header {
    background: rgba(var(--bf-color-bg-rgb), 0.92);
}

[data-theme="dark"] .site-header.scrolled {
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: var(--bf-text-lg);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--bf-text-primary);
}

.site-logo:hover {
    color: var(--bf-text-primary);
}

.main-nav ul {
    display: flex;
    gap: var(--bf-space-2);
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-nav a {
    font-size: var(--bf-text-sm);
    font-weight: 500;
    color: var(--bf-text-secondary);
    padding: var(--bf-space-half) 0;
    position: relative;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--bf-text-primary);
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--bf-text-primary);
    transition: width var(--bf-transition-fast);
    border-radius: 1px;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.header-cta {
    display: flex;
    align-items: center;
    gap: var(--bf-space-1);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--bf-radius-md);
    border: 1px solid var(--bf-border);
    background: var(--bf-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--bf-transition-fast);
}

.theme-toggle:hover {
    border-color: var(--bf-border-strong);
    transform: scale(1.05);
}

.theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
    color: #FFB800;
    text-shadow: 0 0 8px rgba(255, 184, 0, 0.6),
        0 0 16px rgba(255, 184, 0, 0.4);
    font-size: 1.25rem;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: var(--bf-space-half);
    cursor: pointer;
    z-index: 1002;
}

.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    min-height: 2px;
    background: var(--bf-color-text);
    margin: 4px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 1px;
    transform-origin: center;
    flex-shrink: 0;
}

/* Hamburger to X animation - bars move to center and rotate */
.menu-toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ==========================================================================
   HERO - FIXED TEXT VISIBILITY
   ========================================================================== */
.hero {
    min-height: 85vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    /* CRITICAL FIX: Contains the orb */
    background: var(--bf-gradient-surface);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    margin-bottom: var(--bf-space-1);
    color: var(--bf-text-primary);
}

[data-theme="dark"] .hero h1 {
    background: linear-gradient(135deg, #ffffff 0%, #a0a0a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title,
.hero p.lead {
    color: var(--bf-text-primary);
}

.hero .lead {
    margin-bottom: var(--bf-space-2);
}

.hero-cta {
    display: flex;
    gap: var(--bf-space-1);
    flex-wrap: wrap;
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--bf-accent);
    margin-left: 4px;
    animation: blink 1s infinite;
    vertical-align: text-bottom;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.hero-grid {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    opacity: 0.3;
    pointer-events: none;
}

.hero-grid svg {
    width: 100%;
    height: 100%;
}

.hero-orb {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 102, 204, 0.08) 0%, transparent 70%);
    top: 50%;
    right: -200px;
    transform: translateY(-50%);
    animation: float 8s ease-in-out infinite;
    pointer-events: none;
}

[data-theme="dark"] .hero-orb {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(-50%) scale(1);
    }

    50% {
        transform: translateY(-55%) scale(1.05);
    }
}

/* ==========================================================================
   TRUST BAR
   ========================================================================== */
.trust-bar {
    padding: var(--bf-space-3) 0;
    border-top: 1px solid var(--bf-border);
    border-bottom: 1px solid var(--bf-border);
    background: var(--bf-surface);
}

.trust-logos {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--bf-space-3);
    flex-wrap: wrap;
}

.trust-item {
    font-weight: 600;
    color: var(--bf-text-tertiary);
    transition: color var(--bf-transition-fast);
}

.trust-item:hover {
    color: var(--bf-text-secondary);
}

/* ==========================================================================
   PILLAR BLOCKS
   ========================================================================== */
.pillar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: var(--bf-space-2);
}

.pillar-block {
    background: var(--bf-surface);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-lg);
    padding: var(--bf-space-2);
    transition: all var(--bf-transition);
    position: relative;
    overflow: hidden;
}

.pillar-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--bf-text-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--bf-transition);
}

.pillar-block:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    border-color: var(--bf-border-strong);
}

.pillar-block:hover::before {
    transform: scaleX(1);
}

.pillar-number {
    font-size: var(--bf-text-4xl);
    font-weight: 700;
    color: var(--bf-border);
    line-height: 1;
    margin-bottom: var(--bf-space-1);
    transition: color var(--bf-transition);
}

.pillar-block:hover .pillar-number {
    color: var(--bf-border-strong);
}

.pillar-block h3 {
    margin-bottom: var(--bf-space-half);
}

.pillar-list {
    list-style: none;
    margin-top: var(--bf-space-1);
    padding-top: var(--bf-space-1);
    border-top: 1px solid var(--bf-border);
}

.pillar-list li {
    font-size: var(--bf-text-sm);
    color: var(--bf-text-secondary);
    padding: var(--bf-space-quarter) 0;
    padding-left: var(--bf-space-1);
    position: relative;
}

.pillar-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 4px;
    background: var(--bf-text-tertiary);
    border-radius: 50%;
    transform: translateY(-50%);
}

/* ==========================================================================
   DIAGNOSTICS DASHBOARD
   ========================================================================== */
.diagnostics {
    background: var(--bf-surface);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-lg);
    padding: var(--bf-space-2);
}

.diagnostics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
    gap: var(--bf-space-1);
}

.diagnostic-item {
    text-align: center;
    padding: var(--bf-space-1);
    /* Use bottom border instead - works better with reflow */
    border-bottom: 1px solid var(--bf-border);
}

.diagnostic-item:last-child {
    border-bottom: none;
}

/* On wider screens, use right borders for horizontal layout */
@media (min-width: 640px) {
    .diagnostic-item {
        border-bottom: none;
        border-right: 1px solid var(--bf-border);
    }

    .diagnostic-item:last-child {
        border-right: none;
    }
}

.diagnostic-value {
    font-size: var(--bf-text-2xl);
    font-weight: 700;
    color: var(--bf-text-primary);
    margin-bottom: var(--bf-space-quarter);
}

.diagnostic-value.success {
    color: var(--bf-success);
}

.diagnostic-label {
    font-size: var(--bf-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bf-text-tertiary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--bf-text-tertiary);
}

.status-dot.active {
    background: var(--bf-success);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.2);
    }
}

/* ==========================================================================
   TESTIMONIALS - Grid Layout (No horizontal scroll)
   ========================================================================== */
.testimonials-scroll {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--bf-space-lg);
    width: 100%;
}

@media (min-width: 768px) {
    .testimonials-scroll {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .testimonials-scroll {
        grid-template-columns: repeat(3, 1fr);
    }
}

.testimonials-scroll::-webkit-scrollbar {
    display: none;
}

.testimonial-card {
    background: var(--bf-surface);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-xl);
    padding: var(--bf-space-xl);
    transition: all var(--bf-transition);
    display: flex;
    flex-direction: column;
    gap: var(--bf-space-md);
}

.testimonial-card:hover {
    border-color: var(--bf-border-strong);
    box-shadow: var(--bf-shadow-md);
}

/* Star ratings */
.testimonial-stars,
.testimonial-rating {
    display: flex;
    gap: 2px;
    margin-bottom: var(--bf-space-sm);
}

.testimonial-stars span,
.testimonial-rating span {
    color: #F59E0B;
    /* Amber/gold for stars */
    font-size: 1rem;
}

.testimonial-quote {
    font-size: var(--bf-text-base);
    line-height: 1.7;
    color: var(--bf-text-secondary);
    flex-grow: 1;
}

/* Author section with avatar */
.testimonial-author {
    display: flex;
    align-items: center;
    gap: var(--bf-space-sm);
    margin-top: auto;
}

.testimonial-author img,
.testimonial-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--bf-accent);
    object-fit: cover;
}

.testimonial-author-info {
    display: flex;
    flex-direction: column;
}

.testimonial-author strong,
.testimonial-author-name {
    color: var(--bf-text-primary);
    font-weight: 600;
    font-size: var(--bf-text-sm);
}

.testimonial-author span:not(.testimonial-author-name),
.testimonial-author-role {
    color: var(--bf-text-tertiary);
    font-size: var(--bf-text-xs);
}

/* ==========================================================================
   PRICING
   ========================================================================== */
/* ⬇️ LEFT EXACTLY AS YOU SENT IT – SPACING PRESERVED */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--bf-space-2);
    align-items: stretch;
    /* CRITICAL FIX: Equal height */
}

.pricing-block {
    background: var(--bf-surface);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-lg);
    padding: var(--bf-space-2);
    transition: all var(--bf-transition);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
}

.pricing-block:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
}

.pricing-block.featured {
    border-color: var(--bf-text-primary);
}

.pricing-block.featured::before {
    content: 'Most Popular';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bf-text-primary);
    color: var(--bf-surface);
    font-size: var(--bf-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: var(--bf-space-quarter) var(--bf-space-1);
    border-radius: var(--bf-radius-sm);
}

.pricing-title {
    font-size: var(--bf-text-xl);
    font-weight: 600;
    margin-bottom: var(--bf-space-quarter);
}

.pricing-price {
    font-size: var(--bf-text-2xl);
    font-weight: 700;
    color: var(--bf-text-primary);
    margin-bottom: var(--bf-space-quarter);
}

.pricing-price-alt {
    font-size: var(--bf-text-sm);
    color: var(--bf-text-tertiary);
    margin-bottom: var(--bf-space-1);
}

.pricing-desc {
    font-size: var(--bf-text-sm);
    color: var(--bf-text-secondary);
    margin-bottom: var(--bf-space-2);
    flex-grow: 1;
}

.pricing-features {
    list-style: none;
    margin-bottom: var(--bf-space-2);
    flex-grow: 1;
}

.pricing-features li {
    font-size: var(--bf-text-sm);
    padding: var(--bf-space-half) 0;
    border-bottom: 1px solid var(--bf-border);
    color: var(--bf-text-secondary);
    display: flex;
    align-items: center;
    gap: var(--bf-space-half);
}

.pricing-features li::before {
    content: '✓';
    color: var(--bf-success);
    font-weight: 600;
}

.pricing-features li:last-child {
    border-bottom: none;
}

.pricing-block .btn {
    margin-top: auto;
}

/* ==========================================================================
   PRICING & CARD ACCESSIBILITY
   ========================================================================== */
.bento-item,
.case-item {
    background: var(--bf-surface-alt);
    border: 1px solid var(--bf-border);
    color: var(--bf-text-primary);
}

/* FEATURED PRICING CARD - STRICT INVERSION LOGIC */
.bento-item.featured-pricing {
    /* LIGHT MODE: Card is BLACK, Text is WHITE */
    background: #000000;
    color: #ffffff;
    border-color: #000000;
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

/* Force all text elements to White in Light Mode */
.bento-item.featured-pricing .label,
.bento-item.featured-pricing .pricing-price-alt,
.bento-item.featured-pricing .pricing-desc,
.bento-item.featured-pricing p,
.bento-item.featured-pricing h3,
.bento-item.featured-pricing .pricing-title,
.bento-item.featured-pricing .pricing-price {
    color: #ffffff;
}

.bento-item.featured-pricing .pricing-features li {
    color: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
}

/* BUTTON - LIGHT MODE (Black Card -> White Button) */
/* Targeted specifically to override .btn-primary */
.bento-item.featured-pricing .btn,
.bento-item.featured-pricing .btn.btn-primary {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
    font-weight: 600;
}

.bento-item.featured-pricing .btn:hover,
.bento-item.featured-pricing .btn.btn-primary:hover {
    background: #f0f0f0 !important;
    border-color: #f0f0f0 !important;
    color: var(--bf-accent) !important;
    /* Dark Blue Text */
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

/* DARK MODE OVERRIDES */
[data-theme="dark"] .bento-item.featured-pricing {
    /* DARK MODE: Card is WHITE, Text is BLACK */
    background: #ffffff !important;
    color: #000000 !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 50px rgba(255, 255, 255, 0.15);
}

/* Force all text elements to Black in Dark Mode */
[data-theme="dark"] .bento-item.featured-pricing .label,
[data-theme="dark"] .bento-item.featured-pricing .pricing-price-alt,
[data-theme="dark"] .bento-item.featured-pricing .pricing-desc,
[data-theme="dark"] .bento-item.featured-pricing p,
[data-theme="dark"] .bento-item.featured-pricing h3,
[data-theme="dark"] .bento-item.featured-pricing .pricing-title,
[data-theme="dark"] .bento-item.featured-pricing .pricing-price {
    color: #000000 !important;
}

[data-theme="dark"] .bento-item.featured-pricing .pricing-features li {
    color: rgba(0, 0, 0, 0.8) !important;
    border-color: rgba(0, 0, 0, 0.15);
}

/* BUTTON - DARK MODE (White Card -> Black Button) */
[data-theme="dark"] .bento-item.featured-pricing .btn,
[data-theme="dark"] .bento-item.featured-pricing .btn.btn-primary {
    background: #000000 !important;
    color: #ffffff !important;
    border-color: #000000 !important;
}

[data-theme="dark"] .bento-item.featured-pricing .btn:hover,
[data-theme="dark"] .bento-item.featured-pricing .btn.btn-primary:hover {
    background: var(--bf-accent) !important;
    border-color: var(--bf-accent) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .bento-item {
    background: var(--bf-surface);
}

/* ==========================================================================
   TAX CALCULATOR RESULTS
   ========================================================================== */
.result-card {
    background: var(--bf-surface-alt);
    border-radius: var(--bf-radius-lg);
    padding: var(--bf-space-lg);
    margin-top: var(--bf-space-md);
    text-align: center;
}

.result-amount {
    font-size: clamp(3rem, 6vw + 1rem, 4rem);
    /* Hero-sized: 48px → 64px */
    font-weight: 700;
    color: var(--bf-success);
    line-height: 1.1;
    margin-bottom: var(--bf-space-sm);
    text-align: center;
}

/* Fix centering - override global p max-width constraint */
.result-card p,
.result-card .label {
    max-width: none;
    margin-left: auto;
    margin-right: auto;
}

/* Result Stats Grid */
.result-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--bf-space-md);
    border-top: 1px solid var(--bf-border);
    padding-top: var(--bf-space-lg);
    margin-top: var(--bf-space-md);
}

.result-stat {
    text-align: center;
}

.result-stat-label {
    display: block;
    font-size: var(--bf-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--bf-text-tertiary);
    margin-bottom: var(--bf-space-xs);
}

.result-stat-value {
    display: block;
    font-size: var(--bf-text-2xl);
    font-weight: 700;
    color: var(--bf-text-primary);
}

@media (max-width: 640px) {
    .result-stats {
        grid-template-columns: 1fr;
        gap: var(--bf-space-sm);
    }

    .result-stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: var(--bf-space-sm) 0;
        border-bottom: 1px solid var(--bf-border);
    }

    .result-stat:last-child {
        border-bottom: none;
    }

    .result-stat-label {
        margin-bottom: 0;
    }
}

/* ==========================================================================
   TAX GUIDE COMPONENTS
   ========================================================================== */
.guide-card {
    background: var(--bf-surface);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-md);
    padding: var(--bf-space-lg);
    transition: all var(--bf-transition);
}

.guide-card:hover {
    border-color: var(--bf-border-strong);
    transform: translateY(-2px);
}

.state-portal-card {
    background: var(--bf-surface);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-md);
    padding: var(--bf-space-md);
    text-align: center;
    transition: all var(--bf-transition-fast);
}

.state-portal-card:hover {
    border-color: var(--bf-accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.state-portal-card h6 {
    margin-bottom: var(--bf-space-xs);
    font-size: var(--bf-text-sm);
}

.state-portal-card a {
    font-size: var(--bf-text-xs);
    display: inline-block;
    padding: var(--bf-space-xs) var(--bf-space-sm);
    background: var(--bf-accent-subtle);
    border-radius: var(--bf-radius-sm);
    transition: all var(--bf-transition-fast);
}

.state-portal-card a:hover {
    background: var(--bf-accent);
    color: #fff;
}

.tax-bands-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--bf-text-sm);
}

.tax-bands-table th,
.tax-bands-table td {
    padding: var(--bf-space-sm) var(--bf-space-md);
    text-align: left;
    border-bottom: 1px solid var(--bf-border);
}

.tax-bands-table th {
    font-weight: 600;
    color: var(--bf-text-primary);
    background: var(--bf-surface-alt);
}

.tax-bands-table tr:hover td {
    background: var(--bf-surface-alt);
}

/* State Grid - 6 columns on desktop, responsive */
.state-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--bf-space-sm);
}

@media (max-width: 1024px) {
    .state-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .state-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .state-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   PORTFOLIO FILTERS
   ========================================================================== */
.case-filters {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: var(--bf-space-2);
}

.filter-btn {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--bf-border-strong);
    background: transparent;
    color: var(--bf-text-secondary);
    font-size: var(--bf-text-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    border-color: var(--bf-text-primary);
    color: var(--bf-text-primary);
}

.filter-btn.active {
    background: var(--bf-text-primary);
    color: var(--bf-background);
    border-color: var(--bf-text-primary);
}

/* ==========================================================================
   FOOTER - BLACK BACKGROUND
   ========================================================================== */
.site-footer {
    background: #000000;
    color: #ffffff;
    padding: var(--bf-space-4) 0 var(--bf-space-2);
    margin-top: var(--bf-space-4);
}

.site-footer p,
.site-footer a,
.site-footer h6 {
    color: rgba(255, 255, 255, 0.7);
}

.site-footer a:hover {
    color: #ffffff;
}

[data-theme="dark"] .site-footer {
    background: #000000;
}

.footer-grid {
    display: grid;
    /* Fluid grid: brand takes more space, nav columns are flexible */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: var(--bf-space-3);
    margin-bottom: var(--bf-space-3);
}

.footer-brand h3 {
    color: #ffffff;
    font-size: var(--bf-text-xl);
    margin-bottom: var(--bf-space-1);
}

.footer-brand p {
    color: var(--bf-accent-20, #b2afcc);
    font-size: var(--bf-text-sm);
    max-width: 300px;
}

.footer-col h6 {
    color: var(--bf-accent-30, #9591b6);
    margin-bottom: var(--bf-space-1);
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: var(--bf-space-half);
}

.footer-col a {
    font-size: var(--bf-text-sm);
    color: var(--bf-accent-10, #d0cee3);
    transition: color var(--bf-transition-fast);
}

.footer-col a:hover {
    color: #ffffff;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--bf-space-2);
    border-top: 1px solid var(--bf-accent-80, rgba(255, 255, 255, 0.15));
}

.footer-bottom p {
    font-size: var(--bf-text-xs);
    color: var(--bf-accent-30, #9591b6);
    margin: 0;
}

.footer-cta .btn {
    background: var(--bf-text-primary);
    color: var(--bf-background);
    border-color: var(--bf-text-primary);
    border-radius: var(--bf-radius-md);
}

.footer-cta .btn:hover {
    background: transparent;
    color: var(--bf-text-primary);
    border-color: var(--bf-text-primary);
}

[data-theme="dark"] .footer-cta .btn:hover {
    background: var(--bf-text-primary);
    color: var(--bf-background);
    border-color: var(--bf-text-primary);
}

/* ==========================================================================
   TAX CALCULATOR & FORMS
   ========================================================================== */
.input,
.select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bf-surface);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-sm);
    color: var(--bf-text-primary);
    font-family: var(--bf-font-sans);
    font-size: var(--bf-text-base);
    transition: all 0.2s ease;
}

.input:focus,
.select:focus {
    outline: none;
    border-color: var(--bf-accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input::placeholder {
    color: var(--bf-text-muted);
}

[data-theme="dark"] .input,
[data-theme="dark"] .select {
    background: var(--bf-surface-alt);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .input:focus,
[data-theme="dark"] .select:focus {
    border-color: var(--bf-accent);
}

.result-card {
    background: var(--bf-surface-alt);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-md);
    padding: var(--bf-space-lg);
}

/* Tax Bands Tables - Responsive */
.tax-bands-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--bf-text-sm);
}

.tax-bands-table th,
.tax-bands-table td {
    padding: var(--bf-space-sm) var(--bf-space-xs);
    text-align: left;
    border-bottom: 1px solid var(--bf-border);
}

.tax-bands-table th {
    font-weight: 600;
    color: var(--bf-text-primary);
    font-size: var(--bf-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tax-bands-table td {
    color: var(--bf-text-secondary);
}

.tax-bands-table tr:last-child td {
    border-bottom: none;
}

/* Make tables scrollable on mobile within their container */
@media (max-width: 480px) {
    .tax-bands-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tax-bands-table th,
    .tax-bands-table td {
        white-space: nowrap;
        padding: var(--bf-space-xs);
        font-size: var(--bf-text-xs);
    }
}

/* ==========================================================================
   TAX CALCULATOR – LAYOUT CONTROL (FIXED)
   ========================================================================== */

/* OVERRIDE CONTAINER-NARROW for Calculator Section Only */
.page-template-default .section:has(#ng-tax-calc) .container-narrow {
    max-width: var(--bf-container) !important;
}

/* Base Calculator Spacing */
#ng-tax-calc {
    padding: var(--bf-space-lg) !important;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

/* Tabs spacing - ensure proper padding around buttons */
#ng-tax-calc .calc-tabs {
    padding: var(--bf-space-1) var(--bf-space-2) var(--bf-space-2);
    margin-bottom: var(--bf-space-2);
    display: flex;
    gap: var(--bf-space-1);
}

/* ======================================================
   🔥 CORE FIX — FORCE 2 COLUMNS BY DEFAULT
   ====================================================== */

/* DEFAULT: 2 columns on desktop + tablet */
#ng-tax-calc .calc-section>.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--bf-space-2);
}

/* Prevent grid collapse due to input width */
#ng-tax-calc .form-group,
#ng-tax-calc .input,
#ng-tax-calc .select {
    min-width: 0;
    box-sizing: border-box;
}

/* Tax insights spacing */
#ng-tax-calc .tax-insights .grid-2 {
    gap: var(--bf-space-2);
}

/* Result card spacing */
#ng-tax-calc .result-card {
    padding: var(--bf-space-2) !important;
    margin-top: var(--bf-space-2);
    background: var(--bf-surface-alt);
    border-radius: var(--bf-radius-md);
}

#ng-tax-calc .result-card .grid-2 {
    gap: var(--bf-space-2);
    margin-top: var(--bf-space-2);
}

/* Result amount styling */
.result-amount {
    font-size: var(--bf-text-3xl);
    font-weight: 700;
    color: var(--bf-success);
    margin-bottom: var(--bf-space-sm);
}

/* Block display utility */
.block {
    display: block;
}


/* ==========================================================================
   RESPONSIVE BEHAVIOUR
   ========================================================================== */

/* Tablet & Landscape Mobile — KEEP 2 COLUMNS */
@media (max-width: 768px) {
    #ng-tax-calc {
        padding: var(--bf-space-2) !important;
    }

    #ng-tax-calc .tax-insights .grid-2 {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile Portrait ONLY — STACK */
@media (max-width: 480px) {
    #ng-tax-calc .calc-section>.grid-2 {
        grid-template-columns: 1fr !important;
    }

    #ng-tax-calc {
        padding: var(--bf-space-2) !important;
    }

    #ng-tax-calc .calc-tabs {
        padding: 0 var(--bf-space-1) var(--bf-space-2);
        gap: var(--bf-space-1);
    }

    #ng-tax-calc .calc-tabs .btn {
        font-size: var(--bf-text-xs);
        padding: var(--bf-space-1) var(--bf-space-2);
    }
}

/* Large Desktop — breathe */
@media (min-width: 1100px) {
    #ng-tax-calc {
        padding: var(--bf-space-2xl) var(--bf-space-xl) !important;
    }
}


/* ==========================================================================
   PAGE HEADERS
   ========================================================================== */
.page-header {
    padding: var(--bf-space-4) 0 var(--bf-space-3);
    background: var(--bf-gradient-surface);
}

.page-header .label {
    margin-bottom: var(--bf-space-1);
}

.page-header h1 {
    max-width: 900px;
}

.page-header .lead {
    max-width: 700px;
}

/* ==========================================================================
   SERVICES/PILLARS PAGE
   ========================================================================== */
.service-section {
    padding: var(--bf-space-3) 0;
    border-bottom: 1px solid var(--bf-border);
}

.service-section:last-child {
    border-bottom: none;
}

.service-header {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--bf-space-3);
    margin-bottom: var(--bf-space-2);
}

.service-number {
    font-size: var(--bf-text-xs);
    color: var(--bf-text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.service-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--bf-space-1);
}

.service-feature {
    font-size: var(--bf-text-sm);
    color: var(--bf-text-secondary);
    padding-left: var(--bf-space-1);
    border-left: 2px solid var(--bf-border-strong);
    transition: all var(--bf-transition-fast);
}

.service-feature:hover {
    border-color: var(--bf-accent);
    color: var(--bf-text-primary);
}

/* ==========================================================================
   CASE SYSTEMS
   ========================================================================== */
.case-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--bf-space-2);
}

.case-card {
    background: var(--bf-surface);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-lg);
    overflow: hidden;
    transition: all var(--bf-transition);
}

.case-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.1);
    border-color: var(--bf-border-strong);
}

.case-image {
    aspect-ratio: 16/10;
    background: var(--bf-background);
    position: relative;
    overflow: hidden;
}

.case-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--bf-transition-slow);
}

.case-card:hover .case-image img {
    transform: scale(1.05);
}

.case-content {
    padding: var(--bf-space-2);
}

.case-tags {
    display: flex;
    gap: var(--bf-space-half);
    margin-bottom: var(--bf-space-1);
}

.case-tag {
    font-size: var(--bf-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bf-text-tertiary);
    padding: var(--bf-space-quarter) var(--bf-space-half);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-sm);
}

.case-title {
    font-size: var(--bf-text-lg);
    margin-bottom: var(--bf-space-half);
}

.case-desc {
    font-size: var(--bf-text-sm);
    color: var(--bf-text-secondary);
}

.case-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--bf-space-1);
    margin-top: var(--bf-space-2);
    padding-top: var(--bf-space-2);
    border-top: 1px solid var(--bf-border);
}

.case-metric {
    text-align: center;
}

.case-metric-label {
    font-size: var(--bf-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bf-text-tertiary);
    margin-bottom: var(--bf-space-quarter);
}

.case-metric-pre {
    font-size: var(--bf-text-sm);
    color: var(--bf-text-tertiary);
    text-decoration: line-through;
}

.case-metric-post {
    font-size: var(--bf-text-lg);
    font-weight: 700;
    color: var(--bf-success);
}

.case-item {
    transition: all var(--bf-transition), opacity 0.3s ease, transform 0.3s ease;
}

/* ==========================================================================
   CONTACT PAGE
   ========================================================================== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--bf-space-3);
}

.contact-info h3 {
    margin-bottom: var(--bf-space-2);
}

.contact-method {
    margin-bottom: var(--bf-space-2);
}

.contact-method .label {
    margin-bottom: var(--bf-space-half);
}

.contact-method a {
    font-size: var(--bf-text-lg);
    font-weight: 600;
    color: var(--bf-text-primary);
}

.contact-form {
    background: var(--bf-surface);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-lg);
    padding: var(--bf-space-2);
    display: flex;
    flex-direction: column;
    gap: var(--bf-space-1);
}

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: var(--bf-space-1);
}

.form-group label {
    display: block;
    font-size: var(--bf-text-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bf-text-tertiary);
    margin-bottom: var(--bf-space-half);
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--bf-space-1);
    font-family: var(--bf-font-system);
    font-size: var(--bf-text-base);
    border: 1px solid var(--bf-border);
    border-radius: var(--bf-radius-md);
    background: var(--bf-background);
    color: var(--bf-text-primary);
    transition: all var(--bf-transition-fast);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--bf-text-primary);
    box-shadow: 0 0 0 3px var(--bf-accent-subtle);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--bf-text-tertiary);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea {
    background: var(--bf-surface);
}

[data-theme="dark"] .form-group select {
    background-color: var(--bf-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
}

/* ==========================================================================
   STATUS INDICATORS
   ========================================================================== */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: var(--bf-space-half);
}

.status-dot.active {
    background: var(--bf-success);
}

.status-dot.warning {
    background: var(--bf-notice);
}

.status-dot.inactive {
    background: var(--bf-text-tertiary);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--bf-transition), transform var(--bf-transition);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-children>* {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--bf-transition), transform var(--bf-transition);
}

.stagger-children.visible>*:nth-child(1) {
    transition-delay: 0s;
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.visible>*:nth-child(2) {
    transition-delay: 0.1s;
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.visible>*:nth-child(3) {
    transition-delay: 0.2s;
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.visible>*:nth-child(4) {
    transition-delay: 0.3s;
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.visible>*:nth-child(5) {
    transition-delay: 0.4s;
    opacity: 1;
    transform: translateY(0);
}

.stagger-children.visible>*:nth-child(6) {
    transition-delay: 0.5s;
    opacity: 1;
    transform: translateY(0);
}

.slide-left {
    opacity: 0;
    transform: translateX(-40px);
    transition: all var(--bf-transition);
}

.slide-right {
    opacity: 0;
    transform: translateX(40px);
    transition: all var(--bf-transition);
}

.slide-left.visible,
.slide-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.95);
    transition: all var(--bf-transition);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Filtering State */
.filtered-out {
    opacity: 0 !important;
    transform: scale(0.95);
    pointer-events: none;
    transition: all var(--bf-transition);
}

.counter {
    display: inline-block;
}

/* ==========================================================================
   BACK TO TOP BUTTON
   ========================================================================== */
.back-to-top {
    position: fixed;
    bottom: var(--bf-space-lg);
    right: var(--bf-space-lg);
    width: 48px;
    height: 48px;
    border-radius: var(--bf-radius-full);
    background: var(--bf-accent);
    color: #ffffff;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--bf-transition-fast);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    background: var(--bf-text-primary);
}

.back-to-top:active {
    transform: translateY(-2px);
}

/* ==========================================================================
   MICRO-INTERACTIONS & HOVER EFFECTS
   ========================================================================== */

/* Subtle hover lift for cards and interactive elements */
.hover-lift {
    transition: transform var(--bf-transition-fast), box-shadow var(--bf-transition-fast);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

/* Glow effect on hover */
.hover-glow {
    transition: box-shadow var(--bf-transition-fast);
}

.hover-glow:hover {
    box-shadow: 0 0 0 4px var(--bf-accent-subtle), 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Scale on hover */
.hover-scale {
    transition: transform var(--bf-transition-fast);
}

.hover-scale:hover {
    transform: scale(1.02);
}

/* Subtle pulse animation for CTAs */
@keyframes subtle-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(var(--bf-accent-rgb, 34, 32, 78), 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(var(--bf-accent-rgb, 34, 32, 78), 0);
    }
}

.pulse-attention {
    animation: subtle-pulse 2s ease-in-out infinite;
}

/* Icon rotation on hover */
.hover-rotate {
    transition: transform var(--bf-transition-fast);
}

.hover-rotate:hover {
    transform: rotate(15deg);
}

/* Text underline grow effect */
.underline-grow {
    position: relative;
    text-decoration: none;
}

.underline-grow::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    transition: width var(--bf-transition-fast);
}

.underline-grow:hover::after {
    width: 100%;
}

/* Shimmer effect for loading states */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.shimmer {
    background: linear-gradient(90deg,
            var(--bf-surface-alt) 25%,
            var(--bf-surface) 50%,
            var(--bf-surface-alt) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* Smooth border color transition for all interactive elements */
a,
button,
input,
select,
textarea,
.card,
.bento-item {
    transition-property: color, background-color, border-color, box-shadow, transform, opacity;
    transition-duration: var(--bf-transition-fast);
    transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   ACCESSIBILITY
   ========================================================================== */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

.skip-link:focus {
    clip: auto;
    height: auto;
    width: auto;
    position: fixed;
    top: var(--bf-space-1);
    left: var(--bf-space-1);
    background: var(--bf-text-primary);
    color: var(--bf-surface);
    padding: var(--bf-space-1) var(--bf-space-2);
    z-index: 10000;
    border-radius: var(--bf-radius-md);
}

/* ==========================================================================
   RESPONSIVE - Minimal Breakpoints (grids are now intrinsically fluid)
   Only keeping styles that can't be done with intrinsic sizing
   ========================================================================== */

/* Note: Grid layouts (bento-3, bento-4, grid-2, grid-3, etc.) are now 
   intrinsically fluid using auto-fit/minmax and don't need breakpoints */

@media (max-width: 768px) {

    /* Allow natural scrolling - don't hide overflow */
    html,
    body {
        max-width: 100vw;
    }

    /* Container responsive padding */
    .container {
        padding-left: clamp(1rem, 4vw, 2rem);
        padding-right: clamp(1rem, 4vw, 2rem);
    }

    /* Tables get horizontal scroll */
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Media elements are fluid */
    img,
    video,
    iframe,
    embed,
    object {
        max-width: 100%;
        height: auto;
    }

    /* Grid items need min-width: 0 to prevent overflow from content */
    .grid,
    .grid-2,
    .grid-3,
    .grid-12,
    .bento-grid,
    .bento-2x2,
    .bento-3,
    .bento-4 {
        min-width: 0;
    }

    .grid>*,
    .bento-grid>* {
        min-width: 0;
    }

    /* Add right padding to header on mobile to prevent X clipping */
    .header-inner {
        padding-right: 1rem;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    /* CRITICAL FIX: Mobile Nav Drawer */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        position: relative;
        z-index: 1002;
    }

    /* Make hamburger bars visible in both modes */
    .menu-toggle span {
        width: 22px;
        height: 2.5px !important;
        min-height: 2.5px !important;
        background: var(--bf-color-text) !important;
        flex-shrink: 0;
    }

    /* Ensure header controls stay on top and visible */
    .header-cta {
        position: relative;
        z-index: 1003;
    }

    /* Theme toggle always visible on mobile */
    .theme-toggle {
        display: flex !important;
        z-index: 1003;
    }

    /* Menu toggle (hamburger/X) always visible and not clipped */
    .menu-toggle {
        z-index: 1003 !important;
        overflow: visible !important;
        margin-right: 16px;
        padding: 10px;
    }

    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        background: var(--bf-background);
        z-index: 1001;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease, visibility 0.4s ease;
        will-change: opacity;
    }

    .main-nav.active {
        opacity: 1;
        visibility: visible;
    }

    .main-nav ul {
        flex-direction: column;
        gap: var(--bf-space-md);
        align-items: center;
        padding: 0;
        margin: 0;
        list-style: none;
        text-align: center;
    }

    .main-nav li {
        width: 100%;
        text-align: center;
    }

    /* Large centered menu links */
    .main-nav a {
        font-family: var(--bf-font-display);
        font-size: clamp(1.5rem, 5vw, 2rem);
        font-weight: 500;
        color: var(--bf-text-secondary);
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.4s ease, transform 0.4s ease, color 0.2s ease;
        display: inline-block;
        padding: var(--bf-space-sm) var(--bf-space-md);
        text-decoration: none;
    }

    .main-nav a:hover,
    .main-nav a:focus {
        color: var(--bf-text-primary);
    }

    /* Current/active page link */
    .main-nav li.current-menu-item a,
    .main-nav a[aria-current="page"] {
        color: var(--bf-text-primary);
        font-weight: 600;
    }

    /* Focus states for accessibility */
    .main-nav a:focus-visible {
        outline: 2px solid var(--bf-accent);
        outline-offset: 4px;
        border-radius: var(--bf-radius-sm);
    }

    .menu-toggle:focus-visible {
        outline: 2px solid var(--bf-accent);
        outline-offset: 2px;
        border-radius: var(--bf-radius-sm);
    }

    .main-nav.active a {
        opacity: 1;
        transform: translateY(0);
    }

    /* Staggered animation for menu items */
    .main-nav.active li:nth-child(1) a {
        transition-delay: 0.05s;
    }

    .main-nav.active li:nth-child(2) a {
        transition-delay: 0.1s;
    }

    .main-nav.active li:nth-child(3) a {
        transition-delay: 0.15s;
    }

    .main-nav.active li:nth-child(4) a {
        transition-delay: 0.2s;
    }

    .main-nav.active li:nth-child(5) a {
        transition-delay: 0.25s;
    }

    .main-nav.active li:nth-child(6) a {
        transition-delay: 0.3s;
    }

    .header-cta .btn.header-cta-btn {
        display: none;
    }

    /* Body no-scroll when menu is open */
    body.no-scroll {
        overflow: hidden;
    }

    /* Overlay backdrop hidden - full screen is now the menu itself */
    .menu-overlay {
        display: none !important;
        visibility: hidden !important;
    }

    /* Note: Grid stacking is now handled automatically by auto-fit/minmax */
    /* Only keeping specific overrides that can't be done intrinsically */

    .bento-item {
        padding: var(--bf-space-1) calc(var(--bf-space-1) + 4px);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--bf-space-1);
        text-align: center;
    }

    .site-footer {
        padding: var(--bf-space-3) 0 var(--bf-space-2);
    }

    .hero-orb {
        right: -30%;
        opacity: 0.5;
    }

    /* Footer stacked layout on tablet/mobile - fully centered */
    .footer-grid {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: var(--bf-space-lg);
    }

    .footer-brand,
    .footer-col {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: var(--bf-space-md) 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .footer-brand:last-child,
    .footer-col:last-child {
        border-bottom: none;
    }

    .footer-brand h3,
    .footer-brand p,
    .footer-col h6,
    .footer-col a {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
        max-width: none;
    }

    .footer-col ul {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--bf-space-sm);
        padding: 0;
        list-style: none;
    }

    .footer-col h6 {
        margin-bottom: var(--bf-space-sm);
        font-size: var(--bf-text-xs);
        text-transform: uppercase;
        letter-spacing: 0.1em;
        opacity: 0.7;
    }
}

/* Small devices - minimal overrides since grids are intrinsically fluid */
@media (max-width: 480px) {
    :root {
        --bf-space-xl: 32px;
        --bf-space-2xl: 48px;
    }

    .container {
        padding-inline: 1rem;
    }

    /* Tables need horizontal scroll */
    .tax-bands-table {
        display: block;
        overflow-x: auto;
    }

    .section {
        padding: 3rem 0;
    }

    /* Fluid typography - already using clamp, just smaller base */
    h1 {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    h2 {
        font-size: clamp(1.25rem, 5vw, 1.75rem);
    }

    .hero h1 {
        font-size: clamp(1.75rem, 7vw, 2.5rem);
    }

    /* Fluid buttons - stack when needed */
    .btn {
        width: 100%;
    }

    /* CRITICAL: Force ALL grids to single column on mobile */
    .bento-grid,
    .bento-2x2,
    .bento-3,
    .bento-4,
    .bento-featured,
    .bento-asymmetric,
    .grid-2,
    .grid-3,
    .grid-12,
    .pillar-grid,
    .diagnostics-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    /* Remove any large item spanning */
    .bento-asymmetric .bento-item.large,
    .bento-featured .bento-item:first-child {
        grid-column: 1;
        grid-row: auto;
    }

    .hero-cta {
        flex-direction: column;
        align-items: stretch;
    }

    /* Footer stacked layout on mobile - fully centered, reset desktop styles */
    .footer-grid {
        grid-template-columns: 1fr !important;
        text-align: center;
        gap: var(--bf-space-lg);
    }

    .footer-brand,
    .footer-col {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: var(--bf-space-md) 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .footer-brand:last-child,
    .footer-col:last-child {
        border-bottom: none;
    }

    .footer-brand h3,
    .footer-brand p,
    .footer-col h6,
    .footer-col a {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
        max-width: none;
    }

    .footer-col ul {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--bf-space-sm);
        padding: 0;
        list-style: none;
    }

    .footer-col h6 {
        margin-bottom: var(--bf-space-sm);
        font-size: var(--bf-text-xs);
        text-transform: uppercase;
        letter-spacing: 0.1em;
        opacity: 0.7;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: center;
        gap: var(--bf-space-md);
        text-align: center;
    }

    .footer-bottom p {
        order: 1;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ==========================================================================
   WORDPRESS CORE DEFAULTS (Safety Net)
   ========================================================================== */
.alignwide {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.alignfull {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
}

.alignleft {
    float: left;
    margin-right: 1.5em;
    margin-bottom: 1.5em;
}

.alignright {
    float: right;
    margin-left: 1.5em;
    margin-bottom: 1.5em;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.wp-caption {
    margin-bottom: 1.5em;
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.875rem;
    color: var(--bf-text-tertiary);
    text-align: center;
    margin-top: 0.5em;
}