/* ============================================
   mechanic.monster - Glassmorphic Technical Library
   ============================================ */

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

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

body {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    line-height: 1.7;
    color: #2A2040;
    background: linear-gradient(180deg, #E8E4F0 0%, #F0E8E4 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* --- Accent Color Utilities --- */
.accent-mint {
    color: #A8D8C8;
}

.accent-peach {
    color: #F0C4A8;
}

/* --- Glass Panel Base --- */
.glass-panel {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
}

.glass-panel-strong {
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ============================================
   SECTION 1: Observation Deck (Hero)
   ============================================ */
.observation-deck {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0 10vw;
    overflow: hidden;
    background: linear-gradient(180deg, #E8E4F0 0%, #F0E8E4 100%);
}

.hero-title-group {
    position: relative;
    z-index: 2;
    margin-top: 20vh;
}

.hero-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(4rem, 10vw, 8rem);
    text-transform: uppercase;
    color: #2A2040;
    line-height: 0.9;
    letter-spacing: -0.02em;
    opacity: 0;
    transform: translateX(-50px);
    animation: slideInTitle 500ms ease-out forwards;
}

.hero-subtitle {
    display: block;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #7A6B90;
    line-height: 1.1;
    opacity: 0;
    animation: fadeInSubtitle 400ms ease-out 800ms forwards;
}

.hero-panel {
    position: absolute;
    right: 10vw;
    top: 50%;
    transform: translateY(-50%);
    width: 60vw;
    max-width: 600px;
    min-height: 280px;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 1;
    opacity: 0;
    animation: panelAssemble 600ms ease-out 300ms forwards;
}

.panel-icon {
    display: flex;
    align-items: center;
}

.panel-icon svg {
    flex-shrink: 0;
}

.hero-panel .panel-body {
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    line-height: 1.7;
    color: #2A2040;
}

/* ============================================
   SECTION 2: Component Gallery
   ============================================ */
.component-gallery {
    position: relative;
    width: 100%;
    padding: 6rem 8vw 8rem;
    background: linear-gradient(180deg, #F0E8E4 0%, #E8E4F0 50%, #F0E8E4 100%);
}

.gallery-flow {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    align-items: flex-start;
}

.gallery-panel {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 500ms ease-out, transform 500ms ease-out;
}

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

.panel-sm {
    flex: 0 1 280px;
    min-height: 260px;
}

.panel-md {
    flex: 0 1 340px;
    min-height: 280px;
}

.panel-lg {
    flex: 0 1 400px;
    min-height: 300px;
}

/* Organic overlap: negative margins on alternating panels */
.gallery-panel:nth-child(even) {
    margin-top: -15px;
}

.gallery-panel:nth-child(3n) {
    margin-top: 10px;
}

.panel-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    color: #2A2040;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.panel-text {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    line-height: 1.7;
    color: #2A2040;
}

.panel-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: auto;
    padding-top: 0.5rem;
}

.panel-illustration svg {
    display: block;
}

/* SVG line-draw animation for illustrations */
.panel-illustration svg line,
.panel-illustration svg path,
.panel-illustration svg polyline,
.panel-illustration svg circle[stroke="#2A2040"],
.panel-illustration svg rect[stroke="#2A2040"] {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 400ms ease-out;
}

.gallery-panel.panel-visible .panel-illustration svg line,
.gallery-panel.panel-visible .panel-illustration svg path,
.gallery-panel.panel-visible .panel-illustration svg polyline,
.gallery-panel.panel-visible .panel-illustration svg circle[stroke="#2A2040"],
.gallery-panel.panel-visible .panel-illustration svg rect[stroke="#2A2040"] {
    stroke-dashoffset: 0;
}

/* ============================================
   SECTION 3: Deep Reference
   ============================================ */
.deep-reference {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    background: linear-gradient(180deg, #F0E8E4 0%, #E8E4F0 100%);
}

.reference-panel {
    width: 80vw;
    max-width: 1000px;
    min-height: 50vh;
    padding: 3rem;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 800ms ease-out, transform 800ms ease-out, backdrop-filter 800ms ease-out;
}

.reference-panel.panel-visible {
    opacity: 1;
    transform: scale(1);
}

.reference-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: #2A2040;
    text-transform: uppercase;
    margin-bottom: 2rem;
    text-align: center;
}

.reference-grid {
    width: 100%;
    overflow-x: auto;
}

.reference-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Barlow Condensed', sans-serif;
}

.reference-table thead {
    border-bottom: 2px solid rgba(42, 32, 64, 0.2);
}

.reference-table th {
    font-weight: 600;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    color: #7A6B90;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: left;
    padding: 0.75rem 1rem;
}

.reference-table td {
    font-weight: 400;
    font-size: clamp(0.85rem, 1vw, 0.95rem);
    color: #2A2040;
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

.reference-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.15);
}

.data-label {
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    color: #7A6B90;
}

/* ============================================
   SECTION 4: Scholarly Footer
   ============================================ */
.scholarly-footer {
    position: relative;
    width: 100%;
    padding: 6rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #F0E8E4 0%, #E8E4F0 100%);
}

.footer-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 3rem;
    width: 200px;
    min-height: 120px;
    justify-content: center;
}

.footer-text {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 300;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    color: #7A6B90;
    text-transform: uppercase;
}

/* ============================================
   Keyframe Animations
   ============================================ */
@keyframes slideInTitle {
    0% {
        opacity: 0;
        transform: translateX(-50px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInSubtitle {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes panelAssemble {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 900px) {
    .observation-deck {
        flex-direction: column;
        align-items: flex-start;
        padding: 0 6vw;
        height: auto;
        min-height: 100vh;
    }

    .hero-title-group {
        margin-top: 10vh;
    }

    .hero-panel {
        position: relative;
        right: auto;
        top: auto;
        transform: none;
        width: 100%;
        max-width: none;
        margin-top: 3rem;
        margin-bottom: 4rem;
        opacity: 0;
        animation: panelAssembleMobile 600ms ease-out 300ms forwards;
    }

    .gallery-flow {
        flex-direction: column;
        align-items: center;
    }

    .panel-sm, .panel-md, .panel-lg {
        flex: 0 1 auto;
        width: 100%;
        max-width: 480px;
    }

    .gallery-panel:nth-child(even),
    .gallery-panel:nth-child(3n) {
        margin-top: 0;
    }

    .reference-panel {
        width: 95vw;
        padding: 2rem 1.5rem;
    }

    .reference-table th,
    .reference-table td {
        padding: 0.5rem 0.5rem;
        font-size: 0.8rem;
    }
}

@keyframes panelAssembleMobile {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (max-width: 480px) {
    .observation-deck {
        padding: 0 4vw;
    }

    .component-gallery {
        padding: 4rem 4vw 6rem;
    }

    .footer-panel {
        width: 160px;
        padding: 1.5rem 2rem;
    }
}
