/* ============================================
   IAPHub Landing Page — RevenueCat-Inspired
   ============================================ */

:root {
    --coral: #ea5e5b;
    --coral-hover: #d34a47;
    --coral-light: #fef2f2;
    --dark: #0f172a;
    --dark-soft: #1e293b;
    --text: #334155;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --bg: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-muted: #f1f5f9;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
    color: var(--dark);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Navbar ─────────────────────────────── */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
    transition: box-shadow 0.3s;
}

.navbar.scrolled {
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    transition: color 0.2s;
    position: relative;
}

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

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--coral);
    border-radius: 1px;
    transition: width 0.2s;
}

.nav-links a:hover::after { width: 100%; }

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

.nav-link-cta {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    transition: color 0.2s;
}

.nav-link-cta:hover { color: var(--coral); }

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

.mobile-menu-btn span {
    width: 22px;
    height: 2px;
    background: var(--dark);
    border-radius: 1px;
    transition: 0.2s;
}

/* ── Buttons ────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--coral);
    color: #fff;
    box-shadow: 0 1px 2px rgba(234,94,91,0.3);
}

.btn-primary:hover {
    background: var(--coral-hover);
    box-shadow: 0 4px 12px rgba(234,94,91,0.35);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--dark);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-subtle);
    border-color: #cbd5e1;
}

.btn-dark {
    background: var(--dark);
    color: #fff;
}

.btn-dark:hover {
    background: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15,23,42,0.25);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: 8px;
}

.full-width { width: 100%; }

/* ── Hero ───────────────────────────────── */
.hero {
    position: relative;
    padding: 80px 0 100px;
    overflow: hidden;
    background: linear-gradient(180deg, #fff 0%, var(--bg-subtle) 100%);
}

.hero-glow {
    position: absolute;
    top: -200px;
    right: -100px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(234,94,91,0.08) 0%, transparent 70%);
    pointer-events: none;
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--coral-light);
    color: var(--coral);
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 100px;
    margin-bottom: 24px;
}

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

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

.hero-title {
    font-size: 3.75rem;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.035em;
    margin-bottom: 24px;
}

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

.hero-subtitle {
    font-size: 1.18rem;
    color: var(--text-muted);
    max-width: 520px;
    margin-bottom: 32px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
}

.hero-trust {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    color: var(--text-muted);
}

.trust-avatars {
    display: flex;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    margin-right: -8px;
}

.hero-trust strong {
    color: var(--dark);
}

/* Hero Visual — Code Window */
.hero-visual {
    position: relative;
}

.code-window {
    background: var(--dark);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255,255,255,0.05);
    overflow: hidden;
    transform: perspective(1200px) rotateY(-4deg) rotateX(2deg);
    transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.code-window:hover {
    transform: perspective(1200px) rotateY(0deg) rotateX(0deg);
}

.code-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0,0,0,0.3);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.window-dots {
    display: flex;
    gap: 6px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #eab308; }
.dot.green { background: #22c55e; }

.code-filename {
    flex: 1;
    text-align: center;
    color: var(--text-light);
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
}

.code-header-spacer { width: 54px; }

.code-body {
    padding: 20px 24px;
    margin: 0;
    overflow-x: auto;
}

.code-body code {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #e2e8f0;
    line-height: 1.8;
}

.c-keyword { color: #c084fc; }
.c-string { color: #4ade80; }
.c-fn { color: #60a5fa; }
.c-comment { color: #64748b; font-style: italic; }

/* Floating Cards */
.floating-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    animation: float 6s ease-in-out infinite;
}

.card-mrr {
    top: -20px;
    right: -20px;
    animation-delay: 0s;
}

.card-subs {
    bottom: -10px;
    left: -30px;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.floating-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-card-icon.green { background: #dcfce7; color: #16a34a; }
.floating-card-icon.blue { background: #dbeafe; color: #2563eb; }

.floating-card-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.floating-card-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--dark);
}

/* ── Logos Strip ─────────────────────────── */
.logos-strip {
    padding: 40px 0;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg);
}

.logos-label {
    text-align: center;
    text-transform: uppercase;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-light);
    margin-bottom: 24px;
}

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

.logo-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.logo-item:hover { color: var(--dark); }

.logo-item svg { opacity: 0.5; transition: opacity 0.2s; }
.logo-item:hover svg { opacity: 0.8; }

/* ── Metrics Bar ─────────────────────────── */
.metrics-bar {
    padding: 48px 0;
    background: var(--dark);
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
    align-items: center;
    gap: 0;
}

.metric {
    text-align: center;
    padding: 8px 0;
}

.metric-number {
    font-size: 2.25rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.03em;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 4px;
    font-weight: 500;
}

.metric-divider {
    width: 1px;
    height: 48px;
    background: rgba(255,255,255,0.1);
}

/* ── Section Headers ─────────────────────── */
.section-header {
    text-align: center;
    max-width: 620px;
    margin: 0 auto 56px;
}

.section-tag {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--coral);
    margin-bottom: 16px;
}

.section-title {
    font-size: 2.75rem;
    margin-bottom: 16px;
}

.section-title.left,
.section-desc.left {
    text-align: left;
}

.section-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ── Core Pillars ────────────────────────── */
.pillars {
    padding: 96px 0;
    background: var(--bg);
}

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

.pillar-card {
    padding: 32px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.pillar-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.pillar-icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.pillar-icon-wrap.coral { background: #fee2e2; color: #ef4444; }
.pillar-icon-wrap.amber { background: #fef3c7; color: #f59e0b; }
.pillar-icon-wrap.blue { background: #dbeafe; color: #3b82f6; }

.pillar-card h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.pillar-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.7;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--coral);
    transition: gap 0.2s;
}

.card-link:hover { gap: 10px; }

/* ── How It Works ────────────────────────── */
.how-it-works {
    padding: 96px 0;
    background: var(--bg-subtle);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.steps-grid {
    display: flex;
    align-items: flex-start;
    gap: 0;
    justify-content: center;
}

.step-card {
    flex: 1;
    max-width: 320px;
    text-align: center;
    padding: 32px 24px;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--coral);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.step-card h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
}

.step-card p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.step-connector {
    width: 64px;
    height: 2px;
    background: var(--border);
    margin-top: 55px;
    flex-shrink: 0;
    position: relative;
}

.step-connector::after {
    content: '';
    position: absolute;
    right: -3px;
    top: -3px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--border);
    border-top: 2px solid var(--border);
    transform: rotate(45deg);
}

/* ── Integrations ────────────────────────── */
.integrations {
    padding: 96px 0;
    background: var(--bg);
}

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

.integrations-text .section-title {
    font-size: 2.5rem;
}

.check-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
}

.check-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--dark);
    font-size: 0.95rem;
}

.check-list li::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--coral-light);
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 6L5 8.5L9.5 4' stroke='%23ea5e5b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
}

.integrations-visual {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.int-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

.int-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.int-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── CTA Section ─────────────────────────── */
.cta-section {
    position: relative;
    padding: 96px 0;
    background: var(--dark);
    overflow: hidden;
}

.cta-bg-pattern {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(ellipse 600px 400px at 20% 50%, rgba(234,94,91,0.15), transparent),
        radial-gradient(ellipse 400px 300px at 80% 50%, rgba(99,102,241,0.1), transparent);
    pointer-events: none;
}

.cta-grid {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.cta-content h2 {
    color: #fff;
    font-size: 3rem;
    margin-bottom: 16px;
}

.cta-content p {
    color: var(--text-light);
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 32px;
}

.cta-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cta-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
    font-size: 0.95rem;
    font-weight: 500;
}

.cta-form-wrap {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-xl);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--dark);
    transition: all 0.2s;
    background: var(--bg);
}

.form-group input::placeholder { color: var(--text-light); }

.form-group input:focus {
    outline: none;
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(234,94,91,0.15);
}

.form-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    padding: 24px 0;
}

.form-success h3 {
    font-size: 1.3rem;
}

.form-success p {
    color: var(--text-muted);
}

/* ── Footer ──────────────────────────────── */
.footer {
    background: var(--bg);
    border-top: 1px solid var(--border-light);
    padding: 64px 0 0;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 64px;
    padding-bottom: 48px;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 16px;
    max-width: 280px;
    line-height: 1.6;
}

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

.footer-col h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-light);
    margin-bottom: 20px;
}

.footer-col a {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 12px;
    transition: color 0.2s;
}

.footer-col a:hover { color: var(--coral); }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-light);
    padding: 24px 0;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: var(--text-light);
}

.footer-legal {
    display: flex;
    gap: 24px;
}

.footer-legal a {
    font-size: 0.85rem;
    color: var(--text-light);
    transition: color 0.2s;
}

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

/* ── Animations ──────────────────────────── */
.fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1),
                transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

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

/* ── Responsive ──────────────────────────── */
@media (max-width: 1024px) {
    .hero-grid,
    .integrations-grid,
    .cta-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .hero-title { font-size: 3rem; }
    .hero-visual { margin-top: 16px; }
    .section-title { font-size: 2.25rem; }
    .cta-content h2 { font-size: 2.5rem; }

    .footer-top {
        flex-direction: column;
        gap: 40px;
    }

    .metrics-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
    .metric-divider { display: none; }
}

@media (max-width: 768px) {
    .nav-links,
    .nav-actions { display: none; }

    .mobile-menu-btn { display: flex; }

    .hero { padding: 56px 0 72px; }
    .hero-title { font-size: 2.25rem; }
    .hero-subtitle { font-size: 1rem; }
    .hero-actions { flex-direction: column; }

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

    .steps-grid {
        flex-direction: column;
        align-items: center;
    }
    .step-connector {
        width: 2px;
        height: 40px;
        margin: 0;
    }
    .step-connector::after {
        right: -3px;
        top: auto;
        bottom: -3px;
        transform: rotate(135deg);
    }

    .integrations-visual { grid-template-columns: repeat(2, 1fr); }
    .check-list { grid-template-columns: 1fr; }

    .footer-links { flex-direction: column; gap: 32px; }
    .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }

    .floating-card { display: none; }

    .section-title.left,
    .section-desc.left { text-align: center; }

    .logos-row { gap: 24px; }

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

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .hero-title { font-size: 2rem; }
    .metrics-grid { grid-template-columns: 1fr; }
    .integrations-visual { grid-template-columns: 1fr 1fr; }
}
