/* Desk page. Font, margins and page transitions live in base.css. */

:root {
  --bg: #e8e5de;
  --ink: #1d1c1a;
  --muted: #6f6a61;
  --paper: #f7f5f0;
  --line: #ddd8ce;
  --sans: 'Geist', ui-sans-serif, system-ui, sans-serif;
  --pixel: 'Geist Pixel', var(--sans);
  /* Geist Pixel draws on a 38/1000 em grid. At these sizes each font pixel
     lands on whole screen pixels (1 CSS px, or 1 device px on 2x screens);
     anything in between blurs into a soft sans. */
  --pixel-l: 26.32px;
  --pixel-s: 13.16px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.hero {
  position: relative;
  height: 100svh;
  overflow: hidden;
}

#stage {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  opacity: 0;
  transition: opacity 400ms ease-out;
}

/* Until the first frame is drawn: a little pulsing voxel loader, UI hidden.
   Once .ready lands, the UI fades in behind the island's entrance. */
.loader {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  gap: 6px;
  transform: translate(-50%, -50%);
  transition: opacity 300ms ease-out;
}

.loader span {
  width: 8px;
  height: 8px;
  background: var(--ink);
  animation: voxel-pulse 900ms ease-in-out infinite;
}

.loader span:nth-child(2) {
  animation-delay: 150ms;
}

.loader span:nth-child(3) {
  animation-delay: 300ms;
}

@keyframes voxel-pulse {
  0%,
  100% {
    opacity: 0.2;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

.intro,
.actions,
.desk-toys,
.sound,
.scroll-cue {
  opacity: 0;
  translate: 0 8px;
  transition: opacity 500ms var(--ease-out), translate 500ms var(--ease-out);
}

.ready #stage {
  opacity: 1;
}

.ready .loader {
  opacity: 0;
  pointer-events: none;
}

.ready .intro,
.ready .actions,
.ready .desk-toys,
.ready .sound,
.ready .scroll-cue {
  opacity: 1;
  translate: 0 0;
}

.head-only:not(.ready) :is(.intro, .actions, .sound) {
  opacity: 1;
  translate: 0 0;
}

.ready .intro {
  transition-delay: 1900ms;
}

.ready .sound,
.ready .actions {
  transition-delay: 2100ms;
}

.ready .desk-toys,
.ready .scroll-cue {
  transition-delay: 2300ms;
}

/* Pixel type for tooltips and panel headings. */
.tip,
.panel h2 {
  font-family: var(--pixel);
  font-variation-settings: 'ELSH' 1;
  font-weight: 400;
  font-synthesis: none;
}

/* Hover label that follows the pointer over clickable objects. */
.tip {
  position: fixed;
  top: 0;
  left: 0;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: var(--pixel-s);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease-out;
}

.tip.show {
  opacity: 1;
}

/* --- The work, on the monitor -------------------------------------------------
   Seen over Yash's shoulder once the camera has flown in: the monitor's
   screen, as a small light "portfolio" window. Sized to the screen with
   container units; src/main.js lays it exactly over the monitor. */
.monitor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f7f5f0;
  color: var(--ink);
  container-type: size;
  transform-origin: 0 0;
  /* Opacity follows the camera's fly-in (src/main.js). */
  opacity: 0;
  visibility: hidden;
}

.monitor:focus {
  outline: none;
}

.monitor.on {
  visibility: visible;
}

.monitor-bar {
  display: flex;
  flex: none;
  align-items: center;
  gap: 3cqh;
  height: 11cqh;
  padding: 0 4cqh;
  border-bottom: 1px solid var(--line);
  background: #efece5;
}

.monitor-dots {
  display: flex;
  gap: 1.2cqh;
}

.monitor-dots i {
  width: 2cqh;
  height: 2cqh;
  border-radius: 50%;
  background: #d9d3c8;
}

.monitor-bar h2 {
  margin: 0;
  font: 400 5.2cqh / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  font-synthesis: none;
}

.monitor-all {
  margin-left: auto;
  padding: 1.4cqh 2.6cqh;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 2.8cqh / 1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
}

/* The featured projects, two by two, centred in the window. */
.monitor-grid {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(2, auto);
  place-content: center;
  gap: 3cqh 5cqh;
  margin: 0;
  padding: 3cqh 4cqh;
  list-style: none;
}

.monitor-grid a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.monitor-grid .thumb {
  display: block;
  height: 28cqh;
  margin-bottom: 1.5cqh;
  border-radius: 1.4cqh;
}

.monitor-grid .title {
  display: -webkit-box;
  max-width: 38cqh;
  overflow: hidden;
  font: 600 3.4cqh / 1.2 var(--sans);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.monitor-grid .meta {
  display: block;
  color: var(--muted);
  font: 3cqh / 1.3 var(--sans);
}

.monitor a:focus-visible {
  outline: 0.6cqh solid var(--ink);
  outline-offset: 0.6cqh;
}

@media (hover: hover) and (pointer: fine) {
  .monitor-grid a:hover .thumb {
    transform: translateY(-1cqh);
  }
}

/* On a small screen (phones), the covers alone, a little bigger. */
@container (max-width: 480px) {
  .monitor-grid .title,
  .monitor-grid .meta {
    display: none;
  }

  .monitor-grid .thumb {
    height: 34cqh;
    margin: 0;
  }
}

/* The way back, and the desk's own buttons tucked away meanwhile. */
.monitor-back {
  position: absolute;
  left: 50%;
  bottom: var(--top);
  z-index: 3;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 14px / 1 var(--sans);
  cursor: var(--hand);
  opacity: 0;
  visibility: hidden;
  translate: -50% 8px;
  transition: opacity 260ms ease-out, translate 260ms var(--ease-out), visibility 0s 260ms;
}

.at-screen .monitor-back {
  opacity: 1;
  visibility: visible;
  translate: -50% 0;
  transition: opacity 260ms ease-out 700ms, translate 260ms var(--ease-out) 700ms;
}

.monitor-back:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.at-screen .desk-toys,
.at-screen .scroll-cue {
  opacity: 0;
  pointer-events: none;
}

/* Bottom centre: things to do on the desk. Small and quiet so they read as
   toys, not navigation. */
.desk-toys {
  position: absolute;
  left: 50%;
  bottom: var(--top);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.desk-toys-label {
  margin-right: 4px;
  transition: color 800ms ease-out;
}

.desk-toys button {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--ink);
  font: 12px / 1 var(--sans);
  cursor: var(--hand);
  transition: background-color 160ms ease-out, color 800ms ease-out, border-color 800ms ease-out;
}

.desk-toys button:active {
  scale: 0.96;
}

.desk-toys button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .desk-toys button:hover {
    background: rgb(247 245 240 / 0.8);
  }
}

/* Phones: the toys sit just above the bottom nav. */
@media (max-width: 800px) {
  .desk-toys {
    bottom: calc(var(--top) + 60px);
  }

  .desk-toys-label {
    display: none;
  }
}

/* Work and contact panels. */
.panel {
  width: min(720px, calc(100% - 32px));
  max-height: calc(100svh - 64px);
  padding: 28px;
  border: 0;
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.25);
}

.panel-narrow {
  width: min(440px, calc(100% - 32px));
}

.panel::backdrop {
  background: rgb(29 28 26 / 0.35);
}

/* Contact sits to the side with a light backdrop so you can watch the phone call. */
.panel-narrow::backdrop {
  background: rgb(29 28 26 / 0.12);
}

@media (min-width: 900px) {
  .panel-narrow {
    margin-right: var(--edge);
  }
}

.panel[open] {
  animation: panel-in 220ms var(--ease-out);
}

.panel[open]::backdrop {
  animation: fade-in 220ms ease-out;
}

.panel.closing {
  animation: panel-out 160ms ease-in forwards;
}

.panel.closing::backdrop {
  animation: fade-out 160ms ease-in forwards;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
}

@keyframes panel-out {
  to {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel h2 {
  margin: 0;
  font-size: var(--h2);
  line-height: 1;
}

.close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--line);
  color: var(--ink);
  font: 18px/1 var(--sans);
  cursor: var(--hand);
}

.close:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.projects a {
  display: grid;
  gap: 4px;
  color: inherit;
  text-decoration: none;
}

.thumb {
  aspect-ratio: 4 / 3;
  margin-bottom: 6px;
  border-radius: 10px;
  background-color: var(--thumb);
  background-size: cover;
  background-position: center;
  transition: transform 200ms var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .projects a:hover .thumb {
    transform: translateY(-3px);
  }
}

.title {
  font-size: 14px;
  font-weight: 600;
}

.all-work {
  display: inline-block;
  margin-top: 24px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  text-decoration: none;
}

.all-work:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.meta {
  font-size: 13px;
  color: var(--muted);
}

/* --- Contact: a live phone call ------------------------------------------- */

/* It opens as the character picks up the desk phone, so it looks like an
   in-call screen: a status line with a running timer, the lines you can
   reach me on, and a red hang-up button (the phone's red) to close. */
.panel.call {
  --call-red: #c0392b;
  --call-green: #2f9e5b;
  padding: 0;
  border-radius: 24px;
  background: var(--paper);
  box-shadow:
    0 0 0 1px rgb(29 28 26 / 0.06),
    0 2px 4px rgb(29 28 26 / 0.04),
    0 24px 48px -12px rgb(29 28 26 / 0.28),
    0 60px 100px -40px rgb(29 28 26 / 0.3);
}

.call > * {
  margin-inline: 28px;
}

.call-status {
  display: flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  margin-top: 24px;
  margin-bottom: 0;
  padding: 7px 12px 7px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 400 var(--pixel-s) / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
}

.call-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5ed38c;
}

.call-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  animation: call-ping 1.6s var(--ease-out) infinite;
}

@keyframes call-ping {
  from {
    opacity: 0.7;
    scale: 1;
  }
  to {
    opacity: 0;
    scale: 2.6;
  }
}

.call-timer {
  color: rgb(247 245 240 / 0.55);
  font-variant-numeric: tabular-nums;
}

.panel.call h2 {
  margin: 28px 28px 0;
  font-size: var(--h1);
  line-height: 1;
  letter-spacing: -0.02em;
}

.call-copy {
  max-width: 32ch;
  margin-top: 14px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

/* Each way to reach me is one row: a white line you can tap, with a
   trailing control (copy for email, an arrow for links). */
.call-lines {
  display: grid;
  gap: 8px;
  margin-bottom: 0;
  padding: 0;
  list-style: none;
}

.call-line {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px 11px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  transition: border-color 160ms ease-out, box-shadow 200ms ease-out;
}

.call-link {
  display: grid;
  flex: 1;
  gap: 4px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

/* The whole row is the link's hit area; the copy button sits above it. */
.call-link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.call-link:focus-visible {
  outline: none;
}

.call-line:has(.call-link:focus-visible) {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.call-kind {
  color: var(--muted);
  font-size: 12px;
}

.call-value {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.call-copy-btn {
  position: relative;
  z-index: 1;
  min-width: 72px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--pixel-s) / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  cursor: var(--hand);
  transition: background-color 160ms ease-out, color 160ms ease-out, border-color 160ms ease-out, scale 160ms ease-out;
}

.call-copy-btn:active {
  scale: 0.95;
}

.call-copy-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.call-copy-btn.copied {
  border-color: var(--call-green);
  background: var(--call-green);
  color: #fff;
}

/* Phone: a green call button, so on a phone it rings straight through. */
.call-dial {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 11px;
  border-radius: 999px;
  background: var(--call-green);
  color: #fff;
  font: 400 var(--pixel-s) / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25);
  transition: scale 160ms ease-out, background-color 160ms ease-out;
}

.call-dial svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.call-dial:active {
  scale: 0.95;
}

.call-dial:focus-visible {
  outline: 2px solid var(--call-green);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .call-dial:hover {
    background: #278a4e;
  }

  .call-dial:hover svg {
    animation: ringing 500ms ease-in-out;
  }
}

.call-arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--paper);
  font-size: 16px;
  transition: translate 200ms var(--ease-out), background-color 160ms ease-out, color 160ms ease-out;
}

@media (hover: hover) and (pointer: fine) {
  .call-line:hover {
    border-color: rgb(29 28 26 / 0.22);
    box-shadow: 0 8px 20px -12px rgb(29 28 26 / 0.3);
  }

  .call-line:hover /* Phone: a green call button, so on a phone it rings straight through. */
.call-dial {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 11px;
  border-radius: 999px;
  background: var(--call-green);
  color: #fff;
  font: 400 var(--pixel-s) / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25);
  transition: scale 160ms ease-out, background-color 160ms ease-out;
}

.call-dial svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.call-dial:active {
  scale: 0.95;
}

.call-dial:focus-visible {
  outline: 2px solid var(--call-green);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .call-dial:hover {
    background: #278a4e;
  }

  .call-dial:hover svg {
    animation: ringing 500ms ease-in-out;
  }
}

.call-arrow {
    background: var(--ink);
    color: var(--paper);
    translate: 2px -2px;
  }

  .call-copy-btn:hover:not(.copied) {
    border-color: var(--ink);
  }

  .hang-up:hover {
    background: #a83226;
  }
}

.panel.call > .call-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 0;
  padding: 16px 16px 16px 28px;
  border-top: 1px solid var(--line);
}

.call-clock {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.call-clock time {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.hang-up {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--call-red);
  color: #fff;
  font: 400 var(--pixel-s) / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  white-space: nowrap;
  cursor: var(--hand);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25), 0 6px 14px -6px rgb(192 57 43 / 0.6);
  transition: background-color 160ms ease-out, scale 160ms ease-out;
}

.hang-up svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.hang-up:active {
  scale: 0.96;
}

.hang-up:focus-visible {
  outline: 2px solid var(--call-red);
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .call > * {
    margin-inline: 20px;
  }

  .panel.call h2 {
    margin-inline: 20px;
  }

  .panel.call > .call-foot {
    padding-left: 20px;
  }
}

.fallback[hidden] {
  display: none;
}

.fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 16px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 600px) {
  .panel {
    padding: 20px;
  }

  .projects {
    grid-template-columns: 1fr;
  }
}

/* --- Experience ----------------------------------------------------------- */

/* Bottom-right cue on the hero pointing down to the next section (About). */
.scroll-cue {
  position: absolute;
  right: var(--edge);
  bottom: var(--top);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(247 245 240 / 0.7);
  color: var(--ink);
  font: 400 var(--pixel-s) / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  text-decoration: none;
}

.scroll-cue::after {
  content: '↓';
}

.scroll-cue:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Links from other pages (index.html#about) land just under the header bar. */
.about,
.reel,
.experience {
  scroll-margin-top: calc(var(--head-h) + 24px);
}

.experience {
  position: relative;
  /* About sits above with its own generous bottom padding, so a hairline
     and a little room is enough to start the next chapter. */
  padding-top: var(--top);
  border-top: 1px solid var(--line);
  background: var(--bg);
}

/* Title and the Play / Read lever stay pinned just under the header bar
   while you walk. */
.exp-head {
  position: sticky;
  top: var(--head-h);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px var(--edge);
  /* Solid, not a fade: text scrolling underneath never shows through. */
  background: var(--bg);
}

/* In the Read list, a hairline marks where the pinned bar ends, like the
   site header above it. (In Play the scenery runs on behind it instead.) */
.experience:has(.exp-read:not([hidden])) .exp-head {
  border-bottom: 1px solid var(--line);
}

.exp-title {
  margin: 0;
  font: 400 var(--h1) / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  font-synthesis: none;
  letter-spacing: -0.02em;
}

.mode-small {
  --mode-size: var(--h2);
}

/* Play: a tall block you scroll through; the stage inside stays put. */
.trail {
  height: calc(var(--stops) * 60svh + 100svh);
  margin-top: -120px;
}

.trail-stage {
  position: sticky;
  top: 0;
  height: 100svh;
  overflow: hidden;
}

#trail-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* The companies' names, laid over their sign boards as real text (src/trail.js). */
.trail-signs {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.trail-sign {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  font-family: var(--pixel);
  font-variation-settings: 'ELSH' 1;
  font-synthesis: none;
  line-height: 1;
  white-space: nowrap;
  transform-origin: 0 0;
}

.trail-card {
  position: absolute;
  left: var(--edge);
  bottom: calc(var(--top) + 48px);
  width: min(380px, calc(100% - 2 * var(--gutter)));
  padding: 22px 24px;
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.14);
  opacity: 0;
  translate: 0 12px;
  pointer-events: none;
  transition: opacity 200ms ease-out, translate 260ms var(--ease-out);
}

.trail-card.show {
  opacity: 1;
  translate: 0 0;
  pointer-events: auto;
}

.card-dates {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}

.card-role {
  margin: 0;
  font: 400 var(--h2) / 1.1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  font-synthesis: none;
}

.card-company {
  margin: 6px 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.card-summary {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.6;
}

.card-points {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
}

.card-cta {
  margin-top: 8px;
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 400 var(--pixel-s) / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  cursor: var(--hand);
}

.card-cta:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Right-hand rail: one stop per role, shows where you are, jumps on click. */
.trail-rail {
  position: absolute;
  right: var(--edge);
  top: 50%;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  translate: 0 -50%;
}

.trail-rail button {
  width: 100%;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(247 245 240 / 0.7);
  color: var(--ink);
  font: 400 var(--pixel-s) / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  cursor: var(--hand);
  transition: background-color 200ms ease-out, color 200ms ease-out, border-color 200ms ease-out;
}

.trail-rail button[aria-current='true'] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

.trail-rail button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* Three short instructions, with the keys drawn as little keycaps. */
/* Under the role card, on its left edge (src/trail.js keeps the two
   together as the card moves). Dark enough to read on the light ground. */
.trail-hint {
  position: absolute;
  left: var(--edge);
  bottom: var(--top);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 13px;
  color: #3f3b35;
  white-space: nowrap;
  transition: left 260ms var(--ease-out);
}

/* Keycaps that double as buttons: press them or the real arrow keys. */
.trail-key {
  display: inline-block;
  min-width: 26px;
  margin-right: 2px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: 12px / 1 var(--sans);
  text-align: center;
  cursor: var(--hand);
  transition: translate 80ms ease-out, border-bottom-width 80ms ease-out, background-color 160ms ease-out;
}

.trail-key:active {
  translate: 0 1px;
  border-bottom-width: 1px;
}

.trail-key:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .trail-key:hover {
    background: #fff;
  }
}

/* Read: one row per company (company, role, dates) with the details under
   the role. Hovering a row lifts it and pops up the company's mark. */
.exp-read {
  position: relative;
  padding: 12px var(--edge) clamp(96px, 10vw, 160px);
}

.exp-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* "Before design" tag on roles from before the switch to design. */
.exp-note,
.card-note {
  display: inline-block;
  margin-left: 6px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 400 11px / 1.2 var(--sans);
  color: var(--muted);
  vertical-align: middle;
}

.card-note {
  margin-left: 4px;
  padding: 2px 7px;
  font-size: 10px;
}

.exp-item {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 32px;
  row-gap: 10px;
  margin: 0 -20px;
  padding: 28px 20px;
  border-top: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: background-color 200ms ease-out;
}

.exp-item.active {
  background: rgb(247 245 240 / 0.8);
}

.exp-item:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}

.exp-company {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font: 400 var(--h2) / 1.1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  font-synthesis: none;
}

/* Inline mark, phones only (no hover there for the pop-up). */
.exp-mark {
  display: none;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 4px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 0 0 1px var(--line);
}

.exp-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.exp-mark:has(.cover) {
  padding: 0;
}

.exp-role {
  margin: 0;
  font-size: 15px;
}

.exp-dates {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.exp-detail {
  grid-column: 2 / -1;
  max-width: 60ch;
}

.exp-summary {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}

.exp-points {
  margin: 0;
  padding: 0;
  font-size: 14px;
  line-height: 1.7;
  list-style: none;
}

.exp-points li {
  position: relative;
  padding-left: 16px;
}

/* Small square bullets, a nod to the voxels. */
.exp-points li::before {
  content: '';
  position: absolute;
  top: 0.7em;
  left: 0;
  width: 5px;
  height: 5px;
  background: var(--muted);
}

/* The pop-up card: a tilted white tile with the company's mark and a soft
   glow in its accent colour. It springs in, glides between rows, and stays
   clear of the dates. */
.exp-pop {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 16px;
  overflow: hidden;
  background: radial-gradient(120% 75% at 50% 115%, var(--glow, #ffb27a) 0%, rgb(255 255 255 / 0) 70%), var(--tile, #ffffff);
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.04), 0 12px 28px rgb(0 0 0 / 0.16);
  pointer-events: none;
  opacity: 0;
  scale: 0.4;
  transition: opacity 160ms ease-out, scale 380ms cubic-bezier(0.34, 1.56, 0.64, 1), translate 320ms var(--ease-out), rotate 380ms var(--ease-out);
}

.exp-pop.show {
  opacity: 1;
  scale: 1;
}

.exp-pop img {
  width: 64%;
  height: 64%;
  object-fit: contain;
}

/* Marks cropped from a photo fill the tile edge to edge. */
.exp-pop img.cover,
.exp-mark img.cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 720px) {
  .scroll-cue,
  .trail-rail {
    display: none;
  }

  /* Phones: the heading clearly outranks the Play / Read switch under it,
     with room between them (sizes on the pixel font's sharp steps). */
  .exp-head {
    flex-wrap: wrap;
    row-gap: 14px;
  }

  .experience .lever {
    zoom: 0.6;
  }

  .trail-hint {
    display: none;
  }

  /* Clear of the floating nav at the bottom of the screen, with room to spare. */
  .trail-card {
    right: var(--edge);
    bottom: calc(var(--top) + 84px);
    width: auto;
  }
}

/* Narrow screens: rows stack, the mark sits inline, no pop-up. */
@media (max-width: 900px) {
  .exp-item {
    grid-template-columns: 1fr;
    row-gap: 6px;
  }

  .exp-detail {
    grid-column: auto;
    margin-top: 6px;
  }

  .exp-dates {
    text-align: left;
  }

  .exp-mark {
    display: block;
  }

  .exp-pop {
    display: none;
  }
}

/* --- About ---------------------------------------------------------------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: clamp(32px, 6vw, 96px);
  padding: calc(var(--top) * 4) var(--edge) clamp(96px, 10vw, 160px);
  background: var(--bg);
}

.about-title {
  margin: 0;
  font: 400 var(--h1) / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  font-synthesis: none;
  letter-spacing: -0.02em;
}

/* About 65 characters a line in Geist. */
.about-body p {
  max-width: 32em;
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.65;
}

.about-body .about-lead {
  max-width: 24ch;
  margin-bottom: 28px;
  font: 400 var(--h2) / 1.3 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  font-synthesis: none;
}

.about-body .about-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 32px;
}

.about-cta {
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 400 var(--pixel-s) / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  cursor: var(--hand);
}

.about-cta:focus-visible,
.about-actions a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.about-actions a {
  font-size: 14px;
  color: var(--ink);
  text-underline-offset: 4px;
}

@media (max-width: 720px) {
  .about {
    grid-template-columns: 1fr;
  }

  /* Phones: the section heading clearly outranks the intro under it (both
     on the pixel font's sharp sizes). */

}

/* The "Experience ↓" cue would crowd the toys row on narrower screens, and
   the header has Experience anyway. */
@media (max-width: 1000px) {
  .scroll-cue {
    display: none;
  }
}

/* --- Coach mark: one-time spotlight on the Play / Read switch ------------ */

/* The spotlight is a transparent pill whose giant shadow dims everything
   else. It ignores the pointer, so the lever under it still works. */
.coach-spot {
  position: fixed;
  z-index: 50;
  border-radius: 999px;
  box-shadow: 0 0 0 200vmax rgb(20 19 17 / 0.55);
  pointer-events: none;
  opacity: 0;
  transition: opacity 260ms ease-out;
}

.coach-spot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border: 2px solid var(--paper);
  border-radius: inherit;
  animation: coach-pulse 1.4s ease-out 300ms 2 both;
}

@keyframes coach-pulse {
  from {
    opacity: 0.9;
    scale: 1;
  }
  to {
    opacity: 0;
    scale: 1.18;
  }
}

.coach-tip {
  position: fixed;
  z-index: 51;
  width: min(280px, calc(100vw - 32px));
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 16px 40px rgb(0 0 0 / 0.25);
  opacity: 0;
  translate: 0 8px;
  transition: opacity 260ms ease-out 120ms, translate 320ms var(--ease-out) 120ms;
}

/* Little arrow pointing up at the switch. */
.coach-tip::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 40px;
  width: 12px;
  height: 12px;
  background: var(--paper);
  rotate: 45deg;
}

.coach.show .coach-spot,
.coach.show .coach-tip {
  opacity: 1;
  translate: 0 0;
}

.coach-tip p {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
}

.coach-ok {
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 400 var(--pixel-s) / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  cursor: var(--hand);
}

.coach-ok:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* The lever leans over toward Read and springs back, once. */
.lever.nudge .lever-stick {
  animation: lever-nudge 1.1s cubic-bezier(0.34, 1.56, 0.64, 1) 350ms 1;
}

@keyframes lever-nudge {
  0%,
  100% {
    rotate: -58deg;
  }
  40% {
    rotate: 36deg;
  }
  70% {
    rotate: -50deg;
  }
}

/* Lights off: the scene goes dark, so the page text flips to light colours
   and the header's glass turns smoked. */
.night .site-head::before {
  border-color: rgb(255 255 255 / 0.08);
  background: rgb(20 22 30 / 0.72);
}

.night .intro:focus-visible {
  outline-color: var(--paper);
}

.night .intro .name {
  color: var(--paper);
}

.night .intro .role,
.night .desk-toys-label {
  color: #9aa1b1;
}

.night .desk-toys button {
  border-color: rgb(255 255 255 / 0.18);
  color: var(--paper);
}

.night .sound,
.night .scroll-cue,
.night .actions-bar {
  border-color: rgb(255 255 255 / 0.14);
  background: rgb(255 255 255 / 0.06);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.08);
  color: var(--paper);
}

.night .bar-thumb {
  background: var(--paper);
}

.night .actions-bar button {
  color: var(--paper);
}

.night .actions-bar button.lit {
  color: var(--ink);
}

.night .actions-bar button:focus-visible {
  outline-color: var(--paper);
}

/* --- Text reveal (src/reveal.js): About, Experience heading, closing CTA --- */

/* Words rise into place one after another. Pixel-font words also start as a
   grid of dots (ELSH 40) and fill in to solid pixels (ELSH 1). */
.reveal .rw {
  display: inline-block;
  opacity: 0;
  translate: 0 0.45em;
}

.reveal .rw.px {
  font-variation-settings: 'ELSH' 40;
}

.reveal .rw-block {
  opacity: 0;
  translate: 0 12px;
}

/* Only the reveal animates; hiding (when the page sets up) is instant, so
   nothing flickers out first. */
.reveal .rw.in {
  opacity: 1;
  translate: none;
  transition:
    opacity 400ms var(--ease-out) var(--d),
    translate 520ms var(--ease-out) var(--d),
    font-variation-settings 700ms var(--ease-out) var(--d);
}

.reveal .rw.px.in {
  font-variation-settings: 'ELSH' 1;
}

/* Logo tiles rise in one by one, row after row, once their caption's in. */
.reveal .rw-tiles .client {
  opacity: 0;
  translate: 0 14px;
  scale: 0.94;
}

.reveal .rw-tiles.in .client {
  opacity: 1;
  translate: none;
  scale: none;
  transition-property: opacity, translate, scale;
  transition-duration: 420ms, 560ms, 560ms;
  transition-timing-function: var(--ease-out);
  transition-delay: calc(var(--d) + var(--r, 0) * 90ms + var(--i, 0) * 45ms);
}

.reveal .rw-block.in {
  opacity: 1;
  translate: none;
  transition: opacity 500ms var(--ease-out) var(--d), translate 600ms var(--ease-out) var(--d);
}

/* --- Brands strip (under About) ------------------------------------------- */

/* Full-bleed rows of logo tiles drifting sideways, alternating directions,
   fading out at the screen edges. Every logo is drawn in the same black
   (whatever its brand colours), so the strip reads as one calm texture. A
   row pauses while you point at it. */
.about {
  overflow-x: clip;
}

.clients {
  grid-column: 1 / -1;
  width: 100vw;
  /* On top of the About grid's own gap, so the brands follow the copy
     closely enough to land in the same view. */
  margin: clamp(8px, 1.5vw, 24px) calc(50% - 50vw) 0;
}

.clients-rows {
  display: grid;
  gap: 14px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}

.clients-row {
  overflow: hidden;
}

/* Two identical halves; sliding by exactly half loops without a seam. The
   tiles space themselves with margin (not gap) so the halves match. */
.clients-track {
  display: flex;
  width: max-content;
  margin: 0;
  padding: 0;
  list-style: none;
  animation: clients-drift var(--dur) linear var(--delay, 0s) infinite;
}

.clients-track.reverse {
  animation-direction: reverse;
}

.clients-row:hover .clients-track,
.clients-row.held .clients-track {
  animation-play-state: paused;
}

@keyframes clients-drift {
  to {
    translate: -50% 0;
  }
}

/* Tiles sit close together, spaced with margin (not gap) so the two halves
   of a track match exactly. */
.client {
  --tile: 212px;
  flex: none;
  width: var(--tile);
  height: 92px;
  margin-right: 14px;
}

.client-face {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgb(255 255 255 / 0.2);
  color: var(--ink);
  text-decoration: none;
  transition: background-color 240ms ease-out, border-color 240ms ease-out, translate 320ms var(--ease-out), box-shadow 320ms var(--ease-out);
}

.client img {
  grid-area: 1 / 1;
  width: auto;
  height: var(--h);
  max-width: 72%;
  object-fit: contain;
  filter: brightness(0);
  opacity: 0.9;
  transition: translate 360ms var(--ease-out), scale 360ms var(--ease-out);
}

/* Hover (or keyboard focus) on a brand with a website: the tile lifts a
   touch, the logo shifts up, and the address rises in beneath it. Nothing
   outside the tile moves. */
.client-url {
  position: absolute;
  inset: auto 0 10px;
  color: var(--muted);
  font: 400 var(--pixel-s) / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  overflow: hidden;
  padding-inline: 10px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  translate: 0 8px;
  transition: opacity 220ms ease-out, translate 320ms var(--ease-out);
}

a.client-face:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* A brand whose site isn't live yet: the same reveal, but nothing to click. */
.client-face.soon {
  cursor: var(--arrow);
}

@media (hover: hover) and (pointer: fine) {
  .client-face.has-label:hover {
    border-color: rgb(29 28 26 / 0.22);
    background: var(--paper);
    box-shadow: 0 10px 24px -16px rgb(29 28 26 / 0.45);
    translate: 0 -3px;
  }

  .client-face.has-label:hover img {
    translate: 0 -10px;
    scale: 0.9;
  }

  .client-face.has-label:hover .client-url {
    opacity: 1;
    translate: none;
  }
}

a.client-face:focus-visible img {
  translate: 0 -10px;
  scale: 0.9;
}

a.client-face:focus-visible .client-url {
  opacity: 1;
  translate: none;
}

/* Subheading above the strip, lined up with the page's left margin. */
.clients-caption {
  margin: 0 0 28px;
  padding-inline: var(--edge);
  color: var(--ink);
  font: 400 var(--h2) / 1.2 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  font-synthesis: none;
}

@media (max-width: 720px) {
  .clients-rows {
    gap: 10px;
  }

  .client {
    --tile: 156px;
    height: 70px;
    margin-right: 10px;
  }

  .client-face {
    border-radius: 12px;
  }
}

/* While the Experience trail still owes its ending (src/trail.js), the page
   ends at the end of the trail: everything below is collapsed, so the
   browser stops the scroll there and nothing can overshoot and spring back. */
/* And no rubber-band bounce at that temporary bottom of the page (macOS
   trackpads stretch the page past its end and spring it back, which is
   what made the section and its heading jump up and down). */
html.trail-gate,
html.trail-gate body {
  overscroll-behavior-y: none;
}

.trail-gate .cta,
.trail-gate .site-foot {
  max-height: 0;
  padding-block: 0;
  overflow: hidden;
  border-top-width: 0;
}

/* --- Closing CTA ----------------------------------------------------------- */

/* Picks up the trail's last stop ("Your team?") as a full statement, so the
   walk ends on an invitation rather than just running out of page. */
.cta {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: end;
  gap: clamp(32px, 6vw, 96px);
  padding: clamp(96px, 10vw, 160px) var(--edge);
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.cta-title {
  max-width: 14ch;
  margin: 0;
  font: 400 var(--h1) / 1.05 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  font-synthesis: none;
  letter-spacing: -0.02em;
}

.cta-copy {
  max-width: 30em;
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin: 0;
}

.cta-call {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px 14px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 400 15px / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  cursor: var(--hand);
  transition: scale 160ms ease-out, background-color 160ms ease-out;
}

.cta-call svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  transition: rotate 300ms var(--ease-out);
}

.cta-call:active {
  scale: 0.97;
}

.cta-call:focus-visible,
.cta-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

.cta-link {
  color: var(--ink);
  font-size: 15px;
  text-underline-offset: 5px;
}

@media (hover: hover) and (pointer: fine) {
  .cta-call:hover {
    background: #000;
  }

  /* The handset gives a little wiggle, like it's ringing. */
  .cta-call:hover svg {
    animation: ringing 500ms ease-in-out;
  }
}

@keyframes ringing {
  20%,
  60% {
    rotate: -14deg;
  }
  40%,
  80% {
    rotate: 14deg;
  }
}

/* --- Footer: src/footer.css (one template, every page) ----------------------- */

@media (max-width: 900px) {
  .cta {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel[open],
  .panel[open]::backdrop {
    animation: none;
  }

  .intro,
  .actions,
  .desk-toys,
  .sound,
  .scroll-cue {
    translate: none;
  }

  .ready .intro,
  .ready .actions,
  .ready .desk-toys,
  .ready .sound,
  .ready .scroll-cue {
    transition-delay: 0ms;
  }

  .bar-thumb {
    transition: none;
  }

  .sound[aria-pressed='true'] .eq i {
    animation: none;
    scale: 1 0.7;
  }

  /* Still, the strip just sits there; rows stay clipped at the edges. */
  .clients-track {
    animation: none;
  }

  .cta-call:hover svg,
  .call-dial:hover svg {
    animation: none;
  }

  .coach-spot::after {
    animation: none;
  }

  .coach-tip {
    translate: none;
  }

  /* The logo card just fades in place, no spring or glide. */
  .exp-pop {
    transition: opacity 160ms ease-out;
  }
}

/* --- Selected work: the billboard showreel ----------------------------------- */

/* A voxel island with one big billboard on its roof, sized so the whole
   section fits one screen once the Work glide lands. The billboard's screen
   is a sharp canvas (the cover) and a text panel laid over the scene
   (src/reel.js). */
.reel {
  padding: var(--top) 0 clamp(72px, 8vw, 120px);
  border-top: 1px solid var(--line);
  background: var(--bg);
}

/* A stage, so it's set on one centre line: title above the island, the
   project controls under it. */
.reel-head {
  padding: 20px var(--edge) 0;
  text-align: center;
}

.reel-title {
  margin: 0;
  font: 400 var(--h1) / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  font-synthesis: none;
  letter-spacing: -0.02em;
}

/* Inside the page margins, like everything else; the scene is framed to
   fit whatever's left of the screen under the title row, with room under
   the arrows so they never sit on the screen's bottom edge. */
.reel-stage {
  position: relative;
  height: clamp(260px, calc(100svh - var(--head-h) - 24px - 156px), 860px);
  margin: 8px var(--edge) 0;
}

#reel-canvas {
  display: block;
  background: none;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* The billboard's screen: dark until the power comes on, then the ad. */
.reel-screen {
  position: absolute;
  display: block;
  overflow: hidden;
  background: #151518;
  color: #f7f5f0;
  text-decoration: none;
  cursor: var(--hand, pointer);
  touch-action: pan-y;
  container-type: size;
}

.reel-picture {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: scaleY(0.02);
  filter: brightness(3);
}

/* Switching on like an old CRT: a bright line that opens into the picture. */
.reel-screen.on .reel-picture {
  opacity: 1;
  transform: none;
  filter: none;
  transition: transform 320ms cubic-bezier(0.2, 0.9, 0.3, 1), filter 520ms ease-out, opacity 60ms linear;
}

/* The ad's text side: the project's name, big, and one quiet line under
   it. Sized to the screen (container units), so it scales with the board. */
.reel-panel {
  position: absolute;
  inset: 0 0 0 var(--cover, 64%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8cqh 7cqh;
  opacity: 0;
  transition: opacity 160ms ease-out;
}

.reel-screen.on .reel-panel {
  opacity: 1;
  transition-delay: 300ms;
}

.reel-screen.on .reel-panel.swap {
  opacity: 0;
  transition-delay: 0s;
}

.reel-name {
  font: 400 max(14px, 15cqh) / 1 var(--pixel);
  font-variation-settings: 'ELSH' 1;
  font-synthesis: none;
  text-wrap: balance;
}

.reel-meta {
  margin-top: 6cqh;
  color: #b9b3a8;
  font: max(10px, 6.5cqh) / 1.35 var(--sans);
}

/* Lit by the lamps on the hood: warm light falling from the top edge, the
   corners a touch darker, and a glow spilling out round the board. */
.reel-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  /* A pool under each of the three floodlights (at 17%, 50% and 83%). */
  background:
    radial-gradient(22% 55% at 17% 0, rgb(255 226 180 / 0.3), transparent),
    radial-gradient(22% 55% at 50% 0, rgb(255 226 180 / 0.3), transparent),
    radial-gradient(22% 55% at 83% 0, rgb(255 226 180 / 0.3), transparent);
  box-shadow: inset 0 0 6cqh rgb(0 0 0 / 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease-out;
}

.reel-screen.on {
  /* Tight, so it reads as light off the screen without banding into rings. */
  box-shadow: 0 0 2.5cqh 0.5cqh rgb(255 200 130 / 0.4);
  transition: box-shadow 600ms ease-out;
}

.reel-screen.on::after {
  opacity: 1;
}

.reel-screen:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 4px;
}

/* "Show all work": the words on the voxel signboard, laid exactly over its
   face (src/reel.js sets the box and the type size). */
.reel-all {
  position: absolute;
  display: grid;
  place-items: center;
  color: #fff4e6;
  font-family: var(--pixel);
  font-variation-settings: 'ELSH' 1;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}

.reel-all:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.reel-all:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

/* Arrows either side of one tick per project; the current tick fills up
   while it's on screen. */
.reel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
}

.reel-ticks {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.reel-tick {
  display: block;
  padding: 10px 0;
  border: 0;
  background: none;
  cursor: var(--hand, pointer);
}

.reel-tick span {
  display: block;
  width: 28px;
  height: 4px;
  background: linear-gradient(90deg, var(--ink) calc(var(--fill, 0) * 100%), var(--line) 0);
}

.reel-tick:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .reel-stage {
    height: clamp(260px, 44svh, 420px);
    margin: 8px 0 0;
  }

  .reel-tick span {
    width: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reel-screen.on .reel-picture,
  .reel-panel {
    transition: none;
  }
}

/* Home only: the sound toggle lives in the bottom-right corner of the screen,
   out of the header; the scroll cue moves left to make room for it. */
.site-head .sound {
  position: fixed;
  right: var(--edge);
  bottom: var(--top);
  z-index: 30;
}

.scroll-cue {
  right: calc(var(--edge) + 150px);
}

/* When the nav drops to the bottom (800px and below), sound goes back to
   the top right, opposite the name, so the two never collide. */
@media (max-width: 800px) {
  .site-head .sound {
    position: static;
    bottom: auto;
    right: auto;
  }
}

/* Home: the Contact button sits top right like the other pages; it fades in
   with the rest of the header. On narrow screens the sound toggle joins it. */
.head-cta {
  border: 0;
  font-family: inherit;
  opacity: 0;
  translate: 0 8px;
  transition: opacity 500ms var(--ease-out), translate 500ms var(--ease-out), color 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.ready .head-cta,
.head-only:not(.ready) .head-cta {
  opacity: 1;
  translate: 0 0;
  transition-delay: 2100ms, 2100ms, 0ms;
}

@media (max-width: 800px) {
  .site-head:has(.head-cta) {
    grid-template-columns: 1fr auto auto;
  }
}

@media (max-width: 600px) {
  .site-head:has(.head-cta) { column-gap: 8px; }
  .site-head:has(.head-cta) .intro .name { white-space: nowrap; }
  .site-head .head-cta { height: 40px; padding-left: 14px; gap: 8px; font-size: 14px; }
  .site-head .head-cta-arrow { width: 30px; height: 30px; }
  .site-head:has(.head-cta) .sound { width: 40px; height: 40px; }
}
