/**
 * Surreal's public pages (the landing page and the login system): one
 * palette, base, nav, buttons and motion rules so they never drift apart.
 * The portal's own palette (scss/core/_variables.scss, dark theme): flat
 * navy surfaces, the deeper surface for "pop", no washes or starfields.
 * Page-specific styles: landing-page.css, auth.css.
 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: rgb(8 18 42);
    --bg-deep: rgb(6 14 32);
    --bg-card: rgb(13 25 54);
    --bg-card-hover: rgb(17 31 64);
    --bg-tertiary: rgb(16 31 62);
    --text: #e8edf4;
    --text-2: #8b99b0;
    --text-3: #6f7c92;
    --border: rgb(122 143 184 / 22%);
    --border-strong: rgb(142 163 204 / 34%);
    --primary: #3d8ef8;
    --primary-hover: #5a9ff9;
    --socialite: #f472b6;
    --osrs-brass: #b08a4a;
    --dragonwilds: #f07a2c;
    --radius: 8px;
    --radius-lg: 12px;
    --gutter: 40px;
    --max: 1120px;
}

html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    font-family: Rubik, -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

a {
    color: inherit;
}

/* Tapping a control twice quickly (Play the month, race tabs, the
   slider) is two taps, not iOS's double-tap zoom. Pinch zoom still works. */
a,
button,
input,
label,
select,
textarea,
[role="button"] {
    touch-action: manipulation;
}

.wrap {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* ===== Nav ===== */
.lp-nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.lp-nav--scrolled {
    border-bottom-color: var(--border);
}

.lp-nav__inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 68px;
}

.lp-nav__logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* The Surreal S, as big as in the app's nav (css/surreal-mark.css); it
   lifts off the page on hover, as there */
.lp-nav__logo .surreal-mark {
    width: 40px;
    height: 46px;
}

.lp-nav__logo:hover .surreal-mark {
    --s-stretch: 1.5;
}

.lp-nav__logo:hover .surreal-mark__lift {
    transform: translate(-0.6px, -0.9px);
}

@media (prefers-reduced-motion: reduce) {
    .lp-nav__logo:hover .surreal-mark {
        --s-stretch: 1;
    }

    .lp-nav__logo:hover .surreal-mark__lift {
        transform: none;
    }
}

.lp-nav__links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.lp-nav__link {
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-2);
    transition: color 0.15s ease;
}

.lp-nav__link:hover {
    color: var(--text);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius);
    transition: background 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.btn--sm {
    padding: 9px 18px;
    font-size: 14px;
}

.btn--primary {
    color: #ffffff;
    background: var(--primary);
}

.btn--primary:hover {
    background: var(--primary-hover);
}

.btn--secondary {
    color: var(--text);
    background: var(--bg-card);
    border-color: var(--border);
}

.btn--secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
}

/* ===== Sections ===== */
.lp-section {
    padding: 112px 0;
}

.lp-section--deep {
    background: var(--bg-deep);
}

.lp-kicker {
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-2);
}

.lp-h2 {
    margin-bottom: 16px;
    font-size: clamp(30px, 4.4vw, 44px);
    font-weight: 700;
    line-height: 1.15;
}

.lp-lead {
    max-width: 560px;
    font-size: 18px;
    color: var(--text-2);
}

/* ===== Motion ===== */
@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

/* ===== Footer ===== */
.lp-footer {
    padding: 36px 0;
    font-size: 14px;
    color: var(--text-2);
    border-top: 1px solid var(--border);
}

.lp-footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
}

.lp-footer__links {
    display: flex;
    gap: 24px;
}

.lp-footer__legal {
    flex-basis: 100%;
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-3);
}

.legal a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.lp-footer a {
    text-decoration: none;
}

.lp-footer a:hover {
    color: var(--text);
}

/* ===== Privacy policy ===== */
.legal {
    max-width: 720px;
    padding-top: 48px;
    padding-bottom: 72px;
    font-size: 16px;
    color: var(--text-2);
}

.legal h1 {
    margin: 12px 0 4px;
    font-size: 36px;
    font-weight: 800;
    color: var(--text);
}

.legal h2 {
    margin: 32px 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.legal p {
    margin: 0 0 12px;
}

.legal ul {
    margin: 0 0 12px;
    padding-left: 20px;
}

.legal li {
    margin-bottom: 8px;
}

.legal strong {
    color: var(--text);
}

.legal__back,
.legal__date {
    font-size: 14px;
    color: var(--text-3);
}

/* ===== Phone ===== */
@media (width <= 900px) {
    :root {
        --gutter: 16px;
    }

    .lp-section {
        padding: 72px 0;
    }

    .lp-nav__links {
        gap: 16px;
    }

    .lp-nav__link--wide {
        display: none;
    }
}

/* Reduced motion: the script shows every scene finished; nothing moves.
   Anchored to the page's id so it outranks every scene's own transitions. */
#lp.reduced *,
#lp.reduced *::before,
#lp.reduced *::after {
    transition: none;
    animation: none;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* The cast's faces: cut out badly and glued on, on purpose */
.face {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    transform: rotate(-6deg);
    filter: drop-shadow(1px 0 0 #ffffff) drop-shadow(-1px 0 0 #ffffff) drop-shadow(0 1px 0 #ffffff) drop-shadow(0 -1px 0 #ffffff);
    object-fit: contain;
}

.race__row:nth-child(even) .face {
    transform: rotate(5deg);
}

.face--lg {
    width: 34px;
    height: 34px;
    margin-right: 8px;
    vertical-align: middle;
}

.face--tilt {
    margin-right: 0;
    margin-left: 8px;
    transform: rotate(9deg);
}
