/* 1. CSS VARIABLES (Theme System) */
:root {
    /* Default Dark Mode ("Black Hole") */
    --bg-color: #0a0a0a;
    --bg-secondary: #111111;
    --bg-accent: #1a1a1a;
    --text-color: #EAEAEA;
    --text-muted: #888888;
    --border-color: #2A2A2A;
    --border-hover: #555555;

    /* Action Colors */
    --primary-btn: #EAEAEA;
    --primary-btn-text: #101010;
    --accent-glow: rgba(255, 255, 255, 0.05);

    /* Layout */
    --container-width: 1600px;
    --header-height: 70px;
    --spacing: 2rem;
    --radius: 8px;
    --transition: all 0.3s ease;
}

/* Light Mode Overrides */
[data-theme="light"] {
    --bg-color: #FFFFFF;
    --bg-secondary: #F9F9F9;
    --bg-accent: #F0F0F0;
    --text-color: #101010;
    --text-muted: #555555;
    --border-color: #DDDDDD;
    --border-hover: #AAAAAA;
    --accent-glow: rgba(0, 0, 0, 0.05);

    --primary-btn: #101010;
    --primary-btn-text: #FFFFFF;
}

/* 2. GLOBAL RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html{
    scroll-behavior: smooth;
}

body {
    /* Uses San Francisco (Mac), Segoe UI (Windows), Roboto (Android) automatically */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    
    /* Keep your existing settings */
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

h1, h2, h3, .logo {
    /* Clean, bold, modern headers */
    font-family: system-ui, -apple-system, sans-serif;
    letter-spacing: -1px; /* Tighter spacing looks more premium */
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

ul {
    list-style: none;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    color: inherit;
    font-family: inherit;
}


h1 {
    font-size: 3rem;
    line-height: 1.1;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* 3. LAYOUT UTILITIES */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.section-pad {
    padding: 5rem 0;
}

/* 4. NAVIGATION (Enhanced) */
#theme-logo {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.site-header {
    height: var(--header-height);
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

/* Fix for Safari/Firefox backdrop filter support if needed, fallback to opacity */
@supports not (backdrop-filter: blur(10px)) {
    .site-header {
        background: var(--bg-secondary);
    }
}

.site-header nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 20px;
    padding-right: 20px;
}

/* Logo Styling with Icon */
.logo {
    font-weight: 700;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo svg {
    width: 28px;
    height: 28px;
    fill: var(--text-color);
    transition: var(--transition);
}

.logo:hover svg {
    transform: rotate(15deg);
}

/* Desktop Nav Links */
.nav-links {
    display: flex;
    gap: 2.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    align-items: center;
}

.nav-links a {
    position: relative;
}

/* Underline Hover Effect */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-btn);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Theme Toggle Button */
#theme-toggle {
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
    background: var(--bg-accent);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
}

#theme-toggle:hover {
    border-color: var(--text-muted);
    transform: scale(1.05);
}

/* Mobile Menu Button (Hamburger) - Hidden on desktop */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 30px;
    z-index: 1001;
}

.menu-toggle span {
    width: 100%;
    height: 2px;
    background-color: var(--text-color);
    transition: var(--transition);
}

.btn-primary {
    display: inline-block;
    background-color: var(--primary-btn);
    color: var(--primary-btn-text);
    padding: 0.8rem 2rem;
    border-radius: var(--radius);
    font-weight: 600;
    border: 1px solid transparent;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--accent-glow);
}


/* 6. MOBILE RESPONSIVENESS */
@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    h1 {
        font-size: 2.2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

  

    /* Mobile Navigation Logic */
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: var(--bg-color);

        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 2rem;

        /* Proper hidden state */
        opacity: 0;
        visibility: hidden;
        pointer-events: none;

        transition: opacity 0.3s ease, visibility 0.3s ease;
        border-top: 1px solid var(--border-color);
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        display: block;
        padding: 1rem;
        font-size: 1.2rem;
    }

    #theme-toggle {
        margin: 0 auto;
    }

    /* Hamburger Animation */
    .menu-toggle.open span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-toggle.open span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.open span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}

/* --- LEARN PAGE HERO --- */

.learn-hero {
    /* Generous vertical spacing */
    padding: 8rem 0 6rem 0; 
    text-align: center; /* Centered focus */
    position: relative;
}

.learn-hero .container {
    /* Constrain width for readability so text doesn't stretch 1600px */
    max-width: 800px; 
    margin: 0 auto;
}

.learn-micro {
    /* Distinct style for the top label */
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary-btn); /* Uses theme button color for subtle pop */
    margin-bottom: 1rem;
    font-weight: 600;
    opacity: 0.8;
}

.learn-title {
    /* Slightly larger than base h1, very tight tracking */
    font-size: 4.5rem; 
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    /* subtle gradient text support (optional, remove if you want flat color) */
    background: linear-gradient(to bottom, var(--text-color), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.learn-subtitle {
    font-size: 1.35rem;
    color: var(--text-muted);
    line-height: 1.6;
    font-weight: 400;
    margin-bottom: 0; /* Reset default p margin */
}

/* Mobile Responsiveness for Hero */
@media (max-width: 768px) {
    .learn-hero {
        padding: 6rem 0 4rem 0;
        text-align: left; /* Switch to left align on mobile for better reading */
    }

    .learn-title {
        font-size: 3rem;
    }

    .learn-subtitle {
        font-size: 1.1rem;
    }
}
/* --- UPDATED DOMAIN CARDS --- */

.domain-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: var(--bg-secondary); /* Slightly darker than topics */
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 2rem;
    height: 100%;
    transition: var(--transition);
    position: relative;
    text-decoration: none; /* Remove underline from link */
    overflow: hidden;
}

/* Hover Effect */
.domain-card:hover {
    transform: translateY(-5px);
    border-color: var(--text-muted); /* Glow effect */
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Internal Layout */
.card-content {
    margin-bottom: 2rem;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

/* Technical Text Icon */
.domain-icon {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 4px 8px;
    border-radius: 4px;
    background: var(--bg-accent);
}

.domain-card h3 {
    font-size: 1.6rem; /* Larger than topics */
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--text-color);
}

.card-desc {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Footer & Arrow Animation */
.card-footer {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-color);
}

.arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.domain-card:hover .arrow {
    transform: translateX(5px); /* Slide arrow on hover */
    color: var(--primary-btn);
}

/* --- BADGES (Re-used) --- */
.status-badge {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.status-planned {
    color: var(--text-muted);
    border: 1px dashed var(--border-color);
}

/* --- DISABLED STATE --- */
.card-disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none; /* Prevents clicking */
}
/* --- 4-COLUMN LAYOUT --- */
.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 equal columns */
    gap: 1.5rem;
}

/* Responsiveness: Switch to 2x2 on laptops/tablets */
@media (max-width: 1200px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsiveness: Stack on mobile */
@media (max-width: 768px) {
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* --- TOPIC CARDS SECTION --- */

.section-header {
    margin-bottom: 3rem;
}

/* The Card Link Wrapper */
.topic-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: var(--bg-accent);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    height: 100%;
    transition: var(--transition);
    position: relative;
    overflow: hidden; /* For hover effects */
}

/* Hover: Highlight Border & Subtle Glow */
.topic-card:hover {
    border-color: var(--primary-btn);
    transform: translateY(-3px);
}

/* Card Content Structure */
.topic-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.topic-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Keep your existing border/padding */
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px; 
    color: var(--text-muted);
    transition: var(--transition);
}
/* Handle Images inside Topic Icons */
.topic-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block; /* Removes any accidental spacing */
}

/* Optional: Remove the border if you want the colored logo to stand alone, 
   or keep it for the "boxed" look. Keeping it matches your design better. */
.topic-card:hover .topic-icon {
    color: var(--text-color);
    border-color: var(--text-muted);
}
/* Status Indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: block;
}

.status-live {
    background-color: #2ecc71; /* Green for active */
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}

.status-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Typography */
.topic-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.topic-purpose {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Action Footer (The "Button" feel without the box) */
.topic-action {
    margin-top: auto; /* Pushes to bottom */
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

.arrow {
    transition: transform 0.3s ease;
}

.topic-card:hover .arrow {
    transform: translateX(5px);
}

/* --- DISABLED STATE (Coming Soon) --- */
.card-disabled {
    opacity: 0.6;
    cursor: default; /* Optional: change to not-allowed if strictly disabled */
}

.card-disabled:hover {
    transform: none;
    border-color: var(--border-color);
}
/* --- PHILOSOPHY REMINDER --- */

.philosophy-section {
    padding: 6rem 0; /* Plenty of breathing room */
    text-align: center;
}

.philosophy-text {
    font-size: 1rem;
    color: var(--text-muted);
    opacity: 0.6; /* Very subtle */
    max-width: 500px; /* narrow width for focus */
    margin: 0 auto;
    line-height: 1.8;
    font-style: italic; /* distinct "voice" */
}

/* Optional: A tiny decorative line above it to separate from content */
.philosophy-text::before {
    content: "";
    display: block;
    width: 40px;
    height: 1px;
    background-color: var(--border-color);
    margin: 0 auto 2rem auto;
}
/* --- EXPANDED FOOTER STYLING --- */

.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 5rem 0 2rem 0; /* More padding on top */
    font-size: 0.95rem;
}

/* 1. Grid Layout */
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr; /* Brand col is wider */
    gap: 4rem;
    margin-bottom: 4rem;
}

/* 2. Brand Column */
.footer-brand-col {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-color);
}

.footer-desc {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Social Icons */
.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg-accent);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--primary-btn);
    color: var(--primary-btn-text);
    border-color: var(--primary-btn);
    transform: translateY(-2px);
}

.social-links svg {
    width: 18px;
    height: 18px;
}

/* 3. Navigation Columns */
.footer-col h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    letter-spacing: 0.5px;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-col a {
    color: var(--text-muted);
    transition: color 0.2s ease;
    display: inline-block;
}

.footer-col a:hover {
    color: var(--primary-btn);
    transform: translateX(2px); /* Subtle slide effect */
}

/* 4. Bottom Copyright */
.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr; /* 2 columns on tablets */
        gap: 3rem;
    }
    
    .footer-brand-col {
        grid-column: span 2; /* Brand takes full width */
        text-align: center;
        align-items: center;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr; /* Stack vertically on mobile */
        gap: 2.5rem;
        text-align: center;
    }
    
    .footer-brand-col {
        grid-column: span 1;
    }
}