:root {
    --bg-dark: #000000;
    --bg-panel: #050505;
    --text-main: #f2f2f2;
    --text-muted: #888888;
    --accent: #ffffff;
    /* Stark white for contrast */

    --font-heading: 'Montserrat',
        sans-serif;
    --font-body: 'Inter',
        sans-serif;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 8rem;

    --container-width: 1200px;

    --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Page Fade In (Anti-FOUC) */
body.about-page,
body.home-page {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

body.about-page.loaded,
body.home-page.loaded {
    opacity: 1;
}

/* Typography */
/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

h1 {
    font-size: clamp(3.5rem, 9vw, 7rem);
    font-weight: 900;
    letter-spacing: -0.02em;
}

h2 {
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: var(--spacing-md);
}

h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

p {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 60ch;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-sm) 0;
    z-index: 100;
    transition: background-color 0.5s ease, padding 0.5s ease, backdrop-filter 0.5s ease;
}

/* .navbar.scrolled styles removed to keep navbar transparent */

.nav-container {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    /* Push content to right since logo is absolute */
    align-items: flex-start;
    padding: 0 var(--spacing-md);
    position: relative;
    /* Context for absolute logo */
    /* Min height to maintain clickable area for links if needed, or let content define it */
}

/* Navbar Scroll Animation */
.navbar.scrolled .nav-links {
    /* Ensure no layout shift happens to container if possible, 
       but we are moving inner items */
}

.nav-links a {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.navbar.scrolled .nav-links a:nth-child(1) {
    /* About Us moves Right to align with Contact */
    /* Approx width of About (80px) + Gap (32px) = 112px */
    transform: translateX(109px);
}

.navbar.scrolled .nav-links a:nth-child(2) {
    /* Contact moves Down */
    transform: translateY(30px);
}

/* Ensure links don't disappear or get clipped */
.nav-content {
    /* overflow: visible; default */
}

/* Ensure nav-container has a minimum height or let content define it. 
   Since links are distinct, we just want to align them. 
   We might not need explicit height if padding/links provide it. 
   Let's stick to flex-end. */

.logo {
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: white;

    /* Absolute positioning to allow large logo to overlap */
    position: absolute;
    top: -105px;
    left: var(--spacing-md);
    margin-left: -125px;
    z-index: 101;
}

.logo img {
    height: 250px;
    width: auto;
    display: block;
}

.footer-logo {
    position: relative;
    width: 60px;
    /* Small footprint */
    height: 40px;
    display: flex;
    align-items: center;
}

.footer-logo img {
    position: absolute;
    height: 250px;
    width: auto;
    bottom: -120px;
    /* Hang down/up as needed, adjust to center visually */
    left: -100px;
    /* Center horizontally relative to the small anchor */
    display: block;
    max-width: none;
    /* Allow overflow */
}

.nav-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.nav-links a {
    font-size: 0.825rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    font-family: var(--font-body);
    /* Explicit consistency */
    /* Bolder links */
    opacity: 0.8;
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    opacity: 1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Nav CTA Button */
.nav-cta {
    background-color: white;
    color: black;
    padding: 0.75rem 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    font-family: var(--font-heading);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
    /* Sharp boxy feel */
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.nav-cta:hover {
    background-color: #e0e0e0;
    transform: scale(1.02);
    color: black;
}

/* Side Navigation */
.side-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 101;
}

.side-nav.left {
    left: var(--spacing-md);
}

.side-nav.right {
    right: var(--spacing-md);
}

.nav-dot {
    width: 12px;
    height: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform: rotate(45deg);
    /* Diamond shape */
    transition: all 0.3s ease;
    background: transparent;
}

.nav-dot:hover {
    border-color: var(--accent);
    transform: rotate(45deg) scale(1.2);
}

.nav-dot.active {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Social Icons */
.social-icon {
    color: rgba(255, 255, 255, 0.6);
    width: 20px;
    height: 20px;
    transition: all 0.3s ease;
}

.social-icon svg {
    width: 100%;
    height: 100%;
}

.social-icon:hover {
    color: var(--accent);
    transform: translateX(-3px);
    /* Subtle nudge left */
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 2000px;
    /* Deep perspective for premium feel */
}

/* Hero 3D Scene */
.hero-scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 120%;
    /* Taller for parallax */
    transform-style: preserve-3d;
    will-change: transform;
    z-index: 1;
}

.hero-layer {
    position: absolute;
    top: -20%;
    /* Overshoot for tilt coverage */
    left: -20%;
    width: 140%;
    height: 140%;
    background-size: cover;
    background-position: center;
    will-change: transform;
}

/* Layer 1: The customizable Background Image */
.layer-bg {
    /* Deep Starfield/Nebula */
    transform: translateZ(-50px) scale(1.8);
    /* Push back and scale up to fill gap */
    z-index: 1;
}

/* Layer 2: Midground details (Gradient Orb) */
.layer-mid {
    background: radial-gradient(circle at 60% 40%, rgba(40, 40, 60, 0.2) 0%, transparent 60%);
    transform: translateZ(30px);
    /* Bring forward slightly */
    z-index: 2;
    mix-blend-mode: screen;
    pointer-events: none;
}

/* Layer 3: Dynamic Starfield (Canvas) */
.layer-fore {
    /* Removed static noise background */
    transform: translateZ(60px);
    /* Closest to viewer */
    z-index: 3;
    pointer-events: none;
}

/* Layer 4: Hidden Truth (Treasure Hunt) */
#hidden-layer {
    z-index: 4;
    transform: translateZ(40px);
    pointer-events: none;
    /* Let clicks pass through unless on artifact (handled via JS) */
    /* The Magic: Masking */
    mask-image: radial-gradient(circle 100px at var(--cursor-x, 50%) var(--cursor-y, 50%), black 0%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle 100px at var(--cursor-x, 50%) var(--cursor-y, 50%), black 0%, transparent 100%);
    opacity: 0;
    /* Hidden by default until JS enables it */
    transition: opacity 0.5s ease;
}

.hidden-grid {
    width: 100%;
    height: 100%;
    /* Technical Grid/Blueprint look */
    background-image: linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    background-color: rgba(0, 10, 20, 0.6);
    /* Slightly blueish dark */
}

.artifact {
    position: absolute;
    width: 24px;
    height: 24px;
    color: #00ffff;
    filter: drop-shadow(0 0 8px #00ffff);
    /* Initial position (will be randomized) */
    top: 50%;
    left: 10%;
    cursor: pointer;
    pointer-events: auto;
    /* Allow interaction */
    transition: transform 0.3s ease;
}

.artifact:hover {
    transform: scale(1.5);
}

/* Treasure Popup */
/* Treasure Popup */
.treasure-popup {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    width: 400px;
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Gradient Border effect via box-shadow inset */
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(46, 45, 45, 0.1),
        inset 0 0 20px rgba(0, 255, 255, 0.05);
    padding: 2rem;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-radius: 4px;
}

.treasure-popup.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.15),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
}

.treasure-popup h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: white;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    letter-spacing: -0.02em;
}

.treasure-popup p {
    font-size: 0.95rem;
    color: #ccc;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

#popup-close {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-body);
    width: 100%;
}

#popup-close:hover {
    background: white;
    color: black;
    border-color: white;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}



/* Placeholder for an actual image if we add one later */
.hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?q=80&w=2072&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    mix-blend-mode: overlay;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: var(--spacing-md);
    will-change: transform, opacity;
}

.hero-subtitle {
    margin: var(--spacing-md) auto;
    font-weight: 300;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.8);
}

.cta-button {
    display: inline-block;
    margin-top: var(--spacing-md);
    padding: 1rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: white;
    color: black;
    border-color: white;
}

/* Content Sections */
.content-section {
    position: relative;
    padding: var(--spacing-xl) 0;
    z-index: 10;
    background-color: var(--bg-dark);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    /* Wider spacing for label */
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
    /* More breathing room */
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    /* More visible divider */
    padding-top: var(--spacing-sm);
    width: 100%;
}

/* Manifesto Section Special Styling */
#manifesto .container {
    max-width: var(--container-width);
    text-align: left;
}

.manifesto-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: start;
}

.manifesto-left {
    position: sticky;
    top: 20%;
}

.section-subtitle {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: var(--spacing-sm);
}

#manifesto h2 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    letter-spacing: -0.02em;
    margin-bottom: var(--spacing-md);
    background: none;
    -webkit-text-fill-color: initial;
    color: white;
    opacity: 1;
}

#manifesto p {
    font-size: 1.125rem;
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 90%;
    margin: 0;
    /* Reset */
    font-weight: 400;
    text-align: justify;
}

/* Timeline / Right Column */
.manifesto-right {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    position: relative;
    padding-left: 1rem;
}

.timeline-item {
    position: relative;
    padding-left: 3rem;
}

/* Connecting Line */
.manifesto-right::before {
    content: '';
    position: absolute;
    top: 1rem;
    /* Start at center of first marker (which is height 2rem) */
    bottom: 0;
    left: calc(2rem - 1px);
    /* Parent padding (1rem) + Half marker (1rem) - Half line (1px) */
    border-left: 2px dashed rgba(255, 255, 255, 0.2);
    /* Slightly more visible */
    z-index: 0;
}

.timeline-marker {
    position: absolute;
    left: 0;
    top: 0;
    width: 2rem;
    height: 2rem;
    background-color: var(--accent);
    color: black;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 1;
    font-family: var(--font-heading);
}

.timeline-content h3 {
    font-size: 1.5rem;
    color: white;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: -0.01em;
}

.timeline-content p {
    font-size: 1rem;
    color: #888;
    text-align: justify;
}

@media (max-width: 768px) {
    .manifesto-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .manifesto-left {
        position: static;
        margin-bottom: var(--spacing-lg);
    }
}

/* --- ABOUT PAGE SCROLL EFFECT --- */
.about-wrapper {
    position: relative;
    width: 100%;
    z-index: 1;
}

.about-content {
    position: relative;
    width: 100%;
    z-index: 1;
    overflow-x: hidden;
}

.about-hero {
    width: 100%;
    height: 100vh;
    background: #000;
}

.about-image-container {
    width: 100%;
    height: 100vh;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    perspective: 500px;
    overflow: hidden;
    pointer-events: none;
}

.about-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* Process Section */
#process {
    background-color: var(--bg-panel);
    /* Subtle contrast */
}

/* Grid Layout */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-md);
    /* Tighter grid gap for sleekness */
    margin-top: var(--spacing-lg);
}

/* Process Cards - 3D Flip with Pop */
.card {
    background: transparent;
    /* Container is transparent */
    perspective: 1000px;
    padding: 0;
    /* Layout handled by inner */
    border: none;
    cursor: pointer;
    min-height: 200px;
    /* Ensure a consistent touch target/visual block */
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    /* Fill the grid cell */
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy pop */

    /* Grid Stack Trick: Stack front and back on top of each other */
    display: grid;
    grid-template-areas: "stack";
}

.card:hover .card-inner {
    transform: rotateY(180deg) scale(1.05);
    /* Flip and Pop */
}

.card-front,
.card-back {
    grid-area: stack;
    backface-visibility: hidden;
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    /* Align text left */
}

/* Front Face */
.card-front {
    z-index: 2;
    transform: rotateY(0deg);
}

.card-front h3 {
    margin: 0;
    /* Center cleanly */
    font-size: 1.5rem;
    color: white;
}

/* Back Face */
.card-back {
    transform: rotateY(180deg);
    background: rgba(255, 255, 255, 0.08);
    /* Slightly lighter on back for contrast */
    border-color: var(--accent);
    /* Highlight border on active/back */
}

.card-back p {
    margin: 0;
    color: white;
    font-size: 1rem;
    line-height: 1.5;
    text-align: justify;
}

/* Stagger Delays (Optional, keep if nice) */
.card:nth-child(1) {
    transition-delay: 0ms;
}

.card:nth-child(2) {
    transition-delay: 0ms;
}

/* Remove load staggering for hover interactions usually */
.card:nth-child(3) {
    transition-delay: 0ms;
}

/* Showcase / Worlds */
#worlds {
    overflow: hidden;
    /* Contain the absolute bg */
}

.worlds-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.5s ease, background-image 0s linear 0s;
    /* Instant image switch, smooth opacity */
    z-index: 0;
    pointer-events: none;
    mix-blend-mode: soft-light;
    /* Blend with dark bg */
}

/* --- INTRO VIDEO OVERLAY --- */
#intro-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    background-color: #000;
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease-out, visibility 0.8s;
    touch-action: none;
}

#intro-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#intro-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensures full video is visible without cropping */
}

.worlds-bg.active {
    opacity: 0.3;
    /* Subtle backing */
}

.showcase {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Removing gap, using padding for cleaner lines */
}

.project-item {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: none;
    /* Only top borders for list feel */
    padding: var(--spacing-md) 0;
    cursor: pointer;
    transition: all 0.4s var(--ease-out);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.project-item:last-child {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.project-item:hover {
    opacity: 1;
    /* Override default hover opacity */
    background: rgba(255, 255, 255, 0.02);
    padding-left: var(--spacing-sm);
    /* Subtle shift */
}

.project-item h3 {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 400;
    /* Lighter weight for elegance */
    letter-spacing: -0.02em;
    margin: 0;
}

.project-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: monospace;
    /* Tech feel */
}

/* CTA Section */
.cta-section {
    padding: var(--spacing-xl) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background-color: var(--bg-dark);
    text-align: center;
    position: relative;
    z-index: 10;
}

.cta-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.cta-content h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--text-muted);
    margin: 0;
}

.email-link {
    font-size: clamp(2.5rem, 8vw, 6rem);
    /* Made slightly larger for impact */
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.04em;
    transition: opacity 0.3s ease;
}

.email-link:hover {
    opacity: 0.7;
    color: var(--text-main);
}

/* Minimal Footer */
.site-footer {
    padding: var(--spacing-md) 0;
    background-color: #020202;
    /* Very dark, almost black */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.825rem;
    color: var(--text-muted);
    z-index: 20;
    position: relative;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

.footer-logo {
    display: flex;
    /* Image + Text */
    align-items: center;
    gap: 12px;
    font-family: var(--font-heading);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: white;
    opacity: 0.9;
}

.footer-links {
    display: flex;
    gap: var(--spacing-md);
}

.footer-links a {
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: white;
}

.footer-copyright {
    opacity: 0.6;
}

@media (max-width: 768px) {
    .footer-inner {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
}

/* --- RESPONSIVE DESIGN --- */

/* Mobile Menu Styles */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 14px;
    cursor: pointer;
    z-index: 200;
}

.mobile-menu-btn span {
    width: 100%;
    height: 2px;
    background-color: white;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active span:first-child {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:last-child {
    transform: rotate(-45deg) translate(3px, -4px);
}

.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--bg-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 105;
    /* Above navbar background but below logo/btn if we wanted, but here overlay covers everything except button who has 200 */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.mobile-link {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    color: white;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.mobile-nav-overlay.active .mobile-link {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger for menu items */
.mobile-nav-overlay.active .mobile-link:nth-child(1) {
    transition-delay: 0.1s;
}

.mobile-nav-overlay.active .mobile-link:nth-child(2) {
    transition-delay: 0.2s;
}

.mobile-nav-overlay.active .mobile-link:nth-child(3) {
    transition-delay: 0.3s;
}

.mobile-nav-overlay.active .mobile-link:nth-child(4) {
    transition-delay: 0.4s;
}

.mobile-nav-overlay.active .mobile-link:nth-child(5) {
    transition-delay: 0.5s;
}


/* Tablet & Mobile Breakpoints */
@media (max-width: 1024px) {
    :root {
        --spacing-xl: 5rem;
        --container-width: 90%;
    }

    .nav-content {
        gap: var(--spacing-md);
    }
}

@media (max-width: 768px) {

    .nav-links,
    .nav-content {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
        margin-left: auto;
        /* Force push to right if needed, though space-between should work if nav-content is gone */
    }

    .side-nav {
        display: none;
    }

    /* Adjust Fonts */
    h1 {
        font-size: 3rem;
        /* Fallback */
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    h2 {
        font-size: 2rem;
    }

    #manifesto h2 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    /* Fix Grid */
    .grid-layout {
        grid-template-columns: 1fr;
        /* Single column on mobile */
    }

    /* Adjust Layer Scaling for Performance/Fit */
    .hero-layer {
        left: -10%;
        width: 120%;
        height: 120%;
    }

    .treasure-popup {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        /* Full width essentially */
        width: auto;
        padding: 1.5rem;
    }
}

@media (max-width: 390px) {

    /* Specific tweaks for small mobile */
    .container {
        padding: 0 var(--spacing-sm);
    }

    h1 {
        font-size: clamp(2rem, 12vw, 3rem);
    }

    .mobile-link {
        font-size: 1.5rem;
    }
}

/* Rolling Text Animation */
/* Rolling Text Animation */
.rolling-text {
    display: grid;
    overflow: hidden;
    line-height: 1.1;
    text-align: right;
    /* Align text to the right */
    justify-items: end;
    /* Align grid items to the end */
}

.rolling-text span {
    grid-area: 1 / 1;
    display: block;
    /* We handle animation on the children (.char) now */
}

/* Individual Character Styling */
.rolling-text .char {
    display: inline-block;
    transition: transform 0.5s cubic-bezier(0.76, 0, 0.24, 1);
    transition-delay: var(--delay, 0ms);
    /* Dynamic delay */
    will-change: transform;
    white-space: pre;
    /* Preserve spaces as existing chars */
}

.roll-original .char {
    transform: translateY(0);
}

.roll-hover .char {
    transform: translateY(105%);
    color: var(--accent);
}

/* Hover States per character */
.project-item:hover .roll-original .char {
    transform: translateY(-105%);
}

.project-item:hover .roll-hover .char {
    transform: translateY(0);
}

/* --- ABOUT PAGE WRAPPER --- */
.wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* --- ABOUT PAGE ALIGNMENT --- */
.zoom-text-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    pointer-events: none;
}

.zoom-text {
    font-size: clamp(5rem, 15vw, 15rem);
    font-weight: 900;
    color: white;
    text-transform: uppercase;
    margin: 0;
    line-height: 1;
    white-space: nowrap;
}

.text-content-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    opacity: 0;
    /* Controlled by JS, but good default */
}

.text-block {
    max-width: 800px;
    padding: var(--spacing-lg);
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    /* Optional: improve readability */
    backdrop-filter: blur(10px);
    border-radius: 12px;
}

#about-content {
    background-color: #000;
    color: white;
    /* Absolute position to sit behind the zoom text text */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Behind zoom text (z-index 10) */

    /* Center the content */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    /* Hidden initially, revealed by JS */
}

/* Inner Container for Text */
#about-content .container {
    max-width: 800px;
    padding: 0 var(--spacing-md);
    text-align: left;
    /* Better readability for paragraphs */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#about-content h2 {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: var(--spacing-md);
    color: white;
    line-height: 1.1;
}

#about-content h3 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--accent);
    /* Use accent color */
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
}

#about-content p {
    font-family: var(--font-body);
    font-size: 1.1rem;
    line-height: 1.8;
    color: #cccccc;
    /* Slightly muted white */
    margin-bottom: 1.5rem;
    text-align: justify;
}

/* --- HYPERSPACE BACKGROUND --- */
#hyperspace-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* Behind other content but visible */
    pointer-events: none;
    opacity: 0.8;
}

/* --- VALUES SECTION (Slide Over) --- */
#values {
    position: relative;
    z-index: 20;
    /* Slide OVER the pinned about wrapper */
    background-color: var(--bg-panel);
    padding: var(--spacing-xl) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: -100vh;
    /* Parallax Overlap: Covers the full pinned height */
    box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.8);
    /* Depth shadow */
}

.site-footer {
    background-color: black;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 10;
}

#values h2 {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: var(--spacing-lg);
    color: white;
}

.values-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    /* Center alignment */
    gap: var(--spacing-xl);
    padding: 0 var(--spacing-md);
    max-width: 1000px;
    margin: 0 auto;
    /* Center the grid itself */
}

.value-card {
    background: transparent;
    /* Remove card look */
    border: none;
    padding: 0;
    width: 280px;
    /* Fixed width for alignment */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease;
}

.value-card:hover {
    background: transparent;
    border-color: transparent;
    transform: translateY(-10px);
}

.value-icon {
    width: 100px;
    height: 100px;
    background: white;
    /* High contrast circle */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: black;
    /* Icon text color */
    margin-bottom: 1.5rem;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    /* Glow */
    transition: all 0.3s ease;
}

.value-card:hover .value-icon {
    background: var(--accent);
    /* Color shift on hover */
    box-shadow: 0 0 30px var(--accent);
    transform: scale(1.1);
}

.value-card h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.value-card p {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    transform: translateY(10px);
}

.value-card:hover p {
    max-height: 100px;
    /* Reveal content */
    opacity: 1;
    transform: translateY(0);
    margin-top: 0.5rem;
}

/* --- CONTACT PAGE --- */
.contact-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-xl) var(--spacing-md);
    overflow: hidden;
}

/* Background Massive Text */
.contact-bg-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 25vw;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.02);
    z-index: 1;
    pointer-events: none;
    white-space: nowrap;
    text-transform: uppercase;
}

/* Layout Grid */
.contact-container {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    /* Balanced 60/40 text/form split */
    gap: var(--spacing-xl);
    max-width: 1200px;
    width: 100%;
    align-items: start;
    /* Align tops */
}

/* Left Column: Info */
.contact-intro h1 {
    font-size: 3rem;
    /* Slightly reduced to fit text */
    line-height: 1.1;
    margin-bottom: var(--spacing-sm);
    color: white;
}

.contact-intro p {
    font-family: var(--font-body);
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin-bottom: var(--spacing-xl);
}

.contact-cards {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.contact-info-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.contact-info-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-right: var(--spacing-md);
    color: white;
}

.card-details {
    flex: 1;
}

.card-details h3 {
    font-size: 1rem;
    color: white;
    margin-bottom: 4px;
}

.card-details p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.card-arrow {
    opacity: 0.5;
    transition: transform 0.3s ease;
}

.contact-info-card:hover .card-arrow {
    transform: translateX(5px) rotate(-45deg);
    opacity: 1;
    color: var(--accent);
}

/* Right Column: Form */
.contact-form-container {
    background: rgba(20, 20, 20, 0.6);
    backdrop-filter: blur(20px);
    margin-top: 30px;
    /* Separating from header */
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: var(--spacing-lg);
    /* Reduced from xl */
    border-radius: 24px;
}

.contact-input-group {
    margin-bottom: var(--spacing-sm);
    /* Reduced from md */
    display: flex;
    flex-direction: column;
}

.contact-input-group label {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    margin-left: 8px;
}

.contact-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    font-family: var(--font-body);
    color: white;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    width: 100%;
}

.contact-input:focus {
    border-color: var(--accent);
}

textarea.contact-input {
    resize: vertical;
    min-height: 100px;
    /* Reduced from 150px */
}

.submit-btn {
    width: 100%;
    background: white;
    color: black;
    font-family: var(--font-heading);
    font-weight: 800;
    text-transform: uppercase;
    padding: 14px;
    /* Reduced from 18px */
    border: none;
    border-radius: 12px;
    font-size: 0.9rem;
    /* Slightly smaller text */
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: var(--spacing-sm);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.2);
}

/* Responsive */
@media (max-width: 900px) {

    /* Contact Page Responsive */
    .contact-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .contact-intro h1 {
        font-size: 2.5rem;
    }

    .contact-bg-text {
        font-size: 20vw;
        top: 20%;
    }

    .contact-wrapper {
        padding: 150px var(--spacing-md) var(--spacing-lg) var(--spacing-md);
        /* Top padding 150px to clear navbar */
        align-items: flex-start;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    /* About Page Responsive */
    /* About Page Responsive */
    .zoom-text {
        font-size: 15vw;
        /* Larger on mobile */
        width: auto;
        text-align: center;
    }

    #about-content {
        align-items: flex-start;
        padding-top: 150px;
        /* Clear navbar */
        overflow-y: auto;
    }

    .about-wrapper {
        padding-top: 0;
    }

    .values-grid {
        flex-direction: column;
        align-items: center;
    }

    .value-card {
        width: 100%;
        max-width: 400px;
    }

    /* Worlds Section Mobile Fix */
    .project-item {
        flex-direction: column;
        align-items: stretch;
        /* Allow explicit alignment */
        gap: 8px;
        /* Space between meta and title */
    }

    .project-item h3 {
        font-size: 2rem;
        /* Ensure it fits */
        line-height: 1.1;
        align-self: flex-end;
        /* Push to right */
        text-align: right;
    }

    .project-meta {
        font-size: 0.75rem;
        margin-bottom: 4px;
    }
}

/* Fix CTA Email Cropping */
.cta-section .email-link,
.email-link {
    font-size: clamp(1rem, 3.5vw, 5rem) !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    text-transform: none !important;
    line-height: 1.1;
}