/* ===========================
   RETRO LANDING PAGE STYLES
   =========================== */

:root {
    --cream: #F5F5DC;
    --black: #0A0A0A;
    --gray: #4A4A4A;
    --accent: #2A2A2A;

    /* Light mode colors (default) */
    --bg-color: var(--cream);
    --text-color: var(--black);
    --border-color: var(--black);
    --shadow-color: var(--black);
    --card-bg: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] {
    --bg-color: #241C11;
    --text-color: #E8E8D0;
    --border-color: #E8E8D0;
    --shadow-color: #E8E8D0;
    --card-bg: rgba(232, 232, 208, 0.05);
}

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

body {
    font-family: 'VT323', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 20px;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===========================
   THEME TOGGLE BUTTON
   =========================== */

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    cursor: pointer;
    padding: 8px;
    z-index: 1000;
    transition: all 0.3s ease;
    box-shadow: 4px 4px 0 var(--shadow-color);
}

.theme-toggle:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 var(--shadow-color);
}

.theme-icon {
    width: 100%;
    height: 100%;
    display: block;
    transition: opacity 0.3s ease;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* ===========================
   HERO SECTION
   =========================== */

.hero {
    text-align: center;
    padding: 60px 0 80px;
    border-bottom: 3px dashed var(--border-color);
    margin-bottom: 60px;
}

.glitch-text {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(1.2rem, 5vw, 2rem);
    letter-spacing: 2px;
    margin-bottom: 30px;
    animation: fadeIn 1s ease-in;
}

.subtitle-container {
    font-size: 24px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2px;
}

.subtitle {
    min-height: 30px;
}

.cursor {
    animation: blink 1s infinite;
    font-weight: bold;
}

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

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

/* ===========================
   SECTIONS
   =========================== */

.section {
    animation: slideIn 0.8s ease-out;
    margin-bottom: 20px;
}

.section:has(.section-content:not(.collapsed)) {
    margin-bottom: 60px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-title {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(1rem, 3vw, 1.5rem);
    margin-bottom: 30px;
    position: relative;
    display: inline-block;
}

.collapsible-header {
    cursor: pointer;
    user-select: none;
    transition: opacity 0.3s ease;
}

.collapsible-header:hover {
    opacity: 0.7;
}

.collapse-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
    transform-origin: center;
    transform: rotate(90deg);
}

.collapsible-header.collapsed .collapse-arrow {
    transform: rotate(0deg);
}

.section-content {
    max-height: 5000px;
    overflow: visible;
    transition: max-height 0.5s ease, opacity 0.3s ease, padding-bottom 0.5s ease;
    opacity: 1;
    padding-bottom: 40px;
}

.section-content.collapsed {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding-bottom: 0;
}

.loading-dots::after {
    content: '';
    animation: dots 3s infinite;
}

/* Stagger the animation start for different sections */
.about .loading-dots::after {
    animation-delay: 0s;
}

.projects .loading-dots::after {
    animation-delay: 1s;
}

.contact .loading-dots::after {
    animation-delay: 2s;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

.content-box {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    padding: 30px;
    box-shadow: 8px 8px 0 var(--shadow-color);
}

.content-box p {
    margin-bottom: 20px;
    font-size: 22px;
}

.content-box p:last-of-type {
    margin-bottom: 0;
}

/* ===========================
   ABOUT SECTION
   =========================== */

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 25px !important;
}

.tag {
    background: var(--text-color);
    color: var(--bg-color);
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    font-size: 18px;
    transition: all 0.3s ease;
    cursor: default;
}

.tag:hover {
    background: var(--bg-color);
    color: var(--text-color);
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 var(--shadow-color);
}

/* ===========================
   PROJECTS SECTION
   =========================== */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.project-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    padding: 25px;
    padding-bottom: 70px;
    transition: all 0.3s ease;
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translate(-4px, -4px);
    box-shadow: 8px 8px 0 var(--shadow-color);
}

.project-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 16px;
    margin-bottom: 15px;
    line-height: 1.8;
    transform: scaleY(1.4);
    transform-origin: left top;
}

.project-desc {
    font-size: 20px;
    margin-bottom: 20px;
    line-height: 1.5;
    flex-grow: 1;
}

.project-link {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: inline-block;
    color: var(--text-color);
    text-decoration: none;
    border: 2px solid var(--border-color);
    padding: 10px 20px;
    background: var(--bg-color);
    transition: all 0.3s ease;
    font-size: 18px;
}

.project-link:hover {
    background: var(--text-color);
    color: var(--bg-color);
    transform: translateX(4px);
}

.coming-soon {
    cursor: default;
    opacity: 0.6;
}

.coming-soon:hover {
    background: var(--bg-color);
    color: var(--text-color);
    transform: none;
}

/* ===========================
   CONTACT SECTION
   =========================== */

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 25px;
}

.contact-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 22px;
    border: 2px solid var(--border-color);
    padding: 12px 24px;
    background: var(--bg-color);
    transition: all 0.3s ease;
    display: inline-block;
}

.contact-link:hover {
    background: var(--text-color);
    color: var(--bg-color);
    transform: translateY(-3px);
    box-shadow: 6px 6px 0 var(--shadow-color);
}

.bracket {
    font-weight: bold;
}

/* ===========================
   FOOTER
   =========================== */

.footer {
    text-align: center;
    padding: 40px 0 20px;
    border-top: 3px dashed var(--border-color);
    margin-top: 80px;
    font-size: 18px;
    opacity: 0.7;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 768px) {
    .theme-toggle {
        width: 35px;
        height: 35px;
        top: 15px;
        right: 15px;
        padding: 6px;
    }

    .container {
        padding: 30px 15px;
    }

    .hero {
        padding: 40px 0 50px;
    }

    .glitch-text {
        font-size: 1.2rem;
    }

    .subtitle-container {
        font-size: 20px;
    }

    .section {
        margin-bottom: 60px;
    }

    .section-title {
        font-size: 1rem;
    }

    .content-box {
        padding: 20px;
    }

    .content-box p {
        font-size: 20px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .contact-links {
        flex-direction: column;
    }

    .contact-link {
        width: 100%;
        text-align: center;
    }

    .tag {
        font-size: 16px;
        padding: 6px 12px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 18px;
    }

    .glitch-text {
        font-size: 1rem;
        letter-spacing: 1px;
    }

    .subtitle-container {
        font-size: 18px;
    }

    .section-title {
        font-size: 0.9rem;
    }

    .project-title {
        font-size: 14px;
    }
}

/* ===========================
   SCROLL ANIMATIONS
   =========================== */

@media (prefers-reduced-motion: no-preference) {
    .section {
        opacity: 0;
        animation: slideIn 0.8s ease-out forwards;
    }

    .section:nth-child(2) { animation-delay: 0.2s; }
    .section:nth-child(3) { animation-delay: 0.4s; }
    .section:nth-child(4) { animation-delay: 0.6s; }
}
