/* ═══════════════════════════════════════════════════════════════
   ATYC · Arquitectura e Interiorismo
   Preloader Styles — v2.1
   Responsive: TV (≥1920px) · Desktop · Laptop · Tablet · Mobile
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;1,300&family=Montserrat:wght@200;300;400&display=swap');

/* ── RESET SCOPE ── */
#atyc-preloader *,
#atyc-preloader *::before,
#atyc-preloader *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── VARIABLES ── */
:root {
    --atyc-beige: #c8b89a;
    --atyc-beige-mid: #b0a080;
    --atyc-beige-dark: #a09070;
    --atyc-warm-white: #f5f0ea;
    --atyc-cream: #ede8e0;
    --atyc-dark: #1a1a18;
    --atyc-transition: 560ms;

    /* Tamaños responsive — base desktop */
    --atyc-logo-size: 270px;
    --atyc-brand-size: clamp(10px, 1.4vw, 14px);
    --atyc-brand-weight: 400;
    --atyc-label-size: 7px;
    --atyc-coord-size: 6px;
    --atyc-prog-w: 100px;
    --atyc-stage-gap: 28px;
}

/* ── PRELOADER WRAPPER ── */
#atyc-preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease;
}

#atyc-preloader.atyc-out {
    opacity: 0;
    pointer-events: none;
}

/* ── FONDO ── */
#atyc-bg {
    position: absolute;
    inset: 0;
    background: #f5f0ea;
    transition: background 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── GRAIN OVERLAY (textura papel arquitectónico) ── */
#atyc-grain {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 128px 128px;
}

/* ── GRID BLUEPRINT ESTÁTICO ── */
#atyc-grid-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.055;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.7s ease;
}

#atyc-preloader.atyc-phase-dark #atyc-grid-svg {
    opacity: 0.07;
}

/* ── CANVAS LÍNEAS DE CONSTRUCCIÓN ── */
#atyc-lines-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* ── LIQUID GLASS BLOBS ── */
.atyc-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0;
    transition: opacity 1.2s ease, transform 10s ease;
    pointer-events: none;
    z-index: 3;
}

.atyc-blob.b1 {
    width: 65vw;
    height: 65vw;
    top: -20%;
    left: -20%;
    background: radial-gradient(circle, rgba(200, 184, 154, 0.22) 0%, transparent 70%);
}

.atyc-blob.b2 {
    width: 50vw;
    height: 50vw;
    bottom: -15%;
    right: -15%;
    background: radial-gradient(circle, rgba(160, 144, 112, 0.16) 0%, transparent 70%);
}

.atyc-blob.b3 {
    width: 40vw;
    height: 40vw;
    top: 20%;
    left: 30%;
    background: radial-gradient(circle, rgba(245, 240, 234, 0.14) 0%, transparent 70%);
}

.atyc-blob.visible {
    opacity: 1;
}

/* ── ETIQUETA DE FASE ── */
#atyc-phase-lbl {
    position: absolute;
    top: 26px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Montserrat', sans-serif;
    font-weight: 200;
    font-size: var(--atyc-label-size);
    letter-spacing: 0.42em;
    color: var(--atyc-beige-mid);
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.6s ease, color 0.6s ease;
    white-space: nowrap;
    z-index: 20;
}

/* ── COORDENADAS ESQUINAS ── */
.atyc-coord {
    position: absolute;
    font-family: 'Montserrat', sans-serif;
    font-weight: 200;
    font-size: var(--atyc-coord-size);
    letter-spacing: 0.2em;
    color: rgba(160, 144, 112, 0.5);
    opacity: 0;
    transition: opacity 0.6s ease, color 0.6s ease;
    z-index: 20;
    line-height: 1.8;
}

.atyc-coord.tl {
    top: 22px;
    left: 22px;
}

.atyc-coord.tr {
    top: 22px;
    right: 22px;
    text-align: right;
}

.atyc-coord.bl {
    bottom: 54px;
    left: 22px;
}

.atyc-coord.br {
    bottom: 54px;
    right: 22px;
    text-align: right;
}

.atyc-coord.visible {
    opacity: 1;
}

/* ── SCANNER LINE ── */
#atyc-scanner {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(200, 184, 154, 0) 10%,
            rgba(200, 184, 154, 0.4) 50%,
            rgba(200, 184, 154, 0) 90%,
            transparent 100%);
    opacity: 0;
    z-index: 6;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

#atyc-scanner.visible {
    opacity: 1;
}

/* ── LOGO STAGE ── */
#atyc-stage {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--atyc-stage-gap);
}

/* ── LOGO FRAME ── */
#atyc-logo-frame {
    position: relative;
    width: var(--atyc-logo-size);
    height: var(--atyc-logo-size);
}

/* Glass ring */
#atyc-glass-ring {
    position: absolute;
    inset: -16px;
    border-radius: 50%;
    border: 0.5px solid rgba(200, 184, 154, 0.2);
    background: rgba(245, 240, 234, 0.06);
    backdrop-filter: blur(12px) saturate(1.4);
    -webkit-backdrop-filter: blur(12px) saturate(1.4);
    opacity: 0;
    transition: opacity 1s ease;
    z-index: 0;
}

#atyc-glass-ring.visible {
    opacity: 1;
}

#atyc-glass-ring::after {
    content: '';
    position: absolute;
    inset: -14px;
    border-radius: 50%;
    border: 0.3px solid rgba(200, 184, 154, 0.1);
}

/* Stack de logos */
#atyc-logos-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.atyc-logo-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0s;
}

.atyc-logo-img.active {
    opacity: 1;
}

/* Canvas reveal — circular, sin bordes cuadrados */
#atyc-reveal-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3;
    /* overflow circular igual que el logo-frame */
    border-radius: 0;
}

/* ── CROSSHAIRS ESQUINAS DEL FRAME ── */
.atyc-ch {
    position: absolute;
    width: 16px;
    height: 16px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.atyc-ch::before,
.atyc-ch::after {
    content: '';
    position: absolute;
    background: var(--atyc-beige-mid);
}

.atyc-ch::before {
    width: 100%;
    height: 0.5px;
    top: 50%;
    left: 0;
}

.atyc-ch::after {
    width: 0.5px;
    height: 100%;
    top: 0;
    left: 50%;
}

.atyc-ch.tl {
    top: -8px;
    left: -8px;
}

.atyc-ch.tr {
    top: -8px;
    right: -8px;
}

.atyc-ch.bl {
    bottom: -8px;
    left: -8px;
}

.atyc-ch.br {
    bottom: -8px;
    right: -8px;
}

.atyc-ch.visible {
    opacity: 1;
}

/* ── MEDIDA DECORATIVA ── */
#atyc-measure {
    position: absolute;
    bottom: -36px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.6s ease;
}

#atyc-measure.visible {
    opacity: 1;
}

.atyc-measure-line {
    width: 32px;
    height: 0.5px;
    background: rgba(160, 144, 112, 0.4);
}

.atyc-measure-label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 200;
    font-size: 6px;
    letter-spacing: 0.25em;
    color: rgba(160, 144, 112, 0.5);
    white-space: nowrap;
}

/* ── BRAND NAME — más peso, más presencia ── */
#atyc-brand {
    font-family: 'Cormorant Garamond', serif;
    font-weight: var(--atyc-brand-weight);
    font-size: var(--atyc-brand-size);
    letter-spacing: 0.52em;
    color: var(--atyc-beige-mid);
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.8s ease, transform 0.8s ease, color 0.6s ease;
}

#atyc-brand.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ── PROGRESS ── */
#atyc-prog-wrap {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 20;
}

#atyc-prog-track {
    width: var(--atyc-prog-w);
    height: 0.5px;
    background: rgba(160, 144, 112, 0.2);
    position: relative;
    overflow: visible;
}

#atyc-prog-fill {
    height: 100%;
    width: 0%;
    background: var(--atyc-beige-mid);
    transition: width 0.08s linear;
    position: relative;
}

#atyc-prog-fill::after {
    content: '';
    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--atyc-beige);
}

#atyc-prog-num {
    font-family: 'Montserrat', sans-serif;
    font-weight: 200;
    font-size: 6.5px;
    letter-spacing: 0.35em;
    color: rgba(160, 144, 112, 0.5);
}

/* ── SKIP BUTTON ── */
#atyc-skip {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 30;
    background: none;
    border: 0.5px solid rgba(160, 144, 112, 0.3);
    color: rgba(160, 144, 112, 0.6);
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 7px;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    padding: 9px 18px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.5s, border-color 0.3s, color 0.3s, background 0.3s;
}

#atyc-skip:hover {
    border-color: rgba(160, 144, 112, 0.7);
    color: var(--atyc-beige-mid);
    background: rgba(200, 184, 154, 0.06);
}

#atyc-skip.visible {
    opacity: 1;
}

/* ── AJUSTE PARA FONDO OSCURO ── */
#atyc-preloader.atyc-phase-dark #atyc-phase-lbl,
#atyc-preloader.atyc-phase-dark #atyc-brand {
    color: var(--atyc-beige);
}

#atyc-preloader.atyc-phase-dark .atyc-coord {
    color: rgba(200, 184, 154, 0.45);
}

#atyc-preloader.atyc-phase-dark #atyc-skip {
    border-color: rgba(200, 184, 154, 0.3);
    color: rgba(200, 184, 154, 0.6);
}

#atyc-preloader.atyc-phase-dark #atyc-skip:hover {
    border-color: rgba(200, 184, 154, 0.7);
    color: var(--atyc-beige);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — profesional multi-dispositivo
══════════════════════════════════════════════════════════ */

/* ── TV / Pantallas grandes (≥ 1920px) ── */
@media (min-width: 1920px) {
    :root {
        --atyc-logo-size: 380px;
        --atyc-brand-size: 18px;
        --atyc-brand-weight: 400;
        --atyc-label-size: 9px;
        --atyc-coord-size: 7.5px;
        --atyc-prog-w: 140px;
        --atyc-stage-gap: 36px;
    }

    #atyc-phase-lbl {
        top: 36px;
    }

    .atyc-coord.tl {
        top: 30px;
        left: 36px;
    }

    .atyc-coord.tr {
        top: 30px;
        right: 36px;
    }

    .atyc-coord.bl {
        bottom: 70px;
        left: 36px;
    }

    .atyc-coord.br {
        bottom: 70px;
        right: 36px;
    }

    #atyc-skip {
        bottom: 36px;
        right: 36px;
        font-size: 8px;
        padding: 11px 22px;
    }

    #atyc-prog-wrap {
        bottom: 40px;
    }

    .atyc-measure-label {
        font-size: 7px;
    }

    #atyc-measure {
        bottom: -44px;
    }
}

/* ── Desktop / Laptop grande (1280px – 1919px) ── */
/* Variables base ya cubren este rango — sin cambios */

/* ── Laptop pequeño / Monitor estándar (1024px – 1279px) ── */
@media (max-width: 1279px) and (min-width: 1024px) {
    :root {
        --atyc-logo-size: 240px;
        --atyc-brand-size: clamp(10px, 1.2vw, 13px);
        --atyc-stage-gap: 24px;
    }
}

/* ── Tablet landscape (768px – 1023px) ── */
@media (max-width: 1023px) and (min-width: 768px) {
    :root {
        --atyc-logo-size: 220px;
        --atyc-brand-size: 12px;
        --atyc-brand-weight: 400;
        --atyc-label-size: 6.5px;
        --atyc-coord-size: 5.5px;
        --atyc-prog-w: 90px;
        --atyc-stage-gap: 22px;
    }

    .atyc-coord.tr,
    .atyc-coord.br {
        display: none;
    }

    #atyc-measure {
        bottom: -32px;
    }
}

/* ── Tablet portrait / Mobile landscape grande (600px – 767px) ── */
@media (max-width: 767px) and (min-width: 600px) {
    :root {
        --atyc-logo-size: 190px;
        --atyc-brand-size: 11px;
        --atyc-brand-weight: 400;
        --atyc-label-size: 6px;
        --atyc-coord-size: 5px;
        --atyc-prog-w: 80px;
        --atyc-stage-gap: 20px;
    }

    .atyc-coord.tr,
    .atyc-coord.br {
        display: none;
    }

    #atyc-measure {
        bottom: -30px;
    }

    .atyc-blob.b3 {
        display: none;
    }
}

/* ── Mobile estándar (400px – 599px) ── */
@media (max-width: 599px) and (min-width: 400px) {
    :root {
        --atyc-logo-size: min(170px, 58vw);
        --atyc-brand-size: 10px;
        --atyc-brand-weight: 400;
        --atyc-label-size: 5.5px;
        --atyc-coord-size: 5px;
        --atyc-prog-w: 75px;
        --atyc-stage-gap: 18px;
    }

    .atyc-coord.tr,
    .atyc-coord.br {
        display: none;
    }

    .atyc-blob.b3 {
        display: none;
    }

    #atyc-phase-lbl {
        top: 18px;
        letter-spacing: 0.3em;
    }

    .atyc-coord.tl {
        top: 16px;
        left: 16px;
    }

    .atyc-coord.bl {
        bottom: 48px;
        left: 16px;
    }

    #atyc-skip {
        bottom: 18px;
        right: 16px;
        font-size: 6.5px;
        padding: 8px 14px;
    }

    #atyc-prog-wrap {
        bottom: 22px;
    }

    #atyc-measure {
        bottom: -28px;
    }
}

/* ── Mobile pequeño (< 400px — iPhone SE, etc.) ── */
@media (max-width: 399px) {
    :root {
        --atyc-logo-size: min(150px, 60vw);
        --atyc-brand-size: 9px;
        --atyc-brand-weight: 400;
        --atyc-label-size: 5px;
        --atyc-coord-size: 4.5px;
        --atyc-prog-w: 65px;
        --atyc-stage-gap: 16px;
    }

    .atyc-coord.tr,
    .atyc-coord.br,
    .atyc-coord.bl {
        display: none;
    }

    .atyc-blob.b2,
    .atyc-blob.b3 {
        display: none;
    }

    #atyc-phase-lbl {
        top: 14px;
        letter-spacing: 0.25em;
        font-size: 4.5px;
    }

    .atyc-coord.tl {
        top: 12px;
        left: 12px;
    }

    #atyc-skip {
        bottom: 14px;
        right: 12px;
        font-size: 6px;
        padding: 7px 12px;
        letter-spacing: 0.25em;
    }

    #atyc-prog-wrap {
        bottom: 18px;
    }

    #atyc-measure {
        display: none;
    }

    .atyc-ch {
        width: 12px;
        height: 12px;
    }

    .atyc-ch.tl {
        top: -6px;
        left: -6px;
    }

    .atyc-ch.tr {
        top: -6px;
        right: -6px;
    }

    .atyc-ch.bl {
        bottom: -6px;
        left: -6px;
    }

    .atyc-ch.br {
        bottom: -6px;  
        right: -6px;
    }
}

/* ── Mobile landscape (altura < 500px, ancho > 600px) ── */
@media (max-height: 500px) and (orientation: landscape) {
    :root {
        --atyc-logo-size: min(140px, 38vh);
        --atyc-brand-size: 9px;
        --atyc-stage-gap: 12px;
        --atyc-prog-w: 70px;
    }

    #atyc-phase-lbl {
        top: 10px;
    }

    .atyc-coord.tl {
        top: 10px;
        left: 14px;
    }

    .atyc-coord.tr {
        top: 10px;
        right: 14px;
    }

    .atyc-coord.bl {
        bottom: 36px;
        left: 14px;
    }

    .atyc-coord.br {
        bottom: 36px;
        right: 14px;
    }

    #atyc-prog-wrap {
        bottom: 14px;
    }

    #atyc-skip {
        bottom: 12px;
        right: 14px;
        padding: 6px 12px;
    }

    #atyc-measure {
        display: none;
    }

    .atyc-blob.b3 {
        display: none;
    }
}