:root {
    color-scheme: light;
    --ink: #172238;
    --muted: #667085;
    --paper: #ffffff;
    --canvas: #f4f7fb;
    --line: #dbe3ef;
    --brand: #2856c7;
    --brand-dark: #183c99;
    --accent: #e9efff;
    --danger: #a61b1b;
    --shadow: 0 18px 55px rgba(31, 53, 92, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% 0%, #e4ebff 0, transparent 30rem),
        radial-gradient(circle at 90% 10%, #dff6f2 0, transparent 25rem),
        var(--canvas);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 72px 0 36px;
}

.hero {
    max-width: 760px;
    margin-bottom: 32px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(2.2rem, 6vw, 4.75rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.intro {
    max-width: 680px;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.search-panel {
    padding: 26px;
    border: 1px solid rgba(219, 227, 239, 0.9);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

#search-form > label,
.limit-control label {
    display: block;
    margin: 0 0 9px;
    font-size: 0.82rem;
    font-weight: 750;
}

.form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 100px auto;
    gap: 12px;
    align-items: end;
}

input,
select {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
    outline: none;
}

input {
    padding: 0 16px;
}

select {
    padding: 0 10px;
}

input:focus,
select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(40, 86, 199, 0.12);
}

button {
    cursor: pointer;
}

.form-row > button {
    min-height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 11px;
    background: var(--brand);
    color: #fff;
    font-weight: 750;
    box-shadow: 0 7px 18px rgba(40, 86, 199, 0.22);
}

.form-row > button:hover {
    background: var(--brand-dark);
}

.form-row > button:disabled {
    cursor: wait;
    opacity: 0.7;
}

.examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 18px;
    color: var(--muted);
    font-size: 0.86rem;
}

.example {
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--brand-dark);
}

.example:hover {
    border-color: #aebde0;
    background: var(--accent);
}

.status {
    padding: 30px 3px 16px;
    color: var(--muted);
    line-height: 1.5;
}

.status.error {
    color: var(--danger);
}

.results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--paper);
    box-shadow: 0 8px 26px rgba(31, 53, 92, 0.07);
}

.image-link {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e9edf4;
}

.image-link img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.card-body {
    padding: 18px;
}

.card-title-row {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: flex-start;
}

.card h2 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 1.04rem;
    line-height: 1.35;
}

.score {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--brand-dark);
    font-size: 0.72rem;
    font-weight: 800;
}

.description {
    margin: 11px 0 0;
    color: #4a5568;
    line-height: 1.55;
}

.facts,
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
}

.fact,
.tag {
    padding: 5px 8px;
    border-radius: 7px;
    font-size: 0.75rem;
}

.fact {
    background: #f2f4f7;
    color: #475467;
}

.tag {
    background: #edf7f5;
    color: #11675d;
}

details {
    margin-top: 14px;
    border-top: 1px solid #edf0f5;
    padding-top: 12px;
}

summary {
    cursor: pointer;
    color: var(--brand);
    font-size: 0.82rem;
    font-weight: 700;
}

pre {
    max-height: 260px;
    overflow: auto;
    margin: 11px 0 0;
    padding: 12px;
    border-radius: 9px;
    background: #101828;
    color: #d0d5dd;
    font: 0.72rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 32px 3px 0;
    color: var(--muted);
    font-size: 0.82rem;
}

footer a {
    color: var(--brand);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 760px) {
    .shell {
        width: min(100% - 22px, 1180px);
        padding-top: 42px;
    }

    .search-panel {
        padding: 18px;
    }

    .form-row {
        grid-template-columns: 1fr 92px;
    }

    .form-row > button {
        grid-column: 1 / -1;
    }

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

    footer {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .card {
        animation: reveal 280ms ease-out both;
    }

    @keyframes reveal {
        from { opacity: 0; transform: translateY(8px); }
        to { opacity: 1; transform: translateY(0); }
    }
}

