/* File: shared/css/landing.css
 *
 * Landing page for the ECVALLA Ticket System.
 *
 * Purpose-built rather than a variation of the old systems gate: the platform is now a
 * single product, so the page has one job — say what this is and get the visitor either
 * signed in or into the ticket form.
 *
 * Structure: an ink canvas carrying the existing site video as desaturated texture, a
 * wordmark bar, a hero, three plain statements of how the flow works, and a quiet footer.
 * Type does the work — the identity's tight display tracking against wide-tracked
 * micro-labels — so the page stays calm at any width.
 *
 * Tokens come from ecvalla-identity.css, which is loaded before this file.
 */

.landing {
    /* One gutter value drives the bar, the hero and the footer, so the wordmark, the
     * headline and the footer all share a single left edge at every width. */
    --gutter: clamp(20px, 4.6vw, 84px);

    position: relative;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    background-color: #0e1012;
    color: #f2f2f0;
    overflow: hidden;
}

/* --- Backdrop ---------------------------------------------------------- */

.landing-backdrop {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.landing-backdrop video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Greyscaled and pushed down so it reads as texture, never as content. */
    filter: grayscale(1) contrast(1.08) brightness(.34);
}

/* A vignette keeps the centre calm enough for type to sit on it at any viewport size. */
.landing-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(14, 16, 18, .35) 0%, rgba(14, 16, 18, .88) 62%, #0e1012 100%),
        linear-gradient(180deg, rgba(14, 16, 18, .55) 0%, rgba(14, 16, 18, .82) 100%);
}

/* Everything except the backdrop — which must keep position: fixed, or it becomes a
 * block in the flow and pushes the whole page down by the video's intrinsic height. */
.landing>*:not(.landing-backdrop) {
    position: relative;
    z-index: 1;
}

/* --- Bar -------------------------------------------------------------- */

.landing-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: clamp(20px, 2.6vw, 38px) var(--gutter);
}

.landing-bar .brand-wordmark {
    width: clamp(132px, 12vw, 186px);
}

.landing-bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Hero ------------------------------------------------------------- */

.landing-hero {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr);
    align-items: center;
    gap: clamp(24px, 4vw, 64px);
    width: 100%;
    padding: clamp(16px, 3vh, 44px) var(--gutter) clamp(20px, 4vh, 48px);
}

.landing-hero-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.landing-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 clamp(20px, 3vh, 32px);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .28em;
    text-transform: uppercase;
    color: #9aa0a3;
}

/* The hairline before the label is the identity's quietest signature. */
.landing-eyebrow::before {
    content: "";
    width: clamp(28px, 5vw, 64px);
    height: 1px;
    background: linear-gradient(90deg, transparent, #6f7477);
}

.landing-hero h1 {
    margin: 0 0 clamp(18px, 2.6vh, 28px);
    font-size: clamp(38px, 6.1vw, 116px);
    line-height: .96;
    letter-spacing: -.055em;
    font-weight: 700;
    color: #ffffff;
    text-wrap: balance;
}

.landing-hero h1 em {
    display: block;
    font-style: normal;
    white-space: nowrap;
    background: linear-gradient(100deg, #6f7477 0%, #d9dcdd 28%, #8f9497 55%, #eef0f0 78%, #6f7477 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: landing-sheen 9s linear infinite;
}

@keyframes landing-sheen {
    to {
        background-position: -220% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .landing-hero h1 em {
        animation: none;
        color: #8f9497;
        background: none;
    }
}

.landing-lede {
    max-width: min(64ch, 100%);
    margin: 0 0 clamp(24px, 3.4vh, 38px);
    font-size: clamp(15px, 1.15vw, 18px);
    line-height: 1.68;
    color: #b8bcbe;
}

/* --- Actions ---------------------------------------------------------- */

/* The signed-in and signed-out action rows are toggled with the `hidden` attribute, and the
 * UA rule behind it is a bare `display: none` — which the `display: flex` below outranks.
 * Without this the page renders both rows at once. */
.landing [hidden] {
    display: none !important;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.landing-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    min-height: 56px;
    padding: 0 clamp(22px, 2.4vw, 34px);
    border-radius: 11px;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: transform 220ms var(--ecv-ease), background-color 220ms var(--ecv-ease),
        border-color 220ms var(--ecv-ease), box-shadow 220ms var(--ecv-ease), color 220ms var(--ecv-ease);
}

.landing-btn-primary {
    background-color: #ffffff;
    color: #17191b;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .42), 0 14px 38px -14px rgba(255, 255, 255, .22),
        inset 0 0 0 1px rgba(255, 255, 255, .06);
    transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease;
}

.landing-btn-primary:hover {
    background-color: #ececea;
    transform: translateY(-2px);
    box-shadow: 0 22px 52px rgba(0, 0, 0, .5);
}

.landing-btn-ghost {
    background-color: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .18);
    color: #ffffff;
}

.landing-btn-ghost:hover {
    background-color: rgba(255, 255, 255, .11);
    border-color: rgba(255, 255, 255, .34);
    transform: translateY(-2px);
}

.landing-icon-btn {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, .16);
    background-color: rgba(255, 255, 255, .05);
    color: #e9eae8;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 200ms var(--ecv-ease), border-color 200ms var(--ecv-ease);
}

.landing-icon-btn:hover {
    background-color: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .32);
    color: #ffffff;
}

.landing-icon-btn.is-text {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    height: 44px;
    padding: 0 18px 0 6px;
    gap: 11px;
    border-radius: var(--ecv-radius-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    backdrop-filter: blur(6px) saturate(1.2);
    -webkit-backdrop-filter: blur(6px) saturate(1.2);
}

/* The globe sits in its own disc, which is what makes the control read as considered
 * rather than as an icon dropped next to a word. */
.landing-icon-btn.is-text i {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, .10);
    font-size: 13px;
    transition: background-color 200ms var(--ecv-ease), transform 200ms var(--ecv-ease);
}

.landing-icon-btn.is-text:hover {
    border-color: rgba(255, 255, 255, .4);
    transform: translateY(-1px);
}

.landing-icon-btn.is-text:hover i {
    background-color: rgba(255, 255, 255, .2);
    transform: rotate(-18deg);
}

.landing-icon-btn.is-text span {
    padding-top: 1px;
}

/* --- How it works ----------------------------------------------------- */

/* Three statements of the actual flow. No claims, no numbers — the identity does not
 * decorate, and inventing metrics for a support tool would be dishonest. */
.landing-flow {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin: 0;
    border-top: 1px solid rgba(255, 255, 255, .12);
    background-color: rgba(255, 255, 255, .12);
}

.landing-flow article {
    padding: clamp(18px, 1.8vw, 26px) clamp(18px, 2vw, 32px);
    background-color: #0e1012;
}

.landing-flow article:first-child {
    padding-left: var(--gutter);
}

.landing-flow article:last-child {
    padding-right: var(--gutter);
}

.landing-flow b {
    display: block;
    margin-bottom: 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: #6f7477;
}

.landing-flow h2 {
    margin: 0 0 8px;
    font-size: clamp(16px, 1.5vw, 20px);
    font-weight: 700;
    letter-spacing: -.022em;
    color: #f2f2f0;
}

.landing-flow p {
    margin: 0;
    font-size: 13px;
    line-height: 1.62;
    color: #9aa0a3;
}

/* --- Footer ----------------------------------------------------------- */

.landing-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: clamp(16px, 2vw, 24px) var(--gutter);
    border-top: 1px solid rgba(255, 255, 255, .10);
    font-size: 11px;
    letter-spacing: .06em;
    color: #6f7477;
}

.landing-footer a {
    color: #9aa0a3;
    text-decoration: none;
}

.landing-footer a:hover {
    color: #ffffff;
}

/* --- Entrance --------------------------------------------------------- */

.landing-hero-copy>*,
.landing-scene {
    animation: landing-enter .85s var(--ecv-ease) both;
}

.landing-hero-copy>.landing-eyebrow {
    animation-delay: .05s;
}

.landing-hero-copy>h1 {
    animation-delay: .12s;
}

.landing-hero-copy>.landing-lede {
    animation-delay: .2s;
}

.landing-hero-copy>.landing-actions {
    animation-delay: .28s;
}

.landing-scene {
    animation-delay: .34s;
}

@keyframes landing-enter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* --- Arabic ----------------------------------------------------------- */

[dir="rtl"] .landing-eyebrow::before {
    background: linear-gradient(270deg, transparent, #6f7477);
}

[dir="rtl"] .landing-bar .brand-wordmark,
[dir="rtl"] .landing-flow b {
    /* The wordmark is Latin artwork; it keeps its own direction. */
    direction: ltr;
}

/* --- Narrow viewports ------------------------------------------------- */

@media (max-width: 860px) {
    .landing-flow {
        grid-template-columns: 1fr;
    }

    /* Stacked, each card is its own row, so all of them carry the gutter. */
    .landing-flow article,
    .landing-flow article:first-child,
    .landing-flow article:last-child {
        padding: 20px var(--gutter);
    }
}

@media (max-width: 560px) {
    .landing-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .landing-btn {
        width: 100%;
    }

    .landing-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .landing-hero-copy>*,
    .landing-scene {
        animation: none;
    }

    .scene-stage,
    .scene-ticket {
        animation: none !important;
    }

    .scene-pulses {
        display: none;
    }

    .landing-btn:hover,
    .landing-btn-primary:hover,
    .landing-btn-ghost:hover {
        transform: none;
    }
}

/* --- Routing diagram --------------------------------------------------- *
 *
 * The hero's right column: a ticket arriving and being routed onward to the departments
 * that exist in this system (MM, FICO, PS, GEN — the seeded four, not decoration).
 *
 * Depth comes from a CSS perspective transform on the stage plus an isometric drawing
 * inside it, so it reads as a three-dimensional object while remaining a single inline SVG
 * — no library, no external request, and crisp at any size.
 */

.landing-scene {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    perspective: 1400px;
}

.scene-stage {
    width: 100%;
    max-width: 620px;
    transform: rotateX(6deg) rotateZ(-1.5deg);
    transform-style: preserve-3d;
    animation: scene-float 13s ease-in-out infinite;
}

.scene-stage svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

/* A very slow drift keeps it alive without ever competing with the headline. */
@keyframes scene-float {

    0%,
    100% {
        transform: rotateX(6deg) rotateZ(-1.5deg) translateY(0);
    }

    50% {
        transform: rotateX(9deg) rotateZ(1deg) translateY(-10px);
    }
}

.scene-pads text {
    font-family: var(--ecv-font-latin);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2em;
    fill: #9aa0a3;
}

.scene-ticket-label {
    font-family: var(--ecv-font-latin);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .24em;
    text-transform: uppercase;
    fill: #ffffff;
}

/* The ticket sits above the floor and breathes slightly, which is what suggests it is the
 * object being moved rather than part of the grid. */
.scene-ticket {
    animation: scene-lift 6.5s ease-in-out infinite;
}

@keyframes scene-lift {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-7px);
    }
}

.scene-pulses circle {
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, .65));
}

.landing-note {
    margin: 18px 0 0;
    font-size: 12px;
    letter-spacing: .04em;
    color: #6f7477;
}

.landing-note b {
    color: #3f4447;
    font-weight: 700;
}

/* Sign out sits in the note line rather than the action row: it is an exit, not one of the
 * two things the page is offering. */
.landing-note-btn {
    margin-inline-start: 10px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid currentColor;
    background: none;
    font: inherit;
    letter-spacing: inherit;
    color: #6f7477;
    cursor: pointer;
}

.landing-note-btn:hover:not(:disabled) {
    color: #3f4447;
}

.landing-note-btn:disabled {
    cursor: default;
    opacity: .5;
}

.landing-footer-note {
    letter-spacing: .18em;
    text-transform: uppercase;
}

/* Below the two-column threshold the diagram sits under the copy, smaller, and the copy
 * keeps the full width. */
@media (max-width: 1040px) {
    .landing-hero {
        grid-template-columns: 1fr;
        gap: clamp(18px, 3vh, 32px);
    }

    .scene-stage {
        max-width: 460px;
        margin: 0 auto;
    }
}

@media (max-width: 620px) {
    .landing-scene {
        display: none;
    }
}

/* --- Hero rail --------------------------------------------------------- *
 * Two short factual groups under the call to action. They give the column weight so the
 * hero does not read as a headline floating in empty space, and every item is something the
 * system actually does.
 */

.landing-rail {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(22px, 3vw, 52px);
    margin-top: clamp(24px, 3.4vh, 40px);
    padding-top: clamp(20px, 2.6vh, 28px);
    border-top: 1px solid rgba(255, 255, 255, .10);
}

.landing-rail-group b {
    display: block;
    margin-bottom: 11px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: #6f7477;
}

.landing-rail-group ul {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.landing-rail-group li {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    color: #c8ccce;
    background-color: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: var(--ecv-radius-pill);
    transition: border-color 200ms var(--ecv-ease), background-color 200ms var(--ecv-ease);
}

.landing-rail-group li:hover {
    background-color: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .28);
    color: #ffffff;
}

@media (max-width: 560px) {
    .landing-rail {
        gap: 20px;
    }
}
