/* =========================================================
   MANMACHINE WORKS — GLOBAL THEME
   Loaded last so legacy page components use one shared system.
========================================================= */

:root {
    /* Brand colors */
    --primary-color: #EDC540 !important;
    --primary-hover: #D9AF2F !important;
    --primary-light: #F8E9B2 !important;
    --primary-soft: #FFF9E8 !important;

    /* Dark colors */
    --dark-color: #070A10 !important;
    --dark-secondary: #0D1118 !important;
    --dark-card: #11151C !important;

    /* Text colors */
    --heading-color: #0A0A0A !important;
    --text-color: #555555 !important;
    --text-secondary: #6F6F6F !important;
    --muted-color: #888888 !important;
    --text-white: #FFFFFF !important;
    --text-light: rgba(255, 255, 255, .72) !important;
    --text-muted-dark: rgba(255, 255, 255, .58) !important;

    /* Background colors */
    --white: #FFFFFF !important;
    --light-bg: #F6F7F9 !important;
    --soft-bg: #FAFAFA !important;

    /* Border and status colors */
    --border-color: #E8E8E8 !important;
    --border-dark: rgba(255, 255, 255, .14) !important;
    --success-color: #2E7D32 !important;
    --danger-color: #B42318 !important;

    /* Typography */
    --font-heading: 'Manrope', Arial, sans-serif !important;
    --font-body: 'DM Sans', Arial, sans-serif !important;

    /* Shadows */
    --shadow-sm: 0 8px 24px rgba(7, 10, 16, .06) !important;
    --shadow-md: 0 18px 45px rgba(7, 10, 16, .10) !important;

    /* Legacy theme compatibility */
    --primary: var(--primary-color) !important;
    --primary-bright: var(--primary-hover) !important;
    --theme-color: var(--primary-color) !important;
    --theme-gold: var(--primary-color) !important;
    --gold: var(--primary-color) !important;
    --gold-hover: var(--primary-hover) !important;
    --gold-dark: var(--primary-hover) !important;
    --accent-gold: var(--primary-light) !important;
    --theme-soft-gold: var(--primary-light) !important;
    --dark: var(--dark-color) !important;
    --dark-deep: var(--dark-color) !important;
    --theme-dark: var(--dark-color) !important;
    --black-color: var(--dark-color) !important;
    --black-color2: var(--dark-secondary) !important;
    --title-color: var(--heading-color) !important;
    --text-dark: var(--heading-color) !important;
    --body-color: var(--text-color) !important;
    --text-muted: var(--muted-color) !important;
    --smoke-color: var(--light-bg) !important;
    --smoke-color2: var(--soft-bg) !important;
    --white-color: var(--white) !important;
    --error-color: var(--danger-color) !important;
    --border-light: var(--border-dark) !important;
    --glass-border: var(--border-dark) !important;
    --title-font: var(--font-heading) !important;
    --body-font: var(--font-body) !important;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body) !important;
}

body {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.75;
    color: var(--text-color);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body :where(p, a, button, input, select, textarea, label, li, dt, dd, small, blockquote, figcaption, th, td) {
    font-family: var(--font-body) !important;
}

body :where(h1, h2, h3, h4, h5, h6),
body :where(h1, h2, h3, h4, h5, h6) :where(a, button, span, strong, small),
body :where(.sec-title, .main-title, [class*='__title'], [class*='-title']) {
    font-family: var(--font-heading) !important;
}

body :where(h1, h2, h3, h4, h5, h6) {
    margin-top: 0;
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -.035em;
    color: var(--heading-color);
}

body h1 {
    font-size: clamp(42px, 5vw, 72px);
    line-height: .98;
    letter-spacing: -.045em;
}

body h1 :where(.global-h1-accent, .mm-page-hero__highlight, .home-h1-accent, .dl-slider-title__special) {
    position: relative;
    z-index: 0;
    display: inline-block;
    isolation: isolate;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 0 .08em !important;
    background: none !important;
    color: var(--primary-color) !important;
    font-family: 'Times New Roman', Times, serif !important;
    font-size: 1.04em;
    font-style: italic;
    font-weight: 400 !important;
    letter-spacing: -.05em;
    line-height: .96;
    text-transform: none;
}

body h1 :where(.global-h1-accent, .mm-page-hero__highlight, .home-h1-accent, .dl-slider-title__special)::after {
    position: absolute;
    z-index: -1;
    right: 0;
    bottom: -.12em;
    width: 92%;
    height: .24em;
    background:
        linear-gradient(176deg, transparent 36%, currentColor 39%, currentColor 47%, transparent 50%) 0 0 / 100% 55% no-repeat,
        linear-gradient(178deg, transparent 36%, currentColor 39%, currentColor 47%, transparent 50%) 10% 100% / 82% 55% no-repeat;
    content: '';
    opacity: .96;
    pointer-events: none;
}

body h2 {
    font-size: clamp(34px, 4vw, 52px);
}

body h2 :where(.global-h2-accent, .home-h2-accent, .italic-text, .text-with) {
    position: relative;
    display: inline-block;
    isolation: isolate;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 0 .08em !important;
    background: none !important;
    color: var(--primary-color) !important;
    font-family: 'Times New Roman', Times, serif !important;
    font-size: 1.04em;
    font-style: italic;
    font-weight: 400 !important;
    letter-spacing: -.045em;
    line-height: .98;
    text-transform: none;
}

body h2 :where(.global-h2-accent, .home-h2-accent, .italic-text, .text-with):not(.home-h2-accent--no-underline)::after {
    position: absolute;
    z-index: -1;
    right: 0;
    bottom: -.12em;
    width: 92%;
    height: .24em;
    background:
        linear-gradient(176deg, transparent 36%, currentColor 39%, currentColor 47%, transparent 50%) 0 0 / 100% 55% no-repeat,
        linear-gradient(178deg, transparent 36%, currentColor 39%, currentColor 47%, transparent 50%) 10% 100% / 82% 55% no-repeat;
    content: '';
    opacity: .96;
    pointer-events: none;
}

body h3 {
    font-size: 20px;
}

body p {
    font-family: var(--font-body) !important;
    color: var(--text-color);
}

body :where(nav, nav a, .mm-nav-parent) {
    font-family: var(--font-heading) !important;
    font-weight: 700;
}

body :where(button, .btn, .mm-btn, .th-btn) {
    font-family: var(--font-heading) !important;
    font-weight: 800;
}

body :where(input, textarea, select, label) {
    font-family: var(--font-body) !important;
}

/* Shared gold call-to-action button. */
.btn-primary {
    background: var(--primary-color);
    color: var(--dark-color);
    border: 1px solid var(--primary-color);
    border-radius: 2px;
    font-family: var(--font-heading) !important;
    font-weight: 800;
    transition: .2s ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: var(--primary-hover);
    color: var(--dark-color);
    border-color: var(--primary-hover);
}

/* Shared dark-section color treatment. */
.section-dark {
    background: var(--dark-color);
    color: var(--text-white);
}

.section-dark h1,
.section-dark h2,
.section-dark h3 {
    color: var(--white);
}

.section-dark p {
    color: var(--text-light);
}

body :where(
    .sub-title,
    [class*='__eyebrow'],
    [class*='-eyebrow'],
    [class*='__kicker'],
    [class*='-kicker'],
    [class*='__label'],
    [class*='-label'],
    [class*='__subtitle'],
    [class*='-subtitle'],
    [class*='__description'],
    [class*='-description'],
    [class*='__copy'],
    [class*='-copy']
) {
    font-family: var(--font-body) !important;
}

body .logo-work-text {
    font-family: var(--font-heading) !important;
}

/* Preserve the editorial gold italic accent requested for display headings. */
body h1 :where(.global-h1-accent, .mm-page-hero__highlight, .home-h1-accent, .dl-slider-title__special),
body h2 :where(.global-h2-accent, .home-h2-accent, .italic-text, .text-with) {
    font-family: 'Times New Roman', Times, serif !important;
}

body h1 .global-h1-accent .dl-title-underline,
body h1 .dl-slider-title__special .dl-title-underline {
    display: none;
}

/* Keep each Font Awesome style on its own glyph font. In particular, brand
   icons must not inherit the solid icon font or they render as empty boxes. */
body :where(.fa, .fa-solid, .fas) {
    font-family: 'Font Awesome 6 Pro' !important;
    font-weight: 900 !important;
}

body :where(.fa-regular, .far) {
    font-family: 'Font Awesome 6 Pro' !important;
    font-weight: 400 !important;
}

body :where(.fa-light, .fal) {
    font-family: 'Font Awesome 6 Pro' !important;
    font-weight: 300 !important;
}

body :where(.fa-thin, .fat) {
    font-family: 'Font Awesome 6 Pro' !important;
    font-weight: 100 !important;
}

body :where(.fa-brands, .fab) {
    font-family: 'Font Awesome 6 Brands' !important;
    font-weight: 400 !important;
}

@media (max-width: 767px) {
    body h1 :where(.global-h1-accent, .mm-page-hero__highlight, .home-h1-accent, .dl-slider-title__special) {
        display: inline;
        padding-bottom: .06em !important;
        background:
            linear-gradient(currentColor, currentColor) right calc(100% - .02em) / 92% 1.5px no-repeat !important;
        -webkit-box-decoration-break: clone;
        box-decoration-break: clone;
    }

    body h1 :where(.global-h1-accent, .mm-page-hero__highlight, .home-h1-accent, .dl-slider-title__special)::after {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
