:root {
  --ink: #e8fbff;
  --muted: #9fd8e6;
  --glow: #6ff3ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  /* Fallback background when WebGL is unavailable. */
  background: radial-gradient(ellipse at 50% 120%, #0b4a5c 0%, #03101f 60%, #010409 100%);
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", system-ui, sans-serif;
  overflow-x: hidden;
}

/* Headings get a squarer display face, so the page has a voice of its own. */
h1,
h2,
.game-title,
.rank-name {
  font-family: "Chakra Petch", "Manrope", system-ui, sans-serif;
}

a {
  color: var(--glow);
}

a:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Browser defaults, themed to the sea. */
::selection {
  background: rgba(111, 243, 255, 0.28);
  color: #ffffff;
}

html {
  scrollbar-color: rgba(111, 243, 255, 0.35) transparent;
}

#ocean {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* Intro: the prompt to dive. */
.intro {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 1.2s ease;
}

.intro.gone {
  opacity: 0;
  pointer-events: none;
}

.prompt {
  letter-spacing: 0.3em;
  font-size: 0.9rem;
  color: var(--muted);
  animation: breathe 2.8s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

/* Home page: name, bio, and the links as glowing creatures. */
.home {
  position: relative;
  z-index: 2;
  /* Taller than the screen, so there is deeper water to scroll down into. */
  min-height: 140vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12vh 16px 8vh;
  text-align: center;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.4s ease, transform 1.4s ease;
}

.home.surfaced {
  opacity: 1;
  transform: none;
}

h1 {
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 600;
  margin: 0 0 0.5rem;
  text-shadow: 0 2px 12px rgba(0, 6, 16, 0.8);
}

.bio {
  text-shadow: 0 2px 12px rgba(0, 6, 16, 0.9);
}

/* The home name is smaller than before. It stands out by its weight, its
   spacing and a short glowing rule beneath it. */
.home h1 {
  font-size: clamp(2.2rem, 6.4vw, 3.5rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.08em;
  margin: 0 0 1.1rem;
}

/* Hovering the name fades its second face in over the first. */
.name-swap {
  display: inline-grid;
  cursor: default;
}

.name-swap > .name-face {
  grid-area: 1 / 1;
  transition: opacity 0.45s ease;
}

.name-swap > .name-alt {
  opacity: 0;
}

.name-swap:hover > .name-face:not(.name-alt) {
  opacity: 0;
}

.name-swap:hover > .name-alt {
  opacity: 1;
}

.home h1::after {
  content: "";
  display: block;
  width: 2.8rem;
  height: 2px;
  margin: 1rem auto 0;
  background: var(--glow);
  box-shadow: 0 0 10px rgba(111, 243, 255, 0.6);
}

/* The bio line: "hi" and the icon links, on one row. */
.bio-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.9rem 1.4rem;
}

.bio {
  margin: 0;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  line-height: 1.6;
}

.socials {
  display: flex;
  gap: 0.6rem;
}

/* Round glass buttons, one per link. They light up on hover and focus. */
.social {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 50%;
  color: var(--muted);
  border: 1px solid rgba(111, 243, 255, 0.22);
  background: rgba(2, 10, 24, 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.social svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

a.social:hover,
a.social:focus-visible {
  color: var(--ink);
  border-color: rgba(111, 243, 255, 0.7);
  box-shadow: 0 0 14px rgba(111, 243, 255, 0.3);
  outline: none;
}

/* A short handle that appears under an icon on hover or focus. */
.social-tag {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(111, 243, 255, 0.3);
  background: rgba(2, 10, 24, 0.75);
  color: var(--ink);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.social:hover .social-tag,
.social:focus-visible .social-tag {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Home page: the links are stars in a constellation. */
.creatures {
  position: relative;
  width: 100%;
  max-width: 56rem;
  margin-top: 4vh;
}

.constellation-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}


/* Star dust: a seeded sky fixed to the screen. It drifts against the pointer,
   and the stars above the surface line are lit brighter than those below it. */
.home-stars {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.hs {
  position: absolute;
  opacity: var(--lit, 0.5);
  translate: calc(var(--mx, 0) * var(--depth, 1) * -14px) calc(var(--my, 0) * var(--depth, 1) * -14px);
  transition: opacity 0.6s ease-out, translate 1.4s ease-out;
}

/* The twinkle runs on the inner dot, so the light level on .hs stays put. */
.hs::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #fff;
  animation: hs-twinkle 6s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

@keyframes hs-twinkle {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 0.9;
  }
}

/* A link is a box on the sky: a solid dark panel with a clear border, the name
   and a line beneath it. Each one floats slowly and drifts toward the pointer. */
.star {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 16rem;
  padding: 1.1rem 1.1rem 1.2rem;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  background: rgba(3, 12, 26, 0.8);
  border: 1px solid rgba(111, 243, 255, 0.4);
  border-radius: 4px;
  box-shadow: 0 18px 34px -22px rgba(0, 0, 0, 0.9);
  transform: translate(-50%, -50%) translate(
    calc(var(--mx, 0) * var(--depth, 1) * -10px),
    calc(var(--my, 0) * var(--depth, 1) * -10px)
  );
  transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), border-color 0.4s ease, background-color 0.4s ease;
  animation: region-drift 16s ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}

@keyframes region-drift {
  from {
    translate: 0 0;
  }
  to {
    translate: 0 -8px;
  }
}

.star:hover,
.star:focus-visible {
  outline: none;
  border-color: var(--glow);
  background: rgba(5, 18, 38, 0.92);
}

.star .title {
  position: relative;
  padding-bottom: 0.7rem;
  font-family: "Chakra Petch", "Manrope", system-ui, sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* A short rule under the name draws out from its centre on hover. */
.star .title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 2.2rem;
  height: 1px;
  background: var(--glow);
  transform: translateX(-50%);
  transition: width 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.star:hover .title::after,
.star:focus-visible .title::after {
  width: 6rem;
}

/* Each line joins two stars of the one constellation. It draws in one segment
   after another, and the two lines at a star light up when that star is touched. */
.constellation-lines .seg {
  stroke: rgba(111, 243, 255, 0.34);
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 1.2s cubic-bezier(0.4, 0, 0.2, 1) calc(var(--i, 0) * 0.3s),
    stroke 0.5s ease, stroke-width 0.5s ease;
}

.constellation-lines.drawn .seg {
  stroke-dashoffset: 0;
}

.constellation-lines .seg.lit {
  stroke: rgba(190, 235, 255, 0.95);
  stroke-width: 1.6;
}

/* The extra info opens from nothing to its full height on hover. */
.info {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.info > .blurb {
  min-height: 0;
  overflow: hidden;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.star:hover .info,
.star:focus-visible .info {
  grid-template-rows: 1fr;
}

.star:hover .info > .blurb,
.star:focus-visible .info > .blurb {
  opacity: 1;
  transition-delay: 0.15s;
}

/* Phones have no hover, so the extra info stays open there. */
@media (hover: none) {
  .info {
    grid-template-rows: 1fr;
  }

  .info > .blurb {
    opacity: 0.85;
  }
}

/* On a phone the one constellation runs down a single column of boxes. */
@media (max-width: 720px) {
  .star {
    width: min(16rem, 78vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  .star,
  .hs::before {
    animation: none;
  }

  .hs {
    translate: none;
  }

  .star,
  .star .title::after {
    transition: none;
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

/* Subpages. */
.article {
  position: relative;
  z-index: 2;
  max-width: 42rem;
  margin: 8vh auto;
  padding: 6vh 28px 7vh;
  line-height: 1.7;
  border-radius: 18px;
  /* A dark panel keeps the text readable over the busy water. */
  background: rgba(2, 10, 24, 0.6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: rise 1.2s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
}

.article h1 {
  text-align: left;
}

.back {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.back:hover {
  color: var(--glow);
}

/* Song of the day. */
.kicker {
  margin: 0 0 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.cover {
  display: block;
  width: min(15rem, 70vw);
  aspect-ratio: 1;
  margin: 0 auto 1.5rem;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(111, 243, 255, 0.15);
}

.cover[hidden] {
  display: none;
}

.song-title {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin-bottom: 1.2rem;
}

.player {
  display: block;
  width: 100%;
  height: 152px;
  border: 0;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.spotify-code {
  display: block;
  width: min(12rem, 60vw);
  margin: 1.5rem auto 0;
  border-radius: 12px;
}

.spotify-code[hidden] {
  display: none;
}

/* A page with no panel: the text sits straight on the water. */
.article.plain {
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  text-shadow: 0 2px 12px rgba(0, 6, 16, 0.9);
}

/* Depth: the tint darkens as you scroll down (set in main.js). */
#depth {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Plankton: glowing specks left by the cursor, brighter in deeper water. */
#plankton {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.glow-dot {
  position: absolute;
  width: var(--size, 4px);
  height: var(--size, 4px);
  margin: calc(var(--size, 4px) / -2) 0 0 calc(var(--size, 4px) / -2);
  border-radius: 50%;
  background: #bff8ff;
  box-shadow: 0 0 8px 3px rgba(111, 243, 255, 0.6);
  animation: plankton 1.6s ease-out forwards;
}

@keyframes plankton {
  0% {
    opacity: 0.9;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx, 0), var(--dy, -20px)) scale(0.4);
  }
}

/* Daylight: a pale wash over the water, shown by day (set in main.js). */
#daylight {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: rgba(120, 210, 230, 0.22);
  opacity: 0;
}

/* The moon, in the top right, lit to match the real phase tonight. */
#moon {
  position: fixed;
  top: 6vh;
  right: 6vw;
  z-index: 3;
  width: min(6.5rem, 22vw);
  text-align: center;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

#moon svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 14px rgba(200, 235, 255, 0.35));
}

.moon-dark {
  fill: #0a1622;
  stroke: rgba(111, 243, 255, 0.15);
  stroke-width: 1;
}

.moon-lit {
  fill: #eaf6ff;
}

.moon-time {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--ink);
  text-shadow: 0 1px 8px rgba(0, 6, 16, 0.9);
}

.moon-info {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-shadow: 0 1px 8px rgba(0, 6, 16, 0.9);
}

/* On phones the moon is smaller and higher, so it clears the card headings. */
@media (max-width: 600px) {
  #moon {
    top: 3vh;
    right: 16px;
    width: 3.75rem;
  }

  .moon-time {
    margin-top: 0.3rem;
    font-size: 0.7rem;
  }

  .moon-info {
    display: none;
  }
}

/* Fish in the distance: small, dim, flat silhouettes that cross the water now and then. */
#fish {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.fish {
  position: absolute;
  left: 0;
  color: rgba(111, 243, 255, 0.5);
  filter: blur(0.6px);
  will-change: transform;
}

.fish svg {
  display: block;
  width: 100%;
  height: auto;
  fill: currentColor;
}

.fish.eel svg path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
}

/* The tail wags from its joint with the body, so it swings side to side. */
.fish .tail {
  transform-box: fill-box;
  transform-origin: left center;
  animation: tail-wag 0.5s ease-in-out infinite alternate;
}

@keyframes tail-wag {
  from { transform: rotate(-22deg); }
  to { transform: rotate(22deg); }
}

/* Games: one glass card per game, with rank crests. */
.games-grid {
  display: grid;
  gap: 20px;
  margin-top: 2rem;
}

.game-card {
  padding: 28px;
  border-radius: 18px;
  background: rgba(2, 10, 24, 0.7);
  border: 1px solid rgba(111, 243, 255, 0.18);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(111, 243, 255, 0.12);
  text-align: center;
  animation: rise 1.2s ease both;
}

.game-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.5rem;
}

/* The game name sits in a thick, tilted rose-red box with a hard offset edge. */
.game-title {
  display: inline-block;
  margin: 0;
  padding: 0.1em 0.55em 0.2em;
  font-size: 1.6rem;
  text-align: left;
  color: #ffe4ec;
  background: rgba(225, 29, 72, 0.18);
  border: 4px solid #e11d48;
  box-shadow: 5px 5px 0 rgba(225, 29, 72, 0.4);
  transform: rotate(-2deg);
}

.game-tag {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.ranks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 2rem 3rem;
}

.rank {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rank-label {
  margin-bottom: 0.9rem;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Each tier sets its own colours. The crest is a diamond with an inner gem. */
.crest-wrap[data-tier="iron"] { --hi: #9aa1ab; --lo: #3a3f47; --glow: rgba(154, 161, 171, 0.5); }
.crest-wrap[data-tier="bronze"] { --hi: #c08656; --lo: #5a3a22; --glow: rgba(192, 134, 86, 0.5); }
.crest-wrap[data-tier="silver"] { --hi: #d4dfe8; --lo: #5c6c7a; --glow: rgba(212, 223, 232, 0.5); }
.crest-wrap[data-tier="gold"] { --hi: #ecc25a; --lo: #7a5a14; --glow: rgba(236, 194, 90, 0.5); }
.crest-wrap[data-tier="platinum"] { --hi: #62dccb; --lo: #1d6b66; --glow: rgba(98, 220, 203, 0.5); }
.crest-wrap[data-tier="diamond"] { --hi: #75acff; --lo: #1d3f86; --glow: rgba(117, 172, 255, 0.5); }
.crest-wrap[data-tier="ascendant"] { --hi: #3ee0a0; --lo: #0f5c45; --glow: rgba(62, 224, 160, 0.55); }
.crest-wrap[data-tier="immortal"] { --hi: #ff4d6d; --lo: #6b0f23; --glow: rgba(255, 77, 109, 0.55); }
.crest-wrap[data-tier="radiant"] { --hi: #fff3a3; --lo: #a88a1c; --glow: rgba(255, 243, 163, 0.6); }

.crest-wrap {
  filter: drop-shadow(0 10px 16px rgba(0, 6, 16, 0.5));
}

.crest {
  position: relative;
  width: 5.5rem;
  height: 5.5rem;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: linear-gradient(160deg, var(--hi), var(--lo));
}

.crest::after {
  content: "";
  position: absolute;
  inset: 16%;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: linear-gradient(160deg, rgba(2, 10, 24, 0.15), rgba(2, 10, 24, 0.75));
}

.rank-main .crest {
  width: 7.5rem;
  height: 7.5rem;
}

.rank-name {
  margin-top: 1rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.rank-main .rank-name {
  font-size: 1.25rem;
}

.game-note {
  margin: 1.6rem 0 0;
  text-align: left;
  color: var(--muted);
  text-wrap: balance;
}

/* Highlight clip: a 16:9 frame under the ranks, empty until a clip is added. */
.clip {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  margin-top: 0.9rem;
  overflow: hidden;
  border-radius: 14px;
  border: 1px dashed rgba(111, 243, 255, 0.25);
  background: rgba(2, 10, 24, 0.35);
}

.clip-media {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #010815;
}

/* "Clip" heading, with dashed rules on each side. */
.clip-divider {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-top: 2rem;
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}

.clip-divider::before,
.clip-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(111, 243, 255, 0.45) 0 10px, transparent 10px 16px);
}

.clip-label {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Riot IDs as tags, each linking to its tracker.gg profile. */
.accounts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.accs-label {
  align-self: center;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

.account-tag,
.handle-tag {
  position: relative;
  overflow: hidden;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(74, 255, 150, 0.45);
  background: rgba(74, 255, 150, 0.07);
  box-shadow: 0 0 12px rgba(74, 255, 150, 0.22);
  color: var(--ink);
  font-size: 0.8rem;
  text-decoration: none;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.account-tag:hover,
.account-tag:focus-visible {
  background: rgba(74, 255, 150, 0.16);
  border-color: rgba(74, 255, 150, 0.8);
}

/* A green light runs across each handle, over and over. */
.account-tag::after,
.handle-tag::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 35%, rgba(74, 255, 150, 0.5) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: handle-sweep 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes handle-sweep {
  to {
    transform: translateX(100%);
  }
}

/* Screenshots: a grid of frames. Empty slots shimmer until images are added. */
.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.6rem;
  margin-top: 1.8rem;
}

.shot,
.shot-slot {
  position: relative;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border-radius: 12px;
}

.shot {
  border: 1px solid rgba(111, 243, 255, 0.2);
  background: #010815;
  cursor: zoom-in;
  transition: transform 0.4s ease, border-color 0.4s ease;
}

.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shot:hover,
.shot:focus-visible {
  transform: translateY(-3px);
  border-color: var(--glow);
  outline: none;
}

.shot-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(111, 243, 255, 0.25);
  background: rgba(2, 10, 24, 0.35);
}

/* One light sweep crosses each empty slot when the page loads. */
.shot-slot::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(111, 243, 255, 0.12) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: sweep 1.4s ease-out 0.3s both;
}

@keyframes sweep {
  to {
    transform: translateX(100%);
  }
}

/* Lightbox: one screenshot over a dark sea, with arrows and a counter. */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vh 4vw;
  background: rgba(1, 8, 21, 0.9);
}

#lightbox[hidden] {
  display: none;
}

.lightbox-img {
  max-width: 100%;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.lightbox-count {
  position: absolute;
  top: 18px;
  left: 18px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.lightbox-btn {
  position: absolute;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 1px solid rgba(111, 243, 255, 0.3);
  background: rgba(2, 10, 24, 0.6);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.lightbox-btn:hover,
.lightbox-btn:focus-visible {
  border-color: var(--glow);
  outline: none;
}

.lightbox-close {
  top: 14px;
  right: 14px;
}

.lightbox-prev {
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

/* The deep-blue fade used when moving between pages. */
#sink {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #010815;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}

#sink.on {
  opacity: 1;
  pointer-events: all;
}

/* Ink for a change of theme. It starts hidden below the screen, rises to cover
   it (.on), then drains upward to show the new page (.out). */
#ink {
  position: fixed;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.14) 0.9px, transparent 1.4px) 0 0 / 4px 4px, #000;
  clip-path: inset(100% 0 0 0);
  transition: clip-path 0.8s cubic-bezier(0.7, 0, 0.2, 1);
}

#ink.on {
  clip-path: inset(0 0 0 0);
}

#ink.out {
  clip-path: inset(0 0 100% 0);
}

#ink.instant {
  transition: none;
}

/* Into the sky: a constellation. The sea dims, stars light up and join into a
   line, and the galaxy comes up beneath (see main.js). Hidden unless .on. */
/* Sized to the whole window, scrollbar included, because the stars are placed
   in window pixels. Inset 0 would be narrower when a scrollbar shows, and the
   line would drift against the stars. */
#constellation {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100%;
  z-index: 12;
  display: none;
  overflow: hidden;
  pointer-events: none;
}

#constellation.on {
  display: block;
  pointer-events: all;
}

#constellation .cs-dim,
#constellation .cs-sky {
  position: absolute;
  inset: 0;
  opacity: 0;
}

#constellation .cs-dim {
  background: #010815;
}

#constellation .cs-sky {
  background:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff, transparent),
    radial-gradient(1px 1px at 34% 62%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.4px 1.4px at 58% 14%, #fff, transparent),
    radial-gradient(1px 1px at 81% 46%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.2px 1.2px at 70% 84%, rgba(255, 255, 255, 0.75), transparent),
    radial-gradient(1px 1px at 26% 90%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(ellipse 55% 45% at 72% 28%, rgba(110, 84, 170, 0.22), transparent 70%),
    radial-gradient(ellipse 60% 50% at 18% 78%, rgba(44, 110, 150, 0.18), transparent 70%),
    linear-gradient(#05060d, #03040a);
}

#constellation .cs-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#constellation .cs-lines polyline {
  fill: none;
  stroke: rgba(190, 225, 255, 0.75);
  stroke-width: 1;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

#constellation .cs-glow {
  stroke: rgba(160, 215, 255, 0.28);
  stroke-width: 5;
}

#constellation .cs-star {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px 3px rgba(190, 220, 255, 0.75);
  opacity: 0;
  transform: translate(-50%, -50%);
}

/* The constellation stays on the galaxy after the move: a fainter line and
   stars that twinkle slowly. It sits behind the page content. */
#constellation-sky {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* The same line as the transition, dimmed by the svg's opacity. */
#constellation-sky svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.27;
}

#constellation-sky polyline {
  fill: none;
  stroke: rgba(190, 225, 255, 0.75);
  stroke-width: 1;
}

#constellation-sky .cs-glow {
  stroke: rgba(160, 215, 255, 0.28);
  stroke-width: 5;
}

#constellation-sky .bg-star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px 1px rgba(190, 220, 255, 0.5);
  opacity: 0.6;
  transform: translate(-50%, -50%);
  animation: cs-twinkle 7s ease-in-out infinite;
}

@keyframes cs-twinkle {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.72; }
}

@media (prefers-reduced-motion: reduce) {
  #constellation-sky .bg-star {
    animation: none;
  }
}

/* Selected home direction: Depth Index. */
.depth-index .creatures{display:flex;flex-direction:column;align-items:stretch;width:min(700px,82vw);max-width:700px;gap:24px;margin-top:32vh;height:auto;padding-bottom:75px}
.depth-index .star{position:relative;left:auto;top:auto;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;align-self:flex-start;width:82%;min-height:96px;margin:0;padding:8px 0 18px;border:0;border-bottom:1px solid #507a8b80;border-radius:0;background:none;box-shadow:none;text-align:left;transform:none;translate:0;animation:none;transition:translate .5s cubic-bezier(.22,1,.36,1),border-color .4s}
.depth-index .star:nth-child(3n+2){width:72%;align-self:flex-end}.depth-index .star:nth-child(3n){width:60%;margin-left:8%}
.depth-index .star .title{font-size:clamp(1.35rem,3vw,1.65rem);font-weight:400;letter-spacing:.01em;text-transform:none;padding:0;color:#d5edf6}.depth-index .star .title::after{display:none}
.depth-index .star .info{display:block;grid-template-rows:unset;opacity:0;visibility:hidden;margin-top:4px;transition:opacity .3s,visibility .3s}
.depth-index .star .blurb{display:block;opacity:1;font-size:.8rem;color:#abc7d6;line-height:1.6;overflow:visible}
.depth-index .star:hover,.depth-index .star:focus-visible{background:none;box-shadow:none;border-color:#c1e2ef;translate:12px 0}
.depth-index .star:hover .info,.depth-index .star:focus-visible .info{opacity:1;visibility:visible}.depth-index .star:focus-visible{outline:2px solid #b8ebff;outline-offset:8px}
body[data-page=home] .home-stars .hs{translate:calc(var(--mx,0) * var(--depth,1) * -32px) calc(var(--my,0) * var(--depth,1) * -26px);transition:translate 1s cubic-bezier(.22,1,.36,1),opacity .4s}
@media(max-width:720px){.depth-index .creatures{width:86vw;gap:20px}.depth-index .star{width:95%}.depth-index .star:nth-child(3n+2){width:90%}.depth-index .star:nth-child(3n){width:85%;margin-left:0}}
@media(prefers-reduced-motion:reduce){body[data-page=home] .home-stars .hs{translate:0;transition:none}.depth-index .star{transition:none}}

/* Surface / submerge switch, available after the intro. */
#view-toggle{display:none;position:fixed;right:16px;top:50%;translate:0 -50%;z-index:5;min-width:64px;min-height:62px;padding:10px 8px;border:1px solid #7696a451;border-radius:5px;background:#041523c9;color:#bbd5e1;font:400 .68rem 'Manrope',sans-serif;cursor:pointer;align-items:center;justify-content:center;flex-direction:column;gap:5px;transition:background .3s,border-color .3s}
body.dived #view-toggle{display:flex}#view-toggle svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.4;transition:rotate .5s}#view-toggle:hover{border-color:#b7dce3;background:#0a2537}#view-toggle:focus-visible{outline:2px solid #bee6f0;outline-offset:5px}#view-toggle:disabled{cursor:wait;opacity:.7}.surface-view #view-toggle svg{rotate:180deg}
.surface-view #fish,.surface-view #plankton,.surface-view #depth-tint{opacity:0!important;transition:opacity .6s}.surface-view .home{min-height:100vh}
.surface-view .depth-index .creatures{flex-direction:row;align-items:flex-start;justify-content:center;width:min(820px,83vw);max-width:820px;gap:30px;padding-bottom:30px}
.surface-view .depth-index .star:nth-child(n){width:auto;flex:1;min-width:0;align-self:stretch;margin:0;padding:10px 0 16px;min-height:80px}.surface-view .depth-index .star .title{font-size:1.15rem}.surface-view .depth-index .star .info{position:absolute;top:100%;left:0;max-width:100%;margin-top:6px}.surface-view .depth-index .star:hover{translate:0 -4px}
@media(max-width:720px){#view-toggle{right:8px;top:auto;bottom:140px;translate:0;min-width:60px;min-height:56px}.surface-view .depth-index .creatures{width:88vw;gap:16px}.surface-view .depth-index .star .title{font-size:.95rem;line-height:1.45}.surface-view .depth-index .star:nth-child(n){min-height:96px}.surface-view .depth-index .star .blurb{font-size:.7rem}}
@media(prefers-reduced-motion:reduce){#view-toggle,#view-toggle svg{transition:none}}

.home-stars{transition:opacity .9s ease}.surface-view .home-stars{opacity:0}.view-transition .depth-index .star{transform-origin:top left;pointer-events:none;will-change:transform}.view-transition .depth-index .star:hover{translate:0}.view-transition #home{overflow-anchor:none}@media(prefers-reduced-motion:reduce){.home-stars{transition:opacity .2s}}
