:root {
  --ink: #14161a;
  --muted: #5d6470;
  --paper: #f6f3ec;
  --card: #ffffff;
  --line: #e2ddd1;
  --accent: #e5482f;
  --accent-ink: #b8321c;
  --radius: 14px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; line-height: 1.55; }
a { color: var(--accent-ink); }

.brand {
  display: inline-flex; align-items: baseline; gap: .35em;
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  font-weight: 700; letter-spacing: -0.03em; text-decoration: none; color: var(--ink);
}
.brand .num { color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- Header (results + inner pages) ---------- */
.topbar {
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line); background: var(--card);
  position: sticky; top: 0; z-index: 10;
}
.topbar .brand { font-size: 1.35rem; }
.topbar .box { flex: 1 1 420px; max-width: 720px; }

/* ---------- Home ---------- */
.hero {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4rem 1.25rem 3rem; text-align: center;
}
.hero .brand { font-size: clamp(2.6rem, 8vw, 5rem); line-height: 1; }
.hero .tagline { margin: .9rem 0 2.2rem; color: var(--muted); font-size: 1.1rem; max-width: 34rem; }
.hero .box { width: min(680px, 100%); }

/* ---------- Mobile logo ---------- */
@media (max-width: 600px) {
  /* Stack the logo: big "100" on top, "Search Engines" underneath */
  .hero .brand {
    flex-direction: column; align-items: center; gap: .05em;
    font-size: clamp(1.8rem, 9vw, 2.6rem); white-space: nowrap;
  }
  .hero .brand .num { font-size: 1.7em; line-height: .9; }
  .topbar { gap: .75rem 1.5rem; padding: .75rem 1rem; }
  .topbar .brand { font-size: 1.15rem; white-space: nowrap; }
}

/* ---------- Results ---------- */
.results { width: 100%; max-width: 900px; margin: 0 auto; padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 3rem; flex: 1; }

/* ---------- Content pages ---------- */
.page { width: 100%; max-width: 760px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; flex: 1; }
.page h1 { font-family: "Space Grotesk", "Inter", sans-serif; letter-spacing: -0.02em; }

/* ---------- Footer ---------- */
footer {
  display: flex; flex-wrap: wrap; gap: 1.25rem; justify-content: center;
  padding: 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem;
}
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--accent-ink); }

/* ---------- Search form ---------- */
.search {
  display: flex; align-items: center; gap: .4rem;
  padding: .35rem; background: var(--card);
  border: 1.5px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(229, 72, 47, .12); }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 1.1rem; color: var(--ink); padding: .7rem .8rem;
}
.search input::placeholder { color: #9aa0a9; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.search button {
  display: inline-flex; align-items: center; gap: .45rem;
  border: 0; border-radius: calc(var(--radius) - 4px); cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600;
  padding: .75rem 1.2rem;
}
.search button:hover { background: var(--accent-ink); }
.search button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.search svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.search.compact input { font-size: 1rem; padding: .5rem .7rem; }
.search.compact button { padding: .55rem 1rem; }
@media (max-width: 520px) { .search button span { display: none; } }

.empty { color: var(--muted); text-align: center; margin-top: 2rem; }

/* ---------- Light-touch styling of Google's results ---------- */
.gsc-control-cse { background: transparent !important; border: 0 !important; padding: 0 !important; }

/* Hide Google's "Search for '<query>' on Google" link at the bottom of results */
.gcsc-find-more-on-google,
.gcsc-find-more-on-google-root,
.gcsc-more-maybe-branding-root { display: none !important; }

/* Hide Google's numbered page links; replaced by Previous / Next buttons */
.gsc-cursor-box { display: none !important; }

.pager { display: flex; justify-content: space-between; gap: 1rem; max-width: 700px; margin: 1.5rem 0 .5rem; }
.pager[hidden] { display: none; }
.pager button {
  display: inline-flex; align-items: center; gap: .4rem;
  border: 1px solid var(--line); border-radius: calc(var(--radius) - 4px); cursor: pointer;
  background: var(--card); color: var(--ink); font: inherit; font-weight: 600;
  padding: .6rem 1.1rem;
}
.pager button:hover { border-color: var(--accent); color: var(--accent-ink); }
.pager button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.pager button[hidden] { display: none; }
.pager .next { margin-left: auto; }
.afs-ads:empty { display: none; }
.afs-ads { margin-bottom: 1rem; }
