:root {
    --bg: #f7f3eb;
    --paper: #fffaf2;
    --paper-soft: #eee7da;
    --ink: #17211d;
    --muted: #66716a;
    --line: #d8c9b6;
    --line-strong: #b9a68d;
    --navy: #0f332d;
    --blue: #1f6f67;
    --cyan: #b77936;
    --green: #27875b;
    --warning: #a86632;
    --shadow: 0 18px 48px rgba(49, 40, 28, .12);
    --radius: 8px;
    --wrap: 1160px;
    --header: 74px;
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #101814;
    --paper: #17231f;
    --paper-soft: #1d2c27;
    --ink: #f3efe6;
    --muted: #b9c0b7;
    --line: #31433c;
    --line-strong: #52675e;
    --navy: #f3efe6;
    --blue: #6bc1b5;
    --cyan: #d6a15a;
    --green: #61c891;
    --warning: #d6a15a;
    --shadow: 0 22px 58px rgba(0, 0, 0, .28);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; text-size-adjust: 100%; }
body {
    margin: 0;
    min-width: 320px;
    background:
        repeating-linear-gradient(0deg, transparent 0 31px, rgba(22,32,51,.035) 31px 32px),
        var(--bg);
    color: var(--ink);
    font: 16px/1.52 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
body.menu-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
svg { display: block; max-width: 100%; }
.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.skip {
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1000;
    transform: translateY(-140%);
    border-radius: var(--radius);
    background: var(--navy);
    color: var(--paper);
    padding: 10px 14px;
    font-weight: 800;
}
.skip:focus { transform: translateY(0); }
.icon { width: 20px; height: 20px; flex: 0 0 auto; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 80;
    height: var(--header);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(14px);
}
.topbar__inner { min-height: var(--header); display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-width: max-content; }
.brand__symbol {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    background: var(--navy);
    color: var(--paper);
    box-shadow: none;
}
.brand__symbol svg { width: 28px; height: 28px; }
.brand__symbol path:first-child { fill: none; stroke: currentColor; stroke-width: 2; }
.brand__symbol path:last-child { fill: none; stroke: var(--cyan); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand b { display: block; line-height: 1.1; }
.brand small { display: block; color: var(--muted); font-size: .76rem; line-height: 1.2; }
.nav { display: flex; align-items: center; justify-content: center; gap: 4px; }
.nav a { color: var(--muted); border-radius: var(--radius); padding: 10px 12px; font-weight: 750; font-size: .92rem; }
.nav a:hover, .nav a:focus-visible { background: var(--paper-soft); color: var(--ink); outline: none; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.btn, .icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 800;
    min-height: 44px;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.btn { padding: 12px 16px; }
.btn:hover, .btn:focus-visible, .icon-btn:hover, .icon-btn:focus-visible { transform: translateY(-1px); outline: none; }
.btn--primary { background: var(--navy); color: var(--paper); }
.btn--ghost, .btn--quiet { border-color: var(--line); background: var(--paper); color: var(--ink); }
.btn--ghost:hover, .btn--quiet:hover { border-color: var(--line-strong); background: var(--paper-soft); }
.btn--large { min-height: 52px; padding-inline: 20px; }
.icon-btn { width: 44px; border-color: var(--line); background: var(--paper); color: var(--ink); }
.theme-sun, [data-theme="light"] .theme-moon { display: none; }
[data-theme="light"] .theme-sun { display: block; }
.menu { display: none; }
.menu-close { display: none; }

.eyebrow-v4 {
    margin: 0 0 12px;
    color: var(--blue);
    font-size: .78rem;
    font-weight: 850;
    text-transform: uppercase;
}
.hero-v4 { padding: 70px 0 50px; border-bottom: 1px solid var(--line); background: var(--bg); }
.hero-v4__grid { display: grid; grid-template-columns: minmax(0, .82fr) minmax(460px, 1.18fr); align-items: center; gap: 54px; }
.hero-v4 h1 { margin: 0; color: var(--navy); font-size: 6.2rem; line-height: .92; letter-spacing: 0; }
.lead-v4 { margin: 22px 0 0; max-width: 570px; color: var(--muted); font-size: 1.15rem; }
.hero-v4__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.proof-notes { display: grid; gap: 8px; margin-top: 28px; max-width: 520px; }
.proof-notes span {
    border-left: 3px solid var(--cyan);
    background: color-mix(in srgb, var(--paper) 78%, transparent);
    padding: 8px 12px;
    color: var(--muted);
    font-size: .92rem;
    font-weight: 700;
}

.desk-visual svg { width: 100%; aspect-ratio: 780 / 560; }
.desk-bg { fill: var(--paper-soft); stroke: var(--line); }
.paper path:first-child { fill: var(--paper); stroke: var(--line-strong); stroke-width: 1.5; }
.paper path:nth-child(2) { fill: var(--paper-soft); stroke: var(--line-strong); stroke-width: 1.5; }
.paper-back { opacity: .72; transform: rotate(-2deg); transform-origin: 330px 280px; }
.paper-front { filter: drop-shadow(0 18px 30px rgba(16, 32, 56, .12)); }
.paper-front text, .ledger-card text, .file-tabs text { fill: var(--ink); font-weight: 800; font-size: 20px; }
.paper-front .muted-svg, .ledger-card .muted-svg { fill: var(--muted); font-size: 15px; font-weight: 700; }
.paper-front .small-svg { fill: var(--muted); font-size: 14px; font-weight: 700; }
.row-line { stroke: var(--line); stroke-width: 1.5; }
.scan-line { stroke: var(--blue); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 346; animation: scanLine 3.8s ease-in-out infinite; }
.stamp-v4 circle { fill: none; stroke: var(--green); stroke-width: 6; }
.stamp-v4 path { fill: none; stroke: var(--green); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.ledger-card rect { fill: var(--paper); stroke: var(--line-strong); stroke-width: 1.4; }
.ledger-card path { stroke: var(--blue); stroke-width: 5; stroke-linecap: round; opacity: .7; }
.ledger-card { animation: deskFloat 6s ease-in-out infinite; }
.ledger-card-bottom { animation-delay: .45s; }
.file-tabs rect { fill: var(--navy); opacity: .95; }
.file-tabs text { fill: var(--paper); font-size: 15px; }

.brief-strip { border-bottom: 1px solid var(--line); background: var(--paper); padding: 16px 0; }
.brief-strip__inner { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-weight: 800; font-size: .92rem; }
.section-v4 { padding: 88px 0; }
.title-row { margin-bottom: 30px; }
.title-row h2 { margin: 0; max-width: 720px; color: var(--navy); font-size: 3.4rem; line-height: 1.02; }
.title-row--center { display: grid; justify-items: center; text-align: center; }
.audit-flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.audit-step, .price-sheet, .security-v4__items article, .checkout-form, .login-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    box-shadow: var(--shadow);
}
.audit-step { position: relative; min-height: 196px; padding: 24px; }
.audit-step::before { content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 3px; background: var(--blue); }
.audit-step b { color: var(--cyan); }
.audit-step h3 { margin: 26px 0 8px; color: var(--navy); font-size: 1.28rem; }
.audit-step p, .product-v4__copy p, .coverage-table span, .law-card p, .price-sheet p, .security-v4__items span { color: var(--muted); margin: 0; }

.product-v4 { background: var(--paper-soft); border-block: 1px solid var(--line); }
.product-v4__grid { display: grid; grid-template-columns: .8fr 1.2fr; align-items: center; gap: 42px; }
.product-v4__copy h2 { margin: 0 0 16px; color: var(--navy); font-size: 3.4rem; line-height: 1.02; }
.coverage-table { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); box-shadow: var(--shadow); }
.coverage-table div { display: grid; grid-template-columns: 120px 1fr; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.coverage-table div:last-child { border-bottom: 0; }
.coverage-table b { color: var(--navy); }
.coverage-table span { display: block; }
.law-card-section { padding: 34px 0; }
.law-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); padding: 28px; display: grid; grid-template-columns: .2fr .5fr 1fr; gap: 22px; align-items: center; }
.law-card h2 { margin: 0; color: var(--navy); font-size: 2.8rem; line-height: 1; }

.pricing-v4 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.price-sheet { min-height: 532px; display: flex; flex-direction: column; padding: 26px; transition: transform .18s ease, border-color .18s ease; }
.price-sheet:hover { transform: translateY(-6px); border-color: var(--line-strong); }
.price-sheet--featured { border-color: var(--navy); transform: translateY(-10px); }
.price-sheet__label { align-self: flex-start; border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 9px; color: var(--blue); font-weight: 850; font-size: .78rem; }
.price-sheet h3 { margin: 20px 0 8px; color: var(--navy); font-size: 1.9rem; }
.price-sheet__price { margin: 24px 0 18px; display: flex; align-items: baseline; gap: 7px; }
.price-sheet__price b { color: var(--navy); font-size: 2.45rem; line-height: 1; }
.price-sheet__price span { color: var(--muted); font-weight: 800; }
.price-sheet .btn { width: 100%; }
.price-sheet ul { list-style: none; margin: 24px 0 0; padding: 0; display: grid; gap: 11px; }
.price-sheet li { display: flex; gap: 10px; color: var(--muted); font-weight: 700; }
.price-sheet li .icon { width: 18px; height: 18px; color: var(--green); margin-top: 3px; }

.security-v4 { background: var(--paper-soft); border-block: 1px solid var(--line); }
.security-v4__grid { display: grid; grid-template-columns: .78fr 1.22fr; gap: 40px; align-items: start; }
.security-v4__items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.security-v4__items article { min-height: 192px; padding: 22px; }
.security-v4__items .icon { color: var(--blue); width: 28px; height: 28px; }
.security-v4__items b { display: block; margin: 16px 0 8px; color: var(--navy); }
.faq-v4 { display: grid; grid-template-columns: .7fr 1.3fr; gap: 40px; align-items: start; }
.faq-v4__list { display: grid; gap: 10px; }
.faq-v4 details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 8px 24px rgba(15,35,65,.06); }
.faq-v4 summary { cursor: pointer; list-style: none; padding: 19px 21px; font-weight: 800; color: var(--navy); }
.faq-v4 summary::-webkit-details-marker { display: none; }
.faq-v4 details[open] summary { border-bottom: 1px solid var(--line); }
.faq-v4 p { color: var(--muted); margin: 0; padding: 17px 21px 21px; }
.final-v4 { padding: 68px 0; border-top: 1px solid var(--line); background: var(--paper); }
.final-v4__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.final-v4 h2 { margin: 0; max-width: 760px; color: var(--navy); font-size: 3.7rem; line-height: 1; }

.footer { border-top: 1px solid var(--line); background: #0f332d; color: #fff; padding: 52px 0 24px; }
.footer__grid { display: grid; grid-template-columns: 1.2fr .8fr 1fr; gap: 34px; }
.footer p, .footer a, .footer__bottom { color: rgba(255,255,255,.72); }
.footer h2 { margin: 0 0 12px; font-size: .92rem; }
.footer a { display: flex; gap: 8px; align-items: center; margin: 9px 0; }
.footer .icon { width: 17px; height: 17px; }
.footer__bottom { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid rgba(255,255,255,.12); padding-top: 20px; margin-top: 34px; font-size: .86rem; }

.ai-chat { position: fixed; right: 18px; bottom: 18px; z-index: 90; }
.ai-chat__button { min-height: 50px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--navy); color: var(--paper); box-shadow: var(--shadow); padding: 0 16px; font-weight: 850; }
.ai-chat__panel { position: absolute; right: 0; bottom: 62px; width: 356px; display: none; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.ai-chat.is-open .ai-chat__panel { display: block; }
.ai-chat header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding: 14px; }
.ai-chat header span { display: block; color: var(--muted); font-size: .8rem; }
.ai-chat__log { display: grid; gap: 10px; max-height: 330px; overflow: auto; padding: 14px; }
.ai-chat__log p, .ai-chat__log button { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-soft); color: var(--ink); margin: 0; padding: 11px; text-align: left; }
.ai-chat__log .user { border-color: var(--blue); }
.ai-chat form { display: grid; grid-template-columns: 1fr 44px; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.ai-chat input, .checkout-form input, .checkout-form select, .login-card input { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); color: var(--ink); padding: 0 12px; }
.ai-chat input:focus, .checkout-form input:focus, .checkout-form select:focus, .login-card input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 12%, transparent); }
.ai-chat form button { border: 0; border-radius: var(--radius); background: var(--navy); color: var(--paper); display: grid; place-items: center; }
.ai-chat__panel > a { display: flex; gap: 8px; align-items: center; padding: 13px 14px; border-top: 1px solid var(--line); color: var(--blue); font-weight: 800; }

.checkout-shell, .login-shell { padding: 76px 0 96px; min-height: 72svh; background: var(--bg); }
.checkout-grid, .login-grid { display: grid; grid-template-columns: 1fr 480px; align-items: center; gap: 44px; }
.checkout-copy h1, .login-plate h1 { margin: 0; font-size: 4.8rem; line-height: .95; color: var(--navy); }
.checkout-copy p:not(.kicker) { color: var(--muted); font-size: 1.12rem; }
.checkout-art path { fill: none; stroke: var(--blue); stroke-width: 7; stroke-linecap: round; }
.login-plate path { fill: none; stroke: var(--blue); stroke-width: 7; stroke-linecap: round; }
.checkout-art circle, .login-plate circle { fill: var(--paper); stroke: var(--blue); stroke-width: 4; }
.checkout-art rect, .login-plate rect { fill: var(--paper); stroke: var(--line-strong); }
.checkout-form, .login-card { padding: 28px; }
.checkout-form h2 { margin: 24px 0 14px; font-size: 1.1rem; color: var(--navy); }
.checkout-form h2:first-of-type { margin-top: 0; }
.checkout-form label span, .login-card label span { display: block; margin: 12px 0 7px; color: var(--muted); font-weight: 800; }
.plan-switch, .pay-grid { display: grid; gap: 10px; }
.plan-switch { grid-template-columns: repeat(3, 1fr); }
.pay-grid { grid-template-columns: repeat(2, 1fr); margin-bottom: 22px; }
.plan-switch input, .pay-grid input { position: absolute; opacity: 0; pointer-events: none; }
.plan-switch label > span, .pay-grid label > span { display: flex; gap: 8px; align-items: center; min-height: 64px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper-soft); padding: 11px; }
.plan-switch label > span { align-items: flex-start; flex-direction: column; }
.plan-switch small { color: var(--muted); font-weight: 800; }
.plan-switch input:checked + span, .pay-grid input:checked + span { border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 10%, transparent); }
.form-status { min-height: 24px; color: var(--blue); font-weight: 800; }
.login-plate svg { margin-top: 26px; }
.login-plate rect { fill: var(--paper); stroke: var(--line-strong); }
.login-card { align-self: center; }
.login-card h2 { margin: 0 0 18px; font-size: 2rem; color: var(--navy); }
.login-card label { display: block; }
.login-card .btn { width: 100%; margin-top: 20px; }
.login-card > a { display: inline-block; color: var(--blue); font-weight: 800; margin-top: 14px; }

.reveal { opacity: 1; transform: none; }
.reveal.is-visible { opacity: 1; transform: none; }
@keyframes scanLine { 0%, 100% { stroke-dashoffset: 346; opacity: .25; } 45%, 55% { stroke-dashoffset: 0; opacity: 1; } }
@keyframes deskFloat { 50% { transform: translateY(-4px); } }

@media (max-width: 1080px) {
    .nav { position: fixed; top: calc(var(--header) + 10px); left: 20px; right: 20px; display: none; flex-direction: column; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); padding: 10px; }
    body.menu-open .nav { display: flex; }
    .menu { display: inline-flex; }
    body.menu-open .menu-open { display: none; }
    body.menu-open .menu-close { display: block; }
    .topbar__login, .topbar__cta { display: none; }
    .hero-v4__grid, .product-v4__grid, .security-v4__grid, .faq-v4, .checkout-grid, .login-grid { grid-template-columns: 1fr; }
    .audit-flow, .pricing-v4, .security-v4__items { grid-template-columns: 1fr; }
    .price-sheet--featured { transform: none; }
    .desk-visual { max-width: 760px; }
    .law-card { grid-template-columns: 1fr; }
    .hero-v4 h1 { font-size: 5rem; }
    .title-row h2, .product-v4__copy h2, .final-v4 h2 { font-size: 2.8rem; }
    .law-card h2 { font-size: 2.4rem; }
    .checkout-copy h1, .login-plate h1 { font-size: 3.8rem; }
}

@media (max-width: 760px) {
    :root { --header: 68px; }
    body { font-size: 15px; }
    .wrap { width: min(100% - 28px, var(--wrap)); }
    .hero-v4 { padding: 44px 0 40px; }
    .section-v4 { padding: 64px 0; }
    .brand small { display: none; }
    .brand__symbol { width: 38px; height: 38px; }
    .hero-v4__actions, .final-v4__inner { flex-direction: column; align-items: stretch; }
    .hero-v4__actions .btn, .final-v4 .btn { width: 100%; }
    .brief-strip__inner { display: grid; grid-template-columns: 1fr; }
    .coverage-table div { grid-template-columns: 1fr; gap: 4px; }
    .footer__grid, .footer__bottom { display: grid; grid-template-columns: 1fr; }
    .ai-chat { right: 14px; bottom: 14px; }
    .ai-chat__button span { display: none; }
    .ai-chat__panel { width: calc(100vw - 28px); }
    .plan-switch, .pay-grid { grid-template-columns: 1fr; }
    .checkout-shell, .login-shell { padding: 54px 0 72px; }
    .hero-v4 h1 { font-size: 3.35rem; }
    .title-row h2, .product-v4__copy h2, .final-v4 h2 { font-size: 2.15rem; }
    .law-card h2 { font-size: 2rem; }
    .checkout-copy h1, .login-plate h1 { font-size: 2.75rem; }
}

@media (max-width: 430px) {
    .audit-step, .price-sheet, .checkout-form, .login-card, .law-card { padding: 22px; }
    .price-sheet { min-height: auto; }
    .hero-v4 h1 { font-size: 2.85rem; }
    .title-row h2, .product-v4__copy h2, .final-v4 h2 { font-size: 1.95rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
    .reveal { opacity: 1; transform: none; }
}
