/* ============================================================
   BASE.CSS — Design tokens, reset, typography, nav, hero
   ============================================================ */

/* === DESIGN TOKENS === */
:root {
    --bg:               #ffffff;
    --bg-alt:           #f8fafc;
    --bg-dark:          #0c1220;
    --bg-dark-alt:      #131d30;
    --bg-dark-surface:  #1a2640;
    --surface:          #ffffff;
    --border:           #e2e8f0;
    --border-dark:      #1e2d42;

    --text-primary:     #0f172a;
    --text-secondary:   #475569;
    --text-muted:       #94a3b8;
    --text-inverse:     #e2e8f0;
    --text-inverse-muted: #8896a7;

    --accent:           #c0390a;
    --accent-hover:     #a12f08;
    --accent-light:     #fff4f0;
    --accent-border:    #f4c4b0;

    --blue:             #2563eb;
    --blue-light:       #eff6ff;
    --green:            #059669;

    --nav-height:       72px;
    --max-w:            1280px;
    --section-pad:      7rem;
    --radius:           6px;

    --shadow-sm:  0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:  0 4px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg:  0 20px 60px rgba(0,0,0,0.12);

    --transition: 0.2s ease;
}

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg);
    padding-top: var(--nav-height);
}

img { display: block; max-width: 100%; }
ul  { list-style: none; }

/* Screen-reader only */
.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* Inline code / monospace tokens */
code, .mono {
    font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.85em;
    background: #f1f5f9;
    padding: 0.1em 0.35em;
    border-radius: 3px;
    color: var(--accent);
}

/* === SCROLL ANIMATION === */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === SHARED SECTION LAYOUT === */
.section {
    padding: var(--section-pad) 2rem;
}
.section-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}
.section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}
.section-title {
    font-size: clamp(1.875rem, 3vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}
.section-title.light { color: #ffffff; }
.section-lead {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 700px;
    line-height: 1.75;
    margin-bottom: 4rem;
}
.section-lead.light { color: var(--text-inverse-muted); }

/* === BUTTONS === */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent);
    color: #ffffff;
    padding: 0.875rem 2rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background var(--transition), transform 0.1s ease;
}
.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--text-inverse);
    padding: 0.875rem 2rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border-dark);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
}
.btn-secondary:hover {
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.05);
}

/* === NAVIGATION === */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: rgba(12, 18, 32, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-dark);
    z-index: 1000;
}
.nav-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}
.nav-logo-mark {
    width: 32px; height: 32px;
    background: var(--accent);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0;
    flex-shrink: 0;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.nav-links a {
    color: var(--text-inverse-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius);
    transition: color var(--transition), background var(--transition);
}
.nav-links a:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.08);
}
.nav-links .nav-cta {
    background: var(--accent);
    color: #ffffff;
    padding: 0.5rem 1.25rem;
}
.nav-links .nav-cta:hover {
    background: var(--accent-hover);
}
.nav-mobile-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

/* === HERO === */
.hero {
    background-color: var(--bg-dark);
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 64px 64px;
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--section-pad) 2rem;
}
.hero-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    width: 100%;
}
.hero-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.75rem;
}
.hero-label::before {
    content: '';
    display: block;
    width: 24px; height: 2px;
    background: var(--accent);
}
.hero h1 {
    font-size: clamp(2.75rem, 5vw, 4.25rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: #ffffff;
    max-width: 820px;
    margin-bottom: 1.75rem;
}
.hero h1 span { color: var(--accent); }
.hero-sub {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--text-inverse-muted);
    max-width: 680px;
    line-height: 1.75;
    margin-bottom: 3rem;
    font-weight: 400;
}
.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 5rem;
}

/* Hero metrics bar */
.hero-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border-dark);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius);
    overflow: hidden;
}
.metric {
    background: var(--bg-dark-alt);
    padding: 1.75rem 2rem;
}
.metric-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 0.4rem;
}
.metric-value span { color: var(--accent); }
.metric-label {
    font-size: 0.8rem;
    color: var(--text-inverse-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* === RESPONSIVE — BASE === */
@media (max-width: 1100px) {
    .hero-metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    :root { --section-pad: 4rem; }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0; right: 0;
        background: var(--bg-dark);
        flex-direction: column;
        padding: 1rem;
        border-bottom: 1px solid var(--border-dark);
        gap: 0;
        align-items: stretch;
    }
    .nav-links.mobile-open { display: flex; }
    .nav-links a { border-radius: 0; padding: 0.75rem 1rem; }
    .nav-mobile-btn { display: flex; align-items: center; }

    .hero-actions { flex-direction: column; align-items: flex-start; }
    .hero-metrics  { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .hero-metrics { grid-template-columns: 1fr 1fr; }
}
