/* ============================================================================
   F4 · Bespoke "digital noosphere" landing (landing#6) — layout & motion.
   Global (non-scoped) so descendant selectors can reach MudBlazor-rendered DOM
   without ::deep. COLOUR comes exclusively from the unified MudBlazor palette
   custom properties (--mud-palette-*) published by the single MudThemeProvider —
   this file introduces NO new colour tokens and NO second palette. It carries
   layout, type-scale, and motion only.
   ============================================================================ */

html {
    scroll-behavior: smooth;
}

.aibek-landing {
    overflow-x: hidden;
}

/* ── Constellation backdrop (shared motion system, S8) ───────────────────── */
.landing-constellation {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Content sitting over a constellation must be positioned to paint above the z-index:0 canvas. */
.landing-onsky {
    position: relative;
    z-index: 1;
}

/* ── Section rhythm ──────────────────────────────────────────────────────── */
.landing-section {
    position: relative;
    padding: 120px 0;
}

.landing-section--surface {
    background-color: var(--mud-palette-surface);
}

/* ── Overline + display typography ───────────────────────────────────────── */
.landing-overline {
    letter-spacing: 0.18em;
    font-weight: 600;
}

.landing-display {
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    /* Act & Trust headline scale — fluidly tracks the viewport so headings never overflow on a phone
       nor look undersized on a wide display. The hero defines its own larger scale below and wins on
       specificity. Desktop baseline (3rem) equals MudBlazor's Typo.h3, so desktop is unchanged. */
    font-size: clamp(1.9rem, 4.5vw, 3rem);
}

.landing-body {
    max-width: 620px;
    color: var(--mud-palette-text-secondary);
    font-size: 1.08rem;
    line-height: 1.7;
}

.text-center .landing-body {
    margin-left: auto;
    margin-right: auto;
}

.landing-hero .landing-display {
    font-size: clamp(2.4rem, 6vw, 4.4rem);
    line-height: 1.05;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.landing-hero {
    min-height: 82vh;
    display: flex;
    align-items: center;
    padding-top: 110px;
    padding-bottom: 130px;
}

.landing-hero__content {
    position: relative;
    z-index: 1;
}

.landing-hero__sub {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    color: var(--mud-palette-text-secondary);
    font-weight: 400;
}

/* ── Act II · deterministic pipeline ─────────────────────────────────────── */
.landing-pipeline {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.landing-step {
    position: relative;
    background-color: var(--mud-palette-background);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 14px;
    padding: 22px;
}

.landing-step__n {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    margin-bottom: 12px;
    font-weight: 800;
    background-color: rgba(var(--mud-palette-primary-rgb), 0.14);
    color: var(--mud-palette-primary);
}

.landing-step__title {
    font-weight: 700;
}

.landing-step__desc {
    color: var(--mud-palette-text-secondary);
}

/* The deterministic half — accent-marked so the "creativity → compilation" split reads visually. */
.landing-step--det {
    border-color: var(--mud-palette-primary);
    box-shadow: inset 0 0 0 1px rgba(var(--mud-palette-primary-rgb), 0.14);
}

.landing-step--det .landing-step__n {
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
}

/* Tablet & below (below the Md band, <960px): the four-step pipeline folds to a 2×2 grid. */
@media (max-width: 959.98px) {
    .landing-pipeline {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile (below the Sm band, <600px): a single vertical column of steps. */
@media (max-width: 599.98px) {
    .landing-pipeline {
        grid-template-columns: 1fr;
    }
}

/* ── Act III noosphere shell ─────────────────────────────────────────────── */
.landing-noosphere {
    overflow: hidden;
}

.landing-tagline {
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    color: var(--mud-palette-text-secondary);
    font-style: italic;
}

/* ── Trust · honest-signal cards ─────────────────────────────────────────── */
.landing-trust-card {
    height: 100%;
    background-color: var(--mud-palette-background);
    border-radius: 16px;
}

/* ── Conversation panel — the page's interactive climax ──────────────────── */
.landing-chat__stage {
    position: relative;
}

/* The noosphere, quietly present behind the panel: a restrained, reduced-motion-safe accent glow
   (static gradient — no canvas, no animation) so the visitor feels they are stepping into it. */
.landing-chat__glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(1000px, 96%);
    height: 80%;
    transform: translate(-50%, -50%);
    background: radial-gradient(ellipse at center,
        rgba(var(--mud-palette-primary-rgb), 0.12) 0%,
        rgba(var(--mud-palette-primary-rgb), 0) 70%);
    pointer-events: none;
    z-index: 0;
}

.landing-chat__panel {
    width: 100%;
    max-width: 900px;
    height: 70vh;
    overflow: hidden;
    position: relative;
    z-index: 1;
    box-shadow: 0 20px 60px rgba(var(--mud-palette-primary-rgb), 0.14);
}

/* ── Scroll-reveal (shared motion system, S8) ────────────────────────────── */
/* Hidden state is gated behind .landing-js (added by App.razor only when JS runs), so a no-JS or
   pre-hydration render never leaves content invisible — progressive enhancement, not a hard dependency. */
.landing-js .landing-reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.landing-js .landing-reveal.landing-reveal--in {
    opacity: 1;
    transform: none;
}

/* ── Responsive · canonical DeviceKind bands ─────────────────────────────────
   Thresholds mirror the shared AibekBreakpoints scale (Sm 600 · Md 960 · Xxl 2560) and its
   DeviceKind semantics: Mobile <600 · Tablet 600–959 · Desktop 960–2559 · Wide ≥2560. The bespoke
   look is preserved at every size — sections adapt their vertical rhythm, headline scale, and the
   hero / chat framing rather than degrading to plain stacks. Desktop is the authored baseline above;
   these blocks tune the smaller and larger ends. Constellation intensity is tiered separately in
   aibek-landing.js against the same bands. */

/* Tablet & below (below the Md band, <960px): tighten the vertical rhythm a step. */
@media (max-width: 959.98px) {
    .landing-section {
        padding: 96px 0;
    }
}

/* Mobile (below the Sm band, <600px): compact rhythm, a calmer hero, roomier chat climax. */
@media (max-width: 599.98px) {
    .landing-section {
        padding: 64px 0;
    }

    .landing-hero {
        min-height: 78vh;
        padding-top: 88px;
        padding-bottom: 96px;
    }

    .landing-body {
        font-size: 1rem;
    }

    /* The conversation climax takes more of the short viewport so the chat stays usable one-handed. */
    .landing-chat__panel {
        height: 78vh;
    }
}

/* Wide (Xxl band, ≥2560px): open the rhythm and lift the body type on large canvases. The centred
   MudContainer max-widths intentionally hold the measure for readability. */
@media (min-width: 2560px) {
    .landing-section {
        padding: 160px 0;
    }

    .landing-body {
        font-size: 1.2rem;
        max-width: 720px;
    }
}

/* Accessibility: honour reduced-motion — no smooth scroll, no reveal transition. */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .landing-js .landing-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
