/* ========================================
   mechanic.monster - Styles
   Frutiger Aero underwater workshop
   ======================================== */

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

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

body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1vw, 17px);
    line-height: 1.7;
    color: #4A4A4A;
    background: #F5F5F5;
    overflow-x: hidden;
    position: relative;
}

/* --- Typography --- */
h1, h2 {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 600;
    color: #2A2A2A;
}

h2 {
    font-size: clamp(20px, 2.8vw, 40px);
    margin-bottom: 1rem;
}

p {
    color: #4A4A4A;
    max-width: 520px;
}

.tech-label {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    font-size: 12px;
    color: #A0A0A0;
    margin-top: 1.2rem;
    letter-spacing: 0.05em;
}

/* --- Water Bubbles Ambient Layer --- */
#bubble-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #FFFFFF 0%, transparent 40%, rgba(200,200,200,0.1) 100%);
    opacity: 0;
    animation: bubbleRise linear infinite;
}

@keyframes bubbleRise {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    5% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(-100px) translateX(var(--drift, 20px));
        opacity: 0;
    }
}

/* --- Floating Mechanical Parts Layer --- */
#floating-parts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.floating-part {
    position: absolute;
    opacity: 0.25;
    animation: floatPart 6s ease-in-out infinite alternate;
}

@keyframes floatPart {
    0% {
        transform: translateY(0px) rotate(0deg);
    }
    100% {
        transform: translateY(-15px) rotate(10deg);
    }
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #F5F5F5 0%, #D8D8D8 100%);
    z-index: 3;
    overflow: hidden;
}

.hero-inner {
    text-align: center;
    position: relative;
    z-index: 4;
}

#creature-svg {
    width: min(80vw, 600px);
    height: auto;
    margin-bottom: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#creature-svg.visible {
    opacity: 1;
}

.creature-path {
    stroke-dasharray: var(--path-length, 1000);
    stroke-dashoffset: var(--path-length, 1000);
    animation: pathDraw 3s ease forwards;
    animation-delay: 0.5s;
}

.creature-path-circle {
    stroke-dasharray: var(--path-length, 500);
    stroke-dashoffset: var(--path-length, 500);
    animation: pathDraw 3s ease forwards;
    animation-delay: 0.5s;
}

.creature-path-rect {
    stroke-dasharray: var(--path-length, 200);
    stroke-dashoffset: var(--path-length, 200);
    animation: pathDraw 3s ease forwards;
    animation-delay: 0.5s;
}

@keyframes pathDraw {
    to {
        stroke-dashoffset: 0;
    }
}

.logotype {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(24px, 3.5vw, 48px);
    color: #2A2A2A;
    letter-spacing: 0.02em;
    opacity: 0;
    animation: fadeInUp 1.2s ease forwards;
    animation-delay: 1s;
}

.tagline {
    font-family: 'Inter', sans-serif;
    font-size: clamp(12px, 1.2vw, 16px);
    color: #808080;
    margin-top: 0.5rem;
    opacity: 0;
    animation: fadeInUp 1.2s ease forwards;
    animation-delay: 1.4s;
}

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

/* --- Diagonal Sections --- */
.diagonal-section {
    position: relative;
    z-index: 3;
    background: #F0F0F0;
    transform: skewY(-3deg);
    margin: 0 -2%;
    padding: 6% calc(2% + 20px);
    overflow: hidden;
}

.diagonal-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.3) 0%, transparent 50%);
    pointer-events: none;
}

.diagonal-section.alt {
    background: #E8E8E8;
}

.diagonal-inner {
    transform: skewY(3deg);
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.section-content {
    display: flex;
    align-items: center;
    gap: 4rem;
}

.section-content.reverse {
    flex-direction: row-reverse;
}

.text-block {
    flex: 1;
    min-width: 0;
}

.blueprint-container {
    flex: 0 0 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blueprint-svg {
    width: 200px;
    height: 200px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.blueprint-svg.visible {
    opacity: 1;
    transform: translateY(0);
}

.bp-path {
    stroke-dasharray: var(--path-length, 800);
    stroke-dashoffset: var(--path-length, 800);
    transition: stroke-dashoffset 2s ease;
}

.bp-path.animate {
    stroke-dashoffset: 0;
}

.bp-label {
    opacity: 0;
    transition: opacity 1s ease 1.5s;
}

.bp-label.animate {
    opacity: 1;
}

/* --- Contact / Footer Section --- */
#section-contact {
    position: relative;
    z-index: 3;
    background: linear-gradient(180deg, #D8D8D8 0%, #F5F5F5 100%);
    padding: 8% 2rem;
    text-align: center;
}

.contact-inner {
    max-width: 600px;
    margin: 0 auto;
}

.contact-inner h2 {
    margin-bottom: 1rem;
}

.contact-inner p {
    max-width: 480px;
    margin: 0 auto 1rem;
}

.contact-logotype {
    font-family: 'Albert Sans', sans-serif;
    font-weight: 600;
    font-size: clamp(18px, 2vw, 28px);
    color: #A0A0A0;
    margin-top: 3rem;
    letter-spacing: 0.02em;
}

/* --- Floating Parts at Section Boundaries --- */
.section-boundary-part {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    opacity: 0.2;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .section-content,
    .section-content.reverse {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }

    .blueprint-container {
        flex: 0 0 auto;
    }

    .blueprint-svg {
        width: 160px;
        height: 160px;
    }

    p {
        max-width: 100%;
    }

    .diagonal-section {
        padding: 10% calc(2% + 16px);
    }

    .diagonal-inner {
        padding: 1.5rem 1rem;
    }

    #creature-svg {
        width: 90vw;
    }
}

@media (max-width: 480px) {
    .diagonal-section {
        transform: skewY(-2deg);
    }

    .diagonal-inner {
        transform: skewY(2deg);
    }

    .blueprint-svg {
        width: 140px;
        height: 140px;
    }
}
