/* Moss Atlas — pale sage paper, green-black ink, one moss accent, rust for labels */

:root {
  --paper: #eef0e8;
  --paper-2: #e6e9dd;
  --ink: #1d2a1f;
  --moss: #5f7a3d;
  --moss-ink: #4a6130;
  --moss-deep: #3c5027;
  --rust: #a8623a;
  --rust-ink: #8f4e2b;
  --rule: rgba(29, 42, 31, 0.18);
  --serif: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: "Helvetica Neue", Arial, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1rem, 0.96rem + 0.3vw, 1.125rem);
  line-height: 1.62;
}

p, li, h1, h2, h3, figcaption, .brand-domain { overflow-wrap: anywhere; }

img, svg { max-width: 100%; height: auto; }

a { color: var(--moss-ink); }

:focus-visible {
  outline: 2px solid var(--rust-ink);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  z-index: 10;
}
.skip:focus { left: 0; }

/* Layout ------------------------------------------------------------ */

.wrap {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

main > section { padding-block: clamp(3.5rem, 8vw, 7rem); }
main > section + section { border-top: 1px solid var(--rule); }

.measure { max-width: 42rem; }
.measure > p + p { margin-top: 1.1rem; }

/* Type -------------------------------------------------------------- */

h1 {
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 1.08;
  letter-spacing: -0.012em;
  font-weight: 400;
  margin: 0.55rem 0 0;
  max-width: 19ch;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  line-height: 1.16;
  font-weight: 400;
  margin: 0.4rem 0 1.1rem;
}

h3 {
  font-size: 1.14rem;
  line-height: 1.3;
  font-weight: 400;
  margin: 0.35rem 0 0.15rem;
}

.eyebrow, .tag, .site-nav, .brand-domain, .count, .filters button, .toc span {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.68rem;
}

.eyebrow {
  margin: 0;
  color: var(--rust-ink);
}

.standfirst {
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.3rem);
  max-width: 44ch;
  margin: 1rem 0 0;
  color: var(--moss-ink);
}

.latin {
  font-style: italic;
  color: var(--moss-ink);
  margin: 0 0 0.6rem;
}

/* Header & footer --------------------------------------------------- */

.site-head { border-bottom: 1px solid var(--rule); }

.head-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  align-items: baseline;
  justify-content: space-between;
  padding-block: 0.9rem;
}

.brand { margin: 0; min-width: 0; }
.brand-name { font-size: 1.15rem; letter-spacing: 0.01em; }
.brand-domain { color: var(--rust-ink); margin-left: 0.6rem; }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; min-width: 0; }
.site-nav a { text-decoration: none; border-bottom: 1px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--moss); }

.site-foot {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem 3rem;
  background: var(--paper-2);
}
.foot-line { margin: 0.5rem 0 0; max-width: 46ch; font-size: 0.95rem; }

/* Hero -------------------------------------------------------------- */

.hero { padding-block: clamp(1.75rem, 3.5vw, 3rem) clamp(2rem, 4vw, 3.25rem); }

.figure {
  margin: clamp(1.5rem, 3vw, 2.25rem) 0 0;
  border: 1px solid var(--rule);
  padding: clamp(0.75rem, 2vw, 1.25rem);
  background: var(--paper-2);
}
.hero-figure { max-width: 41rem; }
figcaption {
  font-size: 0.86rem;
  margin-top: 0.7rem;
  color: var(--moss-ink);
  max-width: 50ch;
}

.svg-label text { font-family: var(--sans); font-size: 12px; letter-spacing: 0.08em; }
.svg-sub { font-style: italic; opacity: 0.75; letter-spacing: 0.02em; }

/* Contents ---------------------------------------------------------- */

.toc { padding-block: 0 clamp(2rem, 5vw, 3.5rem); }
.toc ol {
  list-style: none;
  counter-reset: toc;
  margin: 0.85rem 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  max-width: 48rem;
}
.toc li {
  counter-increment: toc;
  border-bottom: 1px solid var(--rule);
  padding: 0.7rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: baseline;
}
.toc li::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--rust-ink);
  min-width: 2.25rem;
}
.toc a { text-decoration: none; border-bottom: 1px solid var(--rule); min-width: 0; }
.toc a:hover { border-bottom-color: var(--moss); }
.toc span { color: var(--moss-ink); min-width: 0; }

/* Observations ------------------------------------------------------ */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.75rem 0 0.85rem;
}
.filters button {
  min-width: 0;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.52rem 1rem;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.filters button:hover { border-color: var(--moss); }
.filters button[aria-pressed="true"] {
  background: var(--moss-deep);
  border-color: var(--moss-deep);
  color: var(--paper);
}

.count { margin: 0 0 1.5rem; color: var(--moss-ink); }

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.obs {
  min-width: 0;
  border: 1px solid var(--rule);
  background: var(--paper-2);
  padding: clamp(1rem, 2.2vw, 1.4rem);
}
.obs p:last-child { margin-bottom: 0; font-size: 0.95rem; }
.tag {
  margin: 0;
  color: var(--rust-ink);
}

html.js .obs.is-hidden { display: none; }

/* Notes list -------------------------------------------------------- */

.notes-list {
  list-style: none;
  margin: 1.3rem 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
.notes-list li {
  border-bottom: 1px solid var(--rule);
  padding: 0.8rem 0 0.8rem 1.1rem;
  position: relative;
}
.notes-list li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--rust);
}
.notes-list b { font-weight: 700; }

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