:root {
    --bg: #0f0f11;
    --surface: #17171a;
    --surface-2: #1e1e22;
    --text: #f7f7f8;
    --muted: #a1a1aa;
    --border: rgba(255, 255, 255, 0.1);
    --accent: #00e5ff;
    --accent-soft: rgba(0, 229, 255, 0.1);
    --danger: #fb7185;
    --font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --display: Manrope, var(--font);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 12% 0%, rgba(0, 229, 255, 0.09), transparent 34rem),
        radial-gradient(circle at 90% 18%, rgba(139, 92, 246, 0.08), transparent 30rem),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

a:hover { color: #7cf3ff; }

button, input { font: inherit; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--border);
    background: rgba(15, 15, 17, 0.86);
    backdrop-filter: blur(16px);
}

.topbar-inner,
.page-shell {
    width: min(100% - 32px, 960px);
    margin-inline: auto;
}

.topbar-inner {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    color: var(--text);
    font: 800 1.15rem/1 var(--display);
    text-decoration: none;
}

.brand span { color: var(--accent); }

.topnav { display: flex; gap: 18px; }

.topnav a {
    color: var(--muted);
    font-size: 0.875rem;
    text-decoration: none;
}

.topnav a:hover { color: var(--text); }

.page-shell { padding: 72px 0 96px; }

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1, h2, h3 {
    font-family: var(--display);
    line-height: 1.2;
}

h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.25rem, 7vw, 4.6rem);
    letter-spacing: -0.055em;
}

.lede {
    max-width: 720px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.16rem);
}

.meta {
    margin: 24px 0 0;
    color: #71717a;
    font-size: 0.85rem;
}

.content-card,
.app-card {
    margin-top: 48px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: rgba(23, 23, 26, 0.88);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.22);
}

.content-card { padding: clamp(24px, 6vw, 52px); }

.content-card section + section {
    margin-top: 38px;
    padding-top: 38px;
    border-top: 1px solid var(--border);
}

.content-card h2 { margin: 0 0 14px; font-size: 1.3rem; }
.content-card p, .content-card li { color: #c4c4cc; }
.content-card ul { margin: 14px 0 0; padding-left: 22px; }
.content-card li + li { margin-top: 8px; }

.notice {
    padding: 18px 20px;
    border: 1px solid rgba(0, 229, 255, 0.2);
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    background: var(--accent-soft);
    color: #d9fbff;
}

.app-card { overflow: hidden; }

.app-head {
    padding: clamp(24px, 5vw, 42px);
    border-bottom: 1px solid var(--border);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 28px;
}

.app-head h2 { margin: 0 0 8px; font-size: clamp(1.45rem, 3vw, 2rem); }
.app-head p { margin: 0; color: var(--muted); }
.app-body { padding: clamp(24px, 5vw, 42px); }

.status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    color: var(--muted);
    font-size: 0.9rem;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #71717a;
    box-shadow: 0 0 0 5px rgba(113, 113, 122, 0.1);
}

.status[data-state="ready"] .status-dot {
    background: #22c55e;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12);
}

.status[data-state="error"] .status-dot {
    background: var(--danger);
    box-shadow: 0 0 0 5px rgba(251, 113, 133, 0.12);
}

.button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: var(--accent);
    color: #001014;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.button:hover {
    color: #001014;
    transform: translateY(-1px);
    box-shadow: 0 0 28px rgba(0, 229, 255, 0.22);
}

.button:disabled { cursor: wait; opacity: 0.58; transform: none; }

.button-secondary {
    border-color: var(--border);
    background: transparent;
    color: var(--text);
}

.button-secondary:hover { color: var(--text); box-shadow: none; border-color: rgba(0, 229, 255, 0.4); }

.search-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.search-form label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.search-form input {
    min-width: 0;
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    background: #101012;
    color: var(--text);
}

.search-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.1);
}

.hint { margin: 12px 0 0; color: #71717a; font-size: 0.82rem; }

.results {
    display: grid;
    gap: 12px;
    margin-top: 28px;
}

.result-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
}

.result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.78rem;
}

.result-author { color: var(--accent); font-weight: 700; }
.result-card p { margin: 0; color: #dedee3; white-space: pre-wrap; }
.result-card a { display: inline-block; margin-top: 14px; font-size: 0.85rem; }
.empty { padding: 30px; border: 1px dashed var(--border); border-radius: 14px; color: var(--muted); text-align: center; }

.app-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.is-hidden { display: none !important; }

.footer {
    padding: 28px 0;
    border-top: 1px solid var(--border);
    color: #71717a;
    text-align: center;
    font-size: 0.82rem;
}

@media (max-width: 680px) {
    .topnav a:not(:last-child) { display: none; }
    .page-shell { padding-top: 48px; }
    .app-head { grid-template-columns: 1fr; }
    .search-form { grid-template-columns: 1fr; }
    .search-form .button { width: 100%; }
}

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