/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
    /* Fonts */
    --font-mono: "JetBrains Mono", monospace;
    --font-sans: "DM Sans", sans-serif;
    --font-serif: "Libre Baskerville", serif;

    /* DEVCNX Theme (Dark) - Default */
    --teal: #00DADD;
    --teal-dim: rgba(0, 218, 221, 0.15);
    --teal-glow: rgba(0, 218, 221, 0.3);
    --dark: #001117;
    --panel: #161B22;
    --border: #222;
    --border-lite: #1a1a1a;
    --text: #FFFFFF;
    --dim: #666;
    --sub-text: #888;
    --light-bg: #FAFAFA;
    --light-text: #1A1A1A;
    --light-sub: #525252;
    --light-card: #FFFFFF;
    --light-border: #E5E5E5;
    --light-border-lite: #F0F0F0;
    --light-panel: #F5F5F5;
    --grid-size: 48px;
    --bg-color: #001117;
    --text-color: #FFFFFF;
    --card-bg: #161B22;
    --nav-bg: rgba(0, 17, 23, 0.95);
    --grid-line: rgba(255, 255, 255, 0.05);
    --error: #ff6b6b;
    --success: #00DADD;
    --success-studio: #00858a;
    --error-studio: #c0392b;
    --hover-light: #EFEFEF;
    --theme-indicator: '●';
}

/* Studio Theme (Light) */
.theme-studio {
    --bg-color: #FAFAFA;
    --text-color: #1A1A1A;
    --sub-text: #525252;
    --card-bg: #FFFFFF;
    --nav-bg: rgba(250, 250, 250, 0.95);
    --border: #E5E5E5;
    --border-lite: #F0F0F0;
    --panel: #FFFFFF;
    --text: #1A1A1A;
    --dim: #888;
    --grid-size: 48px;
    --theme-indicator: '○';
    --grid-line: rgba(0, 0, 0, 0.05);
    --scanlines: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 0, 0, 0.03) 2px, rgba(0, 0, 0, 0.03) 4px);
}

/* Theme transition */
:root, .theme-studio {
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

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

body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-mono);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    position: relative;
    background-color: var(--dark);
}

/* ===== SKIP LINK ===== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    background: var(--teal);
    color: var(--dark);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 10000;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* ===== SCHEMATIC GRID ===== */
.grid-bg {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
    background-size: var(--grid-size) var(--grid-size);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 20%, transparent 100%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

.schematic-grid {
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
}

/* ===== AMBIENT GLOW ===== */
.glow-orb {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 218, 221, 0.06) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
    animation: pulse-glow 6s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.15);
    }
}

/* ===== SCANLINE EFFECT ===== */
.scanlines {
    position: fixed;
    inset: 0;
    background: var(--scanlines);
    pointer-events: none;
    z-index: 2;
}

/* ===== ENTRANCE ANIMATIONS ===== */
.fade-up {
    opacity: 0;
    transform: translateY(16px);
    animation: fadeUp 0.8s ease forwards;
}

.fade-up:nth-child(1) { animation-delay: 0.1s; }
.fade-up:nth-child(2) { animation-delay: 0.3s; }
.fade-up:nth-child(3) { animation-delay: 0.5s; }
.fade-up:nth-child(4) { animation-delay: 0.65s; }
.fade-up:nth-child(5) { animation-delay: 0.8s; }
.fade-up:nth-child(6) { animation-delay: 0.9s; }

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== STATUS COMPONENTS ===== */
.status-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--sub-text);
    margin-bottom: 1.2rem;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--teal);
    animation: blink 2s step-end infinite;
    box-shadow: 0 0 6px var(--teal-glow);
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* ===== NAVIGATION ===== */
.global-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    height: 60px;
    display: flex;
    align-items: center;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logos {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.devcnx-logo {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: 0.1em;
    color: var(--text-color);
    text-decoration: none;
}

.logo-mono { color: var(--text-color); }
.logo-accent { color: var(--teal); }

.studio-logo {
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 1rem;
    color: var(--sub-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.studio-logo::before {
    content: "●";
    color: var(--teal);
    font-size: 0.8rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--sub-text);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s ease;
    position: relative;
}

.nav-link:hover { color: var(--text-color); }
.nav-link.active { color: var(--text-color); }

.nav-link::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--teal);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

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

.nav-cta {
    background: var(--teal);
    color: var(--dark);
    padding: 0.5rem 1.2rem;
    border-radius: 0;
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.2s ease;
}

.nav-cta:hover {
    background: rgba(0, 218, 221, 0.9);
    transform: translateY(-1px);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 999;
}

.mobile-menu.active {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: all !important;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.mobile-menu a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.75rem 0.5rem;
    border-radius: 0;
    transition: background 0.2s ease;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

.mobile-menu a:hover { background: var(--teal-dim); }

.mobile-menu a.nav-cta {
    display: block;
    background: var(--teal);
    color: var(--dark) !important;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    margin-top: 0.5rem;
    padding: 0.75rem 0.5rem;
    border-bottom: none;
}

.mobile-menu a.nav-cta:hover {
    background: rgba(0, 218, 221, 0.9);
    color: var(--dark) !important;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--teal);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.4rem 0.6rem;
    line-height: 1;
    transition: border-color 0.2s ease, background 0.2s ease;
    font-family: var(--font-mono);
}

.mobile-menu-toggle:hover {
    border-color: var(--teal);
    background: var(--teal-dim);
}

.mobile-menu-toggle[aria-expanded="true"] {
    border-color: var(--teal);
    background: var(--teal-dim);
}

/* Responsive Navigation */
@media (max-width: 768px) {
    .nav-links, .nav-utilities { display: none; }
    .mobile-menu-toggle { display: block; }
    .brand-logos { gap: 1rem; }
    .devcnx-logo { font-size: 1rem; }
    .studio-logo { font-size: 0.9rem; }
}

/* ===== CTA BUTTON ===== */
.cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--teal);
    color: var(--dark);
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: var(--font-mono);
    height: 44px;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 218, 221, 0.3);
}

.cta-btn.secondary {
    background: transparent;
    border: 1px solid var(--teal);
    color: var(--teal);
}

.cta-btn.secondary:hover {
    background: rgba(0, 218, 221, 0.1);
}

.cta-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 280px;
    margin-top: 1.5rem;
}

/* ===== CARDS ===== */
.card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 1.25rem;
    width: 100%;
    text-align: left;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease, transform 0.2s ease;
    flex: 0 0 auto;
}

.card:hover { border-color: var(--teal); }

.card.featured {
    border-color: var(--teal);
    background: rgba(0, 218, 221, 0.03);
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    height: 1.5rem;
}

.card-desc {
    font-size: 0.8rem;
    line-height: 1.5;
    margin: 0 0 0.75rem;
    flex-grow: 1;
    min-height: 3rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
}

.card-link {
    color: var(--teal);
    text-decoration: none;
}

.card-link:hover {
    color: var(--teal);
    text-decoration: underline;
}

.card-price {
    color: var(--teal);
    font-weight: 600;
}

.card-status {
    color: var(--teal);
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

.card-meta-label {
    color: inherit;
    font-size: 0.8rem;
}

/* Studio card overrides */
.split-half.studio .card {
    background: var(--text);
    border: 1px solid var(--light-border);
    border-radius: 8px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.split-half.studio .card:hover {
    border-color: #4a4a4a;
}

.split-half.studio .card.featured {
    background: rgba(0, 218, 221, 0.05);
    border-color: var(--teal);
}

.split-half.studio .card-title {
    font-size: 1.1rem;
    font-weight: 500;
}

.split-half.studio .card-desc {
    font-size: 0.9rem;
    color: var(--light-sub);
}

.split-half.studio .card-meta {
    border-top-color: var(--light-border);
    color: var(--light-sub);
}

.split-half.studio .card-link { color: var(--teal); }
.split-half.studio .card-link:hover { color: var(--teal); text-decoration: underline; }

/* Studio CTA overrides */
.split-half.studio .cta-btn {
    border-radius: 8px;
    font-family: var(--font-sans);
}

.split-half.studio .cta-btn.secondary {
    border-radius: 8px;
}

/* ===== FOOTER ===== */
body.has-fixed-footer {
    padding-bottom: 72px;
}

@media (min-width: 768px) {
    body.has-fixed-footer {
        padding-bottom: 60px;
    }
}

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.7rem;
    color: var(--dim);
    border-top: 1px solid var(--border);
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    z-index: 999;
    gap: 0.25rem;
}

@media (min-width: 768px) {
    .site-footer {
        flex-direction: row;
        gap: 0;
    }
}

.site-footer .footer-devcnx {
    font-family: var(--font-mono);
    white-space: nowrap;
}

.site-footer .footer-separator {
    display: none;
}

@media (min-width: 768px) {
    .site-footer .footer-separator {
        display: inline;
        margin: 0 1rem;
        opacity: 0.3;
    }
}

.site-footer .footer-studio {
    font-family: var(--font-sans);
    font-style: italic;
    white-space: nowrap;
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.mt-075 { margin-top: 0.75rem; }
.mb-1 { margin-bottom: 1rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .status-panel {
        padding: 1.4rem 1.2rem;
    }
    .meta-row {
        flex-direction: column;
        align-items: flex-start;
    }
}