@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT@9..144,400..700,30..100&display=swap');

:root {
  /* Accent — brand green (logo leaf), used sparingly */
  --accent: oklch(48% 0.13 145);
  --accent-soft: oklch(94% 0.045 145);
  --accent-line: oklch(82% 0.07 145);
  --amber: oklch(70% 0.16 60);
  --green: oklch(62% 0.13 152);
  --green-soft: oklch(96% 0.02 152);
  --red: oklch(58% 0.18 27);
  --red-soft: oklch(96% 0.025 27);

  /* Brand pastels — tuned to the Propel logo's green + yellow */
  --pastel-mint: oklch(93% 0.07 145);
  --pastel-mint-ink: oklch(36% 0.09 145);
  --pastel-butter: oklch(94% 0.085 95);
  --pastel-butter-ink: oklch(38% 0.08 75);
  --pastel-sky: oklch(92% 0.055 245);
  --pastel-sky-ink: oklch(38% 0.08 245);
  --pastel-lavender: oklch(91% 0.055 295);
  --pastel-lavender-ink: oklch(38% 0.09 295);

  /* Neutrals — slightly cool */
  --bg: oklch(98.5% 0.004 270);
  --surface: oklch(100% 0 0);
  --ink: oklch(22% 0.01 270);
  --ink-2: oklch(45% 0.012 270);
  --ink-3: oklch(62% 0.012 270);
  --line: oklch(91% 0.006 270);
  --line-soft: oklch(95% 0.005 270);

  --font: 'Polymath', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --serif: 'Fraunces', 'Source Serif Pro', Georgia, serif;
  --mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  --features: 'pnum' on, 'lnum' on, 'cv05' on, 'cv14' on, 'cv23' on, 'cv27' on, 'cv28' on, 'cv29' on;
  --radius: 10px;
  --radius-lg: 20px;
  --radius-sm: 6px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: light; }

body {
  font-family: var(--font);
  font-feature-settings: var(--features);
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

code, .mono { font-family: var(--mono); font-size: 0.92em; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  display: grid;
  gap: 2.5rem;
}

/* ── Masthead ────────────────────────────────────────────────────────────── */
.masthead {
  display: grid;
  gap: 0.875rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  width: max-content;
  margin-bottom: 0.25rem;
  border-radius: 8px;
  padding: 0.125rem 0.375rem 0.125rem 0;
  transition: opacity 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}
.brand-mark:hover { opacity: 0.78; }
.brand-mark:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.brand-logo {
  display: block;
  background: var(--surface);
  border-radius: 7px;
}
.brand-wordmark {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 80;
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.kicker {
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}
.headline {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-size: clamp(1.75rem, 1.6vw + 1.2rem, 2.25rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.022em;
  max-width: 22ch;
  color: var(--ink);
}
.headline #found-count {
  font-weight: 700;
  color: var(--ink);
  font-feature-settings: var(--features);
}
.headline #total-count {
  font-weight: 500;
  color: var(--ink-2);
}
.headline-of { color: var(--ink-3); font-weight: 400; }
.headline-rest { color: var(--ink-2); font-weight: 400; }
.headline-em {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
}
.subline {
  font-size: 0.8125rem;
  color: var(--ink-3);
  min-height: 1.4em;
}
.subline .delta {
  font-weight: 600;
  color: var(--ink-2);
}
.subline .delta-up {
  color: var(--green);
}

.toolbar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}
.run-picker {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
}
.run-picker-label { color: var(--ink-3); }
.run-picker select {
  font: inherit;
  font-feature-settings: var(--features);
  border: none;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  padding-right: 0.5rem;
  font-weight: 500;
}
.run-picker select:focus { outline: none; }
.run-picker:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.btn {
  font: inherit;
  font-feature-settings: var(--features);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s cubic-bezier(0.22, 1, 0.36, 1),
              color 0.15s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.1s cubic-bezier(0.22, 1, 0.36, 1);
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--ink);
  color: var(--surface);
}
.btn-primary:hover:not(:disabled) { background: oklch(32% 0.01 270); }
.btn-primary:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

/* ── Section heads ───────────────────────────────────────────────────────── */
.section-head {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.875rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.section-head code {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 0.25rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 500;
}
.section-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-3);
  font-feature-settings: var(--features);
}

/* ── Found cards ─────────────────────────────────────────────────────────── */
.found-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}
.found-card {
  font: inherit;
  font-feature-settings: var(--features);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  cursor: pointer;
  display: grid;
  gap: 0.625rem;
  position: relative;
  transition: border-color 0.15s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.15s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}
.found-card:hover {
  border-color: var(--ink-3);
  box-shadow: 0 4px 16px -8px oklch(20% 0.01 270 / 0.18);
  transform: translateY(-1px);
}
.found-card:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.found-card.changed::after {
  content: 'updated';
  position: absolute;
  top: 0.625rem;
  right: 0.75rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--amber);
  background: oklch(96% 0.04 60);
  padding: 0.125rem 0.4rem;
  border-radius: 3px;
}
.found-card-head {
  display: grid;
  gap: 0.125rem;
  position: relative;
}
.found-card-name {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 36, 'SOFT' 60;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.015em;
}
.found-card-meta {
  font-size: 0.7rem;
  color: var(--ink-3);
}
.found-card-stats {
  display: flex;
  gap: 0.625rem;
  align-items: baseline;
  justify-content: space-between;
  position: relative;
}
.stat {
  font-size: 0.75rem;
  color: var(--ink-2);
}
.stat-num {
  font-weight: 650;
  color: var(--ink);
  font-feature-settings: var(--features);
}
.found-card-url {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 18ch;
}

/* ── Missing chips ───────────────────────────────────────────────────────── */
.missing-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}
.missing-chip {
  font: inherit;
  font-feature-settings: var(--features);
  font-size: 0.75rem;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
  white-space: nowrap;
}
.missing-chip:hover {
  border-color: var(--ink-3);
  color: var(--ink);
  background: var(--surface);
}
.missing-chip:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.missing-chip.type-territory {
  background: var(--bg);
  font-style: italic;
}
.missing-chip.type-dc {
  background: var(--bg);
  font-style: italic;
}

/* ── Chart ───────────────────────────────────────────────────────────────── */
.chart-section {
  display: grid;
  gap: 0.75rem;
}
.chart-container {
  width: 100%;
  height: 160px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.chart-container svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  display: block;
}
.chart-empty {
  color: var(--ink-3);
  font-size: 0.8125rem;
  padding: 1.5rem;
  text-align: center;
}

/* ── Dialog ──────────────────────────────────────────────────────────────── */
dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  max-width: 640px;
  width: 92vw;
  max-height: 82vh;
  box-shadow: 0 30px 60px -20px oklch(20% 0.04 270 / 0.25),
              0 12px 20px -10px oklch(20% 0.04 270 / 0.15);
  overflow: hidden;
  background: var(--surface);
  color: var(--ink);
}
dialog[open] {
  display: flex;
  flex-direction: column;
  inset: 0;
  margin: auto;
  animation: dialog-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
dialog::backdrop {
  background: oklch(22% 0.01 270 / 0.4);
  backdrop-filter: blur(2px);
  animation: backdrop-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }

.dialog-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.dialog-header h2 {
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.status-badge {
  font-size: 0.65rem;
  font-weight: 650;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.3rem;
}
.status-badge.found { background: var(--accent-soft); color: var(--accent); }
.status-badge.not-found { background: var(--line-soft); color: var(--ink-3); }

.dialog-body {
  overflow-y: auto;
  padding: 1.25rem 1.5rem;
  flex: 1;
  display: grid;
  gap: 1.25rem;
}

.dialog-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-3);
  cursor: pointer;
  padding: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}
.dialog-close:hover { color: var(--ink); background: var(--line-soft); }

/* llms.txt content rendering */
.llms-content h3,
.dialog-body h3 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 0.75rem;
}

.lc-h {
  color: var(--ink);
  letter-spacing: -0.005em;
}
.lc-h1 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.lc-h2 {
  font-size: 0.875rem;
  font-weight: 650;
  margin: 1.125rem 0 0.375rem;
  padding-top: 0.875rem;
  border-top: 1px solid var(--line-soft);
}
.lc-h2:first-child,
.lc-h1 + .lc-h2,
.lc-p + .lc-h2,
.lc-quote + .lc-h2 { /* keep separator only between content sections */ }
.lc-h1 + .lc-h2 {
  border-top: none;
  padding-top: 0;
  margin-top: 0.75rem;
}
.lc-h3 {
  font-size: 0.8125rem;
  font-weight: 650;
  margin: 0.75rem 0 0.25rem;
  color: var(--ink-2);
}

.lc-p {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0.375rem 0;
  max-width: 65ch;
}

.lc-quote {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-3);
  border-left: 2px solid var(--accent-line);
  padding: 0.125rem 0 0.125rem 0.75rem;
  margin: 0.5rem 0;
}

.lc-list {
  list-style: none;
  margin: 0.5rem 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}
.lc-li {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--ink-2);
  padding-left: 1rem;
  position: relative;
}
.lc-li::before {
  content: '';
  position: absolute;
  left: 0.25rem;
  top: 0.6em;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--ink-3);
}
.lc-li-link {
  padding: 0.25rem 0 0.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.lc-li-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.lc-li-link a:hover { text-decoration: underline; }
.lc-li-desc {
  font-size: 0.75rem;
  color: var(--ink-3);
}

.lc-p a, .lc-li a, .lc-quote a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-line);
}
.lc-p a:hover, .lc-li a:hover, .lc-quote a:hover { border-bottom-color: var(--accent); }

.lc-raw {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  max-height: 320px;
  overflow-y: auto;
}

/* Diff */
.diff-view {
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.55;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.diff-line {
  padding: 0 0.75rem;
  white-space: pre-wrap;
  word-break: break-all;
}
.diff-line.add { background: var(--green-soft); color: var(--green); }
.diff-line.remove { background: var(--red-soft); color: var(--red); }
.diff-line.same { color: var(--ink-2); }

/* ── Why-llms.txt brand section ──────────────────────────────────────────── */
.why-section {
  margin-top: 1rem;
  padding: 2.75rem 0 1rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1.25rem;
}
.why-eyebrow {
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-3);
}
.why-headline {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 30;
  font-weight: 500;
  font-size: clamp(1.625rem, 2.4vw + 1rem, 2.375rem);
  line-height: 1.1;
  letter-spacing: -0.022em;
  color: var(--ink);
  max-width: 22ch;
}
.why-headline em {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 144, 'SOFT' 100;
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
}
.why-lede {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 62ch;
}
.why-lede code {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 0.25rem;
  border-radius: 4px;
  font-size: 0.92em;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.875rem;
  margin-top: 0.5rem;
}
.why-card {
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.375rem 1.625rem;
  display: grid;
  gap: 0.625rem;
  align-content: start;
  min-height: 220px;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.why-card:hover { transform: translateY(-2px); }
.why-card--mint { background: var(--pastel-mint); color: var(--pastel-mint-ink); }
.why-card--butter { background: var(--pastel-butter); color: var(--pastel-butter-ink); }
.why-card--sky { background: var(--pastel-sky); color: var(--pastel-sky-ink); }
.why-card--lavender { background: var(--pastel-lavender); color: var(--pastel-lavender-ink); }

.why-card-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  margin-bottom: 0.25rem;
}
.why-card-title {
  font-family: var(--serif);
  font-variation-settings: 'opsz' 36, 'SOFT' 60;
  font-weight: 600;
  font-size: 1.1875rem;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: inherit;
}
.why-card-body {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: inherit;
  opacity: 0.82;
}

.why-footer {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 56ch;
  margin-top: 0.75rem;
}
.why-footer code {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 0 0.25rem;
  border-radius: 4px;
  font-size: 0.92em;
}
.why-footer a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-line);
  font-weight: 500;
}
.why-footer a:hover { border-bottom-color: var(--accent); }

/* ── Page footer ─────────────────────────────────────────────────────────── */
.page-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  display: flex;
  align-items: center;
  gap: 0.875rem;
  border-top: 1px solid var(--line);
  margin-top: -1px;
}
.page-footer-brand {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  transition: opacity 0.15s;
}
.page-footer-brand:hover { opacity: 0.78; }
.page-footer-brand:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.page-footer-brand svg {
  display: block;
  background: var(--surface);
  border-radius: 7px;
}
.page-footer-copy {
  font-size: 0.8125rem;
  color: var(--ink-2);
}
.page-footer-copy a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  font-weight: 500;
  transition: border-color 0.12s;
}
.page-footer-copy a:hover { border-bottom-color: var(--ink-3); }

/* Responsive */
@media (max-width: 640px) {
  .app { padding: 2rem 1rem 3rem; gap: 2rem; }
  .headline { font-size: 1.375rem; }
  .found-grid { grid-template-columns: 1fr; }
  .why-grid { grid-template-columns: 1fr 1fr; }
  .why-card { min-height: 0; padding: 1.25rem; }
  .toolbar { flex-wrap: wrap; }
  .page-footer { padding: 1.5rem 1rem 2.5rem; flex-wrap: wrap; }
}
@media (max-width: 420px) {
  .why-grid { grid-template-columns: 1fr; }
}
