/* Verify-COA — public stylesheet
   Light theme, charcoal accents, matching opsscience.org */

:root {
  --bg: #ffffff;
  --bg-subtle: #faf9f6;
  --fg: #0e0e0e;
  --fg-muted: #6b6b6b;
  --fg-soft:  #9a9a9a;
  --border: #e7e4dd;
  --border-strong: #cfcbc1;
  --accent: #0a0a0a;
  --accent-hover: #1f1f1f;
  --callout-bg: #f5efe2;
  --callout-border: #ead9b3;

  /* category palette — pastel tile, dark glyph */
  --cat-metabolic-bg:    #dbe6f3;  --cat-metabolic-fg:    #1f4d8c;
  --cat-tissue-repair-bg:#dde9dc;  --cat-tissue-repair-fg:#2f5c3e;
  --cat-aesthetic-bg:    #f0e5d0;  --cat-aesthetic-fg:    #8a6822;
  --cat-cognitive-bg:    #e0dbed;  --cat-cognitive-fg:    #4c3f7a;

  --serif: 'Playfair Display', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(10,10,10,0.04);
  --shadow-md: 0 4px 18px rgba(10,10,10,0.06);

  --container: 880px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; }
a { color: inherit; }

/* ---------- header / footer ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem clamp(1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--border);
}
.brand img { height: 36px; width: auto; }

.back-link {
  font-size: 0.875rem;
  color: var(--fg-muted);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.back-link:hover { color: var(--fg); }

.site-footer {
  max-width: var(--container);
  margin: 4rem auto 2rem;
  padding: 2rem clamp(1rem, 4vw, 2rem) 0;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--fg-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

/* ---------- container ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2rem) 2rem;
}

/* ---------- hero ---------- */
.hero {
  text-align: center;
  margin-bottom: 2.25rem;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
}
.hero h1 em {
  font-style: italic;
  font-weight: 400;
}
.lede {
  max-width: 38rem;
  margin: 0 auto;
  color: var(--fg-muted);
  font-size: 1rem;
}

/* ---------- divider with caption ---------- */
.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2.5rem 0 1.75rem;
  color: var(--fg-soft);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
}
.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.divider span { white-space: nowrap; }

/* ---------- controls ---------- */
.controls {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.search {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg);
  padding: 0 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10,10,10,0.06);
}
.search__icon {
  width: 18px; height: 18px;
  color: var(--fg-soft);
  flex-shrink: 0;
}
.search input {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0.85rem 0.75rem;
  font: inherit;
  color: var(--fg);
  outline: none;
}
.search input::placeholder { color: var(--fg-soft); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip {
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--fg-muted);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.chip:hover { color: var(--fg); border-color: var(--fg-muted); }
.chip.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---------- card list ---------- */
.coa-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-height: 8rem;
}
.coa-list:empty::before {
  content: "Loading…";
  display: block;
  padding: 2rem;
  text-align: center;
  color: var(--fg-soft);
}

/* ---------- card ---------- */
.coa-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(1rem, 3vw, 1.5rem);
  padding: 1.5rem clamp(1rem, 3vw, 1.75rem);
  border-bottom: 1px solid var(--border);
}
.coa-card:last-child { border-bottom: 0; }

.coa-card__icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  background: var(--bg-subtle);
  color: var(--fg-muted);
  flex-shrink: 0;
}
.coa-card__icon[data-cat="metabolic"]      { background: var(--cat-metabolic-bg);     color: var(--cat-metabolic-fg); }
.coa-card__icon[data-cat="tissue-repair"]  { background: var(--cat-tissue-repair-bg); color: var(--cat-tissue-repair-fg); }
.coa-card__icon[data-cat="aesthetic"]      { background: var(--cat-aesthetic-bg);     color: var(--cat-aesthetic-fg); }
.coa-card__icon[data-cat="cognitive"]      { background: var(--cat-cognitive-bg);     color: var(--cat-cognitive-fg); }
.coa-card__glyph {
  width: 26px; height: 26px;
  fill: currentColor;
  stroke: currentColor;
}

.coa-card__body { min-width: 0; }
.coa-card__meta {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--fg-soft);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.coa-card__sep { opacity: 0.6; }
.coa-card__title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.25;
  margin: 0 0 0.25rem;
  letter-spacing: -0.005em;
}
.coa-card__sub {
  margin: 0;
  color: var(--fg-muted);
  font-size: 0.95rem;
}

.coa-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: 0.65rem 1.15rem;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, transform 0.15s;
}
.coa-card__cta:hover { background: var(--accent-hover); }
.coa-card__cta:active { transform: translateY(1px); }
.coa-card__cta svg { flex-shrink: 0; }

/* highlighted (deep-linked) card */
.coa-card.is-highlight {
  background: #fffbeb;
  animation: pulse 1.6s ease-out 1;
}
@keyframes pulse {
  0%   { background: #fff7d1; }
  100% { background: #fffbeb; }
}

/* ---------- empty / error states ---------- */
.empty {
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--fg-muted);
}
.empty button {
  background: none;
  border: 0;
  color: var(--fg);
  text-decoration: underline;
  padding: 0;
  font: inherit;
}

/* ---------- callout ---------- */
.callout {
  margin-top: 2rem;
  padding: 1.1rem 1.25rem;
  background: var(--callout-bg);
  border: 1px solid var(--callout-border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-size: 0.92rem;
  line-height: 1.55;
}
.callout strong { font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 600px) {
  .coa-card {
    grid-template-columns: 56px 1fr;
    grid-template-areas:
      "icon body"
      "cta  cta";
    row-gap: 1rem;
  }
  .coa-card__icon { grid-area: icon; width: 56px; height: 56px; }
  .coa-card__body { grid-area: body; }
  .coa-card__cta {
    grid-area: cta;
    justify-content: center;
    padding: 0.75rem;
  }
  .site-footer { flex-direction: column; align-items: flex-start; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
