/* ============================================
   GLOBAL STYLES & VARIABLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #ffffff;
    --secondary: #000000;
    --accent: hwb(239 55% 29%);
    --accent-light: hwb(240 45% 38%);
    --text-primary: #ffffff;
    --text-secondary: #a1a1a1;
    --bg-primary: #000000;
    --bg-secondary: #0f0f0f;
    --border-color: #333333;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    letter-spacing: -0.01em;
    overflow-x: hidden;
}

/* ============================================
   TYPOGRAPHY & UTILITIES
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

h1 { font-size: 3rem; line-height: 1.1; }
h2 { font-size: 2rem; line-height: 1.2; }
h3 { font-size: 1.5rem; }

p {
    color: var(--text-secondary);
    line-height: 1.8;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-light);
}

.highlight {
    color: var(--accent);
    font-weight: 700;
}

.emphasis {
    color: var(--accent);
    font-weight: 600;
}

/* ============================================
   WELCOME OVERLAY
   ============================================ */

.welcome-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: overlayFadeIn 0.6s ease-out;
}

.welcome-overlay.fade-out {
    animation: overlayFadeOut 0.8s ease-out forwards;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes overlayFadeOut {
    from {
        opacity: 1;
        visibility: visible;
    }
    to {
        opacity: 0;
        visibility: hidden;
    }
}

.welcome-content {
    text-align: center;
    padding: 40px 20px;
    animation: contentSlideUp 0.8s ease-out;
}

@keyframes contentSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-header {
    margin-bottom: 40px;
}

.welcome-title {
    font-size: 3.5rem;
    margin-bottom: 12px;
    color: var(--text-primary);
    animation: textFadeIn 0.8s ease-out 0.2s both;
}

.welcome-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    animation: textFadeIn 0.8s ease-out 0.4s both;
}

@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-btn {
    background: var(--accent);
    color: var(--secondary);
    border: none;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    animation: textFadeIn 0.8s ease-out 0.6s both;
    font-family: 'Inter', sans-serif;
}

.welcome-btn:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.3);
}

.welcome-btn:active {
    transform: translateY(0);
}

/* ============================================
   MAIN CONTENT
   ============================================ */

.main-content {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
    padding: 60px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.main-content.visible {
    opacity: 1;
    visibility: visible;
    animation: contentFadeIn 0.8s ease-out;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
    margin-bottom: 100px;
    animation: sectionFadeIn 0.8s ease-out;
}

@keyframes sectionFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-left {
    display: flex;
    justify-content: center;
}

.pfp-container {
    position: relative;
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1;
}

.pfp {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    border: 2px solid var(--border-color);
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

.pfp:hover {
    border-color: var(--accent);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.2);
    transform: translateY(-4px);
}

.pfp-credit-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--secondary);
    border: none;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.pfp:hover .pfp-credit-btn {
    opacity: 1;
}

.pfp-credit-btn:hover {
    background: var(--accent-light);
    transform: scale(1.1);
}

.pfp img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-right {
    display: flex;
    flex-direction: column;
}

.hero-text {
    animation: sectionFadeIn 0.8s ease-out 0.2s both;
}

.main-title {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.intro-text {
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* ============================================
   CREDIT MODAL
   ============================================ */

.credit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: modalFadeIn 0.3s ease-out;
}

.credit-modal.visible {
    display: flex;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.credit-modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    box-shadow: var(--shadow);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.credit-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.credit-modal-close:hover {
    color: var(--accent);
}

.credit-modal-content p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 0;
}

/* ============================================
   QUICK INFO
   ============================================ */

.quick-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    font-weight: 600;
}

.info-value {
    font-size: 1.3rem;
    color: var(--accent);
    font-weight: 700;
}

/* ============================================
   SOCIAL LINKS
   ============================================ */

.social-links {
    display: flex;
    gap: 16px;
}

.social-btn {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: var(--transition);
    font-size: 1.2rem;
}

.social-btn:hover {
    background: var(--accent);
    color: var(--secondary);
    border-color: var(--accent);
    transform: translateY(-4px);
}

/* ============================================
   SECTIONS
   ============================================ */

.section-title {
    font-size: 2rem;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--accent);
}

/* ============================================
   ABOUT SECTION
   ============================================ */

.about-section {
    margin-bottom: 100px;
    animation: sectionFadeIn 0.8s ease-out 0.2s both;
}

.about-content {
    max-width: 800px;
}

.about-content p {
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.tech-tag {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: var(--transition);
    cursor: default;
}

.tech-tag:hover {
    background: var(--accent);
    color: var(--secondary);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* ============================================
   PHILOSOPHY SECTION
   ============================================ */

.philosophy-section {
    margin-bottom: 100px;
    animation: sectionFadeIn 0.8s ease-out 0.3s both;
}

.philosophy-card {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.philosophy-main {
    font-size: 1.2rem;
    line-height: 1.9;
    margin-bottom: 40px;
    color: var(--text-secondary);
}

.philosophy-quote {
    background: var(--bg-primary);
    border-left: 3px solid var(--accent);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 20px;
    position: relative;
}

.quote-text {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-secondary);
    padding-right: 40px;
    opacity: 1;
}

.quote-refresh-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quote-refresh-btn:hover {
    color: var(--accent-light);
    transform: rotate(180deg);
}

.quote-attr {
    text-align: right;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ============================================
   PROJECTS SECTION
   ============================================ */

.projects-section {
    margin-bottom: 100px;
    animation: sectionFadeIn 0.8s ease-out 0.4s both;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.project-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    transition: var(--transition);
    cursor: default;
}

.project-card:hover {
    border-color: var(--accent);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.1);
    transform: translateY(-4px);
}

.project-card h3 {
    color: var(--accent);
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.project-card p {
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ============================================
   ALIASES SECTION
   ============================================ */

.aliases-section {
    margin-bottom: 100px;
    animation: sectionFadeIn 0.8s ease-out 0.5s both;
}

.aliases-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
}

.aliases-intro {
    margin-bottom: 20px;
    font-size: 1rem;
}

.alias-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.alias-tag {
    padding: 10px 18px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: var(--transition);
    font-family: 'Fira Mono', monospace;
    font-weight: 500;
}

.alias-tag:hover {
    background: var(--accent);
    color: var(--secondary);
    border-color: var(--accent);
}

/* ============================================
   COMMUNITIES SECTION
   ============================================ */

.communities-section {
    margin-bottom: 100px;
    animation: sectionFadeIn 0.8s ease-out 0.6s both;
}

.communities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.community-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    transition: var(--transition);
    text-align: center;
}

.community-card:hover {
    border-color: var(--accent);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.1);
    transform: translateY(-4px);
}

.community-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    color: var(--accent);
}

.community-card h3 {
    color: var(--accent);
    margin-bottom: 12px;
    font-size: 1.3rem;
    text-transform: lowercase;
}

.community-card p {
    font-size: 0.95rem;
    line-height: 1.7;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 80px;
    animation: sectionFadeIn 0.8s ease-out 0.6s both;
}

.footer p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ============================================
   MUSIC PLAYER
   ============================================ */

.music-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, var(--bg-primary), rgba(15, 15, 15, 0.95));
    border-top: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    z-index: 1000;
    animation: playerSlideUp 0.4s ease-out;
}

@keyframes playerSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.player-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.player-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 0 0 auto;
    min-width: 0;
}

.player-toggle {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: var(--accent);
    color: var(--secondary);
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.player-toggle:hover {
    background: var(--accent-light);
    transform: scale(1.05);
}

.player-info {
    min-width: 200px;
}

.track-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Fira Mono', monospace;
}

.track-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.player-middle {
    display: flex;
    gap: 12px;
    flex: 0 0 auto;
}

.player-btn {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.95rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-btn:hover {
    background: var(--accent);
    color: var(--secondary);
    border-color: var(--accent);
}

.player-right {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.progress-section {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    position: relative;
    border-radius: 2px;
    transition: width 0.1s linear;
}

.time-display {
    font-size: 0.8rem;
    color: var(--text-secondary);
    min-width: 80px;
    text-align: right;
    font-family: 'Fira Mono', monospace;
    font-weight: 500;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 1.75rem; }
    
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-left {
        order: 2;
    }

    .hero-right {
        order: 1;
    }

    .quick-info {
        grid-template-columns: repeat(2, 1fr);
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .player-container {
        flex-wrap: wrap;
        padding: 12px 16px;
    }

    .player-right {
        flex-basis: 100%;
        order: 3;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 15px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    .main-content {
        padding: 40px 16px;
    }

    .hero-section,
    .about-section,
    .philosophy-section,
    .projects-section,
    .aliases-section {
        margin-bottom: 60px;
    }

    .welcome-title {
        font-size: 2.5rem;
    }

    .welcome-btn {
        padding: 12px 24px;
        font-size: 0.95rem;
    }

    .intro-text {
        font-size: 1rem;
    }

    .quick-info {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }

    .philosophy-card {
        padding: 24px;
    }

    .philosophy-main {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .player-left {
        flex-basis: 100%;
        order: 1;
    }

    .player-middle {
        order: 2;
        flex-basis: auto;
        margin-left: auto;
    }

    .player-right {
        flex-basis: 100%;
        order: 3;
        margin-top: 12px;
    }

    .player-toggle {
        width: 40px;
        height: 40px;
    }

    .player-btn {
        width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }

    .player-info {
        min-width: 150px;
    }

    .track-name {
        font-size: 0.85rem;
    }

    .tech-stack {
        gap: 10px;
    }

    .tech-tag {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .alias-tag {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* ============================================
   ACCESSIBILITY & ANIMATIONS
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   FOCUS STYLES FOR KEYBOARD NAVIGATION
   ============================================ */

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
