@import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200;0,300;0,400;0,500;1,200;1,300;1,400;1,500&display=swap');

*{
    box-sizing: border-box;
}

body{
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
    font-family: 'Source Code Pro', monospace;
    background: rgb(81,122,140);
    color: #fff;
}

ul{
    list-style: none;
    padding-left: 0;
    margin: 0;
}

button{
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

/* ---------- Escena (fija) ---------- */
.scene{
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: linear-gradient(90deg, rgb(81,122,140) 0%, rgb(208,226,233) 100%);
}

.layer{
    position: absolute;
    inset: 0;
    will-change: transform, opacity;
    pointer-events: none;
}

.layer svg{
    width: 100%;
    height: 100%;
    display: block;
}

/* Modo imagen (Firefox, ver index.js): el canvas solo se ve durante la transición */
.layer__raster{
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    visibility: hidden;
}

.scene.is-moving .layer__raster{
    visibility: visible;
}

.scene.is-moving .layer svg{
    visibility: hidden;
}

/* Velo de niebla entre capas: mismo degradado que el cielo */
.veil{
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgb(81,122,140) 0%, rgb(208,226,233) 100%);
    will-change: opacity;
    pointer-events: none;
}

/* Suelo: oscurece un poco la parte baja para asentar los árboles */
.ground{
    position: absolute;
    inset: auto 0 0 0;
    height: 35vh;
    background: linear-gradient(180deg, transparent 0%, rgba(20, 40, 45, .25) 100%);
    pointer-events: none;
}

.tree__trunk{
    fill: #34505B;
}

/* Corteza del roble principal (tree.js) */
.tree__bark-light{
    fill: #4C6B76;
    opacity: .14;
}

.tree__bark-shade{
    fill: #22363E;
    opacity: .13;
}

.tree__bark-crack{
    fill: none;
    stroke: #263A42;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .22;
}

.tree__bark-ridge{
    fill: none;
    stroke: #56747F;
    stroke-width: .8;
    stroke-linecap: round;
    opacity: .18;
}

.tree__bark-knot{
    fill: #2A3F47;
    stroke: #4C6B76;
    stroke-width: 1;
    opacity: .3;
}

.forest__leaves{
    fill: #6A9E7E;
    fill-opacity: .75;
}

.forest__grass{
    fill: #48685F;
}

.forest__grass--light{
    fill: #5E8573;
}

.tree__twigs{
    fill: none;
    stroke: #34505B;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .5;
}

/* ---------- Recorrido ---------- */
.stop-panel{
    position: fixed;
    z-index: 1;
    will-change: opacity, transform;
}

/* Parada 0: portada */
.stop-panel--home{
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding-right: 8vw;
    pointer-events: none;
}

.presentation{
    font-size: clamp(40px, 5vw, 84px);
    /* sombra muy suave: el texto se lee sobre la niebla clara y los troncos */
    text-shadow: 0 2px 18px rgba(30, 55, 65, .45), 0 1px 3px rgba(30, 55, 65, .35);
}

.presentation__title{
    line-height: .9;
}

/* ".stop-panel" delante para ganar a ".stop-panel p" (que deja margin-top a 0) */
.stop-panel .presentation__subtitle{
    letter-spacing: 3px;
    font-size: 18px;
    /* separación del título: su interlineado es muy cerrado (0.9) y las letras
       con trazo descendente (g, j, p) quedaban casi tocando el subtítulo */
    margin: 1.4em 0 0;
}

.scroll-hint{
    position: absolute;
    bottom: 16vh;
    left: calc(108px + (100% - 108px) / 2);
    transform: translateX(-50%);
    margin: 0;
    font-size: 14px;
    letter-spacing: 2px;
    opacity: .9;
    text-shadow: 0 1px 8px rgba(30, 55, 65, .5);
}

.scroll-hint .hint__arrow{
    display: inline-block;
    animation: hint-bounce 1.8s ease-in-out infinite;
}

/* Texto de la pista según el dispositivo: ratón/trackpad o pantalla táctil */
.hint--touch{
    display: none;
}

@media (pointer: coarse){
    .hint--pointer{ display: none; }
    .hint--touch{ display: inline; }
}

@keyframes hint-bounce{
    50%{ transform: translateY(5px); }
}

/* Parada 1: About */
.stop-panel--about{
    /* centrado vertical sea cual sea la longitud del texto */
    top: 0;
    bottom: 0;
    height: max-content;
    margin: auto 0;
    right: 8vw;
    width: min(34em, calc(100vw - 108px - 16vw));
    padding: 2.2em 2.4em;
    font-size: 17px;
    line-height: 1.65;
    background: rgba(20, 40, 45, .55);
    border-left: 2px solid #82B398;
}

.stop-panel__eyebrow{
    margin: 0;
    font-size: 13px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #A9C98F;
}

.stop-panel__title{
    margin: .2em 0 .6em;
    font-size: clamp(36px, 4vw, 64px);
    font-weight: 400;
    line-height: 1;
}

.stop-panel p{
    margin: 0 0 1em;
}

/* Parada 2: Experience (línea de tiempo) */
.stop-panel--path{
    top: 0;
    bottom: 0;
    height: max-content;
    max-height: 86vh;
    margin: auto 0;
    right: 6vw;
    width: min(46em, calc(100vw - 108px - 12vw));
    padding: 2em 2.2em 1.4em;
    display: flex;
    flex-direction: column;
    font-size: 15px;
    line-height: 1.6;
    background: rgba(20, 40, 45, .55);
    border-left: 2px solid #82B398;
}

.stop-panel__scroll{
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: .6em;
    padding-left: 8px; /* deja ver entero el punto de cada hito */
    margin-top: .2em;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.35) transparent;
}

.timeline{
    list-style: none;
    margin: 0;
    padding: 0 0 0 1.3em;
    border-left: 1px solid rgba(169, 201, 143, .5);
}

.job{
    position: relative;
    padding-bottom: 1.1em;
}

/* hito del sendero */
.job::before{
    content: "";
    position: absolute;
    left: calc(-1.3em - 5px);
    top: .45em;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #A9C98F;
    box-shadow: 0 0 0 3px rgba(20, 40, 45, .8);
}

.job summary{
    list-style: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: .1em;
}

.job summary::-webkit-details-marker{
    display: none;
}

.job__dates{
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #A9C98F;
}

.job__role{
    font-size: 16px;
}

.job__client{
    font-size: 13px;
    opacity: .75;
}

.job__hl{
    opacity: .9;
}

.job__hl::after{
    content: "  +";
    color: #A9C98F;
}

.job details[open] .job__hl::after{
    content: "  –";
}

.job details > p{
    margin: .6em 0 0;
    font-size: 14px;
    opacity: .92;
}

.job .job__tech{
    font-size: 12.5px;
    color: #A9C98F;
    opacity: 1;
}

/* Parada 3: Contact (el claro) */
.stop-panel--contact{
    top: 0;
    bottom: 0;
    height: max-content;
    margin: auto 0;
    right: 8vw;
    width: min(30em, calc(100vw - 108px - 16vw));
    padding: 2.2em 2.4em;
    font-size: 17px;
    line-height: 1.65;
    background: rgba(20, 40, 45, .5);
    border-left: 2px solid #E8C98A;
}

.stop-panel--contact .stop-panel__eyebrow{
    color: #E8C98A;
}

.contact__links{
    display: flex;
    flex-wrap: wrap;
    gap: .8em;
    margin-top: 1.4em !important;
}

.contact__link{
    display: inline-flex;
    align-items: center;
    gap: .5em;
    padding: .6em 1.1em;
    color: #fff;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 999px;
    transition: background-color .2s, border-color .2s;
}

.contact__link:hover,
.contact__link:focus-visible{
    background-color: rgba(232, 201, 138, .2);
    border-color: #E8C98A;
}

/* Luz cálida del claro: degradado fijo, solo cambia su opacidad (barato de animar) */
.clearing-light{
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    will-change: opacity;
    background:
        radial-gradient(ellipse 60% 55% at 72% 18%, rgba(255, 226, 170, .55), rgba(255, 226, 170, 0) 70%),
        linear-gradient(180deg, rgba(255, 214, 150, .18), rgba(255, 214, 150, 0) 60%);
}

/* Aviso de confirmación al llegar al borde de una lista con scroll (index.js) */
.edge-hint{
    position: absolute;
    left: 50%;
    bottom: .6em;
    transform: translateX(-50%) translateY(6px);
    margin: 0;
    padding: .35em .9em;
    font-size: 12px;
    letter-spacing: 1px;
    white-space: nowrap;
    color: #fff;
    background: rgba(20, 40, 45, .85);
    border: 1px solid rgba(169, 201, 143, .6);
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
}

.edge-hint--top{
    bottom: auto;
    top: .6em;
}

.edge-hint.is-visible{
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- Menú ---------- */
.nav{
    position: fixed;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 108px;
    justify-content: space-between;
    align-items: center;
    z-index: 2;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    background-color: rgba(0,0,0,.15);
}

.nav__logo{
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.nav__logo span:last-child{
    font-size: 12px;
}

.logo{
    font-size: 100px;
}

.nav__content{
    width: 100%;
    display: flex;
    flex-direction: column;
}

.nav__content li:first-child{
    border-top: 1px solid #fff;
}

.nav__content li{
    border-bottom: 1px solid #fff;
}

.nav__content__item{
    display: block;
    width: 100%;
    padding: .8em .4em;
    font-size: 16px;
    text-align: center;
    transition: background-color .3s;
}

.nav__icon{
    display: none;
}

.nav__content__item.is-active{
    background-color: rgba(255,255,255,.15);
}

.nav__social__network{
    margin-bottom: 3em;
    display: flex;
    gap: .7em;
}

.nav__social__network a{
    color: #fff;
    font-size: 18px;
    opacity: .85;
    transition: opacity .2s;
}

.nav__social__network a:hover,
.nav__social__network a:focus-visible{
    opacity: 1;
}

@media (prefers-reduced-motion: reduce){
    .stop-panel{
        transition: opacity .4s;
    }
    .scroll-hint .hint__arrow{
        animation: none;
    }
}

/* ---------- Móvil y pantallas estrechas ---------- */
@media (max-width: 760px){
    :root{
        --nav-h: 58px;
    }

    /* Menú: barra superior con iconos */
    .nav{
        top: 0;
        bottom: auto;
        left: 0;
        right: 0;
        width: auto;
        height: auto;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        padding: calc(6px + env(safe-area-inset-top)) 12px 6px;
        min-height: var(--nav-h);
    }

    .nav__logo span:last-child{
        display: none;
    }

    .logo{
        font-size: 30px;
    }

    .nav__content{
        flex-direction: row;
        width: auto;
        flex: 1;
        justify-content: center;
        gap: 4px;
    }

    .nav__content li,
    .nav__content li:first-child{
        border: none;
    }

    .nav__content__item{
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;   /* área táctil cómoda */
        height: 44px;
        padding: 0;
        font-size: 18px;
        border-radius: 10px;
    }

    .nav__icon{
        display: inline-flex;
    }

    /* El texto se oculta a la vista pero lo siguen leyendo los lectores de pantalla */
    .nav__label{
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .nav__social__network{
        margin: 0;
        gap: .7em;
    }

    /* Portada: texto abajo a la izquierda, sobre el suelo; el roble se ve arriba */
    .stop-panel--home{
        align-items: flex-start;
        justify-content: flex-end;
        padding: 0 20px 26vh;
    }

    .presentation{
        font-size: clamp(32px, 10vw, 48px);
    }

    .stop-panel .presentation__subtitle{
        font-size: 14px;
        letter-spacing: 1.5px;
        line-height: 1.5;
    }

    .scroll-hint{
        left: 50%;
        bottom: 4vh;
        font-size: 13px;
        white-space: nowrap;
    }

    /* Paneles: a todo el ancho, encima de la barra de menú */
    .stop-panel--about,
    .stop-panel--path,
    .stop-panel--contact{
        /* centrados en vertical en el espacio bajo la barra de menú */
        top: calc(var(--nav-h) + env(safe-area-inset-top) + 12px);
        left: 12px;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom));
        width: auto;
        height: max-content;
        max-height: calc(100% - var(--nav-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
        margin: auto 0;
        padding: 1.4em 1.3em 1.2em;
        font-size: 15px;
    }

    .stop-panel__title{
        font-size: clamp(28px, 9vw, 40px);
    }

    .stop-panel--about,
    .stop-panel--contact{
        overflow-y: auto;
    }

    .job__role{
        font-size: 15px;
    }
}