:root {
    --bg: #f6f3ee;
    --bg-2: #fffdf9;
    --elev: #ffffff;
    --card: #ffffff;
    --card-hover: #fffdf9;
    --line: #e7e1d6;
    --text: #171412;
    --muted: #6d6760;
    --accent: #e24e2f;
    --accent-2: #c43d22;
    --accent-soft: rgba(226, 78, 47, 0.1);
    --ink: #171412;
    --danger: #c23b3b;
    --ok: #1f8a5b;
    --shadow: 0 18px 50px rgba(40, 28, 18, 0.08);
    --radius: 20px;
    --header: 72px;
    --font: "Plus Jakarta Sans", system-ui, sans-serif;
    --display: "Instrument Serif", Georgia, serif;
}

html[data-theme="dark"] {
    --bg: #12110f;
    --bg-2: #1a1815;
    --elev: #211e1a;
    --card: #1d1b18;
    --card-hover: #24211c;
    --line: #322e28;
    --text: #f4efe8;
    --muted: #a59d93;
    --accent: #ff6a4a;
    --accent-2: #e24e2f;
    --accent-soft: rgba(255, 106, 74, 0.14);
    --ink: #f4efe8;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.65;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; }
button, input, textarea, select { font-family: inherit; }

.noise {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.orb {
    position: fixed;
    z-index: 0;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(110px);
    pointer-events: none;
    opacity: 0.28;
}
.orb-a { top: -160px; right: -40px; background: #f3c4b4; }
.orb-b { top: 180px; left: -180px; background: #ead9c4; opacity: 0.4; }
html[data-theme="dark"] .orb-a { background: #5a2a1c; }
html[data-theme="dark"] .orb-b { background: #3a3228; }

.container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header);
    backdrop-filter: blur(18px);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    border-bottom: 1px solid transparent;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-inner {
    height: var(--header);
    display: flex;
    align-items: center;
    gap: 28px;
}

.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); }
.logo:hover { color: var(--text); }
.logo-text { font-family: var(--font); letter-spacing: -0.04em; font-size: 1.12rem; }
.logo-text em { font-style: normal; color: var(--accent); font-weight: 700; }
.logo-mark { display: grid; place-items: center; }

.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 550;
}
.nav a:hover, .nav a.is-active { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.theme-btn, .menu-btn {
    background: var(--elev);
    border: 1px solid var(--line);
    color: var(--text);
    width: 40px; height: 40px;
    border-radius: 12px;
    cursor: pointer;
}
.theme-btn { display: grid; place-items: center; }
html[data-theme="dark"] .theme-moon,
html:not([data-theme="dark"]) .theme-sun { display: none; }
.menu-btn { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.menu-btn span { display: block; width: 16px; height: 2px; background: var(--text); border-radius: 2px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 11px 18px;
    font-weight: 650;
    font-size: 0.92rem;
    cursor: pointer;
    transition: transform .15s, background .15s, border-color .15s, box-shadow .15s, color .15s;
    color: inherit;
}
.btn:hover { transform: translateY(-1px); color: inherit; }
.btn-primary {
    background: var(--ink);
    color: var(--bg);
    box-shadow: 0 8px 24px rgba(23, 20, 18, 0.16);
}
html[data-theme="dark"] .btn-primary {
    background: var(--accent);
    color: #1a100c;
}
.btn-ghost {
    background: transparent;
    border-color: var(--line);
    color: var(--text);
}
.btn-outline {
    background: var(--elev);
    border-color: var(--line);
    color: var(--text);
}
.btn-accent {
    background: var(--accent);
    color: #fff;
}
.btn-wide { width: 100%; }
.btn-lg { padding: 14px 22px; font-size: 1rem; }

.hero {
    padding: 64px 0 28px;
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 56px;
    align-items: center;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--elev);
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.pulse-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(226, 78, 47, 0.55);
    animation: pulse 1.8s infinite;
}
@keyframes pulse {
    70% { box-shadow: 0 0 0 10px rgba(226, 78, 47, 0); }
    100% { box-shadow: 0 0 0 0 rgba(226, 78, 47, 0); }
}

h1, h2, h3, .display {
    font-family: var(--display);
    letter-spacing: -0.03em;
    line-height: 1.12;
    margin: 0 0 16px;
    font-weight: 500;
}
h1 { font-size: clamp(2.7rem, 5.4vw, 4.6rem); }
h1 em { font-style: italic; font-weight: 500; }
h2 { font-size: clamp(1.9rem, 3.2vw, 3rem); }
h3 { font-size: 1.28rem; font-family: var(--font); letter-spacing: -0.03em; font-weight: 700; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 48ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 14px; }
.trust { color: var(--muted); font-size: 0.9rem; }

.hero-card {
    background: var(--elev);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 12px;
    box-shadow: var(--shadow);
}
.chat-window {
    background: var(--bg-2);
    border-radius: 16px;
    overflow: hidden;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
}
.chat-top {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    font-weight: 650;
    background: var(--elev);
}
.chat-top small { color: var(--muted); font-weight: 500; margin-left: auto; }
.chat-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.bubble {
    max-width: 86%;
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 0.92rem;
}
.bubble.bot { background: var(--elev); border: 1px solid var(--line); }
.bubble.me {
    margin-left: auto;
    background: var(--ink);
    color: var(--bg);
}
html[data-theme="dark"] .bubble.me {
    background: var(--accent);
    color: #1a100c;
}
.chat-input {
    display: flex; gap: 8px; padding: 12px;
    border-top: 1px solid var(--line);
    background: var(--elev);
}
.chat-input input, .field input, .field textarea, .field select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 14px;
    padding: 12px 14px;
    outline: none;
}
.chat-input input:focus, .field input:focus, .field textarea:focus, .field select:focus {
    border-color: var(--accent);
}

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 28px 0 8px;
}
.stat {
    background: var(--elev);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
}
.stat b { display: block; font-size: 1.35rem; font-family: var(--font); letter-spacing: -0.04em; }
.stat span { color: var(--muted); font-size: 0.82rem; }

.logos {
    display: flex; flex-wrap: wrap; gap: 10px 28px;
    align-items: center; justify-content: space-between;
    padding: 10px 0 40px;
    color: var(--muted);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.72rem;
}

section { padding: 72px 0; position: relative; z-index: 1; }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head p { color: var(--muted); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }

.card {
    background: var(--elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.icon-wrap {
    width: 44px; height: 44px; border-radius: 12px;
    display: grid; place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 14px;
}
.icon { width: 22px; height: 22px; }
.card p, .muted { color: var(--muted); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step-n {
    font-family: var(--display);
    font-size: 2rem;
    color: var(--accent);
}

.quote {
    background: var(--elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    margin: 0;
}
.quote p { font-size: 1.05rem; color: var(--text); }
.quote footer { margin-top: 16px; color: var(--muted); font-size: 0.9rem; }
.quote strong { color: var(--text); }

.plans {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}
.plan {
    background: var(--elev);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: visible;
}
.plan.featured {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(226, 78, 47, 0.06), var(--elev) 38%);
    box-shadow: var(--shadow);
}
.badge {
    display: inline-flex;
    align-self: flex-start;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 999px;
    margin-bottom: 12px;
}
.plan h3 { margin-bottom: 6px; }
.plan > .muted { margin: 0 0 18px; min-height: 44px; }

.price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 6px;
    margin: 4px 0 8px;
    line-height: 1;
    color: var(--text);
}
.price-currency {
    font-family: var(--font);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}
.price-amount {
    font-family: var(--font);
    font-size: clamp(2.8rem, 4vw, 3.6rem);
    font-weight: 750;
    letter-spacing: -0.06em;
    line-height: 1;
    color: var(--text);
}
.price-period {
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 550;
    color: var(--muted);
}

.plan ul {
    list-style: none;
    padding: 0;
    margin: 18px 0 24px;
    flex: 1;
}
.plan li {
    padding: 9px 0 9px 26px;
    position: relative;
    color: var(--text);
    font-size: 0.95rem;
    border-bottom: 1px solid var(--line);
}
.plan li:last-child { border-bottom: 0; }
.plan li::before {
    content: "";
    position: absolute;
    left: 0; top: 14px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 4px var(--accent);
}

.billing-toggle {
    display: flex;
    justify-content: center;
    gap: 12px;
    align-items: center;
    margin: 8px auto 32px;
    color: var(--muted);
    position: relative;
    z-index: 1;
}
.switch {
    width: 48px; height: 28px; border-radius: 999px;
    background: var(--elev); border: 1px solid var(--line);
    position: relative; cursor: pointer;
    padding: 0;
}
.switch i {
    position: absolute; top: 3px; left: 3px;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--accent); transition: left .2s;
    display: block;
}
.switch.on i { left: 23px; }

.compare-wrap {
    overflow-x: auto;
    background: var(--elev);
    border: 1px solid var(--line);
    border-radius: 20px;
}
.compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}
.compare-table th, .compare-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}
.compare-table th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}
.compare-table td { color: var(--text); }
.compare-table tr:last-child td { border-bottom: 0; }
.compare-table tbody tr:hover { background: var(--accent-soft); }

.faq details {
    background: var(--elev);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 10px;
}
.faq summary { cursor: pointer; font-weight: 650; }
.faq details p { color: var(--muted); margin: 10px 0 0; }

.cta-band {
    background: var(--ink);
    color: var(--bg);
    border-radius: 28px;
    padding: 52px 40px;
    text-align: center;
}
.cta-band h2 { color: inherit; }
.cta-band .lead { margin: 0 auto 22px; color: rgba(255,255,255,0.72); }
html[data-theme="dark"] .cta-band { background: var(--accent); color: #1a100c; }
html[data-theme="dark"] .cta-band .lead { color: rgba(26,16,12,0.75); }
.cta-band .btn-primary {
    background: #fff;
    color: #171412;
}

.page-hero { padding: 56px 0 12px; }
.page-hero.center { text-align: center; margin-left: auto; margin-right: auto; }
.page-hero p { color: var(--muted); max-width: 62ch; }
.page-hero.center p { margin-left: auto; margin-right: auto; }

.form-card, .auth-card, .checkout {
    background: var(--elev);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 28px;
    max-width: 520px;
    margin: 0 auto 80px;
    box-shadow: var(--shadow);
}
.checkout { max-width: 860px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.85rem; margin-bottom: 6px; color: var(--muted); }
.alert {
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
}
.alert.ok { background: rgba(31, 138, 91, 0.1); color: var(--ok); }
.alert.err { background: rgba(194, 59, 59, 0.1); color: var(--danger); }

.blog-card { color: inherit; display: block; }
.blog-card:hover { color: inherit; }
.blog-card h3 { margin-bottom: 8px; }
.tag {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.article { max-width: 720px; margin: 0 auto 80px; }
.article p { color: var(--muted); font-size: 1.05rem; }

.playground {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 16px;
    min-height: 70vh;
    margin-bottom: 60px;
    padding-top: 12px;
}
.side {
    background: var(--elev);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 16px;
}
.side a, .side button.plain {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: var(--muted);
    padding: 10px 8px;
    border-radius: 10px;
    cursor: pointer;
}
.side a:hover, .side button.plain:hover, .side a.is-active { background: var(--bg); color: var(--text); }

.site-footer {
    border-top: 1px solid var(--line);
    padding: 48px 0 24px;
    position: relative;
    z-index: 1;
    background: var(--bg-2);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 0.8fr) 1.2fr;
    gap: 28px;
}
.footer-brand p, .footer-meta, .site-footer a { color: var(--muted); }
.site-footer h4 { margin: 0 0 12px; font-size: 0.9rem; }
.site-footer a { display: block; margin: 8px 0; }
.site-footer a:hover { color: var(--text); }
.news-form { display: flex; gap: 8px; }
.news-form input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--text);
    border-radius: 12px;
    padding: 10px 12px;
}
.footer-bottom {
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line);
    color: var(--muted); font-size: 0.85rem;
}

.cookie {
    position: fixed;
    z-index: 80;
    left: 16px; right: 16px; bottom: 16px;
    max-width: 720px;
    margin: auto;
    background: var(--elev);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 16px 18px;
    display: none;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow);
}
.cookie.show { display: flex; }
.cookie p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.cookie a { color: var(--accent); }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }

.legal { max-width: 760px; }
.legal h2 { margin-top: 32px; font-size: 1.4rem; font-family: var(--font); }
.legal p, .legal li { color: var(--muted); }

@media (max-width: 960px) {
    .hero, .checkout, .playground, .footer-grid, .plans, .grid-3, .steps, .stats, .grid-4 {
        grid-template-columns: 1fr;
    }
    .nav { display: none; }
    .nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: var(--header);
        left: 0; right: 0;
        background: var(--elev);
        border-bottom: 1px solid var(--line);
        padding: 16px 20px 22px;
        gap: 14px;
    }
    .menu-btn { display: flex; }
    .hide-sm { display: none; }
    .cookie { flex-direction: column; align-items: stretch; }
    .plan > .muted { min-height: 0; }
    .cta-band { padding: 36px 22px; }
}
