:root {
    color-scheme: light;
    --bg: #f5f8fc;
    --surface: #ffffff;
    --surface-soft: #f8faff;
    --text: #101828;
    --muted: #5f6f89;
    --line: #dce4ef;
    --primary: #2563eb;
    --primary-soft: #edf4ff;
    --success: #16803c;
    --danger: #b42318;
    --radius: 16px;
    --shadow:
        0 14px 40px
        rgba(15, 23, 42, .07);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background:
        radial-gradient(
            circle at 90% 0%,
            #e6f4ff 0,
            transparent 27rem
        ),
        var(--bg);
    color: var(--text);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

button {
    font: inherit;
    cursor: pointer;
}

.wrap {
    width: min(
        calc(100% - 32px),
        1120px
    );
    margin-inline: auto;
}

.hero {
    padding: 60px 0 28px;
}

.brand {
    margin-bottom: 28px;
    font-size: 1rem;
    font-weight: 900;
}

.eyebrow,
.section-heading > span,
.result-heading > div > span {
    color: var(--primary);
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: .09em;
}

.hero h1 {
    max-width: 820px;
    margin: 10px 0 12px;
    font-size:
        clamp(
            2.5rem,
            6vw,
            4.8rem
        );
    line-height: .98;
    letter-spacing: -.055em;
}

.hero h1 span {
    color: var(--primary);
}

.hero p {
    max-width: 720px;
    margin: 0;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.65;
}

.privacy {
    width: fit-content;
    margin-top: 16px;
    padding: 8px 11px;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    background: #f0fdf4;
    color: #166534;
    font-size: .8rem;
    font-weight: 700;
}

.tool-section {
    padding: 8px 0 42px;
}

.mode-tabs {
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.mode-tabs button {
    min-width: 145px;
    min-height: 42px;
    padding: 8px 18px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-weight: 850;
}

.mode-tabs button.active {
    background: var(--primary);
    color: #fff;
}

.workspace {
    display: grid;
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );
    gap: 18px;
    margin-top: 16px;
}

.reader-card,
.result-card {
    min-width: 0;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.section-heading {
    margin-bottom: 15px;
}

.section-heading h2,
.result-heading h2 {
    margin: 4px 0 0;
    font-size: 1.28rem;
}

.section-heading p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.55;
}

.drop-zone {
    display: grid;
    place-items: center;
    min-height: 250px;
    padding: 28px;
    border: 2px dashed #9ebcff;
    border-radius: 14px;
    background: #f8fbff;
    text-align: center;
    cursor: pointer;
}

.drop-zone.is-dragging {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.drop-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.upload-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    margin-bottom: 12px;
    border-radius: 13px;
    background: var(--primary);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 900;
}

.drop-zone strong {
    font-size: 1rem;
}

.drop-zone small {
    margin-top: 5px;
    color: var(--muted);
}

.image-preview {
    display: grid;
    place-items: center;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
}

.image-preview img {
    display: block;
    max-width: 100%;
    max-height: 430px;
    object-fit: contain;
}

.camera-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.camera-actions button,
.result-heading button,
.result-actions button,
.result-actions a {
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-weight: 850;
    text-decoration: none;
}

.camera-actions .primary,
.result-actions .primary {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.camera-stage {
    position: relative;
    overflow: hidden;
    margin-top: 14px;
    border-radius: 14px;
    background: #050505;
}

.camera-stage video {
    display: block;
    width: 100%;
    min-height: 300px;
    max-height: 470px;
    object-fit: cover;
}

.scan-box {
    position: absolute;
    inset: 13%;
    pointer-events: none;
    border: 2px solid rgba(255,255,255,.85);
    border-radius: 18px;
}

.scan-box span {
    position: absolute;
    left: 8%;
    right: 8%;
    top: 50%;
    height: 2px;
    background: #22c55e;
    box-shadow:
        0 0 12px
        rgba(34,197,94,.9);
}

.status {
    margin-top: 14px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    font-size: .84rem;
}

.status[data-level="working"] {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.status[data-level="good"] {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: var(--success);
}

.status[data-level="bad"] {
    border-color: #fecaca;
    background: #fef2f2;
    color: var(--danger);
}

.result-card {
    margin-top: 14px;
}

.result-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.result-meta {
    display: grid;
    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );
    gap: 9px;
    margin-top: 15px;
}

.result-meta > div {
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}

.result-meta span {
    display: block;
    color: var(--muted);
    font-size: .69rem;
    font-weight: 850;
    text-transform: uppercase;
}

.result-meta strong {
    display: block;
    margin-top: 3px;
    overflow-wrap: anywhere;
}

.result-card pre {
    max-height: 320px;
    margin: 12px 0;
    padding: 14px;
    overflow: auto;
    border-radius: 10px;
    background: #101828;
    color: #f8fafc;
    font-family:
        ui-monospace,
        SFMono-Regular,
        Menlo,
        monospace;
    font-size: .84rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.result-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 9px;
}

.content-section {
    padding: 0 16px 70px;
}

.content-wrap {
    width: min(
        100%,
        900px
    );
    margin: 0 auto;
    padding:
        clamp(
            22px,
            4vw,
            38px
        );
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.content-wrap h2 {
    margin: 28px 0 8px;
    font-size: 1.45rem;
}

.content-wrap h2:first-child {
    margin-top: 0;
}

.content-wrap > p {
    margin: 0;
    color: var(--muted);
    line-height: 1.72;
}

.faq {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.faq details {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}

.faq summary {
    padding: 12px 13px;
    font-weight: 800;
    cursor: pointer;
}

.faq p {
    margin: 0;
    padding: 0 13px 13px;
    color: var(--muted);
    line-height: 1.6;
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    width: min(
        calc(100% - 32px),
        1120px
    );
    margin: 0 auto;
    padding: 25px 0 40px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .8rem;
}

[hidden] {
    display: none !important;
}

@media (max-width: 760px) {
    .workspace {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .hero {
        padding-top: 36px;
    }

    .mode-tabs {
        display: grid;
        width: 100%;
    }

    .mode-tabs button {
        min-width: 0;
    }

    .reader-card,
    .result-card {
        padding: 15px;
    }

    .result-meta {
        grid-template-columns: 1fr;
    }

    footer {
        flex-direction: column;
    }
}
