/* ========================================
   Crew Relay Chat - Landing Page Styles
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0a0a0a;
    --surface: #141414;
    --surface-2: #1c1c1c;
    --border: #262626;
    --text: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --accent: #f5a623;
    --accent-purple: #8b5cf6;
    --gradient: linear-gradient(135deg, #f5a623 0%, #e040a0 50%, #8b5cf6 100%);
    --gradient-subtle: linear-gradient(135deg, rgba(245,166,35,0.12) 0%, rgba(139,92,246,0.12) 100%);
    --radius: 12px;
    --radius-lg: 20px;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --max-width: 1140px;
    --nav-height: 64px;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #ffc966;
}

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

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 100;
    transition: background 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
    background: rgba(10, 10, 10, 0.92);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-cta {
    background: var(--gradient);
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px !important;
    transition: opacity 0.2s;
}

.nav-cta:hover {
    opacity: 0.9;
    color: #000 !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* --- Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: calc(var(--nav-height) + 40px) 24px 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -20%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(245,166,35,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 70%);
    pointer-events: none;
}

.hero-inner {
    max-width: var(--max-width);
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient-subtle);
    border: 1px solid rgba(245,166,35,0.2);
    border-radius: 100px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 24px;
}

.hero-badge-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.hero h1 {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -1px;
    margin-bottom: 20px;
}

.hero h1 .gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 36px;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.store-badge {
    height: 48px;
    width: auto;
    transition: transform 0.2s, opacity 0.2s;
    border-radius: 8px;
}

.store-badge:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.hero-poster {
    max-width: 400px;
    width: 100%;
    border-radius: var(--radius-lg);
    position: relative;
    z-index: 1;
}

.hero-poster-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: var(--gradient);
    filter: blur(80px);
    opacity: 0.2;
    border-radius: 50%;
    pointer-events: none;
}

/* --- Section shared --- */
.section {
    padding: 100px 24px;
    position: relative;
}

.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-label {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
}

.section-title {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.section-subtitle {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 560px;
    line-height: 1.7;
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-header .section-subtitle {
    margin: 0 auto;
}

/* --- Features --- */
.features {
    background: var(--bg);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    transition: border-color 0.3s, transform 0.3s;
}

.feature-card:hover {
    border-color: rgba(245,166,35,0.3);
    transform: translateY(-4px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gradient-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.feature-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* --- How it works --- */
.how-it-works {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    position: relative;
}

.steps::before {
    content: '';
    position: absolute;
    top: 36px;
    left: calc(16.67% + 36px);
    right: calc(16.67% + 36px);
    height: 2px;
    background: var(--border);
}

.step {
    text-align: center;
    position: relative;
}

.step-number {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: #000;
    margin: 0 auto 24px;
    position: relative;
    z-index: 1;
}

.step h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.step p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 280px;
    margin: 0 auto;
}

/* --- App Showcase --- */
.showcase {
    overflow: hidden;
    padding-bottom: 80px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.showcase-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 0 max(24px, calc((100vw - var(--max-width)) / 2 + 24px));
    scrollbar-width: none;
}

.showcase-track::-webkit-scrollbar {
    display: none;
}

.showcase-item {
    flex: 0 0 auto;
    scroll-snap-align: center;
    width: 280px;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s;
}

.showcase-item:hover {
    transform: scale(1.03);
}

.showcase-item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
}

@media (max-width: 600px) {
    .showcase-item {
        width: 240px;
    }
}

/* --- Video --- */
.video-section {
    background: var(--bg);
}

.video-wrapper {
    max-width: 800px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
    background: #000;
}

.video-wrapper video {
    width: 100%;
    display: block;
}

/* --- Privacy/Trust --- */
.trust {
    background: var(--bg);
}

.trust-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.trust-points {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.trust-point {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.trust-point-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gradient-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
}

.trust-point-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.trust-point h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.trust-point p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.trust-visual {
    display: flex;
    justify-content: center;
}

.trust-diagram {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 440px;
}

.trust-diagram-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
    text-align: center;
}

.mesh-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.mesh-row {
    display: flex;
    gap: 24px;
    justify-content: center;
}

.mesh-node {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border);
    transition: border-color 0.3s;
    position: relative;
}

.mesh-node img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mesh-node.active {
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(245,166,35,0.3);
}

.mesh-lines {
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    color: var(--text-muted);
    font-size: 12px;
}

.mesh-caption {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
    line-height: 1.5;
}

/* --- Platforms --- */
.platforms {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.platforms-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 48px;
    flex-wrap: wrap;
}

.platform-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
}

.platform-item svg {
    width: 28px;
    height: 28px;
    stroke: var(--text-secondary);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Global Reach --- */
.global-section {
    text-align: center;
}

.global-flags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px 20px;
    max-width: 700px;
    margin: 0 auto 32px;
}

.flag-item {
    font-size: 2rem;
    cursor: default;
    transition: transform 0.2s ease;
}

.flag-item:hover {
    transform: scale(1.3);
}

.global-caption {
    color: var(--text-dim);
    font-size: 1.1rem;
}

.global-caption strong {
    color: var(--text);
    font-weight: 600;
}

/* --- Download CTA --- */
.cta-section {
    padding: 120px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient);
    opacity: 0.04;
    pointer-events: none;
}

.cta-section .section-title {
    max-width: 600px;
    margin: 0 auto 16px;
}

.cta-section .section-subtitle {
    margin: 0 auto 40px;
    text-align: center;
}

.cta-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.cta-note {
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--border);
    padding: 48px 24px;
    background: var(--bg);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 24px;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-brand {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 2px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-copy {
    font-size: 13px;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 24px;
    list-style: none;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.2s;
}

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

.footer-social {
    display: flex;
    gap: 16px;
    align-items: center;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    transition: border-color 0.2s, transform 0.2s;
}

.footer-social a:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.footer-social img {
    width: 18px;
    height: 18px;
}

/* --- Scroll Animations --- */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* stagger children */
.stagger > .fade-in:nth-child(1) { transition-delay: 0s; }
.stagger > .fade-in:nth-child(2) { transition-delay: 0.1s; }
.stagger > .fade-in:nth-child(3) { transition-delay: 0.2s; }
.stagger > .fade-in:nth-child(4) { transition-delay: 0.3s; }
.stagger > .fade-in:nth-child(5) { transition-delay: 0.4s; }
.stagger > .fade-in:nth-child(6) { transition-delay: 0.5s; }

/* --- Responsive --- */
@media (max-width: 900px) {
    .hero-inner {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 48px;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-poster {
        max-width: 280px;
    }

    .features-grid {
        grid-template-columns: 1fr 1fr;
    }

    .steps {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .steps::before {
        display: none;
    }

    .trust-grid {
        grid-template-columns: 1fr;
    }

    .trust-visual {
        order: -1;
    }
}

@media (max-width: 600px) {
    :root {
        --nav-height: 56px;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(10, 10, 10, 0.97);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 24px;
        gap: 20px;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.open {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding-bottom: 48px;
    }

    .section {
        padding: 64px 20px;
    }

    .platforms-row {
        gap: 24px;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .footer-left {
        align-items: center;
    }

    .footer-links {
        justify-content: center;
    }
}
