/* Subpages: one shell (bar, menu, head, colophon) over the drift field. */

html { scrollbar-color: rgba(17, 17, 17, 0.32) transparent; }

.page-main {
  width: min(var(--work), calc(100% - 80px));
  margin: 0 auto;
  padding: 176px 0 0;
}

.page .colophon { margin-top: 128px; }

.page-head { margin-bottom: 80px; }

.page-title {
  margin: 0;
  color: #111;
  font-family: "DM Sans", Inter, sans-serif;
  font-size: clamp(60px, 9vw, 120px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.86;
  text-wrap: balance;
}

.page-lede {
  margin: 36px 0 0;
  max-width: 600px;
  color: #5a5a5a;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.45;
  text-wrap: pretty;
}

/* Bar */

.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 24px 40px;
  pointer-events: none;
}

.bar > * { pointer-events: auto; }

.menu-toggle,
.back-home {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06), 0 10px 30px -18px rgba(0, 0, 0, 0.35);
  color: #111;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.45s var(--ease), box-shadow 0.45s var(--ease);
}

.menu-toggle:hover,
.back-home:hover { background: #f4f4f4; }

.menu-open .menu-toggle,
.menu-open .back-home { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); }

.back-home { gap: 8px; padding: 0 16px 0 14px; }

.back-home svg { width: 16px; height: 16px; flex: none; }

.menu-toggle { padding: 0 20px 0 18px; }

.menu-toggle-lines {
  position: relative;
  display: block;
  width: 18px;
  height: 8px;
}

.menu-toggle-lines span {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), top 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-toggle-lines span:first-child { top: 0; }
.menu-toggle-lines span:last-child { top: 6.5px; }

.menu-open .menu-toggle-lines span:first-child { top: 3.25px; transform: rotate(45deg); }
.menu-open .menu-toggle-lines span:last-child { top: 3.25px; transform: rotate(-45deg); }

.menu-toggle-label { min-width: 2.9em; text-align: left; }

/* Back covers the subpage in white from the button. The homepage then uncovers that sheet. */

html.is-leaving { overflow: hidden; }

.leave-cover {
  position: fixed;
  inset: 0;
  z-index: 11000;
}

.leave-sheet {
  position: absolute;
  inset: 0;
  background: #fff;
  clip-path: circle(0 at var(--ox, 100%) var(--oy, 0));
  transition: clip-path 1.05s cubic-bezier(0.4, 0, 0.2, 1);
}

.leave-cover.is-covering .leave-sheet {
  clip-path: circle(150vmax at var(--ox, 100%) var(--oy, 0));
}

/* Menu overlay: a paper sheet that opens as a circle from the toggle. */

.menu {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 140px 40px 36px;
  overflow-y: auto;
  background: #fff;
  color: #111;
  clip-path: circle(0 at var(--ox, calc(100% - 92px)) var(--oy, 48px));
  transition: clip-path 0.5s cubic-bezier(0.7, 0, 0.84, 0);
}

.menu[hidden] { display: none; }

.menu-open .menu {
  clip-path: circle(150vmax at var(--ox, calc(100% - 92px)) var(--oy, 48px));
  transition: clip-path 0.85s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-open { overflow: hidden; }

.menu-pages,
.menu-foot {
  width: min(var(--work), 100%);
  margin: 0 auto;
}

.menu-pages ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.menu-pages li {
  opacity: 0;
  transform: translateY(0.5em);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.menu-open .menu-pages li {
  opacity: 1;
  transform: none;
  transition-duration: 0.9s;
  transition-delay: calc(var(--i) * 45ms + 140ms);
}

.menu-pages a {
  display: inline-flex;
  align-items: center;
  gap: 0.22em;
  max-width: 100%;
  padding: 0.04em 0;
  color: inherit;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(40px, 6.2vh, 76px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.04;
  text-decoration: none;
  transition: opacity 0.45s var(--ease);
}

.menu-pages a[aria-current="page"]::after {
  content: "";
  width: 0.16em;
  height: 0.16em;
  margin-top: 0.12em;
  border-radius: 50%;
  background: var(--accent);
}

.menu-pages ol:has(a:focus-visible) a:not(:focus-visible) { opacity: 0.28; }

@media (hover: hover) {
  .menu-pages ol:hover a:not(:hover) { opacity: 0.28; }
}

.menu-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px 40px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.03em;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.menu-open .menu-foot {
  opacity: 1;
  transition: opacity 0.9s var(--ease) 0.45s;
}

.menu-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
}

.menu-foot a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.menu-foot a:hover { opacity: 0.55; }

.menu-foot a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

/* Paper and prose */

.paper {
  padding: 48px 52px 52px;
  border-radius: 28px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  color: #161616;
}

.prose p {
  max-width: 40rem;
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.6;
  text-wrap: pretty;
}

.prose p:last-child { margin-bottom: 0; }

.paper a:not(.button),
.post a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(22, 22, 22, 0.35);
  text-underline-offset: 0.18em;
  transition: text-decoration-color 0.45s var(--ease);
}

.paper a:not(.button):hover,
.post a:hover { text-decoration-color: currentColor; }

.button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  height: 56px;
  padding: 0 24px 0 28px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.03em;
  text-decoration: none;
  transition: background-color 0.45s var(--ease);
}

.button svg {
  width: 18px;
  height: 18px;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.button:hover { background: var(--accent); }
.button:hover svg { transform: translateX(4px); }

/* Legal */

.doc-status {
  margin: 28px 0 0;
  color: var(--accent);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.45;
}

.page-legal .page-head { margin-bottom: 48px; }

/* 404: one number, one sentence, one way home. */

.page-lost {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-lost .page-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding-top: 96px;
  padding-bottom: 40px;
}

.page-lost .colophon { margin-top: 0; }

.lost-code {
  margin: 0;
  color: #111;
  font-family: "DM Sans", Inter, sans-serif;
  font-size: clamp(96px, 22vw, 280px);
  font-weight: 600;
  letter-spacing: -0.08em;
  line-height: 0.82;
}

.page-lost .button { margin-top: 40px; }

.doc-block { scroll-margin-top: 120px; }

.doc-block + .doc-block { margin-top: 40px; }

.doc-block h2 {
  margin: 0 0 12px;
  color: #111;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.doc-block p,
.doc-credits li {
  max-width: 40rem;
  margin: 0 0 14px;
  color: #161616;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.55;
}

.doc-block p:last-child,
.doc-credits li:last-child { margin-bottom: 0; }

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

.doc-credits li + li { margin-top: 18px; }

.doc-credits li span {
  display: block;
  margin-top: 4px;
  color: #5a5a5a;
  font-size: 15px;
  line-height: 1.45;
}

.doc-note {
  margin: 40px 0 0;
  color: #5a5a5a;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

/* About */

.about-intro {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 64px;
  margin-bottom: 80px;
}

.portrait {
  position: relative;
  width: clamp(200px, 26vw, 320px);
  aspect-ratio: 1;
  margin: 0;
  overflow: hidden;
  border-radius: 50%;
  background: #050505;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.55);
  isolation: isolate;
}

.portrait::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.portrait video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  transform: scale(1.22) translate(-1.5%, 14%);
  transform-origin: center center;
  filter: grayscale(1) contrast(1.04);
}

.about-role {
  margin: 28px 0 0;
  color: var(--accent);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.2;
}

.about-article { max-width: 760px; }

.about-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 40px;
}

.about-contact-mail {
  color: #5a5a5a;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

/* Work: a horizontal track that slides the focused role to the column edge. */

.timeline {
  --entry: min(540px, 70vw);
  --step: 72px;
  --edge: max(40px, calc((100vw - var(--work)) / 2));
}

.tl-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
}

.tl-years {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  list-style: none;
}

.tl-years button {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5a5a5a;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  cursor: pointer;
  transition: background-color 0.45s var(--ease), color 0.45s var(--ease);
}

.tl-years button:hover { color: #111; }

.tl-years button[aria-current="true"] {
  background: #111;
  color: #fff;
}

.round-buttons {
  display: flex;
  gap: 10px;
}

.round-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  color: #111;
  cursor: pointer;
  transition: background-color 0.45s var(--ease), opacity 0.45s var(--ease);
}

.round-button svg { width: 18px; height: 18px; }

.round-button:hover:not(:disabled) { background: #f4f4f4; }

.round-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.tl-viewport {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  overflow: hidden;
  overflow: clip;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--edge), #000 calc(100% - 96px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--edge), #000 calc(100% - 96px), transparent 100%);
}

.tl-track {
  display: flex;
  gap: var(--step);
  margin: 0;
  padding: 8px var(--edge) 12px;
  list-style: none;
  transition: transform 0.95s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.tl-entry {
  position: relative;
  flex: 0 0 var(--entry);
  padding-top: 40px;
  opacity: var(--fade, 1);
  transform: scale(var(--scale, 1));
  transform-origin: left top;
  transition: opacity 0.95s cubic-bezier(0.16, 1, 0.3, 1), transform 0.95s cubic-bezier(0.16, 1, 0.3, 1);
}

.tl-entry:not(.is-focus):hover { opacity: calc(var(--fade, 1) + 0.24); }

.tl-entry::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  right: calc(-1 * var(--step));
  height: 1px;
  background: rgba(17, 17, 17, 0.2);
}

.tl-entry:last-child::before { right: 0; }

.tl-node {
  position: absolute;
  top: 0;
  left: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #111;
  transition: background-color 0.6s var(--ease), transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tl-entry.is-focus .tl-node {
  background: var(--accent);
  transform: scale(1.3);
}

.tl-when {
  margin: 0;
  color: #5a5a5a;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.tl-company {
  margin: 20px 0 14px;
  color: #111;
  font-family: "DM Sans", Inter, sans-serif;
  font-size: clamp(48px, 5.6vw, 80px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.9;
}

.tl-pick {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}

.tl-entry:not(.is-focus) .tl-pick::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.tl-entry.is-focus .tl-pick { cursor: default; }

.tl-role {
  margin: 0;
  color: #5a5a5a;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
}

.tl-products-wrap {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.tl-products {
  min-height: 0;
  margin: 36px 0 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
}

.tl-products li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid rgba(17, 17, 17, 0.1);
  color: #161616;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.45;
}

.tl-products li::before {
  content: "";
  flex: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-3px);
}

/* Personal projects: one bento per slide, each with its own grid. */

.carousel-viewport {
  overflow: hidden;
  touch-action: pan-y;
  transition: height 0.95s cubic-bezier(0.16, 1, 0.3, 1);
}

.carousel-track {
  --index: 0;
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
  transform: translateX(calc(var(--index) * (-100% - var(--gap))));
  transition: transform 0.95s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: var(--gap);
  aspect-ratio: 1120 / 700;
}

.tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border-radius: 28px;
  container-type: size;
}

.carousel.is-ready .tile {
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.95s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(var(--t, 0) * 70ms + 120ms);
}

.carousel.is-ready .slide:not(.is-active) .tile {
  opacity: 0;
  transform: translateY(28px) scale(0.97);
  transition-delay: 0s;
}

.t-name {
  display: flex;
  align-items: flex-end;
  padding: 26px 26px 22px;
  background: #1c1c1c;
  color: #fff;
}

.t-name h2 {
  margin: 0;
  font-family: "DM Sans", Inter, sans-serif;
  font-size: clamp(32px, min(16cqw, 46cqh), 96px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.9;
  text-wrap: balance;
}

.t-desc {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 26px 28px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  color: #161616;
}

.t-desc p {
  max-width: 34rem;
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  text-wrap: pretty;
}

.t-desc .t-status {
  color: #5a5a5a;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 14px;
  letter-spacing: -0.03em;
}

.t-img {
  background-color: #f2f2f2;
  background-image: radial-gradient(circle, rgba(17, 17, 17, 0.16) 1.1px, transparent 1.6px);
  background-size: 11px 11px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.t-img.is-deep {
  background-color: #d9d9d9;
  background-image: radial-gradient(circle, rgba(17, 17, 17, 0.2) 1.1px, transparent 1.6px);
}

.t-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.t-img figcaption {
  position: absolute;
  left: 22px;
  bottom: 18px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #5a5a5a;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.slide[data-layout="a"] .t-i1 { grid-area: 1 / 1 / 5 / 8; }
.slide[data-layout="a"] .t-name { grid-area: 1 / 8 / 2 / 13; }
.slide[data-layout="a"] .t-i2 { grid-area: 2 / 8 / 4 / 13; }
.slide[data-layout="a"] .t-desc { grid-area: 4 / 8 / 5 / 13; }

.slide[data-layout="b"] .t-i1 { grid-area: 1 / 1 / 5 / 6; }
.slide[data-layout="b"] .t-name { grid-area: 1 / 6 / 3 / 13; }
.slide[data-layout="b"] .t-i2 { grid-area: 3 / 6 / 5 / 10; }
.slide[data-layout="b"] .t-desc { grid-area: 3 / 10 / 5 / 13; }

.slide[data-layout="c"] .t-desc { grid-area: 1 / 1 / 5 / 4; }
.slide[data-layout="c"] .t-i1 { grid-area: 1 / 4 / 5 / 10; }
.slide[data-layout="c"] .t-name { grid-area: 1 / 10 / 2 / 13; }
.slide[data-layout="c"] .t-i2 { grid-area: 2 / 10 / 5 / 13; }

.slide[data-layout="d"] .t-i1 { grid-area: 1 / 1 / 3 / 13; }
.slide[data-layout="d"] .t-name { grid-area: 3 / 1 / 5 / 5; }
.slide[data-layout="d"] .t-desc { grid-area: 3 / 5 / 5 / 9; }
.slide[data-layout="d"] .t-i2 { grid-area: 3 / 9 / 5 / 13; }

.slide[data-layout="e"] .t-i2 { grid-area: 1 / 1 / 3 / 5; }
.slide[data-layout="e"] .t-i1 { grid-area: 1 / 5 / 4 / 13; }
.slide[data-layout="e"] .t-name { grid-area: 3 / 1 / 5 / 5; }
.slide[data-layout="e"] .t-desc { grid-area: 4 / 5 / 5 / 13; }

/* Four portrait phone screenshots under a short name and description row. */
.slide[data-layout="screens"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: minmax(clamp(150px, 17vw, 200px), auto) minmax(0, 1fr);
}

.slide[data-layout="screens"] .t-name { grid-column: 1 / 3; }
.slide[data-layout="screens"] .t-desc { grid-column: 3 / 5; container-type: normal; }
.slide[data-layout="screens"] .t-phone { aspect-ratio: auto; }

/* A logo and three 16:9 screenshots: one large, two stacked beside it. */
.carousel-viewport { container-type: inline-size; }

.slide[data-layout="docs"] { grid-template-rows: minmax(18cqw, auto) repeat(2, minmax(0, 1fr)); }

.slide[data-layout="docs"] .t-name { grid-area: 1 / 1 / 2 / 5; }
.slide[data-layout="docs"] .t-logo { grid-area: 1 / 5 / 2 / 7; }
.slide[data-layout="docs"] .t-desc { grid-area: 1 / 7 / 2 / 13; container-type: normal; }
.slide[data-layout="docs"] .t-main { grid-area: 2 / 5 / 4 / 13; }
.slide[data-layout="docs"] .t-main + .t-wide { grid-area: 2 / 1 / 3 / 5; }
.slide[data-layout="docs"] .t-main + .t-wide + .t-wide { grid-area: 3 / 1 / 4 / 5; }

/* Mirrors docs: name over one tall image on the left, description over two stacked images on the right. */
.slide[data-layout="trio"] { grid-template-rows: minmax(18cqw, auto) repeat(2, minmax(0, 1fr)); }

.slide[data-layout="trio"] .t-name { grid-area: 1 / 1 / 2 / 8; }
.slide[data-layout="trio"] .t-desc { grid-area: 1 / 8 / 2 / 13; container-type: normal; }
.slide[data-layout="trio"] .t-main { grid-area: 2 / 1 / 4 / 8; }
.slide[data-layout="trio"] .t-main + .t-wide { grid-area: 2 / 8 / 3 / 13; }
.slide[data-layout="trio"] .t-main + .t-wide + .t-wide { grid-area: 3 / 8 / 4 / 13; }

/* Each image fills its frame with one even inset; --zoom crops in on the centred content without leaving the frame. */
.slide[data-layout="trio"] .t-shot { --frame: clamp(14px, 1.6vw, 24px); }

.slide[data-layout="trio"] .t-shot::before {
  content: "";
  position: absolute;
  inset: var(--frame);
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 10px 28px -12px rgba(0, 0, 0, 0.28);
}

.slide[data-layout="trio"] .t-shot img {
  width: calc(100% - 2 * var(--frame));
  height: calc(100% - 2 * var(--frame));
  max-height: none;
  box-shadow: none;
  object-position: center;
  transform: scale(var(--zoom, 1));
  clip-path: inset(calc(50% - 50% / var(--zoom, 1)) round calc(12px / var(--zoom, 1)));
}

/* Narrow desktops squash the side tiles too flat for any zoom to keep the content whole. */
@media (min-width: 901px) and (max-width: 1080px) {
  .slide[data-layout="trio"] .t-zoom img { --zoom: 1; }
}

/* Two by two halves: name over description, then three images in reading order. */
.slide[data-layout="quad"] { grid-template-rows: minmax(0, 1fr) auto calc(50% - var(--gap) / 2); }
.slide[data-layout="quad"] .t-name { grid-area: 1 / 1 / 2 / 7; }
.slide[data-layout="quad"] .t-desc { grid-area: 2 / 1 / 3 / 7; container-type: normal; }
.slide[data-layout="quad"] .t-desc + .t-wide { grid-area: 1 / 7 / 3 / 13; }
.slide[data-layout="quad"] .t-desc + .t-wide + .t-wide { grid-area: 3 / 1 / 4 / 7; }
.slide[data-layout="quad"] .t-desc + .t-wide + .t-wide + .t-wide { grid-area: 3 / 7 / 4 / 13; }

/* Magnifier: one WebGL lens that follows a fine pointer over project images. */
.lens {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9000;
  width: 320px;
  height: 320px;
  pointer-events: none;
}

.lens canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 22px 48px -14px rgba(0, 0, 0, 0.5), 0 4px 12px -4px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: scale(0.55);
  transition: opacity 0.3s var(--ease), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.lens.is-on canvas {
  opacity: 1;
  transform: none;
}

.lens-on .cursor-dot { visibility: hidden; }

/* Name over description in one phone-wide column, then two full-height phones. */
.slide[data-layout="pair"] { grid-template-rows: minmax(0, 1fr) auto; }
.slide[data-layout="pair"] .t-name { grid-area: 1 / 1 / 2 / 5; }
.slide[data-layout="pair"] .t-desc { grid-area: 2 / 1 / 3 / 5; container-type: normal; }
.slide[data-layout="pair"] .t-desc + .t-phone { grid-area: 1 / 5 / 3 / 9; }
.slide[data-layout="pair"] .t-phone + .t-phone { grid-area: 1 / 9 / 3 / 13; }
.slide[data-layout="pair"] .t-phone { --ratio: 832 / 1620; aspect-ratio: auto; }

/* Screenshots sit whole inside the same dotted frame as the placeholders. */
.t-shot {
  --frame: clamp(14px, 9cqmin, 36px);
  --ratio: 1280 / 716;
  background-color: #f2f2f2;
  background-image: radial-gradient(circle, rgba(17, 17, 17, 0.16) 1.1px, transparent 1.6px);
  background-size: 11px 11px;
}

.t-phone { --ratio: 640 / 1314; aspect-ratio: 5 / 9; }
.t-logo { background: #e8e6e1; }

.t-shot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.t-shot img {
  position: absolute;
  inset: 0;
  width: min(100cqw - 2 * var(--frame), (100cqh - 2 * var(--frame)) * var(--ratio));
  height: auto;
  max-height: calc(100cqh - 2 * var(--frame));
  margin: auto;
  border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 10px 28px -12px rgba(0, 0, 0, 0.28);
  object-fit: cover;
  object-position: top;
}

.t-phone img { border-radius: 16px; }

.t-logo img {
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
  object-position: center;
}

.t-desc .t-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  color: #161616;
  text-decoration: none;
  transition: opacity 0.45s var(--ease);
}

.t-link svg { width: 16px; height: 16px; }
.t-link:hover { opacity: 0.55; }

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 36px;
}

.carousel-status {
  display: flex;
  align-items: center;
  gap: 24px;
}

.carousel-count {
  min-width: 4.5em;
  margin: 0;
  color: #111;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.carousel-count span { color: #5a5a5a; }

.carousel-dots {
  display: flex;
  align-items: center;
  gap: 6px;
}

.carousel-dots button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.carousel-dots button::before {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  margin: auto;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.22);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.45s var(--ease);
}

.carousel-dots button:hover::before { background: rgba(17, 17, 17, 0.5); }

.carousel-dots button[aria-current="true"] { width: 40px; }

.carousel-dots button[aria-current="true"]::before {
  width: 32px;
  background: #111;
}

/* Dark theme: the field and page type invert; tiles, pills, and the menu keep their own surfaces. */

html.theme-dark {
  color-scheme: dark;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.theme-dark body,
.theme-dark #field { background: #181818; }

.theme-dark body { color: #f2f2f2; }

.theme-dark ::selection {
  background: #f2f2f2;
  color: #111;
}

.theme-dark .page-title,
.theme-dark .carousel-count { color: #f2f2f2; }

.theme-dark .page-lede,
.theme-dark .carousel-count span { color: #a5a5a5; }

.theme-dark .colophon { color: #e6e6e6; }

.theme-dark .t-name {
  background: #262626;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}

.theme-dark .t-shot::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09); }

.theme-dark .carousel-dots button::before { background: rgba(255, 255, 255, 0.24); }
.theme-dark .carousel-dots button:hover::before { background: rgba(255, 255, 255, 0.55); }
.theme-dark .carousel-dots button[aria-current="true"]::before { background: #f2f2f2; }

.theme-dark .round-button:focus-visible,
.theme-dark:not(.menu-open) .menu-toggle:focus-visible,
.theme-dark:not(.menu-open) .back-home:focus-visible { outline-color: #f2f2f2; }

/* Blog */

.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(0, 1fr);
  align-items: start;
  gap: var(--gap);
}

.feed {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.post {
  padding: 40px 44px 36px;
  border-radius: 28px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  color: #161616;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  color: #5a5a5a;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.post-meta a { color: inherit; }

.post h2 {
  margin: 20px 0 16px;
  color: #111;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.08;
  text-wrap: balance;
}

.post-meta + .post-body { margin-top: 20px; }

.post-body p {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.62;
  text-wrap: pretty;
}

.post-body p:last-child { margin-bottom: 0; }

.post-media {
  position: relative;
  margin: 28px 0 0;
  overflow: hidden;
  border-radius: 18px;
  background: #f2f2f2;
}

.post-media img,
.post-media video {
  display: block;
  width: 100%;
  height: auto;
}

.post-media video { background: #050505; }

.post-media.is-placeholder {
  aspect-ratio: 16 / 9;
  background-image: radial-gradient(circle, rgba(17, 17, 17, 0.16) 1.1px, transparent 1.6px);
  background-size: 11px 11px;
}

.post-media figcaption {
  padding: 12px 16px 14px;
  background: #fff;
  color: #5a5a5a;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.post-media.is-placeholder figcaption {
  position: absolute;
  left: 18px;
  bottom: 16px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 13px;
  letter-spacing: -0.03em;
}

/* Several images share one row. gallery.js opens the full frame on click. */

.post-gallery {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 28px;
}

.post-gallery .post-media {
  flex: 0 0 auto;
  margin: 0;
  overflow: visible;
  border-radius: 0;
  background: transparent;
}

.post-zoom {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #111;
  color: inherit;
  cursor: zoom-in;
}

.post-gallery .post-media img {
  width: auto;
  height: var(--thumb-h, 280px);
  max-width: none;
  transition: transform 0.5s var(--ease);
}

.post-zoom::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background:
    #fff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23111' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M8 4H4v4M12 4h4v4M8 16H4v-4M12 16h4v-4'/></svg>")
    center / 13px no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

@media (hover: hover) {
  .post-zoom:hover img { transform: scale(1.04); }
}

.lightbox {
  width: max-content;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
  animation: lightbox-in 0.35s var(--ease);
}

.lightbox::backdrop { background: rgba(17, 17, 17, 0.82); }

.lightbox figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 0;
}

.lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(960px, calc(100vw - 128px));
  max-height: min(86dvh, 1100px);
  border-radius: 18px;
}

.lightbox figcaption {
  max-width: 40rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  text-wrap: pretty;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next { position: fixed; }

.lightbox-close { top: 20px; right: 20px; }

.lightbox-prev,
.lightbox-next { top: 50%; margin-top: -24px; }

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

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

/* Guiding principles: a manifesto, one statement per screen. */

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

.tenet {
  display: grid;
  grid-template-columns: minmax(120px, 200px) minmax(0, 1fr);
  align-content: center;
  gap: 0 40px;
  min-height: 76vh;
  padding: 80px 0;
  border-top: 1px solid rgba(17, 17, 17, 0.16);
}

.tenet .tenet-n {
  margin: 0;
  color: #111;
  font-family: Doto, "Space Grotesk", sans-serif;
  font-size: clamp(56px, 7vw, 104px);
  font-variation-settings: "ROND" 100;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.8;
}

.tenet h2 {
  margin: 0;
  color: #111;
  font-family: "DM Sans", Inter, sans-serif;
  font-size: clamp(44px, 7vw, 104px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.92;
  text-wrap: balance;
}

.tenet p {
  max-width: 34rem;
  margin: 36px 0 0;
  color: #5a5a5a;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
  text-wrap: pretty;
}

.reveal-ready .tenet h2 {
  clip-path: inset(0 0 100% 0);
  transform: translateY(0.3em);
  transition: clip-path 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-ready .tenet p,
.reveal-ready .tenet-n {
  opacity: 0;
  transition: opacity 1.1s cubic-bezier(0.16, 1, 0.3, 1) 0.25s;
}

.reveal-ready .tenet.is-in h2 {
  clip-path: inset(-0.1em -0.1em -0.3em -0.1em);
  transform: none;
}

.reveal-ready .tenet.is-in p,
.reveal-ready .tenet.is-in .tenet-n { opacity: 1; }

.vows {
  margin-top: 40px;
  padding: 88px 64px 64px;
  border-radius: 28px;
  background: #1c1c1c;
  color: #fff;
}

.vows h2 {
  margin: 0 0 64px;
  font-family: "DM Sans", Inter, sans-serif;
  font-size: clamp(52px, 8vw, 120px);
  font-weight: 600;
  letter-spacing: -0.05em;
  line-height: 0.86;
}

.vows h2 span { color: var(--accent); }

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

.vows li {
  padding: 32px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.vows h3 {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(26px, 3.2vw, 42px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1.05;
  text-wrap: balance;
}


/* Book recommendations */

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

.shelf li { border-top: 1px solid rgba(17, 17, 17, 0.14); }

.shelf li:last-child { border-bottom: 1px solid rgba(17, 17, 17, 0.14); }

.shelf a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  margin: 0 -24px;
  padding: 28px 24px;
  border-radius: 20px;
  color: #111;
  text-decoration: none;
  transition: background-color 0.45s var(--ease);
}

.shelf a:hover { background: #fff; }

.shelf-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 0.5em;
  min-width: 0;
}

.shelf-title {
  font-family: "DM Sans", Inter, sans-serif;
  font-size: clamp(30px, 3.8vw, 52px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
}

.shelf-author {
  color: #5a5a5a;
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 500;
  line-height: 1.3;
}

.shelf-go {
  flex: none;
  width: 22px;
  height: 22px;
  opacity: 0.4;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.45s var(--ease);
}

.shelf a:hover .shelf-go {
  opacity: 1;
  transform: translate(3px, -3px);
}

.shelf-topics {
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
}

.shelf-topics::before {
  content: "·";
  margin: 0 0.45em;
  color: var(--accent);
}

/* Shared states */

.menu-toggle:focus-visible,
.back-home:focus-visible,
.menu a:focus-visible,
.button:focus-visible,
.round-button:focus-visible,
.tl-years button:focus-visible,
.tl-pick:focus-visible,
.carousel-dots button:focus-visible,
.t-link:focus-visible,
.paper a:focus-visible,
.post a:focus-visible,
.post-zoom:focus-visible,
.shelf a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.shelf a:focus-visible { outline-offset: -2px; }

@media (max-width: 900px) {
  .bar { padding: 16px; }
  .menu-toggle,
  .back-home {
    position: relative;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    gap: 0;
  }
  .back-home span,
  .menu-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    min-width: 0;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .menu { padding: 104px 16px 24px; }
  .menu-pages a { font-size: clamp(30px, 8.2vw, 44px); }
  .page-main { width: calc(100% - 32px); padding-top: 120px; }
  .page .colophon { margin-top: 80px; }
  .page-head { margin-bottom: 48px; }
  .page-title { font-size: clamp(40px, 12vw, 88px); overflow-wrap: break-word; }
  .page-lede { margin-top: 24px; font-size: 18px; }
  .page-lost .page-main { padding-top: 80px; padding-bottom: 24px; }
  .page-lost .colophon { margin-top: 0; }
  .page-lost .lost-code { font-size: clamp(72px, 24vw, 148px); }
  .page-lost .button { margin-top: 32px; }
  .paper,
  .post { padding: 28px 22px 32px; border-radius: 22px; }
  .doc-status { font-size: 16px; }

  .about-intro { grid-template-columns: 1fr; gap: 36px; margin-bottom: 48px; }
  .portrait { width: min(72vw, 300px); }
  .about-role { margin-top: 18px; }

  .tl-nav { display: none; }
  .tl-viewport {
    width: auto;
    margin: 0;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .tl-track {
    flex-direction: column;
    gap: 0;
    padding: 0;
    transform: none !important;
  }
  .tl-entry {
    flex: none;
    padding: 0 0 44px 32px;
    transform: none;
  }
  .tl-entry::before {
    top: 6px;
    bottom: 0;
    left: 5px;
    right: auto;
    width: 1px;
    height: auto;
  }
  .tl-entry:last-child::before { bottom: auto; height: 24px; }
  .tl-node { top: 2px; }
  .tl-company { margin: 12px 0 10px; font-size: clamp(40px, 11vw, 56px); }
  .tl-role { font-size: 17px; }
  .tl-entry:not(.is-focus) .tl-products-wrap { grid-template-rows: 0fr; }
  .tl-products { margin-top: 24px; }
  .tl-entry:not(.is-focus) .tl-products { margin-top: 0; }

  .slide {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    gap: 16px;
    aspect-ratio: auto;
  }
  .slide .tile { grid-area: auto !important; }
  .carousel.is-ready .tile,
  .carousel.is-ready .slide:not(.is-active) .tile {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .slide .t-name { order: 1; aspect-ratio: 2 / 1; }
  .slide .t-i1 { order: 2; aspect-ratio: 4 / 3; }
  .slide .t-desc { order: 3; container-type: normal; }
  .slide .t-i2 { order: 4; aspect-ratio: 16 / 10; }
  .slide[data-layout="screens"],
  .slide[data-layout="docs"] { grid-template-rows: none; }
  .slide[data-layout="pair"],
  .slide[data-layout="trio"],
  .slide[data-layout="quad"] { grid-template-rows: none; }
  .slide[data-layout="trio"] .t-main { --zoom: 1.4; }
  .slide[data-layout="screens"],
  .slide[data-layout="pair"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slide[data-layout="screens"] .t-name,
  .slide[data-layout="screens"] .t-desc,
  .slide[data-layout="pair"] .t-name,
  .slide[data-layout="pair"] .t-desc { grid-column: 1 / -1 !important; }
  .slide[data-layout="screens"] .t-phone,
  .slide[data-layout="pair"] .t-phone { aspect-ratio: 5 / 9; }
  .slide .t-shot { order: 4; border-radius: 20px; }
  .slide .t-logo { aspect-ratio: 4 / 3; }
  .slide .t-wide { order: 5; aspect-ratio: 16 / 10; }
  .t-shot:not(.t-logo) img { border-radius: 8px; }
  .t-phone img { border-radius: 12px; }
  .t-name h2 { font-size: clamp(40px, 12vw, 64px); }
  .carousel-controls { margin-top: 24px; }
  .carousel-dots { display: none; }

  .blog-layout { grid-template-columns: minmax(0, 1fr); }
  .post h2 { font-size: 26px; }
  .post-gallery .post-media img { height: var(--thumb-h, 200px); }
  .lightbox img { max-width: calc(100vw - 32px); }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }

  .tenet { grid-template-columns: minmax(0, 1fr); gap: 28px; min-height: 0; padding: 56px 0; }
  .tenet p { margin-top: 24px; font-size: 18px; }
  .vows { padding: 48px 22px 32px; border-radius: 22px; }
  .vows h2 { margin-bottom: 36px; }
  .vows li { padding: 24px 0; }

  .shelf a { margin: 0 -12px; padding: 22px 12px; gap: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .menu,
  .menu-open .menu,
  .menu-pages li,
  .menu-open .menu-pages li,
  .menu-foot,
  .menu-open .menu-foot,
  .menu-toggle-lines span,
  .tl-track,
  .tl-entry,
  .tl-products-wrap,
  .carousel-viewport,
  .carousel-track,
  .carousel.is-ready .tile,
  .lens canvas,
  .reveal-ready .tenet h2,
  .reveal-ready .tenet p,
  .reveal-ready .tenet-n,
  .button svg,
  .shelf-go,
  .post-zoom img,
  .lightbox { transition: none !important; animation: none !important; }
  .leave-sheet,
  .leave-cover.is-covering .leave-sheet { transition: none; }
  .reveal-ready .tenet h2 { clip-path: none; transform: none; }
  .reveal-ready .tenet p,
  .reveal-ready .tenet-n { opacity: 1; }
}
