:root {
    /* Modern Teal & Emerald Palette */
    --bg: #f8fafc;
    --surface: rgba(255, 255, 255, 0.75);
    --ink: #0f172a;
    --muted: #64748b;
    --primary: #059669; /* Emerald 600 */
    --primary-light: #10b981; /* Emerald 500 */
    --primary-dark: #047857; /* Emerald 700 */
    --secondary: #0d9488; /* Teal 600 */
    --danger: #e11d48;
    --warn: #d97706;
    --good: #16a34a;
    --ring: rgba(5, 150, 105, 0.15);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow-soft: 0 8px 32px 0 rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: 'Manrope', system-ui, -apple-system, sans-serif;
    background: 
        radial-gradient(circle at 10% 20%, rgba(5, 150, 105, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(13, 148, 136, 0.05) 0%, transparent 40%),
        var(--bg);
    min-height: 100vh;
    line-height: 1.6;
}

/* Typography Enhancements */
h1, h2, h3 {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    line-height: 1.2;
}

.site-header,
.site-footer,
main {
    width: min(1200px, 92vw);
    margin: 0 auto;
}

/* Header */
.site-header {
    padding: 1.5rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    margin-bottom: 2rem;
}

.brand {
    font-family: 'DM Serif Display', serif;
    font-size: 1.75rem;
    text-decoration: none;
    color: var(--ink);
    transition: color 0.3s ease;
}

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

.top-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.top-nav a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.top-nav a:not(.button-link):hover {
    color: var(--primary);
}

.button-link,
.inline-form button,
#search-btn {
    text-decoration: none;
    border: 0;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    border-radius: 12px;
    padding: 0.7rem 1.4rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

.button-link:hover,
.inline-form button:hover,
#search-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(5, 150, 105, 0.3);
}

.button-link:active,
#search-btn:active {
    transform: translateY(0);
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3rem;
    align-items: center;
    margin-top: 2rem;
    animation: fadeInRise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hero-copy h1 {
    font-size: clamp(2.5rem, 5vw, 3.75rem);
    margin: 0.5rem 0 1.25rem;
    background: linear-gradient(135deg, var(--ink) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-copy p {
    font-size: 1.125rem;
    color: var(--muted);
    max-width: 500px;
}

.kicker {
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--primary);
    font-weight: 800;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Search Panel - Glassmorphism */
.search-panel {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-soft);
}

.search-panel label {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    color: var(--muted);
}

.search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
}

input[type='text'] {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    font: inherit;
    width: 100%;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.5);
}

input[type='text']:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px var(--ring);
}

.tiny {
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 1rem;
    opacity: 0.7;
}

/* Results Section */
.results {
    margin-top: 4rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.metric-card {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.05);
}

.metric-card h2 {
    font-size: 1.25rem;
    margin: 0 0 1rem;
    color: var(--ink);
}

.metric-card p {
    margin: 0.5rem 0;
    color: var(--muted);
}

.metric-card strong {
    color: var(--ink);
    font-size: 1.1rem;
}

/* Gauge UI */
.gauge {
    margin: 1.5rem 0;
    height: 12px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    position: relative;
}

.gauge-fill {
    height: 100%;
    width: 0;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, var(--secondary), var(--primary));
}

/* Map Grid */
.map-grid {
    margin-top: 4rem;
}

.map-grid h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.map-grid p {
    color: var(--muted);
    margin-bottom: 2rem;
}

.map {
    width: 100%;
    min-height: 500px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--glass-border);
}

/* Affiliation */
.affiliation {
    margin-top: 4rem;
    padding: 2rem;
    background: color-mix(in srgb, var(--primary) 5%, transparent);
    border-radius: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2rem;
}

.affiliation h2 {
    margin: 0;
    font-size: 1.5rem;
    flex-basis: 100%;
}

.affiliate-link {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.2s ease;
}

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

/* Footer */
.site-footer {
    margin-top: 6rem;
    padding: 3rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

/* Autocomplete List */
.autocomplete-list {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    max-height: 200px;
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.autocomplete-list li {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.autocomplete-list li:hover {
    background: #f1f5f9;
    color: var(--primary);
}

/* Animations */
@keyframes fadeInRise {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hidden {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 900px) {
    .site-header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .hero-copy p {
        margin: 0 auto;
    }

    .results {
        grid-template-columns: 1fr;
    }

    .map {
        min-height: 400px;
    }
    
    .affiliation {
        justify-content: center;
        text-align: center;
    }
}
