@font-face {
  font-family: "Anybody";
  src: url("/assets/fonts/anybody-upright.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 50% 150%;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-next-var.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/fonts/atkinson-next-var-italic.woff2") format("woff2");
  font-weight: 200 800;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("/assets/fonts/courier-prime-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Courier Prime";
  src: url("/assets/fonts/courier-prime-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

@view-transition {
  navigation: auto;
}

:root {
  --display: "Anybody", "Arial Narrow", sans-serif;
  --body: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
  --type: "Courier Prime", "Courier New", monospace;

  --teal: #0e5e5a;
  --teal-deep: #08403d;
  --peach: #ffc9a8;
  --lemon: #ffe45c;
  --mint: #cff5e1;
  --forest: #0f3d2e;
  --orange: #ff6b2c;
  --soot: #1a0e08;
  --cream: #fff1e0;
  --plum: #2a0f2e;
  --plum-deep: #1a0820;
  --amber: #ffb347;
  --record: #e8413c;
  --manila: #f3d9a4;
  --oxblood: #7a1e1e;
  --grass: #1f7a3a;
  --grass-deep: #0f2a17;
  --ball: #d4f046;

  --ground: var(--teal);
  --ink: var(--peach);
  --text: #ffe9dc;
  --accent: var(--lemon);
  --accent-ink: var(--soot);
  --dock-bg: var(--teal-deep);
  --dock-ink: #f4efe8;
  --tab-on: var(--lemon);
  --tab-on-ink: var(--soot);
  --wdth: 70%;
  --wght: 760;

  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --measure: 62ch;
  --dock-h: 4.5rem;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

body[data-room="hello"] {
  --ground: var(--teal);
  --ink: var(--peach);
  --text: #ffe9dc;
  --accent: var(--lemon);
  --dock-bg: var(--teal-deep);
  --tab-on: var(--peach);
  --wdth: 68%;
  --wght: 780;
}
body[data-room="work"] {
  --ground: var(--mint);
  --ink: var(--forest);
  --text: #12392b;
  --accent: var(--orange);
  --accent-ink: var(--soot);
  --dock-bg: var(--forest);
  --tab-on: var(--orange);
  --wdth: 58%;
  --wght: 820;
}
body[data-room="things"] {
  --ground: var(--orange);
  --ink: var(--soot);
  --text: var(--soot);
  --accent: var(--soot);
  --accent-ink: var(--cream);
  --dock-bg: var(--soot);
  --tab-on: var(--cream);
  --wdth: 62%;
  --wght: 880;
}
body[data-room="listening"] {
  --ground: var(--plum);
  --ink: var(--amber);
  --text: #f6e3cf;
  --accent: var(--amber);
  --accent-ink: var(--plum-deep);
  --dock-bg: var(--plum-deep);
  --tab-on: var(--amber);
  --tab-on-ink: var(--plum-deep);
  --wdth: 54%;
  --wght: 720;
}
body[data-room="shelf"] {
  --ground: var(--manila);
  --ink: var(--oxblood);
  --text: #4a1410;
  --accent: var(--oxblood);
  --accent-ink: var(--manila);
  --dock-bg: #5a1414;
  --tab-on: var(--manila);
  --tab-on-ink: var(--oxblood);
  --wdth: 104%;
  --wght: 620;
}
body[data-room="dogs"] {
  --ground: var(--grass);
  --ink: var(--ball);
  --text: #f3fbe9;
  --accent: var(--ball);
  --accent-ink: var(--grass-deep);
  --dock-bg: var(--grass-deep);
  --tab-on: var(--ball);
  --tab-on-ink: var(--grass-deep);
  --wdth: 80%;
  --wght: 900;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  line-height: 1.55;
  padding-bottom: calc(var(--dock-h) + 3rem);
  overflow-x: clip;
}

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
[hidden] {
  display: none !important;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

p {
  margin: 0 0 1em;
  max-width: var(--measure);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-stretch: var(--wdth);
  font-weight: var(--wght);
  line-height: 0.92;
  color: var(--ink);
  letter-spacing: -0.01em;
}

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
}
.skip:focus {
  top: 1rem;
}

.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;
}

/* Page frame */

.topline {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter) 0;
  font-size: 0.95rem;
}
.home-link {
  font-family: var(--display);
  font-stretch: 72%;
  font-weight: 800;
  font-size: 1.15rem;
  text-decoration: none;
  color: var(--ink);
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: baseline;
  margin: 0;
  padding: 0;
  list-style: none;
}
.crumbs li + li::before {
  content: "/";
  margin-right: 0.5rem;
  opacity: 0.6;
}
.crumbs a {
  text-decoration: none;
}
.crumbs a:hover {
  text-decoration: underline;
}

.room {
  position: relative;
  padding: clamp(2.5rem, 7vh, 5rem) var(--gutter) 0;
}

.room-head {
  position: relative;
  z-index: 2;
  margin-bottom: clamp(2.5rem, 8vh, 5rem);
}
.room-title {
  font-size: clamp(3.5rem, 9vw, 8.5rem);
  view-transition-name: room-title;
}
.room-title .num {
  font-stretch: 60%;
  margin-right: 0.2em;
}
.room-sub {
  margin-top: 1.1rem;
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem);
  max-width: 48ch;
}

.label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.45;
  background: var(--ink);
  color: var(--ground);
}
.tag.is-hack {
  background: var(--orange);
  color: var(--soot);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.9rem;
  padding: 0.6rem 1.25rem;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s,
    color 0.2s,
    border-color 0.2s,
    transform 0.2s var(--ease-out);
}
.btn:hover {
  background: var(--ink);
  color: var(--ground);
}
.btn:active {
  transform: translateY(1px);
}
.btn.is-fill {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn.is-fill:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ground);
}
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.next-link {
  display: inline-flex;
  gap: 0.4rem;
  font-weight: 700;
  text-decoration: none;
}
.next-link:hover {
  text-decoration: underline;
}

/* Dock */

.dock {
  position: fixed;
  left: 50%;
  bottom: max(0.85rem, env(safe-area-inset-bottom));
  z-index: 50;
  display: flex;
  align-items: stretch;
  gap: 0.75rem;
  width: min(76rem, calc(100% - 1.5rem));
  min-height: var(--dock-h);
  padding: 0.5rem;
  transform: translateX(-50%);
  background: var(--dock-bg);
  color: var(--dock-ink);
  border-radius: 16px;
  box-shadow: 0 14px 30px -12px rgb(0 0 0 / 0.45);
  view-transition-name: dock;
  transition: transform 0.5s var(--ease-out);
}
.dock.is-tucked:not(:focus-within) {
  transform: translateX(-50%) translateY(calc(100% + 2rem));
}

.np {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 0 1 20rem;
  padding: 0.2rem 0.85rem 0.2rem 0.2rem;
  border-radius: 11px;
  text-decoration: none;
  color: inherit;
}
.np:hover {
  background: rgb(255 255 255 / 0.07);
}
.np-art {
  flex: none;
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 6px;
  object-fit: cover;
  background: rgb(255 255 255 / 0.12);
}
.np-text {
  display: grid;
  min-width: 0;
  gap: 0.05rem;
  flex: 1;
}
.np-title,
.np-artist {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.np-title {
  font-weight: 700;
  font-size: 0.95rem;
}
.np-artist {
  font-size: 0.82rem;
  opacity: 0.8;
}

.eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 1.1rem;
  flex: none;
}
.eq i {
  width: 3px;
  height: 30%;
  background: var(--lemon);
  border-radius: 1px;
  transform-origin: bottom;
}
.eq i:nth-child(2) {
  height: 55%;
  animation-delay: -0.3s;
}
.eq i:nth-child(3) {
  height: 40%;
  animation-delay: -0.6s;
}
.eq i:nth-child(4) {
  height: 70%;
  animation-delay: -0.15s;
}
.eq i:nth-child(5) {
  height: 35%;
  animation-delay: -0.45s;
}
.is-playing .eq i {
  animation-name: eq;
  animation-duration: 0.9s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}
@keyframes eq {
  from {
    transform: scaleY(0.35);
  }
  to {
    transform: scaleY(1.45);
  }
}

.rooms {
  display: flex;
  flex: 1;
  gap: 0.35rem;
  margin: 0;
  padding: 0 0 0 0.75rem;
  list-style: none;
  border-left: 1px solid rgb(255 255 255 / 0.14);
  justify-content: flex-end;
}
.rooms li {
  display: flex;
}
.tab {
  display: grid;
  align-content: center;
  gap: 0.05rem;
  padding: 0.35rem 0.9rem;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  line-height: 1.15;
  transition:
    background-color 0.2s,
    color 0.2s;
}
.tab-num {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.tab-name {
  font-size: 0.92rem;
  font-weight: 700;
  white-space: nowrap;
}
.tab:hover {
  background: rgb(255 255 255 / 0.1);
}
.tab[aria-current="page"],
.tab.is-here {
  background: var(--tab-on);
  color: var(--tab-on-ink);
}
.tab[aria-current="page"] .tab-num,
.tab.is-here .tab-num {
  opacity: 0.85;
}

.rooms-toggle {
  display: none;
}

@media (max-width: 1080px) {
  .tab-num {
    display: none;
  }
  .tab {
    padding: 0.35rem 0.65rem;
  }
  .tab-name {
    font-size: 0.86rem;
  }
}

@media (max-width: 820px) {
  :root {
    --dock-h: 4rem;
  }
  .dock {
    gap: 0.5rem;
  }
  .np {
    flex: 1 1 auto;
  }
  .rooms-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex: none;
    min-height: 3rem;
    padding: 0 1rem;
    border: 0;
    border-radius: 11px;
    background: var(--tab-on);
    color: var(--tab-on-ink);
    font-weight: 700;
    cursor: pointer;
  }
  .rooms {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 0.5rem);
    display: grid;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 0;
    border-radius: 16px;
    background: var(--dock-bg);
    box-shadow: 0 14px 30px -12px rgb(0 0 0 / 0.45);
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition:
      opacity 0.2s,
      transform 0.25s var(--ease-out),
      visibility 0.2s;
  }
  .dock.is-open .rooms {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .tab {
    grid-template-columns: 2.5rem 1fr;
    align-items: center;
    min-height: 3rem;
    padding: 0.4rem 0.9rem;
  }
  .tab-num {
    display: block;
  }
  .tab-name {
    font-size: 1rem;
  }
}

/* Drifting album covers */

.drifters {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow-x: clip;
  pointer-events: none;
}
.drifter {
  --x: 80%;
  --y: 20%;
  --r: 6deg;
  --s: 7rem;
  --depth: 1;
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--s);
  pointer-events: auto;
  transform: translate(
      calc(var(--px, 0) * 16px * var(--depth)),
      calc(var(--py, 0) * 12px * var(--depth))
    )
    rotate(var(--r));
  transition: transform 0.8s var(--ease-out);
}
.drifter img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 12px 24px -10px rgb(0 0 0 / 0.5);
  animation: drift 9s ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}
.drifter:hover img {
  animation-play-state: paused;
}
@keyframes drift {
  from {
    translate: 0 -6px;
    rotate: -1.5deg;
  }
  to {
    translate: 0 8px;
    rotate: 1.5deg;
  }
}
@media (max-width: 820px) {
  .drifter.is-wide-only {
    display: none;
  }
}

/* Room-flip transition */

::view-transition-old(root) {
  animation: 0.35s ease-in both flip-out;
}
::view-transition-new(root) {
  animation: 0.6s var(--ease-out) both flip-in;
}
@keyframes flip-out {
  to {
    opacity: 0.4;
    transform: translateY(-3%);
  }
}
@keyframes flip-in {
  from {
    clip-path: inset(100% 0 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
  .drifter {
    transform: rotate(var(--r));
  }
}
