/* archaic.studio - Scandinavian dark-neon design */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #121218;
    --neon-cyan: #00f0ff;
    --neon-magenta: #e930ff;
    --text-primary: #d4cfc6;
    --text-secondary: #6b6b78;
    --border-color: #1e1e2a;
    --code-bg: #1a1a24;
    --left-panel-width: 38vw;
    --right-panel-width: 62vw;
    --content-max-width: 540px;
    --content-left-margin: 6vw;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.0625rem;
    line-height: 1.85;
    letter-spacing: 0.01em;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

a {
    color: var(--neon-cyan);
    text-decoration: none;
}

code {
    font-family: 'IBM Plex Mono', monospace;
    background-color: var(--code-bg);
    border-left: 2px solid var(--neon-cyan);
    padding: 0.15em 0.5em;
    font-size: 0.9em;
}

/* ============================================
   Left Panel (Fixed)
   ============================================ */
.left-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--left-panel-width);
    height: 100vh;
    background-color: var(--bg-primary);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 2.5rem;
    z-index: 10;
    overflow: hidden;
}

/* ============================================
   Organic Blobs
   ============================================ */
.blob {
    position: absolute;
    border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;
    filter: blur(40px);
    pointer-events: none;
}

.blob-primary {
    width: 300px;
    height: 300px;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center, rgba(0, 240, 255, 0.08) 0%, rgba(233, 48, 255, 0.03) 70%, transparent 100%);
    animation: morphBlob 18s ease-in-out infinite;
}

.blob-secondary {
    width: 150px;
    height: 150px;
    top: 15%;
    right: 10%;
    background: radial-gradient(ellipse at center, rgba(233, 48, 255, 0.06) 0%, rgba(0, 240, 255, 0.03) 70%, transparent 100%);
    animation: morphBlob 26s ease-in-out infinite reverse;
}

@keyframes morphBlob {
    0%   { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; transform: translateX(-50%) scale(1) rotate(0deg); }
    25%  { border-radius: 55% 45% 35% 65% / 60% 30% 70% 40%; transform: translateX(-50%) scale(1.04) rotate(3deg); }
    50%  { border-radius: 38% 62% 55% 45% / 35% 65% 45% 55%; transform: translateX(-50%) scale(0.97) rotate(-2deg); }
    75%  { border-radius: 65% 35% 42% 58% / 50% 50% 38% 62%; transform: translateX(-50%) scale(1.02) rotate(1deg); }
    100% { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; transform: translateX(-50%) scale(1) rotate(0deg); }
}

@keyframes morphBlobSecondary {
    0%   { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; transform: scale(1) rotate(0deg); }
    25%  { border-radius: 55% 45% 35% 65% / 60% 30% 70% 40%; transform: scale(1.04) rotate(3deg); }
    50%  { border-radius: 38% 62% 55% 45% / 35% 65% 45% 55%; transform: scale(0.97) rotate(-2deg); }
    75%  { border-radius: 65% 35% 42% 58% / 50% 50% 38% 62%; transform: scale(1.02) rotate(1deg); }
    100% { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; transform: scale(1) rotate(0deg); }
}

.blob-secondary {
    animation: morphBlobSecondary 26s ease-in-out infinite reverse;
}

.blob-pulse {
    animation-duration: 0.8s;
    animation-name: blobPulse;
    animation-timing-function: ease-in-out;
}

@keyframes blobPulse {
    0%   { filter: blur(40px) brightness(1); }
    50%  { filter: blur(40px) brightness(1.3); }
    100% { filter: blur(40px) brightness(1); }
}

/* ============================================
   Wordmark
   ============================================ */
.wordmark {
    position: relative;
    z-index: 2;
}

.wordmark-text {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: lowercase;
    letter-spacing: 0.02em;
}

.cursor {
    display: inline-block;
    width: 0.7em;
    height: 1.2em;
    background-color: var(--neon-cyan);
    vertical-align: text-bottom;
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

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

/* ============================================
   Navigation
   ============================================ */
.nav {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    position: relative;
    z-index: 2;
}

.nav-link {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    position: relative;
    display: inline-block;
    width: fit-content;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--neon-cyan);
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-link:hover {
    color: var(--neon-cyan);
}

.nav-link:hover::after {
    width: 108%;
}

/* ============================================
   UTC Timestamp
   ============================================ */
.timestamp {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    position: relative;
    z-index: 2;
}

/* ============================================
   Panel Divider
   ============================================ */
.panel-divider {
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(to bottom, var(--neon-cyan), transparent 50%, var(--neon-magenta));
    opacity: 0.4;
}

/* ============================================
   Right Panel (Scrollable)
   ============================================ */
.right-panel {
    margin-left: var(--left-panel-width);
    width: var(--right-panel-width);
    min-height: 100vh;
    background-color: var(--bg-secondary);
    position: relative;
}

/* ============================================
   Grid Dots Overlay
   ============================================ */
.grid-dots {
    position: fixed;
    top: 0;
    left: var(--left-panel-width);
    width: var(--right-panel-width);
    height: 100vh;
    background-image: radial-gradient(circle, var(--border-color) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.5;
}

/* ============================================
   Sections
   ============================================ */
.section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.section-opening {
    align-items: flex-start;
}

.section-content {
    max-width: var(--content-max-width);
    margin-left: var(--content-left-margin);
    padding: 2rem 0;
}

/* ============================================
   Hero Statement
   ============================================ */
.hero-statement {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(2rem, 4.5vw, 3.8rem);
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    word-spacing: 0.15em;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.metadata-line {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* ============================================
   Section Labels
   ============================================ */
.section-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--neon-cyan);
    margin-bottom: 3rem;
}

/* ============================================
   Body Text
   ============================================ */
.body-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.0625rem;
    font-weight: 400;
    line-height: 1.85;
    letter-spacing: 0.01em;
    color: var(--text-primary);
    max-width: 65ch;
}

/* ============================================
   Runic Dividers
   ============================================ */
.runic-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8rem 0;
    position: relative;
    z-index: 2;
    margin-left: var(--content-left-margin);
}

.runic-divider-inline {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 0;
    position: relative;
    z-index: 2;
    margin-left: var(--content-left-margin);
    max-width: var(--content-max-width);
}

.runic-glyph {
    width: 80px;
    height: 40px;
    color: var(--neon-cyan);
    opacity: 0.3;
}

.runic-divider-inline .runic-glyph {
    width: 60px;
    height: 30px;
}

/* ============================================
   Projects
   ============================================ */
.project {
    margin-bottom: 6rem;
}

.project-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    word-spacing: 0.15em;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.project-description {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.0625rem;
    line-height: 1.85;
    color: var(--text-primary);
    max-width: 65ch;
    margin-bottom: 0.75rem;
}

.project-meta {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* ============================================
   Contact Section
   ============================================ */
.contact-email {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    text-transform: none;
    letter-spacing: 0.02em;
    color: var(--neon-cyan);
    margin-bottom: 1.5rem;
    word-break: break-all;
}

.contact-location {
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 3rem;
}

.contact-closing {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.0625rem;
    line-height: 1.85;
    color: var(--text-primary);
    max-width: 65ch;
}

/* ============================================
   Footer Space
   ============================================ */
.footer-space {
    height: 20vh;
}

/* ============================================
   Bounce-Enter Animation
   ============================================ */
@keyframes bounceIn {
    0%  { opacity: 0; transform: translateY(40px); }
    60% { opacity: 1; transform: translateY(-6px); }
    80% { transform: translateY(2px); }
    100% { transform: translateY(0); }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
}

.animate-on-scroll.visible {
    animation: bounceIn 650ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: calc(var(--stagger-index, 0) * 100ms);
}

.runic-divider.visible .runic-glyph,
.runic-divider-inline.visible .runic-glyph {
    animation: runicFadeIn 800ms ease-out forwards;
}

.runic-divider .runic-glyph,
.runic-divider-inline .runic-glyph {
    opacity: 0;
    transform: scale(0.8);
}

@keyframes runicFadeIn {
    0%   { opacity: 0; transform: scale(0.8); }
    100% { opacity: 0.3; transform: scale(1); }
}

/* ============================================
   Mobile Header
   ============================================ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--bg-primary);
    z-index: 100;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.wordmark-mobile .wordmark-text {
    font-size: 1.2rem;
}

.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ============================================
   Mobile Nav Overlay
   ============================================ */
.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-primary);
    z-index: 99;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
}

.mobile-nav-link {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-primary);
    opacity: 0;
    transform: translateY(40px);
}

.mobile-nav-overlay.active .mobile-nav-link {
    animation: bounceIn 650ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: calc(var(--stagger-index, 0) * 60ms);
}

.mobile-nav-link:hover {
    color: var(--neon-cyan);
}

/* ============================================
   Mobile Responsive (below 768px)
   ============================================ */
@media (max-width: 768px) {
    :root {
        --left-panel-width: 0;
        --right-panel-width: 100vw;
        --content-left-margin: 1.5rem;
        --content-max-width: calc(100vw - 3rem);
    }

    .left-panel {
        display: none;
    }

    .mobile-header {
        display: flex;
    }

    .mobile-nav-overlay {
        display: flex;
    }

    .right-panel {
        margin-left: 0;
        width: 100%;
        padding-top: 60px;
    }

    .grid-dots {
        left: 0;
        width: 100%;
        opacity: 0.3;
    }

    .hero-statement {
        font-size: clamp(1.5rem, 7vw, 2.5rem);
    }

    .project-title {
        font-size: clamp(1.25rem, 5vw, 1.8rem);
    }

    .contact-email {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
    }

    .runic-divider,
    .runic-divider-inline {
        margin-left: 0;
        justify-content: center;
        width: 100%;
    }

    .section {
        min-height: 80vh;
    }

    .section-opening {
        min-height: 100vh;
        padding-top: 60px;
    }
}

/* ============================================
   Contact section warm shift
   ============================================ */
.section-contact .section-label {
    color: var(--neon-magenta);
}