/* ============================================
   BrainWik: Polish layer (loaded after app.css, shared by every page)
   ============================================ */

/* Calmer, more premium background */
.gradient-blob { opacity: 0.18; filter: blur(120px); }
.blob3 { opacity: 0.1; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* ---------- Page hero: grid + glow backdrop ---------- */
.hero {
    padding: 96px 0 72px;
    overflow: hidden;
    isolation: isolate;
}
.hero::before {
    content: "";
    position: absolute; inset: 0; z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 30%, transparent 75%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black 30%, transparent 75%);
}
.hero::after {
    content: "";
    position: absolute; z-index: -1;
    top: -180px; left: 50%; transform: translateX(-50%);
    width: 720px; height: 420px; max-width: 100%;
    background: radial-gradient(closest-side, rgba(139, 92, 246, 0.35), transparent);
    pointer-events: none;
}
.hero h1 { font-size: clamp(2.3rem, 5.6vw, 4.2rem); letter-spacing: -0.035em; }
.hero h1.gradient-text { padding-bottom: 0.05em; }
.section-title { letter-spacing: -0.03em; }
.section-subtitle { font-size: 1.1rem; line-height: 1.65; }

/* ---------- Cards: subtler, crisper ---------- */
.card, .testimonial, .article-card, .pricing-card, .team-card, .process-step, .demo-card, .faq-item, .case-metric, .contact-form {
    background: linear-gradient(180deg, rgba(26, 32, 46, 0.78), rgba(18, 22, 33, 0.78));
    border-color: rgba(255, 255, 255, 0.07);
}
.card { border-radius: 22px; padding: 28px; }
.card:hover { transform: translateY(-4px); }

/* ---------- Split hero (home) ---------- */
.hero-split { text-align: left; }
.hero-split .hero-grid {
    display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center;
}
.hero-split h1 { margin-bottom: 20px; }
.hero-split p.lead { margin: 0 0 32px; max-width: 560px; }
.hero-split .hero-cta-row { justify-content: flex-start; }
.hero-trust { display: flex; align-items: center; gap: 14px; margin-top: 28px; color: var(--text-mute); font-size: 0.88rem; flex-wrap: wrap; }
.hero-trust .avatars { display: flex; }
.hero-trust .avatars span {
    width: 34px; height: 34px; border-radius: 50%;
    border: 2px solid var(--bg); margin-left: -8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700; color: white;
    background: var(--gradient-primary);
}
.hero-trust .avatars span:first-child { margin-left: 0; }
.hero-trust .avatars span:nth-child(2) { background: var(--gradient-warm); }
.hero-trust .avatars span:nth-child(3) { background: var(--gradient-cool); }
.hero-trust .stars { color: #fbbf24; letter-spacing: 1px; }

.preview-chat {
    border-radius: 24px; overflow: hidden;
    background: #0f131b;
    border: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(139, 92, 246, 0.12);
    animation: fadeUp 0.9s 0.2s ease backwards;
}
.preview-chat-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.preview-chat-head .who { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 0.92rem; }
.preview-chat-head .who i {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--gradient-primary); font-size: 0.8rem;
}
.preview-chat-head small { color: var(--text-mute); font-size: 0.75rem; display: flex; align-items: center; gap: 6px; }
.preview-chat-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.pc-msg { max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 0.88rem; line-height: 1.5; opacity: 0; animation: pcIn 0.4s ease forwards; }
.pc-msg:nth-child(1) { animation-delay: 0.6s; }
.pc-msg:nth-child(2) { animation-delay: 1.4s; }
.pc-handoff { animation-delay: 2.2s !important; }
.pc-msg:nth-child(4) { animation-delay: 3s; }
@keyframes pcIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pc-msg.user { align-self: flex-end; background: #2b5be7; border-bottom-right-radius: 5px; }
.pc-msg.ai { align-self: flex-start; background: #1d2330; color: #e6ecf5; border-bottom-left-radius: 5px; }
.pc-msg.human { align-self: flex-start; background: rgba(249, 115, 22, 0.14); border: 1px solid rgba(249, 115, 22, 0.3); color: #fde6d4; border-bottom-left-radius: 5px; }
.pc-msg small { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.65; margin-bottom: 2px; font-weight: 600; }
.pc-handoff { align-self: center; max-width: 100%; padding: 2px 0; font-size: 0.75rem; color: #fb923c; display: flex; align-items: center; gap: 6px; }
.preview-chat-foot {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 12px 18px; border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02); font-size: 0.82rem; color: var(--text-mute);
}
.preview-chat-foot a { color: #c084fc; font-weight: 600; white-space: nowrap; }

/* ---------- Logo strip ---------- */
.logo-strip { padding: 8px 0 24px; text-align: center; }
.logo-strip p { color: var(--text-mute); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 20px; }
.logo-strip .logos { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 18px 44px; }
.logo-strip .logos span { font-weight: 800; font-size: 1.15rem; color: rgba(255, 255, 255, 0.38); letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }

/* ---------- Integration tiles ---------- */
.integration-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 14px; }
.integration-tile {
    padding: 20px 10px; border-radius: 18px; text-align: center;
    background: rgba(22, 28, 40, 0.7); border: 1px solid var(--border-soft);
    transition: transform 0.2s, border-color 0.2s;
}
.integration-tile:hover { transform: translateY(-3px); border-color: rgba(139, 92, 246, 0.35); }
.integration-tile i { font-size: 1.8rem; color: var(--brand, white); }
.integration-tile span { display: block; margin-top: 8px; font-size: 0.82rem; color: var(--text-soft); }

/* ---------- Reusable blocks (replace inline styles) ---------- */
.stat-tile { padding: 22px; }
.stat-tile .label { color: var(--text-mute); font-size: 0.85rem; }
.stat-tile .value { font-size: 2rem; font-weight: 800; line-height: 1.2; }
.stat-tile .delta { color: #34d399; font-size: 0.85rem; }
.bar { height: 8px; background: rgba(255, 255, 255, 0.06); border-radius: 60px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 60px; background: var(--gradient-primary); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.icon-list { list-style: none; display: grid; gap: 14px; }
.icon-list li { display: flex; gap: 14px; align-items: flex-start; color: var(--text-soft); }
.icon-list li > i {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(139, 92, 246, 0.14); color: #c084fc;
}
.icon-list strong { display: block; color: white; margin-bottom: 2px; }
.avatar.warm { background: var(--gradient-warm); }
.avatar.cool { background: var(--gradient-cool); }
.avatar.violet { background: linear-gradient(135deg, #8b5cf6, #ec4899); }
.chip.pink { background: rgba(236, 72, 153, 0.12); border-color: rgba(236, 72, 153, 0.3); color: #f472b6; }
.chip.cyan { background: rgba(6, 182, 212, 0.12); border-color: rgba(6, 182, 212, 0.3); color: #22d3ee; }
.chip.orange { background: rgba(249, 115, 22, 0.12); border-color: rgba(249, 115, 22, 0.3); color: #fb923c; }

/* ---------- Accessibility ---------- */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid #a78bfa; outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
    .reveal, .reveal-left, .reveal-right, .reveal-scale, .stagger > * { opacity: 1 !important; transform: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .hero-split .hero-grid, .split { grid-template-columns: 1fr; gap: 40px; }
    .hero-split { text-align: center; }
    .hero-split p.lead { margin: 0 auto 28px; }
    .hero-split .hero-cta-row, .hero-trust { justify-content: center; }
    .preview-chat { max-width: 520px; margin: 0 auto; text-align: left; }
    .integration-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .hero { padding: 56px 0 44px; }
    .hero p.lead { margin-bottom: 28px; }
    .hero .hero-cta-row, .cta-banner .btn-row { flex-direction: column; align-items: stretch; }
    .hero .hero-cta-row .btn, .cta-banner .btn-row .btn { width: 100%; }
    .section { padding: 64px 0; }
    .section-sm { padding: 40px 0; }
    .section-header { margin-bottom: 36px; }
    .section-subtitle { font-size: 1rem; }
    .btn-lg { padding: 15px 28px; font-size: 1rem; }
    .card, .testimonial { padding: 22px; border-radius: 20px; }
    .glass { border-radius: 22px; }
    .stats-row { padding: 26px 18px; gap: 22px; border-radius: 22px; }
    .cta-banner { border-radius: 24px; }
    .integration-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .logo-strip .logos { gap: 14px 26px; }
    .logo-strip .logos span { font-size: 1rem; }
    .gradient-blob { width: 90vmax; height: 90vmax; opacity: 0.14; }
    .article-cover { height: 220px; font-size: 3.5rem; border-radius: 20px; }
    .health-check h2 { font-size: 1.4rem; }
    .health-form .btn { width: 100%; }
}

/* ---------- Reviews ---------- */
.rating-summary { padding: 44px; display: grid; grid-template-columns: 1fr 2fr; gap: 48px; align-items: center; }
.rating-score { text-align: center; }
.rating-score > div:first-child { font-size: 4.6rem; font-weight: 800; line-height: 1; }
.rating-score .stars { color: #fbbf24; font-size: 1.2rem; letter-spacing: 4px; margin: 12px 0 6px; }
.rating-score span { color: var(--text-mute); font-size: 0.9rem; }
.rating-rows { display: grid; gap: 12px; }
.rating-row { display: grid; grid-template-columns: 44px 1fr 44px; gap: 12px; align-items: center; font-size: 0.88rem; color: var(--text-soft); }
.rating-row i { color: #fbbf24; font-size: 0.75rem; }
.rating-row span:last-child { color: var(--text-mute); text-align: right; }
.bar-fill.green { background: linear-gradient(90deg, #10b981, #34d399); }
.bar-fill.blue { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.bar-fill.amber { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-fill.orange { background: linear-gradient(90deg, #f97316, #fb923c); }
.bar-fill.red { background: #ef4444; }
.testimonial-masonry { columns: 3; column-gap: 24px; }
.testimonial-masonry .testimonial { break-inside: avoid; margin-bottom: 24px; display: inline-block; width: 100%; }
@media (max-width: 960px) { .testimonial-masonry { columns: 2; } }
@media (max-width: 640px) {
    .testimonial-masonry { columns: 1; }
    .rating-summary { grid-template-columns: 1fr; gap: 28px; padding: 28px 20px; }
}

/* ---------- Contact ---------- */
.contact-layout { display: grid; grid-template-columns: 1.35fr 1fr; gap: 32px; align-items: start; }
.contact-form .form-title { font-size: 1.6rem; margin-bottom: 6px; }
.contact-form .form-sub { color: var(--text-soft); margin-bottom: 24px; font-size: 0.95rem; }
.btn-block { width: 100%; }
.contact-info .card { padding: 22px 24px; }
.contact-info-title { font-size: 1.25rem; margin-bottom: 8px; }
.contact-info-item { display: flex; align-items: flex-start; gap: 14px; padding: 16px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.contact-info-item:last-child { border-bottom: 0; padding-bottom: 0; }
.contact-info .card-icon { width: 40px; height: 40px; flex: 0 0 40px; font-size: 1rem; border-radius: 12px; margin: 0; }
.contact-info h3 { font-size: 1rem; margin: 0 0 4px; }
.contact-info .contact-info-detail { color: var(--text-soft); font-size: 0.92rem; margin: 0; }
.info-label { color: var(--text-soft); margin: 10px 0 2px; font-size: 0.88rem; }
.info-label:first-of-type { margin-top: 0; }
.info-link { color: #c084fc; font-weight: 600; }
.info-link:hover { color: #e9d5ff; }
@media (max-width: 960px) { .contact-layout { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .contact-form { padding: 24px 18px; border-radius: 22px; } }

/* ---------- Article / case study ---------- */
.case-title { font-size: clamp(1.8rem, 3.5vw, 2.8rem); margin-top: 4px; }
.article-hero h1 { letter-spacing: -0.03em; }

/* ---------- About ---------- */
.story-p { color: var(--text-soft); margin-bottom: 16px; line-height: 1.75; }
.about-stats { padding: 32px; }
.about-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 24px; }
.about-stats .stat-value { font-size: 2.4rem; font-weight: 800; line-height: 1.1; }
.about-stats .stat-label { color: var(--text-mute); font-size: 0.9rem; }
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; position: relative; }
.timeline .card { padding-top: 22px; }
.timeline-year {
    display: inline-block; padding: 4px 14px; border-radius: 60px; margin-bottom: 14px;
    font-weight: 800; font-size: 1.05rem; color: var(--c);
    background: #12161f; border: 1px solid var(--c); position: relative;
}
.timeline p { color: var(--text-soft); font-size: 0.92rem; }
@media (max-width: 960px) { .timeline { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .timeline { grid-template-columns: 1fr; } .about-stats .stat-value { font-size: 2rem; } }

/* ---------- Blog ---------- */
.featured-post { padding: 0; overflow: hidden; max-width: 1100px; margin: 0 auto; min-width: 0; }
.featured-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.featured-thumb { height: auto; min-height: 0; width: 100%; align-self: start; }
.featured-body { padding: 48px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.featured-chip { align-self: flex-start; }
.featured-title { font-size: 1.9rem; margin: 14px 0 12px; line-height: 1.25; overflow-wrap: normal; }
.featured-body > p { overflow-wrap: normal; }
#blog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filter-chip { cursor: pointer; transition: border-color 0.2s, color 0.2s; }
.filter-chip:hover { color: white; border-color: rgba(139, 92, 246, 0.5); }
.case-quote { padding: 56px; text-align: center; max-width: 900px; margin: 0 auto; }
.case-quote-text { font-size: 1.35rem; line-height: 1.6; font-style: italic; color: var(--text); margin-bottom: 24px; }
@media (max-width: 760px) {
    .featured-grid { grid-template-columns: 1fr; }
    .featured-thumb { min-height: 0; }
    .featured-body { padding: 26px 20px; }
    .featured-title { font-size: 1.45rem; }
    .case-quote { padding: 32px 20px; }
    .case-quote-text { font-size: 1.1rem; }
}
@media (max-width: 950px) {
    #blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    #blog-grid { grid-template-columns: minmax(0, 1fr); }
    .featured-body { padding: 24px 18px; }
    .article-hero { padding: 44px 16px 24px; }
    .article-cover { height: auto; max-height: none; margin: 28px auto; border-radius: 20px; }
}

/* ============================================
   Core Web Vitals
   ============================================ */

/* LCP: hero text must be visible on the very first frame.
   app.css animated it from opacity 0 (fadeUp), which delays the LCP paint.
   Transform-only entrance keeps the motion without hiding the content. */
@keyframes heroRise { from { transform: translateY(14px); } to { transform: none; } }
.hero h1, .hero p.lead, .hero .hero-cta-row, .hero-badge,
.wf-window, .preview-chat, .ph-facts {
    opacity: 1;
    animation: heroRise 0.6s ease both;
}

/* Phones & reduced motion: the three huge blurred, animated background blobs are
   expensive to paint and composite. Keep them static and lighter. */
@media (max-width: 760px), (prefers-reduced-motion: reduce) {
    .gradient-blob { animation: none; will-change: auto; filter: blur(70px); }
}
