:root {
    /* Brand & Aesthetic Colors - Dark Glassmorphism */
    --color-bg-base: #0a0d14;
    --color-bg-surface: rgba(18, 22, 31, 0.4);
    --color-text-main: #f8fafc;
    --color-text-muted: #94a3b8;
    --color-accent-primary: #00f2fe;
    --color-accent-secondary: #4facfe;
    --color-danger: #ef4444;
    --color-success: #10b981;
    
    /* Glassmorphism Variables */
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-border-bright: rgba(0, 242, 254, 0.4);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    
    /* Spacing Scale */
    --space-4: 4px;
    --space-8: 8px;
    --space-12: 12px;
    --space-16: 16px;
    --space-24: 24px;
    --space-40: 40px;
    --space-64: 64px;

    /* Typography */
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    lang: "en";
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg-base);
    color: var(--color-text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Accessibility */
:focus-visible {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 4px;
    border-radius: 4px;
}

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

/* Typography Overrides */
h1, h2, h3, h4, h5, h6, .brand-name, .nav-link, th {
    overflow-wrap: anywhere;
    color: var(--color-text-main);
    line-height: 1.2;
}

h1 { font-size: 2.5rem; margin-bottom: var(--space-24); }
h2 { font-size: 2rem; margin-top: var(--space-40); margin-bottom: var(--space-16); }
h3 { font-size: 1.5rem; margin-top: var(--space-24); margin-bottom: var(--space-16); }
p { margin-bottom: var(--space-16); }
a { color: var(--color-accent-primary); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--color-accent-secondary); }

/* Utility Classes */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-24);
}

.text-gradient {
    background: linear-gradient(90deg, var(--color-accent-primary), var(--color-accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.glass-panel {
    background: var(--color-bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
}

/* Header */
.site-header {
    height: 64px;
    display: flex;
    align-items: center;
    background: rgba(10, 13, 20, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    position: relative; /* Not sticky per requirements */
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-text-main);
}

.brand svg {
    width: 24px;
    height: 24px;
    fill: url(#brand-gradient);
}

.site-nav {
    display: flex;
    gap: var(--space-24);
    align-items: center;
}

.nav-link {
    color: var(--color-text-main);
    font-size: 0.95rem;
    font-weight: 500;
    padding: var(--space-8);
    border-radius: 4px;
}

.nav-link:hover, .nav-link.is-active {
    color: var(--color-accent-primary);
    background: rgba(255, 255, 255, 0.05);
}

.header-cta {
    display: flex;
    align-items: center;
}

.btn {
    display: inline-block;
    padding: var(--space-8) var(--space-24);
    background: transparent;
    color: var(--color-accent-primary);
    border: 1px solid var(--color-accent-primary);
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(90deg, var(--color-accent-primary), var(--color-accent-secondary));
    color: #000;
    border: none;
}

.btn:hover {
    box-shadow: 0 0 16px rgba(0, 242, 254, 0.4);
    transform: translateY(-1px);
}

.btn-primary:hover {
    color: #000;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--color-text-main);
    padding: var(--space-8);
    border-radius: 4px;
    cursor: pointer;
}

/* Hero Section */
.hero {
    padding: var(--space-64) 0;
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background: var(--color-accent-primary);
    filter: blur(150px);
    opacity: 0.15;
    z-index: -1;
    border-radius: 50%;
}

.hero p {
    font-size: 1.25rem;
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto var(--space-40);
}

/* Layout - Main Content */
main {
    flex: 1;
    padding-bottom: var(--space-64);
}

.section-spacing {
    margin-top: var(--space-64);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-40);
}

/* Allow children to shrink below content width */
.grid > *, .flex > * {
    min-width: 0;
}

/* Card Style: Glass Overlay */
.card {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    min-height: 340px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-decoration: none;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--glass-border-bright);
}

.card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.card-overlay {
    position: relative;
    z-index: 1;
    background: rgba(10, 13, 20, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: var(--space-24);
    border-top: 1px solid var(--glass-border);
    width: 100%;
}

.card-title {
    font-size: 1.25rem;
    color: var(--color-text-main);
    margin-bottom: var(--space-8);
}

.card-desc {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--space-16);
    font-size: 0.8rem;
    color: var(--color-accent-primary);
}

/* Support Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-24);
}

.feature-box {
    padding: var(--space-24);
    text-align: left;
}

.feature-icon {
    width: 40px;
    height: 40px;
    margin-bottom: var(--space-16);
    fill: var(--color-accent-primary);
}

/* Page Content Formatting (Sub-pages & Legal) */
.content-wrapper {
    max-width: 800px;
    margin: var(--space-40) auto;
}

.content-wrapper p {
    margin-bottom: var(--space-24);
    color: var(--color-text-muted);
}

.content-wrapper ul, .content-wrapper ol {
    margin-bottom: var(--space-24);
    padding-left: var(--space-24);
    color: var(--color-text-muted);
}

.content-wrapper li {
    margin-bottom: var(--space-8);
}

.content-wrapper strong {
    color: var(--color-text-main);
}

.hero-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 16px;
    margin-bottom: var(--space-40);
    border: 1px solid var(--glass-border);
}

/* Data Table */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-bottom: var(--space-24);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: var(--space-16);
    border-bottom: 1px solid var(--glass-border);
}

th {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-text-main);
    font-weight: 600;
}

td {
    color: var(--color-text-muted);
}

/* Statistics Block */
.stat-block {
    display: flex;
    align-items: baseline;
    margin-bottom: var(--space-24);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-accent-primary);
    margin-right: var(--space-12);
}

.stat-label {
    font-size: 1rem;
    color: var(--color-text-muted);
}

/* Forms */
.form-group {
    margin-bottom: var(--space-24);
}

.form-label {
    display: block;
    margin-bottom: var(--space-8);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: var(--space-12) var(--space-16);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--color-text-main);
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-accent-primary);
    background: rgba(255, 255, 255, 0.05);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

.form-control.is-invalid {
    border-color: var(--color-danger);
}

.error-msg {
    display: none;
    color: var(--color-danger);
    font-size: 0.85rem;
    margin-top: var(--space-4);
}

.form-control.is-invalid + .error-msg {
    display: block;
}

.form-success {
    display: none;
    padding: var(--space-16);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--color-success);
    color: var(--color-success);
    border-radius: 8px;
    margin-bottom: var(--space-24);
}

.form-success.is-visible {
    display: block;
}

/* Map Block */
.map-block {
    width: 100%;
    height: 300px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    background: 
        linear-gradient(rgba(10, 13, 20, 0.8), rgba(10, 13, 20, 0.8)),
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M0 0h100v100H0z" fill="%230b0e14"/><path d="M10 10h80v80H10z" fill="none" stroke="%23333" stroke-width="1"/><path d="M20 20h60v60H20z" fill="none" stroke="%234facfe" stroke-width="0.5" opacity="0.3"/></svg>');
    background-size: cover, 100px 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.map-marker {
    width: 24px;
    height: 24px;
    fill: var(--color-accent-primary);
    position: absolute;
    z-index: 2;
}

/* Footer */
.site-footer {
    background: rgba(10, 13, 20, 0.95);
    border-top: 1px solid var(--glass-border);
    padding: var(--space-64) 0 var(--space-24);
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-40);
    margin-bottom: var(--space-40);
}

.footer-title {
    font-size: 1.1rem;
    color: var(--color-text-main);
    margin-bottom: var(--space-16);
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: var(--space-8);
}

.footer-links a {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--color-accent-primary);
}

.footer-bottom {
    border-top: 1px solid var(--glass-border);
    padding-top: var(--space-24);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-16);
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: var(--space-24);
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - var(--space-48));
    max-width: 800px;
    z-index: 9999;
    padding: var(--space-24);
    display: flex;
    flex-direction: column;
    gap: var(--space-16);
}

.cookie-banner[hidden] {
    display: none;
}

.cookie-content p {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.cookie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-12);
}

.cookie-actions .btn {
    flex: 1;
    font-size: 0.85rem;
    padding: var(--space-8) var(--space-16);
}

/* Media Queries */
@media (max-width: 767px) {
    .site-header {
        height: 52px;
    }
    
    .menu-toggle {
        display: block;
    }

    .header-cta {
        display: none;
    }

    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(10, 13, 20, 0.98);
        backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--glass-border);
        flex-direction: column;
        padding: var(--space-24);
        gap: var(--space-16);
        transform: translateY(-150%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

    .site-nav.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    /* Remove negative offsets for pseudo-elements on mobile (constraint matching) */
    .hero::before {
        display: none;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
}

@media (max-width: 399px) {
    .site-header {
        height: 48px;
    }
    
    .brand-name {
        font-size: 1.1rem;
    }

    .cookie-banner {
        bottom: 0;
        left: 0;
        transform: none;
        width: 100%;
        border-radius: 16px 16px 0 0;
        border-bottom: none;
        border-left: none;
        border-right: none;
    }

    .cookie-actions {
        flex-direction: column;
    }
}