:root {
  --bg: #f7f8f9;
  --ink: #111111;
  --muted: #5a6468;
  --card: #ffffff;
  --line: #d9dee2;
  --accent: #2e4951;
  --accent-ink: #ffffff;
  --focus: #406772;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 88% 12%, #e7eef1 0%, transparent 36%),
    radial-gradient(circle at 10% 82%, #eef2f4 0%, transparent 42%),
    var(--bg);
  line-height: 1.45;
}

.page {
  width: min(980px, 92vw);
  margin: 3rem auto 4rem;
  min-height: calc(100vh - 7rem);
}

.brandbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
}

.brandmark img {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 2px solid rgba(23, 38, 29, 0.14);
}

.brandnav {
  display: inline-flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.brandnav a,
.brand-ctas a,
.ask-jonathan-link,
.meta-rephrase-link {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-color: rgba(46, 73, 81, 0.35);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.3s ease, background-color 0.3s ease, text-decoration-color 0.3s ease;
}

.brandnav a:hover,
.brand-ctas a:hover,
.ask-jonathan-link:hover,
.meta-rephrase-link:hover {
  color: #1f343c;
  text-decoration-color: rgba(46, 73, 81, 0.65);
  background-color: rgba(46, 73, 81, 0.08);
}

.hero h1 {
  color: var(--accent);
  margin: 0.25rem 0 0.6rem;
  line-height: 1.1;
  font-size: clamp(1.8rem, 4.2vw, 3rem);
  max-width: 22ch;
}

.kicker {
  margin: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

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

.proofline {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.proofline span {
  margin: 0 0.35rem;
}

.search-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  margin-top: 1.25rem;
  box-shadow: 0 18px 30px rgba(12, 28, 20, 0.08);
}

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

.search-form input,
.search-form button,
.chips button {
  font: inherit;
}

.search-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 0.9rem;
  background: #fff;
}

.search-form button {
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
}

.search-form input:focus,
.search-form button:focus,
.chips button:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.chips button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  background: #faf8f1;
  color: var(--ink);
  cursor: pointer;
}

.how-it-works {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.brand-ctas {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin: 0.55rem 0 0;
}

.meta {
  margin: 1rem 0 1.2rem;
}

.meta-card {
  background: linear-gradient(135deg, #ffffff 0%, #f4f8fa 100%);
  border: 1px solid #ced9de;
  border-radius: 14px;
  padding: 0.95rem 1rem 1rem;
  box-shadow: 0 12px 24px rgba(12, 28, 20, 0.08);
}

.meta-kicker {
  margin: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #4b6067;
  font-weight: 700;
}

.meta-intro {
  margin: 0.5rem 0 0;
  color: #263338;
}

.meta-intent {
  margin: 0.35rem 0 0;
  color: #12252c;
  font-weight: 700;
  font-size: 1.02rem;
}

.meta-stage {
  margin: 0.45rem 0 0;
  color: #3f555d;
  font-size: 0.92rem;
}

.meta-topics {
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.meta-pill {
  border: 1px solid #c5d4da;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  background: #fdfefe;
  color: #1f343c;
  font-size: 0.88rem;
}

.results {
  display: grid;
  gap: 1rem;
}

.group {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
}

.group h2 {
  margin: 0.2rem 0 0.8rem;
  font-size: 1.1rem;
}

.list {
  display: grid;
  gap: 0.65rem;
}

.item {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #e1ddd1;
  border-radius: 10px;
  padding: 0.75rem;
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.item:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(12, 28, 20, 0.08);
}

.item-header {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: baseline;
}

.item h3 {
  margin: 0;
  font-size: 1rem;
}

.item time {
  color: var(--muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.item-summary,
.item-meta {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.item-meta {
  font-size: 0.86rem;
}

.empty {
  margin-top: 1.3rem;
  color: var(--muted);
}

.ask-jonathan-fallback {
  font-size: 0.95rem;
}

.ask-jonathan-manual {
  margin-top: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.85rem;
}

.ask-jonathan-manual p {
  margin: 0 0 0.4rem;
}

.ask-copy-button {
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.45rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
}

.ask-copy-button:focus {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.ask-copy-status {
  min-height: 1.2em;
  margin: 1.15rem 0 0.3rem;
  line-height: 1.45;
}

.ask-template {
  margin: 0.45rem 0 0;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbfc;
  white-space: pre-wrap;
  color: #223137;
  font-size: 0.9rem;
}

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

@media (max-width: 720px) {
  .brandbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .item-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .meta-card {
    padding: 0.85rem 0.85rem 0.9rem;
  }
}
