:root {
  --bg: #F4F8FB;
  --fg: #0C2233;
  --accent: #2E6FA9;
  --accent-dark: #1F5080;
  --muted: #5E7382;
  --tint: #E6EEF3;
  --line: #D3DFE7;
  --cream: #FAF4E8;
  --sand: #C9B488;
  --marsh: #7A8A5E;
  --heading: 'Fraunces', Georgia, serif;
  --body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--heading);
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 600; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
h3 { font-size: 1.15rem; font-weight: 600; }

p { margin: 0 0 1em; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: var(--body);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  margin: 0 0 1rem;
}

.lede {
  font-size: 1.18rem;
  color: var(--fg);
  max-width: 42em;
}

.muted { color: var(--muted); }
.small-note { font-size: 0.92rem; }

.center { text-align: center; }
.narrow { max-width: 640px; margin-left: auto; margin-right: auto; }

/* Header */
.site-header {
  position: relative;
  z-index: 20;
  padding: 22px 0;
  background: rgba(244, 248, 251, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-family: var(--heading);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand-mark { width: 34px; height: 34px; color: var(--accent); }
.brand-text { letter-spacing: 0.08em; }

.site-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--fg);
  font-size: 0.94rem;
  font-weight: 500;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent); text-decoration: none; border-bottom-color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* Tide strip */
.tide-strip {
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  font-size: 0.84rem;
  color: var(--fg);
}
.tide-strip-inner {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  padding: 10px 24px;
  align-items: center;
}
.tide-pill {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.tide-note { color: var(--muted); }
.tide-late { color: var(--accent-dark); font-style: italic; margin-left: auto; }
@media (max-width: 720px) {
  .tide-late { margin-left: 0; }
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  min-height: 620px;
  display: flex;
  align-items: flex-end;
}
.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-overlay {
  position: relative;
  width: 100%;
  padding: 120px 0 72px;
  background: linear-gradient(to top, rgba(12, 34, 51, 0.75) 0%, rgba(12, 34, 51, 0.25) 55%, rgba(12, 34, 51, 0) 100%);
}
.hero-overlay .eyebrow { color: #B9D4E6; }
.hero-overlay h1 { color: #fff; max-width: 18ch; }
.hero-overlay .lede { color: #EAF1F6; max-width: 46ch; }
.hero-actions { margin-top: 28px; display: flex; gap: 14px; flex-wrap: wrap; }

/* Page hero */
.page-hero {
  padding: 72px 0 40px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--tint), var(--bg));
}
.page-hero h1 { max-width: 22ch; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 22px;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  border-radius: 2px;
  border: 1px solid var(--accent);
  transition: background 0.15s, transform 0.15s;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; text-decoration: none; }
.btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.6);
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); color: #fff; border-color: #fff; }
.btn-light {
  background: #fff;
  color: var(--accent-dark);
  border-color: #fff;
}
.btn-light:hover { background: var(--tint); color: var(--accent-dark); border-color: var(--tint); }

.inline-link {
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.inline-link:hover { text-decoration: none; }

/* Sections */
.section { padding: 80px 0; }
.section-tint { background: var(--tint); }
.section-accent {
  background: var(--accent);
  color: #fff;
}
.section-accent h2 { color: #fff; }
.section-accent p { color: #EAF1F6; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 56px;
  align-items: start;
}
@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; gap: 24px; }
}

.prose p { max-width: 62ch; }
.prose blockquote {
  margin: 0;
  padding: 24px 28px;
  border-left: 3px solid var(--accent);
  background: var(--tint);
  font-family: var(--heading);
  font-size: 1.25rem;
  line-height: 1.4;
  font-style: italic;
}
.prose blockquote cite {
  display: block;
  margin-top: 12px;
  font-family: var(--body);
  font-size: 0.88rem;
  font-style: normal;
  color: var(--muted);
}

/* Handnote — faux-handwritten ink */
.handnote {
  display: inline-block;
  font-family: var(--heading);
  font-style: italic;
  color: var(--accent-dark);
  transform: rotate(-1.4deg);
  transform-origin: left center;
  opacity: 0.8;
  font-size: 0.98rem;
  margin-top: 4px;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.card {
  background: #fff;
  padding: 32px 28px;
  border: 1px solid var(--line);
  border-radius: 4px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -15px rgba(12, 34, 51, 0.2); }
.card-icon {
  width: 44px; height: 44px;
  color: var(--accent);
  margin-bottom: 16px;
}
.card p { color: var(--muted); margin-bottom: 0; }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }

/* Guide strip (home) */
.guide-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 36px 0 24px;
}
.guide-item {
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 14px;
  text-align: center;
}
.guide-item svg {
  width: 100%;
  height: auto;
  margin-bottom: 8px;
}
.guide-item figcaption {
  font-size: 0.9rem;
  color: var(--fg);
}
.guide-item figcaption span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  margin-top: 2px;
}
@media (max-width: 780px) { .guide-strip { grid-template-columns: repeat(2, 1fr); } }

/* Principles */
.principles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  margin-top: 40px;
}
.principle {
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.principle-num {
  display: block;
  font-family: var(--heading);
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 6px;
}
.principle p { color: var(--muted); margin-bottom: 0; }
@media (max-width: 720px) { .principles { grid-template-columns: 1fr; gap: 0; } }

/* People */
.people {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 32px;
}
.person-portrait {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  margin-bottom: 14px;
}
.role {
  color: var(--accent);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.person p { color: var(--muted); }
@media (max-width: 760px) { .people { grid-template-columns: 1fr; } }

/* Program list */
.program-list { display: flex; flex-direction: column; gap: 64px; }
.program {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 56px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line);
}
.program:last-child { border-bottom: none; padding-bottom: 0; }
.program-meta .muted { font-size: 0.92rem; }
.program-diagram {
  width: 100%;
  margin-top: 20px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--tint);
}
@media (max-width: 820px) {
  .program { grid-template-columns: 1fr; gap: 20px; }
}

/* Calendar */
.calendar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 28px;
}
.cal-month {
  background: #fff;
  border: 1px solid var(--line);
  padding: 14px 12px;
  border-radius: 3px;
  min-height: 96px;
}
.cal-month.active {
  border-color: var(--accent);
  background: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}
.cal-label {
  font-family: var(--heading);
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.cal-act {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
}
@media (max-width: 880px) { .calendar { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .calendar { grid-template-columns: repeat(2, 1fr); } }

/* Notes */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 40px;
}
.note {
  padding: 32px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 2px;
}
.note-date {
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin: 0 0 8px;
}
.note h2 { font-size: 1.4rem; margin-bottom: 10px; }
.note p:last-child { margin-bottom: 0; }
.note-sig { font-size: 0.85rem; margin-top: 10px; }
.new-mark {
  display: inline-block;
  background: var(--sand);
  color: var(--fg);
  font-family: var(--body);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 6px;
  transform: rotate(-3deg);
}

/* Species page */
.species-group-heading {
  margin-top: 24px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.species-group-heading:first-of-type { margin-top: 0; }
.species-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin: 24px 0 56px;
}
.species-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 18px;
  align-items: start;
}
.species-illus {
  width: 100%;
  aspect-ratio: 160 / 110;
  border-radius: 2px;
}
.species-body h3 { margin-bottom: 2px; }
.species-body .latin {
  font-style: italic;
  color: var(--muted);
  margin: 0 0 10px;
  font-size: 0.92rem;
}
.species-body p { margin-bottom: 8px; }
.species-body p:last-child { margin-bottom: 0; }
@media (max-width: 820px) { .species-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .species-card { grid-template-columns: 1fr; }
}

/* Handbook layout with sticky ToC sidebar */
.handbook-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 24px 80px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 56px;
  align-items: start;
}
.toc {
  position: sticky;
  top: 24px;
  font-size: 0.94rem;
  border-left: 2px solid var(--line);
  padding-left: 18px;
}
.toc-label {
  font-family: var(--body);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.74rem;
  color: var(--accent);
  margin: 0 0 12px;
}
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  counter-reset: toc;
}
.toc-list li {
  margin-bottom: 8px;
  color: var(--muted);
}
.toc-list a {
  color: var(--fg);
  border-bottom: 1px solid transparent;
}
.toc-list a:hover { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }
.toc-note { font-size: 0.8rem; }

.handbook-body { max-width: 68ch; }
.hb-section { margin-bottom: 56px; scroll-margin-top: 32px; }
.hb-section h2 {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 18px;
}
.hb-list {
  padding-left: 20px;
  margin: 0 0 18px;
}
.hb-list li { margin-bottom: 10px; }
.hb-quote {
  margin: 18px 0;
  padding: 20px 24px;
  background: var(--cream);
  border-left: 3px solid var(--sand);
  font-family: var(--heading);
  font-style: italic;
  font-size: 1.12rem;
  line-height: 1.5;
}
.hb-quote p { margin: 0; }
.hb-diagram, .tide-diagram svg {
  width: 100%;
  margin: 20px 0;
  border: 1px solid var(--line);
  border-radius: 3px;
}
.glossary {
  margin: 16px 0;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 12px 24px;
}
.glossary dt {
  font-family: var(--heading);
  font-weight: 600;
  color: var(--accent-dark);
}
.glossary dd {
  margin: 0;
  color: var(--fg);
}
@media (max-width: 900px) {
  .handbook-wrap { grid-template-columns: 1fr; gap: 32px; }
  .toc { position: static; border-left: none; border-top: 2px solid var(--line); padding-left: 0; padding-top: 16px; }
  .glossary { grid-template-columns: 1fr; gap: 4px 0; }
  .glossary dt { margin-top: 8px; }
}

/* Open-walk card */
.openwalk-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 24px;
  margin-top: 28px;
  align-items: center;
}
.openwalk-art { width: 100%; border-radius: 3px; }
.openwalk-body h3 { font-size: 1.35rem; margin-bottom: 10px; }
@media (max-width: 760px) {
  .openwalk-card { grid-template-columns: 1fr; }
}

/* Footer */
.site-footer {
  background: #0C2233;
  color: #C6D4DC;
  padding: 64px 0 32px;
  margin-top: 40px;
}
.site-footer h2, .site-footer h3, .site-footer p { color: #C6D4DC; }
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.footer-brand {
  font-family: var(--heading);
  font-size: 1.3rem;
  color: #fff;
  margin: 0 0 8px;
  letter-spacing: 0.08em;
}
.footer-heading {
  font-family: var(--heading);
  font-weight: 600;
  color: #fff;
  margin: 0 0 12px;
  font-size: 1rem;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #C6D4DC; }
.footer-links a:hover { color: #fff; }
.site-footer .muted { color: #90A4B0; font-size: 0.92rem; }
.tended { font-style: italic; margin-top: 10px; }
.footer-bottom {
  border-top: 1px solid #1F3A50;
  padding-top: 20px;
  font-size: 0.85rem;
  color: #90A4B0;
}
@media (max-width: 760px) {
  .footer-inner { grid-template-columns: 1fr; gap: 28px; }
}

/* 404 */
.not-found { padding: 120px 0; }
.nf-art { width: 300px; margin: 0 auto 24px; }