:root {
    --bg-color: #0d0d0d;
    --panel-bg: rgba(20, 20, 20, 0.7);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --accent-ruby: #e0115f;
    --accent-crimson: #990000;
    --gradient: linear-gradient(135deg, #e0115f, #990000);
    --font-heading: 'Play', sans-serif;
    --font-body: 'Play', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.6);
    --glass-bg: rgba(20, 20, 20, 0.4);
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --panel-bg: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.08);
    --text-primary: #121212;
    --text-secondary: #4a4a4a;
    --accent-ruby: #cc0000;
    --accent-crimson: #880000;
    --gradient: linear-gradient(135deg, #cc0000, #880000);
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
    --glass-bg: rgba(255, 255, 255, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* High-Fidelity Scrollbar System */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-ruby) rgba(15, 15, 15, 0.5);
}

/* Chrome, Edge, and Safari */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(15, 15, 15, 0.5);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-ruby) 0%, #ff1a75 100%);
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(204, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb:hover {
    background: #ff1a75;
    box-shadow: 0 0 15px rgba(204, 0, 0, 0.4);
}

/* Light Mode Scrollbar Overrides */
[data-theme="light"] ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ff1a75 0%, #cc0000 100%);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 50% -20%, var(--panel-bg) 0%, var(--bg-color) 100%);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    /* Institutional Security */
    -webkit-user-select: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* UI Controls */
.top-controls {
    position: absolute;
    top: 2rem;
    right: 2rem;
    display: flex;
    gap: 1rem;
    z-index: 100;
}

.control-btn {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.control-btn:hover {
    transform: translateY(-3px) scale(1.05);
    border-color: var(--accent-ruby);
    box-shadow: 0 4px 12px rgba(224, 17, 95, 0.3);
}

.control.day-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    cursor: pointer;
    /* Ensure transition matches hover for smooth reverse */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.4s ease,
        border-color 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 160px;
    /* Override glass-panel animation conflict after load */
    transform: translateY(0);
}

.day-card:hover {
    /* Force expansion with !important to override any cascading animation states */
    transform: translateY(-12px) scale(1.08) !important;
    z-index: 10;
    border-color: var(--accent-ruby);
    box-shadow: 0 20px 40px rgba(204, 0, 0, 0.3);
}

/* Glassmorphism Panel */
@keyframes slideUpFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.glass-panel {
    background: linear-gradient(-45deg, rgba(20, 20, 20, 0.6), rgba(224, 17, 95, 0.05), rgba(20, 20, 20, 0.6), rgba(153, 0, 0, 0.05));
    background-size: 400% 400%;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow-premium);
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    animation: slideUpFade 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards, gradientBG 15s ease infinite;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s ease, box-shadow 0.4s ease;
}

.glass-panel:hover {
    transform: translateY(-10px) scale(1.02) !important;
    border: 2px solid var(--accent-ruby);
    box-shadow: 0 0 30px rgba(224, 17, 95, 0.4);
    z-index: 5;
}

/* Hero Section */
.hero {
    padding: 4rem 2rem 2rem;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.premium-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -2px;
}

/* Scroll Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: var(--accent-ruby);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(224, 17, 95, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #ff1a75;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(224, 17, 95, 0.6);
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 3rem;
}

/* Identity Grid - Redesigned for Premium Sync */
.hero-identity-grid {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
    margin-top: 1rem;
}

.profile-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    position: relative;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 220px;
}

.profile-unit:hover {
    transform: translateY(-5px) scale(1.05) !important;
    background: rgba(224, 17, 95, 0.05);
    border-color: var(--accent-ruby);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.author-pill {
    display: flex;
    flex-direction: column;
    /* Profile Image on top of name */
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-primary);
    margin-bottom: 1.2rem;
}

.author-pill img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--accent-ruby);
    box-shadow: 0 0 15px rgba(224, 17, 95, 0.3);
    transition: all 0.5s ease;
}

.profile-unit:hover img {
    transform: rotate(5deg) scale(1.1);
    box-shadow: 0 0 25px rgba(224, 17, 95, 0.6);
}

.author-pill span {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

.repo-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent-ruby);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 10px rgba(224, 17, 95, 0.3);
}

.repo-btn:hover {
    background: #ff1a75;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(224, 17, 95, 0.5);
}

/* Stats */
.hero-stats-merge {
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 20px;
}

.stats-top-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.stat-unit {
    text-align: left;
}

.stat-unit.align-right {
    text-align: right;
}

.stat-check-icon,
.stat-cert-icon {
    color: #4cd964;
    /* Scientific Green */
}

.stat-check-icon {
    color: #4cd964;
    /* Scientific Green */
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-ruby);
}

#mastery-count {
    color: var(--accent-ruby) !important;
    font-size: 2.2rem;
    /* Substantial Cinematic Scale */
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.stat-footer-label {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stats-animation-track {
    position: relative;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 2rem 0;
}

.stats-ruby-icon {
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translate(-50%, -50%);
    background: transparent;
    /* Remove square bg */
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100 !important;
    /* Ensure clickability */
}

.stats-ruby-icon img {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 0 8px rgba(224, 17, 95, 0.6));
    transition: all 0.3s ease;
}

/* Custom Tooltip */
.stats-ruby-icon::after {
    content: "Click to Replay Analysis";
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.stats-ruby-icon:hover::after {
    opacity: 1;
}

.stats-ruby-icon:hover img {
    transform: scale(1.2) rotate(15deg);
    filter: drop-shadow(0 0 15px var(--accent-ruby));
}

/* Projects Section */
.section-title {
    text-align: center;
    font-size: 2.8rem;
    margin-bottom: 4rem;
    letter-spacing: -1px;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-bottom: 5rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 2rem;
    /* Ensure transition matches hover for smooth reverse */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.4s ease,
        border-color 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    height: 100%;
    /* Override glass-panel animation conflict after load */
    transform: translateY(0);
}

.project-card:hover {
    /* Force expansion with !important to override any cascading animation states */
    transform: translateY(-12px) scale(1.05) !important;
    border-color: var(--accent-ruby);
    background: rgba(224, 17, 95, 0.03);
    box-shadow: 0 20px 40px rgba(204, 0, 0, 0.3);
    z-index: 10;
}

.project-icon-wrapper {
    width: 90px;
    height: 90px;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, rgba(224, 17, 95, 0.1), rgba(153, 0, 0, 0.2));
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    color: var(--accent-ruby);
    border: 1px solid rgba(224, 17, 95, 0.2);
    transition: all 0.4s ease;
}

.project-card:hover .project-icon-wrapper {
    transform: rotate(-5deg) scale(1.1);
    background: var(--accent-ruby);
    color: white;
    box-shadow: 0 0 20px var(--accent-ruby);
}

.project-icon-wrapper img,
.project-icon-wrapper svg {
    width: 55px;
    height: 55px;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.project-card:hover .project-icon-wrapper svg {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.project-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.project-card p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    flex-grow: 1;
    line-height: 1.6;
}

.project-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    width: 100%;
}

.view-btn, .play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    flex: 1;
}

.view-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary) !important;
}

.view-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    border-color: var(--text-secondary);
}

.play-btn {
    background: var(--accent-ruby);
    color: white !important;
    box-shadow: 0 4px 15px rgba(224, 17, 95, 0.3);
}

.play-btn:hover {
    background: #ff1a75;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(224, 17, 95, 0.5);
}

/* Curriculum Section */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--accent-ruby);
    color: white;
    border-color: var(--accent-ruby);
}

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

.day-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    cursor: pointer;
    /* Ensure transition matches hover for smooth reverse */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        box-shadow 0.4s ease,
        border-color 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 160px;
    /* Override glass-panel animation conflict after load */
    transform: translateY(0);
}

.day-card:hover {
    /* Force expansion with !important to override any cascading animation states */
    transform: translateY(-12px) scale(1.08) !important;
    z-index: 10;
    border-color: var(--accent-ruby);
    box-shadow: 0 20px 40px rgba(204, 0, 0, 0.3);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.mastery-pulse {
    width: 10px;
    height: 10px;
    background: var(--accent-ruby);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-ruby);
    animation: breathing 2s infinite ease-in-out;
}

.day-number {
    font-size: 0.8rem;
    color: var(--accent-ruby);
    font-weight: 700;
}

.day-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

.day-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
}

.category-tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    background: rgba(204, 0, 0, 0.1);
    color: var(--accent-ruby);
    border-radius: 4px;
    font-weight: 700;
}

.file-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Archive Modal Container */
#archive-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 3000;
    /* Increased z-index */
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
}

/* Archive Explorer Specifics */
.archive-explorer {
    margin: 0 auto;
    background: #1a1a1a;
    /* Hardcoded fallback background */
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.9);
    width: 90%;
    max-width: 1200px;
    height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Removed all animations for stability */
    transform: translateZ(0);
    /* GPU reset */
}

.archive-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.archive-info h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.breadcrumb {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.archive-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background: var(--accent-ruby);
    color: white;
    transform: translateY(-2px);
}

[data-theme="light"] .icon-btn {
    background: rgba(0, 0, 0, 0.05);
    color: #1a1a1a;
}

[data-theme="light"] .icon-btn:hover {
    background: var(--gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(204, 0, 0, 0.2);
}

[data-theme="light"] .breadcrumb {
    color: #333;
    font-weight: 600;
}

.close-archive {
    font-size: 2.5rem;
    margin-left: 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.close-archive:hover {
    color: var(--accent-ruby);
}

/* Main Archive Explorer Structure */
.archive-body {
    flex-grow: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}

.file-sidebar {
    width: 250px;
    border-right: 1px solid var(--border-color);
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    overflow-y: auto;
}

[data-theme="light"] .file-sidebar {
    background: #f8f8f8;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    font-weight: 700;
}

.sidebar-header .badge {
    background: #00ff88;
    /* Vibrant Emerald for contrast */
    color: #000;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
    transition: all 0.3s ease;
}

.file-list {
    list-style: none !important;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.folder-label {
    padding: 12px 8px 4px 8px;
    font-size: 0.72rem;
    color: var(--accent-ruby);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
    background: rgba(224, 17, 95, 0.05);
    border-radius: 4px;
    margin-top: 8px;
}

[data-theme="light"] .folder-label {
    background: rgba(204, 0, 0, 0.05);
    color: #880000;
}

.folder-label i {
    font-size: 0.8rem;
}

.file-item.nested {
    margin-left: 12px;
    width: calc(100% - 12px);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 0 10px 10px 0;
}

.file-item {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    /* Changed from center to handle wrapping better */
    gap: 8px;
    /* Reduced gap */
    background: rgba(255, 255, 255, 0.02);
    width: 100%;
    box-sizing: border-box;
}

.file-item span {
    white-space: normal;
    /* Allow wrapping to show full name */
    word-break: break-all;
    flex-grow: 1;
    line-height: 1.4;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    /* Removed translateX to save space */
}

[data-theme="light"] .file-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.file-item.active {
    background: linear-gradient(90deg, rgba(204, 0, 0, 0.15) 0%, rgba(204, 0, 0, 0.05) 100%);
    color: var(--accent-ruby);
    font-weight: 700;
    border-left: 4px solid var(--accent-ruby);
    box-shadow: inset 0 0 15px rgba(204, 0, 0, 0.05);
}

[data-theme="light"] .file-item.active {
    background: linear-gradient(90deg, rgba(204, 0, 0, 0.08) 0%, rgba(204, 0, 0, 0.02) 100%);
}

@keyframes activePulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }

    100% {
        opacity: 1;
    }
}

.file-item i {
    font-size: 1rem;
    width: 16px;
    text-align: center;
    margin-top: 3px;
    /* Align icon with top of wrapping text */
}

.code-viewer {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #0d0d0d;
    position: relative;
    /* For absolute positioning of hint */
    min-width: 0;
}

[data-theme="light"] .code-viewer {
    background: #f0f0f0;
    /* Light Grey background as requested */
}

.code-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-theme="light"] .code-header {
    background: #e0e0e0;
    color: #1a1a1a;
}

#archive-code-display {
    padding: 2rem !important;
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.7;
    height: 100%;
    overflow-y: auto;
    user-select: text !important;
    -webkit-user-select: text !important;
    cursor: text;
    white-space: pre !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

[data-theme="light"] #archive-code-display code {
    /* Hardening token contrast for light background */
    text-shadow: none;
    color: #24292e;
    /* GitHub-style dark grey for default text */
}

/* Precise Light Mode Token Overrides for Ruby Colors */
[data-theme="light"] .token.comment,
[data-theme="light"] .token.prolog,
[data-theme="light"] .token.doctype,
[data-theme="light"] .token.cdata {
    color: #6a737d;
}

[data-theme="light"] .token.string,
[data-theme="light"] .token.attr-value {
    color: #032f62;
    /* Deep blue for strings */
}

[data-theme="light"] .token.keyword,
[data-theme="light"] .token.selector,
[data-theme="light"] .token.attr-name {
    color: #d73a49;
    /* Ruby-ish red for keywords */
}

[data-theme="light"] .token.function,
[data-theme="light"] .token.class-name {
    color: #6f42c1;
    /* Purple for functions */
}

[data-theme="light"] .token.operator,
[data-theme="light"] .token.entity,
[data-theme="light"] .token.url {
    color: #005cc5;
}

#archive-code-display code {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    display: block;
    outline: none !important;
    box-shadow: none !important;
}

.execution-hint {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(15, 15, 15, 0.9);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(5px);
    pointer-events: none;
    z-index: 10;
}

[data-theme="light"] .execution-hint {
    background: rgba(255, 255, 255, 0.9);
    color: #444;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Mobile Responsiveness for Archive Explorer */
@media (max-width: 768px) {
    #archive-modal {
        padding: 1rem;
        /* Padding to prevent edge touching */
        align-items: center;
        /* Enforce centering on mobile too */
    }

    .archive-explorer {
        width: 100%;
        height: 90vh;
        /* Slightly smaller than full screen */
        border-radius: 20px;
        /* Keep rounded corners */
        max-width: none;
    }

    .archive-header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .archive-info {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .archive-info h3 {
        font-size: 1.2rem;
    }

    .archive-controls {
        width: 100%;
        justify-content: space-between;
    }

    .close-archive {
        position: absolute;
        top: 1rem;
        right: 1rem;
        margin: 0;
        font-size: 2rem;
    }

    .archive-body {
        flex-direction: column;
    }

    .archive-sidebar {
        width: 100%;
        height: auto;
        max-height: 120px;
        /* Reduced height for sidebar on mobile */
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 1rem;
        display: flex;
        flex-direction: column;
    }

    .file-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .file-item {
        white-space: nowrap;
        flex-shrink: 0;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .file-item.active {
        border-left: none;
        border-bottom: 3px solid var(--accent-ruby);
    }

    .archive-viewer {
        height: 100%;
    }
}


.code-container {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem;
}

.archive-footer {
    padding: 1rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 4rem 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 5rem;
}

.author-link {
    color: var(--accent-ruby);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.author-link:hover {
    color: #ff4d94;
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(255, 26, 117, 0.4);
}

.footer-branding {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.footer-branding img {
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 0 5px rgba(204, 0, 0, 0.3));
    animation: ruby-pulse 2s infinite ease-in-out;
}

.footer-branding img:hover {
    transform: scale(1.3) rotate(15deg);
    filter: drop-shadow(0 0 15px var(--accent-ruby));
    animation-play-state: paused;
}

.footer-branding img:active {
    transform: scale(0.95);
}

@keyframes ruby-pulse {

    0%,
    100% {
        filter: drop-shadow(0 0 5px rgba(204, 0, 0, 0.3));
    }

    50% {
        filter: drop-shadow(0 0 15px rgba(204, 0, 0, 0.8));
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    /* Darker backdrop */
    backdrop-filter: blur(8px);
    cursor: pointer;
    /* Hint that click-to-close works */
}

/* Ensure modal content resets cursor to prevent confusion */
.modal-content {
    cursor: default;
    max-width: 1000px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-body {
    flex-grow: 1;
    overflow-y: auto;
    background: #1e1e1e;
    border-radius: 12px;
    padding: 1rem;
}

.modal-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-btn:hover {
    color: var(--accent-ruby);
}

.close-modal {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

/* Splash Loader */
#skeleton-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.8s ease;
}

.loader-ruby-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

.loader-ruby-icon img {
    width: 96px;
    /* Cinematic Scale */
    height: 96px;
}

.loader-progress-container {
    width: 320px;
    /* Wider for balance */
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

#splash-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--accent-ruby);
    transition: width 0.4s ease;
}

.pulse-text {
    margin-top: 2rem;
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-secondary);
    animation: pulse 1.5s infinite;
    text-align: center;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

@keyframes breathing {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 5px var(--accent-ruby));
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px var(--accent-ruby));
    }
}

.loader-ruby-icon {
    animation: breathing 3s ease-in-out infinite;
}

.splash-footer {
    position: absolute;
    bottom: 3rem;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0 2rem;
}

.splash-footer p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .premium-title {
        font-size: 2.8rem;
    }

    .glass-panel {
        padding: 1.5rem;
    }

    .top-controls {
        top: 1rem;
        right: 1rem;
    }
}

/* Cinematic Easter Egg Overlay */
#easter-egg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(30, 0, 10, 0.98), #000);
    z-index: 3000;
    display: none;
    justify-content: center;
    align-items: center;
    color: #fff;
    cursor: pointer;
    /* Hint that click-to-close works */
    opacity: 0;
    transition: opacity 1s ease;
    backdrop-filter: blur(20px);
}

[data-theme="light"] #easter-egg-overlay {
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.98), #f8f8f8);
    color: #1a1a1a;
}

.easter-egg-active #easter-egg-overlay {
    display: flex;
    opacity: 1;
}

.ee-ruby-glow {
    width: 150px;
    height: 150px;
    margin-bottom: 2rem;
    filter: drop-shadow(0 0 30px var(--accent-ruby));
    animation: ee-pulse 2s infinite ease-in-out;
}

@keyframes ee-pulse {

    0%,
    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 30px var(--accent-ruby));
    }

    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 60px var(--accent-ruby));
    }
}

.ee-content {
    text-align: center;
    max-width: 800px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    /* Signify click anywhere to exit */
}

.ee-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ee-message {
    font-size: 1.25rem;
    color: var(--text-primary);
    line-height: 1.8;
    margin-bottom: 2rem;
    white-space: pre-wrap;
    /* Honor JS newlines */
}

[data-theme="light"] .ee-message {
    color: #333;
}

.ee-close-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

[data-theme="light"] .ee-close-hint {
    color: #666;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(15, 15, 15, 0.95);
    border: 1px solid var(--accent-ruby);
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-family: var(--font-body);
    font-size: 0.95rem;
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-notification i {
    color: var(--accent-ruby);
}