/* Fins: fresh to salt. One frame, two kinds of water, a pane that stays put. */

/* ---- Opening: the betta, with the tank's own room around it ------------------ */
.fins-open { --hood-x: 72%; }
.fins-open .display { font-size: clamp(2.75rem, 1.2rem + 4vw, 6rem); line-height: .94; }
.fins-open .display span { display: block; }
.fins-hero { margin-top: clamp(1.5rem, 4vh, 2.5rem); background: var(--shade); }
.fins-hero img { width: 100%; aspect-ratio: 4 / 5; max-height: 60vh; max-height: 60svh; object-fit: cover; object-position: 50% 40%; }
@media (min-width: 56rem) {
  .fins-hero {
    position: absolute; z-index: -1; top: 0; right: 0; bottom: 0; width: 56%; margin: 0;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36%);
    mask-image: linear-gradient(90deg, transparent 0, #000 36%);
  }
  .fins-hero img { height: 100%; max-height: none; aspect-ratio: auto; }
}

/* ---- The set piece: one frame, fresh water into salt ------------------------- */
.fins-cross { --hood-x: 50%; min-height: 250vh; min-height: 250svh; padding-bottom: 0; }
.fins-stage {
  position: sticky; top: 0; display: flex; flex-direction: column; gap: clamp(1rem, 3vh, 1.75rem);
  min-height: 100vh; min-height: 100svh; padding: clamp(1rem, 2vh, 1.5rem) 0 clamp(1.5rem, 4vh, 3rem);
}
.fins-wrap { width: min(100%, 112vh); width: min(100%, 112svh); margin-block: auto; }
.fins-frame { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); aspect-ratio: 8 / 5; background: var(--shade); }
.fins-cell { position: relative; min-width: 0; overflow: hidden; }
.fins-cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fins-cell--fresh img { object-position: 50% 40%; }
.fins-cell--salt img { object-position: 72% 25%; }
.fins-cell::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 80% 80% at 50% 45%, transparent 55%, var(--shade) 100%); }
/* The pane: a hairline of glass at the centre of the frame. It never moves. */
.fins-pane {
  position: absolute; top: 0; bottom: 0; left: 50%; width: .75rem; transform: translateX(-50%); pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--teal-lit) 20%, transparent) 50%, transparent);
}
.fins-pane::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: var(--hair); background: var(--teal-lit); box-shadow: 0 0 .75rem color-mix(in srgb, var(--teal-lit) 70%, transparent); }
.fins-caps { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--gap); margin-top: 1rem; }
.fins-caps .cap { margin-top: 0; max-width: 18rem; }
.fins-caps .cap span { display: block; margin-bottom: .35rem; color: var(--ink); }

/* Scroll sets the water: fresh fades down as salt comes up, in place. Reduced motion keeps both lit. */
@media (prefers-reduced-motion: no-preference) {
  .js .fins-cell--fresh { opacity: calc(1 - .86 * var(--p, 0)); }
  .js .fins-cell--salt { opacity: calc(.14 + .86 * var(--p, 0)); }
  @media (max-width: 47.99rem) {
    .js .fins-wrap { width: 100%; }
    .js .fins-frame { grid-template-columns: minmax(0, 1fr); aspect-ratio: 4 / 5; width: min(100%, 46vh); width: min(100%, 46svh); }
    .js .fins-cell { grid-area: 1 / 1; }
    .js .fins-cell--fresh { opacity: calc(1 - var(--p, 0)); }
    .js .fins-cell--salt { opacity: var(--p, 0); }
  }
}
@media (max-height: 34rem) {
  .fins-cross { min-height: 0; }
  .fins-stage { position: static; }
}

/* ---- Freshwater and saltwater copy: five columns, the rest left as water ------ */
.fins-fresh { --hood-x: 24%; }
.fins-salt { --hood-x: 78%; }
.fins-copy .fins-text h3 { margin-top: 2.5rem; }
.fins-copy .fins-text .label { margin-bottom: .25rem; }
.fins-facts .label { margin-bottom: 1rem; }
@media (min-width: 56rem) {
  .fins-copy .fins-text { grid-column: 1 / span 5; grid-row: 1; }
  .fins-copy .fins-facts { grid-column: 8 / span 5; grid-row: 1; align-self: end; }
  .fins-salt .fins-text { grid-column: 8 / span 5; }
  .fins-salt .fins-facts { grid-column: 1 / span 5; }
}

/* ---- The clownfish alone on its own screen ----------------------------------- */
.fins-solo { --hood-x: 28%; }
.fins-solo-pic .pic-frame { aspect-ratio: 4 / 5; }
.fins-solo-pic .pic-frame img { object-position: 72% 22%; }
.fins-solo-note .title { margin-bottom: .25rem; }
@media (min-width: 56rem) {
  .fins-solo .tank-body { align-items: end; }
  .fins-solo-pic { grid-column: 1 / span 7; }
  .fins-solo-pic .pic-frame { aspect-ratio: auto; height: min(74vh, 54rem); height: min(74svh, 54rem); }
  .fins-solo-note { grid-column: 9 / span 4; }
}

/* ---- The four fish, as ruled text links -------------------------------------- */
.fins-index { --hood-x: 60%; }
.fins-list { list-style: none; padding: 0; border-bottom: var(--hair) solid var(--line); }
.fish-row {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); row-gap: .75rem;
  padding: clamp(1.25rem, 3vh, 2rem) 0; border-top: var(--hair) solid var(--line);
}
.fish-row > * { grid-column: 1 / -1; min-width: 0; }
.fish-name {
  font-family: var(--serif); font-size: clamp(1.5rem, 1rem + 1.8vw, 2.5rem); line-height: 1.05; letter-spacing: -.015em;
  font-variation-settings: "SOFT" 100, "WONK" 1; text-wrap: balance;
  text-decoration: underline; text-decoration-color: transparent; text-decoration-thickness: var(--hair); text-underline-offset: .2em;
  transition: color .3s, text-decoration-color .3s;
}
.fish-row:hover .fish-name, .fish-row:focus-visible .fish-name { color: var(--teal-lit); text-decoration-color: var(--teal-lit); }
.fish-meta .label, .fish-meta .note { display: block; }
.fish-meta .note { margin-top: .5rem; }
@media (min-width: 56rem) {
  .fish-name { grid-column: 1 / span 5; }
  .fish-meta { grid-column: 8 / span 5; }
}
