/* Public marketing pages - the site root ("/") and the platform tour ("/platform"). Linked from
   those two pages only, never from the application, because it is not CSS-isolation scoped.
   Tokens come from nix-design-system.css's :root block, because these pages are not wrapped in
   NixShell and therefore never receive NixTheme's inline overrides. Fallbacks match the current
   token values exactly so a failed variable is not a silent visual trap. */

.landing {
    display: block;
    background: linear-gradient(160deg, var(--nix-bg, #f6f8fc) 0%, var(--nix-surface-2, #f1f4f8) 100%);
    color: var(--nix-text, #14213d);
    font-family: var(--nix-font-display, 'Open Sans', 'Segoe UI', Roboto, Arial, sans-serif);
    min-height: 100vh;
}

/* Decorative clipping lives here, on the hero block only - not on the whole page - so the content
   below it stays in normal flow and is never clipped when the visitor scrolls. */
.landing__hero {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 1.5rem;
    text-align: center;
}

/* CSS-only ambient background: three blurred colour fields drifting on independent loops. No
   canvas, no dependency, no request - the page stays one server render. */
.landing__aurora {
    position: absolute;
    inset: -20%;
    pointer-events: none;
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.landing__blob {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(72px);
    opacity: 0.55;
    animation: landing-drift 28s ease-in-out infinite;
    will-change: transform;
}

.landing__blob--one {
    width: 44vmax;
    height: 44vmax;
    top: -10%;
    left: -8%;
    background: radial-gradient(circle at 35% 35%, rgba(79, 70, 229, 0.55), rgba(79, 70, 229, 0) 68%);
}

.landing__blob--two {
    width: 36vmax;
    height: 36vmax;
    right: -6%;
    bottom: -14%;
    background: radial-gradient(circle at 60% 40%, rgba(14, 165, 233, 0.42), rgba(14, 165, 233, 0) 70%);
    animation-duration: 34s;
    animation-delay: -11s;
}

.landing__blob--three {
    width: 28vmax;
    height: 28vmax;
    top: 42%;
    left: 52%;
    background: radial-gradient(circle at 50% 50%, rgba(217, 70, 239, 0.3), rgba(217, 70, 239, 0) 70%);
    animation-duration: 40s;
    animation-delay: -19s;
}

@keyframes landing-drift {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    33% {
        transform: translate3d(6%, -5%, 0) scale(1.08);
    }
    66% {
        transform: translate3d(-5%, 6%, 0) scale(0.95);
    }
}

.landing__inner {
    position: relative;
    z-index: 1;
    max-width: 46rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    transition: opacity 0.38s ease, transform 0.38s cubic-bezier(0.4, 0, 1, 1), filter 0.38s ease;
}

.landing__logo {
    height: 3rem;
    width: auto;
    object-fit: contain;
}

/* The headline is enclosed by a line that travels around it. A conic gradient on a masked ring is
   the implementation that fits this page: the interior stays fully transparent so the aurora behind
   it is not covered, the box shrinks to whatever width the sentence takes - including when it wraps
   on a phone - and it needs no SVG, no JavaScript and no extra asset. The gradient turns by having
   an animated custom property re-angle it; a browser without @property support shows the ring
   unanimated rather than not at all. */
@property --nix-landing-spin {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

.landing__title {
    position: relative;
    width: fit-content;
    margin: 0;
    padding: 0.9rem 1.5rem;
    font-size: clamp(2rem, 4.6vw, 3.1rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--nix-text, #14213d);
}

/* Routes.razor focuses the h1 on navigation, and that box now draws its own line - the browser
   default must not add a second one. The headline is not a control and is never tab-reachable. */
.landing__title:focus {
    outline: none;
}

.landing__title::before {
    content: "";
    position: absolute;
    inset: 0;
    padding: 1.5px;
    border-radius: var(--nix-radius-lg, 0.75rem);
    background:
        conic-gradient(from var(--nix-landing-spin),
            #2e3a7f 0deg,
            #1c75bc 60deg,
            #4894d0 120deg,
            rgba(72, 148, 208, 0) 180deg,
            rgba(72, 148, 208, 0) 360deg),
        rgba(46, 58, 127, 0.12);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    filter: drop-shadow(0 0 6px rgba(72, 148, 208, 0.35));
    animation: landing-ring 7s linear infinite;
    pointer-events: none;
}

@keyframes landing-ring {
    to {
        --nix-landing-spin: 360deg;
    }
}

.landing__subtitle {
    margin: 0;
    max-width: 38rem;
    font-size: clamp(0.98rem, 1.4vw, 1.12rem);
    line-height: 1.6;
    color: var(--nix-muted, #64748b);
}

.landing__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin-top: 0.4rem;
}

.landing__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.85rem 1.6rem;
    border-radius: var(--nix-radius-lg, 0.75rem);
    background: var(--nix-primary, #4f46e5);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: var(--nix-shadow-lg, 0 4px 12px rgba(15, 23, 42, 0.12));
    transition: transform var(--nix-transition-base, 0.2s ease), background var(--nix-transition-base, 0.2s ease);
}

.landing__cta:hover,
.landing__cta:focus-visible {
    background: #4338ca;
    transform: translateY(-1px);
}

.landing__cta:focus-visible {
    outline: 2px solid var(--nix-text, #14213d);
    outline-offset: 3px;
}

.landing__cta-arrow {
    display: inline-block;
    transition: transform 0.38s ease;
    animation: landing-nudge 2.4s ease-in-out infinite;
}

@keyframes landing-nudge {
    0%,
    70%,
    100% {
        transform: translateX(0);
    }
    35% {
        transform: translateX(4px);
    }
}

.landing__secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.8rem 1.35rem;
    border: 1px solid var(--nix-border, #dfe5f2);
    border-radius: var(--nix-radius-lg, 0.75rem);
    background: var(--nix-surface, #ffffff);
    color: var(--nix-text, #14213d);
    font-size: 0.98rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform var(--nix-transition-base, 0.2s ease), border-color var(--nix-transition-base, 0.2s ease);
}

.landing__secondary:hover,
.landing__secondary:focus-visible {
    border-color: var(--nix-primary, #4f46e5);
    transform: translateY(-1px);
}

.landing__secondary:focus-visible {
    outline: 2px solid var(--nix-text, #14213d);
    outline-offset: 3px;
}

/* Everything below the hero is normal flow. */
.landing__body {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    max-width: 72rem;
    margin: 0 auto;
    padding: 4.5rem 1.5rem 5.5rem;
}

.landing__section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    text-align: center;
}

.landing__section-title {
    margin: 0;
    max-width: 44rem;
    font-size: clamp(1.4rem, 2.6vw, 1.9rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--nix-text, #14213d);
}

.landing__section-intro {
    margin: 0;
    max-width: 40rem;
    font-size: clamp(0.98rem, 1.3vw, 1.08rem);
    line-height: 1.6;
    color: var(--nix-muted, #64748b);
}

.landing__section-copy {
    margin: 0;
    max-width: 48rem;
    font-size: clamp(0.98rem, 1.3vw, 1.08rem);
    line-height: 1.7;
    color: var(--nix-muted, #64748b);
}

.landing__bottom-cta {
    display: flex;
    justify-content: center;
}

/* The connected-platform visual: one core node with the four business areas around it, joined by a
   thin rail so they read as one platform rather than an unattached catalogue of cards. Pure CSS, no
   SVG or script, and a single-column stack on narrow screens with no horizontal scrolling. */
.platform-map {
    /* The connector geometry all derives from these, so the core line reaches the rail and each
       card tick reaches back up to it at every width. --pm-gap is the space between the core and
       the areas block; --pm-rail is the space between the rail and the first row of cards;
       --pm-col-gap is the grid gap, which the rail endpoints account for. --pm-flow is the light
       that glides along the connectors and --pm-flow-speed how long one pass takes. */
    --pm-gap: 1.5rem;
    --pm-rail: 1.4rem;
    --pm-col-gap: 1rem;
    --pm-flow: #1c75bc;
    --pm-flow-speed: 3.2s;
    width: 100%;
    margin-top: 1.4rem;
}

.platform-map__core {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    width: fit-content;
    margin: 0 auto;
    padding: 0.85rem 1.3rem;
    border: 1px solid var(--nix-border, #dfe5f2);
    border-radius: var(--nix-radius-lg, 0.75rem);
    background: var(--nix-surface, #ffffff);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--nix-text, #14213d);
}

.platform-map__core img {
    height: 1.9rem;
    width: auto;
}

/* The core's own connector: it drops the full gap to the areas block (the rail on desktop, the
   first card on mobile), so the areas read as joined to the core rather than floating below it.
   A single packet of light glides down it - and down each card tick - so the four areas read as
   fed from the one core. Only the connector animates; the cards never move. */
.platform-map__core::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(-1 * var(--pm-gap));
    width: 1px;
    height: var(--pm-gap);
    background-color: var(--nix-border, #dfe5f2);
    background-image: linear-gradient(to bottom,
        transparent 44%,
        var(--pm-flow, #1c75bc) 50%,
        transparent 56%);
    background-repeat: no-repeat;
    background-size: 100% 200%;
    animation: platform-flow var(--pm-flow-speed, 3.2s) linear infinite;
}

.platform-map__areas {
    position: relative;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: var(--pm-col-gap);
    margin: var(--pm-gap) 0 0;
    padding: 0;
    list-style: none;
}

.platform-map__area {
    min-width: 0;
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--nix-border, #dfe5f2);
    border-radius: var(--nix-radius-md, 0.5625rem);
    background: var(--nix-surface, #ffffff);
    text-align: left;
}

.platform-map__area-title {
    margin: 0 0 0.55rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--nix-text, #14213d);
}

.platform-map__items {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.platform-map__items li {
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--nix-muted, #64748b);
}

/* On wider screens the four areas sit in one row under a horizontal rail: the core's connector
   lands on the rail (both are separated from the areas content box by the same --pm-gap), and a
   short tick reaches from each card's top back up to that rail. The rail's endpoints are aligned
   to the first and last card centres with the grid gaps accounted for: a card centre sits
   (100% - 3 gaps) / 8 in from the edge of a four-column grid. */
@media (min-width: 60rem) {
    .platform-map__areas {
        grid-template-columns: repeat(4, 1fr);
        padding-top: var(--pm-rail);
    }

    .platform-map__areas::before {
        content: "";
        position: absolute;
        top: 0;
        left: calc((100% - 3 * var(--pm-col-gap)) / 8);
        right: calc((100% - 3 * var(--pm-col-gap)) / 8);
        height: 1px;
        background-color: var(--nix-border, #dfe5f2);
        background-image: linear-gradient(to right,
            transparent 44%,
            var(--pm-flow, #1c75bc) 50%,
            transparent 56%);
        background-repeat: no-repeat;
        background-size: 200% 100%;
        animation: platform-flow-x var(--pm-flow-speed, 3.2s) linear infinite;
    }

    .platform-map__area {
        position: relative;
    }

    .platform-map__area::before {
        content: "";
        position: absolute;
        top: calc(-1 * var(--pm-rail));
        left: 50%;
        width: 1px;
        height: var(--pm-rail);
        background-color: var(--nix-border, #dfe5f2);
        background-image: linear-gradient(to bottom,
            transparent 44%,
            var(--pm-flow, #1c75bc) 50%,
            transparent 56%);
        background-repeat: no-repeat;
        background-size: 100% 200%;
        animation: platform-flow var(--pm-flow-speed, 3.2s) linear infinite;
    }
}

/* One packet of light travelling the length of a connector, then a brief pause before it repeats.
   The gradient band is 200% of the 1px segment, so at both ends of the sweep it sits entirely off
   the segment - which is what makes the pulse discrete rather than a constant stream. The vertical
   connectors travel top-to-bottom (--flow) and the horizontal rail left-to-right (--flow-x); same
   speed, so the whole network reads as one motion. */
@keyframes platform-flow {
    from {
        background-position: 0 115%;
    }
    to {
        background-position: 0 -15%;
    }
}

@keyframes platform-flow-x {
    from {
        background-position: 115% 0;
    }
    to {
        background-position: -15% 0;
    }
}

/* ---- The platform tour page ---- */

.marketing-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.1rem 1.5rem;
}

.marketing-header__brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--nix-text, #14213d);
    font-weight: 800;
    letter-spacing: 0.02em;
}

.marketing-header__brand img {
    height: 1.8rem;
    width: auto;
}

.marketing-header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.marketing-header .landing__cta,
.marketing-header .landing__secondary {
    padding: 0.55rem 1.05rem;
    font-size: 0.92rem;
}

.platform-hero {
    max-width: 52rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
}

.platform-hero__title {
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--nix-text, #14213d);
}

.platform-hero__lede {
    margin: 0;
    max-width: 44rem;
    font-size: clamp(1rem, 1.4vw, 1.14rem);
    line-height: 1.65;
    color: var(--nix-muted, #64748b);
}

/* Definition-style blocks for a module's capabilities. */
.platform-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 1rem;
    width: 100%;
    margin-top: 1.4rem;
}

.platform-card {
    min-width: 0;
    padding: 1.25rem 1.35rem;
    border: 1px solid var(--nix-border, #dfe5f2);
    border-radius: var(--nix-radius-md, 0.5625rem);
    background: var(--nix-surface, #ffffff);
    text-align: left;
}

.platform-card__title {
    margin: 0 0 0.5rem;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--nix-text, #14213d);
}

.platform-card__copy {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--nix-muted, #64748b);
}

.workflow-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    width: 100%;
    max-width: 46rem;
    margin: 1.4rem auto 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.workflow-list li {
    position: relative;
    padding: 0.85rem 1rem 0.85rem 2.6rem;
    border: 1px solid var(--nix-border, #dfe5f2);
    border-radius: var(--nix-radius-md, 0.5625rem);
    background: var(--nix-surface, #ffffff);
    font-size: 0.94rem;
    line-height: 1.55;
    color: var(--nix-text, #14213d);
}

.workflow-list li::before {
    content: "\2192";
    position: absolute;
    left: 1rem;
    top: 0.85rem;
    color: var(--nix-primary, #4f46e5);
    font-weight: 700;
}

/* The leaving transition: the visitor gets a beat of feedback that the CTA activated, then the
   navigation starts. Only the hero block is affected, and only the CTA that was activated triggers
   it. The script waits for the inner block's transitionend (bounded, in case it never fires), so
   this duration is what the continue delay actually costs. */
.landing__hero.landing--leaving {
    cursor: progress;
}

.landing--leaving .landing__inner {
    opacity: 0;
    transform: translateY(-12px) scale(0.97);
    filter: blur(8px);
}

.landing--leaving .landing__aurora {
    opacity: 0;
    transform: scale(1.35);
}

.landing--leaving .landing__cta-arrow {
    animation: none;
    transform: translateX(14px);
}

@media (prefers-reduced-motion: reduce) {
    .landing__blob,
    .landing__cta-arrow,
    .landing__title::before,
    .platform-map__core::after,
    .platform-map__areas::before,
    .platform-map__area::before {
        animation: none;
    }

    /* The script also skips the delay entirely here - a transition that cannot play must not become
       a wait for transitionend. */
    .landing__inner,
    .landing__aurora,
    .landing__cta-arrow {
        transition: none;
    }
}

@media (max-width: 37.5rem) {
    .landing__hero {
        padding: 2.5rem 1.1rem;
    }

    .landing__logo {
        height: 2.4rem;
    }

    .landing__body {
        gap: 3rem;
        padding: 3.25rem 1.1rem 4rem;
    }

    .landing__actions {
        flex-direction: column;
        width: 100%;
    }

    .landing__cta,
    .landing__secondary {
        width: 100%;
        justify-content: center;
    }

    .marketing-header {
        flex-direction: column;
        align-items: stretch;
    }

    .marketing-header__actions {
        justify-content: center;
    }
}
