/* Home page lab (lab.html + lab.js). Every look fills the screen; only Depth (and any look that opts in) scrolls. */
:root {
  --vh: calc(100vh / var(--zoom));
  --vw: calc(100vw / var(--zoom));
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}
html:has(body.lab) {
  overflow: hidden;
  scrollbar-gutter: auto;
}
html:has(body[data-look="depth"]) {
  overflow: auto;
}
body.lab {
  min-height: var(--vh);
  overflow: hidden;
}
body[data-look="depth"] {
  overflow: visible;
}
.lab-stage {
  position: fixed;
  inset: 0;
  width: var(--vw);
  height: var(--vh);
  overflow: hidden;
}
body[data-look="depth"] .lab-stage {
  position: static;
  height: auto;
  overflow: visible;
}

/* Shared bits */
.lab a {
  color: inherit;
}
.lab-kicker {
  margin: 0;
  font: 500 11px/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-nav);
}
.lab-name {
  margin: 0.1em 0 0.25em;
  font: 400 clamp(44px, 6.2vw, 92px) / 0.95 var(--font-reading);
  letter-spacing: -0.03em;
  color: var(--text-heading);
}
.lab-bio {
  margin: 0 0 0.7em;
  font-size: 17px;
  line-height: 1.55;
  max-width: 46ch;
  text-wrap: pretty;
}
.lab-bio.is-dim {
  color: var(--text-secondary);
}
.lab-socials {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.lab-socials a {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--line-subtle);
  border-radius: 99px;
  font: 500 12px/1.6 var(--font-ui);
  text-decoration: none;
  color: var(--text-secondary);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.lab-socials a:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.lab-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.lab-lists h2 {
  margin: 0 0 6px;
  font: 500 11px/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-nav);
}
.lab-lists ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 15px;
  line-height: 1.7;
}
.lab-lists a {
  text-decoration: none;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 1px no-repeat;
  transition: background-size 0.3s var(--ease), color 0.2s;
}
.lab-lists a:hover {
  color: var(--accent);
  background-size: 100% 1px;
}
.lab-hint {
  position: absolute;
  left: 24px;
  bottom: 20px;
  margin: 0;
  font: 12px/1.4 var(--font-mono);
  color: var(--text-nav);
  pointer-events: none;
}
.lab-hint button {
  pointer-events: auto;
  font: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}
.lab-hint.is-inline {
  position: static;
  margin-top: 22px;
}
.tile-cap {
  margin: 0;
  font: 11px/1.4 var(--font-mono);
  color: var(--text-nav);
}
.lab .work-row:hover .work-name {
  transform: none;
}

/* Mascot with its speech bubble */
.lab-mascot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.lab-bubble {
  margin: 0;
  min-height: 2.2em;
  max-width: 220px;
  padding: 6px 12px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line-subtle);
  font: 13px/1.4 var(--font-ui);
  color: var(--text-copy);
  text-align: center;
}
.lab-bubble span:empty::before {
  content: "…";
}
.lab-creature {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  animation: lab-float 3.6s ease-in-out infinite;
}
.lab-creature img {
  display: block;
  width: 84px;
  height: auto;
}
@keyframes lab-float {
  50% {
    translate: 0 -6px;
  }
}

/* Layout switcher */
.lab-switch {
  position: fixed;
  left: 50%;
  bottom: 14px;
  translate: -50% 0;
  z-index: 300;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 99px;
  border: 1px solid var(--line-subtle);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 8px 30px rgb(0 0 0 / 0.12);
}
.lab-switch button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 0;
  border-radius: 99px;
  background: none;
  color: var(--text-nav);
  font: 500 12.5px/1 var(--font-ui);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.lab-switch button:hover {
  color: var(--text-heading);
}
.lab-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}
.lab-switch kbd {
  font: 10px/1 var(--font-mono);
  opacity: 0.6;
}
.packing-host,
.packing-host canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.packing-stat {
  display: none;
}

/* 1. Bento */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(6, minmax(0, 1fr));
  grid-template-areas:
    "h h h h a a a a p p p p"
    "h h h h a a a a p p p p"
    "h h h h a a a a p p p p"
    "h h h h i i o o r r g g"
    "m m l l i i o o r r g g"
    "m m l l s s z z t t f f";
  gap: 12px;
  height: 100%;
  padding: 16px 16px 70px;
}
.tile {
  position: relative;
  overflow: hidden;
  min-height: 0;
  border-radius: 18px;
  border: 1px solid var(--line-subtle);
  background: var(--surface-subtle);
  text-decoration: none;
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.45s var(--ease), border-color 0.3s, box-shadow 0.3s;
  animation: tile-in 0.7s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes tile-in {
  from {
    opacity: 0;
    transform: perspective(900px) translateY(18px) scale(0.97);
  }
}
.tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s;
}
.tile:hover::after {
  opacity: 1;
}
a.tile:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 18px 40px -18px rgb(0 0 0 / 0.35);
}
.tile-hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 26px 28px;
  background: var(--bg);
}
.tile-hero .lab-name {
  font-size: clamp(52px, 6vw, 96px);
}
.tile-hero .lab-bio {
  font-size: 16px;
}
.tile-shot img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.7s var(--ease), filter 0.4s;
}
a.tile-shot:hover img {
  transform: scale(1.05);
}
.tile-shot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(transparent 35%, rgb(10 10 12 / 0.78));
  transition: opacity 0.3s;
}
.tile-label {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: #fff;
  font-size: 18px;
  line-height: 1.2;
  transition: translate 0.35s var(--ease);
}
.tile-role {
  font: 11px/1.3 var(--font-mono);
  opacity: 0.75;
  white-space: nowrap;
}
.tile-sum {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 2;
  color: rgb(255 255 255 / 0.85);
  font: 12.5px/1.4 var(--font-ui);
  opacity: 0;
  translate: 0 8px;
  transition: opacity 0.3s, translate 0.35s var(--ease);
}
a.tile-shot:hover .tile-label {
  translate: 0 calc(-1 * var(--lift, 3.2em));
}
a.tile-shot:hover .tile-sum {
  opacity: 1;
  translate: 0 0;
}
.tile-pack {
  display: flex;
  flex-direction: column;
  padding: 10px;
  gap: 8px;
}
.tile-pack-slot {
  flex: 1;
  min-height: 0;
  border-radius: 10px;
  overflow: hidden;
}
.tile-mascot {
  display: grid;
  place-items: center;
}
.tile-mascot .lab-bubble {
  font-size: 12px;
  max-width: 180px;
}
.tile-lists {
  padding: 16px 18px;
  background: var(--bg);
}
.tile-lists .lab-lists {
  grid-template-columns: 1fr;
  gap: 10px;
}
.tile-lists ul {
  font-size: 14px;
  line-height: 1.55;
}

/* 2. Explorer */
.ide {
  display: grid;
  grid-template-columns: 250px 1fr;
  grid-template-rows: 38px 1fr 26px;
  height: calc(100% - 70px);
  margin: 14px 14px 0;
  border: 1px solid var(--line-subtle);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  box-shadow: 0 30px 80px -40px rgb(0 0 0 / 0.45);
  font: 13px/1.6 var(--font-mono);
  animation: tile-in 0.6s var(--ease) both;
}
.ide-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line-subtle);
  background: var(--surface-subtle);
}
.ide-dots {
  display: flex;
  gap: 7px;
}
.ide-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
}
.ide-dots i:nth-child(2) {
  background: #febc2e;
}
.ide-dots i:nth-child(3) {
  background: #28c840;
}
.ide-title {
  flex: 1;
  text-align: center;
  margin-right: 50px;
  font: 12px var(--font-ui);
  color: var(--text-nav);
}
.ide-head {
  margin: 0;
  padding: 8px 14px 4px;
  font: 600 10.5px/1.4 var(--font-ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-nav);
}
.ide-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line-subtle);
  background: var(--surface-subtle);
}
.ide-tree {
  flex: 1;
  overflow: auto;
  padding: 0 6px;
}
.ide-tree details details {
  margin-left: 12px;
}
.ide-tree summary {
  padding: 1px 8px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--text-heading);
  list-style: none;
}
.ide-tree summary::before {
  content: "▸ ";
  display: inline-block;
  width: 1.2em;
  color: var(--text-nav);
  transition: rotate 0.2s;
}
.ide-tree details[open] > summary::before {
  content: "▾ ";
}
.ide-tree summary:hover,
.ide-file:hover {
  background: color-mix(in srgb, var(--text-copy) 7%, transparent);
}
.ide-file {
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 12px);
  margin-left: 12px;
  padding: 1px 8px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--text-copy);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ide-file.is-on {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text-heading);
}
.ide-ic {
  font-size: 9px;
  font-weight: 700;
  color: var(--accent);
  width: 18px;
}
.ide-ic.is-json {
  color: #c99a2e;
}
.ide-mini {
  border-top: 1px solid var(--line-subtle);
}
.ide-mini-slot {
  height: 150px;
  margin: 0 10px 10px;
  border-radius: 8px;
  overflow: hidden;
}
.ide-main {
  display: grid;
  grid-template-rows: 36px 1fr 190px;
  min-width: 0;
  min-height: 0;
}
.ide-tabs {
  display: flex;
  overflow: hidden;
  border-bottom: 1px solid var(--line-subtle);
  background: var(--surface-subtle);
}
.ide-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 16px;
  border: 0;
  border-right: 1px solid var(--line-subtle);
  background: none;
  color: var(--text-nav);
  font: inherit;
  cursor: pointer;
}
.ide-tab.is-on {
  background: var(--bg);
  color: var(--text-heading);
  box-shadow: inset 0 2px var(--accent);
}
.ide-x {
  opacity: 0.4;
  padding: 0 3px;
  border-radius: 3px;
}
.ide-x:hover {
  opacity: 1;
  background: color-mix(in srgb, var(--text-copy) 12%, transparent);
}
.ide-split {
  display: flex;
  min-height: 0;
}
.ide-code {
  flex: 1;
  overflow: auto;
  padding: 14px 0;
}
.ide-ln {
  display: grid;
  grid-template-columns: 52px 1fr;
  padding-right: 24px;
}
.ide-ln:hover {
  background: color-mix(in srgb, var(--text-copy) 4%, transparent);
}
.ide-num {
  padding-right: 18px;
  text-align: right;
  color: var(--text-nav);
  opacity: 0.55;
  user-select: none;
}
.ide-ln > span:last-child {
  white-space: pre-wrap;
  max-width: 72ch;
}
.ide-code a {
  color: var(--accent);
  text-decoration: none;
}
.ide-code a:hover {
  text-decoration: underline;
}
.t-h {
  color: var(--accent);
  font-weight: 700;
}
.t-k {
  font-style: normal;
  color: #c4613a;
}
html[data-theme="dark"] .t-k {
  color: #e89a6c;
}
.t-c {
  color: var(--text-nav);
}
.t-p {
  color: var(--accent);
  margin-right: 8px;
}
.ide-open {
  font-weight: 600;
}
.ide-preview {
  width: min(42%, 520px);
  padding: 18px;
  border-left: 1px solid var(--line-subtle);
  overflow: hidden;
}
.ide-preview img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line-subtle);
  box-shadow: 0 20px 50px -30px rgb(0 0 0 / 0.5);
  animation: tile-in 0.5s var(--ease) both;
}
.ide-preview img.is-creature {
  width: 55%;
  margin: 30px auto 0;
  display: block;
  border: 0;
  box-shadow: none;
  animation: lab-float 3.6s ease-in-out infinite;
}
.ide-preview p {
  font: 15px/1.5 var(--font-reading);
  color: var(--text-secondary);
  text-align: center;
}
.ide-term {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-top: 1px solid var(--line-subtle);
}
.term-out {
  flex: 1;
  overflow: auto;
  padding: 0 14px;
  color: var(--text-secondary);
}
.term-line {
  display: flex;
  align-items: center;
  padding: 2px 14px 10px;
}
.term-in {
  flex: 1;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text-heading);
  font: inherit;
  caret-color: var(--accent);
}
.ide-status {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11.5px;
}
.ide-pos {
  opacity: 0.8;
}
.lab-mascot.is-inline {
  flex-direction: row-reverse;
  margin-left: auto;
  gap: 8px;
}
.lab-mascot.is-inline .lab-bubble {
  min-height: 0;
  max-width: none;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
}
.lab-mascot.is-inline img {
  width: 20px;
}

/* 3. Orbit */
.orbit {
  position: relative;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background: radial-gradient(ellipse at 50% 50%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 62%);
}
.orbit.is-dragging {
  cursor: grabbing;
}
.orbit-rings {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.orbit-rings ellipse {
  fill: none;
  stroke: var(--line-subtle);
  stroke-width: 1;
  stroke-dasharray: 2 6;
}
.orbit-core {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -52%;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
}
.orbit-core > * {
  pointer-events: auto;
}
.orbit-sun {
  position: absolute;
  left: 50%;
  top: 38%;
  width: 300px;
  height: 300px;
  translate: -50% -50%;
  z-index: -1;
  border-radius: 50%;
  overflow: hidden;
  opacity: 0.5;
  mask: radial-gradient(circle, #000 55%, transparent 71%);
  pointer-events: none;
}
.orbit-core .lab-name {
  font-size: clamp(44px, 5vw, 76px);
  margin-top: 6px;
}
.orbit-socials {
  position: absolute;
  left: 24px;
  top: 22px;
  z-index: 260;
}
.orbit-line {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--text-secondary);
}
.node {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  will-change: transform;
  transition: opacity 0.2s;
}
.node-dot {
  display: block;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--line-subtle), 0 12px 30px -12px rgb(0 0 0 / 0.5);
  background: var(--surface-subtle);
  transition: box-shadow 0.3s;
}
.node-dot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.node:hover .node-dot {
  box-shadow: 0 0 0 2px var(--accent), 0 0 34px color-mix(in srgb, var(--accent) 50%, transparent);
}
.node-text {
  font-size: 15px;
  white-space: nowrap;
  color: var(--text-heading);
  padding: 0 8px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}
.node.is-small .node-dot {
  width: 12px;
  height: 12px;
  border: 0;
  background: var(--accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 60%, transparent);
}
.node.is-small .node-text {
  font: 12px var(--font-ui);
  color: var(--text-secondary);
}
.orbit-card {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 250;
  width: 260px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--line-subtle);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  box-shadow: 0 24px 60px -24px rgb(0 0 0 / 0.5);
  opacity: 0;
  scale: 0.94;
  pointer-events: none;
  transition: opacity 0.2s, scale 0.3s var(--spring);
}
.orbit-card.is-shown {
  opacity: 1;
  scale: 1;
}
.orbit-card img {
  display: none;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;
}
.orbit-card.has-img img {
  display: block;
}
.orbit-card-role {
  margin: 8px 2px 2px;
  font: 11px var(--font-mono);
  color: var(--accent);
}
.orbit-card-sum {
  margin: 0 2px;
  font: 13.5px/1.45 var(--font-ui);
}

/* 4. Desk */
.desk {
  --u: min(calc(var(--vw) / 1440), calc(var(--vh) / 860));
  position: relative;
  height: 100%;
  overflow: hidden;
  user-select: none;
  background:
    radial-gradient(ellipse at 50% 40%, transparent 50%, color-mix(in srgb, var(--text-copy) 6%, transparent)),
    linear-gradient(color-mix(in srgb, var(--text-copy) 5%, transparent) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, color-mix(in srgb, var(--text-copy) 5%, transparent) 1px, transparent 1px) 0 0 / 28px 28px;
}
.card {
  position: absolute;
  rotate: calc(var(--rot, 0deg) + var(--swing, 0deg));
  cursor: grab;
  text-decoration: none;
  -webkit-user-drag: none;
  touch-action: none;
  transition: rotate 0.35s var(--spring), scale 0.25s var(--spring), box-shadow 0.25s;
  box-shadow: 0 2px 3px rgb(0 0 0 / 0.08), 0 14px 30px -16px rgb(0 0 0 / 0.35);
  animation: card-drop 0.7s var(--spring) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}
@keyframes card-drop {
  from {
    opacity: 0;
    scale: 1.25;
    translate: 0 -30px;
  }
}
.desk.is-tidying .card {
  transition: left 0.6s var(--ease), top 0.6s var(--ease), rotate 0.6s var(--ease);
}
.card:hover {
  scale: 1.02;
}
.card.is-held {
  cursor: grabbing;
  scale: 1.06;
  transition: rotate 0.12s, scale 0.2s var(--spring);
  box-shadow: 0 4px 8px rgb(0 0 0 / 0.1), 0 40px 60px -20px rgb(0 0 0 / 0.45);
}
.card-index {
  width: calc(380 * var(--u));
  padding: calc(26 * var(--u)) calc(28 * var(--u));
  background: var(--bg);
  border-radius: 4px;
  background-image: repeating-linear-gradient(transparent 0 calc(27 * var(--u)), color-mix(in srgb, #4a8fe0 14%, transparent) 0 calc(28 * var(--u)));
  background-position: 0 calc(70 * var(--u));
}
.card-index .lab-name {
  font-size: calc(64 * var(--u));
}
.card-index .lab-bio {
  font-size: calc(15.5 * var(--u));
}
.card-pol {
  width: calc(196 * var(--u));
  padding: calc(10 * var(--u)) calc(10 * var(--u)) 0;
  background: #fbfaf7;
  color: #282828;
  border-radius: 2px;
}
html[data-theme="dark"] .card-pol {
  background: #2c2a28;
  color: #f4f1eb;
}
.pol-img {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: #ddd;
}
.pol-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  pointer-events: none;
}
.pol-cap {
  display: flex;
  flex-direction: column;
  padding: calc(8 * var(--u)) 2px calc(12 * var(--u));
  font-size: calc(17 * var(--u));
  line-height: 1.2;
}
.pol-cap span:last-child {
  font: calc(10.5 * var(--u)) / 1.5 var(--font-mono);
  opacity: 0.6;
}
.card-pack {
  width: calc(310 * var(--u));
  padding: calc(10 * var(--u));
  background: var(--bg);
  border-radius: 6px;
}
.card-pack-slot {
  height: calc(210 * var(--u));
  margin-bottom: 8px;
  border-radius: 4px;
  overflow: hidden;
}
.tape {
  position: absolute;
  top: -12px;
  left: 50%;
  translate: -50% 0;
  rotate: -3deg;
  width: 90px;
  height: 24px;
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  backdrop-filter: blur(2px);
}
.card-sticky {
  width: calc(270 * var(--u));
  padding: calc(18 * var(--u));
  background: #fde99a;
  color: #3a3220;
  border-radius: 2px;
}
.card-sticky .lab-lists {
  grid-template-columns: 1fr;
  gap: 8px;
}
.card-sticky h2 {
  color: #7a6a3a;
}
.card-sticky ul {
  font-size: calc(15 * var(--u));
  line-height: 1.5;
}
.card-mascot {
  box-shadow: none;
}
.card-mascot .lab-creature {
  pointer-events: none;
}

/* 5. Reel */
.reel {
  position: relative;
  height: 100%;
  overflow: hidden;
  touch-action: pan-y;
}
.reel-track {
  display: flex;
  height: 100%;
  translate: calc(var(--i, 0) * -100%) 0;
  transition: translate 0.85s cubic-bezier(0.7, 0, 0.2, 1);
}
.reel-track.is-instant {
  transition: none;
}
.slide {
  position: relative;
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 5vw;
  padding: 6vh 6vw 12vh;
  overflow: hidden;
}
.slide-copy {
  position: relative;
  z-index: 2;
  translate: calc(var(--px, 0) * -14px) calc(var(--py, 0) * -10px);
}
.slide-copy > * {
  opacity: 0;
  translate: 0 24px;
  transition: opacity 0.5s, translate 0.7s var(--ease);
}
.slide.is-on .slide-copy > * {
  opacity: 1;
  translate: none;
}
.slide.is-on .slide-copy > :nth-child(2) { transition-delay: 0.08s; }
.slide.is-on .slide-copy > :nth-child(3) { transition-delay: 0.16s; }
.slide.is-on .slide-copy > :nth-child(4) { transition-delay: 0.24s; }
.slide.is-on .slide-copy > :nth-child(5) { transition-delay: 0.32s; }
.slide.is-on .slide-copy > :nth-child(n + 6) { transition-delay: 0.4s; }
.slide-count {
  margin: 0 0 18px;
  font: 12px var(--font-mono);
  color: var(--accent);
}
.slide-name {
  display: block;
  margin: 0.05em 0 0.15em;
  font: 400 clamp(56px, 8vw, 132px) / 0.95 var(--font-reading);
  letter-spacing: -0.035em;
  color: var(--text-heading);
  text-decoration: none;
}
.slide-role {
  margin: 0 0 14px;
  font: 13px var(--font-mono);
  color: var(--text-nav);
}
.slide-sum {
  margin: 0 0 22px;
  font-size: 20px;
  line-height: 1.5;
  max-width: 30ch;
}
.slide-open {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink) !important;
  font: 500 14px var(--font-ui);
  text-decoration: none;
  transition: scale 0.25s var(--spring);
}
.slide-open:hover {
  scale: 1.05;
}
.slide-shot {
  position: relative;
  z-index: 1;
  display: block;
  aspect-ratio: 16 / 10.5;
  max-height: 68vh;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  box-shadow: 0 50px 100px -40px rgb(0 0 0 / 0.55);
  transform: perspective(1200px) rotateY(calc(var(--px, 0) * -10deg)) rotateX(calc(var(--py, 0) * 8deg)) scale(0.9);
  opacity: 0;
  transition: transform 0.9s var(--ease), opacity 0.6s;
}
.slide.is-on .slide-shot {
  opacity: 1;
  transform: perspective(1200px) rotateY(calc(var(--px, 0) * -10deg)) rotateX(calc(var(--py, 0) * 8deg));
  transition: transform 0.25s ease-out, opacity 0.6s 0.15s;
}
.slide-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  pointer-events: none;
}
.slide-shot.is-pack {
  background: var(--surface-subtle);
}
.slide-shot.is-pack > div {
  height: 100%;
}
.slide-ghost {
  position: absolute;
  right: -2vw;
  bottom: -6vh;
  z-index: 0;
  font: 400 26vw/0.8 var(--font-reading);
  letter-spacing: -0.05em;
  white-space: nowrap;
  color: color-mix(in srgb, var(--text-copy) 4%, transparent);
  pointer-events: none;
  translate: calc(var(--px, 0) * 40px) 0;
}
.slide-outro {
  grid-template-columns: 1fr auto;
}
.slide-outro .lab-lists {
  margin-bottom: 22px;
  font-size: 18px;
}
.slide-outro .lab-lists ul {
  font-size: 18px;
}
.slide-outro .lab-creature img {
  width: 160px;
}
.reel-ticks {
  position: absolute;
  left: 6vw;
  bottom: 72px;
  display: flex;
  gap: 4px;
}
.reel-ticks button {
  position: relative;
  width: 26px;
  height: 18px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.reel-ticks button::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 2px;
  border-radius: 2px;
  background: var(--line-subtle);
  transition: background 0.3s, height 0.3s, top 0.3s;
}
.reel-ticks button.is-on::before {
  background: var(--accent);
  height: 4px;
  top: 7px;
}
.reel-ticks span {
  position: absolute;
  bottom: 22px;
  left: 50%;
  translate: -50% 4px;
  font: 11px var(--font-ui);
  color: var(--text-nav);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, translate 0.2s;
}
.reel-ticks button:hover span {
  opacity: 1;
  translate: -50% 0;
}

/* 6. Depth */
.depth-view {
  position: fixed;
  inset: 0;
  width: var(--vw);
  height: var(--vh);
  overflow: hidden;
  perspective: 900px;
}
.depth-world {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-style: preserve-3d;
}
.dz {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform, opacity;
}
.dz-dust {
  width: var(--r);
  height: var(--r);
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.dz-intro {
  width: min(720px, 80vw);
  text-align: center;
}
.dz-intro .lab-name {
  font-size: clamp(80px, 10vw, 150px);
}
.dz-intro .lab-bio {
  margin-inline: auto;
}
.dz-intro .lab-socials {
  justify-content: center;
}
.dz-pack {
  width: 420px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid var(--line-subtle);
  background: var(--bg);
}
.dz-pack > div {
  height: 280px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.dz-card {
  display: block;
  width: min(560px, 44vw);
  text-decoration: none;
}
.dz-img {
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.5);
}
.dz-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: scale 0.6s var(--ease);
}
.dz-card:hover .dz-img img {
  scale: 1.04;
}
.dz-cap {
  display: block;
  padding: 14px 4px 0;
}
.dz-cap .work-name {
  display: block;
  font: 400 44px/1 var(--font-reading);
  letter-spacing: -0.02em;
  color: var(--text-heading);
  margin: 4px 0 6px;
}
.dz-sum {
  display: block;
  font-size: 16px;
  color: var(--text-secondary);
}
.dz-outro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  width: 520px;
}
.depth-hud {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  font: 12px var(--font-mono);
  color: var(--text-nav);
}
.depth-bar {
  width: 120px;
  height: 2px;
  background: var(--line-subtle);
  overflow: hidden;
}
.depth-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  transform-origin: left;
  transform: scaleX(0);
}
.depth-spacer {
  height: calc(var(--n) * 70 * var(--vh) / 100);
}

/* Phones: these are desktop prototypes. Keep them usable, not tuned. */
@media (max-width: 899px) {
  .bento {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
    grid-auto-rows: 160px;
    grid-template-areas: none;
    overflow: auto;
  }
  .bento > * {
    grid-area: auto !important;
  }
  .tile-hero {
    grid-column: 1 / -1;
    grid-row: span 3;
  }
  .ide {
    grid-template-columns: 1fr;
  }
  .ide-side,
  .ide-preview {
    display: none;
  }
  .slide {
    grid-template-columns: 1fr;
  }
  .lab-switch button {
    padding: 6px 8px;
  }
  .lab-switch kbd {
    display: none;
  }
}

/* 7. Rooms: a quiet home plus tabs, each room spacious with one idea in it */
.rooms {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.rm-bar {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 26px 80px 0 48px;
}
.rm-me,
.rm-tabs button,
.rm-more {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.rm-me {
  font: 400 20px var(--font-reading);
  color: var(--text-heading);
}
.rm-tabs {
  position: relative;
  display: flex;
  gap: 4px;
  margin: 0 auto;
  padding: 4px;
  border-radius: 99px;
  border: 1px solid var(--line-subtle);
}
.rm-tabs button {
  position: relative;
  z-index: 1;
  padding: 6px 16px;
  font: 500 13.5px var(--font-ui);
  color: var(--text-nav);
  transition: color 0.3s;
}
.rm-tabs button:hover,
.rm-tabs button[aria-selected="true"] {
  color: var(--text-heading);
}
.rm-ink {
  position: absolute;
  top: 4px;
  bottom: 4px;
  border-radius: 99px;
  background: var(--surface-subtle);
  box-shadow: inset 0 0 0 1px var(--line-subtle);
  transition: left 0.45s var(--spring), width 0.45s var(--spring);
}
.rm-room {
  flex: 1;
  min-height: 0;
  padding: 0 clamp(48px, 9vw, 160px) 90px;
}
.rm-room:not([hidden]) > * > * {
  animation: tile-in 0.7s var(--ease) both;
}
.rm-room > * > :nth-child(2) { animation-delay: 0.08s; }
.rm-room > * > :nth-child(3) { animation-delay: 0.16s; }
.rm-room > * > :nth-child(4) { animation-delay: 0.24s; }

/* Home */
.rm-home {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 6vw;
}
.rm-intro .lab-name {
  font-size: clamp(52px, 5.6vw, 88px);
}
.rm-intro .lab-bio {
  font-size: 19px;
  max-width: 34ch;
}
.rm-more {
  margin-top: 18px;
  font: 500 14px var(--font-ui);
  color: var(--accent);
}
.rm-more:hover {
  text-decoration: underline;
}
.rm-fan {
  position: relative;
  height: min(380px, 52vh);
}
.rm-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(300px, 24vw);
  text-decoration: none;
  translate: calc(-50% + var(--k) * 46px) calc(-50% + var(--k) * var(--k) * 10px);
  rotate: calc(var(--k) * 7deg);
  transition: translate 0.6s var(--spring), rotate 0.6s var(--spring), scale 0.4s var(--ease);
}
.rm-card:nth-child(2) {
  z-index: 2;
}
.rm-fan:hover .rm-card {
  translate: calc(-50% + var(--k) * 78%) calc(-50% + var(--k) * var(--k) * 14px);
  rotate: calc(var(--k) * 4deg);
}
.rm-fan .rm-card:hover {
  scale: 1.05;
  z-index: 3;
}
.rm-fan-img {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.5);
}
.rm-fan-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}
.rm-fan-cap {
  display: flex;
  justify-content: space-between;
  padding: 10px 4px 0;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.3s 0.1s;
}
.rm-fan-cap span:last-child {
  font: 11px var(--font-mono);
  color: var(--text-nav);
}
.rm-card:hover .rm-fan-cap {
  opacity: 1;
}
.rm-mascot {
  position: absolute;
  right: 0;
  bottom: -40px;
  scale: 0.8;
  transform-origin: bottom right;
}

/* Projects */
.rm-projects {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 7vw;
}
.rm-index {
  max-width: 380px;
}
.rm-index .lab-kicker {
  margin: 22px 0 6px;
}
.rm-index .lab-kicker:first-child {
  margin-top: 0;
}
.rm-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 0;
  text-decoration: none;
  font-size: 24px;
  line-height: 1.3;
  color: var(--text-nav);
  transition: color 0.25s;
}
.rm-row .work-name {
  transition: translate 0.35s var(--ease);
}
.rm-row.is-on {
  color: var(--text-heading);
}
.rm-row.is-on .work-name {
  translate: 8px 0;
}
.rm-role {
  font: 11px var(--font-mono);
  color: var(--text-nav);
  opacity: 0;
  transition: opacity 0.25s;
}
.rm-row.is-on .rm-role {
  opacity: 1;
}
.rm-view {
  margin: 0;
}
.rm-view-img {
  position: relative;
  aspect-ratio: 16 / 10.5;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  box-shadow: 0 40px 80px -40px rgb(0 0 0 / 0.5);
  background: var(--surface-subtle);
}
.rm-view-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  opacity: 0;
  scale: 1.04;
  transition: opacity 0.5s, scale 0.8s var(--ease);
}
.rm-view-img img.is-on {
  opacity: 1;
  scale: 1;
}
.rm-view figcaption {
  margin-top: 14px;
  font-size: 17px;
  color: var(--text-secondary);
  min-height: 3em;
}

/* Passions */
.rm-passions {
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: center;
  gap: 9vh 6vw;
}
.rm-word {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  translate: 0 calc(var(--k) * 8px);
}
.rm-word:nth-child(even) {
  justify-self: end;
  text-align: right;
}
.rm-word-text {
  font: 400 clamp(36px, 4.4vw, 68px) / 1 var(--font-reading);
  letter-spacing: -0.02em;
  color: var(--text-heading);
  transition: color 0.3s, translate 0.4s var(--ease);
}
.rm-word:hover .rm-word-text {
  color: var(--accent);
  translate: 0 -4px;
}
.rm-go {
  font: 12px var(--font-mono);
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s;
}
.rm-word:hover .rm-go {
  opacity: 1;
}

/* Notes */
.rm-notes {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5vh;
  max-width: 900px;
}
.rm-note {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  padding-bottom: 4vh;
  border-bottom: 1px solid var(--line-subtle);
}
.rm-note-title {
  font: 400 clamp(34px, 4vw, 60px) / 1.05 var(--font-reading);
  color: var(--text-heading);
  transition: color 0.3s, translate 0.4s var(--ease);
}
.rm-note:hover .rm-note-title {
  color: var(--accent);
  translate: 10px 0;
}
.rm-soon {
  margin: 0;
  color: var(--text-nav);
}

/* About */
.rm-about {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  align-items: center;
  gap: 7vw;
}
.rm-about-bio {
  margin: 10px 0 16px;
  font: 400 clamp(22px, 2vw, 30px) / 1.4 var(--font-reading);
  color: var(--text-heading);
  text-wrap: pretty;
}
.rm-pack {
  margin: 0;
}
.rm-pack > div {
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line-subtle);
  margin-bottom: 10px;
}

/* The landing screen of every look shows the mascot with the name and short bio. */
.slide-mascot,
.rm-mascot {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 8px;
}
.slide-mascot .lab-mascot,
.rm-mascot .lab-mascot {
  flex-direction: row-reverse;
  align-items: flex-end;
  gap: 10px;
}
.slide-mascot .lab-creature img,
.rm-mascot .lab-creature img {
  width: 64px;
}
.dz-intro .lab-mascot {
  margin-bottom: 10px;
}
.orbit-line {
  max-width: 44ch;
  font-size: 15px;
}

/* Rooms › Projects: a floating field of screenshots, bigger than the screen, that the cursor looks around */
.rm-room[data-room="projects"] {
  padding: 0;
}
.rm-field {
  --u: calc(min(var(--vw), var(--vh)) / 100);
  position: relative;
  height: 100%;
  overflow: hidden;
}
.rm-room > .rm-field > * {
  animation: none;
}
.rf-inner {
  position: absolute;
  inset: 24px 40px 0;
}
.rf-card {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: calc(var(--s) * var(--u));
  text-decoration: none;
  translate: calc(-50% + var(--px, 0) * var(--d) * 60px) calc(-50% + var(--py, 0) * var(--d) * 40px);
  transition: opacity 0.4s, filter 0.4s;
  animation: rf-in 0.9s var(--ease) both, rf-float 7s ease-in-out infinite;
  animation-delay: calc(var(--k) * 60ms), calc(var(--k) * -0.8s);
}
@keyframes rf-in {
  from {
    opacity: 0;
    scale: 0.9;
  }
}
@keyframes rf-float {
  50% {
    transform: translateY(-10px);
  }
}
.rf-img {
  position: relative;
  display: block;
  transition: scale 0.5s var(--ease);
}
.rf-img img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}
.rf-img .rf-glow {
  position: absolute;
  inset: 0;
  height: 100%;
  z-index: -1;
  filter: blur(36px) saturate(1.5);
  opacity: 0.4;
  scale: 1.08;
  transition: opacity 0.5s;
}
.rf-card:hover .rf-img {
  scale: 1.04;
}
.rf-card:hover .rf-glow {
  opacity: 0.75;
}
.rf-inner:has(.rf-card:hover) .rf-card:not(:hover) {
  opacity: 0.28;
  filter: grayscale(0.5);
}
.rf-cap {
  display: block;
  margin-top: 10px;
  font: 12px/1.45 var(--font-mono);
  color: var(--text-heading);
}
.rf-cap .work-name {
  font: inherit;
}
.rf-cap > span:last-child {
  display: block;
  color: var(--text-nav);
}
.rf-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding: 110px clamp(48px, 7vw, 120px) 84px;
  background: linear-gradient(transparent, var(--bg) 62%);
  pointer-events: none;
}
.rf-title {
  margin: 4px 0 0;
  font: 400 clamp(48px, 6vw, 96px) / 0.95 var(--font-reading);
  letter-spacing: -0.03em;
  color: var(--text-heading);
}
.rf-sum {
  max-width: 38ch;
  margin: 0 0 8px;
  font-size: 17px;
  color: var(--text-secondary);
  text-align: right;
}

/* Shared sections: every look (except Rooms, which has its own) gets the same top bar and tabs. */
.sec-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 290;
  height: 64px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
}
.sec-shell .rm-bar {
  padding: 14px 80px 0 28px;
}
body[data-sections] .lab-stage {
  top: 64px;
  height: calc(var(--vh) - 64px);
}
body[data-sections] .sec-home {
  height: 100%;
}
body[data-sections] .lab-stage > .rm-room {
  position: absolute;
  inset: 0;
  padding-top: 24px;
}
body[data-sections] .lab-stage > .rm-room[data-room="projects"] {
  padding-top: 0;
}
/* Depth and Build scroll on Home only. */
html:has(body[data-sections]:not([data-sec="home"])) {
  overflow: hidden !important;
}
body[data-sections]:not([data-sec="home"]) .lab-stage {
  position: fixed !important;
  top: 64px !important;
  height: calc(var(--vh) - 64px) !important;
  overflow: hidden !important;
}
/* The rooms' rise-in, which Rooms gets from .rm-room:not([hidden]) > * > * */
body[data-sections] .rm-room:not([hidden]) > * > * {
  animation: tile-in 0.7s var(--ease) both;
}

/* Never crop a screenshot: each one shows whole, at its own shape. */
.tile-shot .tile-bg {
  filter: blur(22px) saturate(1.3) brightness(0.7);
  scale: 1.2;
}
.tile-shot img:not(.tile-bg) {
  inset: 10px 10px 44px;
  width: calc(100% - 20px);
  height: calc(100% - 54px);
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
}
a.tile-shot:hover img:not(.tile-bg) {
  transform: scale(1.03);
}
.tile-shot::before {
  background: linear-gradient(transparent 70%, rgb(10 10 12 / 0.55));
}
.node-dot {
  width: 104px;
  height: auto;
  border-radius: 10px;
}
.node-dot img {
  display: block;
  height: auto;
}
.node.is-small .node-dot {
  border-radius: 50%;
}
.orbit-card img,
.pol-img,
.slide-shot,
.dz-img,
.rm-fan-img {
  aspect-ratio: auto;
}
.orbit-card img,
.pol-img img,
.dz-img img,
.rm-fan-img img {
  display: block;
  height: auto;
  object-fit: initial;
}
.slide-shot {
  justify-self: center;
  max-height: none;
  width: fit-content;
  max-width: 100%;
}
.slide-shot img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 64vh;
}
.slide-shot.is-pack {
  width: 100%;
  aspect-ratio: 16 / 10.5;
}

body[data-sections] .theme-toggle {
  z-index: 300;
}
body[data-sections]:not([data-sec="home"]) #stage.lab-stage {
  left: 0 !important;
  width: var(--vw) !important;
}
