/**
 * STINA Brand Portal — Future-forward 3D logo gateway
 */

.brand-portal {
    position: relative;
    overflow: hidden;
    background: transparent;
}

.brand-portal__sky {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 65% 30%, rgba(27, 77, 46, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse 50% 40% at 15% 75%, rgba(197, 160, 115, 0.06) 0%, transparent 50%),
        linear-gradient(180deg, var(--home-bg-alt) 0%, var(--home-bg) 100%);
    pointer-events: none;
}

.brand-portal__horizon {
    position: absolute;
    bottom: 0;
    left: -20%;
    right: -20%;
    height: 55%;
    background-image:
        linear-gradient(rgba(27, 77, 46, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(27, 77, 46, 0.08) 1px, transparent 1px);
    background-size: 56px 56px;
    transform: perspective(500px) rotateX(74deg);
    transform-origin: center top;
    mask-image: linear-gradient(to top, black 15%, transparent 85%);
    -webkit-mask-image: linear-gradient(to top, black 15%, transparent 85%);
    pointer-events: none;
    animation: portal-grid-flow 20s linear infinite;
}

@keyframes portal-grid-flow {
    from { background-position: 0 0; }
    to { background-position: 0 56px; }
}

.brand-portal__particles {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(197, 160, 115, 0.4) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.15;
    pointer-events: none;
}

/* Content */
.brand-portal__content {
    position: relative;
    z-index: 3;
    color: var(--stina-green-dark);
}

.brand-portal__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--stina-gold);
    margin-bottom: 1rem;
}

.brand-portal__eyebrow-dot {
    width: 8px;
    height: 8px;
    background: var(--stina-gold);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--stina-gold);
    animation: portal-pulse 2s ease-in-out infinite;
}

@keyframes portal-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

.brand-portal__title {
    font-size: clamp(1.9rem, 3.8vw, 2.75rem);
    color: var(--stina-green-dark);
    margin-bottom: 1rem;
    line-height: 1.12;
}

.brand-portal__lead {
    color: var(--stina-gray);
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 1.75rem;
}

.brand-portal__pillars {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.brand-portal__pillar-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--home-stroke);
    border-left: 3px solid var(--stina-gold);
    border-radius: 0 12px 12px 0;
    box-shadow: 0 8px 24px rgba(13, 18, 16, 0.04);
    opacity: 0;
    animation: pillar-in 0.6s ease forwards;
    animation-delay: calc(var(--pi) * 0.1s);
}

@keyframes pillar-in {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: translateX(0); }
}

.brand-portal__pillar-num {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--stina-gold);
    opacity: 0.7;
    min-width: 1.5rem;
}

.brand-portal__pillar-text {
    font-size: 0.92rem;
    color: var(--stina-gray);
}

.brand-portal__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* 3D Gateway Stage */
.brand-portal__stage {
    position: relative;
    z-index: 2;
    perspective: 1200px;
    perspective-origin: 50% 42%;
    min-height: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.brand-portal__gateway {
    position: relative;
    width: 100%;
    max-width: 440px;
    height: 420px;
    transform-style: preserve-3d;
}

.brand-portal__tunnel {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    transform-style: preserve-3d;
    pointer-events: none;
    z-index: 1;
}

.brand-portal__ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100% - var(--ring) * 8%);
    height: calc(70% - var(--ring) * 6%);
    transform: translate(-50%, -50%) translateZ(calc(var(--ring) * -35px)) rotateX(8deg);
    border: 1px solid rgba(197, 160, 115, calc(0.35 - var(--ring) * 0.04));
    border-radius: 50% / 40%;
    opacity: calc(1 - var(--ring) * 0.1);
    animation: tunnel-pulse 3s ease-in-out infinite;
    animation-delay: calc(var(--ring) * 0.15s);
}

@keyframes tunnel-pulse {
    0%, 100% { border-color: rgba(197, 160, 115, 0.15); }
    50% { border-color: rgba(197, 160, 115, 0.35); }
}

.brand-portal__frame {
    position: absolute;
    inset: 5% 8%;
    pointer-events: none;
    transform-style: preserve-3d;
    z-index: 2;
}

.brand-portal__frame-leg {
    position: absolute;
    bottom: 0;
    width: 3px;
    height: 75%;
    background: linear-gradient(to top, var(--stina-gold), rgba(197, 160, 115, 0.2));
    box-shadow: 0 0 20px rgba(197, 160, 115, 0.4);
    transform: translateZ(20px);
}

.brand-portal__frame-leg--left { left: 0; }
.brand-portal__frame-leg--right { right: 0; }

.brand-portal__frame-arch {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--stina-gold), transparent);
    box-shadow: 0 0 24px rgba(197, 160, 115, 0.5);
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    transform: translateZ(30px);
}

.brand-portal__core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateZ(120px);
    text-align: center;
    z-index: 20;
    transform-style: preserve-3d;
}

.brand-portal__tagline {
    margin: 1rem 0 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 0.9rem;
    color: var(--stina-gold-dark);
    letter-spacing: 0.06em;
    opacity: 0.9;
}

.brand-portal__speedlines {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    transform: translateZ(10px);
    z-index: 3;
}

.brand-portal__speedline {
    position: absolute;
    top: calc(20% + var(--sl) * 12%);
    left: 50%;
    width: 120px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(197, 160, 115, 0.5), transparent);
    transform: translateX(-50%) translateZ(calc(var(--sl) * 15px));
    animation: speedline 2.5s ease-in-out infinite;
    animation-delay: calc(var(--sl) * 0.2s);
    opacity: 0;
}

@keyframes speedline {
    0% { opacity: 0; transform: translateX(-80%) scaleX(0.5); }
    50% { opacity: 0.8; transform: translateX(-50%) scaleX(1); }
    100% { opacity: 0; transform: translateX(-20%) scaleX(0.5); }
}

.brand-portal__hint {
    margin-top: 1.5rem;
    font-size: 0.82rem;
    color: var(--stina-gray);
    text-align: center;
    max-width: 320px;
}

/* Logo Portal — white card on dark gateway */
.logo-portal {
    position: relative;
    width: min(280px, 75vw);
    margin: 0 auto;
    transform-style: preserve-3d;
    z-index: 10;
}

.logo-portal--tilt {
    animation: none;
}

.logo-portal--hero {
    width: min(300px, 80vw);
}

.logo-portal--hero .logo-portal__outer {
    padding: 1.75rem 2.25rem;
}

.logo-portal--hero .logo-portal__img {
    width: min(240px, 70vw);
}

.logo-portal__tilt-stage {
    perspective: 650px;
    transform-style: preserve-3d;
}

.logo-portal__outer {
    position: relative;
    padding: 1.5rem 2rem;
    background: #ffffff;
    border: 1px solid rgba(197, 160, 115, 0.45);
    border-radius: 12px;
    box-shadow:
        0 4px 0 rgba(197, 160, 115, 0.25),
        0 24px 48px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
    isolation: isolate;
    z-index: 2;
    transform-style: preserve-3d;
    will-change: transform;
}

.logo-portal__shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        125deg,
        rgba(255, 255, 255, 0.55) 0%,
        transparent 42%,
        transparent 58%,
        rgba(197, 160, 115, 0.12) 100%
    );
    pointer-events: none;
    z-index: 3;
}

.logo-portal__outer--hub {
    padding: 1.25rem 1.75rem;
    border-radius: var(--stina-radius);
    box-shadow:
        0 24px 48px rgba(13, 18, 16, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}

.logo-portal__outer--hub .logo-portal__img {
    width: 140px;
    height: auto;
}

@keyframes logo-portal-float {
    0%, 100% { transform: translateY(0) rotateX(0deg); }
    50% { transform: translateY(-10px) rotateX(3deg); }
}

.logo-portal__hex {
    position: absolute;
    inset: -22%;
    color: rgba(197, 160, 115, 0.35);
    animation: hex-rotate 30s linear infinite;
    pointer-events: none;
    z-index: 0;
}

.logo-portal__hex-svg {
    width: 100%;
    height: 100%;
}

@keyframes hex-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.logo-portal__core {
    position: relative;
    transform: translateZ(50px);
    transform-style: preserve-3d;
    z-index: 2;
}

.logo-portal__halo {
    position: absolute;
    inset: -30%;
    background: radial-gradient(circle, rgba(197, 160, 115, 0.2) 0%, transparent 65%);
    filter: blur(24px);
    animation: halo-breathe 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes halo-breathe {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

.logo-portal__plate {
    position: relative;
    padding: 1.5rem 2rem;
    background: #ffffff;
    border: 1px solid rgba(197, 160, 115, 0.45);
    border-radius: 8px;
    box-shadow:
        0 4px 0 rgba(197, 160, 115, 0.25),
        0 24px 48px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    overflow: hidden;
    isolation: isolate;
    z-index: 2;
}

.logo-portal__img {
    display: block;
    width: min(220px, 65vw);
    height: auto;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    filter: none;
    will-change: transform;
}

.logo-portal:not(.logo-portal--tilt):hover .logo-portal__img {
    transform: scale(1.02);
}

.logo-portal__scan {
    display: none;
}

.logo-portal__beam {
    position: absolute;
    top: 50%;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--stina-gold), transparent);
    opacity: 0.6;
    pointer-events: none;
}

.logo-portal__beam--l {
    left: -50px;
    transform: translateY(-50%);
}

.logo-portal__beam--r {
    right: -50px;
    transform: translateY(-50%) scaleX(-1);
}

.logo-portal__floor-light {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 28px;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.35) 0%, rgba(197, 160, 115, 0.2) 40%, transparent 75%);
    filter: blur(10px);
    pointer-events: none;
    z-index: 1;
}

/* Responsive */
@media (max-width: 991.98px) {
    .brand-portal__stage {
        min-height: auto;
        perspective: none;
        margin-top: 1rem;
    }

    .brand-portal__gateway {
        height: auto;
        min-height: 300px;
    }

    .brand-portal__tunnel,
    .brand-portal__speedlines,
    .brand-portal__frame-leg,
    .brand-portal__frame-arch {
        opacity: 0.6;
    }

    .brand-portal__core {
        transform: translate(-50%, -50%);
    }

    .logo-portal {
        animation: none;
    }

    .logo-portal__hex {
        animation: none;
    }
}

@media (max-width: 575.98px) {
    .brand-portal__gateway {
        min-height: 250px;
    }

    .brand-portal__frame {
        inset: 8% 10%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand-portal__horizon,
    .brand-portal__ring,
    .brand-portal__speedline,
    .brand-portal__eyebrow-dot,
    .brand-portal__pillar-item,
    .logo-portal:not(.logo-portal--tilt),
    .logo-portal__hex,
    .logo-portal__halo,
    .logo-portal__scan {
        animation: none;
    }

    .logo-portal__outer,
    .logo-portal__img {
        transform: none !important;
    }

    .why-3d__hub {
        transform: translate(-50%, -50%) translateZ(60px) !important;
    }

    .brand-portal__pillar-item {
        opacity: 1;
    }
}
