:root {
  --font: "SF Pro Display", "SF Display", -apple-system, BlinkMacSystemFont, sans-serif;
  --ink: #171717;
  --black: #000;
  --muted: #8a8a8a;
  --soft: #6e6e73;
  --line: #e9e9e9;
  --line-soft: #ececec;
  --hover: #f5f5f5;
  --surface: #fff;
  --panel: #f9f9f9;
  --pink: #ffabdc;
  --lime: #c9f71b;
  --radius-xl: 48px;
  --gutter: 48px;
  --gap: 48px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow-x: clip;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  cursor: pointer;
}

h1,
h2,
h3,
p,
figure,
ul,
dl,
dd {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

img,
video {
  display: block;
}

:focus-visible {
  outline: 2px solid #3a7bd5;
  outline-offset: 2px;
}

/* Loading screen */
html.is-loading {
  overflow: hidden;
}

.loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--surface);
}

.loader__waves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.loader__glide {
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  opacity: 0;
}

.loader.is-in .loader__glide {
  animation: loader-in 0.5s var(--ease) both;
}

/* The record: grooves, a smooth band around the label and the photo as the label. */
.loader__disc {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle closest-side, #111 0 42%, transparent 42.5% 96%, #0b0b0b 96.5%),
    repeating-radial-gradient(circle, #101010 0 1px, #1e1e1e 1px 3px);
}

.loader.is-in .loader__disc {
  animation: loader-spin 1.8s linear infinite;
}

.loader__photo {
  width: 40%;
  height: 40%;
  border-radius: 50%;
  object-fit: cover;
}

/* Light stays where it is while the record turns under it. */
.loader__sheen {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 25deg,
    transparent 0 4%,
    rgba(255, 255, 255, 0.16) 10%,
    transparent 17% 50%,
    transparent 54%,
    rgba(255, 255, 255, 0.16) 60%,
    transparent 67%
  );
  -webkit-mask: radial-gradient(circle closest-side, transparent 41%, #000 42%);
  mask: radial-gradient(circle closest-side, transparent 41%, #000 42%);
}

@keyframes loader-in {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader.is-in .loader__glide {
    animation: none;
    opacity: 1;
  }

  .loader.is-in .loader__disc {
    animation: none;
  }
}

/* Navigation */
.nav {
  display: grid;
  grid-template-columns: minmax(max-content, 1fr) minmax(0, 300px) minmax(max-content, 1fr);
  align-items: center;
  gap: 16px;
  height: 112px;
  padding: 36px 96px;
  position: relative;
  z-index: 20;
}

.nav-left {
  display: flex;
}

.nav-right {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

.nav-now {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  color: var(--black);
  font-weight: 500;
  white-space: nowrap;
}

.nav-now__logo,
.nav-now__arrow {
  flex: none;
}

.nav-now__arrow {
  transition: transform 0.15s ease;
}

.nav-now:hover .nav-now__arrow,
.nav-now:focus-visible .nav-now__arrow {
  transform: translate(2px, -2px);
}

.nav-now__bars {
  display: flex;
  flex: none;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  color: var(--soft);
}

.nav-now__bars i {
  width: 3px;
  height: 100%;
  border-radius: 1px;
  background: currentColor;
  transform-origin: bottom;
  animation: nav-now-bar 0.9s ease-in-out infinite alternate;
}

.nav-now__bars i:nth-child(2) {
  animation-duration: 0.6s;
  animation-delay: -0.3s;
}

.nav-now__bars i:nth-child(3) {
  animation-duration: 0.75s;
  animation-delay: -0.5s;
}

@keyframes nav-now-bar {
  from {
    transform: scaleY(0.3);
  }

  to {
    transform: scaleY(1);
  }
}

/* Older WebKit (iPad) can drop a moving line inside a mask: the prefixed mask and a layer of its
   own for the mask and the line keep it drawn. */
.nav-now__text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 20px), transparent);
  transform: translateZ(0);
}

.nav-now__run {
  display: inline-flex;
  animation: nav-now-run 95s linear infinite;
  will-change: transform;
}

.nav-now__run b {
  padding-inline: 14px;
  color: var(--soft);
  font-weight: 500;
}

@keyframes nav-now-run {
  to {
    transform: translateX(-50%);
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px 2px;
  border: 1px solid var(--line-soft);
  border-radius: 48px;
  color: var(--black);
  font-weight: 500;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.72);
  transition: background-color 0.15s ease;
}

.pill:hover,
.pill[aria-current="page"],
.pill[aria-expanded="true"],
.pill.is-current {
  background: var(--hover);
}

.pill svg {
  transition: transform 0.2s ease;
}

.pill[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.dropdown {
  position: relative;
}

.menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  width: 232px;
  padding: 4px;
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.03);
  transform: translateX(-50%);
  animation: menu-in 0.16s ease-out;
}

.menu[hidden] {
  display: none;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-4px) scale(0.98);
  }
}

.menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 8px 10px;
  border-radius: 12px;
  color: rgba(0, 0, 0, 0.9);
  font-weight: 500;
}

.menu a[href]:hover,
.menu a[href]:focus-visible {
  background: var(--hover);
}

.menu--contacts {
  width: 188px;
}

.menu--contacts svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-inline: 3px;
}

.icon {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  object-fit: contain;
}

.icon--folderr {
  background: #2883df url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='1.3' stroke-linejoin='round'%3E%3Cpath d='M2.8 5A1.2 1.2 0 0 1 4 3.8h2.3l1.2 1.4H12A1.2 1.2 0 0 1 13.2 6.4v5A1.2 1.2 0 0 1 12 12.6H4A1.2 1.2 0 0 1 2.8 11.4z'/%3E%3C/svg%3E") center / 72% no-repeat;
}

.icon--lab {
  background: conic-gradient(from 210deg, #ff4fbf, #8a5cf5, #2fd4ff, #ff4a18, #ff4fbf);
}

/* Page grid */
#app {
  padding-bottom: 48px;
}

.page {
  width: calc(100% - 2 * var(--gutter));
  max-width: 1440px;
  margin-inline: auto;
}

.intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding-block: 24px 72px;
  text-align: center;
}

.intro-face {
  position: relative;
  width: 272px;
  touch-action: pan-y; /* A finger rubbing sideways tickles the beard, swiping up and down still scrolls. */
}

/* What he sneezes out flies over the whole page. */
.face-air {
  position: fixed;
  inset: 0;
  z-index: 50;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.intro-face__head {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 50% 85%;
}

/* The fist comes from below and stops at the text, fading out before it. */
.intro-face__stage {
  position: absolute;
  inset: 0 -140px -40px;
  overflow: hidden;
  pointer-events: none;
  mask-image: linear-gradient(#000 calc(100% - 44px), transparent);
}

.intro-face__hand,
.intro-face__finger {
  position: absolute;
  margin-left: 140px;
  height: auto;
  transform-origin: 20% 90%;
}

.intro-face__hand[hidden],
.intro-face__finger[hidden] {
  display: none;
}

.intro h1 {
  position: relative;
  max-width: 820px;
  margin: 0;
  font-size: 36px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* The intro and, on the first visit, the question over it share one cell: the block keeps the
   intro's height, so answering swaps the text without moving the page. */
.intro-text {
  display: grid;
  justify-items: center;
}

.intro-text > * {
  grid-area: 1 / 1;
}

/* No fade: the intro cuts in the moment the portrait finishes its turn. */
.intro-text.is-asking h1 {
  opacity: 0;
  pointer-events: none;
}

/* Above the hidden intro: the h1 is positioned, so without this it would take the clicks. */
.intro-ask {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.intro-ask__question {
  font-size: 36px;
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.intro-ask__answers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

/* Gone once answered, but keeping their room, so the reply stays where the question was. */
.intro-ask.is-answered .intro-ask__answers {
  visibility: hidden;
}

.intro-ask__answer {
  height: 44px;
  font-size: 17px;
  transition: background-color 0.15s ease, transform 0.15s var(--ease);
}

/* The primary one: the site's pill, filled with ink. */
.intro-ask__answer--primary {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.intro-ask__answer--primary:hover {
  background: #3a3a3a;
}

.intro-ask__answer:active {
  transform: scale(0.96);
}

.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
}

.triple {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: var(--gap);
}

.duo {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: var(--gap);
  margin-top: var(--gap);
}

/* Three columns like .triple, so the edges line up with the row above. */
.duo--flip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Badges with real physics: see mountBadges. */
.badges {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  touch-action: none;
  user-select: none;
}

/* On the home page it is a demo to watch: a click opens the project window. */
.badges--demo {
  cursor: pointer;
}

.badges--demo .badge {
  cursor: pointer;
  pointer-events: none;
}

.badge {
  position: absolute;
  left: 0;
  top: 0;
  cursor: grab;
  -webkit-user-drag: none;
  will-change: transform;
}

.badges.is-dragging,
.badges.is-dragging .badge {
  cursor: grabbing;
}

.recent {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  container-type: inline-size;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
}

.recent-title {
  margin: 0;
  padding-top: 17cqw;
  text-align: center;
  font-size: 6.4cqw;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #171717;
}

/* A revolver cylinder seen from the front, as on the Habi welcome screen: the cards turn around
   a pivot far below, so the neighbours lean outward at the top and sit a little lower. */
.trainer-strip {
  position: absolute;
  inset: 0;
}

.trainer-card {
  position: absolute;
  left: 50%;
  bottom: 7cqw;
  width: 40cqw;
  margin-left: -20cqw;
  aspect-ratio: 280 / 360;
  object-fit: cover;
  border-radius: 6.5cqw;
  transform-origin: 50% calc(100% + 616cqw);
  transform: rotate(calc(var(--pos, 0) * 4deg));
  transition: transform 0.6s cubic-bezier(0.6, 0, 0.15, 1.1);
}

@media (prefers-reduced-motion: reduce) {
  .trainer-card {
    transition: none;
  }
}

/* The project window, for small projects. */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(9, 9, 9, 0.26);
  opacity: 0;
  transition: opacity 0.24s ease;
}

.modal.is-open {
  opacity: 1;
}

.modal-card {
  position: relative;
  box-sizing: border-box;
  width: min(73vw, 1170px, calc((100vh - 190px) * 1.778 + 50px));
  padding: 28px 24px 32px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 48px;
  box-shadow: 0 35px 60px rgba(0, 0, 0, 0.12), 0 8px 20px rgba(0, 0, 0, 0.08);
  transform: scale(0.96);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Almost square, for work that is square itself. */
.modal-card--square {
  width: min(690px, calc(100vw - 32px), calc((100vh - 72px) * 1.06));
}

.modal-card--square .modal-media {
  aspect-ratio: 1.25;
}

.modal-card:focus {
  outline: none;
}

.modal.is-open .modal-card {
  transform: none;
}

.modal-media {
  position: relative;
  aspect-ratio: 900 / 506;
  overflow: hidden;
  border-radius: 24px;
  background: var(--hover);
}

.modal-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* The deck video is taller than the window: it fills it, and only empty white is cut off. */
.modal-video--deck {
  object-fit: cover;
  background: #fff;
}

/* The one exception (Mira's film): a true square window, so the whole film shows, nothing cut.
   The window is narrowed to fit the screen's height together with the title and text under it. */
.modal-card--square:has(.modal-media--film) {
  width: min(690px, calc(100vw - 32px), calc(100vh - 190px));
}

.modal-card--square .modal-media--film {
  aspect-ratio: 1;
}

/* The trainer carousel in the project window: a square in the middle, side cards clipped by the window. */
.modal-media--recent {
  background: var(--surface);
}

.recent--modal {
  height: 100%;
  margin: 0 auto;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
}

/* A phone tile in the project window. The phone sizes itself in cqw of its container, so it sits in a
   square box whose 43cqw is a third of the window's width: the same phone as on the card, larger. */
.modal-media--phone {
  display: grid;
  place-items: center;
  background: var(--hover);
  container-type: inline-size;
}

.modal-phone {
  display: grid;
  place-items: center;
  width: 74.4cqw;
  aspect-ratio: 1;
  container-type: inline-size;
}

/* A Mac window recording in the project window: the same dark margin as on its home card. */
.modal-media--window {
  background: #222;
}

.modal-media--window .modal-video {
  inset: 14px;
  width: calc(100% - 28px);
  height: calc(100% - 28px);
}

.modal-media.badges {
  border: 0;
  background: var(--hover);
}

.modal-text {
  padding: 24px 16px 0;
}

.modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.4;
  color: rgba(0, 0, 0, 0.85);
}

.modal-description {
  margin: 7px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.6);
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  color: #000;
  background: rgba(255, 255, 255, 0.95);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.modal-close:hover {
  background: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}

@media (max-width: 1100px) {
  .modal-card:not(.modal-card--square) {
    width: calc(100vw - 32px);
    border-radius: 32px;
    padding: 16px 16px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal,
  .modal-card {
    transition: none;
  }
}

.reveal {
  opacity: 0;
  transform: scale(0.96) translateY(14px);
  transition: opacity 0.7s ease, transform 0.8s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* Clock on a wallpaper */
.clock {
  position: relative;
  overflow: hidden;
  background: var(--art, #222);
}

.clock-wall,
.clock-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.clock-plates {
  position: absolute;
  inset: 0;
}

.clock-plates i {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.34);
  -webkit-backdrop-filter: blur(9px) saturate(1.2);
  backdrop-filter: blur(9px) saturate(1.2);
}

/* Habi: equipment */
/* Habi loader: three pills get their checks one by one (sizes are the app's × 1.3). */
.match {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  height: 100%;
  color: #000;
}

.match-pills {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.match-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  width: 156px;
  height: 44px;
  padding: 0 15px 0 8px;
  background: #f2f2f2;
  border-radius: 13px;
  opacity: 0;
  transform: translateY(13px);
  transition: opacity 0.26s ease, transform 0.26s ease;
}

.match-pill i {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dfdfdf;
}

.match-check {
  width: 26px;
  height: 26px;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.match-pill.is-in {
  opacity: 1;
  transform: none;
}

.match-pill.is-checked .match-check {
  opacity: 1;
}

.match-pill.is-out {
  opacity: 0;
  transform: none;
  transition-duration: 0.3s;
}

.match-title {
  font-size: 26px;
  line-height: 34px;
  font-weight: 700;
  letter-spacing: -0.4px;
  text-align: center;
}

.eq {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  padding: 20px;
  color: #000;
}

.eq-title {
  font-size: 17px;
  line-height: 22px;
  font-weight: 600;
  text-align: center;
}

.eq-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 8px;
}

.eq-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: 0;
  padding: 0 0 7px;
  overflow: hidden;
  background: #f2f2f2;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px transparent;
  font-size: 12px;
  line-height: 16px;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.3s var(--ease);
}

.eq-card img {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: cover;
  object-position: 50% 60%;
  mix-blend-mode: multiply;
}

.eq-card span {
  flex: none;
  margin-top: 2px;
}

.eq-card:hover {
  transform: scale(1.03);
}

.eq-card.is-on {
  background: #fff;
  box-shadow: inset 0 0 0 1.5px #000;
}

.eq-go {
  flex: none;
  height: 46px;
  border-radius: 23px;
  font-weight: 500;
  background: var(--lime);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.eq-go:disabled {
  color: #9d9d9d;
  background: #f2f2f2;
  cursor: default;
}

/* Habi: collectible card */
.puzzle {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: 20px;
  color: #fff;
  text-align: center;
  background: linear-gradient(180deg, #1d2e12, #070a04);
}

.puzzle-kicker {
  font-size: 12px;
  line-height: 16px;
  color: rgba(255, 255, 255, 0.72);
}

.puzzle-title {
  margin-top: 2px;
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
}

.puzzle-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  aspect-ratio: 1796 / 1586;
  max-width: 100%;
  margin-block: 12px;
  transition: gap 0.45s var(--ease), filter 0.45s ease;
}

.puzzle-grid.is-done {
  gap: 0;
  filter: drop-shadow(0 0 24px rgba(201, 247, 27, 0.45));
}

.puzzle-cell {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background-color: #2c2c2c;
}

.puzzle-cell:not(.is-open) {
  background-image: none;
  background-color: rgba(255, 255, 255, 0.1);
}

.puzzle-cell.is-open {
  background-image: url("/assets/habi/card-art.webp");
  animation: cell-open 0.5s var(--ease);
}

@keyframes cell-open {
  from {
    transform: scale(0.8) rotateY(70deg);
    opacity: 0;
  }
}

.puzzle-grid.is-done .puzzle-cell {
  border-radius: 0;
}

.puzzle-go {
  flex: none;
  width: 100%;
  height: 46px;
  color: #000;
  font-weight: 500;
  background: #fff;
  border-radius: 23px;
}

/* Home: cards with a phone */
.phone-card {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  aspect-ratio: 588 / 682;
  container-type: inline-size;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
}

.phone-stub {
  width: 43cqw;
  aspect-ratio: 395 / 835;
  padding: 1.25cqw;
  background: #232325;
  border-radius: 7.6cqw;
  box-shadow: 0 2.4cqw 5cqw rgba(0, 0, 0, 0.12);
  transform: scale(var(--lift, 1));
  transition: transform 0.5s var(--ease);
}

/* The hand from the WallClocks onboarding, on the same scale as the phone: its
   plug lines up with the phone's port. Multiply melts the clip's white into the card. */
.phone-hand {
  position: absolute;
  top: 103.35cqw;
  left: 2.67cqw; /* the cable, 361 px into the 720 px clip, on the phone's center */
  width: 94.4cqw;
  max-width: none;
  pointer-events: none;
  filter: brightness(1.05);
  mix-blend-mode: multiply;
  transform: scale(var(--lift, 1));
  transform-origin: 47.33cqw -45.35cqw;
  transition: transform 0.5s var(--ease);
}

.phone-card:hover {
  --lift: 1.04;
}


.phone-card--small {
  aspect-ratio: 582 / 715;
}

.phone-card--square {
  aspect-ratio: 1;
}

/* Takes its height from the square beside it. */
.phone-card--wide {
  grid-column: span 2;
  aspect-ratio: auto;
}

.phone-card--square .phone-stub {
  width: 38cqw;
}

/* A phone in a small card (Habi, Mira, WallClocks): the card is taller than a square, so the phone can be wider. */
.phone-card--small-phone .phone-stub {
  width: 44cqw;
}

/* A browser window, whole, in the middle of the card. */
.browser-shot {
  width: 64cqw;
  overflow: hidden;
  border: 0.6cqw solid #000;
  border-radius: 2.6cqw;
  box-shadow: 0 1.6cqw 3.6cqw rgba(0, 0, 0, 0.14);
  transform: scale(var(--lift, 1));
  transition: transform 0.5s var(--ease);
}

.browser-shot img {
  display: block;
  width: 100%;
  height: auto;
}

.phone-card--full {
  border: 0;
}

.phone-card--opens {
  cursor: pointer;
}

/* A video on the page's white keeps the outline of the empty cells. */
.phone-card--framed {
  border: 1px solid var(--line);
}

.phone-card--full video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* The Mac recordings are cropped close to the window's edge, so the video sits inside a margin
   of the window's own dark gray: the rounded corners cut only that margin. */
.frame-stub {
  box-sizing: border-box;
  width: 82.4cqw;
  aspect-ratio: 480 / 270;
  padding: 1.8cqw;
  background: #222;
  overflow: hidden;
  border-radius: 4.4cqw;
  box-shadow: 0 2.4cqw 5cqw rgba(0, 0, 0, 0.12);
  transition: transform 0.5s var(--ease);
}

.frame-stub video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* The whole card: the video holds the deck, its shadows and the flights to the edges. */
.deck-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.phone-card:hover .frame-stub,
.phone-card:hover .deck-video {
  transform: scale(1.04);
}

.phone-card-label {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  left: 50%;
  bottom: 14px;
  padding: 8px 18px;
  color: rgba(0, 0, 0, 0.6);
  line-height: 19px;
  white-space: nowrap;
  background: #fff;
  border-radius: 100px;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s ease, transform 0.4s var(--ease);
}

/* It sits on the edge of the dark window, half on it. */
.phone-card--wide .phone-card-label {
  color: rgba(0, 0, 0, 0.7);
}

.phone-card:hover .phone-card-label,
.badges:hover > .phone-card-label,
.recent:hover > .phone-card-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.phone-stub-screen {
  height: 100%;
  overflow: hidden;
  background: var(--hover);
  border-radius: 6.35cqw;
}

.phone-stub-screen img,
.phone-stub-screen video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Long pages */
.panel {
  position: relative;
  height: 640px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--art, #fff9e8);
}

.panel--photos {
  container-type: size;
  height: 520px;
  overflow: visible;
  background: none;
  border-radius: 0;
}

/* The page is one centered column of text. */
.about-column {
  width: min(100%, 675px);
  margin: 24px auto 0;
}

/* Text size from danield.design case studies: 20 on 32. */
.about-story h2,
.about-story p {
  margin: 0;
  font-size: 20px;
  line-height: 32px;
  font-weight: 400;
  color: #333;
}

.about-story h2 {
  font-weight: 500;
  color: var(--black);
}

.about-story h2:not(:first-child) {
  margin-top: 48px;
}

.about-story h2 + p {
  margin-top: 8px;
}

.about-story p + p {
  margin-top: 16px;
}

/* The photos pop up one by one as a pile, as in the reference, then spread out into a row.
   The text below is always there. Each card has a place in the pile and one in the row. */
.about-stack {
  --u: min(1cqh, 0.62cqw);
  position: absolute;
  left: 50%;
  top: 48%;
}

.about-stack-card {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  margin: calc(var(--h) * var(--u) / -2) 0 0 calc(var(--w) * var(--u) / -2);
  object-fit: cover;
  border-radius: calc(4 * var(--u));
  box-shadow: 0 calc(5 * var(--u)) calc(11 * var(--u)) rgba(0, 0, 0, 0.2);
  opacity: 0;
  translate: calc(var(--x) * var(--u)) calc(var(--y) * var(--u));
  rotate: var(--r);
}

/* In the pile, from the back to the front. */
.about-stack-card--1 { --x: 26; --y: -15; --w: 30; --h: 38; --r: 11deg; }
.about-stack-card--2 { --x: -34; --y: -2; --w: 34; --h: 42; --r: -13deg; }
.about-stack-card--3 { --x: -24; --y: 20; --w: 32; --h: 40; --r: -5deg; }
.about-stack-card--4 { --x: -3; --y: -6; --w: 50; --h: 58; --r: 3deg; }
.about-stack-card--5 { --x: 32; --y: 13; --w: 36; --h: 44; --r: -4deg; }

/* In the row, from left to right. */
.about-stack.is-in .about-stack-card--row1 { --x: -80; --y: 2; --r: -6deg; }
.about-stack.is-in .about-stack-card--row2 { --x: -42; --y: -3; --r: 4deg; }
.about-stack.is-in .about-stack-card--row3 { --x: 0; --y: 0; --r: -2deg; }
.about-stack.is-in .about-stack-card--row4 { --x: 42; --y: 3; --r: 5deg; }
.about-stack.is-in .about-stack-card--row5 { --x: 80; --y: -2; --r: -5deg; }

.about-stack.is-in .about-stack-card {
  animation: about-card-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition:
    translate 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 1.6s,
    rotate 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 1.6s;
}

/* The pile is set before the class arrives; only the row is reached by moving. */
.about-stack:not(.is-in) .about-stack-card {
  transition: none;
}

.about-stack.is-in .about-stack-card--2 { animation-delay: 0.22s; }
.about-stack.is-in .about-stack-card--3 { animation-delay: 0.44s; }
.about-stack.is-in .about-stack-card--4 { animation-delay: 0.66s; }
.about-stack.is-in .about-stack-card--5 { animation-delay: 0.88s; }

@keyframes about-card-in {
  0% {
    opacity: 0;
    transform: translate(calc(5 * var(--u)), calc(6 * var(--u))) rotate(9deg) scale(0.62);
  }
  28% {
    opacity: 1;
  }
  62% {
    opacity: 1;
    transform: rotate(-1deg) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .about-stack-card {
    opacity: 1;
  }

  .about-stack.is-in .about-stack-card {
    animation: none;
    transition: none;
  }
}

.archive {
  margin-top: 96px;
}

.archive h2 {
  margin: 0;
  font-size: 20px;
  line-height: 32px;
  font-weight: 500;
  color: var(--black);
}

.archive-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.archive-list li + li {
  border-top: 1px solid var(--line);
}

.archive-row {
  display: grid;
  grid-template-columns: minmax(0, 26%) minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 24px;
  min-height: 58px;
  padding-block: 12px;
  font-size: 17px;
  line-height: 24px;
  color: var(--soft);
  transition: color 0.15s ease;
}

.archive-row span:first-child {
  color: var(--black);
  transition: color 0.15s ease;
}

.archive-row span:last-child {
  text-align: right;
  white-space: nowrap;
}

a.archive-row:hover,
a.archive-row:hover span:first-child {
  color: #a3a3a3;
}

/* Case study */
.case-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 140px 0 160px;
  text-align: center;
}

.case-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* A logo drawn to the edge of its file: rounding would cut its corners. */
.icon.icon--flat {
  border-radius: 0;
  box-shadow: none;
}

.case-head h1 {
  font-size: 20px;
  line-height: 24px;
  font-weight: 500;
  color: var(--black);
}

.case-head p {
  font-size: 20px;
  line-height: 30px;
  color: var(--soft);
}

.case-head small {
  margin-top: 10px;
  font-size: 14px;
  color: var(--muted);
}

.case-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.case-media,
.case-row,
.case-stats,
.case-panel {
  width: min(880px, 100%);
}

.case-media img,
.case-media video {
  width: 100%;
  height: auto;
  border-radius: 32px;
  background: var(--panel);
}

/* A phone recording sits small on a gray panel instead of filling the column. */
.case-media--phone {
  display: flex;
  justify-content: center;
  padding: 64px 0;
  border-radius: 32px;
  background: var(--panel);
}

.case-media--phone video {
  width: min(340px, 70%);
  border-radius: 40px;
}

.case-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.case-row .case-media {
  width: 100%;
}

.case-row img {
  height: 100%;
  object-fit: cover;
}

.case-text {
  width: min(675px, 100%);
  padding: 72px 0;
  font-size: 20px;
  line-height: 32px;
  color: var(--black);
}

.case-text + .case-text {
  margin-top: -104px;
}

/* Case layout after danield.design: pairs of grey panels with a phone, wide copy breaks between them. */
.case-copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: min(675px, 100%);
  margin: 224px 0;
  font-size: 20px;
  line-height: 32px;
  color: #333;
  text-align: center;
}

.case-shots {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  width: min(880px, 100%);
}

/* A horizontal screen on the same gray panel as the phones: interview footage, Miro boards. */
.case-landscape {
  box-sizing: border-box;
  width: min(880px, 100%);
  padding: 56px;
  background: var(--panel);
  border-radius: 48px;
}

.case-landscape-screen {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--hover);
  border-radius: 20px;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.12);
}

.case-landscape-screen img,
.case-landscape-screen video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* With a recording inside, the screen takes the recording's own proportions instead of cropping it. */
.case-landscape-screen.has-media {
  aspect-ratio: auto;
}

.case-landscape-screen.has-media img,
.case-landscape-screen.has-media video {
  height: auto;
}

@media (max-width: 720px) {
  .case-landscape {
    padding: 20px;
    border-radius: 28px;
  }

  .case-landscape-screen {
    border-radius: 12px;
  }
}

/* The interview carousel as one video; the gray panel and the drifting clips are baked in. */
.case-strip {
  width: min(880px, 100%);
  overflow: hidden;
  background: var(--panel);
  border-radius: 48px;
}

.case-strip video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1760 / 520;
}

@media (max-width: 720px) {
  .case-strip {
    border-radius: 28px;
  }
}

.case-shots-wide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(880px, 100%);
  padding: 32px;
  background: var(--panel);
  border-radius: 48px;
}

/* The phone keeps the home cards' proportions, measured here against its panel (424 px wide, phone 296). */
.case-shot {
  display: grid;
  place-items: center;
  aspect-ratio: 424 / 773;
  background: var(--panel);
  border-radius: 48px;
  container-type: inline-size;
}

.case-shots-wide .case-shot {
  aspect-ratio: 408 / 701;
  background: none;
  border-radius: 0;
}

.case-shot .phone-stub {
  width: 69.8cqw;
  padding: 2.02cqw;
  border-radius: 12.3cqw;
  box-shadow: 0 3.9cqw 8.1cqw rgba(0, 0, 0, 0.12);
}

/* One panel across both columns, as tall as a pair's panels. The phone sits in a column as wide as
   one of a pair's panels, so every size measured from that column matches the pairs exactly. */
.case-shots--single {
  grid-template-columns: minmax(0, 1fr);
}

.case-shots--single .case-shot {
  aspect-ratio: auto;
  container-type: normal;
}

/* A photo as wide as the panels, with their rounded corners. */
.case-photo {
  width: min(880px, 100%);
  margin: 0;
  overflow: hidden;
  border-radius: 48px;
}

.case-photo img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 768px) {
  .case-photo {
    border-radius: 32px;
  }
}

/* Three phones on one panel: the panel keeps a pair's height, the phones are a little smaller than in a pair. */
.case-trio .case-shot {
  aspect-ratio: 880 / 773;
}

.case-trio__row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 5%;
  align-items: center;
  width: 82%;
}

.case-trio__cell {
  display: grid;
  place-items: center;
  container-type: inline-size;
}

/* Same phone as in a pair, measured against its own cell instead of the panel. */
.case-trio__cell .phone-stub {
  width: 100cqw;
  padding: 2.9cqw;
  border-radius: 17.6cqw;
  box-shadow: 0 5.6cqw 11.6cqw rgba(0, 0, 0, 0.12);
}

.case-trio__cell .phone-stub-screen {
  border-radius: 14.75cqw;
}

.case-shot__col {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 424 / 773;
  container-type: inline-size;
}

@media (min-width: 769px) {
  .case-shot__col {
    width: calc(50% - 16px);
  }
}

/* Live wallpapers: a tall tile across two rows on the left, two squares on the right. */
.case-walls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  width: min(880px, 100%);
}

.case-wall {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 48px;
  background: var(--art, var(--panel));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.12);
}

.case-wall--tall {
  grid-row: span 2;
  aspect-ratio: auto;
}

.case-wall canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@media (max-width: 768px) {
  .case-walls {
    gap: 16px;
  }

  .case-wall {
    border-radius: 32px;
  }
}

/* Badges laid out in the phone's footprint: same width and height, three to a row. */
.case-badges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-content: space-between;
  justify-items: center;
  width: 69.8cqw;
  aspect-ratio: 395 / 835;
}

.case-badges img {
  width: 88%;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 1.5cqw 2.5cqw rgba(0, 0, 0, 0.12));
}

/* A screenshot across the whole panel, cropped to its rounded corners. */
.case-fill {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.case-fill img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The deck video has a white ground: multiply turns it into the panel's gray. */
.case-deck {
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.case-shot .phone-stub-screen {
  border-radius: 10.3cqw;
}

.case-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: 40px;
}

.case-stats div {
  display: flex;
  flex-direction: column-reverse;
  gap: 6px;
  padding: 40px 32px;
  background: var(--panel);
  border-radius: 32px;
}

.case-stats dd {
  font-size: clamp(40px, 4.4vw, 60px);
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--black);
}

.case-stats dt {
  font-size: 16px;
  color: var(--soft);
}

.case-phones {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 32px;
  width: min(1040px, 100%);
  padding: 72px 32px;
  background: var(--panel);
  border-radius: 48px;
}

.device {
  position: relative;
  flex: 0 1 280px;
  min-width: 200px;
  padding: 8px;
  background: #111;
  border-radius: 44px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.18);
}

.device img {
  width: 100%;
  height: auto;
  border-radius: 36px;
}

.device-island {
  position: absolute;
  top: 18px;
  left: 50%;
  width: 28%;
  height: 22px;
  background: #000;
  border-radius: 12px;
  transform: translateX(-50%);
}

.case-panel {
  display: flex;
  justify-content: center;
  padding: 72px 32px;
  background: var(--panel);
  border-radius: 48px;
}

.part-card {
  width: min(420px, 100%);
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface);
  border-radius: 40px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.1);
}

/* Clock faces stacked in a gray block, as danield.design shows its widgets. */
.case-faces {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 68%;
  justify-content: center;
  gap: 36px;
  width: min(880px, 100%);
  padding: 64px 0;
  background: var(--panel);
  border-radius: 48px;
}

.face-card {
  aspect-ratio: 2.17;
  border-radius: 28px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.14);
}

.case-wide {
  width: 100%;
}

/* Glass app icon: three layers at different depths. A click knocks it and turns it black. */
.case-icon--glass {
  box-shadow: none;
  border-radius: 0;
}

.glass-stage {
  perspective: 300px;
}

.glass-icon {
  --icon: 64px;
  position: relative;
  width: var(--icon);
  height: var(--icon);
  cursor: pointer;
  transform-style: preserve-3d;
  will-change: transform;
}

.glass-icon:focus-visible {
  outline: none;
}

.glass-icon:focus-visible .glass-plate {
  outline: 3px solid #0a84ff;
  outline-offset: 4px;
  border-radius: 16px;
}

.glass-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: translateZ(calc(var(--z, 0) * var(--icon)));
}

.glass-plate {
  filter: drop-shadow(0 8px 12px var(--plate-shadow, rgba(20, 60, 160, 0.25)));
  transition: filter 0.12s linear;
}

/* Plate colours and layer shadows per icon; a click turns any plate black. */
.glass-icon--wallclocks {
  --plate-top: #fff;
  --plate-bottom: #eef0f3;
  --plate-shadow: rgba(0, 0, 0, 0.16);
  --layer-shadow: rgba(60, 10, 60, 0.35);
}

.glass-icon--salmon {
  --plate-top: #f7a04a;
  --plate-bottom: #f05a5a;
  --plate-shadow: rgba(240, 90, 90, 0.3);
  --layer-shadow: rgba(120, 30, 0, 0.35);
}

.glass-icon--zenit {
  --plate-top: #33aaff;
  --plate-bottom: #0080dd;
  --plate-shadow: rgba(0, 120, 220, 0.3);
}

.glass-icon--gazprom-id {
  --plate-top: #2793d8;
  --plate-bottom: #0068ad;
  --plate-shadow: rgba(0, 100, 180, 0.3);
}

.glass-icon--folderr {
  --plate-top: #4f9ff0;
  --plate-bottom: #2271d0;
  --plate-shadow: rgba(30, 110, 210, 0.3);
}

/* Dark plates have nowhere darker to go, so a click lights them up in the site's lime. */
.glass-icon--habi,
.glass-icon--lab {
  --plate-top: #3a3a3a;
  --plate-bottom: #000;
  --plate-shadow: rgba(0, 0, 0, 0.3);
  --layer-shadow: rgba(0, 0, 0, 0.45);
}

.glass-icon.glass-icon--habi.is-hit .plate-top,
.glass-icon.glass-icon--lab.is-hit .plate-top {
  stop-color: #e4ff7a;
}

.glass-icon.glass-icon--habi.is-hit .plate-bottom,
.glass-icon.glass-icon--lab.is-hit .plate-bottom {
  stop-color: #c6f432;
}

/* A live wallpaper cut to the plate's shape. In the lab a click hides it to show the plate under it. */
.glass-wall {
  inset: 0.2%;
  width: auto;
  height: auto;
  border-radius: 24%;
  overflow: hidden;
  background: var(--art);
  transition: opacity 0.12s linear;
}

/* Until its first frame a canvas is black: the preset's gradient shows through instead. */
.glass-wall canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
}

.glass-wall canvas.is-painted {
  opacity: 1;
}

.glass-icon.is-hit .glass-wall {
  opacity: 0;
}

/* WallClocks: the logo's disc, 80% of the icon as in the App Store icon. A click shows the still
   wallpaper painted over it. */
.glass-disc {
  inset: 10%;
  width: auto;
  height: auto;
  border-radius: 50%;
  overflow: hidden;
}

.glass-disc img,
.glass-disc canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.glass-disc canvas {
  opacity: 0;
  transition: opacity 0.12s linear;
}

.glass-icon.is-hit .glass-disc canvas.is-painted {
  opacity: 1;
}

.plate-top {
  stop-color: var(--plate-top, #4f8dff);
  transition: stop-color 0.12s linear;
}

.plate-bottom {
  stop-color: var(--plate-bottom, #2463e8);
  transition: stop-color 0.12s linear;
}

.glass-tint {
  transition: stop-color 0.12s linear;
}

.glass-icon.is-hit .plate-top {
  stop-color: #3a3a3a;
}

.glass-icon.is-hit .plate-bottom {
  stop-color: #000;
}

.glass-icon.is-hit .glass-tint {
  stop-color: #e6e6e6;
}

.glass-icon.is-hit .glass-plate {
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.3));
}

/* End of a case: a like counter and the next case, two dark pills like the Get in touch button. */
/* The pills ride along at the bottom of the screen while the case scrolls, then settle in place at its end. */
.case-end {
  position: sticky;
  bottom: 24px;
  z-index: 20;
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 96px;
  pointer-events: none;
}

.case-end > * {
  pointer-events: auto;
}

.case-like,
.case-next {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  /* Frosted like the labels on the home cards, so they stay quiet over the screens. */
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  color: var(--black);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.case-like:hover,
.case-next:hover {
  background: rgba(255, 255, 255, 0.85);
}

.case-like:active,
.case-next:active {
  transform: scale(0.97);
}

.case-like__heart {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  transition: fill 0.15s ease, stroke 0.15s ease;
}

.case-like.is-liked .case-like__heart {
  fill: #ff4f7b;
  stroke: #ff4f7b;
}

.case-like.is-popping .case-like__heart {
  animation: like-pop 0.4s cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes like-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.case-like__count {
  min-width: 1ch;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  transition: opacity 200ms ease;
}

/* The count shows once api/likes.js answers. */
.case-like.is-ready .case-like__count {
  opacity: 1;
}

.case-next svg {
  width: 16px;
  height: 16px;
}

.case-link {
  padding-bottom: 32px;
}

/* A pill under a block of case copy, like the nav pills. Disabled: gray text, no hover. */
/* The copy's own font, a step bolder. */
.case-copy__button {
  align-self: center;
  height: 48px;
  margin-top: 8px;
  padding: 0 20px 2px;
  font: inherit;
  font-weight: 600;
  line-height: normal;
}

.case-copy__button:disabled {
  color: rgba(0, 0, 0, 0.32);
  border-color: transparent;
  background: rgba(255, 255, 255, 0.72);
  cursor: default;
}

/* Footer */
.footer {
  display: flex;
  flex-direction: column;
  gap: 48px;
  margin-top: 48px;
  margin-bottom: 8px;
  padding: 48px;
  background: var(--surface);
  border: 1px solid #eaeae6;
  border-radius: var(--radius-xl);
}

.footer-tile {
  position: relative;
  display: grid;
  place-items: center;
  height: 480px;
}

.footer-waves,
.footer-arrow {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.footer-touch {
  --face: #171717;
  --side: #000;
  --text: #fff;
  position: relative;
  display: block;
  transform-style: preserve-3d;
  will-change: transform;
}

.footer-touch.is-hit {
  --face: var(--lime);
  --side: #9dbf12;
  --text: #000;
}

.footer-touch-face,
.footer-touch-side {
  border-radius: 999px;
  background: var(--face);
  transition: background-color 0.12s linear;
}

.footer-touch-face {
  position: relative;
  display: block;
  padding: 30px 64px 34px;
  color: var(--text);
  font-size: 44px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  transition: background-color 0.12s linear, color 0.12s linear;
}

.footer-touch-side {
  position: absolute;
  inset: 0;
  background: var(--side);
  transform: translateZ(calc(var(--layer) * -3px));
}

.footer-touch:focus-visible {
  outline: none;
}

.footer-touch:focus-visible .footer-touch-face {
  outline: 3px solid #0a84ff;
  outline-offset: 4px;
}

.footer-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  font-size: 16px;
  line-height: 25.6px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.44);
}

/* Copyright on the left, links in the middle, Batumi on the right; stacked in the same order on a phone. */
.footer-links {
  display: flex;
  justify-content: center;
  gap: 11px;
  color: #000;
}

.footer-made {
  justify-self: end;
}

.footer-links a:hover {
  color: rgba(0, 0, 0, 0.44);
}

.not-found {
  padding: 96px var(--gutter);
  text-align: center;
}

.not-found .pill {
  margin-top: 24px;
}

/* Folderr */
.case-wide > div[data-part="folderr"] {
  height: 700px;
}

.fw {
  --fw-side: #202020;
  --fw-center: #191919;
  --fw-divider: #2c2c2b;
  --fw-selected: #2c2c2c;
  --fw-field: #373735;
  --fw-text: #f0efed;
  --fw-row: #bcbab7;
  --fw-secondary: #aea9a3;
  --fw-tertiary: #7e7a76;
  --fw-blue: #2883df;
  position: relative;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 256px;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  color: var(--fw-text);
  font-size: 13px;
  line-height: 18px;
  text-align: left;
  background: var(--fw-center);
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.5);
  user-select: none;
  -webkit-user-select: none;
}

.fw-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 0 11px 10px 15px;
  background: var(--fw-side);
  border-right: 1px solid var(--fw-divider);
}

.fw-chrome {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  flex: none;
}

.fw-lights {
  display: inline-flex;
  gap: 7px;
  margin-right: 10px;
}

.fw-lights i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #4a4a48;
}

.fw:hover .fw-lights i:nth-child(1) {
  background: #ff5f57;
}

.fw:hover .fw-lights i:nth-child(2) {
  background: #febc2e;
}

.fw:hover .fw-lights i:nth-child(3) {
  background: #28c840;
}

.fw-grow {
  flex: 1;
}

.fw-tool {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--fw-secondary);
  border-radius: 6px;
}

button.fw-tool:hover {
  color: var(--fw-text);
  background: var(--fw-selected);
}

.fw-library {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
}

.fw-library-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #fff;
  background: var(--fw-blue);
  border-radius: 5px;
}

.fw-library-icon svg {
  width: 14px;
  height: 14px;
}

.fw-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 30px;
  margin: 12px 0;
  padding: 0 8px;
  color: var(--fw-tertiary);
  border: 1px solid var(--fw-field);
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fw-search:focus-within {
  border-color: var(--fw-blue);
  box-shadow: 0 0 0 1px var(--fw-blue);
}

.fw-search input {
  width: 100%;
  min-width: 0;
  color: var(--fw-text);
  background: none;
  border: 0;
  outline: none;
}

.fw-search input::placeholder {
  color: var(--fw-tertiary);
}

.fw-search input::-webkit-search-cancel-button {
  display: none;
}

.fw-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: none;
}

.fw-row {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  height: 26px;
  padding: 0 7px 0 4px;
  color: var(--fw-row);
  border-radius: 6px;
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

.fw-row span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.fw-row em {
  color: var(--fw-tertiary);
  font-size: 12px;
  font-style: normal;
}

.fw-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.fw-row.is-active {
  color: var(--fw-text);
  background: var(--fw-selected);
}

.fw-row.is-drop {
  background: rgba(40, 131, 223, 0.22);
  box-shadow: inset 0 0 0 1px var(--fw-blue);
}

.fw-heading {
  flex: none;
  margin: 14px 0 3px 5px;
  color: var(--fw-tertiary);
  font-size: 12px;
}

.fw-tag {
  flex: none;
  padding: 0 5px;
  font-size: 10px;
  line-height: 15px;
  font-weight: 600;
  border-radius: 4px;
}

.fw-tag.is-dark {
  color: #fff;
  background: #000;
}

.fw-tag.is-blue {
  color: #7ab8f5;
  background: rgba(40, 131, 223, 0.25);
}

.fw-news {
  flex: none;
  margin-top: auto;
  padding: 10px 12px;
  color: var(--fw-text);
  border: 1px solid var(--fw-field);
  border-radius: 12px;
}

.fw-news span {
  display: block;
  color: var(--fw-secondary);
  font-size: 12px;
}

.fw-center {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.fw-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
  height: 34px;
  padding: 0 10px;
}

.fw-title {
  margin: 0 12px 0 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.fw-slider {
  width: 88px;
  height: 16px;
  margin: 0 2px;
  accent-color: #d8d8d6;
  cursor: pointer;
}

.fw-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  margin-right: 6px;
  padding: 0 8px;
  font-size: 12px;
  background: var(--fw-selected);
  border-radius: 11px;
}

.fw-chip[hidden] {
  display: none;
}

.fw-chip i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.fw-grid {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 20px 24px;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: #3c3c3a transparent;
}

.fw-stage {
  position: relative;
}

.fw-tile {
  position: absolute;
  left: 0;
  top: 0;
  padding: 0;
  text-align: center;
  transition: transform 0.42s var(--ease), width 0.42s var(--ease), height 0.42s var(--ease), opacity 0.25s ease;
}

.is-quick .fw-tile {
  transition-duration: 0.1s, 0.1s, 0.1s, 0.25s;
}

.fw-tile.is-out {
  opacity: 0;
  pointer-events: none;
}

.fw-tile.is-lifted {
  opacity: 0.35;
}

.fw-pic {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 42px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--fw-side);
}

.fw-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.fw-tile.is-selected .fw-pic {
  overflow: visible;
  outline: 2px solid var(--fw-blue);
  outline-offset: 2px;
}

.fw-tile.is-selected .fw-pic img {
  border-radius: 6px;
}

.fw-name,
.fw-size {
  position: absolute;
  left: 0;
  right: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.fw-name {
  bottom: 18px;
  font-size: 12px;
  color: var(--fw-text);
}

.fw-tile.is-selected .fw-name {
  color: var(--fw-blue);
}

.fw-size {
  bottom: 2px;
  font-size: 11px;
  color: var(--fw-tertiary);
}

.fw-empty {
  padding-top: 120px;
  color: var(--fw-tertiary);
  text-align: center;
}

.fw-inspector {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 44px 16px 16px;
  background: var(--fw-side);
  border-left: 1px solid var(--fw-divider);
}

.fw-field {
  flex: none;
  padding: 6px 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  border: 1px solid var(--fw-field);
  border-radius: 6px;
}

.fw-group {
  flex: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--fw-divider);
}

.fw-group h4 {
  margin: 0 0 8px;
  color: var(--fw-secondary);
  font-size: 13px;
  font-weight: 600;
}

.fw-group dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
}

.fw-group dt {
  color: var(--fw-secondary);
}

.fw-group dd {
  text-align: right;
}

.fw-bottom {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--fw-divider);
}

.fw-preview {
  height: 200px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--fw-center);
}

.fw-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fw-palette {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 5px;
}

.fw-palette.is-large {
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.fw-swatch {
  aspect-ratio: 1;
  padding: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: transform 0.2s var(--ease);
}

.fw-swatch:hover {
  transform: scale(1.3);
}

.fw-swatch.is-on {
  box-shadow: 0 0 0 2px var(--fw-side), 0 0 0 3.5px var(--fw-blue);
}

.fw-viewer {
  position: absolute;
  top: 0;
  right: 256px;
  bottom: 0;
  left: 232px;
  display: flex;
  flex-direction: column;
  background: var(--fw-center);
  z-index: 5;
}

.fw-viewer[hidden] {
  display: none;
}

.fw-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  height: 34px;
  padding: 0 10px 0 16px;
  color: var(--fw-secondary);
}

.fw-viewer-bar svg {
  transform: rotate(45deg);
}

.fw-viewer-stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.fw-viewer-stage img {
  display: block;
  object-fit: contain;
  transform-origin: center;
  will-change: transform;
}

.fw-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 50;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.fw-ghost img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fw.is-dragging {
  cursor: grabbing;
}

/* Wallpaper Lab */
.lab-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
}

.lab-stage {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  border-radius: 32px;
  background: var(--art, #222);
}

.lab-stage canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.lab-name {
  position: absolute;
  left: 20px;
  bottom: 20px;
  padding: 9px 16px;
  font-size: 14px;
  line-height: 18px;
  color: rgba(0, 0, 0, 0.75);
  background: rgba(255, 255, 255, 0.82);
  border-radius: 100px;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.lab-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--panel);
  border-radius: 32px;
}

.lab-slider {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.lab-slider input {
  width: 100%;
  accent-color: var(--ink);
}

.lab-slider output {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.lab-select {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.lab-select select {
  height: 32px;
  padding: 0 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.lab-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.lab-colors input {
  width: 32px;
  height: 32px;
  padding: 0;
  overflow: hidden;
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.lab-colors input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.lab-colors input::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50%;
}

.lab-heading {
  margin: 40px 0 16px;
  font-size: 20px;
  line-height: 24px;
  font-weight: 500;
  color: var(--black);
}

.lab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 16px;
}

.lab-tile {
  padding: 0;
  text-align: left;
  font-size: 14px;
}

.lab-tile canvas {
  width: 100%;
  aspect-ratio: 1.3;
  display: block;
  border-radius: 20px;
  background: #eee;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s var(--ease), box-shadow 0.2s ease;
}

.lab-tile span {
  display: block;
  margin-top: 8px;
  padding-left: 2px;
}

.lab-tile:hover canvas {
  transform: scale(1.02);
}

.lab-tile.is-on canvas {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink);
}

/* Smaller screens */
@media (max-width: 1100px) {
  .badges {
    aspect-ratio: 2;
  }

  .duo {
    width: min(724px, 100%);
    margin-inline: auto;
  }

  .pair,
  .triple,
  .duo {
    grid-template-columns: minmax(0, 1fr);
    width: min(724px, 100%);
    margin-inline: auto;
  }

  .phone-card--wide {
    grid-column: auto;
    aspect-ratio: 2;
  }

  .fw {
    grid-template-columns: 212px minmax(0, 1fr);
  }

  .fw-inspector {
    display: none;
  }

  .fw-viewer {
    left: 212px;
    right: 0;
  }

  .archive {
    padding: 48px;
  }

  .lab-top {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Too narrow for the running line: only the Spotify logo stays, between the name and the menu. */
@media (max-width: 1040px) {
  .nav {
    grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  }

  .nav-now {
    width: auto;
  }

  .nav-now__bars,
  .nav-now__text,
  .nav-now__arrow {
    display: none;
  }
}

@media (max-width: 768px) {
  :root {
    --gutter: 16px;
    --gap: 16px;
  }

  .nav {
    gap: 8px;
    height: auto;
    padding: 20px 16px;
  }

  .nav-right {
    gap: 4px;
  }

  .nav .pill {
    gap: 4px;
    height: 36px;
    padding: 0 10px 1px;
    font-size: 14px;
  }

  .menu {
    left: auto;
    right: -140px;
    transform: none;
    animation: none;
  }

  .menu--contacts {
    right: 0;
  }

  .case-wide > div[data-part="folderr"] {
    height: 560px;
  }

  .fw {
    grid-template-columns: minmax(0, 1fr);
  }

  .fw-side {
    display: none;
  }

  .fw-viewer {
    left: 0;
  }

  .panel {
    height: 520px;
  }

  .archive {
    padding: 28px;
  }

  .archive-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .archive-row span:nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 15px;
  }

  .case-head {
    padding: 72px 0 88px;
  }

  .case-shots,
  .case-shots-wide {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .case-copy {
    margin: 96px 0;
  }

  .case-end {
    margin-top: 48px;
  }

  .case-like,
  .case-next {
    height: 44px;
    padding: 0 18px;
  }

  .case-body {
    gap: 16px;
  }

  .case-media img,
  .case-media video {
    border-radius: 20px;
  }

  .case-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .case-text {
    padding: 48px 0;
    font-size: 18px;
    line-height: 28px;
  }

  .case-text + .case-text {
    margin-top: -48px;
  }

  .case-stats {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-top: 24px;
  }

  .case-stats div {
    padding: 28px 24px;
    border-radius: 24px;
  }

  .case-phones {
    padding: 32px 16px;
    border-radius: 32px;
  }

  .device {
    flex-basis: 70%;
  }

  .case-panel {
    padding: 28px 16px;
    border-radius: 32px;
  }

  .case-faces {
    grid-template-columns: 86%;
    gap: 16px;
    padding: 32px 0;
    border-radius: 32px;
  }

  .footer {
    gap: 24px;
    margin-top: 16px;
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 32px;
  }

  .footer-tile {
    height: 320px;
  }

  .footer-row {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 8px;
    text-align: center;
  }

  .footer-made {
    justify-self: center;
  }

  .footer-touch-face {
    padding: 20px 40px 24px;
    font-size: 28px;
  }

  .lab-stage {
    min-height: 300px;
  }

  .lab-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


@media (prefers-reduced-motion: reduce) {
  .nav-now__bars i,
  .nav-now__run {
    animation: none;
  }

  .menu,
  .puzzle-cell.is-open {
    animation: none;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .pill,
  .pill svg,
  .phone-stub,
  .phone-card-label {
    transition: none;
  }
}

/* A small icon inside case copy, sitting on the text line, like the Sparks mark after its name. */
.case-copy .inline-icon {
  display: inline-block;
  width: 0.9em;
  height: 0.9em;
  margin: 0 0.05em 0 0.25em;
  vertical-align: -0.12em;
}

/* A figure under NDA: a solid bar in place of the number. The number itself is not in the page at all. */
.case-copy .redacted {
  display: inline-block;
  width: calc(var(--w, 3) * 0.62em);
  height: 0.95em;
  margin: 0 0.1em;
  border-radius: 4px;
  background: #1a1a1a;
  vertical-align: -0.14em;
}

/* Phone layout: a copy of danield.design at 375 px, measured from the live site (Nov 2026).
   Nav pills 40 high, 14 px. Home cards 343 x 419, rounded 48, phone 168 wide. Case (as on
   /case-studies/clocks): grey panels 440 high, rounded 24, a 180 px phone, 16 apart; copy
   15 on 22.5 in a 279 px column. About text:
   18 px headings, 14 on 22.4 text; archive rows 13 on 19.5. */
@media (max-width: 768px) {
  /* No room for the playlist: the name on the left, the menus on the right. */
  .nav {
    display: flex;
    justify-content: space-between;
    padding: 24px 16px 0;
  }

  .nav-now {
    display: none;
  }

  .nav-right {
    gap: 8px;
  }

  .nav .pill {
    gap: 4px;
    height: 40px;
    padding: 0 8px 2px;
    font-size: 14px;
  }

  /* A smaller record on the loading screen, so the waves have room on both sides. */
  .loader__glide {
    width: 160px;
    height: 160px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  }

  /* ---------- Home ---------- */
  .intro {
    gap: 32px;
    padding-block: 32px 48px;
  }

  .intro h1,
  .intro-ask__question {
    font-size: 20px;
    line-height: 28px;
    letter-spacing: 0;
  }

  .intro-ask {
    gap: 16px;
  }

  /* The fist's stage stays inside the screen: 48 px either side of the face instead of 140. */
  .intro-face__stage {
    inset: 0 -48px -40px;
  }

  .intro-face__hand,
  .intro-face__finger {
    margin-left: 48px;
  }

  .phone-card {
    aspect-ratio: 343 / 419;
  }

  /* The card grows with the screen but the phone stays 168 px, as on danield.design. Frame,
     corners and shadow keep the desktop proportions. The WallClocks hand is measured from the
     phone's centre (the card's centre) in the same units, so its plug stays on the port. */
  .phone-card .phone-stub {
    width: 168px;
    padding: 4.9px;
    border-radius: 29.7px;
    box-shadow: 0 9.4px 19.5px rgba(0, 0, 0, 0.12);
  }

  .phone-card .phone-stub-screen {
    border-radius: 24.8px;
  }

  .phone-card .phone-hand {
    top: calc(50% + 177.1px);
    left: calc(50% - 184.9px);
    width: 368.8px;
    transform-origin: 184.9px -177.2px;
  }

  /* ---------- Case pages ---------- */
  .case-head {
    gap: 8px;
    padding-block: 248px 215px;
  }

  .case-head h1 {
    font-size: 18px;
    line-height: 21.6px;
  }

  .case-head p {
    font-size: 14px;
    line-height: 21px;
    color: #666;
  }

  .case-body,
  .case-shots,
  .case-shots-wide {
    gap: 16px;
  }

  /* 440 px high whatever the screen width, as on danield.design. */
  .case-shot,
  .case-shot__col {
    aspect-ratio: auto;
    height: 440px;
  }

  .case-shot {
    border-radius: 24px;
  }

  .case-shots--single .case-shot {
    aspect-ratio: auto;
  }

  /* The phone stays 180 px; frame, corners and shadow keep the desktop proportions. */
  .case-shot > .phone-stub,
  .case-shot__col > .phone-stub {
    width: 180px;
    padding: 5.2px;
    border-radius: 31.7px;
    box-shadow: 0 10px 21px rgba(0, 0, 0, 0.12);
  }

  /* The badge grid stands in for a phone, so it takes the phone's 180 px and shrinks with it. */
  .case-shot > .case-badges {
    width: 180px;
  }

  .case-shot > .phone-stub > .phone-stub-screen,
  .case-shot__col > .phone-stub > .phone-stub-screen {
    border-radius: 26.6px;
  }

  .case-landscape {
    padding: 24px;
    border-radius: 24px;
  }

  .case-landscape-screen {
    border-radius: 16px;
  }

  .case-panel,
  .case-phones,
  .case-faces,
  .case-strip,
  .case-photo,
  .case-wall {
    border-radius: 24px;
  }

  .case-copy {
    gap: 16px;
    width: min(279px, 100%);
    margin: 80px auto;
    font-size: 15px;
    line-height: 22.5px;
  }

  /* The Folderr window needs a computer: on a phone a grey panel says so instead. The hidden
     window never reaches the screen, so it isn't started either. */
  .case-wide:has(> [data-part="folderr"]) {
    display: grid;
    place-items: center;
    height: 240px;
    padding: 24px;
    background: var(--panel);
    border-radius: 24px;
  }

  .case-wide:has(> [data-part="folderr"])::before {
    content: "Switch to a computer screen";
    font-size: 15px;
    line-height: 22.5px;
    color: #666;
    text-align: center;
  }

  .case-wide > [data-part="folderr"] {
    display: none;
  }

  /* ---------- About ---------- */
  /* The photos run to the screen edges and are cut there. */
  .panel--photos {
    height: 360px;
    margin-inline: calc(-1 * var(--gutter));
    overflow: clip;
  }

  .about-story h2 {
    font-size: 18px;
    line-height: 21.6px;
  }

  .about-story p {
    font-size: 14px;
    line-height: 22.4px;
    color: var(--black);
  }

  .about-story h2 + p {
    margin-top: 16px;
  }

  .about-story p + p {
    margin-top: 24px;
  }

  .archive h2 {
    font-size: 20px;
    line-height: 24px;
  }

  .archive-list {
    margin-top: 32px;
  }

  .archive-row {
    min-height: 44px;
    padding-block: 12px;
    font-size: 13px;
    line-height: 19.5px;
  }

  .archive-row span:nth-child(2) {
    font-size: 13px;
  }

  /* ---------- Footer ---------- */
  .footer {
    padding: 24px;
    border-radius: 48px;
  }

  /* Small enough for the waves to show on both sides. */
  .footer-touch-face {
    padding: 11px 20px 13px;
    font-size: 16px;
  }
}

@media (max-width: 374px) {
  .nav .pill {
    padding: 0 6px 2px;
  }
}

/* ---------- Video hello in the bottom-right corner (js/intro-video.js) ---------- */
/* A round muted bubble that opens into a card with sound, a timeline and word-by-word subtitles. */
.intro-video {
  /* Sizes from kirill.si: a 164px bubble (120px on phones) that opens into a 300x500 card. */
  --iv-bubble: 164px;
  --iv-width: min(300px, calc(100vw - 32px));
  --iv-height: min(500px, calc(100svh - 32px));
  --iv-inset: 10px;
  --iv-speed: 0.5s;
  --iv-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 60;
  opacity: 0;
  transform: scale(0.6);
  transform-origin: 100% 100%;
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease);
}

.intro-video.is-in {
  opacity: 1;
  transform: none;
}

.intro-video__box {
  position: relative;
  width: var(--iv-bubble);
  height: var(--iv-bubble);
  overflow: hidden;
  border-radius: calc(var(--iv-bubble) / 2);
  background: #d9d9d9;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  /* Safari: keep the rounded clip while the video is scaled. */
  isolation: isolate;
  transition: width var(--iv-speed) var(--iv-ease), height var(--iv-speed) var(--iv-ease), border-radius var(--iv-speed) var(--iv-ease);
}

.intro-video[data-state="open"] .intro-video__box {
  width: var(--iv-width);
  height: var(--iv-height);
  border-radius: 20px;
  cursor: default;
}

.intro-video__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  /* The bubble is zoomed in on the face; the card shows the whole frame. */
  transform: scale(1.2);
  transform-origin: 50% 46%;
  filter: brightness(0.92);
  transition: transform var(--iv-speed) var(--iv-ease);
}

.intro-video[data-state="bubble"] .intro-video__box:hover .intro-video__video {
  transform: scale(1.28);
}

.intro-video[data-state="open"] .intro-video__video {
  transform: none;
}

/* Frosted pills and round buttons over the video. */
.intro-video__glass {
  color: #fff;
  background: rgba(20, 20, 20, 0.34);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
}

.intro-video__button {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background 0.2s, transform 0.2s var(--ease), opacity 0.3s var(--ease);
}

/* All the round buttons, in the bubble and in the card, carry a 20px icon. */
.intro-video__button svg {
  width: 20px;
  height: 20px;
}

.intro-video__button:hover {
  background: rgba(20, 20, 20, 0.5);
}

.intro-video__button:active {
  transform: scale(0.92);
}

.intro-video__top,
.intro-video__bottom {
  position: absolute;
  left: var(--iv-inset);
  right: var(--iv-inset);
  display: flex;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.intro-video__top {
  top: var(--iv-inset);
  align-items: center;
  justify-content: space-between;
}

.intro-video__bottom {
  bottom: var(--iv-inset);
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* The controls come in once the card has opened. */
.intro-video[data-state="open"] .intro-video__top,
.intro-video[data-state="open"] .intro-video__bottom {
  opacity: 1;
  transition-delay: 0.25s;
}

.intro-video[data-state="open"] .intro-video__top > *,
.intro-video[data-state="open"] .intro-video__track {
  pointer-events: auto;
}

/* Restart, the time and the timeline show on hover, like the close button stays. */
.intro-video__restart,
.intro-video__time,
.intro-video__track {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), background 0.2s;
}

.intro-video[data-state="open"] .intro-video__box:hover :is(.intro-video__restart, .intro-video__time, .intro-video__track),
.intro-video[data-state="open"] .intro-video__box:focus-within :is(.intro-video__restart, .intro-video__time, .intro-video__track),
.intro-video.is-paused :is(.intro-video__restart, .intro-video__time, .intro-video__track),
.intro-video.is-seeking :is(.intro-video__restart, .intro-video__time, .intro-video__track) {
  opacity: 1;
  transform: none;
}

.intro-video__time {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.intro-video__caption {
  max-width: 100%;
  padding: 6px 12px;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
  transition: opacity 0.2s;
}

.intro-video__caption.is-empty {
  opacity: 0;
}

/* Words not yet spoken wait half-lit. */
.intro-video__caption span {
  color: rgba(255, 255, 255, 0.5);
  transition: color 0.12s linear;
}

.intro-video__caption span.is-said {
  color: #fff;
}

.intro-video__track {
  position: relative;
  width: 100%;
  height: 20px;
  cursor: pointer;
  touch-action: none;
}

.intro-video__track::before,
.intro-video__fill {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  height: 4px;
  border-radius: 2px;
}

.intro-video__track::before {
  background: rgba(255, 255, 255, 0.32);
}

.intro-video__fill {
  background: #fff;
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.intro-video__paused {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s, transform 0.3s var(--ease);
}

.intro-video.is-paused .intro-video__paused {
  opacity: 1;
  transform: none;
}

/* Hides the whole bubble; shows on hover over it, and always on touch screens. */
.intro-video__hide {
  position: absolute;
  top: 4px;
  right: 4px;
  opacity: 0;
}

@media (max-width: 1023px) {
  .intro-video__hide {
    top: 0;
    right: 0;
  }
}

.intro-video[data-state="bubble"]:hover .intro-video__hide,
.intro-video__hide:focus-visible {
  opacity: 1;
}

.intro-video[data-state="open"] .intro-video__hide {
  opacity: 0;
  pointer-events: none;
}

@media (hover: none) {
  .intro-video[data-state="bubble"] .intro-video__hide {
    opacity: 1;
  }

  .intro-video[data-state="open"] :is(.intro-video__restart, .intro-video__time, .intro-video__track) {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 1023px) {
  .intro-video {
    --iv-bubble: 120px;
    right: 16px;
    bottom: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-video,
  .intro-video__box,
  .intro-video__video {
    transition-duration: 0.01s;
  }
}
