/* ============================================
   prototype.moe - Evolved Minimal
   Aurora-gradient | Water Bubbles | Immersive Scroll
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
    --deep-space: #0a0520;
    --aurora-violet: #4a0e8f;
    --aurora-teal: #0a7a8a;
    --aurora-rose: #c47a8a;
    --aurora-gold: #d4870a;
    --pale-shimmer: #f0eaff;
    --silver-blue: #c0c8d4;
    --soft-white: #f8f6ff;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    overflow: hidden;
    height: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--deep-space);
    color: var(--soft-white);
    overflow: hidden;
    height: 100%;
    position: relative;
}

/* --- Aurora Background --- */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(
        from 0deg at 50% 50%,
        var(--deep-space) 0deg,
        var(--aurora-violet) 60deg,
        var(--aurora-teal) 120deg,
        var(--deep-space) 180deg,
        var(--aurora-rose) 240deg,
        var(--aurora-gold) 300deg,
        var(--deep-space) 360deg
    );
    animation: auroraRotate 20s linear infinite;
    opacity: 0.3;
    z-index: 0;
    pointer-events: none;
}

@keyframes auroraRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Wireframe Layer --- */
.wireframe-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.wireframe-svg {
    width: 100%;
    height: 100%;
}

/* --- Bubble Container --- */
.bubble-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(
        circle at 30% 30%,
        rgba(248, 246, 255, 0.15),
        rgba(10, 122, 138, 0.08),
        transparent
    );
    border: 1px solid rgba(248, 246, 255, 0.06);
    animation: bubbleFloat linear infinite;
    will-change: transform;
}

@keyframes bubbleFloat {
    0% {
        transform: translateY(100vh) translateX(0) scale(0.4);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-20vh) translateX(var(--drift, 40px)) scale(1);
        opacity: 0;
    }
}

/* --- Scroll Container --- */
.scroll-container {
    position: relative;
    z-index: 3;
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scroll-container::-webkit-scrollbar {
    display: none;
}

/* --- Sections --- */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: start;
    position: relative;
    padding: 80px 40px;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.section-content {
    max-width: 900px;
    width: 100%;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Hero Section --- */
.section-hero {
    background: radial-gradient(
        ellipse at 50% 50%,
        rgba(74, 14, 143, 0.15) 0%,
        transparent 70%
    );
}

.hero-badge {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--aurora-teal);
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.2s, transform 0.6s ease 0.2s;
}

.visible .hero-badge {
    opacity: 1;
    transform: translateY(0);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 300;
    line-height: 0.9;
    letter-spacing: -0.03em;
    margin-bottom: 2rem;
    font-feature-settings: 'onum' 1, 'liga' 1;
}

.title-line {
    display: inline-block;
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.title-line-1 {
    transition-delay: 0.3s;
    color: var(--soft-white);
}

.title-line-2 {
    transition-delay: 0.5s;
    color: var(--aurora-teal);
}

.title-dot {
    display: inline-block;
    color: var(--aurora-rose);
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.5s ease 0.4s, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s;
}

.visible .title-line,
.visible .title-dot {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 300;
    color: var(--silver-blue);
    max-width: 400px;
    line-height: 1.6;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease 0.6s, transform 0.6s ease 0.6s;
}

.visible .hero-subtitle {
    opacity: 1;
    transform: translateY(0);
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    animation: fadeInUp 0.6s ease 1.2s forwards;
}

.scroll-text {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--silver-blue);
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--aurora-teal), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
    50% { opacity: 1; transform: scaleY(1); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* --- Section Labels --- */
.section-label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--aurora-teal);
    margin-bottom: 2rem;
    opacity: 0.7;
}

/* --- Section Titles --- */
.section-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 300;
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin-bottom: 2rem;
    color: var(--soft-white);
    font-feature-settings: 'onum' 1;
}

.section-body {
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--silver-blue);
    max-width: 560px;
}

/* --- Philosophy Section --- */
.section-philosophy {
    background: radial-gradient(
        ellipse at 30% 60%,
        rgba(10, 122, 138, 0.1) 0%,
        transparent 60%
    );
}

/* --- Craft Section --- */
.section-craft {
    background: radial-gradient(
        ellipse at 70% 40%,
        rgba(196, 122, 138, 0.08) 0%,
        transparent 60%
    );
}

.craft-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
    margin-top: 1rem;
}

.craft-item {
    padding: 2rem 0;
    border-top: 1px solid rgba(248, 246, 255, 0.06);
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.visible .craft-item:nth-child(1) { transition-delay: 0.2s; }
.visible .craft-item:nth-child(2) { transition-delay: 0.35s; }
.visible .craft-item:nth-child(3) { transition-delay: 0.5s; }

.visible .craft-item {
    opacity: 1;
    transform: translateY(0);
}

.craft-icon {
    margin-bottom: 1.5rem;
}

.craft-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--soft-white);
}

.craft-desc {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.6;
    color: var(--silver-blue);
}

/* --- Aurora Palette Section --- */
.section-aurora {
    background: radial-gradient(
        ellipse at 50% 50%,
        rgba(74, 14, 143, 0.08) 0%,
        transparent 60%
    );
}

.color-spectrum {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.color-swatch {
    text-align: center;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.visible .color-swatch:nth-child(1) { transition-delay: 0.1s; }
.visible .color-swatch:nth-child(2) { transition-delay: 0.15s; }
.visible .color-swatch:nth-child(3) { transition-delay: 0.2s; }
.visible .color-swatch:nth-child(4) { transition-delay: 0.25s; }
.visible .color-swatch:nth-child(5) { transition-delay: 0.3s; }
.visible .color-swatch:nth-child(6) { transition-delay: 0.35s; }
.visible .color-swatch:nth-child(7) { transition-delay: 0.4s; }
.visible .color-swatch:nth-child(8) { transition-delay: 0.45s; }

.visible .color-swatch {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.swatch-fill {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    background-color: var(--swatch-color);
    margin-bottom: 0.75rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(248, 246, 255, 0.06);
}

.color-swatch:hover .swatch-fill {
    transform: scale(1.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.swatch-label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--soft-white);
    margin-bottom: 0.25rem;
}

.swatch-hex {
    display: block;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 300;
    color: var(--silver-blue);
    opacity: 0.6;
}

/* --- Contact Section --- */
.section-contact {
    background: radial-gradient(
        ellipse at 50% 70%,
        rgba(212, 135, 10, 0.06) 0%,
        transparent 60%
    );
}

.section-title-contact {
    font-size: clamp(2rem, 5vw, 4.5rem);
}

.contact-link {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 400;
    color: var(--aurora-teal);
    text-decoration: none;
    padding: 0.75rem 0;
    margin-bottom: 4rem;
    position: relative;
    transition: color 0.3s ease;
}

.contact-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--aurora-teal);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-link:hover {
    color: var(--soft-white);
}

.contact-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.footer-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(248, 246, 255, 0.06);
}

.footer-copy,
.footer-tagline {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 300;
    color: var(--silver-blue);
    opacity: 0.5;
}

/* --- Section Navigation --- */
.section-nav {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(248, 246, 255, 0.3);
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.nav-dot:hover {
    border-color: var(--aurora-teal);
    background: rgba(10, 122, 138, 0.3);
}

.nav-dot.active {
    border-color: var(--aurora-teal);
    background: var(--aurora-teal);
    transform: scale(1.2);
}

/* --- Morph Transition Overlay --- */
.morph-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    clip-path: circle(0% at 50% 50%);
    transition: clip-path 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.morph-overlay.active {
    clip-path: circle(150% at 50% 50%);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section {
        padding: 60px 24px;
    }

    .craft-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .color-spectrum {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .section-nav {
        right: 1rem;
    }

    .nav-dot {
        width: 8px;
        height: 8px;
    }

    .footer-line {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .hero-title {
        font-size: clamp(3rem, 15vw, 6rem);
    }
}

@media (max-width: 480px) {
    .color-spectrum {
        grid-template-columns: repeat(2, 1fr);
    }

    .section {
        padding: 40px 20px;
    }
}