/* =========================================================================
   APEX-UI Institutional Theme
   Pantera-authentic palette + IBM Plex Mono / Inter typography
   WCAG 2.2 AA, prefers-reduced-motion compliant
   ========================================================================= */

:root {
    --brand-navy:         #15182B;
    --brand-navy-soft:    #1E2340;
    --brand-yellow:       #E9B737;
    --brand-yellow-hover: #F5C74B;
    --surface-0:          #FFFFFF;
    --surface-1:          #FAFAF7;
    --surface-2:          #F2F1EC;
    --text-primary:       #15182B;
    --text-muted:         rgba(21, 24, 43, 0.65);
    --text-inverse:       #FFFFFF;
    --border-subtle:      rgba(21, 24, 43, 0.10);
    --border-hairline:    rgba(21, 24, 43, 0.06);
    --success:            #059669;
    --warning:            #D97706;
    --danger:             #DC2626;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.06),
                 0 24px 48px -12px rgba(0, 0, 0, 0.10);

    --radius-sm: 0px;
    --radius-md: 2px;
    --radius-lg: 4px;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

    --font-mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: var(--font-body);

    --bs-primary:       var(--brand-navy);
    --bs-primary-rgb:   21, 24, 43;
    --bs-body-bg:       var(--surface-0);
    --bs-body-color:    var(--text-primary);
    --bs-body-color-rgb: 21, 24, 43;
    --bs-body-font-family: var(--font-body);
    --bs-body-font-size: 1rem;
    --bs-body-line-height: 1.6;
    --bs-border-color:  var(--border-subtle);
    --bs-border-radius: var(--radius-md);
    --bs-link-color:    var(--brand-navy);
    --bs-link-hover-color: var(--brand-yellow);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: 0.003em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'kern', 'liga';
    margin: 0;
}

img, svg { max-width: 100%; height: auto; }
::selection { background-color: var(--brand-yellow); color: var(--brand-navy); }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.08;
    margin: 0 0 1.25rem;
}
h1, .h1 { font-size: clamp(2.5rem, 5vw + 1rem, 5.5rem); font-weight: 400; letter-spacing: -0.035em; line-height: 1.02; }
h2, .h2 { font-size: clamp(2rem, 3vw + 0.75rem, 3.5rem); font-weight: 400; }
h3, .h3 { font-size: clamp(1.5rem, 1.75vw + 0.5rem, 2.25rem); }
h4, .h4 { font-size: 1.375rem; }
h5, .h5 { font-size: 1.125rem; }
h6, .h6 { font-size: 1rem; }

p { font-size: 1.0625rem; line-height: 1.65; margin: 0 0 1.25rem; }
p.lead, .lead {
    font-size: clamp(1.125rem, 0.5vw + 1rem, 1.375rem);
    font-weight: 300; line-height: 1.55; color: var(--text-muted);
}

a { color: var(--bs-link-color); text-decoration: none; transition: color 200ms var(--ease-out-expo); }
a:hover { color: var(--bs-link-hover-color); }

.tabular, .metric-value, .stat-figure, code, pre {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.eyebrow, .section-eyebrow, .hero-eyebrow, .section-label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.75rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.14rem;
    color: var(--brand-yellow);
    margin-bottom: 1.5rem;
}

.section, section { padding-block: clamp(4rem, 8vw, 10rem); }

.hero-headline, .section-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 5vw + 1rem, 5rem);
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--text-primary);
}
.hero-sub {
    font-size: clamp(1.125rem, 0.5vw + 1rem, 1.25rem);
    color: var(--text-muted);
    max-width: 640px;
    line-height: 1.6;
}
.hero-headline .highlight { color: var(--brand-yellow); }

.xmr-hero {
    background-color: var(--brand-navy);
    color: var(--text-inverse);
    padding: clamp(6rem, 12vw, 10rem) 0 clamp(4rem, 8vw, 7rem);
    position: relative;
    overflow: hidden;
}
.xmr-hero h1, .xmr-hero h2, .xmr-hero h3,
.xmr-hero .hero-headline, .xmr-hero .section-title { color: var(--text-inverse); }
.xmr-hero .hero-sub { color: rgba(255, 255, 255, 0.78); }
.xmr-hero .hero-eyebrow { color: var(--brand-yellow); }

.xmr-card, .fund-card, .stat-box {
    background-color: var(--surface-0);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 2rem;
    transition: transform 300ms var(--ease-out-expo),
                box-shadow 300ms var(--ease-out-expo),
                border-color 300ms var(--ease-out-expo);
}
.xmr-hero .xmr-card {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-inverse);
}
.fund-card:hover, .xmr-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand-navy);
}

.fund-card { display: flex; flex-direction: column; height: 100%; }
.fund-card-header { padding-bottom: 1rem; border-bottom: 1px solid var(--border-hairline); margin-bottom: 1.25rem; }
.fund-icon { font-size: 2rem; color: var(--brand-yellow); margin-bottom: 0.75rem; }
.fund-name { font-size: 1.25rem; font-weight: 500; margin-bottom: 0.25rem; }
.fund-strategy { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12rem; color: var(--text-muted); }
.fund-return { font-family: var(--font-display); font-size: 2.25rem; font-weight: 300; color: var(--brand-navy); line-height: 1; margin-top: 0.5rem; }
.fund-return-label { font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12rem; color: var(--text-muted); margin-bottom: 1rem; }
.fund-card-body { flex: 1 1 auto; }
.fund-card-footer { margin-top: 1.5rem; }

.stat-box { padding: 2rem 1.5rem; text-align: center; border: 0; border-right: 1px solid var(--border-subtle); background: transparent; }
.stat-box:last-child { border-right: 0; }
.stat-value { font-family: var(--font-display); font-size: clamp(1.75rem, 2.5vw + 0.5rem, 2.5rem); font-weight: 400; color: var(--brand-navy); font-variant-numeric: tabular-nums; line-height: 1; margin-bottom: 0.5rem; }
.stat-label { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14rem; color: var(--text-muted); }

.step-number {
    font-family: var(--font-display);
    font-size: 2.5rem; font-weight: 300;
    color: var(--brand-yellow);
    line-height: 1;
}

.risk-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.65rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.1rem;
    padding: 0.25rem 0.6rem;
    border-radius: 2px;
    border: 1px solid transparent;
}
.risk-low        { color: var(--success); border-color: var(--success); }
.risk-medium     { color: var(--warning); border-color: var(--warning); }
.risk-high       { color: var(--danger);  border-color: var(--danger); }
.risk-very-high  { color: var(--danger);  border-color: var(--danger); background: rgba(220,38,38,0.06); }

.section-divider { border-color: var(--border-hairline); opacity: 1; }

.text-accent, .text-xmr-accent { color: var(--brand-yellow) !important; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    border-radius: var(--radius-md);
    padding: 0.9rem 1.75rem;
    font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.14rem;
    border: 1px solid transparent; line-height: 1.4;
    transition: all 250ms var(--ease-out-expo); cursor: pointer;
}
.btn-accent, .btn-primary {
    background-color: var(--brand-yellow);
    border-color: var(--brand-yellow);
    color: var(--brand-navy);
}
.btn-accent:hover, .btn-primary:hover {
    background-color: transparent;
    border-color: var(--brand-yellow);
    color: var(--brand-yellow);
}
.btn-outline-accent {
    background-color: transparent;
    border-color: var(--brand-yellow);
    color: var(--brand-yellow);
}
.btn-outline-accent:hover {
    background-color: var(--brand-yellow);
    color: var(--brand-navy);
}
.xmr-hero .btn-outline-accent { color: var(--brand-yellow); }

.alert-xmr-danger {
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--danger);
    color: var(--danger);
    background-color: rgba(220, 38, 38, 0.05);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
}

.form-control, .form-select {
    background-color: var(--surface-0);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 0.9rem 1.1rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    transition: border-color 200ms var(--ease-out-expo);
}
.form-control:focus, .form-select:focus {
    background-color: var(--surface-0);
    border-color: var(--brand-navy);
    color: var(--text-primary);
    box-shadow: none; outline: none;
}
.form-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 0.12rem;
    color: var(--text-muted); margin-bottom: 0.5rem;
}

:focus-visible {
    outline: 2px solid var(--brand-yellow);
    outline-offset: 3px;
    border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}
