/* Main Website Styles */
:root {
    --bg-color: #F0EEE6;
    --text-color: #333;
    --accent-color: #666;
    --nav-bg: rgba(240, 238, 230, 0.95);
    --transition-speed: 0.3s;
}

:root.dark {
    --bg-color: #1a1a1a;
    --text-color: #fff;
    --accent-color: #ff4444;
    --nav-bg: rgba(26, 26, 26, 0.95);
}

html {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

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

@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@300;400;500;600;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@900&display=swap');

body {
    font-family: 'Roboto Mono', monospace;
    background: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    transition: background var(--transition-speed) ease, color var(--transition-speed) ease;
    cursor: crosshair;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.hero-container {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
}

.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 20px 40px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    background: var(--bg-color);
    backdrop-filter: none;
    gap: 40px;
}

.nav-logo {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: -1px;
    line-height: 0.8;
    transition: color var(--transition-speed) ease;
}

.nav-center {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-item {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 400;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color var(--transition-speed);
    position: relative;
}

.nav-item:hover {
    color: #004225;
}

.nav-item:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
}

.artifact-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.artifact {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

.artifact.active {
    opacity: 1;
}

.hero-content {
    text-align: center;
    z-index: 10;
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.glitch-title {
    font-size: clamp(2.5rem, 6vw, 6rem);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #004225;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    font-family: 'Poppins', sans-serif;
    min-height: 1.2em;
    -webkit-text-stroke: 1px #004225;
    text-stroke: 1px #004225;
    font-stretch: ultra-expanded;
    outline: none;
    border-radius: 8px;
}

.glitch-title:hover,
.glitch-title:focus {
    transform: scale(1.05);
    outline: none;
}

.click-hint {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-top: -10px;
    margin-bottom: 20px;
    font-style: italic;
}

.cta-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.cta-button {
    padding: 15px 40px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all var(--transition-speed);
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    outline: none;
}

.cta-button:hover,
.cta-button:focus {
    background: var(--accent-color);
    color: #fff;
    transform: translateY(-2px);
}

.cta-button:focus {
    outline: 3px solid var(--accent-color);
    outline-offset: 4px;
}

.spark-magic {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.2rem;
    color: #000000;
    background: transparent;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition-speed) ease;
    padding: 15px 30px;
    border-radius: 25px;
    border: none;
    outline: none;
    align-self: flex-end;
    margin-right: 60px;
}

.spark-magic:hover,
.spark-magic:focus {
    transform: scale(1.05);
    outline: none;
}

/* ASCII Flow Styles */
.ascii-container {
    font-family: 'Courier New', monospace;
    line-height: 0.85;
    letter-spacing: 0.05em;
    color: rgba(51, 51, 51, 0.85);
    user-select: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Canvas Styles */
.canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.canvas-container canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Performance indicator */
.performance-info {
    position: fixed;
    bottom: 20px;
    left: 20px;
    font-size: 0.7rem;
    opacity: 0.5;
    z-index: 1001;
    pointer-events: none;
}

/* Error fallback */
.error-fallback {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    font-size: 1.2rem;
    opacity: 0.6;
}

/* Projects Section */
.projects-section {
    min-height: 100vh;
    padding: 80px 40px 40px;
    background: var(--bg-color);
    position: relative;
    z-index: 100;
}

/* CREATE Section Styling */
.create-section {
    padding: 80px 40px;
    background: var(--bg-color);
    position: relative;
}

.create-header {
    margin-bottom: 60px;
}

.create-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -1px;
    color: var(--text-color);
    text-align: left;
    margin-bottom: 15px;
}

.create-subtitle {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 400;
    margin: 0;
    text-align: left;
}

.projects-header {
    margin-bottom: 60px;
}

.projects-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -1px;
    color: var(--text-color);
    text-align: left;
}

.projects-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.project-item {
    border-top: 1px solid rgba(51, 51, 51, 0.4);
    border-bottom: 1px solid rgba(51, 51, 51, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    list-style: none;
    margin-top: -1px;
}

.project-item:first-child {
    margin-top: 0;
}

.project-item:hover {
    background: #004225;
    color: white;
    transform: translateX(10px);
}

.project-item.open {
    background: transparent;
    color: var(--text-color);
}

.project-header {
    padding: 15px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 400;
    font-size: 1.2rem;
}

.project-title {
    transition: color 0.3s ease;
    font-weight: 500;
}

.project-year {
    font-size: 1rem;
    opacity: 0.8;
    font-weight: 300;
}

.project-content {
    display: none;
    padding: 20px 10px 40px 10px;
    color: var(--text-color);
    background: transparent;
}

.project-item.open .project-content {
    display: block;
}

.project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.project-description {
    font-size: 0.95rem;
    line-height: 1.7;
}

.project-description h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-color);
}

.project-description p {
    margin-bottom: 20px;
}

.project-link {
    color: var(--accent-color);
    text-decoration: underline;
    font-weight: 600;
    transition: color var(--transition-speed);
}

.project-link:hover {
    color: #004225;
}

.project-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    max-width: 300px;
}

.project-image {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(51, 51, 51, 0.1);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    opacity: 0.7;
    border: 1px solid rgba(51, 51, 51, 0.2);
    transition: all var(--transition-speed);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: pointer;
}

.project-image:hover {
    background: rgba(51, 51, 51, 0.2);
    transform: translateY(-2px);
}

/* When images are loaded, hide the text */
.project-image.has-image {
    color: transparent;
}

/* Status badges */
.project-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 10px;
}

.status-pivoted {
    background: rgba(255, 165, 0, 0.2);
    color: #ff6b35;
}

.status-ongoing {
    background: rgba(0, 255, 0, 0.2);
    color: #00cc44;
}

.status-case-study {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
}

.status-award {
    background: rgba(255, 215, 0, 0.2);
    color: #ff8c00;
}

/* Contact Section */
.contact-section {
    min-height: 50vh;
    padding: 80px 40px;
    background: var(--bg-color);
}

.contact-header {
    margin-bottom: 60px;
}

.contact-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -1px;
    color: var(--text-color);
    text-align: left;
}

.contact-buttons {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.contact-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.2rem;
    color: var(--text-color);
    background: transparent;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition-speed) ease;
    padding: 15px 30px;
    border-radius: 25px;
    border: none;
    outline: none;
    text-decoration: none;
    font-family: 'Roboto Mono', monospace;
}

.contact-button:hover,
.contact-button:focus {
    transform: scale(1.05);
    outline: none;
}


/* Dark theme adjustments */
:root.dark .project-item {
    border-top-color: rgba(255, 255, 255, 0.4);
    border-bottom-color: rgba(255, 255, 255, 0.4);
}

:root.dark .project-image {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

:root.dark .project-image:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .nav-bar {
        padding: 15px 20px;
        gap: 20px;
    }
    
    .nav-center {
        gap: 20px;
    }
    
    .nav-item {
        font-size: 0.8rem;
        padding: 12px 16px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .glitch-title {
        font-size: clamp(2rem, 8vw, 4rem);
        margin-bottom: 30px;
    }

    .spark-magic {
        margin-right: 20px;
        font-size: 1rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .cta-button {
        padding: 12px 30px;
        font-size: 0.85rem;
    }

    .click-hint {
        font-size: 0.7rem;
    }

    .contact-section {
        padding: 60px 20px;
    }

    .contact-title {
        font-size: 2rem;
    }

    .contact-buttons {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .contact-button {
        font-size: 1rem;
        padding: 12px 25px;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .projects-section {
        padding: 60px 20px 40px;
    }

    .projects-title {
        font-size: 2rem;
    }

    .project-header {
        padding: 12px 5px;
        font-size: 1.1rem;
    }

    .project-content {
        padding: 15px 5px 30px 5px;
    }

}

@media (max-width: 480px) {
    .nav-bar {
        padding: 10px 15px;
    }

    .nav-logo {
        font-size: 1rem;
    }

    .glitch-title {
        font-size: clamp(1.8rem, 10vw, 3rem);
    }

    .card-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.7);
    }

    .card-icon {
        width: 60px;
        height: 60px;
    }

    .icon-svg {
        width: 30px;
        height: 30px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --accent-color: #0066cc;
    }
    
    .glitch-title {
        -webkit-text-stroke: 2px #000;
        text-stroke: 2px #000;
    }
}