/* ========================================================================== */
/* HOME PAGE - styles specific to the landing page (Home.razor)               */
/* ========================================================================== */

/* ========================================================================== */
/* SCROLL REVEAL - IntersectionObserver-driven entrance animations            */
/* ========================================================================== */

/* Base hidden state for all reveal elements */
[data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    will-change: transform, opacity;
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-reveal="left"] {
    transform: translateX(-40px);
}

[data-reveal="right"] {
    transform: translateX(40px);
}

[data-reveal="scale"] {
    transform: scale(0.88);
    opacity: 0;
}

/* Revealed state */
[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

[data-reveal="left"].revealed,
[data-reveal="right"].revealed {
    transform: translateX(0);
}

[data-reveal="scale"].revealed {
    transform: scale(1);
}

/* Stagger children: add data-reveal-stagger to parent, data-reveal to each child */
[data-reveal-stagger] > [data-reveal] {
    transition-delay: calc(var(--reveal-index, 0) * 80ms);
}

/* ========================================================================== */
/* HERO ENTRANCE - plays immediately on page load, no scroll trigger          */
/* ========================================================================== */

.hero-entrance > * {
    opacity: 0;
    will-change: transform, opacity;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    animation: hero-appear 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Overline: dim to 0.7 */
.hero-entrance > *:nth-child(1) { animation-delay: 0ms; animation-name: hero-appear-dim; }
/* Headline container */
.hero-entrance > *:nth-child(2) { animation: none; opacity: 1; }
/* Subtitle: dim to 0.82 */
.hero-entrance > *:nth-child(3) { animation-delay: 1200ms; animation-name: hero-appear-subtle; }
/* Buttons */
.hero-entrance > *:nth-child(4) { animation-delay: 1500ms; }

/* ========================================================================== */
/* HERO KINETIC HEADLINE - each phrase scales in and settles                   */
/* ========================================================================== */

.hero-headline {
    line-height: 1.2;
    color: #FAFAFA;
    font-weight: 700;
}

.hero-phrase {
    display: inline-block;
    font-size: var(--mud-typography-h2-size, 3.75rem);
    font-family: var(--mud-typography-h2-family);
    font-weight: var(--mud-typography-h2-weight, 700);
    letter-spacing: var(--mud-typography-h2-letterspacing, -0.00833em);
    opacity: 0;
    transform: scale(1.35);
    animation: phrase-settle 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.hero-phrase:nth-child(1) { animation-delay: 200ms; }
.hero-phrase:nth-child(2) { animation-delay: 600ms; }
.hero-phrase:nth-child(4),
.hero-phrase:nth-child(3) { animation-delay: 1000ms; }

@keyframes phrase-settle {
    0% {
        opacity: 0;
        transform: scale(1.35);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes hero-appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes hero-appear-dim {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 0.7;
        transform: translateY(0);
    }
}

@keyframes hero-appear-subtle {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 0.82;
        transform: translateY(0);
    }
}

/* ========================================================================== */
/* CTA SHIMMER - sweep effect on primary buttons                              */
/* ========================================================================== */

.shimmer-btn {
    position: relative;
    overflow: hidden;
}

.shimmer-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 80%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 10%,
        rgba(0, 0, 0, 0.05) 30%,
        rgba(0, 0, 0, 0.12) 50%,
        rgba(0, 0, 0, 0.05) 70%,
        transparent 90%
    );
    animation: shimmer-sweep 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
}

@keyframes shimmer-sweep {
    0%   { left: -100%; }
    60%  { left: 120%; }
    100% { left: 120%; }
}

/* ========================================================================== */
/* HERO CTA - Frosted primary button for dark banners                         */
/* ========================================================================== */

.hero-cta-primary.mud-button-root {
    position: relative;
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    color: #FAFAFA !important;
    font-weight: 700;
    border-radius: var(--m3-shape-full) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow:
        0 0 20px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
    overflow: hidden;
    transition: background 0.6s ease,
                box-shadow 0.6s ease,
                border-color 0.6s ease !important;
}

.hero-cta-primary.mud-button-root:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    box-shadow:
        0 0 30px rgba(255, 255, 255, 0.15),
        0 8px 32px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
}

/* Shimmer sweep inside liquid glass */
.hero-cta-primary.mud-button-root::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 70%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 15%,
        rgba(255, 255, 255, 0.12) 40%,
        rgba(255, 255, 255, 0.22) 50%,
        rgba(255, 255, 255, 0.12) 60%,
        transparent 85%
    );
    animation: shimmer-sweep 2.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
}

/* Animated glow pulse behind button */
.hero-cta-primary.mud-button-root::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: var(--m3-shape-full);
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15),
        rgba(255, 255, 255, 0.05),
        rgba(255, 255, 255, 0.2),
        rgba(255, 255, 255, 0.05)
    );
    background-size: 300% 300%;
    animation: glow-shift 4s ease-in-out infinite;
    z-index: -1;
    opacity: 0.6;
}

@keyframes glow-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ========================================================================== */
/* TECH EXPLORER - interactive two-panel technology showcase                   */
/* ========================================================================== */

.tech-explorer {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 16px;
    overflow: hidden;
    background: var(--mud-palette-surface);
}

.tech-explorer-nav {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-background);
}

.tech-explorer-tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    color: var(--mud-palette-text-secondary);
    font-family: var(--font-base);
    font-size: 0.9rem;
    font-weight: 500;
    flex: 1 1 0;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.tech-explorer-tab:last-child {
    border-bottom: none;
}

.tech-explorer-tab:hover {
    background: var(--mud-palette-background-grey);
    color: var(--mud-palette-text-primary);
}

.tech-explorer-tab.active {
    color: var(--mud-palette-text-primary);
    font-weight: 600;
    background: var(--mud-palette-surface);
}

.tech-explorer-tab-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.tech-explorer-tab.active .tech-explorer-tab-indicator {
    opacity: 1;
}

.tech-explorer-tab-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tech-explorer-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 56px;
}

@keyframes tech-detail-enter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tech-explorer-icon-ring {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 28px;
    position: relative;
    background: var(--mud-palette-background-grey);
}

.tech-explorer-icon-ring::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--ring-color);
    border-right-color: var(--ring-color);
    animation: ring-rotate 4s linear infinite;
    transition: border-color 0.3s ease;
}

.tech-explorer-detail-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.tech-explorer-detail-text {
    animation: tech-detail-enter 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes ring-rotate {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Mobile: stack vertically */
@media (max-width: 767.98px) {
    .tech-explorer {
        grid-template-columns: 1fr;
    }

    .tech-explorer-nav {
        border-right: none;
        border-bottom: 1px solid var(--mud-palette-lines-default);
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tech-explorer-tab {
        flex: 1 1 0;
        justify-content: center;
        border-bottom: none;
        border-right: 1px solid var(--mud-palette-lines-default);
        padding: 14px 18px;
    }

    .tech-explorer-tab:last-child {
        border-right: none;
    }

    .tech-explorer-tab-indicator {
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        width: auto;
        height: 3px;
        border-radius: 3px 3px 0 0;
    }

    .tech-explorer-tab-label {
        display: none;
    }

    .tech-explorer-detail {
        padding: 32px 24px;
        min-height: 280px;
    }
}
