* { box-sizing: border-box }

:root {
    --blue: #384bff;
    --line: #dededb;
    --pad: clamp(1rem, 3.5vw, 4rem);
    --serif: Georgia, "Times New Roman", serif;
    font: 100%/1.45 Arial, Helvetica, sans-serif;
    color: var(--blue);
    scroll-behavior: smooth;
    scrollbar-gutter: stable
}

body, h1, h2 { margin: 0 }
body { background: white }
a, button, dialog { color: inherit }
a { text-decoration: none }
button {
    background: none;
    border: 0;
    font: inherit;
    cursor: pointer
}
a:hover, button:hover { text-decoration: underline; text-underline-offset: .22em }
:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px }

.mast { padding-inline: var(--pad) }
h1, .caption, .dialogbar {
    display: flex;
    align-items: center;
    justify-content: space-between
}
.contact-signature::before {
    content: "";
    grid-row: span 2;
    width: 2rem;
    height: 2rem;
    align-self: center;
    background: var(--blue);
    mask: url(assets/gesto.png) center/contain no-repeat
}
.mast { padding-block: clamp(1.4rem, 3vw, 3.3rem) }
h1 { gap: 1rem; font: normal clamp(1.4rem, 2.8vw, 3rem)/1.1 var(--serif); letter-spacing: -.04em }
h1 img { display: block; width: clamp(7rem, 16vw, 15rem); height: auto }

#archivo {
    width: min(calc(100% - 2 * var(--pad)), max(18rem, 69vh), 51rem);
    margin-inline: auto
}
.rail {
    --gap: clamp(8px, 1.3vw, 20px);
    position: relative;
    display: flex;
    gap: var(--gap);
    align-items: center;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    user-select: none;
    cursor: grab;
    overflow-anchor: none
}
.rail::-webkit-scrollbar { display: none }
.rail.dragging { scroll-snap-type: none; cursor: grabbing }
.slide {
    flex: 0 0 100%;
    padding: 0;
    aspect-ratio: 4/5;
    scroll-snap-align: center;
    overflow: hidden;
    cursor: inherit;
    transform: scale(calc(1 - .12 * var(--lift, 0))) rotate(calc(-3deg * var(--lean, 0)));
    border-radius: calc(18% * var(--lift, 0)) 2px calc(13% * var(--lift, 0)) 2px
}
.slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(calc(1 + .055 * var(--lift, 0)));
    pointer-events: none
}
.archive-tools { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center }
#open-post {
    grid-area: 1 / 1;
    justify-self: start;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px
}
#open-post[hidden] { display: none }
.caption { grid-area: 1 / 2; gap: .5rem; min-height: 44px }
output { font-size: .875rem; font-variant-numeric: tabular-nums }
.arrows { display: flex }
.arrows button { width: 44px; height: 44px; font-size: 1.6rem; color: var(--blue) }
.dialogbar a { text-decoration: underline; text-underline-offset: .22em }

#contacto {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 3rem;
    margin: clamp(2rem, 4vw, 4rem) var(--pad) 0;
    padding-block: clamp(1.25rem, 2.5vw, 2.5rem);
    border-top: 1px solid color-mix(in srgb, var(--blue) 35%, white)
}
.contact-signature {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: .85rem
}
.contact-signature h2 { font: normal 1.9rem/1.15 var(--serif); letter-spacing: -.04em }
.contact-signature span { font-size: .8125rem }
#channels {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem clamp(1.5rem, 3.5vw, 4rem);
    font: normal 1rem/1.4 var(--serif)
}
#channels a { display: grid; gap: .3rem; padding-block: .25rem; overflow-wrap: anywhere }
#channels small {
    font: .8125rem/1.3 Arial, Helvetica, sans-serif;
    letter-spacing: .08em;
    text-transform: uppercase
}
dialog { padding: .75rem; border: 1px solid var(--line); width: min(94vw, 540px); max-height: 92dvh }
dialog::backdrop { background: #10101099 }
.dialogbar { gap: .65rem }
.dialogbar button { min-height: 44px }
iframe { width: 100%; height: min(67vh, 680px); border: 0 }
body:has(dialog[open]) { overflow: hidden }
.skip { position: absolute; top: -6rem }
.skip:focus { top: 0; background: white; z-index: 4; padding: 1rem }
[hidden] { display: none !important }

@media (max-width: 700px) {
    #archivo {
        padding: .5rem .5rem 0;
        border: 1px solid var(--line)
    }
    .caption { gap: .15rem }
    output { font-size: .8125rem; letter-spacing: .04em }
    #contacto {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        justify-content: stretch;
        border-top: 0;
        margin-top: 1.75rem;
        padding-block: 0 1.25rem;
        gap: 1rem
    }
    .contact-signature {
        justify-self: center;
        grid-template-columns: auto auto;
        align-items: center;
        gap: .25rem .4rem
    }
    .contact-signature::before { grid-row: 1; width: 1.6rem; height: 1.6rem }
    .contact-signature span { grid-column: 1 / -1; text-align: center }
    #channels { display: grid; gap: 0 }
    #channels a {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: baseline;
        gap: .75rem;
        padding-block: .65rem;
        border-top: 1px solid var(--line)
    }
    #channels a span { text-align: right }
}
@media (prefers-reduced-motion: reduce) {
    :root { scroll-behavior: auto }
    .slide, .slide img { transform: none; border-radius: 0 }
}
