:root {
  color-scheme: light;
  --bg: #f8f9fa;
  --fg: #202124;
  --muted: #5f6368;
  --border: #dadce0;
  --input: #ffffff;
  --input-border: #dfe1e5;
  --btn: #f8f9fa;
  --btn-border: #f8f9fa;
  --btn-hover: #f1f3f4;
  --link: #1a0dab;
  --url: #006621;
  --chip-bg: #e8eaed;
  --chip-fg: #202124;
  --header-bg: rgba(248, 249, 250, 0.92);
  --divider: rgba(228, 228, 231, 0.9);
  --card-line: rgba(228, 228, 231, 0.9);
  --search-btn: #303134;
  --search-btn-hover: #3c4043;
  --primary-btn: #e8eaed;
  --primary-btn-fg: #202124;
}

html.dark {
  color-scheme: dark;
  --bg: #0b0f14;
  --fg: #e8eaed;
  --muted: #9aa0a6;
  --border: #3c4043;
  --input: #202124;
  --input-border: #5f6368;
  --btn: #303134;
  --btn-border: #5f6368;
  --btn-hover: #3c4043;
  --link: #8ab4f8;
  --url: #bdc1c6;
  --chip-bg: #303134;
  --chip-fg: #e8eaed;
  --header-bg: rgba(11, 15, 20, 0.92);
  --divider: rgba(63, 63, 70, 0.9);
  --card-line: rgba(63, 63, 70, 0.85);
  --search-btn: #3c4043;
  --search-btn-hover: #4a4d51;
  --primary-btn: #e8eaed;
  --primary-btn-fg: #202124;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.page-shell {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% 40%, rgba(66, 133, 244, 0.06), transparent 60%),
    var(--bg);
}
html.dark .page-shell {
  background:
    radial-gradient(ellipse 70% 45% at 50% 35%, rgba(66, 133, 244, 0.08), transparent 55%),
    var(--bg);
}

.home-wrap {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: flex-start;
  justify-content: center;
  padding: 4rem 1rem 2rem;
}
@media (min-width: 1024px) {
  .home-wrap {
    align-items: center;
    padding-top: 2rem;
  }
}

.theme-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.theme-btn:hover { background: var(--btn-hover); color: var(--fg); }

.home-center {
  width: 100%;
  max-width: 48rem;
  text-align: center;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  user-select: none;
  font-family: "Product Sans", "Trebuchet MS", Arial, sans-serif;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}
.logo-lg { font-size: clamp(2.75rem, 8vw, 4.5rem); }
.logo-sm { font-size: 1.75rem; }
.logo .dot {
  font-size: 0.72em;
  position: relative;
  top: 0.12em;
}

.search-row {
  position: relative;
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
}
.search-input {
  width: 100%;
  height: 3.25rem;
  border-radius: 999px;
  border: 1px solid var(--input-border);
  background: var(--input);
  color: var(--fg);
  padding: 0 7rem 0 1.25rem;
  outline: none;
}
.search-input::placeholder { color: var(--muted); }
.search-input:hover,
.search-input:focus {
  box-shadow: 0 1px 6px rgba(32, 33, 36, 0.22);
}
html.dark .search-input:hover,
html.dark .search-input:focus {
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}

.btn-search {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  background: var(--search-btn);
  color: #fff;
  padding: 0 1.1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.btn-search:hover { background: var(--search-btn-hover); }

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 28rem;
  margin: 1.25rem auto 0;
}
@media (min-width: 640px) {
  .home-actions {
    flex-direction: row;
    justify-content: center;
  }
}

.btn-primary,
.btn-soft {
  height: 2.75rem;
  border-radius: 999px;
  padding: 0 2rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 11rem;
  flex: 1;
}
@media (min-width: 640px) {
  .btn-primary, .btn-soft { flex: 0 0 auto; }
}

.btn-primary {
  border: 0;
  background: var(--primary-btn);
  color: var(--primary-btn-fg);
}
.btn-primary:hover { filter: brightness(0.96); }

.btn-soft {
  border: 1px solid var(--btn-border);
  background: var(--btn);
  color: var(--fg);
}
.btn-soft:hover {
  background: var(--btn-hover);
  border-color: var(--border);
}

.divider-bar {
  width: 10rem;
  height: 0.35rem;
  border-radius: 999px;
  background: var(--divider);
  margin: 2.5rem auto 0;
}

/* header search page */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
}
.header-inner {
  max-width: 64rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
}
.header-logo { display: none; flex-shrink: 0; }
@media (min-width: 640px) {
  .header-logo { display: inline-flex; }
}
.header-form { flex: 1; min-width: 0; }
.header-theme {
  position: static;
  flex-shrink: 0;
}

/* results */
.results-wrap {
  max-width: 48rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}
.meta-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.meta-label strong {
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg);
  font-weight: 700;
}
.meta-count {
  margin: 0.35rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.suggest-box {
  margin-top: 0.75rem;
  display: inline-block;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  color: var(--chip-fg);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
}
.suggest-box a {
  color: #8ab4f8;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.results-list {
  margin-top: 1.25rem;
}
.result-item {
  display: flex;
  gap: 0.75rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--card-line);
  animation: fade-in 0.35s ease-out both;
}
.favicon {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  overflow: hidden;
  background: var(--btn);
  flex-shrink: 0;
  margin-top: 0.15rem;
}
.favicon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.site-name {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.result-title {
  margin: 0.15rem 0 0;
  font-size: 1.15rem;
  font-weight: 650;
  line-height: 1.3;
  color: var(--link);
}
.result-title:hover { text-decoration: underline; }
.result-url {
  margin: 0.2rem 0 0;
  font-size: 0.875rem;
  color: var(--url);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-desc {
  margin: 0.4rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  margin-top: 2rem;
}
.pager a {
  min-width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  padding: 0 0.7rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--btn);
  color: var(--fg);
}
.pager a.active {
  background: #3b82f6;
  color: #fff;
}
.pager a:hover:not(.active) { filter: brightness(1.08); }

.empty {
  text-align: center;
  color: var(--muted);
  padding: 4rem 1rem;
}

.blocked {
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #fecaca;
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
