/* =========================================================
   style.css — Birdwise

   One stylesheet, no framework, no build step. The rules are
   grouped in the order a page is built: tokens, base, chrome,
   home, tools, prose, footer, responsive.

   Two conventions worth knowing before editing:

   1. Every number a user reads is wrapped in .num, which switches
      to the monospace stack. Columns of measurements only line up
      if the digits are the same width, and a proportional font
      makes "8.75 in" and "31 in" look like different quantities.

   2. Grid tracks that hold text use minmax(0, 1fr), never 1fr.
      A bare 1fr is minmax(auto, 1fr), and the auto minimum refuses
      to shrink below the longest word — which is how a 390px
      screen ends up with a horizontal scrollbar.
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  /* Natural palette: cream paper, forest green, sky blue. */
  --cream: #f7f5ef;
  --cream-deep: #efeade;
  --paper: #fffdf8;
  --sand: #e8e0cf;
  --line: #ded6c5;
  --line-soft: #eae3d4;

  --ink: #1c2420;
  --ink-soft: #46544c;
  --ink-mute: #75837a;

  --forest: #2f5d3a;
  --forest-deep: #1e4227;
  --forest-soft: #e4ede2;
  --sky: #35719a;
  --sky-soft: #e1edf5;
  --amber: #9c6520;
  --amber-soft: #f7edd9;
  --brick: #a13c31;
  --brick-soft: #f8e4e0;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --shadow-sm: 0 1px 2px rgba(28, 36, 32, 0.05);
  --shadow-md: 0 2px 4px rgba(28, 36, 32, 0.04), 0 10px 26px -14px rgba(28, 36, 32, 0.18);
  --shadow-lg: 0 3px 6px rgba(28, 36, 32, 0.05), 0 22px 48px -24px rgba(28, 36, 32, 0.24);

  --font-body: "Inter", "Noto Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo,
    Consolas, "Liberation Mono", monospace;

  --wrap: 1120px;
  --wrap-narrow: 760px;
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* The header is sticky; without this an in-page anchor lands
     underneath it and the heading is invisible. */
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 700;
  color: var(--ink);
}

h1 { font-size: clamp(2rem, 1.35rem + 2.4vw, 3.1rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.45rem, 1.15rem + 1.1vw, 2rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.02rem; }

p { margin: 0 0 1.1em; }

a { color: var(--forest); text-decoration-color: rgba(47, 93, 58, 0.35); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

img, svg { max-width: 100%; }
svg { display: block; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.35em; }
li { margin-bottom: 0.35em; }

code, kbd, samp {
  font-family: var(--font-num);
  font-size: 0.9em;
  background: var(--cream-deep);
  padding: 0.12em 0.38em;
  border-radius: 5px;
}

hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }

:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 3. Utilities ---------- */
.container {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 22px;
}

.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--forest);
  color: #fff;
  padding: 10px 18px;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0; }

.eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--forest);
  margin-bottom: 0.7em;
}

.lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 62ch;
}

.muted { color: var(--ink-mute); }
.small { font-size: 0.875rem; }

/* ---------- 4. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 245, 239, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 800;
  font-size: 1.14rem;
  letter-spacing: -0.02em;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 11px;
  background: var(--forest);
  color: #f4f8f2;
}
.brand-mark svg { width: 20px; height: 20px; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav a {
  padding: 8px 13px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}
.nav a:hover { background: var(--cream-deep); color: var(--ink); }
.nav a.active { background: var(--forest-soft); color: var(--forest-deep); }

.nav-cta { margin-left: 8px; }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  cursor: pointer;
  padding: 10px;
  flex-direction: column;
  justify-content: space-between;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

/* ---------- 5. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--forest);
  color: #fbfdf9;
  font: inherit;
  font-size: 0.97rem;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: var(--forest-deep); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: none;
}
.btn-secondary:hover { background: var(--cream-deep); }

.btn-ghost {
  background: transparent;
  color: var(--forest);
  border-color: transparent;
  box-shadow: none;
  padding: 8px 4px;
  font-weight: 650;
}
.btn-ghost:hover { background: transparent; color: var(--forest-deep); text-decoration: underline; }

.btn-sm { padding: 8px 15px; font-size: 0.88rem; }
.btn-danger { background: var(--brick); }
.btn-danger:hover { background: #8a3128; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  padding: 72px 0 56px;
  overflow: hidden;
}

/* Soft radial wash instead of an image: no request, no layout
   shift, and it reads as morning light rather than as decoration. */
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 620px;
  background:
    radial-gradient(46% 58% at 22% 26%, rgba(47, 93, 58, 0.13), transparent 68%),
    radial-gradient(42% 54% at 82% 12%, rgba(53, 113, 154, 0.12), transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 54px;
  align-items: center;
}

.hero h1 { margin-bottom: 0.35em; max-width: 15ch; }
.hero-sub {
  font-size: 1.13rem;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: 1.7em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 1.5em;
}

.hero-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.86rem;
  color: var(--ink-mute);
}
.hero-note span { display: inline-flex; align-items: center; gap: 6px; }
.hero-note svg { width: 15px; height: 15px; color: var(--forest); }

/* The hero card previews the ID tool with a real worked example.
   Numbers are static text, not a live widget — a widget here would
   duplicate the tool and compete with it. */
.hero-card {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 22px;
}

.hero-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 16px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.trait-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  font-size: 0.92rem;
  border-bottom: 1px dashed var(--line-soft);
}
.trait-row:last-of-type { border-bottom: 0; }
.trait-key { color: var(--ink-mute); font-size: 0.82rem; }
.trait-val { font-weight: 600; }

.hero-result {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--forest-soft);
  display: flex;
  align-items: center;
  gap: 12px;
}
.hero-result-name { font-weight: 700; }
.hero-result-meta { font-size: 0.82rem; color: var(--ink-soft); }

/* ---------- 7. Sections ---------- */
.section { padding: 64px 0; }
.section-tight { padding: 44px 0; }
.section-alt { background: var(--cream-deep); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}
.section-head h2 { margin-bottom: 0.25em; }
.section-head p { margin: 0; color: var(--ink-soft); max-width: 58ch; }

/* ---------- 8. Cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

a.card { text-decoration: none; color: inherit; }
a.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--sand);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 13px;
  background: var(--forest-soft);
  color: var(--forest-deep);
  margin-bottom: 16px;
}
.card-icon svg { width: 22px; height: 22px; }

.card h3 { font-size: 1.08rem; margin-bottom: 0.4em; }
.card p { font-size: 0.93rem; color: var(--ink-soft); margin-bottom: 0; }

.card-sample {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-family: var(--font-num);
  font-size: 0.78rem;
  color: var(--ink-mute);
}

.card-link {
  margin-top: auto;
  padding-top: 16px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--forest);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.card-link svg { width: 15px; height: 15px; transition: transform 0.16s ease; }
a.card:hover .card-link svg { transform: translateX(3px); }

/* audience cards are flatter and quieter than tool cards */
.card-audience { background: transparent; box-shadow: none; border-style: dashed; }
.card-audience .card-icon { background: var(--sky-soft); color: var(--sky); }

/* blog cards */
.card-post .post-meta {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--ink-mute);
  margin-bottom: 10px;
}
.card-post h3 { font-size: 1.04rem; line-height: 1.35; }

/* faq preview rows */
.faq-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
.faq-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}
.faq-item:hover { background: rgba(255, 253, 248, 0.7); }
.faq-item .q { font-weight: 600; }
.faq-item svg { width: 17px; height: 17px; color: var(--ink-mute); margin-left: auto; flex: 0 0 auto; }

/* ---------- 9. Breadcrumb ---------- */
.breadcrumb { padding: 18px 0 0; }
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.84rem;
  color: var(--ink-mute);
}
.breadcrumb li { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb li + li::before { content: "/"; color: var(--line); }
.breadcrumb a { color: var(--ink-mute); text-decoration: none; }
.breadcrumb a:hover { color: var(--forest); text-decoration: underline; }

/* ---------- 10. Tool page ---------- */
.tool-head { padding: 26px 0 30px; }
.tool-head h1 { font-size: clamp(1.8rem, 1.3rem + 1.7vw, 2.6rem); margin-bottom: 0.3em; }
.tool-head p { color: var(--ink-soft); max-width: 66ch; margin-bottom: 0; }

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 26px;
  align-items: start;
  padding-bottom: 64px;
}

.panel {
  background: var(--paper);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 18px;
}
.panel-title svg { width: 16px; height: 16px; }

/* The results panel is sticky on wide screens so a long form can be
   scrolled without losing the answer. */
.results-panel {
  position: sticky;
  top: 88px;
  min-height: 220px;
}

/* ---------- 11. Form controls ---------- */
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }

.field label,
.field-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 650;
  margin-bottom: 7px;
  color: var(--ink);
}

.field-hint {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ink-mute);
  margin-top: 4px;
}

input[type="text"],
input[type="date"],
input[type="number"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}
input[type="number"] { font-family: var(--font-num); }

input:focus, select:focus, textarea:focus {
  border-color: var(--forest);
  outline: 2px solid rgba(47, 93, 58, 0.18);
  outline-offset: 0;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2375837a' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 12px;
  padding-right: 36px;
}

/* Segmented control: the four trait pickers and the song pickers.
   Radio inputs are kept in the DOM for keyboard and screen-reader
   support; only the label is styled. */
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  border: 0;
  padding: 0;
  margin: 0;
}
.segmented legend {
  font-size: 0.88rem;
  font-weight: 650;
  margin-bottom: 7px;
  padding: 0;
}

.seg {
  position: relative;
  display: inline-flex;
}
.seg input {
  position: absolute;
  opacity: 0;
  width: 100%; height: 100%;
  margin: 0;
  cursor: pointer;
}
.seg span {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 0.88rem;
  font-weight: 550;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.13s ease;
  white-space: nowrap;
}
.seg input:checked + span {
  background: var(--forest);
  border-color: var(--forest);
  color: #fbfdf9;
  font-weight: 650;
}
.seg input:focus-visible + span {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
}
.seg:hover span { border-color: var(--sand); }

/* colour swatches read faster than colour names */
.swatch-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 550;
  color: var(--ink-soft);
}
.swatch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.swatch i {
  width: 17px; height: 17px;
  border-radius: 50%;
  border: 1px solid rgba(28, 36, 32, 0.16);
  flex: 0 0 auto;
}
.swatch:has(input:checked) {
  border-color: var(--forest);
  background: var(--forest-soft);
  color: var(--forest-deep);
  font-weight: 650;
}
.swatch:has(input:focus-visible) { outline: 3px solid var(--sky); outline-offset: 2px; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
}

/* ---------- 12. Results ---------- */
.result-empty {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 44px 20px;
  color: var(--ink-mute);
}
.result-empty svg { width: 34px; height: 34px; margin-bottom: 12px; color: var(--sand); }
.result-empty p { margin: 0; font-size: 0.92rem; max-width: 34ch; }

.result-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.result-summary svg { width: 17px; height: 17px; flex: 0 0 auto; }

.level-ok { background: var(--forest-soft); color: var(--forest-deep); }
.level-info { background: var(--sky-soft); color: #24536f; }
.level-warn { background: var(--amber-soft); color: #7a4d13; }
.level-err { background: var(--brick-soft); color: #7d2b22; }

.result-note {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--line);
  background: var(--cream-deep);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: 0.87rem;
  color: var(--ink-soft);
}

.species-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }

.species {
  padding: 13px 15px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--paper);
}
.species:first-child { border-color: var(--sand); background: #fffefb; }

.species-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.species-name { font-weight: 700; font-size: 0.99rem; }
.species-sci {
  font-size: 0.78rem;
  color: var(--ink-mute);
  font-style: italic;
  margin-left: auto;
  text-align: right;
}

.conf-bar {
  height: 6px;
  border-radius: 99px;
  background: var(--cream-deep);
  overflow: hidden;
  margin-bottom: 7px;
}
.conf-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--forest);
  transition: width 0.3s ease;
}
.conf-fill.mid { background: var(--sky); }
.conf-fill.low { background: var(--amber); }

.species-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 0.79rem;
  color: var(--ink-mute);
}
.species-meta b {
  font-weight: 650;
  color: var(--ink-soft);
  font-family: var(--font-num);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--cream-deep);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.tag-hit { background: var(--forest-soft); color: var(--forest-deep); }

/* ---------- 13. Data table ---------- */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--paper);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
th {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
  background: var(--cream-deep);
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(247, 245, 239, 0.6); }

td.num, th.num { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }

/* ---------- 14. Log tool ---------- */
.log-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.log-form .field { margin-bottom: 0; }
.log-form .field-wide { grid-column: 1 / -1; }

.log-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.stat {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--cream-deep);
  text-align: center;
}
.stat b {
  display: block;
  font-family: var(--font-num);
  font-size: 1.4rem;
  line-height: 1.2;
  color: var(--forest-deep);
}
.stat span { font-size: 0.76rem; color: var(--ink-mute); }

.log-entries { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.log-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  background: var(--paper);
}
.log-entry-main { min-width: 0; }
.log-entry-title { font-weight: 650; font-size: 0.93rem; }
.log-entry-meta {
  font-size: 0.78rem;
  color: var(--ink-mute);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.log-entry-meta .num { color: var(--ink-soft); }

.icon-btn {
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink-mute);
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover { color: var(--brick); border-color: var(--brick); }
.icon-btn svg { width: 15px; height: 15px; }

.empty-state {
  text-align: center;
  padding: 36px 18px;
  color: var(--ink-mute);
  font-size: 0.9rem;
}

/* ---------- 15. Prose (Markdown articles) ---------- */
.article { padding: 26px 0 72px; }
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 48px;
  align-items: start;
}

.prose { max-width: 70ch; font-size: 1.03rem; }
.prose > *:first-child { margin-top: 0; }

.prose h2 {
  margin-top: 2em;
  padding-top: 0.1em;
  font-size: 1.42rem;
}
.prose h3 { margin-top: 1.7em; font-size: 1.14rem; }
.prose p, .prose li { color: var(--ink-soft); }
.prose strong { color: var(--ink); font-weight: 650; }

.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.45em; }

.prose blockquote {
  margin: 1.6em 0;
  padding: 2px 0 2px 20px;
  border-left: 3px solid var(--forest);
  color: var(--ink-soft);
  font-style: italic;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose table { margin: 1.6em 0; font-size: 0.9rem; }
.prose thead th { background: var(--cream-deep); }

.prose img { border-radius: var(--r-md); margin: 1.6em 0; }

.prose a { font-weight: 550; }

.prose hr { margin: 2.6em 0; }

.prose .callout {
  margin: 1.7em 0;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--forest-soft);
  border: 1px solid rgba(47, 93, 58, 0.16);
  font-size: 0.95rem;
}
.prose .callout p:last-child { margin-bottom: 0; }

.article-head { margin-bottom: 30px; }
.article-head h1 { margin-bottom: 0.3em; }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.83rem;
  color: var(--ink-mute);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

/* sidebar with the related tool */
.aside-card {
  position: sticky;
  top: 88px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--paper);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
}
.aside-card h4 {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 12px;
}
.aside-card .btn { width: 100%; margin-top: 12px; }

/* prev / next between guides */
.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.pager a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  text-decoration: none;
  color: inherit;
  background: var(--paper);
}
.pager a:hover { border-color: var(--sand); box-shadow: var(--shadow-sm); }
.pager .dir { font-size: 0.74rem; color: var(--ink-mute); display: block; margin-bottom: 3px; }
.pager .next { text-align: right; }

/* ---------- 16. Index page headers ---------- */
.page-head {
  padding: 44px 0 34px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 40px;
}
.page-head h1 { margin-bottom: 0.3em; }
.page-head p { color: var(--ink-soft); max-width: 66ch; margin-bottom: 0; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.filter-bar button {
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}
.filter-bar button[aria-pressed="true"] {
  background: var(--forest);
  border-color: var(--forest);
  color: #fbfdf9;
}

/* ---------- 17. Footer ---------- */
.site-footer {
  margin-top: 40px;
  padding: 56px 0 30px;
  background: #1d2a22;
  color: #cfd8cf;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.7fr repeat(4, minmax(0, 1fr));
  gap: 34px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #f3f7f1;
  text-decoration: none;
  margin-bottom: 12px;
}
.footer-brand svg { width: 20px; height: 20px; }

.footer-about {
  font-size: 0.86rem;
  color: #a8b6a9;
  line-height: 1.6;
  margin-bottom: 16px;
  max-width: 34ch;
}

.footer-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.footer-badges span {
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #b9c6ba;
}

.footer-col h4 {
  font-size: 0.75rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #8fa290;
  margin-bottom: 13px;
  font-weight: 700;
}
.footer-col ul { list-style: none; margin: 0 0 12px; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a {
  font-size: 0.86rem;
  color: #cfd8cf;
  text-decoration: none;
  line-height: 1.45;
  display: inline-block;
}
.footer-col a:hover { color: #fff; text-decoration: underline; }

.footer-col .btn-ghost {
  color: #a9d3ad;
  font-size: 0.8rem;
  padding: 0;
}
.footer-col .btn-ghost:hover { color: #d7ecd8; }

.footer-bottom {
  padding-top: 22px;
  display: grid;
  gap: 5px;
}
.footer-bottom p {
  margin: 0;
  font-size: 0.79rem;
  color: #8fa290;
}

/* ---------- 18. Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .hero h1 { max-width: none; }
  .hero-card { order: 2; }
  .tool-layout { grid-template-columns: minmax(0, 1fr); }
  .results-panel { position: static; }
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .aside-card { position: static; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
  .footer-brand-col { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav-toggle { display: flex; }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 18px 18px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    margin-left: 0;
  }
  .nav.open { display: flex; }
  .nav a { padding: 11px 12px; border-radius: var(--r-sm); }
  .nav-cta { margin-left: 0; margin-top: 6px; }

  .hero { padding: 46px 0 40px; }
  .section { padding: 46px 0; }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .log-form { grid-template-columns: minmax(0, 1fr); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { text-align: left; }
  .tool-head { padding: 18px 0 22px; }
  .panel { padding: 19px; }
}

@media (max-width: 460px) {
  .container { padding: 0 16px; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .log-stats { grid-template-columns: minmax(0, 1fr); }
  .hero-actions .btn { width: 100%; }
  .species-sci { display: none; }
  .seg span { padding: 7px 12px; font-size: 0.84rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header, .site-footer, .nav, .breadcrumb, .form-actions, .aside-card { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .panel, .card { box-shadow: none; border-color: #ccc; }
  a { color: #000; text-decoration: underline; }
}
