        @font-face {
            font-family: 'Fraunces';
            src: url('/static/fonts/fraunces-var.woff2') format('woff2');
            font-weight: 300 900; font-style: normal; font-display: swap;
        }
        @font-face {
            font-family: 'Fraunces';
            src: url('/static/fonts/fraunces-italic-var.woff2') format('woff2');
            font-weight: 300 900; font-style: italic; font-display: swap;
        }
        @font-face {
            font-family: 'Archivo';
            src: url('/static/fonts/archivo-var.woff2') format('woff2');
            font-weight: 400 700; font-style: normal; font-display: swap;
        }

        :root {
            --paper: #f5efe2;
            --paper-2: #ede4cf;
            --card: #fcfaf3;
            --ink: #232f3f;
            --ink-2: #5c6472;
            --ink-3: #8b8f98;
            --line: #ddd2b6;
            --line-soft: #e9e1cc;
            --accent: #c14a09;
            --accent-deep: #9e3c06;
            --green: #1a6b4a;
            --green-soft: #e5efe4;
            --red: #a8352c;
            --red-soft: #f6e5e0;
            --amber: #8a5a00;
            --amber-soft: #f7ecd2;
            --shadow: 0 2px 14px rgba(78, 55, 18, 0.10);
            --shadow-lift: 0 10px 30px rgba(78, 55, 18, 0.14);
            --font-display: 'Fraunces', 'Georgia', serif;
            --font-body: 'Archivo', 'Helvetica Neue', sans-serif;
        }

        * { box-sizing: border-box; margin: 0; padding: 0; }
        html { scroll-behavior: smooth; }
        body {
            font-family: var(--font-body);
            background:
                url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E"),
                var(--paper);
            color: var(--ink);
            line-height: 1.55;
            -webkit-font-smoothing: antialiased;
        }
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
        }
        a:focus-visible, button:focus-visible, input:focus-visible, label:focus-visible, summary:focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
        }
        ::selection { background: rgba(193, 74, 9, 0.18); }

        /* ── Top nav ─────────────────────────────────────────────────── */
        .top-nav {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px clamp(20px, 5vw, 56px);
            border-bottom: 1px solid var(--line);
            background: color-mix(in srgb, var(--paper) 82%, transparent);
            backdrop-filter: blur(6px);
            position: sticky; top: 0; z-index: 40;
        }
        .brand {
            font-family: var(--font-display);
            font-weight: 640;
            font-size: 1.3rem;
            color: var(--ink);
            text-decoration: none;
            display: inline-flex; align-items: center; gap: 10px;
            letter-spacing: 0.005em;
        }
        .brand .seal {
            display: inline-flex; align-items: center; justify-content: center;
            width: 32px; height: 32px; border-radius: 8px;
            background: var(--ink); color: var(--paper);
            font-size: 0.85rem; font-weight: 700;
        }
        .brand span.karo { color: var(--accent); }
        .nav-links { display: flex; align-items: center; gap: 26px; }
        .nav-links a {
            color: var(--ink-2); text-decoration: none; font-size: 0.9rem;
            border-bottom: 2px solid transparent; padding-bottom: 2px;
            transition: color .15s ease;
        }
        .nav-links a:hover { color: var(--ink); border-bottom-color: var(--line); }
        .nav-links .btn-signup {
            background: var(--ink); color: var(--paper);
            padding: 9px 18px; border-radius: 999px;
            font-weight: 650; border-bottom: none;
            transition: background .15s ease, box-shadow .15s ease;
        }
        .nav-links .btn-signup:hover { color: var(--paper); background: #101a26; box-shadow: 0 3px 10px rgba(35,47,63,.3); }
        @media (max-width: 720px) { .hide-mobile { display: none; } }

        /* ── Hero ────────────────────────────────────────────────────── */
        .hero {
            position: relative;
            max-width: 1040px;
            margin: 0 auto;
            padding: clamp(56px, 9vw, 110px) 24px 28px;
            text-align: center;
            overflow: visible;
        }
        .hero::before {
            /* ghost Devanagari watermark */
            content: "अ";
            position: absolute;
            top: -0.08em; left: 50%;
            transform: translateX(-118%);
            font-family: var(--font-display);
            font-size: clamp(200px, 32vw, 380px);
            line-height: 1;
            color: rgba(35, 47, 63, 0.05);
            pointer-events: none;
            user-select: none;
            z-index: 0;
        }
        .hero::after {
            content: "A";
            position: absolute;
            top: 0.05em; left: 50%;
            transform: translateX(30%);
            font-family: var(--font-display);
            font-size: clamp(180px, 28vw, 340px);
            font-style: italic;
            line-height: 1;
            color: rgba(193, 74, 9, 0.055);
            pointer-events: none;
            user-select: none;
            z-index: 0;
        }
        .hero > * { position: relative; z-index: 1; }
        .kicker {
            display: inline-flex; align-items: center; gap: 8px;
            font-size: 0.74rem; font-weight: 700;
            letter-spacing: 0.16em; text-transform: uppercase;
            color: var(--accent);
            border: 1px solid rgba(193, 74, 9, .35);
            border-radius: 3px;
            padding: 5px 12px;
            margin-bottom: 26px;
            background: rgba(193, 74, 9, .04);
            animation: rise .6s ease both;
        }
        .hero h1 {
            font-family: var(--font-display);
            font-size: clamp(2.3rem, 5.4vw, 4.1rem);
            font-weight: 560;
            line-height: 1.08;
            letter-spacing: -0.01em;
            margin-bottom: 22px;
            animation: rise .6s .08s ease both;
        }
        .hero h1 .grad {
            font-style: italic;
            font-weight: 620;
            color: var(--accent);
        }
        .lede {
            max-width: 620px;
            margin: 0 auto 26px;
            color: var(--ink-2);
            font-size: 1.06rem;
            animation: rise .6s .16s ease both;
        }
        .trust-line {
            display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
            font-size: 0.82rem; color: var(--ink-2);
            animation: rise .6s .24s ease both;
        }
        .trust-line .chip {
            border: 1px solid var(--line);
            background: var(--card);
            border-radius: 999px;
            padding: 6px 14px;
        }
        .trust-line .chip strong { color: var(--green); }
        @keyframes rise {
            from { opacity: 0; transform: translateY(14px); }
            to   { opacity: 1; transform: none; }
        }

        /* ── Upload dossier ──────────────────────────────────────────── */
        .upload-wrap {
            max-width: 660px;
            margin: 34px auto 0;
            padding: 0 20px;
            animation: rise .6s .32s ease both;
        }
        .card {
            position: relative;
            background: var(--card);
            border: 1px solid var(--line);
            border-radius: 14px;
            box-shadow: var(--shadow-lift);
            padding: 30px;
        }
        .card::before {
            /* inner document rule */
            content: "";
            position: absolute; inset: 8px;
            border: 1px solid var(--line-soft);
            border-radius: 9px;
            pointer-events: none;
        }
        .drop-zone {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            padding: 40px 24px 32px;
            border: 1.5px dashed var(--line);
            border-radius: 10px;
            background: #fffef9;
            cursor: pointer;
            text-align: center;
            color: var(--ink-3);
            transition: border-color .18s ease, background .18s ease, transform .18s ease;
            position: relative; z-index: 1;
        }
        .drop-zone:hover { border-color: var(--accent); background: #fffdf4; }
        .drop-zone.dragover {
            border-color: var(--accent);
            background: rgba(193, 74, 9, 0.05);
            transform: scale(1.005);
        }
        .drop-zone p { color: var(--ink-2); font-size: 0.98rem; font-weight: 500; }
        .drop-zone .hint { color: var(--ink-3); font-size: 0.8rem; font-weight: 400; }
        .drop-zone .filename {
            color: var(--green);
            font-weight: 650;
            font-size: 0.9rem;
            word-break: break-all;
        }
        #fileInput { display: none; }
        .auto-detect-note {
            text-align: center;
            font-size: 0.8rem;
            color: var(--ink-3);
            margin: 14px 0 14px;
            position: relative; z-index: 1;
        }
        .lang-row {
            display: flex; align-items: center; justify-content: center;
            gap: 10px; margin: 0 0 16px;
            position: relative; z-index: 1;
        }
        .lang-row label {
            font-size: 0.78rem; font-weight: 700;
            text-transform: uppercase; letter-spacing: 0.08em;
            color: var(--ink-2);
        }
        .lang-row select {
            padding: 9px 14px;
            border: 1px solid var(--line);
            border-radius: 8px;
            background: #fffef9;
            color: var(--ink);
            font-family: var(--font-body);
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
        }
        .lang-row select:focus { outline: none; border-color: var(--accent); }
        .btn {
            display: block;
            width: 100%;
            padding: 15px;
            background: var(--accent);
            color: #fff8ef;
            border: none;
            border-radius: 10px;
            font-family: var(--font-body);
            font-size: 1.02rem;
            font-weight: 700;
            letter-spacing: 0.01em;
            cursor: pointer;
            transition: background .15s ease, transform .12s ease, box-shadow .15s ease;
            position: relative; z-index: 1;
        }
        .btn:hover:not(:disabled) { background: var(--accent-deep); box-shadow: 0 6px 18px rgba(193,74,9,.28); }
        .btn:active:not(:disabled) { transform: translateY(1px); }
        .btn:disabled { background: var(--paper-2); color: var(--ink-3); cursor: not-allowed; }

        /* ── Progress ── */
        .progress-area { display: none; margin-top: 24px; text-align: center; position: relative; z-index: 1; }
        .progress-area.active { display: block; }
        .stepper {
            display: flex;
            justify-content: space-between;
            margin: 4px 6px 18px;
            position: relative;
        }
        .stepper::before {
            content: "";
            position: absolute;
            top: 7px; left: 24px; right: 24px;
            border-top: 1px solid var(--line);
        }
        .step { display: flex; flex-direction: column; align-items: center; gap: 7px; position: relative; flex: 1; }
        .step .dot {
            width: 15px; height: 15px;
            border-radius: 50%;
            background: var(--card);
            border: 2px solid var(--line);
            transition: all .25s ease;
        }
        .step .lbl { font-size: 0.68rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
        .step.active .dot {
            border-color: var(--accent);
            background: var(--accent);
            box-shadow: 0 0 0 4px rgba(193, 74, 9, 0.15);
            animation: pulse 1.6s ease infinite;
        }
        .step.active .lbl { color: var(--accent); }
        .step.done .dot { border-color: var(--green); background: var(--green); }
        .step.done .lbl { color: var(--green); }
        @keyframes pulse {
            0%, 100% { box-shadow: 0 0 0 4px rgba(193, 74, 9, 0.15); }
            50%      { box-shadow: 0 0 0 7px rgba(193, 74, 9, 0.07); }
        }
        .progress-bar {
            height: 6px;
            background: var(--paper-2);
            border-radius: 999px;
            overflow: hidden;
            margin-bottom: 12px;
        }
        .progress-bar-fill {
            height: 100%;
            width: 0%;
            border-radius: 999px;
            background: linear-gradient(90deg, var(--accent), #de7a33);
            transition: width .6s ease;
        }
        .progress-text { font-weight: 650; color: var(--ink); font-size: 0.96rem; }
        .progress-step { color: var(--ink-2); font-size: 0.82rem; min-height: 1.2em; margin-top: 3px; }
        /* Timed-out-but-still-polling state (Phase C): the sweeper refunds
           within 10 min, so this stays visually distinct from a hard error
           (which stops polling) without alarming the customer. */
        .progress-area.stuck { background: var(--amber-soft); border-radius: 10px; padding: 14px 10px; }
        .progress-area.stuck .progress-text { color: var(--amber); }
        .progress-area.stuck .progress-step { color: var(--amber); }
        .elapsed-time { color: var(--ink-3); font-size: 0.76rem; margin-top: 5px; font-variant-numeric: tabular-nums; }
        .progress-note { color: var(--ink-3); font-size: 0.78rem; margin-top: 12px; font-style: italic; font-family: var(--font-display); }

        /* ── Errors & results ── */
        .error-msg {
            display: none;
            margin-top: 18px;
            padding: 14px 16px;
            border-radius: 8px;
            background: var(--red-soft);
            border: 1px solid rgba(168, 53, 44, .3);
            border-left: 4px solid var(--red);
            color: #6e2018;
            font-size: 0.9rem;
            position: relative; z-index: 1;
        }
        .error-msg.active { display: block; }
        .btn-retry {
            margin-top: 10px;
            background: var(--red);
            color: #fdf3f1;
            border: none;
            padding: 8px 18px;
            border-radius: 7px;
            font-weight: 650;
            font-size: 0.84rem;
            cursor: pointer;
        }
        .btn-retry:hover { background: #8c2a23; }
        .result-area { display: none; margin-top: 22px; text-align: center; position: relative; z-index: 1; }
        .result-area.active { display: block; animation: rise .45s ease both; }
        .result-banner {
            font-family: var(--font-display);
            font-size: 1.25rem;
            font-weight: 620;
            color: var(--green);
            margin-bottom: 4px;
        }
        .result-banner::before { content: "✓ "; }
        .result-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
        .result-btns a {
            text-decoration: none;
            padding: 11px 20px;
            border-radius: 9px;
            font-weight: 650;
            font-size: 0.9rem;
            transition: transform .12s ease, box-shadow .15s ease;
        }
        .result-btns a:active { transform: translateY(1px); }
        .btn-preview { background: var(--card); border: 1px solid var(--line); color: var(--ink); }
        .btn-preview:hover { border-color: var(--ink-2); }
        .btn-download { background: var(--green); color: #f2f7f0; border: 1px solid var(--green); }
        .btn-download:hover { background: #124f36; box-shadow: 0 4px 14px rgba(26,107,74,.25); }
        .btn-download-alt { background: var(--card); border: 1px solid var(--line); color: var(--ink-2); }
        .btn-download-alt:hover { border-color: var(--ink-2); color: var(--ink); }

        /* ── Landing sections ────────────────────────────────────────── */
        .land {
            max-width: 1000px;
            margin: 0 auto;
            padding: clamp(56px, 8vw, 96px) 24px 0;
        }
        .land h2 {
            font-family: var(--font-display);
            font-size: clamp(1.7rem, 3.4vw, 2.4rem);
            font-weight: 580;
            text-align: center;
            letter-spacing: -0.005em;
        }
        .sec-sub {
            text-align: center;
            color: var(--ink-2);
            margin: 10px 0 40px;
            font-size: 0.98rem;
        }
        .land h2::after {
            content: "";
            display: block;
            width: 64px;
            margin: 14px auto 0;
            border-top: 2px solid var(--accent);
        }

        /* How it works — numbered like clauses */
        .steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
        @media (max-width: 800px) { .steps-grid { grid-template-columns: 1fr; } }
        .how-step {
            background: var(--card);
            border: 1px solid var(--line);
            border-radius: 12px;
            padding: 26px 24px;
            box-shadow: var(--shadow);
            transition: transform .18s ease, box-shadow .18s ease;
        }
        .how-step:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); }
        .how-step .num {
            font-family: var(--font-display);
            font-size: 2.1rem;
            font-weight: 560;
            font-style: italic;
            color: var(--accent);
            display: block;
            margin-bottom: 8px;
        }
        .how-step .num::after { content: "."; }
        .how-step h3 { font-size: 1.08rem; font-weight: 640; margin-bottom: 8px; }
        .how-step p { color: var(--ink-2); font-size: 0.9rem; }

        /* Features */
        .features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
        @media (max-width: 800px) { .features-grid { grid-template-columns: 1fr 1fr; } }
        @media (max-width: 560px) { .features-grid { grid-template-columns: 1fr; } }
        .feature {
            background: var(--card);
            border: 1px solid var(--line);
            border-radius: 12px;
            padding: 22px;
            transition: transform .18s ease, box-shadow .18s ease;
        }
        .feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
        .feature .ico { font-size: 1.35rem; margin-bottom: 10px; }
        .feature h3 { font-size: 0.98rem; font-weight: 650; margin-bottom: 6px; }
        .feature p { color: var(--ink-2); font-size: 0.85rem; }

        /* Pricing — revenue-stamp cards */
        .tiers-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
        @media (max-width: 900px) { .tiers-grid { grid-template-columns: 1fr 1fr; } }
        @media (max-width: 520px) { .tiers-grid { grid-template-columns: 1fr; } }
        .tier {
            background: var(--card);
            border: 1px solid var(--line);
            border-top: 4px double var(--line);
            border-radius: 10px;
            padding: 24px 20px;
            text-align: center;
            transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
        }
        .tier:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); border-color: var(--accent); }
        .tier .range {
            font-size: 0.74rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: var(--ink-3);
            margin-bottom: 10px;
        }
        .tier .rate {
            font-family: var(--font-display);
            font-size: 2.2rem;
            font-weight: 580;
            color: var(--ink);
        }
        .tier .rate small { font-size: 0.85rem; color: var(--ink-3); font-family: var(--font-body); font-weight: 500; }
        .tier .note { margin-top: 10px; font-size: 0.78rem; color: var(--ink-2); }
        .pricing-foot {
            text-align: center;
            margin-top: 26px;
            color: var(--ink-2);
            font-size: 0.88rem;
            max-width: 560px;
            margin-left: auto; margin-right: auto;
        }
        .pricing-foot strong { color: var(--green); }

        /* FAQ */
        .faq { max-width: 720px; margin: 0 auto; }
        .faq details {
            border-bottom: 1px solid var(--line);
            padding: 4px 0;
        }
        .faq details:first-child { border-top: 1px solid var(--line); }
        .faq summary {
            cursor: pointer;
            list-style: none;
            padding: 16px 34px 16px 4px;
            font-weight: 650;
            font-size: 0.96rem;
            position: relative;
        }
        .faq summary::-webkit-details-marker { display: none; }
        .faq summary::after {
            content: "+";
            position: absolute; right: 8px; top: 50%;
            transform: translateY(-50%);
            font-family: var(--font-display);
            font-size: 1.3rem;
            color: var(--accent);
            transition: transform .18s ease;
        }
        .faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
        .faq-body { padding: 0 4px 18px; color: var(--ink-2); font-size: 0.9rem; }
        .faq-body code {
            background: var(--paper-2);
            border-radius: 4px;
            padding: 1px 6px;
            font-size: 0.82rem;
        }

        /* ── Modal ───────────────────────────────────────────────────── */
        .modal-overlay {
            display: none;
            position: fixed; inset: 0;
            background: rgba(35, 47, 63, 0.45);
            backdrop-filter: blur(3px);
            z-index: 100;
            align-items: center; justify-content: center;
            padding: 20px;
        }
        .modal-overlay.active { display: flex; }
        .modal {
            background: var(--card);
            border: 1px solid var(--line);
            border-radius: 14px;
            box-shadow: 0 24px 60px rgba(35, 47, 63, 0.35);
            width: 100%;
            max-width: 440px;
            max-height: 90vh;
            overflow-y: auto;
            padding: 28px;
            position: relative;
            animation: rise .3s ease both;
        }
        .modal::before {
            content: "";
            position: absolute; inset: 7px;
            border: 1px solid var(--line-soft);
            border-radius: 9px;
            pointer-events: none;
        }
        .modal > * { position: relative; }
        .modal h2 {
            font-family: var(--font-display);
            font-size: 1.4rem;
            font-weight: 600;
            margin-bottom: 18px;
            text-align: center;
        }
        .modal-row {
            display: flex;
            justify-content: space-between;
            padding: 7px 0;
            font-size: 0.9rem;
        }
        .modal-row .label { color: var(--ink-3); }
        .modal-divider { border: none; border-top: 1px dashed var(--line); margin: 12px 0; }
        .modal-total {
            display: flex;
            justify-content: space-between;
            font-family: var(--font-display);
            font-size: 1.2rem;
            font-weight: 640;
        }
        .modal-features { margin-top: 18px; background: var(--paper); border-radius: 8px; padding: 14px 16px; }
        .modal-features h3 {
            font-size: 0.72rem;
            text-transform: uppercase;
            letter-spacing: 0.09em;
            color: var(--ink-3);
            margin-bottom: 8px;
        }
        .modal-features ul { list-style: none; }
        .modal-features li { font-size: 0.82rem; color: var(--ink-2); padding: 3px 0 3px 20px; position: relative; }
        .modal-features li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
        .modal-btns { display: flex; gap: 10px; margin-top: 20px; }
        .btn-cancel {
            flex: 1;
            padding: 12px;
            background: var(--card);
            border: 1px solid var(--line);
            border-radius: 9px;
            color: var(--ink-2);
            font-family: var(--font-body);
            font-weight: 650;
            font-size: 0.9rem;
            cursor: pointer;
        }
        .btn-cancel:hover { border-color: var(--ink-2); color: var(--ink); }
        .btn-confirm {
            flex: 2;
            padding: 12px;
            background: var(--green);
            border: none;
            border-radius: 9px;
            color: #f2f7f0;
            font-family: var(--font-body);
            font-weight: 700;
            font-size: 0.92rem;
            cursor: pointer;
            transition: filter .15s ease;
        }
        .btn-confirm:hover:not(:disabled) { filter: brightness(0.92); }
        .btn-confirm:disabled { opacity: 0.6; cursor: not-allowed; }
        #modalGstin {
            flex: 1; margin-left: 8px;
            padding: 7px 10px;
            border: 1px solid var(--line);
            border-radius: 6px;
            background: #fffef9;
            color: var(--ink);
            font-family: var(--font-body);
            font-size: 0.85rem;
            text-transform: uppercase;
        }
        #modalGstin:focus { outline: none; border-color: var(--accent); }
        #trialNote {
            display: none;
            margin-top: 12px;
            padding: 10px 14px;
            border-radius: 6px;
            font-size: 0.82rem;
            background: var(--green-soft);
            border: 1px solid rgba(26, 107, 74, .3);
            color: #14503a;
            text-align: center;
        }
        .modal-estimate-time { text-align: center; margin-top: 12px; font-size: 0.8rem; color: var(--ink-3); }

        /* ── Footer: the ink block ───────────────────────────────────── */
        .site-footer {
            margin-top: clamp(64px, 9vw, 110px);
            background: var(--ink);
            color: #b9c0cb;
            text-align: center;
            padding: 44px 24px 38px;
        }
        .site-footer nav { display: flex; justify-content: center; gap: 26px; flex-wrap: wrap; margin-bottom: 16px; }
        .site-footer a { color: #d7dce3; text-decoration: none; font-size: 0.86rem; }
        .site-footer a:hover { color: #f5efe2; }
        .site-footer .tagline {
            font-family: var(--font-display);
            font-style: italic;
            font-size: 0.9rem;
            color: #8b95a3;
        }
        .site-footer .mark {
            font-family: var(--font-display);
            font-size: 1.5rem;
            color: var(--paper);
            margin-bottom: 12px;
        }
        .site-footer .mark em { color: #de7a33; font-style: normal; }
