@font-face {
    font-family: "Archivo";
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    font-stretch: 62% 125%;
    src: url("fuentes/archivo-latin-wdth-normal.woff2") format("woff2-variations");
}

:root {
    color-scheme: light;
    --negro: #161413;
    --blanco: #f7f6f2;
    --junta: #b9b5ad;
    --caoba: #6b1e22;
    --caoba-viva: #84282d;
    --rosa-caoba: #f2dcd8;
    --gris: #55504b;
    --gris-claro: #c9c4bc;
    --focus: var(--caoba);
    --j: 3px;
    --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    /* 2x2 damero: the floor of the apartment */
    --damero: repeating-conic-gradient(var(--negro) 0 25%, var(--blanco) 0 50%);
}

/* damero with grout: --t is one tile */
.board .tile-damero, .site-footer::before {
    background:
        repeating-linear-gradient(90deg, var(--junta) 0 2px, transparent 0 var(--t)),
        repeating-linear-gradient(180deg, var(--junta) 0 2px, transparent 0 var(--t)),
        var(--damero) 0 0 / calc(2 * var(--t)) calc(2 * var(--t));
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scrollbar-color: var(--negro) var(--blanco);
}

body {
    margin: 0;
    background: var(--blanco);
    color: var(--negro);
    font: 400 1rem/1.6 var(--font);
    font-stretch: 100%;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

figure, h1, h2, h3, p, dl, dd {
    margin: 0;
}

img {
    display: block;
    width: 100%;
}

a {
    color: inherit;
    text-underline-offset: 0.25em;
    text-decoration-thickness: 1px;
}

a, button {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

::selection {
    color: var(--blanco);
    background: var(--caoba);
}

[hidden] {
    display: none !important;
}

.sr-only, .skip-link:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link:focus {
    position: fixed;
    z-index: 3;
    inset: 0.5rem auto auto 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--blanco);
}

.shell {
    width: min(100% - 2rem, 82rem);
    margin-inline: auto;
}

h1, h2, h3, .tile-price, .brand {
    font-stretch: 125%;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

h2 {
    font-size: clamp(2rem, 5.4vw, 4.25rem);
    line-height: 0.95;
}

h3 {
    font-size: 1.05rem;
    line-height: 1.2;
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--blanco);
    border-bottom: var(--j) solid var(--negro);
}

.masthead {
    min-height: 4.25rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.5rem;
}

.brand {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    text-decoration: none;
}

.brand-mark {
    width: 1.15rem;
    aspect-ratio: 1;
    flex-shrink: 0;
    background: var(--damero);
    outline: 1.5px solid var(--negro);
}

.masthead nav {
    display: flex;
    gap: clamp(1rem, 3vw, 2.5rem);
    font-size: 0.92rem;
    font-weight: 500;
}

.masthead nav a {
    padding-block: 0.5rem;
    text-decoration: none;
    background: linear-gradient(var(--caoba), var(--caoba)) 0 85% / 0 2px no-repeat;
    transition: background-size 280ms var(--ease);
}

.masthead nav a:hover {
    background-size: 100% 2px;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: fit-content;
    min-height: 2.85rem;
    padding: 0.6rem 1.2rem;
    border: 0;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: background-color 160ms ease, color 160ms ease;
}

.button-caoba {
    justify-self: end;
    background: var(--caoba);
    color: var(--blanco);
}

.button-caoba:hover {
    background: var(--caoba-viva);
}

/* Hero: a board of tiles */

.hero {
    container-type: inline-size;
    padding-block: clamp(1rem, 2.5vw, 2rem);
}

.board {
    --cols: 4;
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    grid-auto-rows: minmax(5.75rem, auto);
    gap: var(--j);
    padding: var(--j);
    background: var(--junta);
}

.board .hero-facts {
    display: contents;
}

.tile, .board .hero-facts > div {
    container-type: inline-size;
    position: relative;
    padding: clamp(0.8rem, 1.6vw, 1.25rem);
    background: var(--blanco);
    color: var(--negro);
    animation: colocar 650ms var(--ease) backwards;
    animation-delay: calc(var(--d, 0) * 60ms);
}

.tile-price, .board .hero-facts > div:is(:nth-child(2), :nth-child(3)) {
    background: var(--negro);
    color: var(--blanco);
    --focus: var(--blanco);
}

.tile-place {
    --d: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.25rem;
}

.tile-place h1 {
    font-size: clamp(2.6rem, 15cqi, 6rem);
    line-height: 0.9;
    overflow-wrap: anywhere;
}

.hero-ref {
    max-width: 30ch;
    color: var(--gris);
    font-size: clamp(0.95rem, 3.4cqi, 1.15rem);
    line-height: 1.4;
}

.tile-price {
    --d: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.35rem;
    line-height: 1;
}

.tile-price strong {
    font-size: clamp(2.2rem, 14cqi, 4.75rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums lining-nums;
    white-space: nowrap;
}

.tile-price span, .board .hero-facts dt {
    font-size: 0.78rem;
    font-weight: 500;
    font-stretch: 100%;
    letter-spacing: 0.04em;
    line-height: 1.3;
    text-transform: uppercase;
}

.tile-price span {
    color: var(--gris-claro);
}

.board .hero-facts > div {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.5rem;
}

.board .hero-facts dt {
    color: var(--gris);
}

.board .hero-facts > div:is(:nth-child(2), :nth-child(3)) dt {
    color: var(--gris-claro);
}

.board .hero-facts dd {
    font-size: clamp(1.35rem, 21cqi, 3rem);
    font-stretch: 110%;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.board .hero-facts dd small {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.95rem;
    font-stretch: 100%;
    font-weight: 600;
}

.board .hero-facts > div:nth-child(1) { --d: 3; }
.board .hero-facts > div:nth-child(2) { --d: 4; }
.board .hero-facts > div:nth-child(3) { --d: 5; }

.tile-link, .tile-cta {
    outline-offset: -6px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.2rem;
    text-decoration: none;
    font-weight: 700;
    line-height: 1.2;
    transition: background-color 200ms ease, color 200ms ease;
}

.tile-link {
    --d: 5;
    font-size: 1.05rem;
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.tile-link:hover {
    background: var(--negro);
    color: var(--blanco);
    --focus: var(--blanco);
}

.tile-cta {
    --d: 1;
    background: var(--caoba);
    color: var(--blanco);
    --focus: var(--blanco);
}

.tile-cta strong {
    font-size: clamp(1.15rem, 7cqi, 1.5rem);
    font-stretch: 115%;
}

.tile-cta span {
    color: var(--rosa-caoba);
    font-weight: 500;
}

.tile-cta::after {
    content: "";
    position: absolute;
    top: clamp(0.8rem, 1.6vw, 1.25rem);
    right: clamp(0.8rem, 1.6vw, 1.25rem);
    width: 1.5rem;
    height: 1.5rem;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='square'%3E%3Cpath d='M5 19 19 5M8 5h11v11'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform 300ms var(--ease);
}

.tile-cta:hover {
    background: var(--caoba-viva);
}

.tile-cta:hover::after {
    transform: translate(3px, -3px);
}

.tile-damero {
    --d: 3;
    --t: 23px; /* 4 whole tiles in the 5.75rem row */
    min-height: 2.75rem;
    padding: 0;
}

.hero-photo {
    --d: 2;
    position: relative;
    min-height: 0;
    background: var(--negro);
    animation: colocar 650ms var(--ease) backwards;
    animation-delay: calc(var(--d, 0) * 60ms);
}

.hero-photo img {
    height: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}

.photo-pending {
    grid-column: 1 / -1;
    padding: 1.25rem;
    background: var(--blanco);
    color: var(--gris);
}

.photo-note {
    position: absolute;
    left: 0.75rem;
    bottom: 0.75rem;
    padding: 0.3rem 0.6rem;
    background: var(--blanco);
    color: var(--negro);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Phone and tablet order: where, how much, act, then look */

.tile-place, .tile-price, .tile-cta, .hero-photo, .photo-pending, .tile-damero {
    grid-column: 1 / -1;
}

.tile-place { order: 1; }
.tile-price { order: 2; }
.tile-cta { order: 3; min-height: 5.25rem; }
.tile-damero { order: 4; }
.hero-photo, .photo-pending { order: 5; }
.board .hero-facts > div, .tile-link { order: 6; grid-column: span 2; }

@media (min-width: 40rem) and (max-width: 71.99rem) {
    /* photo beside the stacked facts keeps the 720px source sharp */
    .hero-photo { grid-column: 1 / 3; grid-row: span 4; }
    .board .hero-facts > div, .tile-link { grid-column: 3 / 5; }

    .board .hero-facts > div:nth-child(3) {
        background: var(--blanco);
        color: var(--negro);
    }

    .board .hero-facts > div:nth-child(3) dt {
        color: var(--gris);
    }

    .tile-link {
        background: var(--negro);
        color: var(--blanco);
        --focus: var(--blanco);
    }
}

@media (min-width: 72rem) {
    .board {
        --cols: 8;
        --cell: calc((min(100cqi - 2rem, 82rem) - 9 * var(--j)) / 8);
        grid-auto-rows: var(--cell);
    }

    .board > *, .board .hero-facts > div {
        order: 0;
    }

    .board .hero-facts > div:nth-child(2) {
        background: var(--blanco);
        color: var(--negro);
    }

    .board .hero-facts > div:nth-child(2) dt {
        color: var(--gris);
    }

    .tile-place { grid-area: 1 / 1 / 3 / 5; }
    .tile-damero { grid-area: 1 / 5 / 4 / 6; --t: calc((3 * var(--cell) + 2 * var(--j)) / 6); }
    .hero-photo, .photo-pending { grid-area: 1 / 6 / 5 / 9; }
    .tile-price { grid-area: 3 / 1 / 4 / 4; }
    .board .hero-facts > div:nth-child(1) { grid-area: 3 / 4 / 4 / 5; }
    .board .hero-facts > div:nth-child(2) { grid-area: 4 / 1 / 5 / 2; }
    .board .hero-facts > div:nth-child(3) { grid-area: 4 / 2 / 5 / 3; }
    .tile-link { grid-area: 4 / 3 / 5 / 4; }
    .tile-cta { grid-area: 4 / 4 / 5 / 6; min-height: 0; }

    /* laying order follows the diagonal: row + column */
    .tile-place { --d: 0; }
    .tile-price { --d: 2; }
    .board .hero-facts > div:nth-child(2) { --d: 3; }
    .tile-damero, .board .hero-facts > div:nth-child(3) { --d: 4; }
    .hero-photo, .tile-link, .board .hero-facts > div:nth-child(1) { --d: 5; }
    .tile-cta { --d: 6; }

    .hero-photo img {
        aspect-ratio: auto;
    }
}

@keyframes colocar {
    from {
        opacity: 0.6;
        transform: translate(-0.6rem, -0.6rem);
        filter: brightness(1.3);
    }
}

/* La propiedad */

.property, .gallery {
    padding-block: clamp(4rem, 9vw, 7.5rem);
}

.property {
    display: grid;
    gap: clamp(2rem, 4vw, 3rem);
}

.section-heading {
    display: grid;
    gap: 1.25rem;
}

.section-heading p {
    max-width: 62ch;
    color: var(--gris);
}

.property .section-heading {
    grid-template-columns: minmax(0, 1fr);
    align-items: end;
}

.section-heading .property-description {
    white-space: pre-line;
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    line-height: 1.55;
    color: var(--negro);
}

.property-data, .property-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: var(--j);
    padding: var(--j);
    background: var(--junta);
}

.property-data > div {
    display: grid;
    gap: 0.4rem;
    padding: 1.25rem;
    background: var(--blanco);
}

.property-data dt {
    color: var(--gris);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.property-data dd {
    font-size: clamp(1.1rem, 1.8vw, 1.35rem);
    font-stretch: 110%;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.property-highlights > div {
    display: grid;
    align-content: start;
    gap: 0.85rem;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    background: var(--negro);
    color: var(--blanco);
}

.property-highlights > div:nth-child(even) {
    background: var(--blanco);
    color: var(--negro);
}

.property-highlights p {
    max-width: 52ch;
    color: #ddd8d1;
}

.property-highlights > div:nth-child(even) p {
    color: var(--gris);
}

/* Galería */

.gallery {
    background: var(--negro);
    color: var(--blanco);
    --focus: var(--blanco);
}

.gallery .section-heading {
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.gallery .section-heading p {
    color: var(--gris-claro);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--j);
    padding: var(--j);
    background: var(--junta);
}

.gallery-card {
    display: flex;
    flex-direction: column;
    background: var(--blanco);
    color: var(--negro);
}

.gallery-card:is(:nth-child(8n+1), :nth-child(8n+3), :nth-child(8n+6), :nth-child(8n+8)) {
    background: var(--negro);
    color: var(--blanco);
}

.gallery-link {
    display: block;
    position: relative;
    overflow: hidden;
    background: #2a2624;
    cursor: zoom-in;
}

.gallery-link img {
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 600ms var(--ease), filter 600ms var(--ease);
}

.gallery-card--portrait img {
    aspect-ratio: 3 / 4;
}

.gallery-link:hover img {
    transform: scale(1.04);
}

.gallery-zoom {
    position: absolute;
    inset: auto 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    display: grid;
    place-items: center;
    background: var(--caoba);
    color: var(--blanco);
    transform-origin: bottom right;
    transition: transform 300ms var(--ease);
}

.gallery-link:hover .gallery-zoom {
    transform: scale(1.2);
}

.gallery-zoom::before, .gallery-zoom::after,
.close-viewer::before, .close-viewer::after {
    content: "";
    grid-area: 1 / 1;
    width: 0.9rem;
    height: 2px;
    background: currentColor;
}

.gallery-zoom::after {
    transform: rotate(90deg);
}

.gallery-card figcaption {
    padding: 0.7rem 0.85rem 0.85rem;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
}

/* Contacto */

.contact {
    --focus: var(--blanco);
    background: var(--caoba);
    color: var(--blanco);
}

.contact-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    align-items: end;
    gap: 2.5rem clamp(2rem, 6vw, 6rem);
    padding-block: clamp(4rem, 9vw, 7rem);
}

.contact h2 {
    font-size: clamp(2.4rem, 6.5vw, 5.5rem);
    line-height: 0.92;
}

.contact-inner p {
    max-width: 40ch;
    margin-top: 1.25rem;
    color: var(--rosa-caoba);
    font-size: 1.1rem;
}

.contact-links {
    display: grid;
    gap: var(--j);
    min-width: 0;
}

.contact-links .button {
    width: 100%;
    min-height: 4rem;
    justify-content: space-between;
    gap: 1rem;
    padding-inline: 1.25rem;
    font-size: 1.02rem;
    text-align: left;
}

.contact-links .button::after {
    content: "";
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='square'%3E%3Cpath d='M5 19 19 5M8 5h11v11'/%3E%3C/svg%3E") center / contain no-repeat;
}

.button-light {
    background: var(--blanco);
    color: var(--negro);
}

.button-light:nth-child(even) {
    background: var(--negro);
    color: var(--blanco);
    --focus: var(--blanco);
}

.button-light:hover {
    background: var(--rosa-caoba);
    color: var(--negro);
}

.contact-email {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 2.75rem;
    color: var(--rosa-caoba);
    overflow-wrap: anywhere;
}

.contact-email:first-of-type {
    margin-top: 0.75rem;
}

.contact-email:hover {
    color: var(--blanco);
    text-decoration-thickness: 2px;
}

.contact-status {
    padding: 0.75rem 1rem;
    border: 1px solid var(--rosa-caoba);
    color: var(--rosa-caoba);
}

/* Pie */

.site-footer {
    display: grid;
    gap: 1.5rem;
    padding-block: 0 2.5rem;
}

.site-footer::before {
    content: "";
    --t: 1.5rem;
    height: 3rem;
}

/* Visor */

dialog {
    width: fit-content;
    max-width: min(95vw, 75rem);
    max-height: 95vh;
    max-height: 95dvh;
    padding: 3.75rem 1rem 1rem;
    border: 0;
    background: var(--negro);
    color: var(--blanco);
    --focus: var(--blanco);
}

dialog::backdrop {
    background: rgb(22 20 19 / 88%);
}

dialog img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 70vh;
    max-height: 70dvh;
    object-fit: contain;
    margin-inline: auto;
}

dialog figcaption {
    margin-top: 0.75rem;
    text-align: center;
    font-weight: 600;
}

dialog button {
    cursor: pointer;
    min-height: 2.75rem;
    border: 0;
    background: var(--blanco);
    color: var(--negro);
    font: 700 0.92rem var(--font);
    padding-inline: 1rem;
    --focus: var(--blanco);
}

dialog button:hover {
    background: var(--rosa-caoba);
}

dialog .close-viewer {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    min-width: 2.75rem;
    display: grid;
    place-items: center;
    background: var(--caoba);
    color: var(--blanco);
}

dialog .close-viewer:hover {
    background: var(--caoba-viva);
}

.close-viewer::before {
    transform: rotate(45deg);
}

.close-viewer::after {
    transform: rotate(-45deg);
}

.viewer-controls {
    display: flex;
    justify-content: center;
    gap: var(--j);
    margin-top: 0.85rem;
}

/* Responsive */

@media (max-width: 71.99rem) {
    .contact-inner {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
    }
}

@media (max-width: 48rem) {
    .masthead {
        grid-template-columns: 1fr auto;
        gap: 0.25rem 0.75rem;
        padding-block: 0.6rem;
    }

    .masthead nav {
        display: none;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gallery-card:is(:nth-child(8n+1), :nth-child(8n+3), :nth-child(8n+6), :nth-child(8n+8)) {
        background: var(--blanco);
        color: var(--negro);
    }

    .gallery-card:is(:nth-child(4n+1), :nth-child(4n+4)) {
        background: var(--negro);
        color: var(--blanco);
    }
}

@media (max-width: 30rem) {
    .brand {
        font-size: 0.72rem;
        gap: 0.5rem;
    }

    .masthead .button {
        padding-inline: 0.85rem;
        font-size: 0.85rem;
    }

    .gallery-card figcaption {
        font-size: 0.85rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
