:root {
    /* Theme: Dark (Executive) */
    --bg-deep: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.4);
    --card-border: rgba(255, 255, 255, 0.1);
    --accent-primary: #60a5fa;
    --accent-secondary: #a855f7;
    --text-main: #f8fafc;
    --text-dim: #cbd5e1;
    /* Lightened from #94a3b8 for better legibility */
    --glass-overlay: rgba(15, 23, 42, 0.75);
    /* Darkened for contrast */
    --hero-height: 85vh;
}

[data-theme="light"] {
    --bg-deep: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(15, 23, 42, 0.1);
    --accent-primary: #2563eb;
    --accent-secondary: #7c3aed;
    --text-main: #0f172a;
    --text-dim: #334155;
    /* Darkened for light mode contrast */
    --glass-overlay: rgba(255, 255, 255, 0.85);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.5s ease;
}

h1,
h2,
h3 {
    font-family: 'Outfit', sans-serif;
}

/* --- Navigation --- */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 2rem;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--card-border);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- Hero Carousel --- */
.hero-container {
    position: relative;
    height: var(--hero-height);
    width: 100%;
    overflow: hidden;
    margin-top: 0;
    /* Nav is transparent over it or fixed, handled by padding usually but here we want full sticking */
}

.carousel-track {
    height: 100%;
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    /* General Overlay */
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    padding: 4rem 3rem;
    background: var(--glass-overlay);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 2rem;
    border: 1px solid var(--card-border);
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: heroIn 0.8s ease-out;
}

@keyframes heroIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content h1,
.hero-content h2 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    margin-bottom: 1rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text-main);
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    /* Legibility shadow */
}

/* Accessibility: Visually hidden but accessible to screen readers */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hero-content p {
    font-size: 1.35rem;
    color: var(--text-dim);
    margin-bottom: 2.5rem;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    /* Legibility shadow */
}

/* Carousel Controls */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: white;
}

.prev-btn {
    left: 2rem;
}

.next-btn {
    right: 2rem;
}

.carousel-dots {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.8rem;
    z-index: 20;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s;
}

.dot.active {
    background: white;
    transform: scale(1.2);
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border-radius: 3rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    cursor: pointer;
    border: none;
    font-size: 1.1rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    filter: brightness(1.1);
}

/* --- Registry Section --- */
.section-registry {
    max-width: 1400px;
    margin: 6rem auto;
    padding: 0 2rem;
}

.registry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 4rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 2rem;
}

.registry-header h2 {
    font-size: 2.5rem;
    letter-spacing: -0.02em;
}

.filters {
    display: flex;
    gap: 1rem;
}

.filter-btn {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-dim);
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 1.5rem;
    padding: 2.5rem;
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-8px);
    background: rgba(30, 41, 59, 0.6);
    border-color: var(--accent-primary);
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-primary);
    border: 1px solid rgba(96, 165, 250, 0.2);
    margin-bottom: 1.5rem;
    width: fit-content;
}

.card h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.card p {
    color: var(--text-dim);
    margin-bottom: 2rem;
    flex-grow: 1;
}

/* --- Status Dots --- */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dim);
    opacity: 0.9;
}

.dot-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* --- Theme Switcher --- */
.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s;
}

.theme-toggle:hover {
    background: var(--accent-primary);
    color: white;
}

/* --- Footer --- */
footer {
    padding: 4rem 2rem 2rem;
    text-align: center;
    border-top: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.2);
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: var(--bg-deep);
    color: var(--text-main);
    text-align: center;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 10;
    bottom: 130%;
    left: 50%;
    margin-left: -125px;
    opacity: 0;
    transition: opacity 0.3s;
    border: 1px solid var(--accent-primary);
    font-size: 0.85rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.tooltip-container:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.footer-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--accent-primary);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.footer-btn:hover {
    border-color: var(--accent-primary);
    background: rgba(96, 165, 250, 0.1);
}

.bottom-row {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-dim);
    opacity: 0.7;
}

/* Container Query Support for Debug Testing */
#page-wrapper {
    container-type: inline-size;
    container-name: page;
}

/* Container Query: Mobile Styles (for debug viewport switcher) */
@container page (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .hero-content {
        padding: 2rem 1.5rem;
        width: 90%;
        max-width: 100%;
    }

    .hero-content h1,
    .hero-content h2 {
        font-size: 2rem;
    }

    nav {
        padding: 1rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .prev-btn {
        left: 0.5rem;
    }

    .next-btn {
        right: 0.5rem;
    }

    .registry-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .filters {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
}

/* Media Query: Mobile Styles (for real devices) */
@media (max-width: 768px) {

    /* Fix Grid Overflow: Force single column that fits viewport */
    .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Fix Carousel Card Width */
    .hero-content {
        padding: 2rem 1.5rem;
        width: 90%;
        max-width: 100%;
    }

    /* Scale Down Typhography */
    .hero-content h1,
    .hero-content h2 {
        font-size: 2rem;
        /* Reduced from 2.5rem to fit 375px */
    }

    /* Fix Navigation Scaling */
    nav {
        padding: 1rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    /* Scale Down Buttons */
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .prev-btn {
        left: 0.5rem;
    }

    .next-btn {
        right: 0.5rem;
    }

    /* Adjust Registry Header for Mobile */
    .registry-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    /* Fix Filter Buttons: Wrap and Scale */
    .filters {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
    }
}