:root {
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-panel: rgba(15, 23, 42, 0.94);
  --bg-card: rgba(2, 6, 23, 0.68);
  --border: rgba(148, 163, 184, 0.2);
  --border-strong: rgba(56, 189, 248, 0.45);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --heading: #f8fafc;
  --accent: #38bdf8;
  --accent-strong: #0ea5e9;
  --accent-soft: rgba(14, 165, 233, 0.12);
  --success: #7dd3fc;
  --danger: #fda4af;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --shadow-soft: 0 24px 64px rgba(2, 6, 23, 0.42);
  --font-stack: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 0;
  background:
    radial-gradient(circle at top, rgba(14, 165, 233, 0.16), transparent 30%),
    linear-gradient(180deg, #020617 0%, #0b1220 100%);
  color: var(--text);
  font-family: var(--font-stack);
  line-height: 1.65;
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(56, 189, 248, 0.45);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -48px;
  left: 16px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: #001018;
  font-weight: 700;
}

.skip-link:focus {
  top: 16px;
}

.site-header,
.page-shell,
.site-footer {
  width: 100%;
}

.site-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  backdrop-filter: blur(12px);
}

.header-inner,
.page-shell,
.site-footer .footer-grid,
.site-footer .copyright {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--heading);
  font-weight: 700;
}

.site-logo i {
  color: var(--accent);
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.72rem 0.95rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
}

.top-nav a:hover {
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--heading);
}

.page-shell {
  padding: 2rem 0 4rem;
}

.search-hero,
.search-workspace {
  display: grid;
  gap: 1.25rem;
}

.search-hero {
  margin-bottom: 1.5rem;
}

.hero-copy,
.hero-panel,
.results-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-panel);
  box-shadow: var(--shadow-soft);
}

.hero-copy,
.hero-panel,
.results-panel {
  padding: 1.25rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 0.9rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 999px;
  color: var(--success);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  color: var(--heading);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 0.85rem;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.65rem);
}

h3 {
  font-size: 1.1rem;
}

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

.hero-text {
  max-width: 62ch;
}

.suggested-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 1rem;
}

.suggested-topics span {
  color: var(--muted);
  font-size: 0.95rem;
}

.suggestion-chip,
.filter-pill {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.5);
  color: var(--text);
  padding: 0.62rem 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.suggestion-chip:hover,
.filter-pill:hover,
.filter-pill.is-active {
  border-color: var(--border-strong);
  color: var(--heading);
  background: var(--accent-soft);
}

.search-form {
  display: grid;
  gap: 0.8rem;
}

.search-label {
  color: var(--heading);
  font-weight: 600;
}

.search-control-row {
  display: grid;
  gap: 0.75rem;
}

.search-input-wrap {
  position: relative;
}

.search-input-wrap i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
}

.search-input-wrap input {
  width: 100%;
  min-height: 56px;
  padding: 0.95rem 1rem 0.95rem 2.9rem;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.64);
  color: var(--heading);
}

.search-input-wrap input::placeholder {
  color: #7c8aa1;
}

.search-input-wrap input:focus {
  border-color: var(--border-strong);
}

.search-button {
  min-height: 56px;
  border: 1px solid var(--accent-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 100%);
  color: #001018;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.1rem;
  cursor: pointer;
}

.search-button:hover {
  filter: brightness(1.04);
}

.helper-text {
  font-size: 0.94rem;
}

.search-stats {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.stat-card {
  padding: 1rem 1.05rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.stat-label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.stat-card strong {
  display: block;
  color: var(--heading);
  font-size: 1.1rem;
}

.search-workspace {
  align-items: start;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.results-panel-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.google-fallback {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--success);
  font-weight: 600;
}

.google-fallback:hover {
  color: var(--heading);
}

.state-block {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.75rem;
  padding: 1rem;
}

.state-error .state-icon {
  background: rgba(190, 24, 93, 0.16);
  color: var(--danger);
}

.state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 165, 233, 0.16);
  color: var(--success);
  font-size: 1.3rem;
}

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

.result-card {
  padding: 1.1rem;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius-md);
  background: var(--bg-card);
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.36rem 0.66rem;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.13);
  color: #bae6fd;
  font-size: 0.8rem;
}

.result-card h3 {
  margin-bottom: 0.55rem;
}

.result-card h3 a {
  color: var(--heading);
}

.result-card h3 a:hover {
  color: var(--success);
}

.result-excerpt {
  color: var(--muted);
}

.result-excerpt mark,
.matched-keywords mark,
.result-card h3 mark {
  background: rgba(56, 189, 248, 0.16);
  color: var(--heading);
  border-radius: 4px;
  padding: 0 0.15rem;
}

.matched-keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.keyword-pill {
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  font-size: 0.78rem;
}

.result-footer {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.result-url {
  color: var(--success);
  font-size: 0.92rem;
  word-break: break-word;
}

.view-page {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--heading);
  font-weight: 600;
}

.site-footer {
  background: #020617;
  color: #9ca3af;
  padding: 40px 0 28px;
  font-size: 13px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.site-footer .footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}

.site-footer h4 {
  color: #fff;
  margin-bottom: 10px;
  font-size: 15px;
}

.site-footer h4 i {
  margin-right: 8px;
}

.site-footer a {
  display: block;
  margin-bottom: 6px;
  color: #cbd5e1;
}

.site-footer a i {
  width: 16px;
  margin-right: 8px;
  text-align: center;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
}

.site-footer .copyright {
  margin-top: 30px;
  border-top: 1px solid #1f2937;
  padding-top: 18px;
  text-align: center;
}

@media (min-width: 720px) {
  .header-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .search-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    align-items: stretch;
  }

  .search-control-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .search-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card-wide {
    grid-column: 1 / -1;
  }

  .results-panel-header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
}

@media (min-width: 960px) {
  .page-shell {
    padding-top: 2.5rem;
  }

  .hero-copy,
  .hero-panel,
  .results-panel {
    padding: 1.5rem;
  }

  .search-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stat-card-wide {
    grid-column: auto;
  }
}

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