/* ============================================
   mechanic.party — Sunset Workshop Isometric
   ============================================ */

/* CSS Custom Properties — Sunset Over the Workshop */
:root {
    --amber-glow: #e8943a;
    --terracotta-dusk: #c4573e;
    --deep-indigo: #2b2d54;
    --blush-cream: #faf0e4;
    --plum-shadow: #5c3a6e;
    --soft-coral: #f2a07b;
    --pewter-grey: #8a8d93;
    --warm-white: #fdf8f0;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Nunito Sans', 'Segoe UI', sans-serif;
    --font-accent: 'Recursive', 'Courier New', monospace;

    --light-x: 50%;
    --light-y: 50%;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--deep-indigo);
    background-color: var(--warm-white);
    overflow-x: hidden;
    position: relative;
}

/* ============================================
   Cursor-Follow Light
   ============================================ */
#cursor-light {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 148, 58, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    will-change: transform;
    mix-blend-mode: screen;
}

/* ============================================
   Watercolor Background Effects
   ============================================ */
.watercolor-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.wc-blob {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: multiply;
    filter: blur(60px);
    animation: wcPulse 12s ease-in-out infinite alternate;
}

.wc-blob-1 {
    width: 500px;
    height: 500px;
    top: -10%;
    right: 10%;
    background: radial-gradient(circle, rgba(232, 148, 58, 0.15) 0%, transparent 70%);
    animation-delay: 0s;
}

.wc-blob-2 {
    width: 400px;
    height: 400px;
    top: 20%;
    right: 30%;
    background: radial-gradient(circle, rgba(242, 160, 123, 0.12) 0%, transparent 70%);
    animation-delay: -3s;
}

.wc-blob-3 {
    width: 350px;
    height: 350px;
    bottom: 10%;
    left: 5%;
    background: radial-gradient(circle, rgba(92, 58, 110, 0.1) 0%, transparent 70%);
    animation-delay: -6s;
}

.wc-blob-4 {
    width: 300px;
    height: 300px;
    top: 40%;
    left: 20%;
    background: radial-gradient(circle, rgba(196, 87, 62, 0.08) 0%, transparent 70%);
    animation-delay: -9s;
}

.wc-blob-5 {
    width: 450px;
    height: 450px;
    top: -5%;
    left: -5%;
    background: radial-gradient(circle, rgba(232, 148, 58, 0.1) 0%, transparent 70%);
    animation-delay: -2s;
}

.wc-blob-6 {
    width: 380px;
    height: 380px;
    bottom: -10%;
    right: 10%;
    background: radial-gradient(circle, rgba(242, 160, 123, 0.1) 0%, transparent 70%);
    animation-delay: -7s;
}

.wc-blob-7 {
    width: 500px;
    height: 500px;
    top: 10%;
    right: -5%;
    background: radial-gradient(circle, rgba(232, 148, 58, 0.08) 0%, transparent 70%);
    animation-delay: -1s;
}

.wc-blob-8 {
    width: 400px;
    height: 400px;
    bottom: 5%;
    left: 10%;
    background: radial-gradient(circle, rgba(92, 58, 110, 0.08) 0%, transparent 70%);
    animation-delay: -5s;
}

@keyframes wcPulse {
    0% { transform: scale(1) translate(0, 0); opacity: 1; }
    50% { transform: scale(1.15) translate(10px, -10px); opacity: 0.8; }
    100% { transform: scale(1.05) translate(-5px, 5px); opacity: 0.9; }
}

/* ============================================
   Section 1: Hero — Rooftop Observatory
   ============================================ */
.section-hero {
    position: relative;
    min-height: 100vh;
    background-color: var(--warm-white);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    padding: 0 0 8vh 0;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding-left: 12vw;
    padding-bottom: 5vh;
    max-width: 45%;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(3rem, 5vw, 5rem);
    color: var(--deep-indigo);
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.hero-underline {
    width: 200px;
    height: 6px;
    background: linear-gradient(90deg, var(--amber-glow), var(--soft-coral), transparent);
    border-radius: 3px;
    margin-bottom: 1.5rem;
    filter: blur(1px);
    animation: underlineBleed 4s ease-in-out infinite alternate;
}

@keyframes underlineBleed {
    0% { width: 200px; filter: blur(1px); }
    100% { width: 260px; filter: blur(2px); }
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--plum-shadow);
    letter-spacing: 0.01em;
}

/* Cityscape — positioned right 65% */
.hero-cityscape {
    position: absolute;
    top: 0;
    right: 0;
    width: 65%;
    height: 100%;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.city-svg {
    width: 100%;
    height: auto;
    max-height: 90vh;
}

/* Steam animations */
.steam {
    animation: steamRise 8s ease-in-out infinite;
}

.steam-1 { animation-delay: 0s; }
.steam-2 { animation-delay: -2.5s; }
.steam-3 { animation-delay: -5s; }

@keyframes steamRise {
    0% { opacity: 0; transform: translateY(0); }
    20% { opacity: 0.3; }
    50% { opacity: 0.2; transform: translateY(-10px); }
    80% { opacity: 0.1; transform: translateY(-20px); }
    100% { opacity: 0; transform: translateY(-30px); }
}

/* Slow rotating gears */
.gear {
    position: absolute;
    opacity: 0.6;
}

.gear-1 {
    width: 120px;
    height: 120px;
    bottom: 15%;
    right: 55%;
    animation: gearSpin 60s linear infinite;
}

.gear-2 {
    width: 80px;
    height: 80px;
    bottom: 25%;
    right: 48%;
    animation: gearSpin 60s linear infinite reverse;
}

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

/* ============================================
   Isometric Diagonal Dividers
   ============================================ */
.iso-divider {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 3;
    overflow: hidden;
}

.iso-divider::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -5%;
    width: 110%;
    height: 100%;
    background: var(--blush-cream);
    transform: skewY(-2.5deg);
    transform-origin: bottom left;
}

.iso-divider-hero::before {
    background: var(--blush-cream);
}

.iso-divider-workshop::before {
    background: var(--deep-indigo);
}

.iso-divider-engine::before {
    background: var(--blush-cream);
}

.iso-divider-street::before {
    background: linear-gradient(135deg, var(--plum-shadow), var(--deep-indigo));
}

/* ============================================
   Section 2: Workshop — Upper Workshop (About)
   ============================================ */
.section-workshop {
    position: relative;
    background-color: var(--blush-cream);
    padding: 10vh 12vw 12vh;
    overflow: hidden;
}

.skyline-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 0;
    pointer-events: none;
}

.workshop-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

/* Isometric Tiles */
.iso-tile {
    max-width: 550px;
    background: rgba(253, 248, 240, 0.85);
    border: 1px solid rgba(232, 148, 58, 0.15);
    padding: 2.5rem;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.iso-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(232, 148, 58, 0.05), transparent);
    pointer-events: none;
}

.iso-tile:hover {
    box-shadow: 12px 12px 30px rgba(92, 58, 110, 0.1),
                -4px -4px 20px rgba(232, 148, 58, 0.05);
}

.tile-left {
    align-self: flex-start;
    transform: perspective(1000px) rotateY(2deg) rotateX(-1deg);
}

.tile-left:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

.tile-right {
    align-self: flex-end;
    transform: perspective(1000px) rotateY(-2deg) rotateX(-1deg);
}

.tile-right:hover {
    transform: perspective(1000px) rotateY(0deg) rotateX(0deg);
}

/* Tile animation states */
.tile-animate {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.tile-animate[data-direction="left"] {
    transform: perspective(1000px) rotateY(2deg) rotateX(-1deg) translateX(-80px) translateY(30px);
}

.tile-animate[data-direction="right"] {
    transform: perspective(1000px) rotateY(-2deg) rotateX(-1deg) translateX(80px) translateY(30px);
}

.tile-animate.visible {
    opacity: 1;
}

.tile-animate.visible[data-direction="left"] {
    transform: perspective(1000px) rotateY(2deg) rotateX(-1deg) translateX(0) translateY(0);
}

.tile-animate.visible[data-direction="right"] {
    transform: perspective(1000px) rotateY(-2deg) rotateX(-1deg) translateX(0) translateY(0);
}

.tile-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
}

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

.tile-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--deep-indigo);
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.tile-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--plum-shadow);
}

/* Workshop Shelves */
.workshop-shelves {
    position: absolute;
    right: 8vw;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 1;
}

.shelf {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem 0.5rem 0.75rem;
    background: rgba(253, 248, 240, 0.7);
    border-bottom: 2px solid rgba(232, 148, 58, 0.2);
    transform: perspective(600px) rotateY(-5deg);
    transition: transform 0.3s ease;
}

.shelf:hover {
    transform: perspective(600px) rotateY(0deg);
}

.shelf-icon {
    width: 28px;
    height: 28px;
}

.shelf-label {
    font-family: var(--font-accent);
    font-size: 0.8rem;
    font-weight: 450;
    letter-spacing: 0.05em;
    color: var(--pewter-grey);
    text-transform: uppercase;
}

/* ============================================
   Section 3: Engine Room (Features)
   ============================================ */
.section-engine {
    position: relative;
    background-color: var(--deep-indigo);
    padding: 10vh 12vw 14vh;
    overflow: hidden;
}

.engine-content {
    position: relative;
    z-index: 1;
}

.engine-header {
    margin-bottom: 5rem;
}

.engine-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    color: var(--warm-white);
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.engine-subtitle {
    font-family: var(--font-accent);
    font-size: 0.9rem;
    font-weight: 450;
    letter-spacing: 0.05em;
    color: var(--soft-coral);
    text-transform: uppercase;
}

.engine-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

/* Diagram */
.engine-diagram {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.diagram-svg {
    width: 100%;
    max-width: 300px;
    height: auto;
}

/* SVG draw animation */
.draw-path {
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    transition: stroke-dashoffset 2s ease-out;
}

.diagram-animate.visible .draw-path {
    stroke-dashoffset: 0;
}

.diagram-animate.visible .gear-outer {
    stroke-dasharray: 503;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 2.5s ease-out;
}

.diagram-animate.visible .gear-inner {
    stroke-dasharray: 189;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1.5s ease-out 0.5s;
}

.diagram-animate.visible .spring-path {
    stroke-dasharray: 200;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1.8s ease-out 0.8s;
}

/* Engine text blocks */
.engine-text-blocks {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.engine-block {
    padding: 2rem;
    border-left: 3px solid var(--amber-glow);
    background: rgba(253, 248, 240, 0.04);
}

.block-animate {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.block-animate.visible {
    opacity: 1;
    transform: translateX(0);
}

.block-label {
    font-family: var(--font-accent);
    font-size: 0.8rem;
    font-weight: 450;
    letter-spacing: 0.05em;
    color: var(--pewter-grey);
    display: block;
    margin-bottom: 0.5rem;
}

.block-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--amber-glow);
    letter-spacing: -0.03em;
    margin-bottom: 0.75rem;
}

.block-body {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(253, 248, 240, 0.75);
}

/* ============================================
   Section 4: Street Level (Community/Gallery)
   ============================================ */
.section-street {
    position: relative;
    background-color: var(--blush-cream);
    padding: 10vh 12vw 14vh;
    overflow: hidden;
}

.street-content {
    position: relative;
    z-index: 1;
}

.street-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    color: var(--deep-indigo);
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.street-subtitle {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--plum-shadow);
    margin-bottom: 4rem;
}

/* Card Gallery */
.card-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
}

.iso-card {
    position: relative;
    background: var(--warm-white);
    border: 1px solid rgba(232, 148, 58, 0.12);
    padding: 2rem;
    overflow: hidden;
    transform: perspective(800px) rotateX(2deg) rotateY(-2deg);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.iso-card:hover {
    transform: perspective(800px) rotateX(0deg) rotateY(0deg);
    box-shadow: 8px 12px 30px rgba(92, 58, 110, 0.12),
                0 0 0 1px rgba(232, 148, 58, 0.2);
}

.card-animate {
    opacity: 0;
    transform: perspective(800px) rotateX(2deg) rotateY(-2deg) translateY(40px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out, box-shadow 0.4s ease;
}

.card-animate.visible {
    opacity: 1;
    transform: perspective(800px) rotateX(2deg) rotateY(-2deg) translateY(0);
}

.card-animate.visible:hover {
    transform: perspective(800px) rotateX(0deg) rotateY(0deg) translateY(0);
}

.card-watercolor {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(242, 160, 123, 0.15) 0%, transparent 70%);
    filter: blur(20px);
    pointer-events: none;
}

.card-icon-wrap {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
}

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

.card-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--deep-indigo);
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.card-text {
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--plum-shadow);
}

/* ============================================
   Section 5: The Underground (Footer)
   ============================================ */
.section-underground {
    position: relative;
    background: linear-gradient(180deg, var(--plum-shadow), var(--deep-indigo));
    padding: 8vh 12vw;
    overflow: hidden;
    min-height: 40vh;
}

.underground-reflection {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.6;
}

.reflection-skyline {
    width: 100%;
    height: auto;
    position: absolute;
    bottom: 0;
}

.underground-content {
    position: relative;
    z-index: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding-top: 4vh;
}

.footer-nav {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    font-weight: 450;
    letter-spacing: 0.05em;
    color: var(--soft-coral);
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.3s ease;
    position: relative;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--amber-glow);
    transition: width 0.3s ease;
}

.footer-link:hover {
    color: var(--amber-glow);
}

.footer-link:hover::after {
    width: 100%;
}

.footer-quote {
    font-family: var(--font-display);
    font-weight: 700;
    font-style: italic;
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    color: var(--warm-white);
    letter-spacing: -0.02em;
    margin-top: 1rem;
}

.footer-domain {
    font-family: var(--font-accent);
    font-size: 0.8rem;
    font-weight: 450;
    letter-spacing: 0.1em;
    color: var(--pewter-grey);
    text-transform: uppercase;
    margin-top: 1rem;
}

/* ============================================
   Watercolor Splatter Transitions
   ============================================ */
.splatter {
    position: fixed;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.splatter-1 {
    top: 28%;
    right: 5%;
    width: 200px;
}

.splatter-2 {
    top: 62%;
    left: 3%;
    width: 180px;
}

.splatter.visible {
    opacity: 1;
}

/* ============================================
   Skyline backgrounds
   ============================================ */
.skyline-bg-2 {
    bottom: 0;
    left: 0;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .hero-content {
        padding-left: 8vw;
        max-width: 55%;
    }

    .hero-cityscape {
        width: 55%;
    }

    .engine-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .engine-diagram {
        order: -1;
    }

    .card-gallery {
        grid-template-columns: 1fr;
    }

    .workshop-shelves {
        display: none;
    }
}

@media (max-width: 768px) {
    .section-hero {
        flex-direction: column;
        align-items: flex-start;
        padding: 4vh 6vw 6vh;
        min-height: auto;
    }

    .hero-content {
        padding-left: 0;
        max-width: 100%;
        order: 2;
    }

    .hero-cityscape {
        position: relative;
        width: 100%;
        height: 40vh;
        order: 1;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .section-workshop,
    .section-engine,
    .section-street {
        padding: 8vh 6vw 10vh;
    }

    .iso-tile {
        max-width: 100%;
    }

    .tile-left,
    .tile-right {
        align-self: stretch;
        transform: none;
    }

    .tile-animate[data-direction="left"],
    .tile-animate[data-direction="right"] {
        transform: translateY(30px);
    }

    .tile-animate.visible[data-direction="left"],
    .tile-animate.visible[data-direction="right"] {
        transform: translateY(0);
    }

    .iso-card {
        transform: none;
    }

    .card-animate {
        transform: translateY(30px);
    }

    .card-animate.visible {
        transform: translateY(0);
    }

    .footer-nav {
        gap: 1.5rem;
    }
}
