/*
    The cinematic look, shared with the Realnaps router site (virtual-games.realnaps.com):
    night pitch, kelly green and floodlight gold, display type in capitals, film grain,
    vignettes and scrims over stadium footage. Loaded last on every member-facing page
    (marketing, sign-in, dashboard, legal), so it restyles through the colour tokens the
    other stylesheets already use, plus the cinematic pieces below (hero, ticker, scenes).
*/

:root {
    --pitch: #07120b;
    --turf: #0f2a17;
    --turf-deep: #0a1d10;
    --floodlight: #f2f5ef;
    --kelly: #26a64b;
    --kelly-bright: #34c05d;
    --gold: #d9a521;
    --chalk: rgba(242, 245, 239, 0.16);
    --muted: rgba(242, 245, 239, 0.66);
    --dim: rgba(242, 245, 239, 0.4);
    --display: "Chakra Petch", "Arial Narrow", sans-serif;
    --body: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
    --mono: "Spline Sans Mono", ui-monospace, monospace;

    /* The tokens auth.css, site.css and dashboard.css are built on */
    --auth-page: var(--pitch);
    --auth-card: rgba(10, 29, 16, 0.86);
    --auth-field: rgba(15, 42, 23, 0.45);
    --auth-field-border: var(--chalk);
    --auth-text: var(--floodlight);
    --auth-muted: var(--muted);
    --auth-subtle: var(--dim);
    --auth-green: var(--kelly);
    --auth-green-hover: var(--kelly-bright);
    --auth-lime: var(--kelly-bright);
    --auth-pill: rgba(217, 165, 33, 0.12);
    --auth-success-bg: rgba(38, 166, 75, 0.14);
    --auth-success-text: #9fe0b2;
    --auth-radius-card: 4px;
    --auth-radius-field: 2px;
    --site-line: var(--chalk);
    --site-raised: rgba(15, 42, 23, 0.55);
    --site-alt: var(--turf-deep);
}

::selection {
    background: var(--kelly);
    color: var(--pitch);
}

.auth-body {
    background: var(--pitch);
    color: var(--floodlight);
    font-family: var(--body);
    text-rendering: optimizeLegibility;
}

/* Film grain over everything; never catches clicks */
.auth-body::before {
    position: fixed;
    z-index: 60;
    inset: -50%;
    width: 200%;
    height: 200%;
    pointer-events: none;
    opacity: 0.05;
    content: "";
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Type ---------- */

.auth-body h1,
.auth-body h2,
.auth-body h3,
.auth-title,
.dash-title {
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.auth-body h1 {
    line-height: 1.04;
}

.auth-body h3 {
    font-weight: 600;
    letter-spacing: 0.06em;
}

.site-eyebrow,
.auth-pill,
.cine-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border-radius: 0;
    background: none;
    color: var(--gold);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.32em;
    text-transform: uppercase;
}

.site-eyebrow::before,
.auth-pill::before,
.cine-kicker::before {
    display: inline-block;
    flex: none;
    width: 34px;
    height: 1px;
    margin-right: 14px;
    background: var(--gold);
    content: "";
}

.cine-gold {
    color: var(--gold);
}

.site-lead,
.site-muted,
.auth-subtitle {
    color: var(--muted);
}

/* ---------- Buttons ---------- */

.site-button,
.auth-button,
.dash-cta,
.wf-btn--primary {
    border: 1px solid var(--kelly);
    border-radius: 2px;
    background: var(--kelly);
    color: var(--pitch) !important;
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    transition: background 0.25s, border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.site-button:hover,
.auth-button:hover,
.dash-cta:hover {
    border-color: var(--kelly-bright);
    background: var(--kelly-bright);
    box-shadow: 0 0 28px rgba(38, 166, 75, 0.35);
}

.site-button--ghost,
.cine-button--chalk,
.dash-button--ghost {
    border: 1px solid var(--chalk);
    background: rgba(7, 18, 11, 0.35);
    color: var(--floodlight) !important;
}

.site-button--ghost:hover,
.cine-button--chalk:hover {
    border-color: var(--floodlight);
    background: rgba(242, 245, 239, 0.06);
    box-shadow: none;
}

.site-link-arrow {
    font-family: var(--display);
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ---------- Fields and cards ---------- */

.auth-input,
.auth-body select,
.auth-body textarea {
    border-radius: 2px;
}

.auth-input:focus,
.auth-body select:focus,
.auth-body textarea:focus {
    border-color: var(--kelly);
    box-shadow: 0 0 0 3px rgba(38, 166, 75, 0.15);
    outline: none;
}

.site-card,
.site-plan,
.site-model,
.site-feed__item,
.site-last-round,
.site-faq,
.dash-card,
.dash-panel,
.dash-plan,
.dash-stat {
    border: 1px solid var(--chalk);
    border-radius: 4px;
    background: linear-gradient(145deg, rgba(15, 42, 23, 0.62), rgba(7, 18, 11, 0.2));
}

.site-plan--featured,
.dash-plan--featured {
    border-color: var(--gold);
    box-shadow: 0 0 40px rgba(217, 165, 33, 0.12);
}

.site-plan__badge {
    border-radius: 2px;
    background: var(--gold);
    color: var(--pitch);
    font-family: var(--mono);
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.site-proof__grid strong,
.dash-stat__value,
.dash-rate__value,
.site-plan__price {
    color: var(--gold);
    font-family: var(--mono);
    font-weight: 500;
    text-shadow: 0 0 30px rgba(217, 165, 33, 0.35);
}

/* ---------- Header (glass once scrolled) ---------- */

.site-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 40;
    border-bottom: 1px solid transparent;
    background: linear-gradient(to bottom, rgba(7, 18, 11, 0.7), rgba(7, 18, 11, 0));
    transition: background 0.4s, border-color 0.4s;
}

.site-header.is-scrolled {
    border-bottom-color: var(--chalk);
    background: rgba(7, 18, 11, 0.88);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.site-body main {
    padding-top: 0;
}

.cine-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--floodlight) !important;
    text-decoration: none;
}

.cine-brand img {
    width: 38px;
    height: auto;
    filter: drop-shadow(0 0 12px rgba(38, 166, 75, 0.45));
}

.cine-brand span {
    display: flex;
    flex-direction: column;
    font-family: var(--display);
    font-size: 19px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.22em;
}

.cine-brand small {
    margin-top: 5px;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 0.3em;
}

.site-nav a {
    color: var(--muted) !important;
    font-family: var(--display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.site-nav a:hover,
.site-nav a.is-active {
    color: var(--floodlight) !important;
}

.site-nav .site-button {
    color: var(--pitch) !important;
}

/* ---------- Home hero: stadium footage ---------- */

.cine-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100vh;
    min-height: 100svh;
    overflow: hidden;
}

.cine-hero__media {
    position: absolute;
    z-index: 0;
    inset: 0;
    transform: scale(1.06);
    transform-origin: center;
    will-change: transform;
}

.cine-hero__media video,
.cine-hero__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cine-hero__vignette {
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 50% 42%, transparent 22%, rgba(7, 18, 11, 0.82) 88%),
        linear-gradient(to top, var(--pitch) 0%, rgba(7, 18, 11, 0.25) 34%, transparent 60%),
        linear-gradient(to bottom, rgba(7, 18, 11, 0.75) 0%, transparent 24%);
}

.cine-hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--site-max);
    margin: 0 auto;
    padding: 140px 24px 72px;
}

.cine-hero h1 {
    max-width: 15ch;
    margin: 22px 0 22px;
    font-size: clamp(2.5rem, 6.4vw, 5.4rem);
    letter-spacing: 0.015em;
}

.cine-hero .site-lead {
    max-width: 620px;
    font-size: 18px;
}

.cine-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-top: 30px;
}

.cine-hero .site-micro {
    margin-top: 18px;
    color: var(--dim);
}

/* The perimeter board: real fixtures and results, running past */
.cine-ticker {
    position: relative;
    z-index: 3;
    overflow: hidden;
    padding: 13px 0;
    border-top: 1px solid var(--chalk);
    border-bottom: 1px solid var(--chalk);
    background: rgba(7, 18, 11, 0.92);
    font-family: var(--mono);
    font-size: 13px;
    white-space: nowrap;
}

.cine-ticker__track {
    display: flex;
    width: max-content;
    animation: cine-ticker 60s linear infinite;
}

.cine-ticker:hover .cine-ticker__track {
    animation-play-state: paused;
}

.cine-ticker__set {
    display: flex;
    flex: none;
    gap: 28px;
    padding-right: 28px;
}

.cine-ticker__item {
    color: var(--muted);
}

.cine-ticker__item b {
    margin-left: 8px;
    color: var(--gold);
    font-weight: 500;
}

.cine-ticker__item em {
    margin-right: 8px;
    color: var(--kelly-bright);
    font-style: normal;
}

.cine-ticker__sep {
    color: var(--kelly);
}

@keyframes cine-ticker {
    to {
        transform: translateX(-50%);
    }
}

/* The live board sits in its own band under the hero */
.cine-board {
    position: relative;
    padding: 80px 0 40px;
}

.cine-board__grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 56px;
    align-items: center;
}

.cine-board__copy h2 {
    margin: 18px 0 16px;
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
}

.cine-board__copy p {
    color: var(--muted);
}

/* ---------- Backdrop bands (tunnel, floodlight, odds board) ---------- */

.cine-band {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.cine-band::before,
.cine-band::after {
    position: absolute;
    inset: 0;
    content: "";
    pointer-events: none;
}

.cine-band::before {
    z-index: -2;
    background: var(--band-image) center / cover no-repeat;
}

.cine-band::after {
    z-index: -1;
    background:
        linear-gradient(to right, rgba(7, 18, 11, 0.94) 0%, rgba(7, 18, 11, 0.74) 55%, rgba(7, 18, 11, 0.5) 100%),
        linear-gradient(to top, var(--pitch) 0%, transparent 22%),
        linear-gradient(to bottom, var(--pitch) 0%, transparent 22%);
}

.site-section.cine-band {
    padding: 140px 0;
}

.cine-band--tunnel {
    --band-image: url("/images/cinema/tunnel.jpg");
}

.cine-band--floodlight {
    --band-image: url("/images/cinema/floodlight.jpg");
}

.cine-band--board {
    --band-image: url("/images/cinema/oddsboard.jpg");
}

.cine-band--board::before {
    filter: hue-rotate(55deg) saturate(0.7);
}

.cine-band--board::after {
    background:
        linear-gradient(to top, var(--pitch) 0%, transparent 30%),
        linear-gradient(to bottom, var(--pitch) 0%, transparent 30%),
        linear-gradient(rgba(7, 18, 11, 0.86), rgba(7, 18, 11, 0.86));
}

.cine-band--stadium {
    --band-image: url("/images/cinema/hero-stadium.jpg");
}

/* Inner pages: a floodlit header band under the fixed nav */
.site-page-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding: 170px 0 80px;
    border-bottom: 1px solid var(--chalk);
    background: none;
}

.site-page-hero::before,
.site-page-hero::after {
    position: absolute;
    inset: 0;
    content: "";
    pointer-events: none;
}

.site-page-hero::before {
    z-index: -2;
    background: url("/images/cinema/floodlight.jpg") center 30% / cover no-repeat;
}

.site-page-hero::after {
    z-index: -1;
    background:
        radial-gradient(ellipse at 30% 30%, transparent 10%, rgba(7, 18, 11, 0.7) 80%),
        linear-gradient(to top, var(--pitch) 0%, rgba(7, 18, 11, 0.6) 50%, rgba(7, 18, 11, 0.75) 100%);
}

.site-page-hero h1 {
    font-size: clamp(2.2rem, 5vw, 4rem);
}

.site-proof {
    border-top: 1px solid var(--chalk);
    border-bottom: 1px solid var(--chalk);
    background: rgba(7, 18, 11, 0.6);
}

.site-section--alt {
    background: var(--turf-deep);
}

.site-final {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: none;
}

.site-final::before,
.site-final::after {
    position: absolute;
    inset: 0;
    content: "";
    pointer-events: none;
}

.site-final::before {
    z-index: -2;
    background: url("/images/cinema/hero-stadium.jpg") center / cover no-repeat;
}

.site-final::after {
    z-index: -1;
    background:
        linear-gradient(to bottom, var(--pitch) 0%, rgba(7, 18, 11, 0.72) 30%, rgba(7, 18, 11, 0.72) 70%, var(--pitch) 100%);
}

.site-footer {
    border-top: 1px solid var(--chalk);
    background: var(--pitch);
}

.site-footer nav h2 {
    color: var(--gold);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.3em;
}

.site-footer nav a {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.04em;
}

.cine-tagline {
    color: var(--dim);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

/* ---------- Sign-in and sign-up: a stadium scene beside the form ---------- */

.auth {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.auth-visual.cine-scene {
    position: sticky;
    display: block;
    padding: 0;
    background: var(--scene-image) center / cover no-repeat;
}

.cine-scene::after {
    position: absolute;
    inset: 0;
    content: "";
    background:
        linear-gradient(to right, rgba(7, 18, 11, 0.35) 0%, rgba(7, 18, 11, 0.2) 55%, var(--pitch) 100%),
        linear-gradient(to top, rgba(7, 18, 11, 0.85) 0%, transparent 45%),
        linear-gradient(to bottom, rgba(7, 18, 11, 0.6) 0%, transparent 25%);
}

.cine-scene .cine-brand {
    position: absolute;
    z-index: 2;
    top: 32px;
    left: 40px;
}

.cine-scene__caption {
    position: absolute;
    z-index: 2;
    bottom: 40px;
    left: 40px;
    margin: 0;
    color: var(--dim);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

.cine-scene__caption strong {
    color: var(--gold);
    font-weight: 500;
}

.auth-card {
    border: 1px solid var(--chalk);
    background: linear-gradient(160deg, rgba(15, 42, 23, 0.6), rgba(7, 18, 11, 0.2));
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.auth-logo {
    height: 52px;
    filter: drop-shadow(0 0 12px rgba(38, 166, 75, 0.45));
}

.auth-google {
    border-radius: 2px;
}

a.auth-google {
    color: inherit;
    text-decoration: none;
}

/* ---------- Dashboard ---------- */

.dash-sidebar {
    border-right: 1px solid var(--chalk);
    background: linear-gradient(to bottom, rgba(15, 42, 23, 0.5), rgba(7, 18, 11, 0.95)), var(--pitch);
}

.dash-brand img {
    filter: drop-shadow(0 0 12px rgba(38, 166, 75, 0.35));
}

.dash-nav__link {
    border-radius: 2px;
    font-family: var(--display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.dash-nav__link.is-active {
    box-shadow: inset 2px 0 0 var(--gold);
}

.dash-topbar {
    border-bottom: 1px solid var(--chalk);
    background: rgba(7, 18, 11, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.dash-main {
    position: relative;
    background:
        radial-gradient(ellipse at 70% -10%, rgba(38, 166, 75, 0.12), transparent 55%),
        var(--pitch);
}

.dash-hello {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid var(--chalk);
    border-radius: 4px;
}

.dash-hello::before,
.dash-hello::after {
    position: absolute;
    inset: 0;
    content: "";
    pointer-events: none;
}

.dash-hello::before {
    z-index: -2;
    background: url("/images/cinema/tunnel.jpg") center 40% / cover no-repeat;
}

.dash-hello::after {
    z-index: -1;
    background: linear-gradient(to right, rgba(7, 18, 11, 0.95) 0%, rgba(7, 18, 11, 0.78) 60%, rgba(7, 18, 11, 0.55) 100%);
}

.dash-badge,
.dash-pill,
.dash-chip {
    border-radius: 2px;
    font-family: var(--mono);
    letter-spacing: 0.08em;
}

/* ---------- Motion ---------- */

/* Hidden only once site.js is running, so nothing stays hidden without it */
.cine-js [data-reveal] {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.75s ease-out, transform 0.75s ease-out;
}

.cine-js [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
}

.cine-live::before {
    margin-right: 8px;
    color: var(--kelly-bright);
    content: "●";
    animation: cine-pulse 2.4s ease-in-out infinite;
}

@keyframes cine-pulse {
    50% {
        opacity: 0.3;
    }
}

/* ---------- Small screens ---------- */

@media (max-width: 1040px) {
    .cine-board__grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }
}

@media (max-width: 900px) {
    .auth {
        grid-template-columns: 1fr;
    }

    .auth-visual.cine-scene {
        position: relative;
        display: block;
        height: 32vh;
        min-height: 220px;
    }

    .cine-scene .cine-brand {
        top: 20px;
        left: 20px;
    }

    .cine-scene__caption {
        bottom: 20px;
        left: 20px;
    }
}

@media (max-width: 720px) {
    .cine-hero__content {
        padding: 120px 16px 48px;
    }

    .cine-hero__actions .site-button {
        width: 100%;
    }

    .cine-brand small {
        display: none;
    }

    .site-page-hero {
        padding: 130px 0 56px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    .cine-ticker__track {
        animation: none;
    }

    .cine-js [data-reveal] {
        opacity: 1;
        transform: none;
    }

    .cine-hero__media {
        transform: none !important;
    }
}
