body {
  font-family: Arial, Helvetica, sans-serif;
  margin: 0;
  padding: 0;
  background: #424242;
  color: #171717;
}

header {
  position: sticky;
  top: 0;
  background: #000;
  padding: 1rem;
  z-index: 100;
}

/*horseshoe leatherjacket MASCOT*/
.title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.title-fish {
  height: 4rem;          /* 👈 about 2× size */
  width: auto;
  opacity: 0.9;
  animation: floaty 4s ease-in-out infinite;
}

@media (max-width: 640px) {
  .title-fish {
    height: 3rem;
  }
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}


h1 {
  font-size: 2rem;
  color: white;
  margin: 0 0 0.5rem 0;
  text-transform: lowercase;
}
h2 {
  font-size: 1rem;
  color: black;
  margin: 0 0 0.5rem 0;
  text-transform: lowercase;
}
h3 {
  font-size: 1rem;
  color: white;
  margin: 0 0 0.5rem 0;
  text-transform: lowercase;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

select, input {
  padding: 0.5rem;
  border-radius: 9999px;
  border: 2px solid black;
}

/* ----------- PROGRESS BAR ----------- */
.progress-container {
  position: relative;
  width: 100%;
  height: 24px; /* increased thickness */
  background: #ddd;
  border-radius: 9999px;
  margin-top: 0.5rem;
}
/*prog bar falls short of wonky mobile vertical alphabet*/
@media (max-width: 640px) {
  .progress-container {
    padding-right: 10rem; /* space for alphabet */
  }
}


.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, #ec4899, #facc15, #3b82f6);
  border-radius: 9999px;
}
@media (max-width: 640px) {
  .progress-bar {
    max-width: calc(100% - 10rem);
  }
}


#progress-text {
  position: absolute;
  left: 0.75rem;
  top: 50%; /* vertically center */
  transform: translateY(-50%);
  font-weight: bold;
}

/* Default: 4 per row */
.species-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-top: 4rem;
  padding-right: 3rem;
  justify-items: stretch;
}

/* Mobile: 1 per row */
@media (max-width: 640px) {
  .species-grid {
    grid-template-columns: 1fr;
  }
}


/* Individual Card */
.species-card {
  border: 2px solid black;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  background: white;
  padding: 6px;          /* 👈 small, clean padding */
  box-sizing: border-box;
}

/* Fish Image */
.species-card img {
  width: 100%;
  aspect-ratio: 1 / 1; /* square images, large */
  object-fit: cover;
   position: relative;
  z-index: 1; /* ABOVE tint */
}

/* Placeholder images should be smaller + centred */
.species-card.locked img {
  width: 70%;
  aspect-ratio: auto;
  object-fit: contain;
  margin: 1.5rem auto 0.5rem;
  opacity: 0.85;
  
}

/* placeholder animations */
@keyframes wriggle {
  0%   { transform: translateY(0) rotate(0deg) scale(1); }
  15%  { transform: translateY(-4px) rotate(-2deg) scale(1.03); }
  30%  { transform: translateY(4px) rotate(2deg) scale(1.03); }
  50%  { transform: translateY(-3px) rotate(-1deg) scale(1.02); }
  70%  { transform: translateY(2px) rotate(1deg) scale(1.02); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}

.species-card.locked img.wiggle {
  animation: wriggle 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}




/* Text container inside card */
.species-card .card-text {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  gap: 0.25rem;
  flex-grow: 1; /* take remaining space below image */
  position: relative;
  z-index: 2; /* TOP layer */
}

/* Name and scientific name */
.species-card h2 {
  text-align: center;
  margin: 0;
}

.species-card p.scientific-name {
  text-align: center;
  font-style: italic;
  margin: 0;
}

/* Description: clamp to ~3 lines */
.species-card p.description {
  text-align: justify;
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5; /* limit to 3 lines */
}

.species-card.unlocked {
  box-shadow: 0 0 12px rgba(255,255,255,0.8);
}

.species-card.locked {
  filter: grayscale(100%);
  transform: scale(0.95);
  box-shadow: 0 0 8px rgba(0,0,0,0.4);
}
.vertical-alphabet {
  position: fixed;           /* stays on screen */
  top: 60%;                  /* ~3/5 down viewport */
  right: 1rem;               /* distance from right edge */
  transform: translateY(-50%); /* truly center around top point */
  display: flex;
  flex-direction: column;    /* vertical letters */
  gap: 0.2rem;
  z-index: 1000;             /* above everything */
}

@media (max-width: 640px) {
  .vertical-alphabet {
    position: fixed;
    top: auto !important;
    bottom: 1.25rem;
    right: 0.75rem;

    height: calc(100vh - 160px); /* header-safe zone */
    max-height: 70vh;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    transform: none !important;
  }
}


/* Base state */
.alphabet-letter {
  color: #ffffff;                 /* 👈 white letters */
  font-weight: 600;
  transform: scale(1);          /* 👈 start smaller */
  opacity: 0.4;
  transition:
    transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.25s ease,
    color 0.25s ease;
}

/* Hovered letter (big pop) */
.alphabet-letter:hover {
  transform: scale(3);          /* 👈 WAY more dramatic */
  opacity: 1;
  color: #ffffff;
}

/* Neighbour wave */
.alphabet-letter:hover + .alphabet-letter,
.alphabet-letter:has(+ .alphabet-letter:hover) {
  transform: scale(1.4);          /* 👈 strong wave */
  opacity: 0.8;
}

/* Active (current scroll position) */
.alphabet-letter.active {
  transform: scale(2.4);          /* 👈 biggest */
  opacity: 1;
    color: var(--alpha-tint, #ffffff);              /* 👈 TINT WHITE with ACTIVE COLOUR*/
}


mark {
  background-color: #fde047;
  color: black;
  border-radius: 0.2rem; 
  padding: 0 0.1rem;
}

.funder {
  margin-top: auto;
  font-size: 0.75rem;
  opacity: 0.6;
  text-align: right;
}

/* Coming soon (funded but not illustrated) */
.species-card.funded img {
  object-fit: contain;
  padding: 1.5rem;
  opacity: 0.75;
}

/* =========================
   MAGNIFY MODE — STEP 1
   Overlay Scaffold ONLY
   ========================= */

.magnify-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 220ms ease, visibility 0ms linear 220ms;
}

.magnify-overlay.is-visible {
  opacity: 1.3;
  visibility: visible;
  transition: opacity 220ms ease, visibility 0ms linear 0ms;
}

.magnify-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at center,
      var(--bg-colour, rgba(0,0,0,0)) 0%,
      rgba(0,0,0,0.9) 55%
    );
  opacity: 0;
  transition: opacity 220ms ease;
}



.magnify-stage {
  position: absolute;
  inset: 0;
}

.magnify-image-wrap {
  position: absolute;
  inset: 0;
}

.magnify-image {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(62vw, 560px);
  transform: translate(-50%, -50%);
  opacity: 0;
  filter: drop-shadow(0 18px 40px rgba(0,0,0,0.35));
  will-change: transform, top, left, width, height;
}

.magnify-text {
  position: absolute;
  left: 50%;
  bottom: 7vh;
  transform: translateX(-50%);
  width: min(860px, 92vw);
  text-align: center;
  color: rgba(255,255,255,0.92);
  opacity: 0;
}

.magnify-common {
  margin: 0 0 8px;
  font-size: clamp(28px, 3.2vw, 44px);
  color: rgba(255,255,255,0.95);

}

.magnify-scientific {
  margin: 0 0 14px;
  font-size: clamp(16px, 1.6vw, 20px);
  font-style: italic;
  opacity: 0.85;
}

.magnify-description,
.magnify-lore {
  margin: 0 auto 12px;
  max-width: 70ch;
  font-size: clamp(14px, 1.4vw, 18px);
  line-height: 1.55;
}

.magnify-lore {
  opacity: 0.78;
}

/* =========================
   MAGNIFY MODE — STEP 2
   Make content visible
   ========================= */

.magnify-overlay.is-visible {
  pointer-events: auto;
}

.magnify-overlay.is-visible .magnify-bg {
  opacity: 1;
}

.magnify-overlay.is-visible .magnify-image {
  opacity: 1;
}

.magnify-overlay.is-visible .magnify-text {
  opacity: 1;
}

/* =========================
   MAGNIFY MODE — ZOOM ANIMATION
   ========================= */
.magnify-image {
  transition:
    top 600ms cubic-bezier(0.22, 1, 0.36, 1),
    left 600ms cubic-bezier(0.22, 1, 0.36, 1),
    width 600ms cubic-bezier(0.22, 1, 0.36, 1),
    height 600ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 600ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 200ms ease;
}

.magnify-image-wrap.reset-visuals::before,
.magnify-image-wrap.reset-visuals::after {
  animation: none !important;
  opacity: 0 !important;
}

/* =========================
   MAGNIFY MODE — SHIMMER + GLITTER (FIXED)
   ========================= */

.magnify-image-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ---- SHIMMER (soft glow, behind fish) ---- */
.magnify-image-wrap::before {
  content: "";
  position: absolute;
  inset: -22%;
  z-index: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 25% 30%, rgba(255,255,255,0.35), transparent 45%),
    radial-gradient(circle at 70% 65%, rgba(255,255,255,0.25), transparent 50%),
    radial-gradient(circle at 45% 80%, rgba(255,255,255,0.18), transparent 55%);
  filter: blur(22px);
  opacity: 0;
  mix-blend-mode: screen;
  animation: shimmer-drift 8s linear infinite;
}

.magnify-overlay.is-visible .magnify-image-wrap::before {
  opacity: 0.9;
}


/* fish stays clean and above everything */
.magnify-image {
  position: relative;
  z-index: 2;
}

/* ---- animations ---- */
@keyframes shimmer-drift {
  0%   { transform: scale(0.95) rotate(0deg); }
  50%  { transform: scale(1.05) rotate(180deg); }
  100% { transform: scale(0.95) rotate(360deg); }
}

/* =========================
   MAGNIFY MODE — GLITTER EMITTER
   ========================= */

.magnify-glitter-layer {
  position: absolute;
  inset: -30%;
  z-index: 1; /* behind fish, above shimmer */
  pointer-events: none;
  overflow: visible;
}

.magnify-glitter-layer span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sparkle-colour, rgba(255,255,255,0.9));
  opacity: 0;
  filter: blur(0.3px);
  animation: glitter-fly 2.6s linear forwards;
}

@keyframes glitter-fly {
  0% {
    transform: translate(0, 0) scale(0.6);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) scale(1.2);
    opacity: 0;
  }
}

/* keep fish above everything */
.magnify-image {
  position: relative;
  z-index: 3;
}
/* =========================
   CARD HOVER — SPECIES TINT
   ========================= */

.species-card.unlocked {
  position: relative;
  overflow: hidden;
}

.species-card.unlocked::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--card-tint);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 0; /* LOWEST: tint sits underneath everything */
}

.species-card.unlocked:hover::before {
  opacity: 0.6; /* light, bright wash */
}

.species-card.unlocked:hover {
  transform: translateY(-10px);
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--card-tint) 85%, transparent),
    0 12px 32px color-mix(in srgb, var(--card-tint) 65%, rgba(0,0,0,0.35));
}

/* FUNDED / COMING SOON — force small, centred badge */
.species-card.funded {
  display: flex;
  align-items: center;
  justify-content: center;
}

.species-card.funded img {
  width: 45% !important;
  height: auto !important;
  max-width: 160px;
  object-fit: contain;
  opacity: 0.85;
}



