/* Just Climb v2 — modern dark theme aligned with Flutter app
 * Palette: navy #2D3566 base, coral #E7866A primary, lavender #AC9FFF accent.
 * Fonts: League Spartan (display) + Inter (body).
 */

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: var(--primary); color: #000; }

/* ---------- Tokens ---------- */
:root {
    --bg: #1a1f3a;
    --bg-elev: #2D3566;
    --bg-elev-2: #3D4576;
    --primary: #E7866A;
    --primary-dark: #cb6b4b;
    --primary-glow: rgba(231, 134, 106, 0.4);
    --secondary: #AC9FFF;
    --secondary-dark: #8d7ee0;
    --text: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.7);
    --text-faint: rgba(255, 255, 255, 0.5);
    --border: rgba(172, 159, 255, 0.15);
    --border-strong: rgba(172, 159, 255, 0.35);
    --error: #CF6679;
    --success: #5DD39E;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 8px 32px var(--primary-glow);

    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    --container: min(1200px, calc(100% - 48px));
    --section-pad: clamp(64px, 10vw, 120px);
    --font-display: 'League Spartan', 'Inter', sans-serif;
}

/* ---------- Layout ---------- */
.container { width: var(--container); margin: 0 auto; }
section { padding-block: var(--section-pad); position: relative; }
.section-narrow { padding-block: clamp(48px, 7vw, 80px); }
.visually-hidden {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Backgrounds ---------- */
.bg-glow {
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(231,134,106,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 90% 70%, rgba(172,159,255,0.10) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 10% 100%, rgba(231,134,106,0.08) 0%, transparent 50%);
}
.bg-grid {
    position: absolute; inset: 0; opacity: 0.4; pointer-events: none;
    background-image:
        linear-gradient(rgba(172,159,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(172,159,255,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 70% 50% at 50% 50%, black, transparent);
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h4 { font-size: clamp(1.125rem, 2vw, 1.5rem); }
.eyebrow {
    display: inline-block;
    font-size: 0.75rem; font-weight: 600;
    letter-spacing: 0.15em; text-transform: uppercase;
    color: var(--secondary);
    padding: 6px 14px; border-radius: var(--radius-pill);
    background: rgba(172,159,255,0.1);
    border: 1px solid var(--border);
    margin-bottom: 16px;
}
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.lead { font-size: clamp(1rem, 1.5vw, 1.25rem); color: var(--text-dim); max-width: 60ch; }

/* ---------- Navbar ---------- */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 16px 0;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: padding var(--transition), background var(--transition), backdrop-filter var(--transition);
}
.navbar.scrolled {
    padding: 10px 0;
    background: rgba(26, 31, 58, 0.8);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-bottom: 1px solid var(--border);
}
.nav-inner {
    width: var(--container); margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; }
.nav-logo img { width: 36px; height: 36px; border-radius: 9px; box-shadow: var(--shadow-glow); }
.nav-logo .brand { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.nav-links {
    display: flex; align-items: center; gap: 8px;
    list-style: none;
}
.nav-link {
    padding: 8px 14px; border-radius: var(--radius-pill);
    color: var(--text-dim); font-size: 0.9rem; font-weight: 500;
    transition: color var(--transition), background var(--transition);
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-actions { display: flex; align-items: center; gap: 10px; }

/* Burger */
.burger {
    display: none;
    width: 40px; height: 40px;
    flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    border-radius: var(--radius-md);
    transition: background var(--transition);
}
.burger:hover { background: rgba(255,255,255,0.05); }
.burger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform var(--transition), opacity var(--transition); }
.burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Lang switcher */
.lang-switch {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 10px; border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    font-size: 0.8rem; font-weight: 600;
    transition: background var(--transition);
}
.lang-switch:hover { background: rgba(255,255,255,0.1); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    padding: 14px 24px;
    border-radius: var(--radius-md);
    font-weight: 600; font-size: 0.95rem;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}
.btn-primary {
    background: var(--primary); color: #1a1f3a;
    box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 8px 24px var(--primary-glow); }
.btn-primary:active { transform: translateY(0); }
.btn-outline {
    background: transparent; color: var(--text);
    border: 1px solid var(--border-strong);
}
.btn-outline:hover { background: rgba(255,255,255,0.05); border-color: var(--secondary); }
.btn-ghost { background: transparent; color: var(--text-dim); padding: 10px 16px; }
.btn-ghost:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.btn-lg { padding: 18px 32px; font-size: 1rem; }
.btn-sm { padding: 10px 18px; font-size: 0.85rem; }

/* Store badges */
.store-badges { display: flex; flex-wrap: wrap; gap: 12px; }
.store-badges a {
    display: inline-block;
    transition: transform var(--transition);
}
.store-badges a:hover { transform: translateY(-3px); }
.store-badges img { height: 50px; width: auto; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding-top: 100px;
    padding-bottom: 80px;
    overflow: hidden;
}
.hero-grid {
    display: grid;
    gap: 64px;
    grid-template-columns: 1fr;
    align-items: center;
}
@media (min-width: 960px) {
    .hero-grid { grid-template-columns: 1.3fr 1fr; }
}
.hero h1 .underline {
    background: linear-gradient(180deg, transparent 60%, var(--primary-glow) 60%);
    padding: 0 4px;
}
.hero p.lead { margin-top: 24px; }
.hero .cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }
.hero .badge-row { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 32px; align-items: center; }
.rating {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--text-dim); font-size: 0.9rem;
}
.rating .stars { color: var(--primary); letter-spacing: 2px; font-size: 1.1rem; }

/* Phone mockup */
.phone-frame {
    position: relative;
    margin: 0 auto;
    width: min(280px, 80vw);
    aspect-ratio: 280 / 580;
    border-radius: 38px;
    background: linear-gradient(145deg, #1a1f3a, #0a0d1c);
    padding: 12px;
    box-shadow:
        0 30px 80px rgba(0,0,0,0.5),
        0 0 0 2px rgba(172,159,255,0.2),
        inset 0 0 0 4px #0a0d1c;
}
.phone-frame::before {
    content: ""; position: absolute;
    top: 14px; left: 50%; transform: translateX(-50%);
    width: 96px; height: 24px;
    background: #0a0d1c;
    border-radius: 12px;
    z-index: 2;
}
.phone-screen {
    position: relative;
    width: 100%; height: 100%;
    border-radius: 28px;
    overflow: hidden;
    background: #2D3566;
}
.phone-screen img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0; transition: opacity 600ms ease;
}
.phone-screen img.active { opacity: 1; }
.phone-dots {
    display: flex; justify-content: center; gap: 8px;
    margin-top: 24px;
}
.phone-dots button {
    width: 8px; height: 8px; border-radius: 50%;
    background: rgba(172,159,255,0.3);
    transition: width var(--transition), background var(--transition);
}
.phone-dots button.active { width: 24px; background: var(--primary); border-radius: 4px; }

/* ---------- Stats strip ---------- */
.stats {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    padding: 32px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, rgba(231,134,106,0.08), rgba(172,159,255,0.08));
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.stat { text-align: center; }
.stat-num {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem); font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.stat-label { color: var(--text-dim); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; margin-top: 8px; }

/* ---------- Feature grid ---------- */
.section-head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.section-head .lead { margin: 16px auto 0; }

.feature-grid {
    display: grid; gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.feature-card {
    padding: 28px;
    background: rgba(45, 53, 102, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform var(--transition), border-color var(--transition), background var(--transition);
}
.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
    background: rgba(45, 53, 102, 0.6);
}
.feature-icon {
    width: 48px; height: 48px;
    display: grid; place-items: center;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(231,134,106,0.2), rgba(172,159,255,0.2));
    color: var(--primary);
    margin-bottom: 16px;
}
.feature-icon svg { width: 26px; height: 26px; }
.feature-card h4 { margin-bottom: 8px; }
.feature-card p { color: var(--text-dim); font-size: 0.95rem; }

/* ---------- Split section (For Gyms) ---------- */
.split {
    display: grid; gap: 56px;
    grid-template-columns: 1fr;
    align-items: center;
}
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } }
.split.reverse { direction: rtl; }
.split.reverse > * { direction: ltr; }
.split-visual {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #2D3566, #3D4576);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
}
.split-visual img { width: 100%; height: 100%; object-fit: cover; }
.split-visual::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(231,134,106,0.15) 100%);
    pointer-events: none;
}

/* Variant when split-visual hosts a phone-frame carousel instead of a flat image. */
.split-visual.split-visual-phone {
    aspect-ratio: auto;
    background: none;
    border: none;
    box-shadow: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 0;
}
.split-visual.split-visual-phone::after { content: none; }

.bullet-list { list-style: none; padding: 0; margin-top: 24px; display: grid; gap: 16px; }
.bullet-list li { display: flex; gap: 14px; align-items: flex-start; }
.bullet-list .check {
    flex: 0 0 28px; height: 28px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(93, 211, 158, 0.15);
    color: var(--success);
}
.bullet-list strong { display: block; margin-bottom: 2px; }
.bullet-list span { color: var(--text-dim); font-size: 0.95rem; }

/* ---------- FAQ ---------- */
.faq-grid { display: grid; gap: 12px; max-width: 800px; margin: 0 auto; }
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(45, 53, 102, 0.4);
    overflow: hidden;
}
.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 20px 24px;
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    font-weight: 600;
    transition: background var(--transition);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { background: rgba(255,255,255,0.03); }
.faq-item summary::after {
    content: "+";
    font-size: 1.5rem; line-height: 1;
    color: var(--secondary);
    transition: transform var(--transition);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-answer { padding: 0 24px 20px; color: var(--text-dim); }

/* ---------- Newsletter ---------- */
.newsletter-card {
    padding: clamp(32px, 5vw, 56px);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(231,134,106,0.15), rgba(172,159,255,0.10)),
        rgba(45, 53, 102, 0.7);
    border: 1px solid var(--border-strong);
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
.newsletter-form {
    display: flex; flex-wrap: wrap; gap: 10px;
    max-width: 480px; margin: 24px auto 0;
}
.newsletter-form input[type="email"] {
    flex: 1 1 240px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-strong);
    background: rgba(0,0,0,0.25);
    color: var(--text);
    font-family: inherit; font-size: 0.95rem;
    transition: border-color var(--transition);
}
.newsletter-form input[type="email"]:focus { outline: none; border-color: var(--primary); }
.newsletter-form input[type="email"]::placeholder { color: var(--text-faint); }
.newsletter-form .honeypot { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }
.newsletter-msg { margin-top: 14px; font-size: 0.9rem; min-height: 1.2em; }
.newsletter-msg.success { color: var(--success); }
.newsletter-msg.error { color: var(--error); }

/* ---------- CTA banner ---------- */
.cta-banner {
    text-align: center;
    padding: clamp(48px, 7vw, 96px) clamp(24px, 5vw, 64px);
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(231,134,106,0.20), rgba(172,159,255,0.15));
    border: 1px solid var(--border-strong);
    overflow: hidden;
    position: relative;
}
.cta-banner::before {
    content: ""; position: absolute;
    width: 600px; height: 600px; border-radius: 50%;
    background: radial-gradient(circle, var(--primary-glow), transparent 70%);
    top: -200px; right: -200px; pointer-events: none;
    filter: blur(40px);
}
.cta-banner h2 { position: relative; }
.cta-banner .store-badges { justify-content: center; margin-top: 24px; position: relative; }

/* ---------- Footer ---------- */
.footer {
    border-top: 1px solid var(--border);
    padding: 64px 0 32px;
    margin-top: 80px;
    background: rgba(0,0,0,0.2);
}
.footer-grid {
    display: grid;
    gap: 40px;
    grid-template-columns: 2fr repeat(3, 1fr);
}
@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
}
.footer-brand p { color: var(--text-dim); font-size: 0.9rem; max-width: 32ch; margin-top: 12px; }
.footer-brand .nav-logo { margin-bottom: 4px; }
.footer h5 {
    font-family: var(--font-display);
    font-size: 0.95rem;
    margin-bottom: 16px;
    letter-spacing: 0.05em;
}
.footer ul { list-style: none; display: grid; gap: 10px; }
.footer ul a {
    color: var(--text-dim); font-size: 0.9rem;
    transition: color var(--transition);
}
.footer ul a:hover { color: var(--text); }
.footer-bottom {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
    color: var(--text-faint); font-size: 0.85rem;
}
.social-row { display: flex; gap: 10px; }
.social-row a {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    transition: background var(--transition), color var(--transition);
}
.social-row a:hover { background: var(--primary); color: #1a1f3a; }
.social-row svg { width: 16px; height: 16px; }

/* ---------- Cookie banner ---------- */
.cookie-banner {
    position: fixed; bottom: 16px; left: 16px; right: 16px;
    z-index: 200;
    padding: 18px 22px;
    border-radius: var(--radius-lg);
    background: rgba(26, 31, 58, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-strong);
    display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
    max-width: 720px; margin: 0 auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(120%);
    transition: transform 400ms cubic-bezier(0.4,0,0.2,1);
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner p { font-size: 0.85rem; color: var(--text-dim); margin: 0; flex: 1 1 280px; }
.cookie-banner .cookie-actions { display: flex; gap: 8px; }

/* ---------- Mobile nav ---------- */
@media (max-width: 880px) {
    .burger { display: flex; }
    .nav-links {
        position: fixed;
        top: 64px; left: 16px; right: 16px;
        flex-direction: column;
        gap: 4px;
        padding: 16px;
        border-radius: var(--radius-lg);
        background: rgba(26, 31, 58, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--border);
        opacity: 0; pointer-events: none;
        transform: translateY(-12px);
        transition: opacity var(--transition), transform var(--transition);
    }
    .nav-links.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
    .nav-link { padding: 12px 14px; }
}

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- Mini-page (deeplink, league, invitation) ---------- */
.mini-page {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 48px 24px;
}
.mini-card {
    width: 100%; max-width: 460px;
    text-align: center;
    padding: 48px 32px;
    border-radius: var(--radius-xl);
    background:
        linear-gradient(135deg, rgba(45,53,102,0.6), rgba(45,53,102,0.4));
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-lg);
}
.mini-card .logo {
    width: 88px; height: 88px;
    border-radius: 22px;
    box-shadow: var(--shadow-glow);
    margin: 0 auto 24px;
}
.mini-card .preview-image {
    width: 100%; max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}
.mini-card h1 {
    font-size: 1.75rem;
    color: var(--primary);
    margin-bottom: 8px;
}
.mini-card .subtitle { color: var(--text-dim); margin-bottom: 28px; line-height: 1.5; }
.entity-name { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.entity-detail { font-size: 0.9rem; color: var(--text-faint); margin-bottom: 4px; }

.spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status { font-size: 0.85rem; color: var(--text-faint); }
.divider {
    width: 40px; height: 2px;
    background: rgba(255,255,255,0.1);
    margin: 24px auto;
    border-radius: 1px;
}
.cta-text { font-size: 0.85rem; color: var(--text-faint); }

/* Hide outline on mouse, keep on keyboard */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 4px; }

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