@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(assets/fonts/lexend-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(assets/fonts/lexend-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: dark;
  font-synthesis: none;
  --water: #070a0f; /* same colour as the fog in fish.js, so the fish fade into it */
  --surface: #0f141b;
  --border: #4d5b68;
  --accent: #ff9a5c; /* koi orange */
  --text: #dde3e8;
  --muted: #ffffff73;
  /* square corners with a 2px step cut out, like an old ui */
  --pixel-corners: polygon(4px 0, calc(100% - 4px) 0, calc(100% - 4px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 2px) calc(100% - 4px), calc(100% - 2px) calc(100% - 2px), calc(100% - 4px) calc(100% - 2px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 4px), 0 calc(100% - 4px), 0 4px, 2px 4px, 2px 2px, 4px 2px);
  /* bigger steps for the profile picture, almost a circle */
  --pixel-round: polygon(12px 0, calc(100% - 12px) 0, calc(100% - 12px) 4px, calc(100% - 6px) 4px, calc(100% - 6px) 6px, calc(100% - 4px) 6px, calc(100% - 4px) 12px, 100% 12px, 100% calc(100% - 12px), calc(100% - 4px) calc(100% - 12px), calc(100% - 4px) calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) calc(100% - 4px), calc(100% - 12px) calc(100% - 4px), calc(100% - 12px) 100%, 12px 100%, 12px calc(100% - 4px), 6px calc(100% - 4px), 6px calc(100% - 6px), 4px calc(100% - 6px), 4px calc(100% - 12px), 0 calc(100% - 12px), 0 12px, 4px 12px, 4px 6px, 6px 6px, 6px 4px, 12px 4px);
  --pixel-border: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234d5b68' d='M4 0h4v2H4zM4 10h4v2H4zM0 4h2v4H0zM10 4h2v4h-2zM2 2h2v2H2zM8 2h2v2H8zM2 8h2v2H2zM8 8h2v2H8z'/%3E%3C/svg%3E") 4 / 4px / 0 stretch;
  font-family: "Lexend", system-ui, sans-serif;
}

html {
  min-width: 280px;
  background: var(--water);
}

body {
  min-height: 100svh;
  background: var(--water);
  color: var(--text);
  font-weight: 400;
  text-transform: lowercase;
}

h1 {
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}

h2 {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.2;
}

p,
li {
  font-size: 13px;
  line-height: 1.35;
}

a {
  color: inherit;
}

::selection {
  background: var(--accent);
  color: #000;
}

::-webkit-scrollbar {
  width: 3px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
}

:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.muted {
  color: var(--muted);
}

/* ---------- the fish ---------- */

#water {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
  image-rendering: pixelated; /* drawn small and scaled up, so the 3d fish look pixel-art */
}

/* ---------- the card ---------- */

.page-shell {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: 64px 16px 5vh;
}

.card-frame {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
}

.card {
  position: relative;
  max-height: calc(100svh - 96px);
  overflow-y: auto;
  padding: 20px 15px 15px;
  border: 4px solid transparent;
  border-image: var(--pixel-border);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(2px);
  clip-path: var(--pixel-corners);
}

.view {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* tabs sitting on the top edge of the card */
.tabs {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 2;
  display: flex;
  gap: 4px;
  transform: translate(-50%, -50%);
}

.tabs a {
  min-width: 68px;
  padding: 3px 8px;
  border: 4px solid transparent;
  border-image: var(--pixel-border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  text-decoration: none;
  clip-path: var(--pixel-corners);
}

.tabs a:hover,
.tabs a:focus-visible,
.tabs a[aria-current="page"] {
  background: var(--accent);
  color: var(--water);
  outline: none;
}

.tabs a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- profile ---------- */

.profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  position: relative;
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
}

.avatar::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--border);
  clip-path: var(--pixel-round);
}

.avatar img:first-child {
  position: relative;
  top: 2px;
  left: 2px;
  display: block;
  width: 72px;
  height: 72px;
  background: #1a2129;
  object-fit: cover;
  clip-path: var(--pixel-round);
}

.oneko {
  position: absolute;
  bottom: -4px;
  left: -8px;
  image-rendering: pixelated;
}

.intro {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.intro h1 span {
  color: var(--accent);
}

/* ---------- panels ---------- */

.panel {
  padding: 7px 10px 10px;
  border: 4px solid transparent;
  border-image: var(--pixel-border);
}

.panel-heading {
  margin-bottom: 6px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  list-style: none;
}

.list li {
  position: relative;
  padding-left: 12px;
}

.list li::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 1px;
  width: 4px;
  height: 4px;
  background: var(--accent);
}

.list a {
  text-decoration: none;
  border-bottom: 1px dashed var(--muted);
}

.list a:hover,
.list a:focus-visible {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ---------- music ---------- */

.music .panel-heading {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.music-status {
  overflow: hidden;
  min-width: 0;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equalizer {
  display: flex;
  flex: 0 0 10px;
  align-items: end;
  gap: 2px;
  height: 10px;
}

.equalizer i {
  width: 2px;
  height: 3px;
  background: var(--muted);
}

.music[data-playing="true"] .equalizer i {
  background: var(--accent);
  animation: equalizer 0.6s steps(3, end) infinite alternate;
}

.music[data-playing="true"] .equalizer i:nth-child(2) {
  animation-delay: -0.4s;
}

.music[data-playing="true"] .equalizer i:nth-child(3) {
  animation-delay: -0.2s;
}

@keyframes equalizer {
  from {
    height: 2px;
  }
  to {
    height: 9px;
  }
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
}

.music-art {
  display: grid;
  flex: 0 0 48px;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 4px solid transparent;
  border-image: var(--pixel-border);
  background: var(--water);
  color: var(--muted);
  clip-path: var(--pixel-corners);
}

.music[data-playing="true"] .music-art {
  color: var(--accent);
}

.music-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.music-title,
.music-artist {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-title {
  font-size: 14px;
}

.music-artist {
  font-size: 11px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}

.ctrl {
  min-width: 36px;
  padding: 2px 6px;
  border: 4px solid transparent;
  border-image: var(--pixel-border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-transform: inherit;
  cursor: pointer;
  clip-path: var(--pixel-corners);
}

.ctrl-play {
  min-width: 56px;
}

.ctrl:hover,
.ctrl:focus-visible {
  background: var(--accent);
  color: var(--water);
  outline: none;
}

.time {
  margin-left: auto;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* a chunky pixel seek bar */
.seek {
  --fill: 0%;
  width: 100%;
  height: 8px;
  margin-top: 8px;
  background: linear-gradient(to right, var(--accent) var(--fill), var(--water) var(--fill));
  border: 2px solid var(--border);
  appearance: none;
  cursor: pointer;
}

.seek::-webkit-slider-thumb {
  width: 6px;
  height: 10px;
  background: var(--text);
  border: 0;
  border-radius: 0;
  appearance: none;
}

.seek::-moz-range-thumb {
  width: 6px;
  height: 10px;
  background: var(--text);
  border: 0;
  border-radius: 0;
}

.tracks {
  display: flex;
  flex-direction: column;
  max-height: 168px;
  margin-top: 10px;
  overflow-y: auto;
  list-style: none;
}

.track {
  display: flex;
  gap: 8px;
  width: 100%;
  padding: 3px 4px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  text-align: left;
  text-transform: inherit;
  cursor: pointer;
}

.track span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-num {
  flex: 0 0 auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.track:hover,
.track:focus-visible {
  background: #ffffff12;
  outline: none;
}

.track[aria-current="true"] {
  color: var(--accent);
}

/* ---------- 88x31 buttons ---------- */

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
}

.buttons a,
.buttons > img {
  display: block;
  width: 100%;
  aspect-ratio: 88 / 31;
  transition: transform 80ms step-end;
}

.buttons img {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.buttons a:hover,
.buttons a:focus-visible,
.buttons > img:hover {
  outline: 1px solid var(--accent);
  transform: translateY(-1px);
}

/* ---------- screen sizes ---------- */

@media (width <= 380px) {
  .page-shell {
    padding-inline: 10px;
  }

  .card {
    padding: 18px 11px 11px;
  }

  .profile {
    gap: 12px;
  }

  h1 {
    font-size: 21px;
  }

  .buttons {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (width >= 1200px) and (height >= 760px) {
  .card-frame {
    transform: scale(1.1);
  }
}

@media (width >= 1400px) and (height >= 860px) {
  .card-frame {
    transform: scale(1.2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .music[data-playing="true"] .equalizer i {
    animation: none;
  }

  .buttons a,
  .buttons > img {
    transition: none;
  }
}
