/* ============================================
   mechanic.monster — Vaporwave Mechanical Dreamscape

   Palette:
     Deep Void:      #0A0818
     Lavender Cream:  #E8D0E8
     Mauve Grey:      #C0B0C0
     Ocean Purple:    #4040A0
     Ocean Teal:      #40A0A0
     Bokeh Pink:      #E870A0
     Grid Grey:       #2A2A3A

   Fonts:
     Display: Space Grotesk 500, 700
     Body:    Work Sans 300, 400
   ============================================ */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #0A0818;
    color: #C0B0C0;
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.75;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* --- Bokeh Background --- */
#bokeh-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    will-change: transform, opacity;
    animation: bokehDrift linear infinite, bokehFade ease-in-out infinite;
}

@keyframes bokehDrift {
    0% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -40px) scale(1.05);
    }
    50% {
        transform: translate(-20px, -80px) scale(0.95);
    }
    75% {
        transform: translate(10px, -120px) scale(1.02);
    }
    100% {
        transform: translate(-15px, -160px) scale(1);
    }
}

@keyframes bokehFade {
    0%, 100% {
        opacity: 0;
    }
    20% {
        opacity: 0.6;
    }
    80% {
        opacity: 0.4;
    }
}

/* --- Blueprint Grid Overlay --- */
#grid-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(64, 64, 160, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(64, 64, 160, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* --- Sections & Content Positioning --- */
.section-hero,
.floating-panel,
.section-sigil {
    position: relative;
    z-index: 2;
}

/* --- Hero Section --- */
.section-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    text-align: center;
    padding: 2rem;
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 8vw, 6rem);
    line-height: 1.1;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, #4040A0, #E870A0, #40A0A0, #E8D0E8);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transform: translateY(30px);
    animation: heroFadeIn 2s ease 0.5s forwards, gradientShift 8s ease 0.5s infinite;
}

.title-line {
    display: block;
}

.title-dot {
    display: inline;
    font-size: 0.7em;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes heroFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    color: #C0B0C0;
    letter-spacing: 0.25em;
    text-transform: lowercase;
    opacity: 0;
    animation: subtitleFadeIn 2s ease 1.5s forwards;
}

@keyframes subtitleFadeIn {
    0% {
        opacity: 0;
        transform: translateY(15px);
    }
    100% {
        opacity: 0.7;
        transform: translateY(0);
    }
}

.hero-ornament {
    width: 200px;
    opacity: 0;
    animation: ornamentFadeIn 2s ease 2.2s forwards;
}

.ornament-line {
    width: 100%;
    height: 2px;
}

@keyframes ornamentFadeIn {
    0% {
        opacity: 0;
        transform: scaleX(0);
    }
    100% {
        opacity: 1;
        transform: scaleX(1);
    }
}

/* --- Floating Panels --- */
.floating-panel {
    position: relative;
    max-width: 520px;
    margin: 6rem auto;
    padding: 2.5rem;
    background: rgba(42, 42, 58, 0.35);
    border: 1px solid rgba(64, 64, 160, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    cursor: grab;
    user-select: none;
}

.floating-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

.floating-panel.oscillating {
    animation: panelOscillate 8s ease-in-out infinite;
}

@keyframes panelOscillate {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Gradient border glow effect */
.panel-border-glow {
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(135deg, rgba(64, 64, 160, 0.4), rgba(232, 112, 160, 0.3), rgba(64, 160, 160, 0.4));
    z-index: -1;
    opacity: 0.6;
    transition: opacity 0.4s ease;
}

.panel-border-glow::after {
    content: "";
    position: absolute;
    top: 1px;
    left: 1px;
    right: 1px;
    bottom: 1px;
    background: rgba(42, 42, 58, 0.92);
}

.floating-panel:hover .panel-border-glow {
    opacity: 1;
}

/* Panel position offsets for organic-flow layout */
.panel-workshop {
    margin-left: 10%;
}

.panel-workshop.oscillating {
    animation-delay: 0s;
}

.panel-engine {
    margin-left: auto;
    margin-right: 10%;
}

.panel-engine.oscillating {
    animation-delay: 1.3s;
}

.panel-circuit {
    margin-left: 15%;
}

.panel-circuit.oscillating {
    animation-delay: 2.6s;
}

.panel-marble {
    margin-left: auto;
    margin-right: 15%;
}

.panel-marble.oscillating {
    animation-delay: 3.9s;
}

.panel-neon {
    margin-left: 8%;
}

.panel-neon.oscillating {
    animation-delay: 5.2s;
}

/* Panel dragging state */
.floating-panel.dragging {
    cursor: grabbing;
    transition: none;
    animation: none;
    box-shadow:
        0 0 40px rgba(64, 64, 160, 0.3),
        0 0 80px rgba(232, 112, 160, 0.15);
}

.floating-panel.snapping {
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- Panel Inner Content --- */
.panel-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.panel-icon {
    width: 60px;
    height: 60px;
}

.panel-icon svg {
    width: 100%;
    height: 100%;
}

.panel-heading {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
    color: #E8D0E8;
    letter-spacing: 0.03em;
}

.panel-text {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    line-height: 1.75;
    color: #C0B0C0;
}

/* --- Sigil Section --- */
.section-sigil {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem;
    text-align: center;
}

.sigil-mark {
    width: 120px;
    height: 120px;
    animation: sigilRotate 30s linear infinite;
}

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

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

.sigil-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 500;
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    color: #E8D0E8;
    letter-spacing: 0.3em;
    text-transform: lowercase;
    margin-top: 2rem;
    opacity: 0.5;
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .floating-panel {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
        max-width: none;
        padding: 2rem 1.5rem;
    }

    .panel-workshop,
    .panel-engine,
    .panel-circuit,
    .panel-marble,
    .panel-neon {
        margin-left: 1.5rem;
        margin-right: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .floating-panel {
        margin-top: 4rem;
        margin-bottom: 4rem;
        padding: 1.5rem 1.25rem;
    }
}
