/* Membrane Template — Future-Medieval Acid Portfolio
   No sidebar. Full-screen nav overlay. Full-bleed content. */

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

:root {
    --primary-color: #E8E0D4;
    --secondary-color: #8A8078;
    --accent-color: #8B5CF6;
    --background-color: #0A0A0F;
    --text-color: #C8C0B4;
    --text-light-color: #5A5550;
    --border-color: #1E1E28;
    --muted-color: #6B6560;

    --glow-violet: #8B5CF6;
    --glow-magenta: #EC4899;
    --glow-amber: #F59E0B;
    --glow-gradient: linear-gradient(135deg, var(--glow-violet), var(--glow-magenta), var(--glow-amber));

    --text-dark-color: #D4CCC0;
    --separator-color: #2A2A35;
    --hover-color: #F0E8DC;
    --placeholder-bg: #12121A;
    --form-bg: #111118;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'UnifrakturCook', cursive;
    --base-font-size: 15px;

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;
    --spacing-4xl: 80px;

    --glow-sm: 0 0 8px rgba(139, 92, 246, 0.2), 0 0 2px rgba(236, 72, 153, 0.1);
    --glow-md: 0 0 20px rgba(139, 92, 246, 0.3), 0 0 6px rgba(236, 72, 153, 0.15), 0 0 40px rgba(139, 92, 246, 0.08);
    --glow-lg: 0 0 30px rgba(139, 92, 246, 0.35), 0 0 10px rgba(236, 72, 153, 0.2), 0 0 60px rgba(139, 92, 246, 0.1), 0 0 4px rgba(245, 158, 11, 0.1);
}

body {
    font-family: var(--font-family);
    font-size: var(--base-font-size);
    line-height: 1.7;
    color: var(--text-color);
    background:
        radial-gradient(ellipse at 70% 5%, rgba(139, 92, 246, 0.12) 0%, transparent 45%),
        radial-gradient(ellipse at 20% 90%, rgba(236, 72, 153, 0.08) 0%, transparent 45%),
        radial-gradient(ellipse at 90% 60%, rgba(245, 158, 11, 0.04) 0%, transparent 35%),
        var(--background-color);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

/* ==============================
   ATMOSPHERIC — Scanlines + floating orb
   ============================== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9998;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(139, 92, 246, 0.012) 3px,
        rgba(139, 92, 246, 0.012) 4px
    );
}

body::after {
    content: '';
    position: fixed;
    top: 5%;
    right: 5%;
    width: 500px;
    height: 500px;
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(236, 72, 153, 0.08) 30%, transparent 65%);
    filter: blur(80px);
    animation: ambientDrift 25s ease-in-out infinite alternate;
}

@keyframes ambientDrift {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(-80px, 40px) scale(1.15); }
    66% { transform: translate(30px, -30px) scale(0.9); }
    100% { transform: translate(-20px, 60px) scale(1.05); }
}

/* ==============================
   BRAND MARK — Fixed top-left, blackletter
   ============================== */
.brand-mark {
    position: fixed;
    top: 28px;
    left: 40px;
    z-index: 200;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    text-shadow: 0 0 30px rgba(139, 92, 246, 0.15);
    transition: text-shadow 0.4s ease;
    line-height: 1;
}

.brand-mark:hover {
    text-shadow: 0 0 50px rgba(139, 92, 246, 0.5), 0 0 100px rgba(236, 72, 153, 0.2);
    color: var(--primary-color);
}

.brand-mark img {
    max-height: 32px;
    width: auto;
    display: block;
}

/* ==============================
   NAV TRIGGER — Ritual gate button
   ============================== */
.nav-trigger {
    position: fixed;
    top: 24px;
    right: 100px;
    z-index: 200;
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid rgba(139, 92, 246, 0.2);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    transition: all 0.4s ease;
}

.nav-trigger:hover {
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: var(--glow-sm);
}

.nav-trigger .trigger-line {
    display: block;
    width: 20px;
    height: 1.5px;
    background: var(--primary-color);
    transition: all 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
    box-shadow: 0 0 4px rgba(139, 92, 246, 0.15);
}

/* X state when overlay is open */
.nav-trigger.active {
    border-color: rgba(139, 92, 246, 0.8);
    box-shadow: var(--glow-md);
}

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

.nav-trigger.active .trigger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

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

/* ==============================
   NAV OVERLAY — Full-screen ritual
   ============================== */
.nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(10, 10, 15, 0.97);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    /* Scanlines on the overlay */
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 4px,
        rgba(139, 92, 246, 0.015) 4px,
        rgba(139, 92, 246, 0.015) 5px
    );
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* Enormous blackletter nav links */
.nav-link-huge {
    font-family: var(--font-display);
    font-size: 68px;
    color: var(--secondary-color);
    text-decoration: none;
    transition: all 0.4s ease;
    position: relative;
    cursor: pointer;
    display: inline-block;
    line-height: 1.15;
}

.nav-link-huge:hover {
    color: var(--primary-color);
    text-shadow:
        0 0 60px rgba(139, 92, 246, 0.5),
        0 0 120px rgba(139, 92, 246, 0.2),
        -4px 0 0 rgba(139, 92, 246, 0.3),
        4px 0 0 rgba(236, 72, 153, 0.25);
    transform: scale(1.03);
}

.nav-link-huge.active {
    color: var(--primary-color);
}

.nav-link-huge.active::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 2px;
    background: var(--glow-gradient);
    box-shadow: var(--glow-sm);
}

/* Staggered entrance animation */
.nav-overlay.active .nav-link-huge,
.nav-overlay.active .nav-group {
    animation: navSlideIn 0.5s cubic-bezier(0.215, 0.61, 0.355, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

.nav-overlay.active .nav-link-huge:nth-child(1),
.nav-overlay.active .nav-group:nth-child(1) { animation-delay: 0.05s; }
.nav-overlay.active .nav-link-huge:nth-child(2),
.nav-overlay.active .nav-group:nth-child(2) { animation-delay: 0.1s; }
.nav-overlay.active .nav-link-huge:nth-child(3),
.nav-overlay.active .nav-group:nth-child(3) { animation-delay: 0.15s; }
.nav-overlay.active .nav-link-huge:nth-child(4),
.nav-overlay.active .nav-group:nth-child(4) { animation-delay: 0.2s; }
.nav-overlay.active .nav-link-huge:nth-child(5),
.nav-overlay.active .nav-group:nth-child(5) { animation-delay: 0.25s; }
.nav-overlay.active .nav-link-huge:nth-child(6),
.nav-overlay.active .nav-group:nth-child(6) { animation-delay: 0.3s; }
.nav-overlay.active .nav-link-huge:nth-child(7),
.nav-overlay.active .nav-group:nth-child(7) { animation-delay: 0.35s; }
.nav-overlay.active .nav-link-huge:nth-child(8),
.nav-overlay.active .nav-group:nth-child(8) { animation-delay: 0.4s; }

@keyframes navSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page groups in nav */
.nav-group {
    text-align: center;
}

.nav-group-trigger {
    user-select: none;
}

.nav-sub-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.3s ease;
    margin-top: 0;
}

.nav-sub-links.open {
    max-height: 400px;
    opacity: 1;
    margin-top: 8px;
}

.nav-link-sub {
    font-family: var(--font-family);
    font-size: 18px;
    color: var(--muted-color);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    padding: 4px 0;
}

.nav-link-sub:hover {
    color: var(--primary-color);
    text-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
    letter-spacing: 0.15em;
}

.nav-link-sub.active {
    color: var(--accent-color);
}

/* Nav overlay footer */
.nav-overlay-footer {
    position: absolute;
    bottom: 30px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    color: var(--text-light-color);
}

.nav-overlay-footer a {
    color: var(--muted-color);
    text-decoration: none;
}

.nav-overlay-footer a:hover {
    color: var(--accent-color);
}

/* ==============================
   LANGUAGE SWITCHER — Fixed top-right
   ============================== */
.language-switcher {
    position: fixed;
    top: 34px;
    right: 40px;
    z-index: 201;
    display: flex;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 0.06em;
}

.language-switcher a {
    color: var(--muted-color);
    text-decoration: none;
    font-weight: 400;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.language-switcher a:hover,
.language-switcher a.active {
    color: var(--primary-color);
    text-shadow: 0 0 8px rgba(139, 92, 246, 0.3);
}

.language-switcher .divider {
    color: var(--border-color);
}

/* ==============================
   MAIN CONTENT — Full width, no sidebar
   ============================== */
.main-content {
    width: 100%;
    padding: 100px 60px 80px;
    position: relative;
    z-index: 1;
}

/* ==============================
   TYPOGRAPHY
   ============================== */
h1 {
    font-family: var(--font-display);
    font-size: 64px;
    font-weight: 700;
    line-height: 1.05;
    margin-bottom: var(--spacing-xl);
    color: var(--primary-color);
    text-shadow:
        0 0 60px rgba(139, 92, 246, 0.2),
        0 0 120px rgba(139, 92, 246, 0.08),
        0 0 4px rgba(236, 72, 153, 0.1);
}

h2 {
    font-family: var(--font-family);
    font-size: 26px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin-bottom: var(--spacing-lg);
    color: var(--primary-color);
}

h3 {
    font-family: var(--font-family);
    font-size: 18px;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.4;
    margin-bottom: var(--spacing-md);
    color: var(--primary-color);
}

p {
    margin-bottom: var(--spacing-md);
    color: var(--text-color);
    line-height: 1.7;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

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

/* ==============================
   OFFLINE BANNER
   ============================== */
#offline-banner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 9999;
    font-family: var(--font-family);
    font-size: 14px;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.5), 0 0 60px rgba(139, 92, 246, 0.2);
}

#offline-banner.is-hidden { display: none; }

.offline-banner-content { display: flex; flex-direction: column; gap: 2px; }
.offline-banner-content strong { font-weight: 600; font-size: 13px; }
.offline-banner-content span { opacity: 0.9; font-size: 12px; }

#offline-banner button {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
}

#offline-banner-mini {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #8B5CF6, #EC4899);
    color: white;
    width: 36px;
    height: 36px;
    display: none;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    z-index: 9999;
    font-size: 18px;
    font-weight: 600;
}

#offline-banner-mini.is-hidden { display: none; }

/* ==============================
   MOBILE RESPONSIVE
   ============================== */
@media (max-width: 768px) {
    .brand-mark {
        top: 20px;
        left: 20px;
        font-size: 18px;
    }

    .brand-mark img {
        max-height: 26px;
    }

    .nav-trigger {
        top: 18px;
        right: 70px;
        width: 38px;
        height: 38px;
    }

    .language-switcher {
        top: 26px;
        right: 20px;
    }

    .main-content {
        padding: 90px 20px 60px;
    }

    h1 {
        font-size: 42px;
    }

    h2 {
        font-size: 22px;
    }

    .nav-link-huge {
        font-size: 42px;
    }
}

/* ==============================
   BODY SCROLL LOCK
   ============================== */
body.nav-open {
    overflow: hidden;
}

/* ==============================
   UTILITIES
   ============================== */
.is-hidden {
    display: none !important;
}
