/* SportX simple homepage — dark default + light */

:root,
html[data-theme="dark"] {
    --bg: #0f1216;
    --bg-elevated: #171b21;
    --ink: #f2f3f5;
    --ink-soft: #a0a7b3;
    --line: rgba(242, 243, 245, 0.1);
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-soft: rgba(45, 212, 191, 0.12);
    --game: #38bdf8;
    --game-strong: #7dd3fc;
    --game-soft: rgba(56, 189, 248, 0.14);
    --tour: #f0abfc;
    --tour-strong: #f5d0fe;
    --tour-soft: rgba(240, 171, 252, 0.14);
    --events: #fbbf24;
    --events-strong: #fcd34d;
    --events-soft: rgba(251, 191, 36, 0.14);
    --shop: #34d399;
    --shop-strong: #6ee7b7;
    --shop-soft: rgba(52, 211, 153, 0.14);
    --btn-primary-bg: #f2f3f5;
    --btn-primary-ink: #0f1216;
    --btn-primary-hover: #ffffff;
    --header-bg: rgba(15, 18, 22, 0.88);
    --footer-bg: rgba(10, 12, 16, 0.6);
    --nav-hover-bg: rgba(242, 243, 245, 0.06);
    --step-bg: rgba(242, 243, 245, 0.04);
    --dot-idle: rgba(242, 243, 245, 0.22);
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    --shadow-device: 0 24px 60px rgba(0, 0, 0, 0.45);
    --device-shell: #050608;
    --radius: 18px;
    --radius-sm: 12px;
    --max: 1080px;
    --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --header-h: 64px;
    color-scheme: dark;
}

html[data-theme="light"] {
    --bg: #f6f5f2;
    --bg-elevated: #ffffff;
    --ink: #14171c;
    --ink-soft: #5a616c;
    --line: rgba(20, 23, 28, 0.08);
    --accent: #0d9488;
    --accent-strong: #0f766e;
    --accent-soft: rgba(13, 148, 136, 0.12);
    --game: #0284c7;
    --game-strong: #0369a1;
    --game-soft: rgba(2, 132, 199, 0.12);
    --tour: #a21caf;
    --tour-strong: #86198f;
    --tour-soft: rgba(162, 28, 175, 0.1);
    --events: #d97706;
    --events-strong: #b45309;
    --events-soft: rgba(217, 119, 6, 0.12);
    --shop: #059669;
    --shop-strong: #047857;
    --shop-soft: rgba(5, 150, 105, 0.12);
    --btn-primary-bg: #14171c;
    --btn-primary-ink: #ffffff;
    --btn-primary-hover: #000000;
    --header-bg: rgba(246, 245, 242, 0.88);
    --footer-bg: rgba(255, 255, 255, 0.4);
    --nav-hover-bg: rgba(20, 23, 28, 0.05);
    --step-bg: rgba(20, 23, 28, 0.03);
    --dot-idle: rgba(20, 23, 28, 0.18);
    --shadow: 0 12px 40px rgba(15, 20, 25, 0.08);
    --shadow-device: 0 24px 60px rgba(15, 20, 25, 0.18);
    --device-shell: #111418;
    color-scheme: light;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
    font-family: var(--font);
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color 0.25s ease, color 0.25s ease;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: var(--ink);
    color: #fff;
    padding: 0.6rem 1rem;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    background: var(--header-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}

.header-inner {
    max-width: var(--max);
    height: 100%;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    flex-shrink: 0;
}

.brand .logo,
.site-footer .logo {
    height: 36px;
    width: auto;
}

.site-footer .logo {
    height: 30px;
}

/* Default dark: white wordmark. Light theme: dark wordmark. */
.logo-for-light {
    display: none;
}

.logo-for-dark {
    display: block;
}

html[data-theme="light"] .logo-for-light {
    display: block;
}

html[data-theme="light"] .logo-for-dark {
    display: none;
}

/* Compact colored text next to logo — lighter than hero pills */
.brand-tagline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem 0.45rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    margin: 0;
    padding-left: 0.85rem;
    border-left: 1px solid var(--line);
}

.brand-tagline .bt-play {
    color: var(--game-strong);
}

.brand-tagline .bt-events {
    color: var(--events-strong);
}

.brand-tagline .bt-shop {
    color: var(--shop-strong);
}

.brand-tagline .bt-sep {
    color: var(--ink-soft);
    opacity: 0.45;
    font-weight: 500;
    user-select: none;
}

/* Shared text-link style (header tagline + contact) */
.bt {
    white-space: nowrap;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.2;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.bt:hover,
.bt:focus-visible {
    opacity: 0.85;
    outline: none;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bt-why {
    color: var(--events-strong);
}

.bt-contact {
    color: var(--tour-strong);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Theme toggle */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-left: 0.25rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg-elevated);
    color: var(--ink);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    border-color: rgba(13, 148, 136, 0.4);
    outline: none;
}

.theme-toggle:active {
    transform: scale(0.96);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

/* Default dark → show sun (switch to light). Light theme → show moon. */
.theme-toggle .icon-sun {
    display: block;
}

html[data-theme="light"] .theme-toggle .icon-sun {
    display: none;
}

html[data-theme="light"] .theme-toggle .icon-moon {
    display: block;
}

/* Hero */

.hero {
    padding: 4.5rem 1.25rem 3rem;
}

.hero-inner {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
}

.eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--game-strong);
    background: var(--game-soft);
    border: 1px solid color-mix(in srgb, var(--game) 30%, transparent);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 1.25rem;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.1rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.12;
    margin-bottom: 1rem;
}

.hero-lead {
    font-size: 1.1rem;
    color: var(--ink-soft);
    max-width: 34rem;
    margin: 0 auto 0.9rem;
}

.hero-lead .hl-game {
    color: var(--game-strong);
    font-weight: 600;
}

.hero-lead .hl-tour {
    color: var(--tour-strong);
    font-weight: 600;
}

.hero-byline {
    display: inline-block;
    margin: -0.5rem auto 1.75rem;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #fff;
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--tour) 40%, transparent);
    background: linear-gradient(
        120deg,
        var(--game),
        var(--tour),
        var(--events),
        var(--shop),
        var(--game)
    );
    background-size: 300% 300%;
    animation: byline-gradient 8s ease infinite;
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--tour) 20%, transparent),
        0 8px 24px color-mix(in srgb, var(--tour) 22%, transparent);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

@keyframes byline-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

html[data-theme="light"] .hero-byline {
    color: #0f1216;
    text-shadow: none;
    border-color: color-mix(in srgb, var(--tour) 28%, transparent);
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--game) 12%, transparent),
        0 8px 20px color-mix(in srgb, var(--tour) 14%, transparent);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 46px;
    padding: 0.7rem 1.2rem;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-ink);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: var(--btn-primary-hover);
    outline: none;
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
}

.btn-ghost:hover,
.btn-ghost:focus-visible {
    border-color: color-mix(in srgb, var(--ink) 22%, transparent);
    background: var(--nav-hover-bg);
    outline: none;
}

/* Products — side-by-side 2-column */

.products {
    max-width: min(1180px, 100%);
    margin: 0 auto;
    padding: 1rem 1.25rem 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: stretch;
}

.product {
    display: flex;
    flex-direction: column;
    gap: 1.35rem;
    height: 100%;
    padding: 1.5rem 1.35rem 1.6rem;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: calc(var(--radius) + 6px);
    box-shadow: var(--shadow);
}

.product-copy {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: center;
}

.product-badge {
    display: inline-block;
    align-self: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-strong);
    background: var(--accent-soft);
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.65rem;
}

.product h2 {
    font-size: clamp(1.35rem, 2.4vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.15;
    margin-bottom: 0.3rem;
}

.product-tagline {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--accent-strong);
    margin-bottom: 0.65rem;
}

.product-copy > p:not(.product-tagline) {
    color: var(--ink-soft);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    max-width: 36ch;
    margin-left: auto;
    margin-right: auto;
}

/* Product color identities */

#game-app {
    --product: var(--game);
    --product-strong: var(--game-strong);
    --product-soft: var(--game-soft);
}

#tour-app {
    --product: var(--tour);
    --product-strong: var(--tour-strong);
    --product-soft: var(--tour-soft);
}

#game-app .product-badge,
#tour-app .product-badge {
    color: var(--product-strong);
    background: var(--product-soft);
}

#game-app .product-tagline,
#tour-app .product-tagline {
    color: var(--product-strong);
}

#game-app .demo-step-label,
#tour-app .demo-step-label {
    color: var(--product-strong);
}

#game-app .demo-dots button.is-active,
#tour-app .demo-dots button.is-active {
    background: var(--product);
}

#game-app .demo-dots button:hover,
#game-app .demo-dots button:focus-visible,
#tour-app .demo-dots button:hover,
#tour-app .demo-dots button:focus-visible {
    background: var(--product-strong);
}

#game-app.product.is-playing .device-bezel::after,
#tour-app.product.is-playing .device-bezel::after {
    border-color: color-mix(in srgb, var(--product) 45%, transparent);
}

/* How it works steps */

.how-steps {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 1.15rem;
    text-align: left;
}

.how-steps li {
    display: grid;
    gap: 0.08rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: var(--step-bg);
    color: var(--ink-soft);
    transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
    cursor: pointer;
}

.how-steps li strong {
    font-size: 0.88rem;
    color: var(--ink);
    font-weight: 600;
}

.how-steps li span {
    font-size: 0.82rem;
}

.how-steps li.is-active {
    background: var(--product-soft, var(--accent-soft));
    border-color: color-mix(in srgb, var(--product, var(--accent)) 35%, transparent);
    color: var(--ink);
    transform: translateX(2px);
}

.how-steps li.is-active strong {
    color: var(--product-strong, var(--accent-strong));
}

.how-steps li.is-active span {
    color: color-mix(in srgb, var(--product-strong, var(--accent-strong)) 75%, var(--ink-soft));
}

.product-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    margin-top: auto;
}

.product-actions .btn {
    min-height: 42px;
    padding: 0.55rem 1rem;
    font-size: 0.9rem;
}

.store-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    width: 100%;
    margin-top: 0.15rem;
}

.store-badge img {
    height: 34px;
    width: auto;
    transition: opacity 0.15s ease;
}

.store-badge:hover img,
.store-badge:focus-visible img {
    opacity: 0.85;
}

/* Demo device — phone on top of each column */

.product-demo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    order: -1;
}

.device {
    position: relative;
    width: min(100%, 200px);
}

.device-bezel {
    position: relative;
    background: var(--device-shell);
    border-radius: 30px;
    padding: 10px;
    box-shadow: var(--shadow-device);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.device-notch {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 72px;
    height: 18px;
    background: var(--device-shell);
    border-radius: 999px;
    z-index: 3;
}

.device-screen {
    position: relative;
    aspect-ratio: 9 / 19.5;
    border-radius: 22px;
    overflow: hidden;
    background: #1a1e24;
}

.demo-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    opacity: 0;
    transform: scale(1.04) translateY(8px);
    transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

.demo-frame.is-active {
    opacity: 1;
    transform: scale(1) translateY(0);
    z-index: 1;
}

/* Subtle pulse ring while demo is running */
.product.is-playing .device-bezel::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 42px;
    border: 1px solid rgba(13, 148, 136, 0.28);
    animation: demo-glow 2.4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes demo-glow {
    0%, 100% { opacity: 0.25; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.01); }
}

.demo-caption {
    text-align: center;
    min-height: 2.4rem;
}

.demo-step-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-strong);
    margin-bottom: 0.12rem;
}

.demo-step-text {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--ink-soft);
    animation: caption-in 0.4s ease;
}

@keyframes caption-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.demo-dots {
    display: flex;
    gap: 0.45rem;
}

.demo-dots button {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: none;
    padding: 0;
    background: var(--dot-idle);
    cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease;
}

.demo-dots button.is-active {
    width: 22px;
    background: var(--accent);
}

.demo-dots button:hover,
.demo-dots button:focus-visible {
    background: var(--accent-strong);
    outline: none;
}

/* Links strip */

.links-strip {
    padding: 0 1.25rem 4rem;
}

.links-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.link-card {
    display: grid;
    gap: 0.25rem;
    padding: 1.4rem 1.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.link-card:hover,
.link-card:focus-visible {
    border-color: rgba(13, 148, 136, 0.35);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
    outline: none;
}

.link-card-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-strong);
}

.link-card strong {
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.link-card span:last-child {
    font-size: 0.92rem;
    color: var(--ink-soft);
}

/* Events / Shop subheader accents */
.links-inner .link-card:first-child .link-card-label {
    color: var(--events-strong);
}

.links-inner .link-card:first-child {
    --link-accent: var(--events);
    --link-soft: var(--events-soft);
}

.links-inner .link-card:last-child .link-card-label {
    color: var(--shop-strong);
}

.links-inner .link-card:last-child {
    --link-accent: var(--shop);
    --link-soft: var(--shop-soft);
}

.links-inner .link-card:hover,
.links-inner .link-card:focus-visible {
    border-color: color-mix(in srgb, var(--link-accent, var(--accent)) 45%, transparent);
    background: linear-gradient(180deg, var(--link-soft, transparent), var(--bg-elevated));
}

/* Footer */

.site-footer {
    border-top: 1px solid var(--line);
    padding: 2rem 1.25rem 2.5rem;
    background: var(--footer-bg);
}

.footer-inner {
    max-width: var(--max);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.footer-inner .logo {
    opacity: 0.95;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 1rem;
}

.footer-nav a {
    font-size: 0.9rem;
    color: var(--ink-soft);
    font-weight: 500;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
    color: var(--ink);
    outline: none;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--ink-soft);
    opacity: 0.8;
}

/* Responsive */

@media (max-width: 900px) {
    .products {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        max-width: 520px;
    }

    .product {
        padding: 1.4rem 1.25rem 1.5rem;
    }

    .device {
        width: min(100%, 210px);
    }
}

@media (max-width: 820px) {
    .brand-tagline {
        display: none;
    }
}

@media (max-width: 560px) {
    .hero {
        padding: 3rem 1.1rem 2rem;
    }

    .hero h1 br {
        display: none;
    }

    .links-inner {
        grid-template-columns: 1fr;
    }

    .header-inner {
        padding: 0 1rem;
    }

    .products {
        max-width: none;
    }
}

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

    body {
        transition: none;
    }

    .demo-frame,
    .how-steps li,
    .link-card,
    .btn,
    .demo-step-text,
    .hero-byline {
        transition: none !important;
        animation: none !important;
    }

    .hero-byline {
        background-position: 50% 50%;
    }

    .product.is-playing .device-bezel::after {
        animation: none;
        opacity: 0.5;
    }
}
