:root {
    color-scheme: dark;
    --bg: #0f1113;
    --surface: #16191c;
    --surface-2: #1c1f22;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);
    --text: #f3f4f4;
    --muted: #8f999f;
    --accent: #a86442;
    --accent-soft: rgba(168, 100, 66, 0.16);
    --good: #7fb38d;
    --warn: #d3a766;
    --bad: #d47e7e;
    --radius: 0.3rem;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 10%, rgba(168, 100, 66, 0.1), transparent 32rem),
        linear-gradient(135deg, #0f1113 0%, #16191c 45%, #1c1f22 100%);
    font-family: var(--font);
    line-height: 1.6;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 44px 44px;
    content: "";
    mask-image: linear-gradient(to bottom, black, transparent 90%);
}

button,
input {
    font: inherit;
}

button,
a,
.drop-zone {
    -webkit-tap-highlight-color: transparent;
}

code {
    padding: 0.12rem 0.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
    color: #d9dee2;
    font-size: 0.88em;
}

.noise {
    position: fixed;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.7'/%3E%3C/svg%3E");
}

.site-header,
.site-footer,
.shell {
    width: min(1120px, calc(100% - 2rem));
    margin-inline: auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.82rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-size: 0.8rem;
}

.status-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--good);
    box-shadow: 0 0 0 0.25rem rgba(127, 179, 141, 0.12);
}

.shell {
    padding: 5rem 0 4rem;
}

.hero {
    max-width: 780px;
    margin-bottom: 2.5rem;
}

.eyebrow,
.kicker {
    margin: 0 0 0.6rem;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 1rem;
    font-size: clamp(2.6rem, 7vw, 5.5rem);
    line-height: 0.98;
    letter-spacing: -0.06em;
}

h2 {
    margin-bottom: 0.45rem;
    font-size: clamp(1.15rem, 2vw, 1.5rem);
    letter-spacing: -0.03em;
}

h3 {
    margin-bottom: 0.8rem;
    font-size: 0.92rem;
}

.hero-copy {
    max-width: 670px;
    margin-bottom: 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.15rem);
}

.panel,
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(22, 25, 28, 0.78);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.panel {
    padding: clamp(1rem, 3vw, 1.5rem);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.button {
    min-height: 2.35rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.button:hover:not(:disabled) {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
}

.button:active:not(:disabled) {
    transform: translateY(1px);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.button-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.drop-zone {
    display: grid;
    min-height: 220px;
    place-items: center;
    align-content: center;
    gap: 0.25rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.025);
    color: var(--muted);
    cursor: pointer;
    text-align: center;
    transition: border-color 160ms ease, background 160ms ease;
}

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

.drop-zone strong {
    color: var(--text);
}

.drop-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.drop-icon {
    display: grid;
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.5rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
}

.drop-icon svg {
    width: 1.35rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.6;
}

.summary-grid,
.grid {
    display: grid;
    gap: 1rem;
}

.summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 1rem;
}

.metric {
    min-width: 0;
    padding: 0.9rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.025);
}

.metric span {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.metric strong {
    display: block;
    overflow: hidden;
    font-size: 0.95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.results {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.16);
}

.results ul {
    display: grid;
    gap: 0.55rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.result-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.result-badge {
    flex: 0 0 auto;
    min-width: 3.6rem;
    padding: 0.15rem 0.4rem;
    border-radius: 999px;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.result-badge.pass {
    background: rgba(127, 179, 141, 0.14);
    color: var(--good);
}

.result-badge.warn {
    background: rgba(211, 167, 102, 0.14);
    color: var(--warn);
}

.result-badge.fail {
    background: rgba(212, 126, 126, 0.14);
    color: var(--bad);
}

.grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1rem;
}

.card {
    padding: 1.25rem;
}

.card-index {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--accent);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
}

.card p {
    margin-bottom: 0;
    color: var(--muted);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 0 2rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8rem;
}

.toast {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 30;
    max-width: min(360px, calc(100% - 2rem));
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: #1c1f22;
    box-shadow: var(--shadow);
    color: var(--text);
    font-size: 0.88rem;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

@media (max-width: 820px) {
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

@media (max-width: 560px) {
    .shell {
        padding-top: 3rem;
    }

    .site-header,
    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .panel-head {
        align-items: flex-start;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
