@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400&display=swap');

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

body {
    font-family: 'Source Code Pro', monospace;
    background: #000;
    color: #fff;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    overflow-x: hidden;
}

/* --- Particle Background --- */
.bg-container {
    --mouse-x: 0;
    --mouse-y: 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.bg-container span {
    position: absolute;
    border-radius: 100%;
    background: rgba(80, 120, 100, 0.8);
    filter: blur(120px);
    transition: transform 0.3s ease-out;
    margin-top: calc(var(--mouse-y) * 5px);
    margin-left: calc(var(--mouse-x) * 5px);
}

@keyframes float {
    0%   { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(120px, -50px) scale(1.4); }
    40%  { transform: translate(-80px, 100px) scale(0.6); }
    60%  { transform: translate(40px, 150px) scale(1.8); }
    75%  { transform: translate(-130px, -20px) scale(0.4); }
    90%  { transform: translate(20px, 40px) scale(1.1); }
    100% { transform: translate(0, 0) scale(1); }
}

.bg-container span:nth-child(1)  { width: 120px; height: 120px; top: 15%; left: 10%; animation: float 89s infinite ease-in-out; animation-delay: -12s; opacity: 0.4; }
.bg-container span:nth-child(2)  { width: 350px; height: 350px; top: 60%; left: 70%; animation: float 197s infinite ease-in-out; animation-delay: -45s; opacity: 0.2; }
.bg-container span:nth-child(3)  { width: 80px;  height: 80px;  top: 40%; left: 85%; animation: float 131s infinite ease-in-out; animation-delay: -92s; opacity: 0.1; }
.bg-container span:nth-child(4)  { width: 180px; height: 180px; top: 5%;  left: 55%; animation: float 67s infinite ease-in-out;  animation-delay: -3s;   opacity: 0.3; }
.bg-container span:nth-child(5)  { width: 240px; height: 240px; top: 80%; left: 20%; animation: float 251s infinite ease-in-out; animation-delay: -110s; opacity: 0.2; }
.bg-container span:nth-child(6)  { width: 50px;  height: 50px;  top: 30%; left: 40%; animation: float 103s infinite ease-in-out; animation-delay: -58s; opacity: 0.5; }
.bg-container span:nth-child(7)  { width: 290px; height: 290px; top: 10%; left: 75%; animation: float 163s infinite ease-in-out; animation-delay: -140s; opacity: 0.15; }
.bg-container span:nth-child(8)  { width: 40px;  height: 40px;  top: 90%; left: 60%; animation: float 73s infinite ease-in-out;  animation-delay: -22s; opacity: 0.4; }
.bg-container span:nth-child(9)  { width: 160px; height: 160px; top: 50%; left: 5%;  animation: float 227s infinite ease-in-out; animation-delay: -88s; opacity: 0.25; }
.bg-container span:nth-child(10) { width: 210px; height: 210px; top: 25%; left: 35%; animation: float 149s infinite ease-in-out; animation-delay: -175s; opacity: 0.2; }

/* --- Header --- */
.site-header {
    width: 100%;
    padding: 24px 16px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.site-header h1 {
    font-size: 32px;
    font-weight: 400;
    letter-spacing: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* --- Folder (Main Card) - Transparent Glass Effect --- */
.folder {
    width: min(95%, 1842px);
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    z-index: 1;

    /* Glassmorphism with dynamic tab color tint */
    background: linear-gradient(
        135deg,
        rgba(20, 20, 20, 0.4),
                                color-mix(in srgb, var(--active-tab-color, #8a8a91) 8%, rgba(20, 20, 20, 0.4))
    );
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: background 0.9s ease;
}

/* --- Tab Bar --- */
.tab-bar {
    display: flex;
    gap: 0;
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 4px 0 4px;
}

.tab {
    flex: 1;
    padding: 24px 16px;
    font-family: inherit;
    font-size: 20px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.tab:hover:not(.locked) {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-bottom: 2px solid var(--tab-color);
    text-shadow: 0 0 8px var(--tab-color);
}

/* --- Locked Tab Styles --- */
.tab.locked {
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 2px solid transparent;
    filter: grayscale(0.8) brightness(0.7);
}

.tab.locked:hover {
    background: rgba(0, 0, 0, 0.2); /* No hover effect */
    color: rgba(255, 255, 255, 0.3);
}

/* Optional: Add a subtle lock icon or overlay */
.tab.locked::after {
    content: "🔒";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
    pointer-events: none;
}

/* --- Content Area --- */
.content-area {
    background: rgba(15, 15, 15, 0.6);
    flex: 1;
    padding: 32px;
    border-radius: 0 0 10px 10px;
    min-height: 400px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    overflow-y: auto; /* ENABLE SCROLLING HERE */
    overflow-x: hidden;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #444 #151515; /* thumb track */
}

.content-area::-webkit-scrollbar {
    width: 8px;
}
.content-area::-webkit-scrollbar-track {
    background: #151515;
}
.content-area::-webkit-scrollbar-thumb {
    background-color: #444;
    border-radius: 4px;
}
.content-area::-webkit-scrollbar-thumb:hover {
    background-color: #666;
}

.tab-content {
    display: none;
    font-size: 20px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    gap: 32px;
}

.tab-content a:link {
    color: #fff;
    text-decoration: none;
    text-align: center;
}

.tab-content a:visited {
    color: #fff;
    text-decoration: none;
    text-align: center;
}

.tab-content img {
    padding-top: 1rem;
    padding-bottom: 2rem;
    padding-left: 1rem;
    max-width: 100%;
    max-height: 40%;
    height: auto;
}

.tab-content.active {
    display: grid;
    grid-template-columns: 1fr 1fr;
    animation: fadeIn 0.8s ease;
}

/* Targets direct children divs inside the tab content wrapper */
.tab-content > div {
    margin-left: 1rem;       /* Space between items */
    padding-left: 1rem;      /* Space before the line */
    padding-right: 1rem;
    border-left: 1px solid rgba(128, 128, 128, 0.2); /* Faint line */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .tab-content.active {
        grid-template-columns: 1fr;
    }
}

/* --- Footer --- */
.site-footer {
    width: 100%;
    padding: 24px 16px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.site-footer p {
    font-size: 18px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.6);
}

/* ... (keep existing particle and layout styles) ... */
/* ... (existing styles) ... */

/* --- Welcome Screen --- */
.welcome {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 1rem;
    background: #000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.8s ease, visibility 1.8s ease;
    padding: 20px;
}

.welcome.show {
    opacity: 1;
    visibility: visible;
}

.welcome h1 {
    font-family: 'Source Code Pro', monospace;
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 400;
    color: #fff;
    letter-spacing: 0.05em;
    transform: scale(0.95);
    transition: transform 1.8s ease;
    align-self: center;
}

.welcome.show h1 {
    transform: scale(1);
}

/* Definition block: left-aligned, constrained width */
.welcome .definition {
    text-align: left;
    max-width: 480px;
    align-self: center;
}

.welcome h3 {
    font-family: 'Source Code Pro', monospace;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.1em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1s ease 0.8s, transform 1s ease 0.8s;
}

.welcome.show h3 {
    opacity: 1;
    transform: translateY(0);
}

.welcome h2 {
    font-family: 'Source Code Pro', monospace;
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.08em;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1s ease 0.6s, transform 1s ease 0.6s;
}

.welcome.show h2 {
    opacity: 1;
    transform: translateY(0);
}

.welcome p {
    font-family: 'Source Code Pro', monospace;
    font-size: clamp(0.8rem, 2vw, 1.1rem);
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 1s ease 1.2s, transform 1s ease 1.2s;
}

.welcome.show p {
    opacity: 1;
    transform: translateY(0);
}

.welcome.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.site-header,
.folder,
.site-footer {
    opacity: 0;
    transition: opacity 1s ease 0.6s;
}

body.revealed .site-header,
body.revealed .folder,
body.revealed .site-footer {
    opacity: 1;
}

/* ... (existing styles) ... */

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    /* 1. Typography & Spacing */
    body {
        font-size: 16px; /* Base font size */
        padding: 0 16px;
    }

    .site-header h1 {
        font-size: 24px;
        margin-bottom: 16px;
    }

    .folder {
        width: 100%;
        border-radius: 8px;
        overflow: hidden;
    }

    /* 2. Tab Bar: Scrollable Horizontal Strip */
    .tab-bar {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px 8px 0 8px;
        gap: 8px;
        background: rgba(0, 0, 0, 0.3);
        /* Hide scrollbar but keep functionality */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
        white-space: nowrap;
    }

    .tab-bar::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .tab {
        flex: 0 0 auto; /* Don't shrink, don't grow */
        width: 140px; /* Fixed width for scroll */
        min-width: 120px;
        padding: 16px 12px;
        font-size: 16px;
        border-radius: 8px;
        margin-bottom: 0; /* Remove bottom margin if any */
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        gap: 4px;
    }

    .tab p:last-child {
        font-size: 12px;
        opacity: 0.8;
    }

    /* 3. Content Area */
    .content-area {
        padding: 20px;
        min-height: 300px;
    }

    .tab-content {
        font-size: 16px;
        line-height: 1.5;
    }

    /* 4. Welcome Screen */
    .welcome h1 {
        font-size: 2rem; /* Smaller on mobile */
    }

    /* 5. Performance: Reduce particles on mobile */
    /* Hide the heaviest particles to save battery/GPU */
    .bg-container span:nth-child(2),
    .bg-container span:nth-child(5),
    .bg-container span:nth-child(7) {
        opacity: 0.05; /* Make them barely visible */
        filter: blur(160px); /* Blur more to hide detail */
    }

    /* Reduce total count if needed, but opacity is cheaper */
}

/* Very small screens (iPhone SE, etc) */
@media (max-width: 400px) {
    .tab {
        width: 100px;
        font-size: 14px;
    }
    .tab p:last-child {
        display: none; /* Hide subtitle on tiny screens */
    }
}
