/* ==========================================================================
   GRUPO PIC - Sitio Estático de Enlaces
   Tecnologías nativas CSS3 | Mobile-First | Institucional #2A3B6D
   ========================================================================== */

:root {
    --brand-navy: #2A3B6D;
    --brand-navy-rgb: 42, 59, 109;
    --brand-navy-deep: #16203F;
    --brand-orange: #F39200;
    --brand-red: #E52D27;

    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.78);
    --text-muted: rgba(255, 255, 255, 0.62);

    --card-bg: rgba(14, 21, 42, 0.68);
    --card-bg-hover: rgba(26, 39, 76, 0.84);
    --card-border: rgba(255, 255, 255, 0.45);
    --card-border-hover: rgba(255, 255, 255, 0.85);
    --card-radius: 16px;

    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
    height: 100%;
    background-color: var(--brand-navy-deep);
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100%;
    min-height: 100dvh;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: var(--brand-navy-deep);
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

/* Utilidad de accesibilidad */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Fondo ambiental exclusivo para pantallas anchas */
.ambient-backdrop {
    display: none;
}

/* Contenedor principal (Mobile-First a pantalla completa) */
.stage {
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    isolation: isolate;
    overflow: hidden;
}

/* Fotografía industrial de fondo con respaldo JPG + WebP */
.stage__bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-color: var(--brand-navy);
    background-image: url("../img/bg-plant.jpg");
    background-image: image-set(
        url("../img/bg-plant.webp") type("image/webp"),
        url("../img/bg-plant.jpg") type("image/jpeg")
    );
    background-size: cover;
    background-position: center 65%;
    background-repeat: no-repeat;
    transform: scale(1.01);
}

/* Superposición institucional #2A3B6D para máximo contraste del logotipo blanco */
.stage__overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        180deg,
        rgba(var(--brand-navy-rgb), 0.94) 0%,
        rgba(var(--brand-navy-rgb), 0.84) 24%,
        rgba(var(--brand-navy-rgb), 0.62) 55%,
        rgba(18, 27, 53, 0.78) 82%,
        rgba(12, 18, 36, 0.90) 100%
    );
}

.stage__content {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: max(1.25rem, env(safe-area-inset-top)) 1.25rem max(1.75rem, env(safe-area-inset-bottom));
}

/* Barra superior (botón compartir) */
.top-actions {
    display: flex;
    justify-content: flex-end;
    min-height: 2.5rem;
}

.share-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(14, 21, 42, 0.42);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.share-btn svg {
    width: 1.1rem;
    height: 1.1rem;
}

.share-btn:hover {
    background: rgba(var(--brand-navy-rgb), 0.85);
    border-color: rgba(255, 255, 255, 0.7);
}

.share-btn:active {
    transform: scale(0.94);
}

.share-btn:focus-visible {
    outline: 2px solid var(--brand-orange);
    outline-offset: 2px;
}

/* Encabezado y logotipo GRUPO PIC */
.brand-header {
    text-align: center;
    padding: 0.75rem 0.5rem 1.85rem;
    animation: fadeDown 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand-header__logo-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.85rem;
}

.brand-header__logo {
    width: min(240px, 68vw);
    max-width: 250px;
    height: auto;
    display: block;
    filter: drop-shadow(0 6px 18px rgba(8, 13, 28, 0.42));
}

.brand-header__title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.brand-header__subtitle {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

/* Lista vertical de enlaces (estilo tarjetas translúcidas de referencia) */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
    width: 100%;
    margin-bottom: auto;
}

.link-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    min-height: 4.65rem;
    padding: 0.9rem 1.15rem;
    text-decoration: none;
    color: var(--text-primary);
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: 0 8px 24px rgba(7, 12, 26, 0.32);
    transition:
        transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(0.08s + var(--stagger, 0) * 0.07s);
}

.link-card:hover {
    transform: translateY(-2px);
    background: var(--card-bg-hover);
    border-color: var(--card-border-hover);
    box-shadow: 0 12px 28px rgba(7, 12, 26, 0.48);
}

.link-card:active,
.link-card.is-pressed {
    transform: scale(0.985);
}

.link-card:focus-visible {
    outline: 2px solid var(--brand-orange);
    outline-offset: 3px;
}

/* Contenedor de icono izquierdo */
.link-card__icon {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    background: rgba(var(--brand-navy-rgb), 0.55);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.link-card:hover .link-card__icon {
    background: rgba(var(--brand-navy-rgb), 0.92);
    border-color: rgba(255, 255, 255, 0.45);
    transform: scale(1.04);
}

.link-card__icon svg {
    width: 1.45rem;
    height: 1.45rem;
}

.link-card__brand-icon {
    width: 1.75rem;
    height: 1.75rem;
    object-fit: contain;
}

/* Texto de la tarjeta */
.link-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.link-card__title {
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.link-card__subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Indicador derecho discreto */
.link-card__arrow {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    color: rgba(255, 255, 255, 0.55);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, color 0.2s ease;
}

.link-card__arrow svg {
    width: 1.15rem;
    height: 1.15rem;
}

.link-card:hover .link-card__arrow {
    color: var(--text-primary);
    transform: translateX(3px);
}

/* Pie de página */
.site-footer {
    margin-top: 2.25rem;
    padding-top: 1rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Notificación Toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%) translateY(12px);
    background: rgba(14, 21, 42, 0.94);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 0.6rem 1.15rem;
    font-size: 0.85rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 50;
}

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

/* Adaptación para Tablets y Escritorio (preserva nitidez de la foto vertical 682x1024) */
@media (min-width: 540px) {
    body {
        align-items: center;
        padding: 1.5rem;
    }

    .ambient-backdrop {
        display: block;
        position: fixed;
        inset: -32px;
        z-index: 0;
        background-color: var(--brand-navy-deep);
        background-image:
            linear-gradient(180deg, rgba(var(--brand-navy-rgb), 0.88), rgba(12, 18, 36, 0.92)),
            url("../img/bg-plant.jpg");
        background-size: cover;
        background-position: center;
        filter: blur(26px) saturate(1.1);
        transform: scale(1.08);
    }

    .stage {
        max-width: 440px;
        min-height: min(820px, calc(100dvh - 3rem));
        border-radius: 28px;
        border: 1px solid rgba(255, 255, 255, 0.22);
        box-shadow:
            0 24px 64px rgba(5, 9, 20, 0.65),
            0 0 0 1px rgba(var(--brand-navy-rgb), 0.4);
    }

    .stage__content {
        padding: 1.5rem 1.6rem 1.85rem;
    }
}

/* Animaciones y respeto a reducción de movimiento */
@keyframes fadeDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
