/* Salmon lifecycle - Mrs. Mandeville 4th grade
   Palette: river teal, ocean blue, soft green, sand/cream, Orchard purple accent */
:root {
  --teal: #1f7a7a;
  --teal-deep: #145858;
  --river: #2a7a9a;
  --ocean: #1a4f7a;
  --foam: #e8f6f4;
  --mint: #d7efe6;
  --sand: #f7f1e6;
  --cream: #fbf8f2;
  --ink: #1f2f36;
  --muted: #4a5c64;
  --soft: #6b7c84;
  --line: #c9dde0;
  --white: #ffffff;
  --gold: #e8b45a;
  --coral: #d86b5a;
  --purple: #581c64;
  --shadow: 0 16px 36px rgba(26, 79, 122, 0.12);
  --radius: 18px;
  --max: 1080px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #d8f0ea 0%, transparent 55%),
    radial-gradient(900px 420px at 100% 0%, #d3e8f5 0%, transparent 50%),
    var(--cream);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; height: auto; }
a { color: var(--teal-deep); }
a:hover { color: var(--purple); }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--purple);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
}
.skip:focus { left: 0.75rem; top: 0.75rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px);
  background: rgba(251, 248, 242, 0.92);
  border-bottom: 1px solid rgba(31, 122, 122, 0.12);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-decoration: none;
  color: inherit;
}
.brand-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 700;
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: 1.12rem;
  color: var(--ocean);
  line-height: 1.2;
}
.nav {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  color: var(--ocean);
}
.nav a:hover { background: var(--foam); color: var(--purple); }
.nav .btn-home {
  background: var(--purple);
  color: #fff !important;
}
.nav .btn-home:hover { background: var(--teal-deep); }

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

.hero {
  display: grid;
  gap: 1.5rem;
  padding: 2rem 0 1rem;
}
@media (min-width: 860px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    padding: 2.75rem 0 1.5rem;
  }
}
.eyebrow {
  display: inline-block;
  margin: 0 0 0.7rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: var(--mint);
  color: var(--teal-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.12;
  margin: 0 0 0.85rem;
  color: var(--ocean);
}
.lede {
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 1.12rem;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.78rem 1.15rem;
  border-radius: 999px;
}
.button-primary {
  background: var(--teal);
  color: #fff;
}
.button-primary:hover { background: var(--teal-deep); color: #fff; }
.button-ghost {
  background: transparent;
  color: var(--ocean);
  border: 2px solid var(--line);
}
.button-ghost:hover {
  border-color: var(--teal);
  color: var(--teal-deep);
  background: var(--foam);
}
.hero-media {
  position: relative;
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--river);
}
.hero-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.hero-badge {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  background: rgba(251, 248, 242, 0.94);
  color: var(--ocean);
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  font-size: 0.92rem;
  max-width: 80%;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.hero-badge strong { display: block; color: var(--purple); }

.section {
  padding: 2.4rem 0;
}
.section-head {
  margin-bottom: 1.35rem;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 3.4vw, 2.1rem);
  margin: 0 0 0.45rem;
  color: var(--ocean);
}
.section-head p {
  margin: 0;
  color: var(--muted);
  max-width: 46rem;
}

.story-grid {
  display: grid;
  gap: 1rem;
}
@media (min-width: 760px) {
  .story-grid { grid-template-columns: 1.1fr 0.9fr; align-items: stretch; }
}
.story-card, .panel {
  background: var(--white);
  border: 1px solid rgba(42, 122, 154, 0.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.story-card {
  padding: 1.25rem 1.3rem;
}
.story-card h3 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  color: var(--teal-deep);
  font-size: 1.25rem;
}
.story-card p { margin: 0 0 0.85rem; }
.story-card p:last-child { margin-bottom: 0; }
.note {
  background: var(--foam);
  border-left: 4px solid var(--purple);
  padding: 0.85rem 1rem;
  border-radius: 0 12px 12px 0;
  color: var(--muted);
  margin-top: 1rem;
}
.story-media {
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #cfe4e8;
}
.story-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 240px;
}
.caption {
  font-size: 0.85rem;
  color: var(--soft);
  padding: 0.65rem 0.9rem 0.85rem;
  background: var(--white);
}

.stage-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .stage-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .stage-grid { grid-template-columns: repeat(3, 1fr); }
}
.stage-card {
  background: var(--white);
  border: 1px solid rgba(42, 122, 154, 0.12);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: 0 10px 24px rgba(26, 79, 122, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.stage-card.rich {
  padding: 0;
  overflow: hidden;
  gap: 0;
}
.stage-photo {
  position: relative;
  background: #d7e8ee;
}
.stage-photo img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.stage-card.rich .stage-num {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
}
.stage-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1rem 1.1rem 1.15rem;
}
.stage-num {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--mint);
  color: var(--teal-deep);
  font-weight: 800;
  font-size: 0.92rem;
}
.stage-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--ocean);
}
.stage-card .where {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stage-card p { margin: 0; color: var(--muted); }
.stage-card.wide { grid-column: 1 / -1; }
@media (min-width: 980px) {
  .stage-card.wide { grid-column: span 3; }
  .stage-card.rich.wide {
    display: grid;
    grid-template-columns: 1.1fr 1.2fr;
  }
  .stage-card.rich.wide .stage-photo img {
    height: 100%;
    aspect-ratio: auto;
    min-height: 220px;
  }
}

.diagram {
  margin: 1.4rem 0 0.4rem;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid rgba(42, 122, 154, 0.12);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.diagram img, .diagram object {
  width: 100%;
  display: block;
}
.diagram .caption { border-top: 1px solid var(--line); }

.species-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .species-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .species-grid { grid-template-columns: repeat(3, 1fr); }
}
.species-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(42, 122, 154, 0.12);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.species-photo-btn {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: #d7e8ee;
  cursor: zoom-in;
}
.species-photo-btn img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.zoom-hint {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  background: rgba(251, 248, 242, 0.94);
  color: var(--ocean);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  pointer-events: none;
}
.species-photo-btn:hover .zoom-hint,
.species-photo-btn:focus-visible .zoom-hint {
  background: var(--purple);
  color: #fff;
}
.species-photo-btn:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: -3px;
}
.species-body { padding: 1rem 1.05rem 1.15rem; }
.species-body h3 {
  margin: 0 0 0.2rem;
  font-family: var(--font-display);
  color: var(--ocean);
  font-size: 1.22rem;
}
.nickname {
  margin: 0 0 0.55rem;
  color: var(--purple);
  font-weight: 700;
  font-size: 0.92rem;
}
.species-body p { margin: 0; color: var(--muted); }

.game-panel, .quiz-panel {
  background: var(--white);
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid rgba(42, 122, 154, 0.14);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.game-help {
  margin: 0 0 1rem;
  color: var(--muted);
}
.pool-label, .slots-label {
  font-weight: 700;
  color: var(--teal-deep);
  margin: 0 0 0.55rem;
  font-size: 0.95rem;
}
.stage-pool, .stage-slots {
  display: grid;
  gap: 0.55rem;
  min-height: 3.2rem;
  margin-bottom: 1rem;
}
@media (min-width: 720px) {
  .stage-pool, .stage-slots {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }
}
.stage-chip {
  appearance: none;
  border: 2px solid var(--line);
  background: var(--foam);
  color: var(--ink);
  border-radius: 14px;
  padding: 0.75rem 0.6rem;
  font: inherit;
  font-weight: 700;
  cursor: grab;
  touch-action: none;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  user-select: none;
}
.stage-chip:active { cursor: grabbing; }
.stage-chip:hover, .stage-chip:focus-visible {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 8px 18px rgba(31, 122, 122, 0.18);
}
.stage-chip.selected {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(88, 28, 100, 0.18);
  background: #f4e8f6;
}
.stage-chip.dragging {
  opacity: 0.55;
  transform: scale(0.98);
}
.slot {
  min-height: 3.4rem;
  border: 2px dashed #9ebcc4;
  border-radius: 14px;
  background: var(--sand);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  position: relative;
}
.slot.filled { border-style: solid; border-color: var(--teal); background: #f2fbf8; }
.slot.drag-over {
  border-color: var(--purple);
  background: #f7eef8;
}
.slot.correct {
  border-style: solid;
  border-color: #2f8a4e;
  background: #e5f7ea;
  min-height: 5.5rem;
}
.slot-index {
  position: absolute;
  top: 0.35rem;
  left: 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--soft);
  z-index: 1;
}
.slot .stage-chip {
  width: 100%;
  margin: 0;
  cursor: pointer;
}
.slot-photo {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #9fd6ad;
  background: #fff;
}
.slot-photo img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.slot-photo .slot-photo-label {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #145c2e;
  padding: 0.25rem 0.3rem 0.4rem;
  background: #e5f7ea;
}
.game-actions, .quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.4rem;
}
.feedback {
  margin-top: 0.9rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  display: none;
}
.feedback.show { display: block; }
.feedback.ok {
  background: #e5f7ea;
  color: #145c2e;
  border: 1px solid #9fd6ad;
}
.feedback.bad {
  background: #fdeceb;
  color: #7a2a22;
  border: 1px solid #f0b2ab;
}
.feedback.info {
  background: var(--foam);
  color: var(--teal-deep);
  border: 1px solid #b7ddd8;
}

.quiz-progress {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--soft);
  margin-bottom: 0.6rem;
}
.quiz-question {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ocean);
  margin: 0 0 1rem;
}
.quiz-options {
  display: grid;
  gap: 0.55rem;
}
.quiz-option {
  text-align: left;
  border: 2px solid var(--line);
  background: var(--cream);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}
.quiz-option:hover:not(:disabled) {
  border-color: var(--teal);
  background: var(--foam);
}
.quiz-option:disabled { cursor: default; }
.quiz-option.correct {
  border-color: #2f8a4e;
  background: #e5f7ea;
}
.quiz-option.incorrect {
  border-color: #d86b5a;
  background: #fdeceb;
}
.quiz-score {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--foam), var(--mint));
  border: 1px solid var(--line);
  display: none;
}
.quiz-score.show { display: block; }
.quiz-score strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ocean);
}

.sources {
  background: #eef6f7;
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}
.sources h2 {
  font-family: var(--font-display);
  color: var(--ocean);
  margin: 0 0 0.6rem;
  font-size: 1.3rem;
}
.sources ul {
  margin: 0.4rem 0 0;
  padding-left: 1.15rem;
}
.sources li { margin: 0.25rem 0; }

.site-footer {
  background: var(--ocean);
  color: #d7e8f2;
  padding: 1.5rem 0;
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: grid;
  gap: 0.75rem;
}
.site-footer a { color: #fff; }
.footer-note { margin: 0; font-size: 0.92rem; opacity: 0.92; }

.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.2rem 0 0.4rem;
}
.toc a {
  text-decoration: none;
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--ocean);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
}
.toc a:hover { border-color: var(--teal); background: var(--foam); }

/* Lightbox */
.lightbox[hidden] { display: none !important; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 35, 48, 0.72);
}
.lightbox-dialog {
  position: relative;
  z-index: 1;
  max-width: min(920px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: var(--cream);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  padding: 1rem;
}
.lightbox-dialog img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 12px;
  background: #102838;
}
.lightbox-caption {
  margin: 0.75rem 0 0;
  color: var(--ocean);
  font-weight: 700;
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  border: none;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  z-index: 2;
}
.lightbox-close:hover { background: var(--teal-deep); }
body.lightbox-open { overflow: hidden; }

@media (max-width: 640px) {
  .nav a:not(.btn-home) { display: none; }
  .hero-actions .button { width: 100%; }
  .stage-card.rich.wide {
    display: flex;
  }
}

/* Photo-based lifecycle path (replaces old SVG + USACE diagrams) */
.lifecycle-path {
  margin: 0 0 1.25rem;
  padding: 1rem 1rem 0.85rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(31, 122, 122, 0.08), rgba(255, 255, 255, 0.9)),
    #f4faf9;
  border: 1px solid rgba(31, 122, 122, 0.18);
  box-shadow: 0 10px 28px rgba(20, 60, 70, 0.08);
}
.path-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  margin: 0 0 0.9rem;
}
.path-band {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.path-band.fresh { background: #d7f0e4; color: #0f5c3a; }
.path-band.salt { background: #d7e8f8; color: #174b7d; }
.path-band.return { background: #f8e2d7; color: #8a3b16; }
.path-arrow {
  color: #5d7a80;
  font-weight: 800;
}
.path-steps {
  list-style: none;
  margin: 0;
  padding: 0.15rem 0.15rem 0.35rem;
  display: grid;
  grid-template-columns: repeat(7, minmax(7.5rem, 1fr));
  gap: 0.65rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.path-step {
  position: relative;
  margin: 0;
  min-width: 7.5rem;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(20, 60, 70, 0.12);
  box-shadow: 0 6px 16px rgba(20, 60, 70, 0.08);
  scroll-snap-align: start;
  display: grid;
  grid-template-rows: auto auto auto auto;
  justify-items: center;
  text-align: center;
}
.path-step img {
  width: 100%;
  height: 5.6rem;
  object-fit: cover;
  display: block;
  background: #e8f2f2;
}
.path-num {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: #1f7a7a;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.path-step strong {
  margin-top: 0.4rem;
  font-size: 0.95rem;
  color: #17343a;
}
.path-place {
  display: block;
  margin: 0.1rem 0 0.55rem;
  padding: 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #4d6a70;
}
.path-caption {
  margin: 0.55rem 0 0;
  text-align: center;
}
@media (max-width: 900px) {
  .path-steps {
    grid-template-columns: repeat(7, minmax(8.25rem, 1fr));
    padding-bottom: 0.5rem;
  }
  .path-step img { height: 6rem; }
}

