:root {
  --ink: #17211f;
  --muted: #60716d;
  --sand: #f5efe2;
  --shell: #fffaf0;
  --gulf: #176f87;
  --gulf-deep: #0a4356;
  --sound: #8bb7a7;
  --marsh: #526f43;
  --reed: #c9b26d;
  --line: #d9d0bf;
  --warning: #9d4f2f;
  --card: #fffcf5;
  --shadow: 0 10px 30px rgba(23, 33, 31, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--shell);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
select,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 250, 240, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 18px 24px 12px;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--gulf);
  color: white;
  padding: 8px 12px;
  cursor: pointer;
}

.kicker,
.section-label {
  margin: 0 0 5px;
  color: var(--gulf-deep);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.5vw, 2.25rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 14px;
  font-size: clamp(1.55rem, 3vw, 2.75rem);
  line-height: 1.08;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.header-note {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.gallery-nav {
  display: flex;
  gap: 4px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 12px;
  overflow-x: auto;
}

.gallery-nav a {
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.9rem;
}

.gallery-nav a:hover,
.gallery-nav a:focus-visible {
  border-color: var(--gulf);
  outline: none;
}

.exhibit-band {
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 138px;
}

.intro-band {
  background: linear-gradient(180deg, #fffaf0 0%, #eef7f5 100%);
}

.band-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 24px;
}

.intro-grid,
.two-column {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 32px;
  align-items: center;
}

.lead {
  font-size: 1.22rem;
  line-height: 1.42;
}

.cross-section {
  position: relative;
  min-height: 320px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.8), rgba(255,255,255,0.1)),
    linear-gradient(90deg, #0b5d75 0 22%, #efe2c4 22% 45%, #dbc682 45% 58%, #f2ead8 58% 72%, #9ac2b0 72% 100%);
  box-shadow: var(--shadow);
}

.cross-section::before {
  content: "";
  position: absolute;
  left: 20%;
  right: 0;
  bottom: 55px;
  height: 85px;
  background: linear-gradient(135deg, transparent 0 20%, rgba(255,255,255,0.55) 20% 22%, transparent 22% 100%);
  opacity: 0.8;
}

.zone {
  position: absolute;
  min-width: 96px;
  border: 1px solid rgba(23, 33, 31, 0.18);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.88);
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(23, 33, 31, 0.08);
}

.zone:hover,
.zone:focus-visible {
  outline: 2px solid var(--gulf);
  outline-offset: 2px;
}

.zone.gulf { left: 7%; bottom: 52px; }
.zone.beach { left: 27%; bottom: 78px; }
.zone.dune { left: 44%; bottom: 145px; }
.zone.island { left: 56%; bottom: 98px; }
.zone.sound { right: 7%; bottom: 62px; }

.section-head {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: end;
  margin-bottom: 28px;
}

.section-head p {
  color: var(--muted);
}

.feature-card,
.species-card,
.source-card,
.info-card,
.plant-card,
.fauna-card,
.season-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.feature-card,
.info-card,
.plant-card,
.fauna-card,
.season-card {
  padding: 18px;
}

.process-canvas {
  display: block;
  width: 100%;
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef7f5;
  box-shadow: var(--shadow);
}

.process-canvas.large {
  min-height: 420px;
}

.birds-band {
  background: #f7f2e8;
}

.visual-band {
  background: #eef7f5;
}

.seasonal-band {
  background: #eef5f0;
}

.field-sheet-band {
  background: #fbf7ec;
}

.stewardship-band {
  background: #f7f1e4;
}

.subsection-title {
  margin-top: 30px;
}

.card-grid,
.plant-grid,
.fauna-grid,
.visual-reference-grid,
.seasonal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.plant-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.fauna-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.visual-reference-grid {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

.visual-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.visual-image-link,
.media-figure a {
  display: block;
}

.visual-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #dfe9e7;
}

.visual-card-body {
  padding: 12px;
}

.visual-card h3 {
  margin-bottom: 2px;
}

.media-credit {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.local-note {
  border-left: 3px solid var(--reed);
  margin: 10px 0;
  padding: 7px 9px;
  background: #fbf4df;
  color: #604b16;
  font-size: 0.9rem;
}

.media-figure {
  overflow: hidden;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8f1ee;
}

.media-figure img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.media-figure figcaption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  background: rgba(255, 250, 240, 0.94);
  color: var(--muted);
  font-size: 0.76rem;
}

.media-figure figcaption a {
  color: var(--gulf-deep);
  font-weight: 700;
  text-decoration: none;
}

.mini-kicker {
  margin: 0 0 8px;
  color: var(--gulf-deep);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.info-card ul,
.season-card ul {
  padding-left: 20px;
}

.month-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0 14px;
}

.month-row span {
  min-width: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf0;
  color: var(--gulf-deep);
  padding: 3px 7px;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 800;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.filter-button,
.utility-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffaf0;
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
}

.utility-button.compact {
  padding: 7px 10px;
  font-size: 0.9rem;
}

.filter-button[aria-pressed="true"],
.utility-button.active {
  border-color: var(--gulf);
  background: var(--gulf);
  color: white;
}

.count-line {
  min-height: 24px;
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.species-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.species-card {
  padding: 16px;
}

.species-card header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}

.species-card h3 {
  margin: 0;
}

.latin {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
}

.confidence {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.76rem;
  text-transform: uppercase;
  background: #e6f0ec;
  color: var(--marsh);
  white-space: nowrap;
}

.confidence.medium {
  background: #f4e8cb;
  color: #7a5a1a;
}

.confidence.watch-list {
  background: #f7dfd4;
  color: var(--warning);
}

.tag-row,
.source-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag,
.source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 8px;
  background: #eef4f2;
  color: var(--gulf-deep);
  font-size: 0.78rem;
  text-decoration: none;
}

.process-layout {
  display: grid;
  grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
  gap: 22px;
}

.process-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.process-tab {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  color: var(--ink);
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.process-tab[aria-selected="true"] {
  border-color: var(--gulf);
  box-shadow: inset 4px 0 0 var(--gulf);
}

.process-tab strong {
  display: block;
  margin-bottom: 4px;
}

.process-tab span {
  color: var(--muted);
  font-size: 0.88rem;
}

.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.process-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.control-field,
.check-field {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.control-field select {
  width: auto;
  min-width: 168px;
  padding: 7px 10px;
}

.control-field input[type="range"] {
  width: 130px;
}

.tide-live-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(260px, 1fr);
  gap: 14px 18px;
  align-items: start;
  margin: 12px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 16px;
  box-shadow: var(--shadow);
}

.tide-live-panel[hidden] {
  display: none;
}

.tide-live-panel h3 {
  margin-bottom: 6px;
}

.tide-live-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.tide-metric-grid,
.tide-prediction-list {
  display: grid;
  gap: 8px;
}

.tide-metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tide-metric,
.tide-prediction {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px;
}

.tide-metric strong,
.tide-prediction strong {
  display: block;
  color: var(--gulf-deep);
}

.tide-metric span,
.tide-prediction span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.tide-live-panel .source-chip-row {
  grid-column: 1 / -1;
  margin-top: 0;
}

.food-web-panel,
.reef-link-panel {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: center;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 18px;
}

.food-web-panel h3,
.reef-link-panel h3 {
  margin-bottom: 7px;
}

.food-web-panel p,
.reef-link-panel p {
  color: var(--muted);
}

.food-web-diagram {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
}

.food-node {
  display: grid;
  min-height: 92px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  font-weight: 800;
}

.food-node.producer { background: #e5f0dd; color: #304d2f; }
.food-node.small-life { background: #eef7f5; color: var(--gulf-deep); }
.food-node.fish { background: #e7f1f6; color: #164c62; }
.food-node.predator { background: #f7ecd8; color: #614a1f; }

.food-arrow {
  display: none;
}

.field-controls {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

.field-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-weight: 700;
}

.photo-prompt-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 14px;
}

.photo-prompt-panel ul {
  margin: 0;
  padding-left: 20px;
}

.photo-prompt-panel li {
  margin-bottom: 6px;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 10px 12px;
}

.field-results {
  display: grid;
  gap: 10px;
}

.field-subhead {
  margin-top: 24px;
}

.field-sheet-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 18px;
}

.field-sheet-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
}

.field-sheet-head h3 {
  margin-bottom: 6px;
  font-size: 1.25rem;
}

.field-sheet-head p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
}

.field-sheet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field-sheet-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 12px;
}

.field-sheet-card h3 {
  margin-bottom: 7px;
  color: var(--gulf-deep);
}

.field-sheet-card ul {
  padding-left: 18px;
  margin: 0;
}

.field-sheet-card li {
  margin-bottom: 5px;
}

.field-sheet-card .source-chip-row {
  margin-top: 10px;
}

.mini-result {
  border-left: 4px solid var(--gulf);
  padding: 10px 12px;
  background: #fffaf0;
}

.mini-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.source-card {
  padding: 14px;
}

.source-card a {
  color: var(--gulf-deep);
  font-weight: 700;
}

.source-card p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 24px 42px;
  color: var(--muted);
}

.error-box {
  max-width: 760px;
  margin: 24px auto;
  border: 1px solid var(--warning);
  border-radius: 8px;
  background: #fff5f0;
  padding: 16px;
}

@media (max-width: 820px) {
  .header-inner,
  .section-head,
  .intro-grid,
  .two-column,
  .process-layout {
    grid-template-columns: 1fr;
  }

  .header-inner {
    align-items: start;
    padding-bottom: 10px;
  }

  .header-note {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .gallery-nav {
    display: none;
    max-height: 48vh;
    padding: 0 18px 12px;
    flex-wrap: wrap;
    overflow-y: auto;
  }

  .gallery-nav.open {
    display: flex;
  }

  .gallery-nav a {
    flex: 1 1 45%;
    text-align: center;
    border-color: var(--line);
    background: #fffaf0;
  }

  .band-inner {
    padding: 38px 18px;
  }

  .gallery-nav {
    padding-inline: 18px;
  }

  .section-head {
    gap: 8px;
  }

  .cross-section {
    min-height: 260px;
  }

  .zone {
    min-width: auto;
    padding: 7px 9px;
    font-size: 0.82rem;
  }

  .process-canvas.large {
    min-height: 320px;
  }

  .process-layout {
    gap: 16px;
  }

  .stage-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .process-controls {
    justify-content: flex-start;
  }

  .control-field,
  .check-field {
    width: 100%;
    justify-content: space-between;
  }

  .control-field select,
  .control-field input[type="range"] {
    width: min(58vw, 220px);
  }

  .tide-live-panel,
  .tide-metric-grid,
  .field-sheet-grid,
  .food-web-panel,
  .reef-link-panel,
  .food-web-diagram {
    grid-template-columns: 1fr;
  }

  .field-sheet-head {
    flex-direction: column;
  }

  .species-grid,
  .card-grid,
  .plant-grid,
  .fauna-grid,
  .visual-reference-grid,
  .seasonal-grid,
  .source-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  @page {
    margin: 0.42in;
  }

  body {
    background: white;
    color: #111;
    font-size: 10px;
  }

  .site-header,
  .site-footer,
  .exhibit-band:not(.field-sheet-band),
  .print-button,
  .source-chip-row {
    display: none !important;
  }

  .field-sheet-band {
    background: white;
    border: 0;
  }

  .band-inner {
    max-width: none;
    padding: 0;
  }

  .field-sheet-band .section-head {
    display: none;
  }

  .field-sheet-panel {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  .field-sheet-head {
    margin-bottom: 10px;
  }

  .field-sheet-head h3 {
    font-size: 18px;
  }

  .field-sheet-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .field-sheet-card {
    break-inside: avoid;
    border-color: #777;
    padding: 8px;
  }

  .field-sheet-card h3 {
    font-size: 12px;
    margin-bottom: 4px;
  }

  .field-sheet-card li {
    margin-bottom: 3px;
  }
}
