/* ═══════════════════════════════════════════════════════════
   MasonboroIsland.org — Coastal Field Station
   Mobile-first. Built to be read on a phone, on a boat, in sun.
   Palette: marsh greens + sand. (Draft tokens — final TBD.)
   ═══════════════════════════════════════════════════════════ */

:root {
  /* Marsh */
  --marsh-950: #142219;
  --marsh-900: #1f3326;
  --marsh-700: #2f4f3a;
  --marsh-500: #557a4f;
  --marsh-300: #a7b98c;
  --marsh-100: #e4ead8;

  /* Sand */
  --sand-50:  #fbf8f1;
  --sand-100: #f5efe2;
  --sand-200: #ebe1cb;
  --sand-400: #d6c196;
  --sand-600: #a88b55;

  /* Ink — kept dark on purpose: daylight readability beats subtlety */
  --ink:      #151a15;
  --ink-mid:  #3d463c;
  --ink-soft: #5a6357;
  --rule:     #d9cfb8;

  /* Signal */
  --accent:   #b5521f;   /* oyster-shell rust: CTAs, "new" tags */
  --good:     #2e6b34;
  --warn:     #9a5a0e;
  --bad:      #a3301c;

  /* Trip calls: green / yellow / red. Yellow is a true yellow so the middle step reads as its own thing. */
  --call-go:          #3f8a3c;
  --call-go-bg:       #dcefd3;
  --call-caution:     #e8b923;
  --call-caution-bg:  #fbf0c4;
  --call-nogo:        #c0392b;
  --call-nogo-bg:     #f7d5cd;

  /* King tide: a kind of day, not a step on the go/no-go scale, so it gets its own hue outside the traffic light */
  --king:     #0e7378;
  --king-bg:  #d3ecec;

  --font-body:  "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-label: "Space Grotesk", ui-monospace, "Segoe UI", sans-serif;

  --wrap: 72rem;
  --gutter: 1rem;
  --radius: 6px;
}
@media (min-width: 768px) { :root { --gutter: 2rem; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--sand-100);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;      /* 17px — never smaller for body copy */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--marsh-700); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

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

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.label {
  font-family: var(--font-label);
  font-size: 0.8125rem;      /* 13px floor for labels */
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.material-symbols-outlined { font-size: 1.35em; line-height: 1; vertical-align: -0.2em; }

/* ── Header ─────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245, 239, 226, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; height: 3.75rem; gap: 1rem; }
.brand { font-weight: 800; font-size: 1.125rem; color: var(--marsh-900); text-decoration: none; letter-spacing: -0.01em; }
.brand span { color: var(--marsh-500); }
.nav-toggle {
  display: inline-flex; align-items: center; gap: .35rem;
  background: none; border: 1px solid var(--marsh-700); border-radius: var(--radius);
  color: var(--marsh-900); padding: .45rem .7rem; font: inherit; font-weight: 600; cursor: pointer;
}
.site-nav { display: none; }
.site-nav.open {
  display: block; position: absolute; top: 3.75rem; left: 0; right: 0;
  background: var(--sand-50); border-bottom: 1px solid var(--rule);
  padding: .5rem var(--gutter) 1rem;
}
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: .8rem 0; border-bottom: 1px solid var(--rule);
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: 1.125rem;
}
.site-nav .nav-cta { margin-top: .75rem; border: 0; }
.site-nav .btn, .site-nav .btn:hover { color: var(--sand-50); border: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--marsh-900); color: var(--sand-50);
  padding: .8rem 1.2rem; border-radius: var(--radius); border: 0;
  font-family: var(--font-label); font-weight: 700; font-size: .875rem;
  letter-spacing: .1em; text-transform: uppercase; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--marsh-700); color: var(--sand-50); }
.btn-accent { background: var(--accent); }
.btn-accent:hover { background: #963f14; }

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav.open { display: block; position: static; background: none; border: 0; padding: 0; }
  .site-nav ul { display: flex; align-items: center; gap: 1.75rem; }
  .site-nav a { border: 0; padding: 0; font-size: 1rem; }
  .site-nav .nav-cta { margin: 0; }
  .site-nav .nav-cta .btn { padding: .6rem 1rem; }
}

/* ── Hero ───────────────────────────────────────────────── */
.hero { position: relative; min-height: 86svh; display: flex; align-items: flex-end; color: #fff; background: var(--marsh-900); overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Heavy scrim at the bottom so text survives any photo, in any light */
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,34,25,.94) 0%, rgba(20,34,25,.78) 38%, rgba(20,34,25,.15) 72%, rgba(20,34,25,0) 100%);
}
.hero .wrap { position: relative; z-index: 1; width: 100%; padding-top: 6rem; padding-bottom: 2.5rem; }
.hero .label { color: var(--marsh-300); }
.hero h1 {
  margin: .5rem 0 1rem; font-weight: 800; letter-spacing: -0.035em; line-height: .95;
  font-size: clamp(3.25rem, 15vw, 7.5rem);
}
.hero h1 em { font-weight: 300; }
.hero-lede { max-width: 38rem; font-size: 1.125rem; line-height: 1.55; margin: 0 0 1.75rem; color: #f3f1ea; }
.coords {
  display: inline-block; border-left: 3px solid var(--marsh-300);
  padding: .25rem 0 .25rem 1rem; font-family: var(--font-label);
}
.coords .label { display: block; font-size: .75rem; color: var(--marsh-300); margin-bottom: .25rem; }
.coords strong { display: block; font-size: 1.375rem; font-weight: 600; letter-spacing: .02em; line-height: 1.25; }
.coords small { display: block; font-size: .8125rem; color: #e0e4da; margin-top: .25rem; letter-spacing: .08em; text-transform: uppercase; }
@media (min-width: 900px) {
  .hero .wrap { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 3rem; padding-bottom: 4rem; }
}

/* ── Alert bars (king tide / launch) ────────────────────── */
.alert { display: none; padding: 1rem 0; color: #fff; }
.alert.show { display: block; }
.alert .wrap { display: flex; gap: .85rem; align-items: flex-start; }
.alert p { margin: 0; }
.alert .label { color: rgba(255,255,255,.85); font-size: .75rem; }
.alert strong { font-size: 1.0625rem; }
.alert-tide { background: var(--king); }   /* teal: our heads-up, not an official alert */
.alert-nws-red { background: var(--call-nogo); }
.alert-nws-yellow { background: var(--call-caution); color: var(--ink); }
.alert-nws-yellow .label { color: var(--ink-mid); }
.alert-nws a { color: inherit; }
.alert-more { font-weight: 600; opacity: .85; font-size: .9375rem; }
.alert-launch { background: var(--marsh-950); border-bottom: 3px solid var(--accent); }

/* ── Station conditions strip ───────────────────────────── */
.conditions { background: var(--marsh-900); color: var(--sand-50); padding: 2rem 0 2.5rem; }
.conditions-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.conditions-head h2 { margin: 0; font-size: 1.375rem; font-weight: 800; letter-spacing: -0.01em; }
.conditions-head .label { color: var(--marsh-300); font-size: .75rem; }
.readouts { display: grid; grid-template-columns: 1fr; gap: 1px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.14); border-radius: var(--radius); overflow: hidden; }
.readout { background: var(--marsh-900); padding: 1.1rem 1.1rem 1.2rem; min-height: 8.5rem; }
.readout .label { color: var(--marsh-300); font-size: .75rem; display: flex; align-items: center; gap: .4rem; }
.readout .big { font-size: 2rem; font-weight: 800; line-height: 1.1; margin: .5rem 0 .2rem; letter-spacing: -0.02em; }
.readout .sub { margin: 0; font-size: 1rem; color: #dfe5d8; line-height: 1.45; }
.readout .sub strong { color: #fff; }
.conditions-src { margin: 1rem 0 0; font-size: .9375rem; color: #c9d3c2; }
.conditions-src a { color: #eef2e8; }
.tide-chart { display: block; width: 100%; height: 64px; margin-top: .6rem; }
.pill { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-family: var(--font-label); font-weight: 700; font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase; }
.big .pill { font-size: 1.25rem; padding: .2rem .8rem; letter-spacing: .04em; }
.pill-good { background: #cfe5c6; color: #173d1c; }
.pill-warn { background: #f6df7c; color: #3d2f00; }
.pill-bad  { background: #f3c4b8; color: #5e170b; }
@media (min-width: 640px) { .readouts { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1200px) { .readouts { grid-template-columns: 1.3fr 1fr 1fr 1fr; } }

/* ── Sections ───────────────────────────────────────────── */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--sand-50); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.section-head { margin-bottom: 1.75rem; max-width: 40rem; }
.section-head .label { color: var(--marsh-500); }
.section-head h2 { margin: .35rem 0 .5rem; font-size: clamp(2rem, 7vw, 3rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; color: var(--marsh-950); }
.section-head p { margin: 0; color: var(--ink-mid); font-size: 1.125rem; }
.section-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; max-width: none; }
.more { font-family: var(--font-label); font-weight: 700; font-size: .875rem; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; white-space: nowrap; }
@media (min-width: 768px) { .section { padding: 5rem 0; } }

/* ── Tool cards ─────────────────────────────────────────── */
.cards { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .cards-3 { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
a.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(31,51,38,.12); color: inherit; }
.card img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.375rem; font-weight: 800; letter-spacing: -0.015em; color: var(--marsh-950); display: flex; align-items: center; gap: .5rem; }
.card-body h3 .material-symbols-outlined { color: var(--marsh-500); }
.card-body p { margin: 0; color: var(--ink-mid); }
.card-live { margin-top: .25rem !important; padding: .6rem .75rem; background: var(--marsh-100); border-radius: 4px; color: var(--marsh-950) !important; font-size: .9375rem; }
.card-cta { margin-top: auto; padding-top: .5rem; color: var(--accent); font-family: var(--font-label); font-weight: 700; font-size: .875rem; letter-spacing: .1em; text-transform: uppercase; display: flex; align-items: center; gap: .3rem; }

/* ── Wildlife ───────────────────────────────────────────── */
.critters { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (min-width: 900px) { .critters { grid-template-columns: repeat(5, 1fr); } }
.critter { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--marsh-900); color: #fff; }
.critter img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.critter-text { position: absolute; inset: auto 0 0 0; padding: 2.5rem .85rem .85rem; background: linear-gradient(to top, rgba(20,34,25,.95), rgba(20,34,25,.75) 60%, rgba(20,34,25,0)); }
.critter h3 { margin: 0 0 .2rem; font-size: 1.125rem; font-weight: 800; line-height: 1.2; }
.critter .label { font-size: .6875rem; color: var(--marsh-300); letter-spacing: .12em; }
/* Odd one out on the 2-up phone grid: the blacktips (our email hook) go full width */
@media (max-width: 899px) { .critter:last-child { grid-column: 1 / -1; } .critter:last-child img { aspect-ratio: 16 / 9; } }
.critters-note { margin: 1.25rem 0 0; color: var(--ink-mid); font-size: 1rem; }

/* ── Field notes ────────────────────────────────────────── */
.notes { display: grid; gap: 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 900px) { .notes { grid-template-columns: 1.6fr 1fr; } }
.note img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.note .card-body h3 { font-size: 1.5rem; line-height: 1.2; }
.note-meta { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.tag { font-family: var(--font-label); font-weight: 700; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; padding: .15rem .5rem; border-radius: 3px; background: var(--marsh-100); color: var(--marsh-900); }
.tag-new { background: var(--accent); color: #fff; }
.tag-soon { background: var(--sand-200); color: var(--ink-mid); }
.note-soon { opacity: .92; }

/* ── Signup ─────────────────────────────────────────────── */
.signup { background: var(--marsh-900); color: var(--sand-50); padding: 3.5rem 0; }
.signup .wrap { max-width: 44rem; }
.signup h2 { margin: .35rem 0 .75rem; font-size: clamp(2rem, 7vw, 2.75rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.05; }
.signup .label { color: var(--marsh-300); }
.signup p { margin: 0 0 1.5rem; color: #e3e8dc; font-size: 1.125rem; }
.signup-form { display: flex; flex-direction: column; gap: .75rem; }
.signup-form input {
  font: inherit; font-size: 1.0625rem; padding: .9rem 1rem; border-radius: var(--radius);
  border: 2px solid transparent; background: #fff; color: var(--ink); min-width: 0;
}
.signup-form input:focus { outline: none; border-color: var(--accent); }
.signup-status { min-height: 1.5rem; margin: .75rem 0 0 !important; font-size: 1rem !important; }
.signup-done { display: none; padding: 1rem 1.25rem; background: rgba(255,255,255,.08); border-left: 3px solid var(--marsh-300); border-radius: 4px; }
.signup-done strong { display: block; font-size: 1.125rem; }
@media (min-width: 640px) { .signup-form { flex-direction: row; } .signup-form input { flex: 1; } }
@media (min-width: 768px) { .signup { padding: 5rem 0; } }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer { background: var(--marsh-950); color: #cdd5c6; padding: 3rem 0 2rem; font-size: 1rem; }
.site-footer a { color: #eef2e8; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-name { color: #fff; font-weight: 800; font-size: 1.125rem; margin: 0 0 .5rem; }
.site-footer h3 { margin: 0 0 .75rem; color: var(--marsh-300); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.footer-fine { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid rgba(255,255,255,.14); font-size: .9375rem; line-height: 1.6; }
.footer-fine p { margin: 0 0 1rem; }
.footer-fine strong { color: #fff; }
.footer-family { font-family: var(--font-label); font-size: .8125rem; letter-spacing: .1em; text-transform: uppercase; color: #aab6a3; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a.card { transition: none; }
}
