/* Field Notes stylesheet.
   Every color and font lives in the :root block below. To match drkarenboyd.com,
   change these values only; nothing else needs editing. */
:root {
  --paper: #f3f5f0;        /* pale lichen page */
  --paper-2: #e8ece4;      /* panels, inputs */
  --card: #fbfcf9;         /* specimen labels */
  --rule: #cfd6ca;         /* hairlines and borders */
  --ink: #1f2a24;          /* body text: forest ink */
  --ink-soft: #4d5a52;     /* secondary text */
  --moss: #3f6b4a;         /* links, buttons, "worked" stamp */
  --moss-deep: #2c4d35;
  --berry: #8c2f39;        /* "didn't work" stamp */
  --lake: #2f5d8a;         /* "surprise" stamp */
  --ochre: #7d5f12;        /* "workaround" stamp */
  --alert: #b3261e;        /* the red "unclaimed" warning */
  --alert-bg: #fbeceb;
  --test: #6b4f8a;         /* "invented test data" label */
  --focus: #1d6fd1;

  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Public Sans", "Helvetica Neue", Arial, sans-serif;

  --measure: 70ch;
  --radius: 3px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--serif);
}
a { color: var(--moss); text-underline-offset: 0.18em; }
a:hover { color: var(--moss-deep); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; font-weight: 600; margin: 1.6em 0 0.5em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -0.01em; margin-top: 0.4em; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; max-width: var(--measure); }
.sans, button, input, select, textarea, label, .tag, .meta, nav, .stamp { font-family: var(--sans); }
.meta { color: var(--ink-soft); font-size: 0.9rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 8px; z-index: 10; }

/* ---------- header ---------- */
.site-head { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 24px; padding-top: 14px; padding-bottom: 12px; }
.brand { text-decoration: none; color: var(--ink); }
.brand strong { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; display: block; line-height: 1.1; }
.brand span { font-family: var(--sans); font-size: 0.82rem; color: var(--ink-soft); }
.site-head nav { margin-left: auto; display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.95rem; }
.site-head nav a { color: var(--ink); text-decoration: none; }
.site-head nav a:hover, .site-head nav a[aria-current] { text-decoration: underline; }

main { padding: 24px 0 64px; }
.site-foot { border-top: 1px solid var(--rule); padding: 24px 0 40px; font-family: var(--sans); font-size: 0.88rem; color: var(--ink-soft); }

/* ---------- flash messages ---------- */
.flash { font-family: var(--sans); padding: 10px 14px; border-radius: var(--radius); margin: 0 0 16px; border-left: 4px solid var(--moss); background: var(--card); }
.flash.error { border-color: var(--alert); background: var(--alert-bg); }
.flash.info { border-color: var(--lake); }

/* ---------- buttons and forms ---------- */
.btn, button {
  display: inline-block; font-size: 1rem; font-weight: 600; line-height: 1.2;
  padding: 11px 18px; border-radius: var(--radius); border: 1px solid var(--moss);
  background: var(--moss); color: #fff; cursor: pointer; text-decoration: none;
}
.btn:hover, button:hover { background: var(--moss-deep); color: #fff; }
.btn.quiet, button.quiet { background: transparent; color: var(--moss); }
.btn.quiet:hover, button.quiet:hover { background: var(--paper-2); color: var(--moss-deep); }
button.danger { background: var(--alert); border-color: var(--alert); }
input[type=text], input[type=email], input[type=url], input[type=search], input[type=number], select, textarea {
  width: 100%; font-size: 1rem; padding: 10px 12px; border: 1px solid var(--rule);
  border-radius: var(--radius); background: var(--card); color: var(--ink);
}
textarea { min-height: 7em; font-family: var(--serif); line-height: 1.55; resize: vertical; }
label { display: block; font-weight: 600; font-size: 0.95rem; margin: 18px 0 6px; }
.hint { display: block; font-family: var(--sans); font-weight: 400; color: var(--ink-soft); font-size: 0.88rem; margin-top: 2px; }
fieldset { border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px 18px 18px; margin: 24px 0; background: var(--card); }
legend { font-family: var(--sans); font-weight: 700; padding: 0 6px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.checks label { display: inline-flex; gap: 6px; align-items: center; font-weight: 400; margin: 0; padding: 4px 10px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); cursor: pointer; font-size: 0.92rem; }
.checks label:has(input:checked) { border-color: var(--moss); background: #e3ece3; }
.row { display: grid; gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.honey { position: absolute; left: -5000px; }
.form-note { font-family: var(--sans); background: #e9f0e6; border-radius: var(--radius); padding: 12px 16px; max-width: var(--measure); }
details.more > summary { font-family: var(--sans); cursor: pointer; color: var(--moss); font-weight: 600; margin: 12px 0; }

/* ---------- the specimen label (a learning) ---------- */
.specimen {
  position: relative; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 16px 18px 14px; margin: 0 0 14px;
  background-image: linear-gradient(var(--rule), var(--rule));
  background-size: 1px 100%; background-repeat: no-repeat; background-position: 6px 0;
}
.specimen h3 { margin: 0 0 6px; font-size: 1.12rem; padding-right: 7.5rem; }
.specimen h3 a { color: var(--ink); text-decoration: none; }
.specimen h3 a:hover { text-decoration: underline; }
.specimen p { margin: 0 0 8px; }
.specimen .from { font-family: var(--sans); font-size: 0.88rem; color: var(--ink-soft); }
.stamp {
  position: absolute; top: 12px; right: 14px; transform: rotate(-3deg);
  font-weight: 800; font-size: 0.78rem; letter-spacing: 0.02em; padding: 3px 8px;
  border: 2px solid currentColor; border-radius: 4px; color: var(--ink-soft); background: transparent;
  opacity: 0.92;
}
.stamp.worked { color: var(--moss); }
.stamp.failed { color: var(--berry); }
.stamp.surprise { color: var(--lake); }
.stamp.workaround { color: var(--ochre); }
.stamp.inline { position: static; display: inline-block; margin-right: 8px; }
@media (max-width: 520px) {
  .specimen h3 { padding-right: 0; }
  .stamp { position: static; display: inline-block; margin-bottom: 8px; }
}

/* ---------- warnings ---------- */
.unclaimed { font-family: var(--sans); color: var(--alert); background: var(--alert-bg); border: 1px solid #e6b8b4;
  border-radius: var(--radius); padding: 8px 12px; font-size: 0.9rem; font-weight: 600; margin: 6px 0 10px; }
.unclaimed.big { font-size: 1rem; padding: 12px 16px; }
/* On result cards the warning stays red and readable, but drops the box so a list of results isn't a wall of red. */
.specimen .unclaimed, .proj-card .unclaimed { background: none; border: 0; border-left: 3px solid var(--alert);
  border-radius: 0; padding: 2px 0 2px 10px; font-size: 0.84rem; font-weight: 600; margin: 8px 0 0; }
.tag-rows { margin: 12px 0 0; }
.tag-rows dt { font-family: var(--sans); font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; margin-top: 10px; }
.tag-rows dd { margin: 4px 0 0; }
.filter-panel > summary { display: none; }
@media (max-width: 879px) {
  .filter-panel { border: 1px solid var(--rule); border-radius: var(--radius); padding: 8px 12px; background: var(--card); }
  .filter-panel > summary { display: list-item; cursor: pointer; font-weight: 700; color: var(--moss); }
}
.testdata { font-family: var(--sans); color: var(--test); border: 1px dashed var(--test); border-radius: var(--radius);
  padding: 6px 10px; font-size: 0.88rem; font-weight: 600; display: inline-block; margin: 4px 0 8px; }

/* ---------- tags ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 6px 0; }
.tag { font-size: 0.8rem; padding: 2px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink); text-decoration: none; }
a.tag:hover { background: #dbe4d6; }

/* ---------- home ---------- */
.ask { padding: 28px 0 8px; }
.ask h1 { max-width: 18ch; font-size: clamp(2.1rem, 5.2vw, 3.3rem); margin: 0 0 14px; }
.ask p { font-size: 1.12rem; color: var(--ink-soft); }
.askbox { display: flex; gap: 8px; max-width: 720px; margin: 18px 0 8px; }
.askbox input { font-size: 1.1rem; padding: 14px 16px; }
.examples { font-family: var(--sans); font-size: 0.9rem; color: var(--ink-soft); }
.examples a { margin-right: 10px; }
.home-cols { display: grid; gap: 36px; grid-template-columns: 1fr; margin-top: 36px; }
@media (min-width: 880px) { .home-cols { grid-template-columns: 1fr 1.35fr; } }
.themes h2, .recent h2 { margin-top: 0; }
.theme-group { margin-bottom: 22px; }
.theme-group h3 { font-family: var(--sans); font-size: 0.95rem; color: var(--ink-soft); margin: 0 0 8px; font-weight: 600; }
.theme-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--rule); }
.theme-list li { border-bottom: 1px solid var(--rule); }
.theme-list a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 2px; text-decoration: none; color: var(--ink); }
.theme-list a:hover { background: var(--paper-2); }
.theme-list .n { font-family: var(--sans); color: var(--ink-soft); font-size: 0.9rem; }
.contribute { margin-top: 40px; padding: 20px 22px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); }
.contribute h2 { margin-top: 0; }

/* ---------- search ---------- */
.search-head { display: flex; gap: 8px; max-width: 760px; margin-bottom: 14px; }
.search-layout { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 880px) { .search-layout { grid-template-columns: 260px 1fr; } }
.filters { font-family: var(--sans); font-size: 0.92rem; }
.filters details { border-bottom: 1px solid var(--rule); padding: 8px 0; }
.filters summary { cursor: pointer; font-weight: 700; }
.filters .opt { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin: 6px 0; font-size: 0.92rem; }
.filters .opt .n { color: var(--ink-soft); margin-left: auto; }
.filters .facet-q { color: var(--ink-soft); font-size: 0.82rem; margin: 2px 0 6px; }
.toggle { font-family: var(--sans); display: inline-flex; border: 1px solid var(--moss); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.toggle a { padding: 7px 14px; text-decoration: none; }
.toggle a[aria-current] { background: var(--moss); color: #fff; }
.result-count { font-family: var(--sans); color: var(--ink-soft); font-size: 0.92rem; margin-bottom: 12px; }
.proj-card { border-bottom: 1px solid var(--rule); padding: 14px 0; }
.proj-card h3 { margin: 0 0 4px; }
.proj-card p { margin: 0 0 6px; }
.waiting { margin-top: 32px; }
.waiting h2 { font-size: 1.15rem; }
.empty { font-family: var(--sans); padding: 18px; border: 1px dashed var(--rule); border-radius: var(--radius); }

/* ---------- project page ---------- */
.proj-head .kicker { font-family: var(--sans); color: var(--ink-soft); font-size: 0.92rem; margin: 0; }
.proj-layout { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .proj-layout { grid-template-columns: 1fr 300px; } }
.facts { font-family: var(--sans); font-size: 0.92rem; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--card); padding: 4px 16px 14px; align-self: start; }
.facts dt { font-weight: 700; margin-top: 12px; }
.facts dd { margin: 2px 0 0; }
.lede { font-size: 1.2rem; line-height: 1.55; max-width: var(--measure); }
.why { border-left: 4px solid var(--moss); padding: 4px 0 4px 16px; margin: 18px 0; max-width: var(--measure); }
.why strong { font-family: var(--sans); display: block; font-size: 0.9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.sources li, .outputs li { margin-bottom: 6px; }
.private { font-family: var(--sans); font-size: 0.8rem; color: var(--berry); font-weight: 700; }
.log { font-family: var(--sans); font-size: 0.85rem; color: var(--ink-soft); }
.no-learnings { font-family: var(--sans); padding: 16px 18px; border: 1px dashed var(--moss); border-radius: var(--radius); background: #eef3ec; }

/* ---------- admin ---------- */
.admin-nav { font-family: var(--sans); display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); margin-bottom: 18px; font-size: 0.92rem; }
table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 0.92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-weight: 700; }
.table-wrap { overflow-x: auto; }
.pill { font-family: var(--sans); font-size: 0.78rem; padding: 2px 8px; border-radius: 999px; background: var(--paper-2); white-space: nowrap; }
.pill.urgent { background: var(--alert); color: #fff; }
.diff td:nth-child(2) { color: var(--berry); text-decoration: line-through; }
.diff td:nth-child(3) { color: var(--moss-deep); }
pre.email { white-space: pre-wrap; font-size: 0.85rem; background: var(--card); border: 1px solid var(--rule); padding: 10px; border-radius: var(--radius); }
.inline-form { display: grid; gap: 8px; grid-template-columns: 2fr 3fr 70px 120px auto; align-items: center; }
@media (max-width: 720px) { .inline-form { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
