/* ==========================================================================
   Kartik Patath — site styles
   Paper + ink, one route-blue accent. The only other colour is the red of the Mars yard photos. Display and text: Bricolage Grotesque.
   Data labels: Geist Mono.
   ========================================================================== */

:root {
  --paper: #f4f2ec;
  --paper-2: #e9e6de;
  --ink: #15140f;
  --ink-2: #5d5b54;
  --ink-3: #c9c6bc;
  --line: rgba(21, 20, 15, 0.16);
  --route: #2346f5;

  /* The projects stage and the footer stay dark in both themes */
  --stage: #151513;
  --stage-ink: #f1efe8;
  --stage-ink-2: #9d9a91;
  --stage-ink-3: #45443f;
  --stage-line: rgba(241, 239, 232, 0.14);
  --sheet: #dedbd3;
  --sheet-ink: #15140f;

  --sans: "Bricolage Grotesque", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(1.25rem, 5.5vw, 5.5rem);
  --max: 77.5rem;
  --ease: cubic-bezier(0.2, 0.75, 0.2, 1);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #121210;
  --paper-2: #1f1e1b;
  --ink: #f1efe8;
  --ink-2: #a5a299;
  --ink-3: #3d3c37;
  --line: rgba(241, 239, 232, 0.16);
  --route: #8497ff;
  --stage: #0a0a09;
  color-scheme: dark;
}

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

/* One scale for the whole site. Up to about 87.5rem wide the root size is the
   reader's default. Beyond that it grows with the window so the content
   column (77.5rem) keeps reaching both gutters, and every section widens
   together. The vh term stops it on very wide, short windows. */
html {
  font-size: clamp(100%, min(1.2903vw - 2.27px, 2.71vh), 200%);
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Paper grain over everything, never in the way of clicks */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.13;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

:root[data-theme="dark"] body::after {
  mix-blend-mode: soft-light;
  opacity: 0.3;
}

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

ol,
ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

:focus-visible {
  outline: 2px solid var(--route);
  outline-offset: 3px;
  border-radius: 0.25rem;
}

.defs {
  position: absolute;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.skip {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 200;
  padding: 0.625rem 1rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 0.5rem;
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

/* Section headings fade from faint to full ink once, when they scroll in */
.js .ink-in {
  color: var(--ink-3);
  transition: color 1.1s var(--ease);
}

.js .ink-in.is-in {
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Navigation pill
   -------------------------------------------------------------------------- */

.bar {
  position: fixed;
  top: clamp(0.75rem, 2.4vh, 1.625rem);
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.pill {
  pointer-events: auto;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.4375rem 0.4375rem 0.4375rem 1.125rem;
  background: #15140f;
  color: #f4f2ec;
  border: 1px solid rgba(244, 242, 236, 0.14);
  border-radius: 0.875rem;
  box-shadow: 0 0.625rem 1.875rem -12px rgba(0, 0, 0, 0.45);
}

.pill__name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  margin-right: clamp(0.625rem, 3vw, 2.25rem);
}

.pill__links {
  display: flex;
  gap: 2px;
}

.pill__links a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(244, 242, 236, 0.72);
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}

.pill__links a:hover,
.pill__links a[aria-current="true"] {
  color: #f4f2ec;
  background: rgba(244, 242, 236, 0.12);
}

.pill__btn {
  display: grid;
  place-items: center;
  width: 2.375rem;
  height: 2.375rem;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0.5625rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.pill__btn:hover {
  background: rgba(244, 242, 236, 0.12);
}

.pill__menu {
  display: none;
  background: #f4f2ec;
  color: #15140f;
}

.pill__menu:hover {
  background: #fff;
}

.icon--sun {
  display: none;
}

:root[data-theme="dark"] .icon--sun {
  display: block;
}

:root[data-theme="dark"] .icon--moon {
  display: none;
}

@media (max-width: 860px) {
  .pill {
    padding-left: 1rem;
  }

  .pill__name {
    margin-right: clamp(2.5rem, 22vw, 7.5rem);
  }

  .pill__menu {
    display: grid;
  }

  .pill__links {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 0.5rem;
    background: #15140f;
    border: 1px solid rgba(244, 242, 236, 0.14);
    border-radius: 0.875rem;
    box-shadow: 0 1.125rem 2.5rem -16px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s, transform 0.2s var(--ease), visibility 0.2s;
  }

  .pill__links.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .pill__links a {
    padding: 0.75rem 0.875rem;
    font-size: 1.0625rem;
  }
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  min-height: 3rem;
  padding: 0 1.25rem;
  border: 1px solid var(--ink);
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--solid {
  background: var(--ink);
  color: var(--paper);
}

.btn--solid:hover {
  background: var(--route);
  border-color: var(--route);
  color: #fff;
}

.btn .icon {
  transition: transform 0.25s var(--ease);
}

.btn:hover .icon {
  transform: translate(2px, -2px);
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: 6.125rem 0 clamp(1.875rem, 5vh, 3.5rem);
  overflow: hidden;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hero__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.hero__title {
  font-size: clamp(2rem, 3.6vw, 4.6rem);
  font-weight: 800;
  font-stretch: 96%;
  line-height: 1;
  letter-spacing: -0.025em;
}

.hero__note {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding-bottom: 0.25rem;
  font-size: clamp(0.875rem, 0.82vw, 1.125rem);
  color: var(--ink-2);
}

.wall__pause {
  padding: 0.3125rem 0.6875rem;
  border: 1px solid var(--ink-3);
  border-radius: 62.4375rem;
  background: none;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 0.6875rem;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.wall__pause:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.no-js .wall__pause {
  display: none;
}

/* The name is a window. Clips play behind it and show only through the
   letters: the mask is page-coloured with black type, blended "lighten",
   so black lets the clip through and the page colour stays the page. */
.name {
  position: relative;
  height: 20.6vw;
  margin-top: 0.625rem;
  overflow: hidden;
  isolation: isolate;
}

.name__strip {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1.05fr 1.05fr 1fr 0.95fr 0.5fr 1.05fr;
}

/* Never let a clip get lighter than the page, or the letter would vanish */
.name__strip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--paper);
  mix-blend-mode: darken;
}

.name__cell {
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.name__cell video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.92) contrast(1.06);
}

.name__cell.is-bright video {
  filter: brightness(0.7) contrast(1.15) saturate(1.1);
}

.name__cell.is-zoom video {
  object-position: 50% 30%;
  transform: scale(1.5);
  transform-origin: 50% 38%;
}

.name__mask {
  position: absolute;
  inset: -2px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  color: #000;
  mix-blend-mode: lighten;
  font-size: 28vw;
  font-weight: 800;
  line-height: 0.72;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}

.name__mask span {
  display: block;
}

/* Dark page: the same trick, mirrored */
:root[data-theme="dark"] .name__strip::after {
  mix-blend-mode: lighten;
}

:root[data-theme="dark"] .name__mask {
  color: #fff;
  mix-blend-mode: darken;
}

:root[data-theme="dark"] .name__cell video,
:root[data-theme="dark"] .name__cell.is-bright video {
  filter: contrast(0.8) brightness(1.25);
}

.name__legend {
  display: grid;
  grid-template-columns: 1.05fr 1.05fr 1fr 0.95fr 0.5fr 1.05fr;
  margin-top: 0.625rem;
}

.name__legend li {
  padding: 0 0.625rem 0 2px;
  font-size: clamp(0.6875rem, 0.78vw, 1rem);
  line-height: 1.25;
}

.name__legend b {
  font-weight: 600;
}

.name__legend span {
  display: block;
  margin-top: 1px;
  font-family: var(--mono);
  font-size: clamp(0.5625rem, 0.6vw, 0.8125rem);
  color: var(--ink-2);
}

.hero__grid {
  position: relative;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(20rem, 1.1fr) minmax(0, 0.8fr) minmax(0, 1.15fr);
  gap: clamp(1.25rem, 3vw, 3rem);
  align-items: stretch;
  min-height: clamp(15.625rem, 22vw, 27.5rem);
  max-height: 34vw;
  margin-top: clamp(0.75rem, 2vh, 1.5rem);
}

/* The portrait is a cut-out: it stands on the page under the name */
.hero__me {
  position: relative;
}

.hero__me img {
  position: absolute;
  left: 0;
  bottom: calc(-1 * clamp(1.875rem, 5vh, 3.5rem));
  width: 100%;
  height: calc(100% + clamp(1.875rem, 5vh, 3.5rem));
  object-fit: contain;
  object-position: 0 100%;
  filter: grayscale(1) contrast(1.05);
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent 99%);
  mask-image: linear-gradient(to bottom, #000 78%, transparent 99%);
  transition: filter 0.6s var(--ease);
}

.hero__me:hover img {
  filter: none;
}

.hero__intro {
  position: relative;
  z-index: 1;
  align-self: center;
}

.hero__role {
  font-size: clamp(1.35rem, 2vw, 2.6rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.025em;
}

.hero__now {
  margin-top: clamp(1rem, 2.4vh, 1.625rem);
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  max-width: 22em;
  font-size: clamp(1rem, 1.05vw, 1.4rem);
}

.hero__now dt {
  font-size: 0.8125em;
  color: var(--ink-2);
  margin-bottom: 0.375rem;
}

.hero__now dd {
  display: grid;
  gap: 2px;
  font-size: 1em;
  line-height: 1.35;
}

.hero__now strong {
  font-weight: 700;
}

.hero__now span {
  color: var(--ink-2);
}

.hero__pitch {
  position: relative;
  z-index: 1;
  align-self: center;
}

.hero__pitch p {
  max-width: 24ch;
  font-size: clamp(1.3rem, 1.95vw, 2.6rem);
  font-weight: 400;
  line-height: 1.22;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

.hero__pitch strong {
  font-weight: 750;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
  margin-top: clamp(1.125rem, 3vh, 1.875rem);
}

/* One load sequence for the hero, nothing else animates on its own */
@media (prefers-reduced-motion: no-preference) {
  .js .hero__head,
  .js .name,
  .js .name__legend,
  .js .hero__grid {
    animation: rise 0.9s var(--ease) both;
  }

  .js .name {
    animation-delay: 0.08s;
  }

  .js .name__legend {
    animation-delay: 0.16s;
  }

  .js .hero__grid {
    animation-delay: 0.26s;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.375rem);
  }
}

@media (max-width: 959px) {
  .hero {
    min-height: 0;
    padding-top: 5.5rem;
  }

  .hero__head {
    flex-wrap: wrap;
  }

  .name__legend {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.625rem 0.5rem;
    margin-top: 0.875rem;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    min-height: 0;
    margin-top: 1.75rem;
  }

  .hero__me {
    max-width: 18.75rem;
  }

  .hero__me img {
    position: static;
    width: 100%;
    height: auto;
    object-fit: fill;
  }

  .hero__grid {
    max-height: none;
  }

  .hero__intro,
  .hero__pitch {
    align-self: start;
  }
}

@media (min-width: 640px) and (max-width: 959px) {
  .hero__grid {
    grid-template-columns: minmax(15rem, 0.8fr) minmax(0, 1fr);
    column-gap: 2.25rem;
    align-items: center;
  }

  .hero__me {
    grid-row: 1 / 3;
  }
}

@media (max-width: 560px) {
  .hero__note span {
    display: none;
  }

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

/* --------------------------------------------------------------------------
   Section heads
   -------------------------------------------------------------------------- */

.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
}

.head__title {
  font-size: clamp(2.9rem, 6.4vw, 5.5rem);
  font-weight: 750;
  font-stretch: 96%;
  line-height: 0.95;
  letter-spacing: -0.022em;
}

.head__note {
  flex: none;
  padding-top: clamp(0.625rem, 1.6vw, 1.625rem);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink-2);
}

@media (max-width: 640px) {
  .head {
    flex-direction: column;
    gap: 0.875rem;
  }

  .head__note {
    padding-top: 0;
  }

  .head__note br {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   About + toolbox
   -------------------------------------------------------------------------- */

.about {
  padding: clamp(5.5rem, 13vh, 9.375rem) 0 clamp(5rem, 12vh, 8.75rem);
}

.about__body {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  margin-top: clamp(2.5rem, 6vh, 4.5rem);
}

.about__lede {
  max-width: 30ch;
  font-size: clamp(1.45rem, 2.5vw, 2.125rem);
  font-weight: 450;
  line-height: 1.22;
  letter-spacing: -0.022em;
  text-wrap: pretty;
}

.about__facts {
  display: grid;
  gap: 1.375rem;
  align-content: start;
}

.about__facts div {
  padding-top: 0.875rem;
  border-top: 1px solid var(--line);
}

.about__facts dt {
  font-size: 0.8125rem;
  color: var(--ink-2);
  margin-bottom: 0.25rem;
}

.about__facts dd {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
}

/* Three columns that step down like survey stations */
.tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.75rem);
  margin-top: clamp(4rem, 10vh, 7.5rem);
}

.tools__col {
  padding-top: 1.625rem;
  border-top: 1px solid var(--ink);
}

.tools__col:nth-child(2) {
  margin-top: 3.5rem;
}

.tools__col:nth-child(3) {
  margin-top: 7rem;
}

.tools__col h3 {
  max-width: 12ch;
  font-size: clamp(1.4rem, 2.1vw, 1.8rem);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.tools__col p {
  max-width: 30ch;
  margin-top: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 1.375rem;
}

.chip {
  padding: 0.5rem 0.75rem;
  background: var(--paper-2);
  border-radius: 0.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
}

.chip--on {
  background: var(--ink);
  color: var(--paper);
}

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

  .tools {
    grid-template-columns: 1fr;
    gap: 2.75rem;
  }

  .tools__col:nth-child(2),
  .tools__col:nth-child(3) {
    margin-top: 0;
  }

  .tools__col h3 {
    max-width: none;
  }
}

/* --------------------------------------------------------------------------
   Research: the snake robot, and the ladder a policy has to climb
   -------------------------------------------------------------------------- */

.research {
  padding: clamp(2.5rem, 6vh, 4.5rem) 0 clamp(5.5rem, 13vh, 9.375rem);
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
  margin-top: clamp(3rem, 8vh, 5.5rem);
}

/* The folder: one project, filed. Sheets lift when you reach for it */
.folder {
  --f-back: #c8b88e;
  --f-front: #dfd1a9;
  --f-ink: #2a2414;
  position: relative;
  display: block;
  aspect-ratio: 5 / 4;
  max-width: 38.75rem;
  color: var(--f-ink);
  text-decoration: none;
}

:root[data-theme="dark"] .folder {
  --f-back: #96875f;
  --f-front: #b9a97c;
}

.folder__tab {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  height: 10%;
  padding: 0 2.75rem 0 1.25rem;
  background: var(--f-back);
  border-radius: 0.75rem 0 0 0;
  clip-path: polygon(0 0, calc(100% - 1.625rem) 0, 100% 100%, 0 100%);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
}

.folder__back {
  position: absolute;
  inset: 9.6% 0 0 0;
  background: var(--f-back);
  border-radius: 0 1rem 1rem 1rem;
}

.folder__sheet {
  position: absolute;
  top: 15%;
  width: 44%;
  aspect-ratio: 4 / 3;
  padding: 0.3125rem;
  background: #f7f4ec;
  border-radius: 0.3125rem;
  box-shadow: 0 0.5rem 1.25rem rgba(42, 36, 20, 0.22);
  transition: transform 0.55s var(--ease);
}

.folder__sheet img,
.folder__sheet video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
  background: #3a0704;
}

.folder__sheet--1 { left: 5%; transform: rotate(-5deg); }
.folder__sheet--2 { left: 28%; top: 12%; transform: rotate(1.5deg); }
.folder__sheet--3 { left: 51%; transform: rotate(6deg); }

.folder:hover .folder__sheet--1,
.folder:focus-visible .folder__sheet--1 { transform: translateY(-13%) rotate(-7deg); }
.folder:hover .folder__sheet--2,
.folder:focus-visible .folder__sheet--2 { transform: translateY(-17%) rotate(1.5deg); }
.folder:hover .folder__sheet--3,
.folder:focus-visible .folder__sheet--3 { transform: translateY(-13%) rotate(8deg); }

.folder__front {
  position: absolute;
  inset: 42% 0 0 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: clamp(1.125rem, 2.6vw, 1.875rem);
  background: var(--f-front);
  border-radius: 0.5rem 0.5rem 1rem 1rem;
  box-shadow: 0 -8px 1.125rem rgba(42, 36, 20, 0.16);
  transform-origin: 50% 100%;
  transition: transform 0.55s var(--ease);
}

.folder:hover .folder__front,
.folder:focus-visible .folder__front {
  transform: perspective(68.75rem) rotateX(-9deg);
}

.folder__kicker {
  font-family: var(--mono);
  font-size: 0.75rem;
}

.folder__title {
  max-width: 20ch;
  font-size: clamp(1.25rem, 2.2vw, 1.8rem);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.folder__meta {
  font-size: 0.9375rem;
  opacity: 0.78;
}

.feature__text h3 {
  font-size: clamp(1.8rem, 3.2vw, 2.6rem);
  font-weight: 750;
  line-height: 1.02;
  letter-spacing: -0.028em;
}

.feature__text h3 span {
  display: block;
  margin-top: 0.625rem;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-2);
}

.feature__text p {
  max-width: 46ch;
  margin-top: 1.125rem;
  color: var(--ink-2);
}

.feature__text p:first-of-type {
  margin-top: 1.5rem;
  color: var(--ink);
}

.feature__text .btn {
  margin-top: 1.75rem;
}

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

.doc figcaption,
.ladder__screen figcaption {
  margin-top: 0.625rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.45;
  color: var(--ink-2);
}

.ladder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: clamp(1.75rem, 5vw, 5rem);
  align-items: start;
  margin-top: clamp(4rem, 10vh, 7.5rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--ink);
}

.ladder__side h3 {
  max-width: 14ch;
  font-size: clamp(1.6rem, 2.8vw, 2.3rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.ladder__side > p {
  margin-top: 0.75rem;
  color: var(--ink-2);
}

.ladder__rungs {
  margin-top: clamp(1.25rem, 3vh, 2rem);
  border-bottom: 1px solid var(--line);
}

.rung {
  display: grid;
  grid-template-columns: 4.6em minmax(0, 1fr);
  column-gap: 0.75rem;
  width: 100%;
  padding: 0.8125rem 0 0.875rem;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  color: var(--ink-2);
  text-align: left;
  cursor: pointer;
  transition: color 0.2s;
}

.rung:hover {
  color: var(--ink);
}

.rung__n {
  grid-row: 1 / 3;
  padding-top: 0.25rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
}

.rung__t {
  font-size: 1.125rem;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.rung__d {
  display: none;
  margin-top: 0.3125rem;
  font-size: 0.9375rem;
  line-height: 1.45;
}

.rung[aria-pressed="true"] {
  color: var(--ink);
  border-top-color: var(--ink);
}

.rung[aria-pressed="true"] .rung__n {
  color: var(--route);
}

.rung[aria-pressed="true"] .rung__d {
  display: block;
  color: var(--ink-2);
}

.no-js .rung__d {
  display: block;
}

.ladder__frame {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 0.875rem;
  overflow: hidden;
  background: var(--stage);
}

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

.ladder__frame.is-contain {
  background: #fff;
}

.ladder__frame.is-contain video {
  object-fit: contain;
  padding: 3%;
}

.ladder__empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 12%;
  background: var(--paper-2);
  color: var(--ink);
  font-size: clamp(1.1rem, 1.9vw, 1.5rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

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

  .ladder__screen {
    order: -1;
  }

  .ladder__side h3 {
    max-width: none;
  }
}

/* --------------------------------------------------------------------------
   Experience: a trajectory with seven keyframes
   -------------------------------------------------------------------------- */

.path {
  padding: clamp(2.5rem, 6vh, 4.5rem) 0 clamp(6rem, 14vh, 10rem);
}

.path__track {
  position: relative;
  margin-top: clamp(3rem, 8vh, 5.5rem);
}

.path__line {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.path__line path {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.25;
}

.path__list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.375rem);
}

.kf:nth-child(even) {
  padding-top: 3.625rem;
}

.kf__head {
  display: grid;
  justify-items: start;
  gap: 0;
  width: 100%;
  padding: 0 0 0.875rem;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.kf__node {
  position: relative;
  width: 1.625rem;
  height: 1.625rem;
  margin-bottom: 1.375rem;
  border: 1.25px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  transition: background-color 0.25s, transform 0.25s var(--ease);
}

.kf__node::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--ink);
  transition: background-color 0.25s;
}

.kf__head:hover .kf__node {
  transform: scale(1.12);
}

.kf__head[aria-pressed="true"] .kf__node {
  background: var(--ink);
}

.kf__head[aria-pressed="true"] .kf__node::after {
  background: var(--paper);
}

.kf__node--now {
  border-color: var(--route);
  box-shadow: 0 0 0 0.3125rem color-mix(in srgb, var(--route) 18%, transparent);
}

.kf__head[aria-pressed="true"] .kf__node--now {
  background: var(--route);
}

.kf__flag {
  margin-bottom: 0.75rem;
  padding: 0.25rem 0.5rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 3px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.3;
}

.kf__dates {
  font-family: var(--mono);
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--ink-2);
}

.kf__title {
  margin-top: 0.75rem;
  font-size: clamp(0.95rem, 1.2vw, 1.0625rem);
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.kf__org {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.kf__place {
  margin-top: 2px;
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.kf__head[aria-pressed="false"] .kf__title,
.kf__head[aria-pressed="false"] .kf__org {
  color: var(--ink-2);
  transition: color 0.25s;
}

.kf__head[aria-pressed="false"]:hover .kf__title,
.kf__head[aria-pressed="false"]:hover .kf__org {
  color: var(--ink);
}

.kf__detail p + p,
.path__panel p + p {
  margin-top: 0.875rem;
}

/* With JS, role details move into one panel below the trajectory */
.js .kf__detail {
  display: none;
}

.no-js .kf__detail {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.path__panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  margin-top: clamp(2.25rem, 6vh, 4rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--ink);
  min-height: 11.875rem;
}

.path__panel:empty {
  display: none;
}

.panel__org {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.panel__meta {
  margin-top: 0.625rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-2);
}

.panel__media,
.kf__media {
  position: relative;
  aspect-ratio: 16 / 10;
  max-width: 22.5rem;
  margin-top: 1.25rem;
  border-radius: 0.625rem;
  overflow: hidden;
  background: var(--stage);
}

.panel__media video,
.kf__media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.js .kf__media {
  display: none;
}

.panel__text {
  max-width: 62ch;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.panel__text strong {
  color: var(--ink);
  font-weight: 650;
}

@media (prefers-reduced-motion: no-preference) {
  .panel__org,
  .panel__meta,
  .panel__text {
    animation: swap 0.35s var(--ease) both;
  }
}

@keyframes swap {
  from {
    opacity: 0;
    transform: translateY(0.375rem);
  }
}

/* Narrow screens: the trajectory runs straight down, every role stays open */
@media (max-width: 1023px) {
  .path__line,
  .js .path__panel {
    display: none;
  }

  .path__list {
    grid-template-columns: 1fr;
    gap: 0;
    padding-left: 2.75rem;
  }

  .path__list::before {
    content: "";
    position: absolute;
    top: 0.8125rem;
    bottom: 1.875rem;
    left: 0.7812rem;
    width: 1.25px;
    background: var(--ink);
  }

  .kf,
  .kf:nth-child(even) {
    position: relative;
    padding: 0 0 2.75rem;
  }

  .kf__head {
    padding-bottom: 0.75rem;
    cursor: default;
  }

  .kf__node {
    position: absolute;
    left: -44px;
    top: 0;
    margin: 0;
  }

  .kf__head:hover .kf__node {
    transform: none;
  }

  .kf__title {
    margin-top: 0.5rem;
    font-size: 1.35rem;
  }

  .kf__head[aria-pressed="false"] .kf__title,
  .kf__head[aria-pressed="false"] .kf__org {
    color: var(--ink);
  }

  .kf__head[aria-pressed="true"] .kf__node:not(.kf__node--now) {
    background: var(--paper);
  }

  .kf__head[aria-pressed="true"] .kf__node:not(.kf__node--now)::after {
    background: var(--ink);
  }

  .js .kf__media {
    display: block;
    margin: 0.25rem 0 1rem;
  }

  .js .kf__detail {
    display: block;
    max-width: 62ch;
    font-size: 1rem;
    color: var(--ink-2);
  }

  .kf__detail strong {
    color: var(--ink);
    font-weight: 650;
  }
}

/* --------------------------------------------------------------------------
   Projects: a dark stage with a deck of index cards
   -------------------------------------------------------------------------- */

.stage {
  --card-h: clamp(23.75rem, 62vh, 33.75rem);
  --card-w: calc(var(--card-h) * 0.714);
  position: relative;
  padding: clamp(5rem, 12vh, 8.5rem) 0 clamp(3.5rem, 8vh, 5.5rem);
  background: var(--stage);
  color: var(--stage-ink);
  overflow: hidden;
}

/* Faint survey grid on the stage floor */
.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--stage-line) 1px, transparent 1px);
  background-size: 100% 25%;
  opacity: 0.45;
  pointer-events: none;
}

.head--stage {
  position: relative;
}

.head--stage .head__note {
  color: var(--stage-ink-2);
}

.js .stage .ink-in {
  color: var(--stage-ink-3);
}

.js .stage .ink-in.is-in {
  color: var(--stage-ink);
}

.deck {
  position: relative;
  height: calc(var(--card-h) + 7.5rem);
  margin-top: clamp(0.5rem, 2vh, 1.75rem);
  touch-action: pan-y;
  outline-offset: -4px;
}

.deck__track {
  --deck-x: 50%;
  position: absolute;
  inset: 0;
  perspective: 93.75rem;
  perspective-origin: var(--deck-x) 46%;
}

.card {
  position: absolute;
  top: 50%;
  left: var(--deck-x);
  width: var(--card-w);
  height: var(--card-h);
  margin: calc(var(--card-h) / -2) 0 0 calc(var(--card-w) / -2);
  transform-style: preserve-3d;
  transition: transform 0.85s var(--ease), opacity 0.6s var(--ease);
  will-change: transform;
}

.card__btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  background: none;
  border: 0;
  text-align: left;
  cursor: pointer;
  transform-style: preserve-3d;
  -webkit-tap-highlight-color: transparent;
}

.card__btn:focus-visible {
  outline: none;
}

.card__btn:focus-visible .card__cover {
  box-shadow: inset 0 0 0 3px var(--route);
}

.card__tilt {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.5s var(--ease);
}

.card.is-tilting .card__tilt {
  transition-duration: 0.12s;
}

.card__page,
.card__cover {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 7% / 5%;
}

/* Inner pages peek out on the right and through the notch */
.card__page--back {
  inset: 2.5% 0 2.5% 6%;
  background: #2a2926;
  transform: translate3d(5.5%, 0, -14px);
}

.card__page--mid {
  inset: 1.2% 0 1.2% 4%;
  background: #454440
    repeating-linear-gradient(to bottom, transparent 0 0.9375rem, rgba(241, 239, 232, 0.2) 0.9375rem 1rem);
  background-origin: content-box;
  background-clip: border-box, content-box;
  padding: 26% 6% 26% 60%;
  transform: translate3d(3%, 0, -7px);
}

.card__cover {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  padding: 8.5% 8.5% 8%;
  background-color: var(--sheet);
  background-image:
    linear-gradient(105deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 38%, rgba(0, 0, 0, 0.06) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .22 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--sheet-ink);
  clip-path: url(#card-shape);
  border-radius: 0;
}

.card__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #0a0a09;
  opacity: var(--dim, 0);
  transition: opacity 0.7s var(--ease);
  pointer-events: none;
}

.card__top {
  padding-bottom: 5%;
  border-bottom: 1px solid rgba(21, 20, 15, 0.16);
  font-family: var(--mono);
  font-size: calc(var(--card-h) * 0.0235);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.card__num {
  align-self: end;
  justify-self: end;
  margin-right: 7%;
  font-size: calc(var(--card-h) * 0.4);
  font-weight: 800;
  font-stretch: 84%;
  line-height: 0.82;
  letter-spacing: -0.07em;
  font-variant-numeric: lining-nums;
}

.card__title {
  margin-top: 7%;
  padding-top: 6%;
  border-top: 1px solid rgba(21, 20, 15, 0.16);
  min-height: calc(var(--card-h) * 0.2);
  font-size: calc(var(--card-h) * 0.05);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: calc(var(--card-h) * 0.0215);
  font-weight: 500;
}

.card__tag {
  padding: 0.45em 0.8em;
  border: 1px solid rgba(21, 20, 15, 0.45);
  border-radius: 62.4375rem;
}

.card__kind {
  margin-right: 3%;
}

.card.is-active .card__btn {
  cursor: zoom-in;
}

/* Before the stage scrolls into view the deck waits edge-on, below its mark */
.deck.is-waiting .card {
  transition: none;
}

/* Details live in the page for crawlers and no-JS readers; JS moves them into the reader */
.js .card__detail {
  display: none;
}

.deck__read {
  position: absolute;
  z-index: 200;
  top: 50%;
  left: max(var(--gutter), calc((100% - var(--max)) / 2));
  width: min(18.75rem, 25vw);
  transform: translateY(-50%);
}

.deck__meta {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--stage-ink-2);
}

.deck__lede {
  margin-top: 0.875rem;
  font-size: clamp(1.25rem, 1.9vw, 1.6rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

.deck__open {
  margin-top: 1.625rem;
  border-color: var(--stage-ink);
  background: var(--stage-ink);
  color: var(--stage);
  cursor: pointer;
}

.deck__open:hover {
  background: var(--route);
  border-color: var(--route);
  color: #fff;
}

@media (prefers-reduced-motion: no-preference) {
  .deck__read > * {
    animation: swap 0.4s var(--ease) both;
  }
}

@media (min-width: 1000px) {
  .deck__track {
    --deck-x: 58%;
  }
}

@media (max-width: 999px) {
  .deck {
    height: auto;
  }

  .deck__track {
    position: relative;
    height: calc(var(--card-h) + 5.625rem);
  }

  .deck__read {
    position: static;
    width: min(100% - 2 * var(--gutter), 32.5rem);
    margin: 0.25rem var(--gutter) 2.125rem;
    transform: none;
  }
}

.no-js .deck__read {
  display: none;
}

.deck__bar {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.25rem;
}

.deck__count {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--stage-ink-2);
}

.deck__count span:first-child {
  color: var(--stage-ink);
}

.deck__ticks {
  display: flex;
  gap: 2px;
}

.deck__ticks button {
  display: grid;
  place-items: center;
  min-width: 2.125rem;
  height: 2.5rem;
  padding: 0 0.25rem;
  background: none;
  border: 0;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--stage-ink-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.deck__ticks button:hover {
  color: var(--stage-ink);
}

.deck__ticks button[aria-current="true"] {
  color: var(--stage-ink);
  border-bottom-color: var(--stage-ink);
}

.deck__nav {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.round {
  display: grid;
  place-items: center;
  width: 2.875rem;
  height: 2.875rem;
  padding: 0;
  background: none;
  border: 1px solid var(--stage-line);
  border-radius: 50%;
  color: var(--stage-ink);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.round:hover:not(:disabled) {
  background: var(--stage-ink);
  border-color: var(--stage-ink);
  color: var(--stage);
}

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

@media (max-width: 640px) {
  .stage {
    --card-h: clamp(21.25rem, 56vh, 27.5rem);
  }

  .deck__bar {
    grid-template-columns: 1fr auto;
  }

  .deck__ticks {
    display: none;
  }
}

/* Without JS the deck becomes a plain readable grid */
.no-js .deck {
  height: auto;
}

.no-js .deck__track {
  position: static;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.25rem, 1fr));
  gap: 1.75rem;
  width: min(100% - 2 * var(--gutter), var(--max));
  margin: 2.5rem auto 0;
  perspective: none;
}

.no-js .card {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
}

.no-js .card__btn {
  height: calc(var(--card-h) * 0.7);
  width: calc(var(--card-h) * 0.5);
  --card-h: 23.75rem;
}

.no-js .card__detail {
  margin-top: 1rem;
  font-size: 0.9375rem;
  color: var(--stage-ink-2);
}

.no-js .deck__bar {
  display: none;
}

/* --------------------------------------------------------------------------
   Project reader (dialog)
   -------------------------------------------------------------------------- */

.sheet {
  width: min(100% - 1.5rem, 48.75rem);
  max-height: none;
  height: min(100dvh - 3rem, 56.25rem);
  margin: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--sheet-ink);
  overflow: visible;
}

.sheet::backdrop {
  background: rgba(10, 10, 9, 0.78);
  -webkit-backdrop-filter: blur(0.375rem);
  backdrop-filter: blur(0.375rem);
}

.sheet__page {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(1.5rem, 5vw, 3.5rem) clamp(1.375rem, 6vw, 4.25rem) clamp(2rem, 6vw, 4rem);
  background: var(--sheet);
  border-radius: 0.625rem;
}

.sheet__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid rgba(21, 20, 15, 0.16);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

.sheet__meta {
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: #5d5b54;
}

.sheet__title {
  margin-top: 0.5rem;
  font-size: clamp(2.1rem, 5.4vw, 3.4rem);
  font-weight: 750;
  font-stretch: 96%;
  line-height: 1;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.sheet__body {
  margin-top: clamp(1.25rem, 3vh, 1.875rem);
  max-width: 58ch;
}

.sheet__body .card__lede {
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.015em;
}

.sheet__body p + p {
  margin-top: 1rem;
}

.sheet__body .card__links {
  margin-top: 1.5rem;
}

.sheet__body .card__links a {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0 1.25rem;
  background: #15140f;
  color: #f4f2ec;
  border-radius: 0.375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s;
}

.sheet__body .card__links a:hover {
  background: #2346f5;
}

.sheet__media {
  margin-top: clamp(1.625rem, 4vh, 2.5rem);
  background: #cfccc3;
  border-radius: 0.5rem;
  overflow: hidden;
}

.sheet__media img,
.sheet__media video {
  display: block;
  width: 100%;
  max-height: 28.75rem;
  object-fit: contain;
}

.sheet__media [hidden] {
  display: none;
}

.sheet__close {
  position: absolute;
  top: 0;
  right: -58px;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: rgba(241, 239, 232, 0.1);
  border: 1px solid rgba(241, 239, 232, 0.22);
  border-radius: 0.5rem;
  color: #f1efe8;
  cursor: pointer;
}

.sheet__close:hover {
  background: #f1efe8;
  color: #15140f;
}

@media (max-width: 920px) {
  .sheet__close {
    top: 0.625rem;
    right: 0.625rem;
    background: #15140f;
    border-color: #15140f;
  }

  .sheet__head {
    padding-right: 3.25rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .sheet[open] {
    animation: unfold 0.45s var(--ease) both;
  }

  .sheet[open]::backdrop {
    animation: fade 0.35s ease both;
  }
}

@keyframes unfold {
  from {
    opacity: 0;
    transform: translateY(1.75rem) scale(0.97);
  }
}

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

/* --------------------------------------------------------------------------
   Papers and patents
   -------------------------------------------------------------------------- */

.papers {
  padding: clamp(6rem, 14vh, 10rem) 0 clamp(4.5rem, 10vh, 7.5rem);
}

.rows {
  margin-top: clamp(2.5rem, 6vh, 4.5rem);
  border-top: 1px solid var(--ink);
}

.papers__sub {
  margin-top: clamp(3.5rem, 8vh, 5.5rem);
  font-size: clamp(1.4rem, 2.1vw, 1.8rem);
  font-weight: 650;
  letter-spacing: -0.025em;
}

.papers__sub + .rows {
  margin-top: 1.375rem;
}

.row {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr) minmax(7.5rem, 13.75rem);
  gap: clamp(0.875rem, 3vw, 2.5rem);
  align-items: baseline;
  padding: 1.375rem 0;
  border-bottom: 1px solid var(--line);
}

.row__year,
.row__where {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.row__where {
  text-align: right;
}

.row__main {
  display: grid;
  gap: 0.375rem;
}

.row__title {
  max-width: 44ch;
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.018em;
  text-decoration: none;
  text-wrap: balance;
}

a.row__title {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.25rem;
  text-decoration-thickness: 1.5px;
  transition: text-decoration-color 0.2s;
}

a.row__title:hover {
  text-decoration-color: currentColor;
}

.row__who {
  max-width: 70ch;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--ink-2);
}

.row__who b {
  font-weight: 650;
  color: var(--ink);
}

@media (max-width: 700px) {
  .row {
    grid-template-columns: 1fr;
    gap: 0.375rem;
  }

  .row__where {
    text-align: left;
  }
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.talk {
  padding: clamp(3.5rem, 9vh, 6.875rem) 0 clamp(6rem, 14vh, 10rem);
}

.talk__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
}

.talk__title {
  font-size: clamp(3.6rem, 9vw, 7.75rem);
  font-weight: 800;
  font-stretch: 96%;
  line-height: 0.9;
  letter-spacing: -0.025em;
}

.talk__text {
  max-width: 32ch;
  margin-top: clamp(1.25rem, 3vh, 2rem);
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.4;
  color: var(--ink-2);
}

.talk__mail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 650;
  letter-spacing: -0.015em;
}

.talk__mail a {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.3125rem;
  overflow-wrap: anywhere;
}

.talk__mail a:hover {
  color: var(--route);
}

.copy {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.copy:hover {
  background: var(--ink);
  color: var(--paper);
}

.copy__note {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--ink-2);
}

.talk__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.talk__links a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.talk__links a:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

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

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.foot {
  position: relative;
  padding-top: clamp(3rem, 7vh, 4.5rem);
  background: var(--stage);
  color: var(--stage-ink);
  overflow: hidden;
}

.foot a {
  text-decoration: none;
}

.foot a:hover {
  text-decoration: underline;
  text-underline-offset: 0.25rem;
}

.foot__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(1.75rem, 5vw, 4.5rem);
}

.foot__name {
  font-size: 1.75rem;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1;
}

.foot__role {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.4;
  color: var(--stage-ink-2);
}

.foot__label {
  margin-bottom: 0.875rem;
  font-size: 0.875rem;
  color: var(--stage-ink-2);
}

.foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
}

.foot__fine {
  margin-top: 1.125rem;
  font-size: 0.8125rem;
  color: var(--stage-ink-2);
}

.foot__close {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: clamp(2.5rem, 6vh, 4rem);
}

.foot__bye {
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1;
}

.foot__top {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

/* Oversized wordmark, cut off by the bottom edge of the page */
.foot__mark {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin: clamp(1.25rem, 4vh, 2.75rem) auto -0.2em;
  font-size: clamp(6.5rem, 25vw, 23rem);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.03em;
  text-indent: -0.045em;
  color: var(--stage-ink-3);
  white-space: nowrap;
  user-select: none;
}

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

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   Projects: three stages, newest first
   -------------------------------------------------------------------------- */

.stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(0.875rem, 2.2vw, 2rem);
  margin-top: clamp(2rem, 5vh, 3.5rem);
}

.stage-tab {
  display: grid;
  gap: 0.375rem;
  justify-items: start;
  width: 100%;
  padding: 0.875rem 0 0;
  border: 0;
  border-top: 1px solid var(--stage-ink-3);
  background: none;
  color: var(--stage-ink-2);
  text-align: left;
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s;
}

.stage-tab:hover {
  color: var(--stage-ink);
}

.stage-tab[aria-pressed="true"] {
  border-top-color: var(--stage-ink);
  color: var(--stage-ink);
}

.stage-tab:focus-visible {
  outline-color: var(--stage-ink);
}

.stage-tab__when {
  font-family: var(--mono);
  font-size: 0.6875rem;
}

.stage-tab__name {
  font-size: clamp(1.1rem, 1.7vw, 1.45rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.022em;
}

.stage-tab__note {
  max-width: 34ch;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--stage-ink-2);
}

@media (max-width: 700px) {
  .stages {
    gap: 0.625rem;
  }

  .stage-tab__note {
    display: none;
  }

  .stage-tab__name {
    font-size: 1rem;
  }
}

/* --------------------------------------------------------------------------
   Papers: the link under each entry
   -------------------------------------------------------------------------- */

.row__link {
  display: inline-block;
  margin-top: 0.4375rem;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--route);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.row__link:hover {
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Research page (one project, read top to bottom)
   -------------------------------------------------------------------------- */

.doc {
  padding: 7.5rem 0 clamp(5rem, 12vh, 8.75rem);
}

.doc__back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ink-2);
  text-decoration: none;
}

.doc__back:hover {
  color: var(--ink);
}

.doc__kicker {
  margin-top: clamp(1.75rem, 5vh, 3.5rem);
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.doc__title {
  max-width: 22ch;
  margin-top: 0.875rem;
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 800;
  font-stretch: 96%;
  line-height: 0.95;
  letter-spacing: -0.024em;
  text-wrap: balance;
}

.doc__meta {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(1.25rem, 5vw, 5rem);
  align-items: end;
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
}

.doc__authors {
  max-width: 56ch;
  color: var(--ink-2);
}

.doc__authors b {
  color: var(--ink);
  font-weight: 650;
}

.doc__status {
  display: grid;
  gap: 0.375rem;
  justify-items: start;
  font-size: 0.9375rem;
}

.doc__status strong {
  font-weight: 650;
}

.doc__status span {
  color: var(--ink-2);
}

.doc__lead {
  position: relative;
  margin-top: clamp(2rem, 5vh, 3.5rem);
  aspect-ratio: 21 / 9;
  border-radius: 1.125rem;
  overflow: hidden;
  background: #3a0704;
}

.doc__lead img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% 60%;
}

.doc__sec {
  margin-top: clamp(4.5rem, 11vh, 8.25rem);
}

.doc__h2 {
  max-width: 20ch;
  font-size: clamp(1.9rem, 3.8vw, 3.1rem);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.doc__cols {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
}

.doc__big {
  max-width: 30ch;
  font-size: clamp(1.3rem, 2.1vw, 1.75rem);
  font-weight: 450;
  line-height: 1.24;
  letter-spacing: -0.02em;
  text-wrap: pretty;
}

.doc__body {
  max-width: 54ch;
  color: var(--ink-2);
}

.doc__body p + p {
  margin-top: 0.875rem;
}

.doc__fig {
  margin-top: clamp(1.75rem, 5vh, 3rem);
}

.doc__fig img {
  width: 100%;
  height: auto;
  border-radius: 0.875rem;
  background: #fff;
}

.doc__fig--paper img {
  padding: clamp(0.625rem, 2vw, 1.5rem);
}

.doc__pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: clamp(1.75rem, 5vh, 3rem);
}

.doc__pair img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 0.875rem;
  background: #3a0704;
}

.spec {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.125rem clamp(1rem, 2.4vw, 2rem);
  margin-top: clamp(1.75rem, 5vh, 3rem);
}

.spec div {
  padding-top: 0.75rem;
  border-top: 1px solid var(--ink);
}

.spec dt {
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.spec dd {
  margin-top: 0.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.trio {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 2.2vw, 1.75rem);
  margin-top: clamp(1.75rem, 5vh, 3rem);
}

.trio__item {
  padding-top: 1.125rem;
  border-top: 1px solid var(--ink);
}

.trio__item img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  margin-bottom: 1rem;
  border-radius: 0.625rem;
  background: #3a0704;
}

.trio__tag {
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--ink-2);
}

.trio__item h3 {
  margin-top: 0.5rem;
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.022em;
}

.trio__item p {
  margin-top: 0.625rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-2);
}

.trio__item q {
  display: block;
  margin-top: 0.625rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--ink);
  quotes: "\201C" "\201D";
}

.doc .ladder {
  margin-top: clamp(1.75rem, 5vh, 3rem);
}

.doc__end {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 5rem);
  align-items: end;
  margin-top: clamp(4.5rem, 11vh, 8.25rem);
  padding-top: 1.75rem;
  border-top: 1px solid var(--ink);
}

@media (max-width: 860px) {
  .doc__meta,
  .doc__cols,
  .doc__end {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .doc__lead {
    aspect-ratio: 16 / 10;
  }

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

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
