/*
 * base.css — Global design tokens & base typography
 *   - Typography: (Mobile ≤440 / Tablet 577–1024 / Laptop 1440+)
 *   - Colors:  (Brand / Neutral / Interactive / Surface)
 */

:root {
    --breakpoint-tablet: 37.5rem; /* 600px · Figma "Medium" · Tablet 577–1024px */
    --breakpoint-desktop: 56.25rem; /* 900px · project mid tier */
    --breakpoint-wide: 75rem; /* 1200px · Figma "Large" · Laptop 1440px+ */

    /* ==========================================================================
     COLOR — raw palette
     ========================================================================== */

    /* Neutral · Black (IBX Black) — #101820 / rgb(16 24 32) */
    --color-black-100: #101820;
    --color-black-90: rgb(16 24 32 / 90%);
    --color-black-80: rgb(16 24 32 / 80%);
    --color-black-70: rgb(16 24 32 / 70%);
    --color-black-60: rgb(16 24 32 / 60%);
    --color-black-50: rgb(16 24 32 / 50%);
    --color-black-40: rgb(16 24 32 / 40%);
    --color-black-30: rgb(16 24 32 / 30%);
    --color-black-20: rgb(16 24 32 / 20%);
    --color-black-12: rgb(16 24 32 / 12%);
    --color-black-10: rgb(16 24 32 / 10%);
    --color-black-08: rgb(16 24 32 / 8%);
    --color-black-05: rgb(16 24 32 / 5%);
    --color-black-00: rgb(16 24 32 / 0%);
    --color-pure-black: #000;
    --color-pure-black-40: rgb(0 0 0 / 40%);
    --color-pure-black-20: rgb(0 0 0 / 20%);
    --color-pure-black-10: rgb(0 0 0 / 10%);
    --color-pure-black-05: rgb(0 0 0 / 5%);

    /* Brand · IBX Green — #00BD4D / rgb(0 189 77) */
    --color-green-100: #00bd4d;
    --color-green-90: rgb(0 189 77 / 90%);
    --color-green-80: rgb(0 189 77 / 80%);
    --color-green-70: rgb(0 189 77 / 70%);
    --color-green-60: rgb(0 189 77 / 60%);
    --color-green-50: rgb(0 189 77 / 50%);
    --color-green-40: rgb(0 189 77 / 40%);
    --color-green-30: rgb(0 189 77 / 30%);
    --color-green-20: rgb(0 189 77 / 20%);
    --color-green-10: rgb(0 189 77 / 10%);
    --color-green-05: rgb(0 189 77 / 5%);
    --color-green-00: rgb(0 189 77 / 0%);

    /* Neutral · Off-white — #F0EFE9 / rgb(240 239 233) */
    --color-offwhite-100: #f0efe9;
    --color-offwhite-90: rgb(240 239 233 / 90%);
    --color-offwhite-80: rgb(240 239 233 / 80%);
    --color-offwhite-70: rgb(240 239 233 / 70%);
    --color-offwhite-60: rgb(240 239 233 / 60%);
    --color-offwhite-50: rgb(240 239 233 / 50%);
    --color-offwhite-40: rgb(240 239 233 / 40%);
    --color-offwhite-30: rgb(240 239 233 / 30%);
    --color-offwhite-20: rgb(240 239 233 / 20%);
    --color-offwhite-10: rgb(240 239 233 / 10%);
    --color-offwhite-05: rgb(240 239 233 / 5%);
    --color-offwhite-00: rgb(240 239 233 / 0%);

    /* Neutral · White — #FFFFFF */
    --color-white-100: #fff;
    --color-white-90: rgb(255 255 255 / 90%);
    --color-white-85: rgb(255 255 255 / 85%);
    --color-white-80: rgb(255 255 255 / 80%);
    --color-white-60: rgb(255 255 255 / 60%);
    --color-white-40: rgb(255 255 255 / 40%);
    --color-white-20: rgb(255 255 255 / 20%);
    --color-white-12: rgb(255 255 255 / 12%);
    --color-white-10: rgb(255 255 255 / 10%);
    --color-white-05: rgb(255 255 255 / 5%);
    --color-white-00: rgb(255 255 255 / 0%);

    /* Brand · IBX Evergreen — #00594C */
    --color-evergreen-100: #00594c;

    /* Brand · Interface Green — #007D4C */
    --color-interface-green-100: #007d4c;

    /* Brand · Teal — rgb(0 120 134) */
    --color-teal-100: #007886;

    /* teal-100 is only 3.43:1 on --color-black-100; this is 5.36:1 */
    --color-teal-light: #009bad;
    --color-teal-medium: #006580;
    --color-teal-dark: #006373;
    --color-teal-40: rgb(0 120 134 / 40%);
    --color-teal-30: rgb(0 120 134 / 30%);
    --color-teal-10: rgb(0 120 134 / 10%);

    /* Neutral · Steel — rgb(28 43 54) */
    --color-steel-100: #1c2b36;
    --color-steel-16: rgb(28 43 54 / 16%);

    /* Interface Black — rgb(13 19 26) · used in borders and overlays */
    --color-interface-black-100: #0d131a;
    --color-interface-black-20: rgb(13 19 26 / 20%);
    --color-interface-black-10: rgb(13 19 26 / 10%);
    --color-interface-black-08: rgb(13 19 26 / 8%);

    /* Steel Gray — rgb(217 225 226) · light teal-gray */
    --color-steel-gray-100: #d9e1e2;
    --color-steel-gray-60: rgb(217 225 226 / 60%);
    --color-steel-gray-20: rgb(217 225 226 / 20%);

    /* Neutral · Slate — #40464D / rgb(64 70 77) · long-form body text */
    --color-slate-100: #40464d;

    /* Neutral · Carbon — #0F0F15 / rgb(15 15 21) · Figma content/secondary */
    --color-carbon-100: #0f0f15;
    --color-carbon-80: rgb(15 15 21 / 80%);
    --color-carbon-60: rgb(15 15 21 / 60%);
    --color-carbon-20: rgb(15 15 21 / 20%);
    --color-carbon-10: rgb(15 15 21 / 10%);
    --color-carbon-05: rgb(15 15 21 / 5%);

    /* Neutral · Ink — #131313 / rgb(19 19 19) · scrims and overlays */
    --color-ink-100: #131313;
    --color-ink-75: rgb(19 19 19 / 75%);
    --color-ink-25: rgb(19 19 19 / 25%);

    /* Neutral · Gray — #DADADA · hairline borders */
    --color-gray-100: #dadada;

    /* Accent · Periwinkle — #7C8EF3 / rgb(124 142 243) · category tags */
    --color-periwinkle-100: #7c8ef3;
    --color-periwinkle-60: rgb(124 142 243 / 60%);

    /* Accent · Yellow — #FFE957 · category tags */
    --color-yellow-100: #ffe957;

    /* Brand gradient */
    --gradient-brand: linear-gradient(
        90deg,
        #fedd00 0%,
        #00be4c 33%,
        #00be4c 66%,
        #00e2ec 100%
    );

    /* ==========================================================================
     COLOR — semantic aliases
     ========================================================================== */
    --content-primary: var(--color-black-100);
    --content-secondary: var(--color-green-100);
    --content-tertiary: var(--color-black-60);
    --content-body: var(--color-slate-100);
    --content-on-dark: var(--color-white-100);
    --content-on-brand: var(--color-black-100);
    --secondary-text-color: #555;
    --brand-hover: var(--color-green-90);
    --surface-default: var(--color-white-100);
    --surface-muted: var(--color-offwhite-100);
    --surface-inverse: var(--color-black-100);
    --surface-brand: var(--color-green-100);
    --divider-primary: var(--color-black-20);
    --divider-secondary: var(--color-black-10);
    --link-color: var(--color-green-100);
    --link-hover-color: var(--color-green-90);

    /* Mega-menu */
    --mm-bg: var(--surface-default);
    --mm-border: var(--divider-secondary);
    --mm-sidebar-bg: linear-gradient(
        155deg,
        var(--color-evergreen-100) 0%,
        var(--color-interface-green-100) 30.29%,
        var(--color-interface-green-100) 63.94%,
        var(--color-evergreen-100) 100%
    );
    --mm-sidebar-text: var(--content-on-dark);
    --mm-sidebar-text-muted: var(--color-white-80);
    --mm-sidebar-border: var(--color-white-20);
    --mm-item-accent: var(--color-teal-40);
    --mm-pill-bg: var(--color-offwhite-60);

    /* Header nav */
    --nav-rail-bg: #161d22;
    --nav-rail-text: #b3b7ba;
    --nav-rail-expanded-bg: #213a43;
    --nav-shadow: rgb(0 0 0 / 5%);
    --nav-rail-divider: var(--color-interface-black-10);
    --nav-dropdown-hover: #f4f6f8;
    --nav-cta-bg: var(--color-black-10);
    --nav-cta-hover: #d2d6d9;
    --nav-search-bg: var(--color-steel-gray-60);
    --nav-search-divider: var(--color-interface-black-20);
    --nav-search-placeholder: #6c7780;
    --nav-mobile-dark-bg: var(--color-interface-black-100);
    --nav-mobile-cta-bg: var(--color-teal-100);
    --nav-mobile-utils-border: var(--color-white-10);

    /* ==========================================================================
     TYPOGRAPHY — font families
     ========================================================================== */
    --font-family-primary:
        'Alliance No.1', 'Roboto', helvetica, arial, sans-serif;
    --font-family-secondary:
        'JetBrains Mono', 'SF Mono', 'Roboto Mono', monospace;
    --font-family-icon: ibx-icon-lib, sans-serif;

    /* Display alias (used by the custom-button block) */
    --font-family-display: var(--font-family-primary);

    /* Custom-button block dependencies */
    --type-btn-letter-spacing: 0.0625rem; /* 1px */
    --color-system-focus: #00aed1; /* Interactive · system focus ring */
    --shadow-button:
        0 2.75rem 0.75rem rgb(16 24 32 / 1%),
        0 1.75rem 0.6875rem rgb(16 24 32 / 4%),
        0 1rem 0.625rem rgb(16 24 32 / 15%),
        0 0.4375rem 0.4375rem rgb(16 24 32 / 26%),
        0 0.125rem 0.25rem rgb(16 24 32 / 29%);

    /* Font weights (Alliance No.1) */
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    /* ==========================================================================
     TYPOGRAPHY — font-size scale (t-shirt · fixed across breakpoints)
     ========================================================================== */
    --font-size-2xs: 0.75rem; /* 12px */
    --font-size-xs: 0.875rem; /* 14px */
    --font-size-base: 0.9375rem; /* 15px */
    --font-size-sm: 1.125rem; /* 18px */
    --font-size-md: 1.375rem; /* 22px */
    --font-size-lg: 1.5rem; /* 24px */
    --font-size-xl: 1.75rem; /* 28px */
    --font-size-2xl: 2.25rem; /* 36px */
    --font-size-3xl: 2.5rem; /* 40px */
    --font-size-4xl: 3rem; /* 48px */
    --font-size-5xl: 3.25rem; /* 52px */
    --font-size-6xl: 4rem; /* 64px */

    /* ==========================================================================
     TYPOGRAPHY — line-height scale (fixed across breakpoints)
     ========================================================================== */
    --line-height-xs: 1.125rem; /* 18px */

    /* 20px sits between xs and sm; named semantically to avoid renumbering the scale */
    --line-height-ui: 1.25rem; /* 20px · pairs with --font-size-xs */
    --line-height-sm: 1.375rem; /* 22px */
    --line-height-md: 1.5rem; /* 24px */
    --line-height-lg: 1.75rem; /* 28px */
    --line-height-xl: 2rem; /* 32px */
    --line-height-2xl: 2.5rem; /* 40px */
    --line-height-3xl: 2.75rem; /* 44px */
    --line-height-4xl: 3rem; /* 48px */
    --line-height-5xl: 3.625rem; /* 58px */
    --line-height-6xl: 4rem; /* 64px */
    --line-height-7xl: 4.375rem; /* 70px */

    /* ==========================================================================
     SPACING — 4px base unit (Tailwind-like scale)
     Anchored to Figma tokens: base=16 (space-4), gutter=24 (space-6),
     2xl=40 (space-10), 5xs=0 (space-0).
     ========================================================================== */
    --space-0: 0;
    --space-1: 0.25rem; /* 4px */
    --space-2: 0.5rem; /* 8px */
    --space-3: 0.75rem; /* 12px */
    --space-4: 1rem; /* 16px */
    --space-5: 1.25rem; /* 20px */
    --space-6: 1.5rem; /* 24px */
    --space-8: 2rem; /* 32px */
    --space-10: 2.5rem; /* 40px */
    --space-12: 3rem; /* 48px */
    --space-16: 4rem; /* 64px */
    --space-20: 5rem; /* 80px */

    /* ==========================================================================
     BORDER RADIUS
     ========================================================================== */
    --radius-xs: 2px;
    --radius-sm: 4px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 999px;

    /* ==========================================================================
     LAYOUT GRID — 12 columns, 24px gutter
     Content max-width 1176px; responsive side margins.
     ========================================================================== */
    --grid-columns: 12;
    --grid-gutter: var(--space-6); /* 24px */
    --layout-max-width: 75.75rem; /* 1212px = 1180px content + 16px padding each side */
    --layout-margin-inline: var(--space-6); /* 24px · mobile ≤440 */
}

/* ============================================================================
   TABLET · 577–1024px  (--breakpoint-tablet · 600px)
   Only display + heading sizes scale up; body styles stay constant.
   ============================================================================ */
@media (width >= 37.5rem) {
    :root {
        /* Tablet · Medium 577–1024px — 40px side margins */
        --layout-margin-inline: var(--space-10); /* 40px */
    }
}

/* ============================================================================
   LAPTOP · 1440px+  (--breakpoint-wide · 1200px)
   Display scales to its largest size; headings match the tablet scale.
   ============================================================================ */
@media (width >= 75rem) {
    :root {
        /* Laptop · Large 1440px+ — content centers at max-width, margins auto */
        --layout-margin-inline: var(
            --space-6
        ); /* 24px min gutter; centered by max-width */
    }
}

/* ============================================================================
   BASE ELEMENTS
   ============================================================================ */
body {
    margin: 0;
    color: var(--content-primary);
    background-color: var(--surface-default);
    font-family: var(--font-family-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-lg);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0.8rem 0 0.25rem;
    font-family: var(--font-family-primary);
    scroll-margin: 2.5rem;
}

h1 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-2xl);
    letter-spacing: -0.0938rem;
}

h2 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-xl);
    letter-spacing: -0.0625rem;
}

h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-lg);
    letter-spacing: -0.0313rem;
}

h4 {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-xl);
    letter-spacing: -0.0031rem;
}

h5 {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-xl);
    letter-spacing: -0.0156rem;
}

h6 {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-lg);
}

p {
    margin: 0 0 1rem;
}

a,
a:any-link {
    color: var(--link-color);
    text-decoration: underline;
    text-underline-offset: 0.15rem;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

code,
kbd,
samp,
pre {
    font-family: var(--font-family-secondary);
    font-size: var(--font-size-xs);
    line-height: var(--line-height-xs);
}

hr {
    height: 0.125rem;
    margin: 1.5rem 0 1rem;
    border: 0;
    background-color: var(--divider-primary);
}

@media (width >= 37.5rem) {
    hr {
        margin: 2.5rem 0 1.5rem;
    }
}

/* ============================================================================
   TYPOGRAPHY UTILITY CLASSES
   Apply an exact design type style to any element.
   ============================================================================ */
.type-h1 {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-2xl);
    letter-spacing: -0.0938rem;
}

.type-h2 {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-xl);
    letter-spacing: -0.0625rem;
}

.type-h3 {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-lg);
    letter-spacing: -0.0313rem;
}

.type-h4 {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-xl);
    letter-spacing: -0.0031rem;
}

.type-b1 {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-xl);
    letter-spacing: -0.0156rem;
}

.type-b1-sb {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-xl);
    letter-spacing: -0.0156rem;
}

.type-b2 {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-lg);
}

.type-b2-sb {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-lg);
}

.type-b3 {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-md);
    letter-spacing: 0.0156rem;
}

.type-btn {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-sm);
    letter-spacing: 0.0625rem;
    text-transform: uppercase;
}

.type-mono {
    font-family: var(--font-family-secondary);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-xs);
    text-transform: uppercase;
}

.type-stat {
    font-family: var(--font-family-primary);
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-regular);
    line-height: var(--line-height-4xl);
    letter-spacing: -0.125rem;
}

/* ============================================================================
   GRID UTILITIES — 12-column design grid + convenience column counts
   ============================================================================ */
.grid {
    display: grid;
    gap: var(--grid-gutter);
}

.grid-12 {
    display: grid;
    grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
    gap: var(--grid-gutter);
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-cols-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.grid-cols-12 {
    grid-template-columns: repeat(12, minmax(0, 1fr));
}

/* Auto-responsive columns — fills as many tracks of ≥min as fit */
.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
    gap: var(--grid-gutter);
}

/* Column span helpers (against the 12-col grid) */
.col-span-1 {
    grid-column: span 1;
}

.col-span-2 {
    grid-column: span 2;
}

.col-span-3 {
    grid-column: span 3;
}

.col-span-4 {
    grid-column: span 4;
}

.col-span-6 {
    grid-column: span 6;
}

.col-span-8 {
    grid-column: span 8;
}

.col-span-12 {
    grid-column: span 12;
}

/* ============================================================================
   FLEX UTILITIES
   ============================================================================ */
.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.flex-row {
    flex-direction: row;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-nowrap {
    flex-wrap: nowrap;
}

.flex-1 {
    flex: 1 1 0%;
}

.flex-auto {
    flex: 1 1 auto;
}

.flex-none {
    flex: none;
}

.grow {
    flex-grow: 1;
}

.shrink-0 {
    flex-shrink: 0;
}

.items-start {
    align-items: flex-start;
}

.items-center {
    align-items: center;
}

.items-end {
    align-items: flex-end;
}

.items-stretch {
    align-items: stretch;
}

.items-baseline {
    align-items: baseline;
}

.justify-start {
    justify-content: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.justify-around {
    justify-content: space-around;
}

.self-start {
    align-self: flex-start;
}

.self-center {
    align-self: center;
}

.self-end {
    align-self: flex-end;
}

.self-stretch {
    align-self: stretch;
}

/* ============================================================================
   GAP UTILITIES (work with flex + grid)
   ============================================================================ */
.gap-0 {
    gap: var(--space-0);
}

.gap-1 {
    gap: var(--space-1);
}

.gap-2 {
    gap: var(--space-2);
}

.gap-3 {
    gap: var(--space-3);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-5 {
    gap: var(--space-5);
}

.gap-6 {
    gap: var(--space-6);
}

.gap-8 {
    gap: var(--space-8);
}

.gap-10 {
    gap: var(--space-10);
}

.gap-12 {
    gap: var(--space-12);
}

.gap-16 {
    gap: var(--space-16);
}

.gap-x-2 {
    column-gap: var(--space-2);
}

.gap-x-4 {
    column-gap: var(--space-4);
}

.gap-x-6 {
    column-gap: var(--space-6);
}

.gap-y-2 {
    row-gap: var(--space-2);
}

.gap-y-4 {
    row-gap: var(--space-4);
}

.gap-y-6 {
    row-gap: var(--space-6);
}

/* ============================================================================
   MARGIN UTILITIES (logical properties, RTL-safe)
   m = all · mx/my = axis · mt/mr/mb/ml = sides
   ============================================================================ */
.m-0 {
    margin: var(--space-0);
}

.m-2 {
    margin: var(--space-2);
}

.m-4 {
    margin: var(--space-4);
}

.m-6 {
    margin: var(--space-6);
}

.m-8 {
    margin: var(--space-8);
}

.m-auto {
    margin: auto;
}

.mx-0 {
    margin-inline: var(--space-0);
}

.mx-2 {
    margin-inline: var(--space-2);
}

.mx-4 {
    margin-inline: var(--space-4);
}

.mx-6 {
    margin-inline: var(--space-6);
}

.mx-auto {
    margin-inline: auto;
}

.my-0 {
    margin-block: var(--space-0);
}

.my-2 {
    margin-block: var(--space-2);
}

.my-4 {
    margin-block: var(--space-4);
}

.my-6 {
    margin-block: var(--space-6);
}

.my-8 {
    margin-block: var(--space-8);
}

.mt-0 {
    margin-block-start: var(--space-0);
}

.mt-2 {
    margin-block-start: var(--space-2);
}

.mt-4 {
    margin-block-start: var(--space-4);
}

.mt-6 {
    margin-block-start: var(--space-6);
}

.mt-8 {
    margin-block-start: var(--space-8);
}

.mb-0 {
    margin-block-end: var(--space-0);
}

.mb-2 {
    margin-block-end: var(--space-2);
}

.mb-4 {
    margin-block-end: var(--space-4);
}

.mb-6 {
    margin-block-end: var(--space-6);
}

.mb-8 {
    margin-block-end: var(--space-8);
}

/* ============================================================================
   PADDING UTILITIES (logical properties, RTL-safe)
   ============================================================================ */
.p-0 {
    padding: var(--space-0);
}

.p-2 {
    padding: var(--space-2);
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

.p-8 {
    padding: var(--space-8);
}

.px-0 {
    padding-inline: var(--space-0);
}

.px-2 {
    padding-inline: var(--space-2);
}

.px-4 {
    padding-inline: var(--space-4);
}

.px-6 {
    padding-inline: var(--space-6);
}

.px-8 {
    padding-inline: var(--space-8);
}

.py-0 {
    padding-block: var(--space-0);
}

.py-2 {
    padding-block: var(--space-2);
}

.py-4 {
    padding-block: var(--space-4);
}

.py-6 {
    padding-block: var(--space-6);
}

.py-8 {
    padding-block: var(--space-8);
}

.py-10 {
    padding-block: var(--space-10);
}

/* ============================================================================
   SECTION SPACING — vertical padding & margin for AEM sections
   Scoped to `main > .section` (the section wrapper authors select in UE).
   T-shirt scale → --space tokens: 0·xs8·sm16·md24·lg32·xl40·2xl48·3xl64·4xl80.
   Desktop classes apply at all widths; `-m-` classes override below 600px.
   Author picks one desktop class + (optionally) one mobile class per side.
   ============================================================================ */

/* Padding · top (pt-*) */
main > .section.pt-0 {
    padding-top: var(--space-0);
}

main > .section.pt-xs {
    padding-top: var(--space-2);
}

main > .section.pt-sm {
    padding-top: var(--space-4);
}

main > .section.pt-md {
    padding-top: var(--space-6);
}

main > .section.pt-lg {
    padding-top: var(--space-8);
}

main > .section.pt-xl {
    padding-top: var(--space-10);
}

main > .section.pt-2xl {
    padding-top: var(--space-12);
}

main > .section.pt-3xl {
    padding-top: var(--space-16);
}

main > .section.pt-4xl {
    padding-top: var(--space-20);
}

/* Padding · bottom (pb-*) */
main > .section.pb-0 {
    padding-bottom: var(--space-0);
}

main > .section.pb-xs {
    padding-bottom: var(--space-2);
}

main > .section.pb-sm {
    padding-bottom: var(--space-4);
}

main > .section.pb-md {
    padding-bottom: var(--space-6);
}

main > .section.pb-lg {
    padding-bottom: var(--space-8);
}

main > .section.pb-xl {
    padding-bottom: var(--space-10);
}

main > .section.pb-2xl {
    padding-bottom: var(--space-12);
}

main > .section.pb-3xl {
    padding-bottom: var(--space-16);
}

main > .section.pb-4xl {
    padding-bottom: var(--space-20);
}

/* Padding · block / vertical (py-*) */
main > .section.py-0 {
    padding-block: var(--space-0);
}

main > .section.py-xs {
    padding-block: var(--space-2);
}

main > .section.py-sm {
    padding-block: var(--space-4);
}

main > .section.py-md {
    padding-block: var(--space-6);
}

main > .section.py-lg {
    padding-block: var(--space-8);
}

main > .section.py-xl {
    padding-block: var(--space-10);
}

main > .section.py-2xl {
    padding-block: var(--space-12);
}

main > .section.py-3xl {
    padding-block: var(--space-16);
}

main > .section.py-4xl {
    padding-block: var(--space-20);
}

/* Margin · top (mt-*) */
main > .section.mt-0 {
    margin-top: var(--space-0);
}

main > .section.mt-xs {
    margin-top: var(--space-2);
}

main > .section.mt-sm {
    margin-top: var(--space-4);
}

main > .section.mt-md {
    margin-top: var(--space-6);
}

main > .section.mt-lg {
    margin-top: var(--space-8);
}

main > .section.mt-xl {
    margin-top: var(--space-10);
}

main > .section.mt-2xl {
    margin-top: var(--space-12);
}

main > .section.mt-3xl {
    margin-top: var(--space-16);
}

main > .section.mt-4xl {
    margin-top: var(--space-20);
}

/* Margin · bottom (mb-*) */
main > .section.mb-0 {
    margin-bottom: var(--space-0);
}

main > .section.mb-xs {
    margin-bottom: var(--space-2);
}

main > .section.mb-sm {
    margin-bottom: var(--space-4);
}

main > .section.mb-md {
    margin-bottom: var(--space-6);
}

main > .section.mb-lg {
    margin-bottom: var(--space-8);
}

main > .section.mb-xl {
    margin-bottom: var(--space-10);
}

main > .section.mb-2xl {
    margin-bottom: var(--space-12);
}

main > .section.mb-3xl {
    margin-bottom: var(--space-16);
}

main > .section.mb-4xl {
    margin-bottom: var(--space-20);
}

/* Margin · block / vertical (my-*) */
main > .section.my-0 {
    margin-block: var(--space-0);
}

main > .section.my-xs {
    margin-block: var(--space-2);
}

main > .section.my-sm {
    margin-block: var(--space-4);
}

main > .section.my-md {
    margin-block: var(--space-6);
}

main > .section.my-lg {
    margin-block: var(--space-8);
}

main > .section.my-xl {
    margin-block: var(--space-10);
}

main > .section.my-2xl {
    margin-block: var(--space-12);
}

main > .section.my-3xl {
    margin-block: var(--space-16);
}

main > .section.my-4xl {
    margin-block: var(--space-20);
}

/* --------------------------------------------------------------------------
   MOBILE OVERRIDES · below 600px (--breakpoint-tablet)
   Same specificity as desktop rules but later in source, so they win here.
   -------------------------------------------------------------------------- */
@media (width < 37.5rem) {
    /* Padding · top */
    main > .section.pt-m-0 {
        padding-top: var(--space-0);
    }

    main > .section.pt-m-xs {
        padding-top: var(--space-2);
    }

    main > .section.pt-m-sm {
        padding-top: var(--space-4);
    }

    main > .section.pt-m-md {
        padding-top: var(--space-6);
    }

    main > .section.pt-m-lg {
        padding-top: var(--space-8);
    }

    main > .section.pt-m-xl {
        padding-top: var(--space-10);
    }

    main > .section.pt-m-2xl {
        padding-top: var(--space-12);
    }

    main > .section.pt-m-3xl {
        padding-top: var(--space-16);
    }

    main > .section.pt-m-4xl {
        padding-top: var(--space-20);
    }

    /* Padding · bottom */
    main > .section.pb-m-0 {
        padding-bottom: var(--space-0);
    }

    main > .section.pb-m-xs {
        padding-bottom: var(--space-2);
    }

    main > .section.pb-m-sm {
        padding-bottom: var(--space-4);
    }

    main > .section.pb-m-md {
        padding-bottom: var(--space-6);
    }

    main > .section.pb-m-lg {
        padding-bottom: var(--space-8);
    }

    main > .section.pb-m-xl {
        padding-bottom: var(--space-10);
    }

    main > .section.pb-m-2xl {
        padding-bottom: var(--space-12);
    }

    main > .section.pb-m-3xl {
        padding-bottom: var(--space-16);
    }

    main > .section.pb-m-4xl {
        padding-bottom: var(--space-20);
    }

    /* Padding · block / vertical */
    main > .section.py-m-0 {
        padding-block: var(--space-0);
    }

    main > .section.py-m-xs {
        padding-block: var(--space-2);
    }

    main > .section.py-m-sm {
        padding-block: var(--space-4);
    }

    main > .section.py-m-md {
        padding-block: var(--space-6);
    }

    main > .section.py-m-lg {
        padding-block: var(--space-8);
    }

    main > .section.py-m-xl {
        padding-block: var(--space-10);
    }

    main > .section.py-m-2xl {
        padding-block: var(--space-12);
    }

    main > .section.py-m-3xl {
        padding-block: var(--space-16);
    }

    main > .section.py-m-4xl {
        padding-block: var(--space-20);
    }

    /* Margin · top */
    main > .section.mt-m-0 {
        margin-top: var(--space-0);
    }

    main > .section.mt-m-xs {
        margin-top: var(--space-2);
    }

    main > .section.mt-m-sm {
        margin-top: var(--space-4);
    }

    main > .section.mt-m-md {
        margin-top: var(--space-6);
    }

    main > .section.mt-m-lg {
        margin-top: var(--space-8);
    }

    main > .section.mt-m-xl {
        margin-top: var(--space-10);
    }

    main > .section.mt-m-2xl {
        margin-top: var(--space-12);
    }

    main > .section.mt-m-3xl {
        margin-top: var(--space-16);
    }

    main > .section.mt-m-4xl {
        margin-top: var(--space-20);
    }

    /* Margin · bottom */
    main > .section.mb-m-0 {
        margin-bottom: var(--space-0);
    }

    main > .section.mb-m-xs {
        margin-bottom: var(--space-2);
    }

    main > .section.mb-m-sm {
        margin-bottom: var(--space-4);
    }

    main > .section.mb-m-md {
        margin-bottom: var(--space-6);
    }

    main > .section.mb-m-lg {
        margin-bottom: var(--space-8);
    }

    main > .section.mb-m-xl {
        margin-bottom: var(--space-10);
    }

    main > .section.mb-m-2xl {
        margin-bottom: var(--space-12);
    }

    main > .section.mb-m-3xl {
        margin-bottom: var(--space-16);
    }

    main > .section.mb-m-4xl {
        margin-bottom: var(--space-20);
    }

    /* Margin · block / vertical */
    main > .section.my-m-0 {
        margin-block: var(--space-0);
    }

    main > .section.my-m-xs {
        margin-block: var(--space-2);
    }

    main > .section.my-m-sm {
        margin-block: var(--space-4);
    }

    main > .section.my-m-md {
        margin-block: var(--space-6);
    }

    main > .section.my-m-lg {
        margin-block: var(--space-8);
    }

    main > .section.my-m-xl {
        margin-block: var(--space-10);
    }

    main > .section.my-m-2xl {
        margin-block: var(--space-12);
    }

    main > .section.my-m-3xl {
        margin-block: var(--space-16);
    }

    main > .section.my-m-4xl {
        margin-block: var(--space-20);
    }
}

/* ============================================================================
   LINK UTILITIES
   Base <a> styling lives above; these are opt-in variants.
   ============================================================================ */
.link-plain,
.link-plain:any-link {
    color: inherit;
    text-decoration: none;
}

.link-subtle,
.link-subtle:any-link {
    color: var(--content-primary);
    text-decoration: none;
}

.link-subtle:hover {
    color: var(--link-color);
    text-decoration: underline;
    text-underline-offset: 0.15rem;
}

.link-on-dark,
.link-on-dark:any-link {
    color: var(--content-on-dark);
}

.link-on-dark:hover {
    color: var(--brand-primary);
}

/* Arrow/CTA style link — brand color, medium weight, no underline until hover */
.link-cta,
.link-cta:any-link {
    color: var(--brand-primary);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
}

.link-cta:hover {
    color: var(--brand-hover);
    text-decoration: underline;
    text-underline-offset: 0.15rem;
}

/* ============================================================================
   RESPONSIVE TYPE — Tablet 577px+ scale-up (Figma "Medium"/"Large")
   Placed after base elements + utilities so overrides win the cascade.
   ============================================================================ */
@media (width >= 37.5rem) {
    h1,
    .type-h1 {
        font-size: var(--font-size-6xl);
        line-height: var(--line-height-7xl);
    }

    h2,
    .type-h2 {
        font-size: var(--font-size-5xl);
        line-height: var(--line-height-5xl);
    }

    h3,
    .type-h3 {
        font-size: var(--font-size-3xl);
        line-height: var(--line-height-3xl);
    }

    h4,
    .type-h4 {
        font-size: var(--font-size-xl);
        line-height: var(--line-height-xl);
    }

    .type-stat {
        font-size: var(--font-size-6xl);
        line-height: var(--line-height-6xl);
    }
}
