/* Custom Properties & Dark Glassmorphism Theme */
:root {
    --bg-dark: #07070a;
    --bg-gradient: radial-gradient(circle at top right, #1a1b26, #07070a 60%);
    
    --surface: rgba(20, 20, 30, 0.4);
    --surface-border: rgba(255, 255, 255, 0.08);
    
    --text-main: #f0f2f5;
    --text-muted: #9ba1b0;
    
    --accent-1: #00f0ff;
    --accent-2: #b000ff;
    
    --sp-4: 4px;
    --sp-8: 8px;
    --sp-12: 12px;
    --sp-16: 16px;
    --sp-24: 24px;
    --sp-40: 40px;
    --sp-64: 64px;
    
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Resets */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    min-height: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-dark);
    background-image: var(--bg-gradient);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img, svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-1);
}

ul, ol {
    list-style: none;
}

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

[hidden] {
    display: none !important;
}

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

/* Typography */
h1, h2, h3, h4, .brand-name {
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: var(--sp-24);
    background: linear-gradient(to right, #fff, var(--accent-1));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: #fff;
}

h2 {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    margin-bottom: var(--sp-16);
}

h3 {
    font-size: 1.25rem;
    margin-bottom: var(--sp-12);
}

h4 {
    font-size: 1rem;
    margin-bottom: var(--sp-12);
}

p {
    margin-bottom: var(--sp-16);
}

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

.lead-text {
    font-size: 1.125rem;
    color: var(--text-muted);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-12) var(--sp-24);
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #000;
    text-align: center;
}

.btn:hover {
    filter: brightness(1.1);
    color: #000;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--accent-1);
    color: var(--accent-1);
}

.btn-outline:hover {
    background: rgba(0, 240, 255, 0.1);
    color: var(--accent-1);
}

.btn-full {
    width: 100%;
}

/* Glass Panels */
.glass-panel {
    background: var(--surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--surface-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(0, 240, 255, 0.05);
    border-radius: 12px;
}

/* Header */
.site-header {
    height: 64px;
    border-bottom: 1px solid var(--surface-border);
    background: rgba(7, 7, 10, 0.8);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
}

.header-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--sp-24);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--sp-8);
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    overflow-wrap: anywhere;
}

.brand-icon {
    width: 24px;
    height: 24px;
    color: var(--accent-1);
}

.main-nav .nav-list {
    display: flex;
    gap: var(--sp-24);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    width: 32px;
    height: 32px;
    position: relative;
    z-index: 100;
}

.hamburger, .hamburger::before, .hamburger::after {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    position: absolute;
    transition: transform 0.3s ease, opacity 0.3s ease;
    left: 4px;
}

.hamburger { top: 15px; }
.hamburger::before { content: ''; top: -8px; left: 0; }
.hamburger::after { content: ''; top: 8px; left: 0; }

.nav-toggle[aria-expanded="true"] .hamburger { background: transparent; }
.nav-toggle[aria-expanded="true"] .hamburger::before { transform: rotate(45deg); top: 0; }
.nav-toggle[aria-expanded="true"] .hamburger::after { transform: rotate(-45deg); top: 0; }

/* Main & Sections */
main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--sp-40) var(--sp-24);
    display: flex;
    flex-direction: column;
    gap: var(--sp-64);
}

/* Hero */
.hero {
    position: relative;
    padding: var(--sp-64) var(--sp-40);
    text-align: center;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(176, 0, 255, 0.15) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

/* Cards Grid */
.section-guides .section-header {
    margin-bottom: var(--sp-40);
}

.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--sp-24);
}

/* Glass Overlay Card Style */
.card {
    position: relative;
    min-height: 380px;
    border-radius: 12px;
    overflow: hidden; /* Only to clip the img/overlay at border-radius */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.card-overlay {
    position: relative;
    z-index: 2;
    background: rgba(10, 12, 18, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: var(--sp-24);
    border-top: 1px solid rgba(0, 240, 255, 0.3);
    display: flex;
    flex-direction: column;
    gap: var(--sp-12);
}

.card-excerpt {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin: 0;
}

.card .btn {
    align-self: flex-start;
    margin-top: var(--sp-8);
}

/* About / Stats Grid */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-40);
    padding: var(--sp-40);
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--sp-24);
    align-content: center;
}

.stat-block {
    display: flex;
    flex-direction: column;
    gap: var(--sp-12);
}

.stat-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-1);
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* General Pages Content Wrapper */
.page-content {
    gap: var(--sp-24);
}

.content-wrapper {
    padding: var(--sp-40);
}

.article-header {
    margin-bottom: var(--sp-40);
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: var(--sp-24);
}

.article-featured-img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: var(--sp-40);
    border: 1px solid var(--surface-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.article-body h2 {
    margin-top: var(--sp-40);
    color: var(--accent-1);
}

.article-body h3 {
    margin-top: var(--sp-24);
    color: var(--text-main);
}

.article-body ul {
    list-style: disc;
    margin-left: var(--sp-24);
    margin-bottom: var(--sp-16);
}

.article-body li {
    margin-bottom: var(--sp-8);
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: var(--sp-24);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

th, td {
    padding: var(--sp-16);
    text-align: left;
    border-bottom: 1px solid var(--surface-border);
}

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

tr:last-child td {
    border-bottom: none;
}

/* Contact Form */
.contact-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: var(--sp-40);
}

.contact-form-wrapper, .contact-info {
    padding: var(--sp-40);
}

.form-group {
    margin-bottom: var(--sp-24);
}

label {
    display: block;
    margin-bottom: var(--sp-8);
    font-weight: 600;
}

input, select, textarea {
    width: 100%;
    padding: var(--sp-16);
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-1);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

input.is-invalid, select.is-invalid, textarea.is-invalid {
    border-color: #ff4757;
}

.error-msg {
    display: block;
    color: #ff4757;
    font-size: 0.85rem;
    margin-top: var(--sp-8);
}

.success-msg {
    margin-top: var(--sp-16);
    padding: var(--sp-16);
    background: rgba(46, 213, 115, 0.1);
    border: 1px solid #2ed573;
    color: #2ed573;
    border-radius: 6px;
}

.contact-details {
    margin-top: var(--sp-24);
}

.map-block {
    margin-top: var(--sp-24);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--surface-border);
}

/* Footer */
.site-footer {
    background: rgba(5, 5, 8, 0.9);
    border-top: 1px solid var(--surface-border);
    padding: var(--sp-64) var(--sp-24) var(--sp-24);
    margin-top: auto;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--sp-40);
    margin-bottom: var(--sp-40);
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: var(--sp-8);
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid var(--surface-border);
    padding-top: var(--sp-24);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-email {
    color: var(--accent-1);
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: var(--sp-24);
    left: var(--sp-24);
    right: var(--sp-24);
    max-width: 800px;
    margin: 0 auto;
    padding: var(--sp-24);
    z-index: 1000;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-24);
}

.cookie-content {
    flex: 1 1 300px;
}

.cookie-content h4 {
    margin-bottom: var(--sp-8);
}

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

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

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

    .main-nav {
        position: fixed;
        top: 52px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(7, 7, 10, 0.95);
        backdrop-filter: blur(16px);
        padding: var(--sp-40) var(--sp-24);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 99;
    }

    .main-nav.is-visible {
        transform: translateX(0);
    }

    .main-nav .nav-list {
        flex-direction: column;
        align-items: center;
        gap: var(--sp-40);
        font-size: 1.5rem;
    }

    .btn-header {
        display: none;
    }

    .about-grid, .contact-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .cookie-banner {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cookie-actions {
        justify-content: stretch;
    }
    
    .cookie-actions .btn {
        flex: 1 1 100%;
    }
}

@media (max-width: 400px) {
    :root {
        --sp-40: 24px;
        --sp-64: 40px;
    }
    
    .hero {
        padding: var(--sp-40) var(--sp-16);
    }

    .content-wrapper, .about-grid, .contact-form-wrapper, .contact-info {
        padding: var(--sp-24) var(--sp-16);
    }
    
    main {
        padding-left: var(--sp-16);
        padding-right: var(--sp-16);
    }

    .grid-cards {
        grid-template-columns: 1fr;
    }
    
    .min-width-zero {
        min-width: 0;
    }
}

/* Ensures layout elements can shrink */
.grid-cards, .about-grid, .contact-grid, .footer-grid, .nav-list {
    min-width: 0;
}