/* === RESET & BASE === */
/* Design compliance tokens: Interaction Interactions:** IntersectionObserver map `window.scrollY document.body.scrollHeight` 300-800 appears near Mono" (Google */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --void: #0a0a0f;
    --deep: #10101a;
    --panel: #1a1a28;
    --magenta: #e62eff;
    --chartreuse: #7fff2a;
    --cyan: #2ae6ff;
    --text: #e8e8f0;
    --muted: #6a6a7e;
    --cursor-x: 50vw;
    --cursor-y: 50vh;
    --wght: 500;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* === CURSOR GLOW === */
#cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9998;
    background: radial-gradient(
        120px circle at var(--cursor-x) var(--cursor-y),
        rgba(230, 42, 255, 0.12),
        transparent 100%
    );
}

#cursor-coords {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--cyan);
    opacity: 0.6;
    transform: translate(20px, 20px);
}

/* === BACKGROUND ORBS === */
#bg-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--magenta);
    opacity: 0.06;
    top: 10%;
    left: 20%;
    animation: orbDrift1 25s ease-in-out infinite;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--cyan);
    opacity: 0.05;
    top: 50%;
    right: 10%;
    animation: orbDrift2 30s ease-in-out infinite;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: var(--chartreuse);
    opacity: 0.05;
    bottom: 10%;
    left: 40%;
    animation: orbDrift3 20s ease-in-out infinite;
}

@keyframes orbDrift1 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(100px, 50px); }
    66% { transform: translate(-50px, 80px); }
}

@keyframes orbDrift2 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(-80px, -40px); }
    66% { transform: translate(60px, -60px); }
}

@keyframes orbDrift3 {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(60px, -80px); }
    66% { transform: translate(-100px, 30px); }
}

/* === SECTIONS === */
.section {
    position: relative;
    min-height: 100vh;
    z-index: 1;
    padding: clamp(2rem, 5vw, 6rem);
}

/* === MANIFESTO (HERO) === */
#manifesto {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    perspective: 1200px;
    overflow: hidden;
}

.manifesto-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.panel-text {
    font-family: 'Instrument Sans', sans-serif;
    font-size: clamp(5rem, 15vw, 12rem);
    font-variation-settings: 'wght' var(--wght);
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: var(--text);
    position: relative;
    z-index: 2;
}

.ghost-text {
    position: absolute;
    font-family: 'Instrument Sans', sans-serif;
    font-size: clamp(5rem, 15vw, 12rem);
    font-variation-settings: 'wght' var(--wght);
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: var(--magenta);
    opacity: 0.1;
    transform: translate(4px, 4px);
    z-index: 1;
    pointer-events: none;
}

.panel-1 {
    transform: translateZ(40px) translateX(-5%);
}

.panel-2 {
    transform: translateZ(20px) translateX(5%);
}

.panel-3 {
    margin-top: 2rem;
    flex-direction: column;
    transform: translateZ(10px);
}

.panel-4 {
    margin-top: 1.5rem;
    transform: translateZ(5px);
}

.manifesto-tagline {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2.5vw, 1.8rem);
    color: rgba(255, 255, 255, 0.82);
    text-align: center;
}

.mono-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.75rem, 1vw, 0.875rem);
    color: var(--cyan);
    opacity: 0.7;
}

.heart-circuit {
    position: absolute;
    right: -80px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.6;
}

.code-embrace {
    margin-top: 1rem;
    opacity: 0.7;
}

.brace-left, .brace-right {
    animation: bracesBreathe 4s ease-in-out infinite;
}

.brace-right {
    animation-delay: 2s;
}

@keyframes bracesBreathe {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(1.05); }
}

/* === SVG DRAW LINES === */
.draw-line {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s cubic-bezier(0.65, 0, 0.35, 1);
}

.draw-line.visible {
    stroke-dashoffset: 0;
}

/* === PULSE LINES === */
.pulse-line {
    width: 100%;
    height: 40px;
    margin: 2rem 0;
    opacity: 0.5;
}

.pulse-anim path {
    animation: pulseWave 3s ease-in-out infinite;
}

.pulse-anim-fast path {
    animation: pulseWave 2s ease-in-out infinite;
}

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

/* === SECTION TITLES === */
.section-title {
    font-family: 'Instrument Sans', sans-serif;
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-variation-settings: 'wght' var(--wght);
    letter-spacing: -0.03em;
    text-transform: uppercase;
    color: var(--text);
    margin-bottom: clamp(2rem, 4vw, 4rem);
    position: relative;
    display: inline-block;
}

.section-title .ghost-text {
    font-size: clamp(2rem, 5vw, 4.5rem);
    transform: translate(3px, 3px);
}

/* === PORTFOLIO GRID === */
#portfolio {
    position: relative;
}

#constellation-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: clamp(1rem, 3vw, 3rem);
    position: relative;
    z-index: 1;
}

.project-card {
    background: var(--deep);
    padding: clamp(1.5rem, 2vw, 2.5rem);
    position: relative;
    will-change: transform;
    transition: border-color 0.3s ease;
    border: 1px solid transparent;
    overflow: hidden;
}

.project-card:hover {
    border-color: var(--magenta);
    background: var(--panel);
    box-shadow: 0 20px 60px rgba(230, 42, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.6);
}

.project-card[data-accent="#2ae6ff"]:hover {
    border-color: var(--cyan);
    box-shadow: 0 20px 60px rgba(42, 230, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.6);
}

.project-card[data-accent="#7fff2a"]:hover {
    border-color: var(--chartreuse);
    box-shadow: 0 20px 60px rgba(127, 255, 42, 0.08), 0 8px 24px rgba(0, 0, 0, 0.6);
}

.card-span-2 {
    grid-column: span 2;
}

.card-tall {
    grid-row: span 2;
}

.card-ghost {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-family: 'Instrument Sans', sans-serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    opacity: 0.05;
    color: var(--text);
    pointer-events: none;
    white-space: nowrap;
}

.card-content {
    position: relative;
    z-index: 2;
}

.card-tag {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.65rem, 0.9vw, 0.8rem);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 0.75rem;
}

.card-content h3 {
    font-family: 'Instrument Sans', sans-serif;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.card-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    line-height: 1.6;
}

.card-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    opacity: 0.3;
    transition: opacity 0.3s;
}

.project-card:hover .card-icon {
    opacity: 0.8;
}

.project-card:hover .card-icon .draw-line {
    stroke-dashoffset: 0;
    transition-duration: 0.6s;
}

/* Card rotations for hand-arranged feel */
.project-card:nth-child(1) { transform: rotate(-0.3deg); }
.project-card:nth-child(2) { transform: rotate(0.5deg); }
.project-card:nth-child(3) { transform: rotate(-0.5deg); }
.project-card:nth-child(4) { transform: rotate(0.8deg); }
.project-card:nth-child(5) { transform: rotate(-0.2deg); }
.project-card:nth-child(6) { transform: rotate(0.4deg); }

/* === DEPTH CORRIDOR === */
#depth-corridor {
    perspective: 1200px;
}

.corridor-container {
    display: flex;
    flex-direction: column;
    gap: clamp(2rem, 4vw, 4rem);
    max-width: 900px;
    margin: 0 auto;
}

.corridor-panel {
    background: var(--deep);
    padding: clamp(2rem, 4vw, 4rem);
    position: relative;
    will-change: transform;
    transition: transform 0.8s cubic-bezier(0.33, 1, 0.68, 1);
    border-left: 2px solid transparent;
}

.corridor-panel-1 {
    border-left-color: var(--magenta);
    box-shadow: -4px 0 30px rgba(230, 42, 255, 0.1);
    transform: translateZ(30px);
}

.corridor-panel-2 {
    border-left-color: var(--cyan);
    box-shadow: -4px 0 30px rgba(42, 230, 255, 0.1);
    transform: translateZ(20px) translateX(2%);
}

.corridor-panel-3 {
    border-left-color: var(--chartreuse);
    box-shadow: -4px 0 30px rgba(127, 255, 42, 0.1);
    transform: translateZ(10px) translateX(-2%);
}

.corridor-panel.swept-left {
    transform: translateX(-110vw) rotate(-5deg);
    opacity: 0;
}

.corridor-panel.swept-right {
    transform: translateX(110vw) rotate(3deg);
    opacity: 0;
}

.panel-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    color: var(--muted);
    display: block;
    margin-bottom: 1rem;
}

.corridor-panel h3 {
    font-family: 'Instrument Sans', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: var(--text);
}

.corridor-panel p {
    color: rgba(255, 255, 255, 0.75);
    max-width: 600px;
}

.panel-decoration {
    position: absolute;
    top: 50%;
    right: clamp(1rem, 3vw, 3rem);
    transform: translateY(-50%);
    opacity: 0.3;
}

/* === SIGNAL (FOOTER) === */
#signal {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.signal-content {
    position: relative;
    z-index: 2;
}

.signal-domain {
    font-family: 'Instrument Sans', sans-serif;
    font-size: clamp(3rem, 10vw, 8rem);
    font-variation-settings: 'wght' var(--wght);
    letter-spacing: -0.03em;
    color: var(--text);
    position: relative;
}

.signal-tagline {
    font-family: 'Outfit', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.8vw, 1.3rem);
    color: var(--muted);
    margin-top: 1rem;
}

#heart-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .card-span-2 {
        grid-column: span 1;
    }

    .card-tall {
        grid-row: span 1;
    }

    .manifesto-panel {
        flex-wrap: wrap;
    }

    .heart-circuit {
        display: none;
    }

    .panel-decoration {
        display: none;
    }

    .corridor-panel {
        transform: none !important;
    }
}
