/* namu.style — Submerged forest, surreal underwater descent */
/* Stacked sections, card-flip, Jost + Libre Baskerville */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Libre Baskerville', serif;
    background: #0A1628;
    color: #A0C4C4;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Depth sections */
.depth-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 5vh 5vw;
}

/* Section backgrounds — progressive depth */
.surface {
    background: linear-gradient(180deg, #0F2A3E 0%, #0A1628 100%);
    justify-content: flex-start;
    padding-top: 20vh;
}

.canopy {
    background: linear-gradient(180deg, #0A1628 0%, #0A1A2E 50%, #081828 100%);
    align-items: flex-start;
    padding-left: 12vw;
}

.trunk {
    background: linear-gradient(180deg, #081828 0%, #061420 50%, #051018 100%);
}

.roots {
    background: linear-gradient(180deg, #051018 0%, #040E16 50%, #030A10 100%);
    align-items: flex-end;
    padding-right: 12vw;
}

.floor {
    background: linear-gradient(180deg, #030A10 0%, #020810 50%, #01060C 100%);
}

/* Depth labels */
.depth-label {
    position: absolute;
    top: 24px;
    right: 24px;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #4A8A8A;
    opacity: 0.6;
}

/* Section content */
.section-content {
    position: relative;
    z-index: 2;
}

/* Site title — letter-by-letter reveal */
.site-title {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: 72px;
    letter-spacing: 0.04em;
    color: #E0F0F0;
    text-align: center;
    margin-bottom: 48px;
}

.site-title .letter {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.12s ease;
}

.site-title .letter.visible {
    opacity: 1;
}

/* Chevron pulse */
.chevron-down {
    text-align: center;
    animation: chevronPulse 2s ease-in-out infinite;
}

@keyframes chevronPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* Icon clusters */
.icon-cluster {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}

.surface-icons {
    bottom: 15vh;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0.5;
}

.canopy-icons {
    top: 10vh;
    right: 10vw;
    opacity: 0.3;
}

/* Cards */
.card {
    width: 360px;
    height: 420px;
    perspective: 1000px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border: 1px solid rgba(46, 139, 139, 0.3);
    border-radius: 4px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.card-front {
    background: rgba(10, 22, 40, 0.8);
}

.card-back {
    background: rgba(15, 42, 62, 0.9);
    transform: rotateY(180deg);
    justify-content: center;
}

.card-icon {
    margin-bottom: 32px;
    opacity: 0.8;
}

.card-title {
    font-family: 'Jost', sans-serif;
    font-weight: 600;
    font-size: 28px;
    letter-spacing: 0.04em;
    color: #E0F0F0;
    margin-bottom: 12px;
}

.card-subtitle {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 16px;
    color: #4A8A8A;
}

.card-detail {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.8;
    color: #A0C4C4;
}

/* Bubbles */
.bubble-cluster {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.bubble {
    position: absolute;
    bottom: -20px;
    left: var(--x);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    border: 1px solid rgba(46, 139, 139, 0.4);
    background: transparent;
    animation: bubbleRise 6s ease-in infinite;
    animation-delay: var(--delay);
}

@keyframes bubbleRise {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0.6;
    }
    50% {
        transform: translateY(-50vh) translateX(10px);
        opacity: 0.4;
    }
    100% {
        transform: translateY(-100vh) translateX(-5px);
        opacity: 0;
    }
}

/* Floor particles */
.floor-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    bottom: 10%;
    left: var(--x);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #F4A460;
    opacity: 0;
    animation: particleDrift 5s ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes particleDrift {
    0%, 100% { opacity: 0; transform: translateY(0); }
    50% { opacity: 0.5; transform: translateY(-20px); }
}

/* Depth gauge */
.depth-gauge {
    position: fixed;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 30vh;
    background: rgba(46, 139, 139, 0.15);
    z-index: 100;
    border-radius: 1px;
}

.depth-gauge-fill {
    width: 100%;
    height: 0%;
    background: #2E8B8B;
    border-radius: 1px;
    transition: height 150ms linear;
}

.depth-gauge-marker {
    position: absolute;
    left: -3px;
    top: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #F4A460;
    transition: top 150ms linear;
}

/* Responsive */
@media (max-width: 768px) {
    .site-title {
        font-size: 42px;
    }

    .card {
        width: 300px;
        height: 380px;
    }

    .card-title {
        font-size: 22px;
    }

    .canopy {
        align-items: center;
        padding-left: 5vw;
    }

    .roots {
        align-items: center;
        padding-right: 5vw;
    }

    .depth-label {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 32px;
    }

    .card {
        width: 260px;
        height: 340px;
    }

    .card-front,
    .card-back {
        padding: 24px;
    }
}
