/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --bg: #07070c;
    --bg-soft: #0e0e16;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-strong: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #f5f5fa;
    --text-dim: #a4a4b8;
    --text-faint: #6b6b80;
    --accent: #7c5cff;
    --accent-2: #20d4ff;
    --accent-3: #ff5cb3;
    --gradient: linear-gradient(135deg, #7c5cff 0%, #20d4ff 100%);
    --gradient-warm: linear-gradient(135deg, #ff5cb3 0%, #ffa35c 100%);
    --radius: 14px;
    --radius-lg: 22px;
    --shadow-glow: 0 0 80px rgba(124, 92, 255, 0.25);
    --easing: cubic-bezier(.2, .8, .2, 1);
}

html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img, svg { display: block; max-width: 100%; }

/* ---------- Background — animated aurora ---------- */
.aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.aurora::before, .aurora::after {
    content: "";
    position: absolute;
    width: 60vmax;
    height: 60vmax;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    animation: drift 24s var(--easing) infinite;
}
.aurora::before {
    background: radial-gradient(circle, #7c5cff 0%, transparent 70%);
    top: -20vmax;
    left: -20vmax;
}
.aurora::after {
    background: radial-gradient(circle, #20d4ff 0%, transparent 70%);
    bottom: -20vmax;
    right: -20vmax;
    animation-delay: -12s;
}
@keyframes drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(8vmax, -6vmax) scale(1.1); }
    66% { transform: translate(-6vmax, 4vmax) scale(0.95); }
}

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    background: rgba(7, 7, 12, 0.6);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--border); }
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.brand-mark {
    width: 44px; height: 44px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}
.nav {
    display: flex;
    align-items: center;
    gap: 32px;
}
.nav a {
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}
.nav a:hover, .nav a.active { color: var(--text); }
.nav-cta {
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--surface-strong);
    border: 1px solid var(--border);
    color: var(--text) !important;
    font-size: 13px !important;
    transition: all 0.2s;
}
.nav-cta:hover { background: var(--surface); border-color: var(--border-strong); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.25s var(--easing);
    will-change: transform;
}
.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 4px 24px rgba(124, 92, 255, 0.4);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(124, 92, 255, 0.55);
}
.btn-ghost {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-ghost:hover {
    background: var(--surface-strong);
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: 96px 0 64px;
    overflow: hidden;
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 64px;
    align-items: center;
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 24px;
}
.hero-eyebrow .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 10px #4ade80;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.hero h1 {
    font-size: clamp(40px, 6vw, 72px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 700;
    margin-bottom: 24px;
}
.hero h1 .gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    display: inline-block;
}
.hero p.lede {
    font-size: 19px;
    color: var(--text-dim);
    margin-bottom: 36px;
    max-width: 540px;
    line-height: 1.55;
}
.hero-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.hero-meta {
    margin-top: 32px;
    display: flex;
    gap: 24px;
    color: var(--text-faint);
    font-size: 13px;
    flex-wrap: wrap;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Phone mockup ---------- */
.phone {
    position: relative;
    width: 320px;
    height: 660px;
    margin: 0 auto;
    border-radius: 48px;
    background: linear-gradient(160deg, #1a1a2e 0%, #0a0a14 100%);
    padding: 14px;
    box-shadow:
        0 0 0 2px rgba(255,255,255,0.06),
        0 30px 90px rgba(0, 0, 0, 0.5),
        var(--shadow-glow);
    transform: perspective(1200px) rotateY(-8deg) rotateX(4deg);
    transition: transform 0.6s var(--easing);
}
.phone:hover { transform: perspective(1200px) rotateY(-4deg) rotateX(2deg); }
.phone::before {
    content: "";
    position: absolute;
    top: 18px; left: 50%;
    transform: translateX(-50%);
    width: 100px; height: 28px;
    background: #000;
    border-radius: 20px;
    z-index: 2;
}
.phone-screen {
    width: 100%;
    height: 100%;
    border-radius: 36px;
    background: var(--bg-soft);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}
.phone-statusbar {
    height: 44px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 28px;
    font-size: 13px;
    font-weight: 600;
}
.phone-content {
    flex: 1;
    padding: 12px 18px 18px;
    overflow: hidden;
    position: relative;
}
.chat-bubble {
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 13.5px;
    line-height: 1.45;
    max-width: 86%;
    opacity: 0;
    transform: translateY(8px);
    animation: bubbleIn 0.5s var(--easing) forwards;
}
.chat-bubble.user {
    background: var(--gradient);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}
.chat-bubble.bot {
    background: var(--surface-strong);
    color: var(--text);
    border-bottom-left-radius: 4px;
}
.chat-bubble.status {
    background: transparent;
    color: var(--text-dim);
    font-size: 12px;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.chat-bubble.status .spinner {
    width: 10px; height: 10px;
    border: 1.5px solid var(--text-faint);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.chat-bubble:nth-child(1) { animation-delay: 0.3s; }
.chat-bubble:nth-child(2) { animation-delay: 1.4s; }
.chat-bubble:nth-child(3) { animation-delay: 2.4s; }
.chat-bubble:nth-child(4) { animation-delay: 3.4s; }
.chat-bubble:nth-child(5) { animation-delay: 4.4s; }
@keyframes bubbleIn {
    to { opacity: 1; transform: translateY(0); }
}
.install-pill {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.15), rgba(32, 212, 255, 0.15));
    border: 1px solid rgba(74, 222, 128, 0.4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12.5px;
    opacity: 0;
    animation: bubbleIn 0.5s var(--easing) 5.4s forwards;
}
.install-pill .label { color: #4ade80; font-weight: 600; }
.install-pill .install-btn {
    padding: 5px 12px;
    background: white;
    color: black;
    border-radius: 999px;
    font-weight: 600;
    font-size: 11.5px;
}

/* ---------- Sections ---------- */
section.section {
    padding: 96px 0;
    position: relative;
}
.section-header {
    max-width: 720px;
    margin: 0 auto 64px;
    text-align: center;
}
.section-eyebrow {
    color: var(--accent-2);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.section-header h2 {
    font-size: clamp(32px, 4vw, 48px);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 16px;
}
.section-header p {
    color: var(--text-dim);
    font-size: 17px;
}

/* ---------- Feature grid ---------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.feature-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: all 0.4s var(--easing);
    position: relative;
    overflow: hidden;
}
.feature-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: var(--gradient);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s;
}
.feature-card:hover {
    transform: translateY(-4px);
    background: var(--surface-strong);
}
.feature-card:hover::before { opacity: 0.6; }
.feature-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    box-shadow: 0 6px 20px rgba(124, 92, 255, 0.3);
}
.feature-icon svg { width: 22px; height: 22px; color: white; }
.feature-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}
.feature-card p {
    color: var(--text-dim);
    font-size: 14.5px;
    line-height: 1.55;
}

/* ---------- Step row ---------- */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    counter-reset: step;
}
.step {
    padding: 32px 28px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    position: relative;
    counter-increment: step;
}
.step::before {
    content: counter(step, decimal-leading-zero);
    position: absolute;
    top: 24px; right: 28px;
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.4;
    letter-spacing: -0.03em;
}
.step h3 {
    font-size: 20px;
    margin: 8px 0 12px;
    letter-spacing: -0.01em;
}
.step p { color: var(--text-dim); font-size: 14.5px; }

/* ---------- Pipeline animation ---------- */
.pipeline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 32px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    margin-top: 48px;
    flex-wrap: wrap;
    gap: 12px;
}
.pipeline-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 110px;
    text-align: center;
}
.pipeline-dot {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s;
}
.pipeline-dot svg { width: 16px; height: 16px; color: var(--text-faint); }
.pipeline-arrow {
    flex: 0 0 24px;
    height: 2px;
    background: var(--border-strong);
    position: relative;
    overflow: hidden;
}
.pipeline-arrow::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: left;
    animation: pipelineFill 4s var(--easing) infinite;
}
.pipeline-stage:nth-child(1) .pipeline-dot { animation: pipelineDot 4s var(--easing) infinite 0s; }
.pipeline-arrow:nth-child(2)::after { animation-delay: 0.4s; }
.pipeline-stage:nth-child(3) .pipeline-dot { animation: pipelineDot 4s var(--easing) infinite 0.8s; }
.pipeline-arrow:nth-child(4)::after { animation-delay: 1.2s; }
.pipeline-stage:nth-child(5) .pipeline-dot { animation: pipelineDot 4s var(--easing) infinite 1.6s; }
.pipeline-arrow:nth-child(6)::after { animation-delay: 2s; }
.pipeline-stage:nth-child(7) .pipeline-dot { animation: pipelineDot 4s var(--easing) infinite 2.4s; }
@keyframes pipelineDot {
    0%, 30% { border-color: var(--border-strong); background: transparent; transform: scale(1); }
    20% { border-color: var(--accent); background: var(--accent); transform: scale(1.15); box-shadow: 0 0 24px var(--accent); }
    100% { border-color: var(--accent); background: var(--accent); transform: scale(1); box-shadow: 0 0 12px rgba(124, 92, 255, 0.4); }
}
@keyframes pipelineFill {
    0%, 30% { transform: scaleX(0); }
    50%, 100% { transform: scaleX(1); }
}
.pipeline-label {
    font-size: 12.5px;
    color: var(--text-dim);
    font-weight: 500;
}

/* ---------- CTA section ---------- */
.cta {
    padding: 80px 48px;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 30% 20%, rgba(124, 92, 255, 0.25), transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(32, 212, 255, 0.2), transparent 50%),
        var(--surface);
    border: 1px solid var(--border-strong);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta h2 {
    font-size: clamp(28px, 4vw, 44px);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}
.cta p {
    color: var(--text-dim);
    font-size: 17px;
    margin-bottom: 32px;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}
.cta-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    color: var(--text-faint);
    font-size: 13.5px;
}
.site-footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.footer-links {
    display: flex;
    gap: 24px;
}
.footer-links a:hover { color: var(--text); }

/* ---------- Reveal on scroll ---------- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--easing), transform 0.8s var(--easing);
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* ---------- Q/A page ---------- */
.qa-hero {
    padding: 80px 0 48px;
    text-align: center;
}
.qa-hero h1 {
    font-size: clamp(36px, 5vw, 56px);
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}
.qa-hero p {
    color: var(--text-dim);
    font-size: 18px;
    max-width: 560px;
    margin: 0 auto;
}
.qa-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 56px;
    padding-bottom: 96px;
}
.qa-toc {
    position: sticky;
    top: 88px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}
.qa-toc h4 {
    font-size: 12px;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 14px;
}
.qa-toc ul { list-style: none; }
.qa-toc li { margin-bottom: 6px; }
.qa-toc a {
    display: block;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-dim);
    border-left: 2px solid transparent;
    transition: all 0.2s;
}
.qa-toc a:hover, .qa-toc a.active {
    color: var(--text);
    background: var(--surface);
    border-left-color: var(--accent);
}
.qa-content h2 {
    font-size: 28px;
    margin: 40px 0 24px;
    letter-spacing: -0.01em;
    scroll-margin-top: 88px;
}
.qa-content h2:first-child { margin-top: 0; }
.qa-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    background: var(--surface);
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
}
.qa-item:hover { border-color: var(--border-strong); }
.qa-item summary {
    padding: 18px 22px;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-weight: 500;
    font-size: 16px;
    transition: background 0.2s;
}
.qa-item summary::-webkit-details-marker { display: none; }
.qa-item summary:hover { background: var(--surface-strong); }
.qa-item summary::after {
    content: "";
    width: 10px; height: 10px;
    border-right: 2px solid var(--text-dim);
    border-bottom: 2px solid var(--text-dim);
    transform: rotate(45deg);
    transition: transform 0.3s var(--easing);
    flex-shrink: 0;
}
.qa-item[open] summary::after { transform: rotate(-135deg); }
.qa-answer {
    padding: 0 22px 22px;
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.65;
    animation: qaSlide 0.35s var(--easing);
}
@keyframes qaSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.qa-answer p { margin-bottom: 12px; }
.qa-answer p:last-child { margin-bottom: 0; }
.qa-answer ol, .qa-answer ul {
    margin: 8px 0 12px 20px;
}
.qa-answer li { margin-bottom: 6px; }
.qa-answer code {
    font-family: "SF Mono", Menlo, monospace;
    font-size: 13px;
    background: rgba(124, 92, 255, 0.12);
    color: var(--accent-2);
    padding: 1px 6px;
    border-radius: 4px;
}
.qa-answer strong { color: var(--text); font-weight: 600; }
.qa-answer a { color: var(--accent-2); border-bottom: 1px dashed var(--accent-2); }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
    .hero { padding: 64px 0 32px; }
    .hero-grid { grid-template-columns: 1fr; gap: 48px; }
    .phone { transform: none; }
    .steps { grid-template-columns: 1fr; }
    .qa-layout { grid-template-columns: 1fr; gap: 24px; }
    .qa-toc { position: static; max-height: none; }
    .pipeline { flex-direction: column; }
    .pipeline-arrow { width: 2px; height: 24px; }
}
@media (max-width: 640px) {
    .nav { gap: 16px; }
    .nav a:not(.nav-cta) { display: none; }
    section.section { padding: 64px 0; }
    .cta { padding: 48px 24px; }
    .site-footer .container { flex-direction: column; text-align: center; }
}

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