/* riron.xyz — Vaporwave Alpine Wilderness */
/* Palette: #2d4a2d #4a2d5a #7a4a8b #b87dd4 #c4a882 */

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

html {
    scroll-snap-type: y proximity;
    scroll-behavior: smooth;
}

body {
    background: #0d1a0d;
    color: #d4dcc8;
    font-family: 'Inter', sans-serif;
    font-variation-settings: 'wght' 350;
    overflow-x: hidden;
}

/* Vaporwave gradient overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(170deg, rgba(74, 45, 90, 0.15) 0%, rgba(122, 74, 139, 0.08) 40%, rgba(45, 107, 74, 0.12) 70%, rgba(13, 26, 13, 0.3) 100%);
    pointer-events: none;
    z-index: 100;
}

/* Scan lines */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(74, 45, 90, 0.03) 2px, rgba(74, 45, 90, 0.03) 4px);
    pointer-events: none;
    z-index: 101;
    animation: chromatic-drift 20s ease-in-out infinite;
}

@keyframes chromatic-drift {
    0%, 100% { filter: hue-rotate(-5deg); }
    50% { filter: hue-rotate(5deg); }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #0d1a0d;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8b6b4a, #3a2a1a);
    border-radius: 6px;
    border: 2px solid #0d1a0d;
}

/* Summit Navigation */
#summit-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.summit-dot {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 10px solid #1a3a2a;
    cursor: pointer;
    transition: border-bottom-color 0.4s ease;
}

.summit-dot.active {
    border-bottom-color: #2d6b4a;
}

.summit-dot:hover {
    border-bottom-color: #7a4a8b;
}

/* Panels */
.panel {
    min-height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(4, 1fr);
    padding: 4vh 4vw;
    overflow: hidden;
}

/* Leather stitch border */
.leather-stitch-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 12px;
    background: repeating-linear-gradient(
        90deg,
        #8b6b4a 0px,
        #8b6b4a 8px,
        transparent 8px,
        transparent 12px,
        #3a2a1a 12px,
        #3a2a1a 20px,
        transparent 20px,
        transparent 24px
    );
    opacity: 0.6;
}

/* Leather surface */
.leather-surface {
    background:
        repeating-linear-gradient(
            45deg,
            transparent 0px,
            transparent 3px,
            rgba(139, 107, 74, 0.04) 3px,
            rgba(139, 107, 74, 0.04) 4px
        ),
        radial-gradient(
            ellipse at 30% 40%,
            rgba(139, 107, 74, 0.12) 0%,
            rgba(74, 45, 42, 0.08) 50%,
            transparent 70%
        ),
        linear-gradient(180deg, #1a2a1a 0%, #0d1a0d 100%);
    border-radius: 2px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4), inset 0 -1px 1px rgba(139, 107, 74, 0.1);
    padding: 2rem 2.5rem;
}

/* Typography */
.hero-title {
    font-family: 'Recursive', sans-serif;
    font-size: clamp(2.8rem, 8vw, 6.5rem);
    font-variation-settings: 'CASL' 0, 'wght' 300;
    color: #d4dcc8;
    letter-spacing: -0.03em;
    line-height: 0.95;
    text-shadow: 2px 0 rgba(122, 74, 139, 0.3), -2px 0 rgba(45, 107, 74, 0.3);
    transition: font-variation-settings 2s ease;
    border-left: 3px solid #4a2d5a;
    padding-left: 1rem;
}

.hero-title.loaded {
    font-variation-settings: 'CASL' 0.5, 'wght' 700;
}

.body-text {
    font-family: 'Inter', sans-serif;
    font-variation-settings: 'wght' 350;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    color: #a8b89a;
    line-height: 1.7;
    max-width: 52ch;
    transition: font-variation-settings 600ms ease;
}

.body-text:hover {
    font-variation-settings: 'wght' 420;
}

.annotation {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.72rem;
    color: #7a6b8a;
}

.clearing-statement {
    font-family: 'Recursive', sans-serif;
    font-size: clamp(2rem, 5vw, 4rem);
    font-variation-settings: 'CASL' 0.3, 'wght' 400;
    color: #d4dcc8;
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-shadow: 2px 0 rgba(122, 74, 139, 0.3), -2px 0 rgba(45, 107, 74, 0.3);
}

.base-title {
    font-family: 'Recursive', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-variation-settings: 'CASL' 0.4, 'wght' 600;
    color: #d4dcc8;
    margin: 1.5rem 0;
    line-height: 1.1;
}

.annotation-block {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.annotation-detail {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: #a8b89a;
    line-height: 1.6;
    opacity: 0.8;
}

/* Panel 1: The Ridge */
.panel-1 {
    background: #0d1a0d;
}

.panel-1 .panel-content {
    grid-column: 1 / 3;
    grid-row: 3 / 5;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 1rem;
    z-index: 2;
}

.mountain-layer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
}

.mountain-far {
    clip-path: polygon(0 70%, 20% 50%, 40% 65%, 60% 40%, 80% 55%, 100% 45%, 100% 100%, 0 100%);
    background: #0d1a0d;
    z-index: 0;
}

.mountain-mid {
    clip-path: polygon(0 80%, 15% 60%, 35% 72%, 55% 50%, 75% 65%, 90% 55%, 100% 70%, 100% 100%, 0 100%);
    background: #15301f;
    z-index: 0;
}

.mountain-near {
    clip-path: polygon(0 85%, 10% 72%, 30% 80%, 50% 65%, 70% 78%, 85% 68%, 100% 82%, 100% 100%, 0 100%);
    background: #1a3a2a;
    z-index: 1;
}

/* Panel 2: The Canopy */
.panel-2 {
    background: #1a3a2a;
}

.panel-2-grid {
    grid-column: 3 / 6;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 2;
}

.canopy-pattern {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background:
        radial-gradient(ellipse 80px 80px at 20% 60%, rgba(45, 107, 74, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 120px 100px at 50% 70%, rgba(26, 58, 42, 0.15) 0%, transparent 70%),
        radial-gradient(ellipse 60px 60px at 70% 50%, rgba(45, 107, 74, 0.08) 0%, transparent 70%),
        radial-gradient(ellipse 100px 90px at 35% 80%, rgba(26, 42, 26, 0.1) 0%, transparent 70%),
        radial-gradient(ellipse 90px 70px at 80% 75%, rgba(45, 107, 74, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* Panel 3: The Clearing */
.panel-3 {
    background: #0d1a0d;
}

.panel-3-grid {
    grid-column: 1 / 6;
    grid-row: 2 / 4;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    z-index: 2;
}

.annotations-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.ridgeline-transition {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30%;
    clip-path: polygon(0 85%, 15% 72%, 30% 80%, 50% 65%, 70% 78%, 85% 70%, 100% 82%, 100% 100%, 0 100%);
    background: linear-gradient(180deg, #1a3a2a, #0d1a0d);
    z-index: 0;
}

/* Panel 4: The Valley */
.panel-4 {
    background: linear-gradient(180deg, #0d1a0d 0%, #0f1f0f 50%, #0d1a0d 100%);
}

.panel-4-grid {
    grid-column: 1 / 6;
    grid-row: 2 / 4;
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 2rem;
    align-items: center;
    z-index: 2;
}

.valley-left {
    grid-column: 1;
}

.valley-right {
    grid-column: 3;
}

.elevation-profile {
    width: 100%;
    height: 200px;
    clip-path: polygon(0% 90%, 5% 85%, 10% 80%, 15% 70%, 20% 65%, 25% 55%, 30% 45%, 35% 40%, 40% 35%, 45% 30%, 50% 25%, 55% 30%, 60% 40%, 65% 50%, 70% 55%, 75% 60%, 80% 70%, 85% 75%, 90% 80%, 95% 85%, 100% 90%, 100% 100%, 0% 100%);
    background: linear-gradient(180deg, #2d6b4a, #1a3a2a);
}

/* Panel 5: The Base */
.panel-5 {
    background: #0d1a0d;
    min-height: 130vh;
}

.panel-5-grid {
    grid-column: 2 / 5;
    grid-row: 2 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.base-card {
    border-radius: 4px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4), inset 0 -1px 1px rgba(139, 107, 74, 0.15);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-top: 2px solid #2d4a2d;
}

.trail-end {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30vh;
    background: linear-gradient(180deg, #0d1a0d, #0d1a0d);
    border-top: 1px solid #2d4a2d;
}

/* Accent highlights */
.clearing-statement {
    border-bottom: 1px solid #b87dd4;
    padding-bottom: 1.5rem;
}

.annotation-block .annotation {
    color: #c4a882;
}

/* Bounce Enter Animation */
@keyframes bounceEnter {
    0% { opacity: 0; transform: translateY(40px) scale(0.97); }
    60% { opacity: 1; transform: translateY(-8px) scale(1.01); }
    80% { transform: translateY(3px) scale(0.995); }
    100% { transform: translateY(0) scale(1); }
}

@keyframes bounceEnterLeft {
    0% { opacity: 0; transform: translateX(-30px) scale(0.97); }
    60% { opacity: 1; transform: translateX(6px) scale(1.01); }
    80% { transform: translateX(-3px) scale(0.995); }
    100% { transform: translateX(0) scale(1); }
}

@keyframes bounceEnterRight {
    0% { opacity: 0; transform: translateX(30px) scale(0.97); }
    60% { opacity: 1; transform: translateX(-6px) scale(1.01); }
    80% { transform: translateX(3px) scale(0.995); }
    100% { transform: translateX(0) scale(1); }
}

.bounce-enter {
    opacity: 0;
}

.bounce-enter.visible {
    animation: bounceEnter 700ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: calc(var(--stagger-index, 0) * 120ms);
}

.panel-4 .valley-left.bounce-enter.visible {
    animation-name: bounceEnterLeft;
}

.panel-4 .valley-right.bounce-enter.visible {
    animation-name: bounceEnterRight;
}

/* Responsive */
@media (max-width: 768px) {
    .panel {
        padding: 3vh 5vw;
    }

    .annotations-row {
        grid-template-columns: 1fr;
    }

    .panel-4-grid {
        grid-template-columns: 1fr;
    }

    .valley-left,
    .valley-right {
        grid-column: 1;
    }

    #summit-nav {
        right: 12px;
    }
}
