:root {
    color-scheme: light dark;
    --bg: #f4f3f8;
    --surface: rgba(255, 255, 255, 0.68);
    --surface-strong: rgba(255, 255, 255, 0.9);
    --text: #24202b;
    --muted: #6f6878;
    --accent: #7357d9;
    --accent-soft: rgba(115, 87, 217, 0.14);
    --border: rgba(91, 75, 115, 0.13);
    --shadow: 0 20px 60px rgba(62, 44, 91, 0.11);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111016;
        --surface: rgba(35, 32, 43, 0.72);
        --surface-strong: rgba(43, 39, 52, 0.92);
        --text: #f4f0f8;
        --muted: #b0a8ba;
        --accent: #b39aff;
        --accent-soft: rgba(179, 154, 255, 0.15);
        --border: rgba(233, 221, 255, 0.1);
        --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 8%, rgba(153, 119, 255, 0.17), transparent 32rem),
        radial-gradient(circle at 92% 28%, rgba(255, 138, 189, 0.12), transparent 28rem),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.shell { width: min(1060px, calc(100% - 32px)); margin: 0 auto; padding: 72px 0 80px; }
.hero { max-width: 760px; margin: 0 auto 56px; text-align: center; }
.eyebrow { margin: 0 0 12px; color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(34px, 6vw, 64px); line-height: 1.08; letter-spacing: -.045em; }
.intro { margin: 20px 0 30px; color: var(--muted); font-size: clamp(16px, 2vw, 19px); }

.search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px) saturate(140%);
}

.search input { min-width: 0; border: 0; outline: 0; padding: 13px 16px; color: var(--text); background: transparent; font: inherit; font-size: 16px; }
.search input::placeholder { color: var(--muted); }
.search button { border: 0; border-radius: 15px; padding: 0 24px; color: white; background: var(--accent); font: inherit; font-weight: 700; cursor: pointer; transition: transform .18s ease, filter .18s ease; }
.search button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.search button:disabled { cursor: wait; opacity: .65; transform: none; }

.status-line { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 17px; color: var(--muted); font-size: 14px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #55b985; box-shadow: 0 0 0 5px rgba(85, 185, 133, .12); }
.results-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.results-heading h2 { margin: 0; font-size: 21px; }
#result-count { color: var(--muted); font-size: 14px; }
.message { padding: 50px 20px; color: var(--muted); text-align: center; border: 1px dashed var(--border); border-radius: 24px; }
.message[hidden] { display: none; }
.results { display: grid; gap: 16px; }

.result-card {
    display: grid;
    grid-template-columns: 240px 1fr;
    overflow: hidden;
    min-height: 150px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: 0 12px 38px rgba(43, 31, 64, .07);
    backdrop-filter: blur(18px) saturate(130%);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.result-card:hover { transform: translateY(-2px); border-color: rgba(115, 87, 217, .28); box-shadow: var(--shadow); }
.cover-link { position: relative; display: block; min-height: 150px; background: var(--accent-soft); }
.cover { width: 100%; height: 100%; min-height: 150px; object-fit: cover; display: block; }
.duration { position: absolute; right: 10px; bottom: 9px; padding: 3px 7px; border-radius: 7px; color: white; background: rgba(15, 13, 19, .72); font-size: 12px; }
.card-body { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; padding: 20px 22px; min-width: 0; }
.card-body h3 { margin: 0 0 7px; font-size: 18px; line-height: 1.4; }
.title { color: var(--text); text-decoration: none; }
.title:hover { color: var(--accent); }
.meta { margin: 0; color: var(--muted); font-size: 13px; }
.snippet { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.time-links { display: flex; flex-wrap: wrap; gap: 8px; }
.time-link { padding: 6px 10px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: 13px; font-weight: 650; text-decoration: none; }
.time-link:hover { filter: brightness(1.1); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

@media (max-width: 700px) {
    .shell { width: min(100% - 22px, 560px); padding-top: 46px; }
    .hero { margin-bottom: 42px; }
    .search { border-radius: 18px; }
    .search button { padding: 0 18px; }
    .result-card { grid-template-columns: 1fr; border-radius: 21px; }
    .cover-link, .cover { min-height: 0; aspect-ratio: 16 / 9; }
    .card-body { padding: 17px; }
}

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