@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Fredoka:wght@600;700&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  --current: #0b84c6;
  --deep: #07537f;
  --tidal: #009db5;
  --foam: #f4fbff;
  --mist: #e2f6ff;
  --coral: #d63852;
  --coral-dark: #b72d43;
  --kelp: #3b9d50;
  --shell: #ffd34d;
  --ink: #173b52;
  --muted: #567487;
  --line: #b9dfea;
  --white: #ffffff;
  --focus: #ffd34d;
  --radius: 8px;
  --shadow: 0 14px 36px rgba(7, 83, 127, 0.14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--foam);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.65;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 1000;
  background: var(--shell);
  color: var(--deep);
  padding: 10px 14px;
  border-radius: 4px;
  font-weight: 700;
}

.skip-link:focus { top: 12px; }

.container {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 74px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.nav-row {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand-copy strong {
  display: block;
  color: var(--deep);
  font-family: "Fredoka", Arial, sans-serif;
  font-size: 20px;
  line-height: 1.05;
}

.brand-copy small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 9px 11px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  font-size: 15px;
  font-weight: 700;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--deep);
  border-color: var(--coral);
}

.nav-search {
  display: flex;
  align-items: stretch;
  width: 230px;
}

.nav-search input,
.level-search input {
  min-width: 0;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--white);
  color: var(--ink);
  padding: 10px 12px;
}

.nav-search button,
.level-search button {
  border: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--coral);
  color: var(--white);
  padding: 10px 14px;
  font-weight: 700;
}

.nav-search button:hover,
.level-search button:hover { background: var(--coral-dark); }

.menu-button {
  display: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--deep);
  padding: 9px 12px;
  font-weight: 700;
}

.mobile-menu { display: none; }

.play-surface {
  padding: 0 0 64px;
  background: var(--mist);
  border-bottom: 1px solid var(--line);
}

.play-hero {
  position: relative;
  min-height: 270px;
  display: flex;
  align-items: end;
  overflow: hidden;
  background-color: var(--current);
  background-image: url('/assets/images/hero-aquarium.jpg');
  background-size: cover;
  background-position: center;
}

.play-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(4, 64, 99, 0.5);
}

.play-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 40px;
  padding: 42px 0 36px;
}

.play-heading > div:first-child { max-width: 720px; }
.play-heading h1 { margin-bottom: 12px; color: var(--white); font-size: 54px; }
.play-heading p { margin: 0; color: #f0fbff; font-size: 20px; line-height: 1.5; }

.play-game { padding-top: 26px; }

.play-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.game-toolbar,
.game-stage {
  width: min(100%, 540px);
  margin-inline: auto;
}

.game-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--deep);
  color: var(--white);
  font-size: 14px;
  line-height: 1.35;
}

.game-toolbar span:last-child {
  flex: 0 0 auto;
  color: var(--shell);
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.game-stage {
  aspect-ratio: 9 / 16;
  overflow: hidden;
  border: 6px solid var(--deep);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--deep);
  box-shadow: var(--shadow);
}

.game-stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--white);
}

.game-stage:fullscreen {
  width: 100vw;
  max-width: none;
  height: 100vh;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
}

.game-disclosure {
  max-width: 760px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}

.game-disclosure strong { color: var(--deep); }
.game-disclosure a { color: var(--coral-dark); font-weight: 700; }
.game-disclosure a:hover { color: var(--tidal); }

.hero {
  position: relative;
  min-height: 650px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-color: var(--current);
  background-image: url('/assets/images/hero-aquarium.jpg');
  background-size: cover;
  background-position: center;
  color: var(--white);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(4, 71, 112, 0.38);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(660px, 62%);
  padding: 72px 0 84px;
}

.eyebrow,
.article-eyebrow {
  display: inline-block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 18px;
  padding: 7px 10px;
  background: var(--shell);
  color: var(--deep);
  border-radius: 4px;
}

h1, h2, h3 {
  margin-top: 0;
  color: var(--deep);
  font-family: "Fredoka", Arial, sans-serif;
  letter-spacing: 0;
}

h1 { font-size: 60px; line-height: 1.02; margin-bottom: 20px; }
h2 { font-size: 36px; line-height: 1.12; margin-bottom: 12px; }
h3 { font-size: 22px; line-height: 1.2; margin-bottom: 8px; }

.hero h1 { color: var(--white); max-width: 640px; }
.hero-copy { max-width: 590px; font-size: 21px; line-height: 1.5; color: #f6fcff; }

.hero-search {
  display: flex;
  align-items: stretch;
  max-width: 520px;
  margin-top: 28px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 17px 18px;
  color: var(--ink);
}

.hero-search button {
  border: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--coral);
  color: var(--white);
  padding: 14px 22px;
  white-space: nowrap;
  font-weight: 700;
}

.hero-note { margin-top: 12px; color: #e5f8ff; font-size: 14px; }

.section { padding: 72px 0; }
.section-compact { padding: 46px 0; }
.section-mist { background: var(--mist); }
.section-deep { background: var(--deep); color: var(--white); }
.section-deep h2, .section-deep h3 { color: var(--white); }
.section-deep p { color: #dff5ff; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 30px;
}

.section-heading p { max-width: 620px; margin: 0; color: var(--muted); }
.section-heading a { color: var(--coral-dark); font-weight: 700; white-space: nowrap; }

.stat-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  padding: 24px;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: 0; }
.stat strong { display: block; color: var(--current); font-family: "Fredoka", Arial, sans-serif; font-size: 28px; }
.stat span { color: var(--muted); font-size: 15px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.card {
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--tidal);
  box-shadow: var(--shadow);
}

.card-body { padding: 20px; }
.card p { margin: 0; color: var(--muted); }
.card-kicker { display: block; margin-bottom: 8px; color: var(--kelp); font: 500 12px/1.4 "IBM Plex Mono", monospace; text-transform: uppercase; }
.card-link { display: inline-block; margin-top: 16px; color: var(--coral-dark); font-weight: 700; }

.level-card .thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--current);
}

.level-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.level-badge { position: absolute; left: 12px; bottom: 12px; padding: 5px 8px; background: var(--shell); color: var(--deep); border-radius: 4px; font: 500 12px/1.2 "IBM Plex Mono", monospace; }

.level-finder {
  position: relative;
  overflow: hidden;
  background: var(--current);
  color: var(--white);
}

.level-finder .section-heading p { color: #dff5ff; }
.level-finder h2 { color: var(--white); }

.range-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.range-link,
.level-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  min-height: 44px;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: var(--radius);
  color: var(--white);
  font-family: "IBM Plex Mono", monospace;
  font-size: 14px;
}

.range-link:hover,
.level-pill:hover { background: var(--shell); color: var(--deep); border-color: var(--shell); }

.wiki-row {
  display: grid;
  grid-template-columns: 1.1fr 1.9fr;
  gap: 54px;
  align-items: start;
}

.wiki-intro { position: sticky; top: 106px; }
.wiki-intro img { width: 180px; margin: 12px auto 0; }
.topic-list { border-top: 1px solid var(--line); }

.topic-link {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.topic-index { color: var(--coral-dark); font-family: "IBM Plex Mono", monospace; }
.topic-link strong { display: block; color: var(--deep); }
.topic-link span:not(.topic-index):not(.topic-arrow) { display: block; color: var(--muted); font-size: 15px; }
.topic-arrow { color: var(--coral-dark); font-size: 22px; }

.event-band {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 26px;
  background: var(--shell);
  color: var(--deep);
  border-radius: var(--radius);
}

.event-label { font: 500 13px/1.4 "IBM Plex Mono", monospace; text-transform: uppercase; }
.event-band h2 { margin: 0; }
.event-band p { margin: 4px 0 0; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 11px 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--coral);
  color: var(--white);
  font-weight: 700;
}
.button:hover { background: var(--coral-dark); }
.button-secondary { background: var(--white); color: var(--deep); border: 1px solid var(--line); }
.button-secondary:hover { background: var(--mist); }

.page-hero {
  position: relative;
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 82px 0 58px;
  background-color: var(--deep);
  background-image: url('/assets/images/hero-aquarium.jpg');
  background-position: center;
  background-size: cover;
  border-bottom: 1px solid var(--line);
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(4, 64, 99, 0.42);
}

.page-hero-grid {
  position: relative;
  z-index: 1;
}

.page-hero h1 { max-width: 820px; color: var(--white); font-size: 52px; }
.page-hero p { max-width: 760px; margin-bottom: 0; color: #f0fbff; font-size: 20px; }
.page-hero .article-eyebrow { color: var(--shell); }
.article-eyebrow { color: var(--coral-dark); margin-bottom: 12px; }

.breadcrumbs {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  font-size: 14px;
}
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li:not(:last-child)::after { content: '/'; margin-left: 8px; color: #8ab7c8; }
.breadcrumbs a:hover { color: var(--coral-dark); }

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) 280px;
  gap: 64px;
  align-items: start;
}

.article-copy > p:first-child { font-size: 21px; color: var(--current); }
.article-section { padding: 26px 0; border-bottom: 1px solid var(--line); }
.article-section:last-child { border-bottom: 0; }
.article-section p { margin: 0; }

.article-aside {
  position: sticky;
  top: 102px;
  border-left: 4px solid var(--coral);
  padding-left: 18px;
}
.article-aside h3 { font-size: 18px; }
.article-aside ul { margin: 0; padding-left: 18px; }
.article-aside li { margin-bottom: 8px; }
.article-aside a { color: var(--tidal); }

.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); padding: 15px 0; }
.faq-list summary { color: var(--deep); font-weight: 700; cursor: pointer; }
.faq-list p { margin: 10px 0 0; color: var(--muted); }

.video-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--deep);
  border-radius: var(--radius);
}
.video-shell img, .video-shell iframe { width: 100%; height: 100%; border: 0; object-fit: cover; }
.video-play {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(7, 83, 127, 0.34);
  color: var(--white);
  font-size: 18px;
  font-weight: 700;
}
.video-play span { display: inline-block; padding: 12px 18px; border-radius: var(--radius); background: var(--coral); }

.level-search {
  display: flex;
  max-width: 520px;
  margin: 24px 0;
}
.search-message { min-height: 26px; color: var(--coral-dark); font-weight: 700; }

.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
}

.library-toolbar .level-search { margin: 0; }

.source-link {
  color: var(--tidal);
  font-weight: 700;
}

.source-link:hover { color: var(--coral-dark); }

.level-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.level-pill { color: var(--deep); border-color: var(--line); background: var(--white); }

.library-latest { margin-top: 54px; }

.nearby-levels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 26px;
}

.nearby-level {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}

.nearby-level:hover { border-color: var(--tidal); }
.nearby-level span { display: block; color: var(--muted); font-size: 13px; }
.nearby-level strong { display: block; color: var(--deep); }

.download-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 42px;
  align-items: center;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.download-panel img { width: 210px; justify-self: center; }
.detail-table { width: 100%; border-collapse: collapse; margin: 24px 0; }
.detail-table th, .detail-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.detail-table th { width: 180px; color: var(--deep); }

.callout {
  margin: 26px 0;
  padding: 18px 20px;
  border-left: 4px solid var(--shell);
  background: #fff6c7;
}
.callout strong { color: var(--deep); }

.site-footer { padding: 52px 0 24px; background: var(--deep); color: #e2f5ff; }
.footer-grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 44px; }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.footer-brand img { width: 56px; height: 56px; object-fit: contain; }
.footer-brand strong { color: var(--white); font: 700 22px/1.1 "Fredoka", Arial, sans-serif; }
.footer-grid h3 { color: var(--white); font-size: 17px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: 7px 0; }
.footer-grid a:hover { color: var(--shell); }
.legal { margin-top: 38px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.22); color: #b8deed; font-size: 13px; }

.not-found { min-height: 62vh; display: grid; place-items: center; text-align: center; }
.not-found img { width: 190px; margin: 0 auto 12px; }

@media (max-width: 1020px) {
  .nav-links { display: none; }
  .menu-button { display: inline-flex; }
  .mobile-menu[data-open="true"] { display: block; padding: 12px 0 18px; border-top: 1px solid var(--line); }
  .mobile-menu a { display: block; padding: 9px 0; font-weight: 700; }
  .hero-content { width: 72%; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr) 240px; gap: 38px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .level-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  .container { width: min(100% - 28px, 1160px); }
  .site-header { min-height: 66px; }
  .nav-row { min-height: 66px; }
  .brand img { width: 42px; height: 42px; }
  .brand-copy small, .nav-search { display: none; }
  .play-surface { padding-bottom: 48px; }
  .play-hero { min-height: 270px; background-position: 60% center; }
  .play-hero::before { background: rgba(4, 64, 99, 0.62); }
  .play-heading { display: block; padding: 34px 0 28px; }
  .play-heading h1 { font-size: 40px; }
  .play-heading p { font-size: 18px; }
  .play-actions { margin-top: 20px; }
  .play-actions .button { flex: 1 1 0; }
  .play-game { padding-top: 18px; }
  .game-toolbar { align-items: flex-start; flex-direction: column; gap: 4px; }
  .game-disclosure { text-align: left; }
  .hero { min-height: 620px; background-position: 58% center; align-items: end; }
  .hero::before { background: rgba(4, 71, 112, 0.6); }
  .hero-content { width: 100%; padding: 86px 0 46px; }
  h1 { font-size: 42px; }
  h2 { font-size: 30px; }
  .hero-copy { font-size: 19px; }
  .hero-search { display: grid; grid-template-columns: 1fr; background: transparent; box-shadow: none; gap: 8px; }
  .hero-search input, .hero-search button { border-radius: var(--radius); }
  .section { padding: 54px 0; }
  .section-heading { display: block; }
  .section-heading a { display: inline-block; margin-top: 12px; }
  .stat-strip { grid-template-columns: 1fr; }
  .stat { border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
  .card-grid { grid-template-columns: 1fr; }
  .level-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .library-toolbar { align-items: stretch; flex-direction: column; }
  .library-toolbar .level-search { max-width: none; }
  .nearby-levels { grid-template-columns: 1fr; }
  .wiki-row, .page-hero-grid, .article-layout, .download-panel { grid-template-columns: 1fr; }
  .wiki-intro, .article-aside { position: static; }
  .wiki-intro img, .page-hero img { display: none; }
  .topic-link { grid-template-columns: 40px 1fr auto; }
  .event-band { grid-template-columns: 1fr; gap: 12px; }
  .page-hero { min-height: 340px; padding: 68px 0 38px; background-position: 60% center; }
  .page-hero::before { background: rgba(4, 64, 99, 0.56); }
  .page-hero h1 { font-size: 39px; }
  .article-aside { margin-top: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .download-panel { padding: 24px; }
  .detail-table th, .detail-table td { display: block; width: 100%; padding-left: 0; padding-right: 0; }
  .detail-table th { border-bottom: 0; padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
