/* Premium Global Styles */
body {
    background-color: #010204;
    color: #E2E8F0;
    font-family: 'Rajdhani', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.font-display {
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.02em;
}

/* Sci-Fi HUD Borders - Redesigned to be lighter, elegant, premium */
.hud-border {
    position: relative;
    background: rgba(10, 15, 22, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 240, 255, 0.05); /* very subtle border */
    box-shadow: 0 4px 30px rgba(0, 240, 255, 0.02);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hud-border::before,
.hud-border::after {
    content: '';
    position: absolute;
    width: 6px; /* thinner corners */
    height: 6px;
    border: 1px solid rgba(0, 240, 255, 0.4); /* softer glow color */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    opacity: 0.6;
}

.hud-border::before {
    top: -1px;
    left: -1px;
    border-right: none;
    border-bottom: none;
}

.hud-border::after {
    bottom: -1px;
    right: -1px;
    border-left: none;
    border-top: none;
}

.hud-border:hover {
    background: rgba(10, 15, 22, 0.7);
    border: 1px solid rgba(0, 240, 255, 0.15);
    box-shadow: 0 8px 40px rgba(0, 240, 255, 0.08); /* deeper glow on hover */
}

.hud-border:hover::before,
.hud-border:hover::after {
    width: 12px;
    height: 12px;
    border-color: rgba(0, 240, 255, 0.8);
    opacity: 1;
}

/* Base text selection color for premium feel */
::selection {
    background: rgba(0, 240, 255, 0.2);
    color: #fff;
}

/* Premium smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Phase 6: the homepage Hero is the only redesigned surface. */
.hero.hero-scroll-scene {
    --hero-poster: url('/assets/video/hero-scroll-desktop-poster.webp');
    --hero-progress: 0;
    position: relative;
    height: 220vh;
    padding: 0;
    isolation: isolate;
    background: #020408;
}

.hero-scroll-sticky {
    position: sticky;
    top: 4.75rem;
    height: calc(100vh - 4.75rem);
    min-height: 35rem;
    overflow: hidden;
    display: grid;
    align-items: stretch;
    background: #020408;
}

.hero-scroll-media {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(calc(100% - 3rem), calc((100vh - 7.75rem) * 1.7778));
    aspect-ratio: 16 / 9;
    overflow: hidden;
    transform: translate(-50%, -50%);
    contain: layout paint;
    border: 1px solid rgba(113, 226, 237, 0.48);
    border-radius: 1rem;
    background: #071016 var(--hero-poster) center / cover no-repeat;
    box-shadow:
        0 1.8rem 4.5rem rgba(0, 0, 0, 0.58),
        inset 0 0 0 1px rgba(229, 252, 255, 0.06),
        inset 0 -2.5rem 4rem rgba(0, 0, 0, 0.2);
}

.hero-instrument-frame::before,
.hero-instrument-frame::after {
    content: '';
    position: absolute;
    z-index: 4;
    pointer-events: none;
}

.hero-instrument-frame::before {
    inset: 0.45rem;
    border: 1px solid rgba(179, 244, 249, 0.12);
    border-radius: 0.7rem;
}

.hero-instrument-frame::after {
    inset: -1px;
    border-radius: inherit;
    box-shadow: 0 0.8rem 2.4rem rgba(0, 185, 207, 0.16);
}

.hero-scroll-video,
.hero-scroll-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.hero-frame-scan {
    position: absolute;
    z-index: 3;
    inset-block: 0;
    left: 0;
    width: 24%;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(-160%, 0, 0) skewX(-10deg);
    background: linear-gradient(90deg, transparent, rgba(165, 248, 255, 0.11), rgba(221, 253, 255, 0.2), transparent);
}

.hero-scroll-scene[data-media-state='ready'] .hero-frame-scan {
    opacity: 1;
    animation: hero-frame-sweep 7s 1.2s cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

@keyframes hero-frame-sweep {
    0%, 68% { transform: translate3d(-160%, 0, 0) skewX(-10deg); opacity: 0; }
    74% { opacity: 0.72; }
    92%, 100% { transform: translate3d(520%, 0, 0) skewX(-10deg); opacity: 0; }
}

.hero-frame-corner {
    position: absolute;
    z-index: 5;
    width: clamp(1.2rem, 2.4vw, 2.2rem);
    height: clamp(1.2rem, 2.4vw, 2.2rem);
    pointer-events: none;
    border-color: #77f5ff;
    filter: drop-shadow(0 0.25rem 0.45rem rgba(0, 187, 204, 0.3));
}

.hero-frame-corner.top-left { top: 0.75rem; left: 0.75rem; border-top: 2px solid; border-left: 2px solid; }
.hero-frame-corner.top-right { top: 0.75rem; right: 0.75rem; border-top: 2px solid; border-right: 2px solid; }
.hero-frame-corner.bottom-left { bottom: 0.75rem; left: 0.75rem; border-bottom: 2px solid; border-left: 2px solid; }
.hero-frame-corner.bottom-right { bottom: 0.75rem; right: 0.75rem; border-bottom: 2px solid; border-right: 2px solid; }

.hero-scroll-status {
    position: absolute;
    z-index: 5;
    right: 1.1rem;
    bottom: 1rem;
    display: grid;
    grid-template-columns: auto minmax(4rem, 7rem);
    align-items: center;
    gap: 0.65rem;
    color: rgba(221, 249, 252, 0.82);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-scroll-progress {
    position: relative;
    display: block;
    height: 2px;
    overflow: hidden;
    background: rgba(220, 252, 255, 0.2);
}

.hero-scroll-progress::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: scaleX(var(--hero-progress));
    transform-origin: left center;
    background: #75f5ff;
    box-shadow: 0 0.25rem 0.55rem rgba(0, 210, 229, 0.42);
}

.hero-scroll-video {
    display: block;
    object-fit: cover;
    opacity: 0;
    transition: opacity 240ms cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

.hero-scroll-scene[data-media-state='ready'] .hero-scroll-video {
    opacity: 1;
}

.hero-scroll-overlay {
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(2, 4, 8, 0.93) 0%, rgba(2, 4, 8, 0.72) 42%, rgba(2, 4, 8, 0.22) 72%, rgba(2, 4, 8, 0.5) 100%),
        linear-gradient(0deg, rgba(2, 4, 8, 0.78) 0%, transparent 48%, rgba(2, 4, 8, 0.36) 100%);
}

.hero-scroll-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(17rem, 0.8fr);
    align-items: center;
    gap: clamp(2rem, 6vw, 5.5rem);
    padding-block: clamp(2rem, 6vh, 4.5rem);
}

.hero-scroll-copy {
    max-width: 48rem;
    text-shadow: 0 0.2rem 1.5rem rgba(0, 0, 0, 0.72);
}

html[lang='de'] .hero-scroll-content {
    grid-template-columns: minmax(0, 1fr) minmax(17rem, 19rem);
    gap: clamp(1.5rem, 3vw, 3rem);
}

html[lang='de'] .hero-scroll-copy {
    max-width: clamp(42rem, 56vw, 54rem);
}

html[lang='de'] .hero-scroll-copy h1 {
    max-width: 18ch;
    font-size: clamp(2.65rem, 4.6vw, 4.75rem);
    text-wrap: balance;
}

.hero-scroll-content .signal {
    align-self: end;
    margin-bottom: clamp(1rem, 4vh, 3rem);
    border-color: rgba(153, 227, 235, 0.28);
    background: rgba(3, 10, 15, 0.86);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(12px);
}

.hero-scroll-content .button.secondary {
    background: rgba(3, 10, 15, 0.72);
    border-color: rgba(244, 247, 251, 0.42);
}

@media (max-width: 767px) {
    .hero.hero-scroll-scene {
        --hero-poster: url('/assets/video/hero-scroll-mobile-poster.webp');
        height: 180vh;
    }

    .hero-scroll-sticky {
        min-height: 38rem;
    }

    .hero-scroll-media {
        top: 72%;
        width: calc(100% - 3rem);
        max-width: 32rem;
        aspect-ratio: 4 / 5;
        border-radius: 0.85rem;
    }

    .hero-scroll-status {
        right: 0.85rem;
        bottom: 0.8rem;
        grid-template-columns: minmax(3.5rem, 5.5rem);
    }

    .hero-scroll-status > span:first-child { display: none; }

    .hero-scroll-overlay {
        background:
            linear-gradient(0deg, rgba(2, 4, 8, 0.94) 0%, rgba(2, 4, 8, 0.72) 55%, rgba(2, 4, 8, 0.48) 100%),
            linear-gradient(90deg, rgba(2, 4, 8, 0.35), transparent 55%, rgba(2, 4, 8, 0.24));
    }

    .hero-scroll-content {
        grid-template-columns: 1fr;
        align-content: space-between;
        gap: 1rem;
        padding-block: clamp(1.25rem, 4vh, 2.25rem);
    }

    .hero-scroll-copy h1 {
        max-width: 13ch;
        font-size: clamp(2.25rem, 11.5vw, 3.75rem);
    }

    html[lang='de'] .hero-scroll-content {
        grid-template-columns: 1fr;
    }

    html[lang='de'] .hero-scroll-copy,
    html[lang='de'] .hero-scroll-copy h1 {
        max-width: 100%;
    }

    html[lang='de'] .hero-scroll-copy h1 {
        font-size: clamp(2.05rem, 9.5vw, 3rem);
        text-wrap: pretty;
    }

    .hero-scroll-copy .lead {
        font-size: 1rem;
        line-height: 1.55;
    }

    .hero-scroll-content .actions {
        margin-top: 1.1rem;
    }

    .hero-scroll-content .button {
        flex: 1 1 100%;
    }

    .hero-scroll-content .signal {
        align-self: auto;
        margin: 0;
        padding: 1rem 1.1rem;
        font-size: 0.92rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-scroll-video {
        transition: none;
    }

    .hero.hero-scroll-scene {
        height: auto;
    }

    .hero-scroll-sticky {
        position: relative;
        top: auto;
        min-height: calc(100svh - 4.75rem);
    }

    .hero-frame-scan {
        animation: none !important;
        opacity: 0.16;
        transform: none;
    }

    .hero-scroll-progress::after { transform: scaleX(0); }
}

.hero-scroll-scene[data-media-state='poster'][data-media-reason] {
    height: auto;
}

.hero-scroll-scene[data-media-state='poster'][data-media-reason] .hero-scroll-sticky {
    position: relative;
    top: auto;
    min-height: calc(100svh - 4.75rem);
}
