:root {
  --bg: #faf7f2;
  --bg-soft: #f2ece2;
  --surface: #ffffff;
  --ink: #1c1a17;
  --muted: #6b655c;
  --line: #e7ded1;
  --accent: #ff5a3c;
  --accent-ink: #ffffff;
  --ring: rgba(255, 90, 60, 0.28);
  --shadow: 0 1px 2px rgba(28, 26, 23, .04), 0 8px 24px rgba(28, 26, 23, .06);
  --radius: 16px;
  --max: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---------- header ---------- */
.site {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: .85rem clamp(1rem, 4vw, 2rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; }
.brand-mark {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
  font-family: var(--serif); font-size: 1.15rem; line-height: 1;
}
.brand-word { letter-spacing: -.02em; font-size: 1.1rem; }
.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.site-nav a { color: var(--muted); font-weight: 500; }
.site-nav a:hover { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .7rem 1.15rem; border-radius: 999px;
  font-weight: 600; font-size: .95rem; cursor: pointer;
  border: 1px solid transparent; transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-ghost { border-color: var(--line); color: var(--ink) !important; }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-quiet { color: var(--muted) !important; }
.btn-quiet:hover { color: var(--ink) !important; }
.btn-lg { padding: .95rem 1.7rem; font-size: 1.05rem; }

/* ---------- hero ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }

.hero { text-align: center; padding: clamp(3rem, 9vw, 6.5rem) 0 clamp(2rem, 5vw, 3.5rem); }
.eyebrow {
  text-transform: uppercase; letter-spacing: .18em; font-size: .72rem;
  font-weight: 700; color: var(--accent); margin: 0 0 1.1rem;
}
.hero h1 {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(2.4rem, 6.5vw, 4.2rem); line-height: 1.05;
  letter-spacing: -.02em; margin: 0 0 1.1rem;
}
.lede {
  max-width: 40ch; margin: 0 auto 2rem; font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  color: var(--muted);
}

.search {
  position: relative; max-width: 34rem; margin: 0 auto 1.5rem;
}
.search-ico {
  position: absolute; left: 1.05rem; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; fill: none; stroke: var(--muted); stroke-width: 2;
  stroke-linecap: round;
}
.search input {
  width: 100%; padding: .95rem 1.1rem .95rem 2.9rem;
  font-size: 1.02rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: var(--shadow); outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }

.hero-cta { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; align-items: center; }

/* ---------- explore ---------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin: 2.5rem 0 1.25rem;
}
.section-head h2, .why + .claim h2, .claim h2 { font-family: var(--serif); letter-spacing: -.01em; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }

.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .14s ease, border-color .14s ease;
}
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card a { display: block; padding: 1.25rem 1.35rem; height: 100%; }
.card h3 { margin: 0 0 .15rem; font-size: 1.15rem; letter-spacing: -.01em; }
.card .domain { margin: 0 0 .7rem; font-size: .82rem; color: var(--accent); font-weight: 600; }
.card .blurb { margin: 0 0 1rem; color: var(--muted); font-size: .95rem; }
.card .pulse { margin: 0; font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .45rem; }
.dot {
  width: 8px; height: 8px; border-radius: 50%; background: #33c26a;
  box-shadow: 0 0 0 3px color-mix(in srgb, #33c26a 22%, transparent);
}
.pulse-soon { color: var(--muted); }
.pulse-soon .dot {
  background: #c9a227;
  box-shadow: 0 0 0 3px color-mix(in srgb, #c9a227 22%, transparent);
}

.empty { text-align: center; color: var(--muted); padding: 2rem 0; }
.empty a { color: var(--accent); font-weight: 600; }

/* ---------- why ---------- */
.why {
  display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin: clamp(3rem, 7vw, 5rem) 0; padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px);
}
.why-item h3 { font-size: 1.15rem; margin: 0 0 .4rem; letter-spacing: -.01em; }
.why-item p { margin: 0; color: var(--muted); }

/* ---------- claim ---------- */
.claim { text-align: center; padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(3rem, 8vw, 5.5rem); }
.claim h2 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); margin: 0 0 .6rem; }
.claim > p { color: var(--muted); font-size: 1.1rem; margin: 0 0 1.6rem; }
.claim .fine { font-size: .85rem; margin-top: 1rem; }

/* ---------- footer ---------- */
.site-foot {
  max-width: var(--max); margin: 0 auto; padding: 2rem clamp(1rem, 4vw, 2rem) 3rem;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 1rem 1.5rem; flex-wrap: wrap;
}
.site-foot nav { display: flex; gap: 1.25rem; }
.site-foot nav a { color: var(--muted); }
.site-foot nav a:hover { color: var(--ink); }
.site-foot .small { margin: 0; flex-basis: 100%; }

@media (max-width: 560px) {
  .site-nav a:not(.btn) { display: none; }
}

/* ---------- browse + search pages ---------- */
.page-head { padding: clamp(2rem, 6vw, 3.5rem) 0 1.25rem; text-align: center; }
.page-head h1 {
  font-family: var(--serif); font-weight: 700; letter-spacing: -.02em;
  font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 .5rem;
}
.page-head p { color: var(--muted); margin: 0 auto; max-width: 46ch; }

.status { color: var(--muted); text-align: center; padding: 1.25rem 0 .25rem; }
.status a { color: var(--accent); font-weight: 600; }

.results { display: grid; gap: 1.1rem; margin: 1.5rem 0 3rem; }
.result-group {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.result-group h3 {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  margin: 0; padding: .85rem 1.25rem; font-size: 1.05rem; letter-spacing: -.01em;
  border-bottom: 1px solid var(--line); background: var(--bg-soft);
}
.result-group h3 .domain { font-size: .8rem; font-weight: 600; color: var(--accent); }

.hits { list-style: none; margin: 0; padding: 0; }
.hits li + li { border-top: 1px solid var(--line); }
.hits a { display: block; padding: .85rem 1.25rem; }
.hits a:hover { background: var(--bg-soft); }
.hit-title { margin: 0 0 .2rem; font-weight: 600; }
.hit-snippet { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.55; }
/* MediaWiki marks matched terms in the snippet it returns */
.hit-snippet .searchmatch {
  color: var(--ink); font-weight: 600;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 3px; padding: 0 .15em;
}
