:root {
    --infinite-deep: #0a0a1a;
    --spiral-gold: #c9a961;
    --fade-cream: #f5f0e8;
    --recursive-blue: #4a6fa5;
    --mist-lavender: #b8a8d0;
    --void-black: #050508;
    --shimmer-pearl: #e8e3d8;
    --deep-navy: #1a1a3e;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--infinite-deep);
    color: var(--fade-cream);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ========================================
   SPIRAL CANVAS - Fixed background SVG
   ======================================== */
#spiral-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
}

#spiral-svg {
    width: 120vmin;
    height: 120vmin;
    opacity: 0.7;
    will-change: transform;
}

.spiral-line {
    stroke-linecap: round;
    stroke-linejoin: round;
    will-change: transform;
}

/* Mandala rotation animations */
.mandala-rotate-cw {
    transform-origin: 500px 500px;
    animation: rotateCW 40s linear infinite;
    will-change: transform;
}

.mandala-rotate-ccw {
    transform-origin: 500px 500px;
    animation: rotateCCW 55s linear infinite;
    will-change: transform;
}

@keyframes rotateCW {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes rotateCCW {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
}

/* Mathematical annotations */
.math-annotation {
    position: fixed;
    z-index: 1;
    pointer-events: none;
    opacity: 0.35;
    transition: opacity 0.6s ease;
}

.mono-text {
    font-family: 'Inconsolata', monospace;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    color: var(--recursive-blue);
    letter-spacing: 0.04em;
}

#anno-phi { transform: rotate(-12deg); }
#anno-inf { transform: rotate(8deg); font-size: 1.6rem; }
#anno-z { transform: rotate(-5deg); }
#anno-r { transform: rotate(15deg); }

/* ========================================
   SECTIONS - Spiral layered content
   ======================================== */
.spiral-section {
    position: relative;
    z-index: 2;
    min-height: 120vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ========================================
   HERO SECTION
   ======================================== */
#hero {
    min-height: 120vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-content {
    text-align: center;
    z-index: 3;
    position: relative;
}

.studio-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--fade-cream);
    text-shadow: 0 0 60px rgba(201, 169, 97, 0.2), 0 0 120px rgba(10, 10, 26, 0.8);
    opacity: 0;
    animation: titleFadeIn 2s cubic-bezier(0.23, 1, 0.32, 1) 0.3s forwards;
}

.studio-subtitle {
    font-family: 'Inconsolata', monospace;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: var(--spiral-gold);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-top: 1.2rem;
    opacity: 0;
    animation: titleFadeIn 2s cubic-bezier(0.23, 1, 0.32, 1) 0.8s forwards;
}

@keyframes titleFadeIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========================================
   SPIRAL RINGS - Portfolio / Process / Contact
   ======================================== */
.spiral-ring {
    position: relative;
    width: clamp(320px, 80vw, 800px);
    height: clamp(320px, 80vw, 800px);
    will-change: transform;
}

.spiral-card {
    position: absolute;
    width: clamp(160px, 22vw, 240px);
    height: clamp(180px, 24vw, 260px);
    border-radius: 12% 88% 71% 29% / 98% 40% 60% 2%;
    background: radial-gradient(ellipse at center, var(--deep-navy) 0%, var(--infinite-deep) 100%);
    border: 1px solid rgba(201, 169, 97, 0.2);
    padding: clamp(16px, 2vw, 28px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.8s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.8s cubic-bezier(0.23, 1, 0.32, 1),
                border-color 0.4s ease,
                box-shadow 0.4s ease;
    will-change: transform, opacity;
    overflow: hidden;
}

.spiral-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: conic-gradient(from 0deg, rgba(201, 169, 97, 0.06), rgba(74, 111, 165, 0.06), rgba(184, 168, 208, 0.06), rgba(201, 169, 97, 0.06));
    animation: shimmerRotate 8s linear infinite;
    pointer-events: none;
}

@keyframes shimmerRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spiral-card.visible {
    opacity: 1;
    transform: scale(1);
}

.spiral-card:hover {
    border-color: var(--spiral-gold);
    box-shadow: 0 0 40px rgba(201, 169, 97, 0.12), inset 0 0 30px rgba(201, 169, 97, 0.04);
    transform: scale(1.05);
    z-index: 10;
}

.spiral-ring:has(.spiral-card:hover) .spiral-card:not(:hover) {
    opacity: 0.3;
}

.card-inner {
    position: relative;
    z-index: 2;
    text-align: center;
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1rem, 1.6vw, 1.3rem);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--fade-cream);
    margin-bottom: 0.6rem;
}

.card-desc {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.75rem, 0.9vw, 0.85rem);
    font-weight: 400;
    line-height: 1.8;
    color: var(--shimmer-pearl);
    opacity: 0.75;
}

.card-index {
    display: block;
    margin-top: 0.8rem;
    color: var(--spiral-gold);
    opacity: 0.5;
    font-size: clamp(0.7rem, 0.8vw, 0.8rem);
}

/* Section labels */
.section-label {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 400;
    letter-spacing: 0.12em;
    color: var(--spiral-gold);
    opacity: 0.4;
    margin-top: 3rem;
    text-align: center;
}

/* Process cards variant */
.process-card {
    border-radius: 29% 71% 88% 12% / 2% 60% 40% 98%;
    border-color: rgba(74, 111, 165, 0.2);
}

.process-card:hover {
    border-color: var(--recursive-blue);
    box-shadow: 0 0 40px rgba(74, 111, 165, 0.12), inset 0 0 30px rgba(74, 111, 165, 0.04);
}

/* Contact section */
#contact {
    min-height: 100vh;
    padding-bottom: 10vh;
}

.contact-spiral {
    position: relative;
    z-index: 3;
    text-align: center;
    margin-bottom: 4rem;
}

.contact-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 5vw, 3.6rem);
    font-weight: 400;
    letter-spacing: 0.06em;
    color: var(--fade-cream);
    margin-bottom: 1.5rem;
}

.contact-text {
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.95rem, 1.15vw, 1.05rem);
    font-weight: 300;
    line-height: 1.8;
    color: var(--shimmer-pearl);
    max-width: 520px;
    margin: 0 auto 2rem;
    opacity: 0.7;
}

.contact-details {
    margin-top: 2rem;
}

.contact-link {
    font-size: clamp(0.85rem, 1vw, 1rem);
    color: var(--spiral-gold);
    letter-spacing: 0.1em;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.contact-link:hover {
    opacity: 1;
}

/* Contact cards - smaller decorative */
.contact-card {
    width: clamp(80px, 10vw, 120px);
    height: clamp(80px, 10vw, 120px);
    background: radial-gradient(ellipse at center, var(--deep-navy) 0%, transparent 100%);
    border-color: rgba(184, 168, 208, 0.15);
}

.contact-card .card-index {
    font-size: 1.4rem;
    color: var(--mist-lavender);
    opacity: 0.4;
    margin-top: 0;
}

/* ========================================
   HOVER GLOW - Radial gradient at mouse
   ======================================== */
#hover-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: radial-gradient(
        300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(201, 169, 97, 0.06) 0%,
        transparent 80%
    );
}

#hover-glow.active {
    opacity: 1;
}

/* ========================================
   GRADIENTS AND OVERLAYS
   ======================================== */
#hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30vh;
    background: linear-gradient(to bottom, transparent, var(--infinite-deep));
    pointer-events: none;
    z-index: 1;
}

#portfolio::before,
#process::before,
#contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20vh;
    background: linear-gradient(to top, transparent, var(--infinite-deep));
    pointer-events: none;
    z-index: 1;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 1024px) {
    .spiral-ring {
        width: clamp(300px, 90vw, 600px);
        height: clamp(300px, 90vw, 600px);
    }

    .spiral-card {
        width: clamp(130px, 28vw, 200px);
        height: clamp(150px, 30vw, 220px);
    }
}

@media (max-width: 768px) {
    .spiral-ring {
        width: 90vw;
        height: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        padding: 2rem 0;
    }

    .spiral-card {
        position: relative;
        width: 80vw;
        max-width: 320px;
        height: auto;
        min-height: 160px;
        border-radius: 16px;
    }

    .process-card {
        border-radius: 16px;
    }

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

    .spiral-ring:has(.contact-card) {
        flex-direction: row;
        justify-content: center;
    }

    .math-annotation {
        display: none;
    }

    #spiral-svg {
        width: 160vmin;
        height: 160vmin;
        opacity: 0.4;
    }
}

/* ========================================
   SCROLL-LINKED CUSTOM PROPERTIES
   ======================================== */
body {
    --scroll-scale: 1;
    --spiral-rotation: 0deg;
}
