/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-modal: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-purple: #8b5cf6;
    --accent-purple-hover: #a78bfa;
    --accent-dark: #5b21b6;
    --border-color: #404040;
    --shadow-color: rgba(139, 92, 246, 0.2);
    --font-family: 'League Spartan', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --chocolates-family: 'TT Chocolates', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 16px;
    --vh: 1vh;
}

/* Mobile viewport height fix */
@supports (-webkit-touch-callout: none) {
    .container,
    .letter-glitch-bg {
        height: calc(var(--vh, 1vh) * 100);
        min-height: calc(var(--vh, 1vh) * 100);
    }
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    width: 100vw;
    max-width: 100vw;
}

/* Letter Glitch Background */
.letter-glitch-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    min-width: 100vw;
    z-index: 1;
    opacity: 0.4;
    overflow: hidden;
}

.container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    z-index: 10;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* Main Header with Logo */
.main-header {
    margin-bottom: 60px;
    animation: fadeInDown 0.8s ease-out;
    background: transparent;
}

.logo-container {
    position: relative;
    display: inline-block;
    background: transparent;
}

.brand-text {
    text-align: center;
    background: transparent;
    transition: var(--transition);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.brand-text:hover:not(.dissipating):not(.reappearing),
.brand-text.touch-active:not(.dissipating):not(.reappearing) {
    animation: hoverPulse 2s ease-in-out infinite;
}

.brand-text:active {
    transform: scale(0.98);
}

.yeey-text {
    font-family: var(--font-family);
    font-size: 280px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    line-height: 0.75;
    letter-spacing: -6px;
    text-shadow: 0 40px 100px var(--shadow-color);
    transition: var(--transition);
}

.launchpad-text {
    font-family: var(--chocolates-family);
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 16px 0 0 0;
    padding: 0;
    line-height: 1;
    letter-spacing: 8px;
    text-transform: uppercase;
    text-shadow: 0 10px 30px var(--shadow-color);
    transition: var(--transition);
}

/* Interactive Logo Animations */
@keyframes dissipate {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: blur(0px) brightness(1);
    }
    25% {
        opacity: 0.8;
        transform: scale(1.1) rotate(2deg);
        filter: blur(1px) brightness(1.2);
    }
    50% {
        opacity: 0.4;
        transform: scale(1.2) rotate(-1deg);
        filter: blur(3px) brightness(1.5);
    }
    75% {
        opacity: 0.1;
        transform: scale(1.4) rotate(1deg);
        filter: blur(8px) brightness(2);
    }
    100% {
        opacity: 0;
        transform: scale(1.8) rotate(0deg);
        filter: blur(15px) brightness(3);
    }
}

@keyframes reappear {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(0deg);
        filter: blur(20px) brightness(3);
    }
    25% {
        opacity: 0.3;
        transform: scale(0.6) rotate(-1deg);
        filter: blur(10px) brightness(2);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.8) rotate(1deg);
        filter: blur(5px) brightness(1.5);
    }
    75% {
        opacity: 0.9;
        transform: scale(0.95) rotate(-0.5deg);
        filter: blur(2px) brightness(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
        filter: blur(0px) brightness(1);
    }
}

@keyframes glitch {
    0%, 100% {
        text-shadow: 0 40px 100px var(--shadow-color);
    }
    10% {
        text-shadow: 
            -2px 0 var(--accent-purple),
            2px 0 #61dca3,
            0 40px 100px var(--shadow-color);
    }
    20% {
        text-shadow: 
            2px 0 var(--accent-purple),
            -2px 0 #61dca3,
            0 40px 100px var(--shadow-color);
    }
    30% {
        text-shadow: 0 40px 100px var(--shadow-color);
    }
    40% {
        text-shadow: 
            -1px 0 var(--accent-purple),
            1px 0 #2b4539,
            0 40px 100px var(--shadow-color);
    }
    50% {
        text-shadow: 0 40px 100px var(--shadow-color);
    }
    60% {
        text-shadow: 
            1px 0 #61dca3,
            -1px 0 var(--accent-purple),
            0 40px 100px var(--shadow-color);
    }
    80% {
        text-shadow: 0 40px 100px var(--shadow-color);
    }
}

.brand-text.dissipating .yeey-text {
    animation: dissipate 0.8s ease-out forwards;
}

.brand-text.dissipating .launchpad-text {
    animation: dissipate 0.8s ease-out 0.1s forwards;
}

.brand-text.reappearing .yeey-text {
    animation: reappear 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.brand-text.reappearing .launchpad-text {
    animation: reappear 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.2s forwards;
}

.brand-text.glitching .yeey-text {
    animation: glitch 0.3s ease-in-out;
}

/* Hover Pulse Animation */
@keyframes hoverPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 40px 100px var(--shadow-color));
    }
    25% {
        transform: scale(1.03);
        filter: drop-shadow(0 50px 120px rgba(139, 92, 246, 0.4));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 60px 140px rgba(139, 92, 246, 0.6));
    }
    75% {
        transform: scale(1.03);
        filter: drop-shadow(0 50px 120px rgba(139, 92, 246, 0.4));
    }
}

/* Floating Letters Effect */
@keyframes floatY {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

@keyframes floatE1 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-6px) rotate(1deg); }
    66% { transform: translateY(-12px) rotate(-0.5deg); }
}

@keyframes floatE2 {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-10px) rotate(-1deg); }
    75% { transform: translateY(-4px) rotate(0.5deg); }
}

@keyframes floatDot {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-15px) scale(1.2); }
}

/* Individual letter animations on hover and touch */
.brand-text:hover:not(.dissipating):not(.reappearing) .letter-y,
.brand-text.touch-active:not(.dissipating):not(.reappearing) .letter-y { 
    animation: floatY 1.5s ease-in-out infinite; 
}
.brand-text:hover:not(.dissipating):not(.reappearing) .letter-e1,
.brand-text.touch-active:not(.dissipating):not(.reappearing) .letter-e1 { 
    animation: floatE1 1.8s ease-in-out infinite 0.2s; 
}
.brand-text:hover:not(.dissipating):not(.reappearing) .letter-e2,
.brand-text.touch-active:not(.dissipating):not(.reappearing) .letter-e2 { 
    animation: floatE2 1.6s ease-in-out infinite 0.4s; 
}
.brand-text:hover:not(.dissipating):not(.reappearing) .letter-y2,
.brand-text.touch-active:not(.dissipating):not(.reappearing) .letter-y2 { 
    animation: floatY 1.7s ease-in-out infinite 0.3s; 
}
.brand-text:hover:not(.dissipating):not(.reappearing) .letter-dot,
.brand-text.touch-active:not(.dissipating):not(.reappearing) .letter-dot { 
    animation: floatDot 1.4s ease-in-out infinite 0.6s; 
}

/* Letter spacing consistency */
.yeey-text span {
    display: inline-block;
    transition: all 0.3s ease;
}

/* Mobile touch feedback */
@media (hover: none) and (pointer: coarse) {
    .brand-text {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
    }
    
    .nav-btn {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    /* Enhanced touch active state */
    .brand-text.touch-active {
        transform: scale(1.01);
    }
}

/* Sparkle effect overlay */
.brand-text::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    transform: translate(-50%, -50%);
    background: 
        radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.3) 2px, transparent 3px),
        radial-gradient(circle at 80% 20%, rgba(97, 220, 163, 0.3) 1px, transparent 2px),
        radial-gradient(circle at 30% 80%, rgba(139, 92, 246, 0.2) 1.5px, transparent 2.5px),
        radial-gradient(circle at 70% 70%, rgba(97, 179, 220, 0.3) 1px, transparent 2px),
        radial-gradient(circle at 90% 60%, rgba(139, 92, 246, 0.2) 2px, transparent 3px);
    opacity: 0;
    animation: sparkleRotate 8s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes sparkleRotate {
    from { transform: translate(-50%, -50%) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    to { transform: translate(-50%, -50%) rotate(360deg); opacity: 0; }
}

.brand-text:hover:not(.dissipating):not(.reappearing)::before,
.brand-text.touch-active:not(.dissipating):not(.reappearing)::before {
    opacity: 1;
}

/* Color shift on hover */
@keyframes colorShift {
    0% { color: var(--text-primary); }
    25% { color: rgba(139, 92, 246, 1); }
    50% { color: rgba(97, 220, 163, 1); }
    75% { color: rgba(97, 179, 220, 1); }
    100% { color: var(--text-primary); }
}

.brand-text:hover:not(.dissipating):not(.reappearing) .yeey-text,
.brand-text.touch-active:not(.dissipating):not(.reappearing) .yeey-text {
    animation: hoverPulse 2s ease-in-out infinite, colorShift 3s ease-in-out infinite;
}

/* Navigation Buttons */
.main-nav {
    display: flex;
    gap: 32px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
    margin-bottom: 60px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 36px;
    background: transparent;
    border: 2px solid var(--accent-purple);
    color: var(--accent-purple);
    font-family: var(--font-family);
    font-size: 18px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-width: 160px;
    justify-content: center;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.2), transparent);
    transition: var(--transition);
}

.nav-btn:hover::before {
    left: 100%;
}

.nav-btn:hover {
    background: var(--accent-purple);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 40px var(--shadow-color);
}

.nav-btn i {
    font-size: 16px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1999;
    opacity: 0;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    opacity: 0;
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: scale(1);
    opacity: 1;
}

.modal-header {
    padding: 32px 32px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.modal-header h2 {
    font-family: var(--font-family);
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-purple);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.modal-body {
    padding: 32px;
}

.modal-body p {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.modal-body p strong {
    color: var(--accent-purple);
    font-weight: 700;
}

.modal-body p em {
    color: var(--accent-purple-hover);
    font-style: italic;
}

.close {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    z-index: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
}

.close:hover {
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.1);
}

/* Projects Grid */
.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-link {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.project-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition);
    cursor: pointer;
}

.project-item:hover {
    background: var(--bg-primary);
    border-color: var(--accent-purple);
    transform: translateX(8px);
    box-shadow: 0 8px 32px var(--shadow-color);
}

.project-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-purple);
    border-radius: 12px;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.project-info {
    flex: 1;
    text-align: left;
}

.project-info h3 {
    font-family: var(--font-family);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.project-info p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.project-arrow {
    color: var(--accent-purple);
    font-size: 16px;
    transition: var(--transition);
    flex-shrink: 0;
}

.project-item:hover .project-arrow {
    transform: translateX(4px);
    color: var(--accent-purple-hover);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Mobile Viewport Fixes */
@media screen and (max-width: 768px) {
    html {
        width: 100vw;
        overflow-x: hidden;
    }
    
    body {
        padding: 0;
        width: 100vw;
        height: 100vh;
        min-height: -webkit-fill-available; /* iOS Safari fix */
        position: fixed;
        top: 0;
        left: 0;
    }
    
    .letter-glitch-bg {
        width: 100vw;
        height: 100vh;
        min-height: -webkit-fill-available; /* iOS Safari fix */
        position: fixed;
        top: 0;
        left: 0;
    }
    
    .container {
        padding: 8px 12px 60px 12px;
        width: 100vw;
        height: 100vh;
        min-height: -webkit-fill-available; /* iOS Safari fix */
        position: fixed;
        top: 0;
        left: 0;
        justify-content: space-between;
    }
    
    .main-content {
        transform: translateY(-20px);
    }
    
    .main-header {
        margin-bottom: 30px;
    }
    
    .yeey-text {
        font-size: 160px;
        letter-spacing: -4px;
        line-height: 0.75;
    }
    
    .launchpad-text {
        font-size: 12px;
        letter-spacing: 4px;
        margin-top: 16px;
    }
    
    .main-nav {
        flex-direction: column;
        gap: 16px;
        width: 100%;
        max-width: 300px;
        margin-bottom: 16px;
    }
    
    .nav-btn {
        padding: 16px 24px;
        font-size: 16px;
        min-width: auto;
        width: 100%;
    }
    
    .modal-content {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .modal-header {
        padding: 24px 24px 0;
    }
    
    .modal-header h2 {
        font-size: 24px;
    }
    
    .modal-body {
        padding: 24px;
    }
    
    .modal-body p {
        font-size: 16px;
    }
    
    .project-item {
        padding: 20px;
    }
    
    .project-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .project-info h3 {
        font-size: 18px;
    }
    
    .site-footer {
        padding: 20px 0;
        transform: translateY(-10px);
    }
    
    .logo-loop-wrapper {
        margin-bottom: 12px;
    }
    
    .copyright p {
        font-size: 11px;
    }
    
    .creator-credit {
        font-size: 10px !important;
        margin-top: 6px !important;
    }
}

@media screen and (max-width: 480px) {
    html {
        width: 100vw;
        height: 100vh;
        overflow: hidden;
    }
    
    body {
        width: 100vw;
        height: 100vh;
        min-height: -webkit-fill-available;
        position: fixed;
        padding: 0;
        margin: 0;
    }
    
    .letter-glitch-bg {
        width: 100vw;
        height: 100vh;
        min-height: -webkit-fill-available;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
    }
    
    .container {
        width: 100vw;
        height: 100vh;
        min-height: -webkit-fill-available;
        position: fixed;
        top: 0;
        left: 0;
        padding: 6px 8px 50px 8px;
        justify-content: space-between;
    }
    
    .yeey-text {
        font-size: 120px;
        letter-spacing: -3px;
        line-height: 0.7;
    }
    
    .launchpad-text {
        font-size: 10px;
        letter-spacing: 3px;
        margin-top: 16px;
    }
}
    
    .nav-btn {
        padding: 14px 20px;
        font-size: 14px;
    }
    
    .modal-header h2 {
        font-size: 20px;
        letter-spacing: 1px;
    }
    
    .project-item {
        flex-direction: row;
        gap: 16px;
        padding: 16px;
    }
    
    .project-info h3 {
        font-size: 16px;
    }
    
    .project-info p {
        font-size: 12px;
    }
    
    .main-content {
        transform: translateY(-30px);
    }
    
    .site-footer {
        padding: 16px 0;
        transform: translateY(-15px);
    }
    
    .main-header {
        margin-bottom: 16px;
    }
    
    .main-nav {
        margin-bottom: 12px;
        gap: 14px;
    }
    
    .copyright p {
        font-size: 10px;
    }
    
    .creator-credit {
        font-size: 9px !important;
        margin-top: 4px !important;
    }
}

/* Custom Scrollbar */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--accent-purple);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple-hover);
}

/* Footer Styles */
.site-footer {
    width: 100%;
    padding: 20px 0;
    z-index: 5;
    animation: fadeInUp 1s ease-out 0.8s both;
    flex-shrink: 0;
}

.logo-loop-wrapper {
    margin-bottom: 16px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.logo-loop-wrapper:hover {
    opacity: 1;
}

.copyright {
    text-align: center;
}

.copyright p {
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
    margin: 0;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.copyright p:hover {
    opacity: 1;
}

.creator-credit {
    margin-top: 8px !important;
    font-size: 11px !important;
    opacity: 0.6 !important;
}

.creator-credit:hover {
    opacity: 0.9 !important;
}

.heart {
    color: var(--accent-purple);
    font-size: 12px;
    display: inline-block;
    animation: heartbeat 2s ease-in-out infinite;
}

.creator-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.creator-link:hover {
    color: var(--accent-purple);
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}

.creator-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-purple);
    transition: width 0.3s ease;
}

.creator-link:hover::after {
    width: 100%;
}

@keyframes heartbeat {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.1); 
    }
}