:root {
  color-scheme: only light;
  --belly: #e5e6e6;
  --teal: #54899b;
  --teal-ink: #2d6476;
  --teal-pale: #93c6d6;
  --plum: #2f152f;
  --pink: #d45a89;
  --pink-pale: #f08fb4;
  --gold: #f1c75b;
  --twilight: #1c4150;
  --midnight: #1a2438;
  --abyss: #2f152f;
  --seabed: #170a18;
  --mono: ui-monospace, "JetBrains Mono", "DejaVu Sans Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--seabed); color: var(--belly); font: 16px/1.6 var(--mono); overflow-x: hidden; }
pre { margin: 0; font-family: var(--mono); }
h1, h2, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--pink-pale); }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { width: min(100% - 32px, 1000px); margin-inline: auto; }
.zone { padding-block: 64px; }
.depth { color: var(--teal-pale); font-size: 14px; margin-bottom: 4px; }
h2 { font-size: clamp(26px, 5vw, 36px); line-height: 1.2; font-weight: 700; margin-bottom: 28px; letter-spacing: -.02em; }
h2::before { content: "# "; color: var(--teal-pale); font-weight: 400; }
.sub { margin: -16px 0 32px; }

/* surface */
.surface { background: var(--belly); color: var(--plum); padding: 0; }
.surface a:hover { color: var(--pink); }
.nav { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 16px; padding-block: 16px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; }
.links a { text-decoration: none; padding: 8px 2px; }
.links a:hover { text-decoration: underline; }

.hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px; padding-block: 40px 24px; }
.wordmark { font-size: min(calc((100vw - 32px) / 30), 17px); line-height: 1.15; font-weight: 700; color: var(--plum); }
.lede { margin-block: 24px; font-size: 17px; max-width: 54ch; }
.cta { display: inline-block; padding: 12px 16px; background: var(--plum); color: var(--belly); font-weight: 700; text-decoration: none; }
.surface .cta:hover { background: var(--pink); color: var(--plum); }

.blob { --art: 13px; position: relative; display: flex; align-items: flex-end; min-height: calc(var(--art) * 24); padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; justify-self: center; }
.blob pre { font-size: var(--art); line-height: 1; font-weight: 700; white-space: pre; }
.blob-hint { position: absolute; top: 0; left: 0; font-size: 13px; color: var(--teal-ink); }
.blob-hint::after { content: " ->"; }
.g-t { color: var(--teal-ink); }
.g-w { color: #a9b6ba; }
.g-d { color: var(--plum); }
.g-m { color: #70757a; }
.g-p { color: #c23f73; }

.sea { color: var(--twilight); font-size: 16px; line-height: 1.1; overflow: hidden; white-space: pre; font-weight: 700; user-select: none; }
.sea .fin { color: var(--plum); }

/* dividers */
.wave, .sand { overflow: hidden; white-space: pre; line-height: 1; font-size: 16px; font-weight: 700; user-select: none; }
.wave { padding-top: 4px; }
.w-midnight { background: var(--twilight); color: var(--midnight); }
.w-abyss { background: var(--midnight); color: var(--abyss); }
.sand { color: #6d5a50; margin-top: -64px; margin-bottom: 40px; padding-top: 8px; background: var(--seabed); }

/* game */
.twilight { background: var(--twilight); padding-top: 40px; }
.field {
  display: block; width: 100%; padding: 0; background: var(--seabed); color: var(--belly);
  line-height: 1.2; white-space: pre; overflow: hidden; cursor: pointer; font-weight: 700;
  user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  min-height: 200px;
}
.field.playing { touch-action: none; }
.field.shake { transform: translate(3px, 1px); }
.c1 { color: var(--belly); }
.c2 { color: var(--teal); }
.c3 { color: var(--teal-pale); }
.c4 { color: var(--pink-pale); }
.c5 { color: var(--gold); }
.c6 { color: #4b5b6b; }
.c7 { color: #8a7566; }

.status { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; background: var(--seabed); border-top: 1px dashed var(--teal); }
.status img { background: var(--belly); border-radius: 8px; padding: 3px; flex: none; }
.status p { flex: 1 1 140px; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; }
.controls button { min-height: 40px; padding: 4px 10px; background: none; border: 1px solid var(--teal); color: var(--belly); font: 14px var(--mono); cursor: pointer; }
.controls button:hover { background: var(--teal); color: var(--seabed); }

.legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 8px 32px; margin-top: 28px; font-size: 15px; }
.legend div { display: flex; gap: 12px; }
.legend dt { flex: 0 0 5ch; font-weight: 700; }
.k-fish { color: var(--teal-pale); }
.k-gold { color: var(--gold); }
.k-bad { color: var(--pink-pale); }

/* notes */
.midnight { background: var(--midnight); }
.notes { counter-reset: n; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 28px 48px; }
.notes li { counter-increment: n; padding-left: 5ch; position: relative; }
.notes li::before { content: "0" counter(n) "."; position: absolute; left: 0; color: var(--teal-pale); }
.notes b { display: block; color: var(--gold); }

/* moods */
.abyss { background: var(--abyss); }
.moods { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 32px 16px; }
.moods li { display: flex; flex-direction: column; align-items: flex-start; }
.moods img { width: 96px; height: 96px; margin-bottom: 8px; transition: transform .15s; }
.moods li:hover img { transform: translateY(-4px) rotate(-5deg); }
.moods span { font-size: 14px; color: #d9c8d6; }

/* seabed */
.seabed { background: var(--seabed); }
.credits { font-size: 14px; color: #d4c8cc; }
.credits p + p { margin-top: 12px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
  .blob { order: -1; }
  .blob { --art: min(calc((100vw - 32px) / 26.4), 13px); }
  .zone { padding-block: 48px; }
  .twilight { padding-top: 32px; }
  .sand { margin-top: -48px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .moods img { transition: none; }
}
