/* ─────────────────────────────────────────────────────────────────────────
 * RetrofitEco landing — global tokens, base styles, animations and shared
 * primitives. Section-specific styles live in *.razor.css next to each
 * component. Everything here is intentionally NOT scoped: tokens have to be
 * visible to every component, animations are reused, etc.
 *
 * IMPORTANT: This file overrides MudBlazor's typography for the landing page.
 * The MudThemeProvider is still mounted because the contact-form / dialog
 * primitives need it, but body styles are driven by these CSS variables.
 * ─────────────────────────────────────────────────────────────────────── */

/* ─── TOKENS ─── */
:root {
    --c: #05070A;
    --s1: #0A0F14;
    --s2: #0E1620;
    --s3: #111d2b;
    --cy: #00E6FF;
    --cyd: #00B7C8;
    --cyi: #5FF7FF;
    --vi: #7C4DFF;
    --ok: #00FF9C;
    --warn: #FFB020;
    --hi: #E6F6FF;
    --md: #C7D7E0;
    --lo: #8BA0AE;
    --dim: #3a5060;
    --bc: rgba(0, 230, 255, .10);
    --bv: rgba(124, 77, 255, .20);
    --gc: 0 0 32px rgba(0, 230, 255, .14);
    --gv: 0 0 32px rgba(124, 77, 255, .16);
    --r: 10px;
    --rl: 16px;
}

/* ─── RESET (scoped to the landing page only — we'd kill MudBlazor otherwise) ─── */
.landing-root,
.landing-root *,
.landing-root *::before,
.landing-root *::after {
    box-sizing: border-box;
}

.landing-root {
    background: var(--c);
    color: var(--md);
    font-family: 'DM Sans', 'Inter', system-ui, sans-serif;
    font-weight: 300;
    line-height: 1.65;
    overflow-x: hidden;
    min-height: 100vh;
}

.landing-root h1,
.landing-root h2,
.landing-root h3,
.landing-root h4,
.landing-root h5,
.landing-root h6,
.landing-root p,
.landing-root ul,
.landing-root ol {
    margin: 0;
    padding: 0;
}

.landing-root ul,
.landing-root ol {
    list-style: none;
}

.landing-root button {
    font-family: inherit;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

/* Splash — shown until WASM boots */
.landing-splash {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--c);
    color: var(--cy);
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    letter-spacing: .14em;
    z-index: 9999;
}

/* Scrollbar */
.landing-root ::-webkit-scrollbar {
    width: 8px;
}

.landing-root ::-webkit-scrollbar-track {
    background: var(--s1);
}

.landing-root ::-webkit-scrollbar-thumb {
    background: var(--cyd);
    border-radius: 4px;
    border: 2px solid var(--s1);
}

.landing-root ::-webkit-scrollbar-thumb:hover {
    background: var(--cy);
}

/* Grid background */
.landing-root::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 230, 255, .018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 230, 255, .018) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Centered wrapper */
.wrap {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 1;
}

/* ─── COMMON SECTION PRIMITIVES ─── */
.landing-root section {
    position: relative;
    z-index: 1;
}

.sec-eye {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--cy);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.sec-eye::before {
    content: '';
    width: 20px;
    height: 1px;
    background: var(--cy);
}

.sec-eye.center {
    justify-content: center;
}

.landing-root h1 {
    font-family: 'Orbitron', monospace;
    font-size: clamp(34px, 5.2vw, 62px);
    font-weight: 700;
    line-height: 1.08;
    color: var(--hi);
    letter-spacing: -.01em;
}

/* <FocusOnNavigate Selector="h1" /> (App.razor) fokussiert die h1 nach jeder Navigation —
   gewollt für Screenreader, aber der Browser malt dabei einen Fokus-Rahmen um die Headline.
   Die h1 ist nur programmatisch fokussierbar (tabindex=-1), Tastatur-Fokusringe auf Links/
   Buttons bleiben unberührt. Gleiches Muster wie im Blazor-Standard-Template. */
.landing-root h1:focus,
.landing-root h1:focus-visible {
    outline: none;
}

.landing-root h1 em,
.landing-root h2 em,
.landing-root h3 em {
    font-style: normal;
    color: var(--cy);
}

.landing-root h2 {
    font-family: 'Orbitron', monospace;
    font-size: clamp(22px, 3vw, 38px);
    font-weight: 700;
    line-height: 1.15;
    color: var(--hi);
    letter-spacing: -.01em;
    margin-bottom: 14px;
}

.lead {
    font-size: 16px;
    font-weight: 300;
    line-height: 1.75;
    color: var(--md);
    max-width: 560px;
}

.lead.center {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Reveal-on-scroll — toggled via JS (intersection observer) */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .7s ease, transform .7s ease;
}

.reveal.on {
    opacity: 1;
    transform: none;
}

.reveal-d1 {
    transition-delay: .1s;
}

.reveal-d2 {
    transition-delay: .2s;
}

.reveal-d3 {
    transition-delay: .3s;
}

.reveal-d4 {
    transition-delay: .4s;
}

/* ─── PRIMARY CTA / GHOST BUTTONS ─── */
.btn-main {
    background: var(--cy);
    color: var(--c);
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    border: none;
    border-radius: var(--r);
    padding: 14px 32px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background .2s, box-shadow .2s, transform .2s;
}

.btn-main:hover {
    background: var(--cyi);
    box-shadow: var(--gc);
    transform: translateY(-2px);
}

.btn-ghost {
    font-size: 13px;
    font-weight: 400;
    color: var(--lo);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color .2s;
    background: none;
    border: none;
    cursor: pointer;
}

.btn-ghost:hover {
    color: var(--cy);
}

.btn-ghost::after {
    content: '→';
    font-size: 16px;
}

.btn-vi {
    background: var(--vi);
    color: var(--hi);
    font-family: 'Orbitron', monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    border: none;
    border-radius: var(--r);
    padding: 13px 28px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background .2s, box-shadow .2s, transform .2s;
}

.btn-vi:hover {
    background: #9b6dff;
    box-shadow: var(--gv);
    transform: translateY(-1px);
}

.btn-vi-ghost {
    font-size: 13px;
    font-weight: 400;
    color: var(--vi);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity .2s;
    background: none;
    border: none;
    cursor: pointer;
}

.btn-vi-ghost:hover {
    opacity: .75;
}

.btn-vi-ghost::after {
    content: '→';
    font-size: 15px;
}

.btn-inline-ghost {
    font-size: 13px;
    font-weight: 400;
    color: var(--lo);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color .2s;
}

.btn-inline-ghost:hover {
    color: var(--cy);
}

.btn-inline-ghost::after {
    content: '→';
    font-size: 15px;
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeLeft {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: .3;
    }
}

@keyframes pulseRing {
    0%, 100% {
        r: 6;
        opacity: .7;
    }

    50% {
        r: 10;
        opacity: .15;
    }
}

@keyframes ringpulse {
    0%, 100% {
        transform: scale(1);
        opacity: .4;
    }

    50% {
        transform: scale(1.08);
        opacity: .1;
    }
}

@keyframes stepPulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: .6;
    }
}

/* ─── RESPONSIVE PRIMITIVES ─── */
@media (max-width: 900px) {
    /* Buttons need a generous touch target on phone & tablet. */
    .btn-main,
    .btn-vi {
        padding: 14px 28px;
        min-height: 44px;
        line-height: 1.4;
    }

    .btn-ghost,
    .btn-vi-ghost,
    .btn-inline-ghost {
        padding: 12px 4px;
        min-height: 44px;
        align-items: center;
    }
}

@media (max-width: 600px) {
    .wrap {
        padding: 0 20px;
    }

    /* Slightly tighter side margin on very small phones */
    .landing-root section {
        word-wrap: break-word;
    }

    /* Center inline-block buttons in the column when they're stretched */
    .btn-main,
    .btn-vi {
        padding: 14px 24px;
        font-size: 12px;
    }

    .sec-eye {
        gap: 10px;
        margin-bottom: 14px;
    }

    /* Keep the page from cropping the title rendering on extremely
       narrow screens (e.g. 320px). */
    .landing-root h1,
    .landing-root h2 {
        word-break: break-word;
    }
}

@media (max-width: 380px) {
    .wrap {
        padding: 0 16px;
    }
}
