/* ========================================
   SaaSArena — Human, wide, textured
   ======================================== */

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

:root {
    --bg: #0a0a0c;
    --bg-card: #111115;
    --bg-elevated: #16161b;
    --border: #1f1f27;
    --border-light: #2a2a35;
    --text: #ededef;
    --text-muted: #9d9daa;
    --text-dim: #5c5c6e;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-soft: rgba(139, 92, 246, 0.1);
    --red: #ef4444;
    --green: #34d399;
    --amber: #fbbf24;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --hand: 'Caveat', cursive;
    --transition: 0.25s ease;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

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

/* --- Film grain overlay --- */
.grain {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 128px 128px;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 32px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font);
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-sm { padding: 8px 18px; font-size: 14px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--text-dim);
    color: var(--text);
}

.btn-ghost {
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

/* --- Nav --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: var(--transition);
}

.nav.scrolled {
    background: rgba(10, 10, 12, 0.9);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 800;
}

.logo-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.logo-accent { color: var(--primary); }

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a:not(.btn) {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dim);
    transition: var(--transition);
}

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

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

.mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

/* --- Hero — left-aligned with floating cards on right --- */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-glow {
    position: absolute;
    width: 700px;
    height: 700px;
    top: 30%;
    left: 20%;
    transform: translate(-50%, -50%);
    background: var(--primary);
    border-radius: 50%;
    filter: blur(200px);
    opacity: 0.06;
}

.hero-glow-2 {
    position: absolute;
    width: 400px;
    height: 400px;
    bottom: 10%;
    right: 10%;
    background: #e879f9;
    border-radius: 50%;
    filter: blur(180px);
    opacity: 0.04;
}

.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
    padding: 140px 0 100px;
}

.hero-content {
    text-align: left;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.live-dot {
    width: 7px;
    height: 7px;
    background: var(--red);
    border-radius: 50%;
    animation: pulse-red 1.5s infinite;
    flex-shrink: 0;
}

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
}

.hero h1 {
    font-size: clamp(38px, 5vw, 62px);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.035em;
    margin-bottom: 20px;
}

.gradient-text {
    background: linear-gradient(135deg, #a78bfa 0%, #e879f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 36px;
}

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

/* --- Hero floating cards (right side) --- */
.hero-visual {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
}

.hero-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-card:hover {
    transform: translateX(-4px);
    box-shadow: 8px 8px 0 rgba(139, 92, 246, 0.06);
}

.hero-card-1 { transform: rotate(-0.8deg); }
.hero-card-2 { transform: rotate(0.5deg); margin-left: 16px; }
.hero-card-3 { transform: rotate(-0.3deg); margin-left: 8px; }

.hero-card-1:hover { transform: rotate(-0.8deg) translateX(-4px); }
.hero-card-2:hover { transform: rotate(0.5deg) translateX(-4px); }
.hero-card-3:hover { transform: rotate(-0.3deg) translateX(-4px); }

.hc-badge {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}

.hc-win {
    background: rgba(52, 211, 153, 0.12);
    color: var(--green);
}

.hc-live {
    background: rgba(239, 68, 68, 0.12);
    color: var(--red);
}

.hc-next {
    background: rgba(251, 191, 36, 0.12);
    color: var(--amber);
}

.hc-name {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
}

.hc-score {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-dim);
    white-space: nowrap;
}

.hero-scribble {
    font-family: var(--hand);
    font-size: 22px;
    color: var(--primary);
    opacity: 0.5;
    transform: rotate(-4deg);
    margin-top: 8px;
    margin-left: 32px;
}

/* --- Battle Section — circle clash --- */
.battle-section {
    padding: 20px 0 100px;
    position: relative;
    z-index: 2;
}

.battle-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.battle-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.battle-live {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 1.5px;
    color: var(--red);
    text-transform: uppercase;
}

.battle-label {
    color: var(--text-muted);
    font-weight: 500;
}

.battle-timer {
    margin-left: auto;
    color: var(--text-dim);
    font-size: 13px;
}

.battle-timer strong {
    font-family: var(--mono);
    color: var(--text-muted);
    font-weight: 600;
}

/* Arena — circle layout */
.battle-arena {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 32px;
    position: relative;
    min-height: 320px;
}

.arena-fighter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.arena-fighter-left {
    margin-right: 0;
}

.arena-fighter-right {
    margin-left: 0;
}

.arena-pct {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.03em;
    line-height: 1;
}

.arena-fighter-left .arena-pct { color: var(--primary); }
.arena-fighter-right .arena-pct { color: var(--text-muted); }

.arena-circle {
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 2px solid var(--border);
    transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1),
                height 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.arena-circle-left {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.12), rgba(139, 92, 246, 0.03));
    border-color: rgba(139, 92, 246, 0.25);
}

.arena-circle-right {
    width: 140px;
    height: 140px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border-color: var(--border-light);
}

.arena-emoji {
    font-size: 32px;
    line-height: 1;
}

.arena-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.arena-tag {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
}

/* Clash fire in the middle */
.arena-clash {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    flex-shrink: 0;
    overflow: visible;
}

.clash-fire {
    font-size: 40px;
    line-height: 1;
    animation: fire-pulse 1.2s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(249, 115, 22, 0.5));
}

@keyframes fire-pulse {
    0%, 100% { transform: scale(1) rotate(-4deg); }
    50% { transform: scale(1.15) rotate(4deg); }
}

.battle-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    border-top: 1px solid var(--border);
}

.battle-metrics {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-dim);
}

.metric-dot {
    width: 3px;
    height: 3px;
    background: var(--text-dim);
    border-radius: 50%;
}

/* --- How Section — horizontal 3-col --- */
.how-section {
    padding: 80px 0;
    border-top: 1px solid var(--border);
}

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

.how-item {
    padding: 28px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: var(--transition);
}

.how-item:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.how-num {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    display: inline-block;
    margin-bottom: 12px;
    opacity: 0.7;
}

.how-item p {
    font-size: 16px;
    color: var(--text-muted);
    line-height: 1.55;
}

.how-item p strong {
    color: var(--text);
}

/* --- Social Proof — quote + numbers side by side --- */
.proof-section {
    padding: 80px 0;
    border-top: 1px solid var(--border);
}

.proof-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 64px;
    align-items: center;
}

.proof-quote {
    text-align: left;
}

.proof-quote p {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: var(--text);
    margin-bottom: 20px;
}

.proof-quote footer {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.proof-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-muted);
}

.proof-role {
    font-size: 13px;
    color: var(--text-dim);
}

.proof-stats {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.proof-stat {
    padding: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
}

.ps-num {
    display: block;
    font-family: var(--mono);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 2px;
}

.ps-label {
    font-size: 14px;
    color: var(--text-dim);
}

/* --- CTA --- */
.cta-section {
    padding: 40px 0 100px;
}

.cta-card {
    position: relative;
    padding: 72px 48px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
    overflow: hidden;
}

.cta-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.cta-card h2 {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.cta-card p {
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

.cta-note {
    display: block;
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-dim);
}

.cta-scribble {
    font-family: var(--hand);
    font-size: 48px;
    color: var(--primary);
    opacity: 0.12;
    transform: rotate(-6deg);
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
}

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

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer .logo { font-size: 16px; }

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    font-size: 13px;
    color: var(--text-dim);
    transition: var(--transition);
}

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

/* --- Animations --- */
[data-animate] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 48px;
        padding: 120px 0 60px;
    }

    .hero-content { text-align: left; }

    .hero-visual {
        max-width: 420px;
    }

    .battle-arena {
        padding: 40px 16px;
        min-height: 240px;
    }

    .arena-circle-left { width: 160px; height: 160px; }
    .arena-circle-right { width: 120px; height: 120px; }

    .arena-fighter-left { margin-right: 0; }
    .arena-fighter-right { margin-left: 0; }
    .arena-clash { width: 40px; }

    .proof-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .proof-stats {
        flex-direction: row;
        gap: 16px;
    }

    .proof-stat { flex: 1; }
}

@media (max-width: 768px) {
    .container { padding: 0 20px; }

    .nav-inner { padding: 0 20px; }

    .nav-links {
        display: none;
        position: fixed;
        inset: 0;
        background: var(--bg);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 24px;
        z-index: 999;
    }

    .nav-links.active { display: flex; }
    .nav-links a { font-size: 18px; }
    .nav-links .btn { margin-left: 0; }

    .mobile-toggle {
        display: flex;
        z-index: 1001;
    }

    .mobile-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .mobile-toggle.active span:nth-child(2) { opacity: 0; }
    .mobile-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .hero { min-height: auto; }

    .hero-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-visual { display: none; }

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

    .battle-footer {
        flex-direction: column;
        gap: 14px;
        align-items: flex-start;
    }

    .battle-metrics {
        flex-wrap: wrap;
    }

    .arena-emoji { font-size: 24px; }
    .arena-name { font-size: 11px; }
    .arena-pct { font-size: 18px; }
    .clash-fire { font-size: 30px; }

    .how-section, .proof-section {
        padding: 56px 0;
    }

    .cta-section { padding: 24px 0 80px; }

    .cta-card {
        flex-direction: column;
        padding: 48px 24px;
        text-align: center;
        align-items: center;
    }

    .cta-inner { align-items: center; }
    .cta-scribble { display: none; }

    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 32px; }
    .hero-sub { font-size: 16px; }

    .arena-circle-left { width: 130px; height: 130px; }
    .arena-circle-right { width: 100px; height: 100px; }
    .arena-fighter-left { margin-right: 0; }
    .arena-fighter-right { margin-left: 0; }
    .arena-clash { width: 28px; }
    .arena-emoji { font-size: 20px; }
    .arena-name { font-size: 10px; }
    .clash-fire { font-size: 24px; }
}
