:root {
  --paper: #ffffff;
  --ink: #141414;
  --ink-soft: #5c5c5c;
  --ink-faint: #8a8a8a;
  --rule: #d6d6d6;
  --frame: #f5f6f8;
  /* Mat behind the pictures in the walnut frames: warm ivory, so it reads as paper behind glass, not page white. */
  --mat: #f3ead6;
  --gutter: clamp(16px, 5vw, 96px);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
}

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  font: 400 1rem/1.55 "Instrument Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Skiers ride the viewport, so they keep going while the page scrolls: over the snow, behind the projects. */
#skiers {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  pointer-events: none;
}

/* Hero: the only snow that takes tracks. */
.hero {
  position: relative;
  min-height: 100svh;
  /* Vertical swipes still scroll on touch screens; sideways drags draw in the snow. */
  touch-action: pan-y;
}

#snow {
  position: absolute;
  inset: 0;
  display: block;
}

.intro {
  position: relative;
  min-height: 100svh;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  justify-content: center;
  pointer-events: none;
}

h1 {
  margin: 0 0 0.6rem;
  font: 400 clamp(2.75rem, 6vw, 4.25rem)/1 "Instrument Serif", Georgia, serif;
  letter-spacing: -0.01em;
}

.intro p {
  margin: 0;
  max-width: 30rem;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
  color: var(--ink-soft);
  text-wrap: pretty;
}

.intro nav {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.intro nav a, .cue a {
  pointer-events: auto;
  font-weight: 500;
  font-size: 0.9375rem;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: border-color 160ms ease-out;
}

.intro nav a:hover, .cue a:hover { border-color: var(--ink); }

.cue {
  position: absolute;
  left: var(--gutter);
  bottom: clamp(24px, 5vh, 48px);
  display: flex;
  gap: 1.5rem;
  color: var(--ink-soft);
}

.intro .availability {
  margin-top: 0.9rem;
  font-size: 0.875rem;
  color: var(--ink);
}

/* The section after the hero needs no extra top space beyond its own. */
#experience { padding-bottom: clamp(48px, 8vh, 80px); }
#projects { padding-top: 0; }

/* Projects */
.projects {
  position: relative;
  z-index: 2;
  padding: clamp(56px, 9vh, 96px) var(--gutter) clamp(72px, 12vh, 128px);
}

h2 {
  margin: 0 0 clamp(24px, 3.5vh, 36px);
  font: 400 clamp(2rem, 3.6vw, 2.75rem)/1 "Instrument Serif", Georgia, serif;
  letter-spacing: -0.01em;
}

.grid {
  display: grid;
  /* Fills the width: 1 column on phones, 2 on tablets, 3 from laptops up (cards grow on wider screens). */
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(32px, 4.4vh, 44px) clamp(24px, 2.6vw, 40px);
}

@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
}

/* Each card is an opaque block (with a little white margin) that skiers pass behind. */
.project {
  min-width: 0;
  background: var(--paper);
  box-shadow: 0 0 0 12px var(--paper);
}

/* Walnut picture frame. The grain is procedural (SVG noise stretched along each rail); the rails are shaded as a
   rounded moulding lit from the top left, mitred at the corners, with a gilt liner and a bevel-cut mat inside. */
.shot {
  --rail: clamp(12px, 1.3vw, 18px);
  --grain-v: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='600'%3E%3Cfilter id='d'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.24 0.005' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.035 0 0 0 0 0.01 4.4 0 0 0 -1.9'/%3E%3C/filter%3E%3Cfilter id='l'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.24 0.005' numOctaves='3' seed='23' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.86 0 0 0 0 0.62 0 0 0 0 0.4 2.4 0 0 0 -1.4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23d)'/%3E%3Crect width='100%25' height='100%25' filter='url(%23l)'/%3E%3C/svg%3E");
  --grain-h: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='200'%3E%3Cfilter id='d'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.005 0.24' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.035 0 0 0 0 0.01 4.4 0 0 0 -1.9'/%3E%3C/filter%3E%3Cfilter id='l'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.005 0.24' numOctaves='3' seed='23' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.86 0 0 0 0 0.62 0 0 0 0 0.4 2.4 0 0 0 -1.4'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23d)'/%3E%3Crect width='100%25' height='100%25' filter='url(%23l)'/%3E%3C/svg%3E");
  --wood: linear-gradient(90deg, #6e4124, #7d4b2a 35%, #6a3d21 65%, #7a4829);
  position: relative;
  margin: 0 0 16px;
  padding: var(--rail);
  border-radius: 1px;
  background:
    /* side rails: rounded profile, light on the left rail, in shade on the right */
    linear-gradient(90deg, rgba(255, 228, 192, 0.32), rgba(255, 228, 192, 0.06) 38%, rgba(0, 0, 0, 0.05) 62%, rgba(0, 0, 0, 0.42)) left / var(--rail) 100% no-repeat,
    linear-gradient(90deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.12) 40%, rgba(255, 228, 192, 0.08) 70%, rgba(0, 0, 0, 0.3)) right / var(--rail) 100% no-repeat,
    var(--grain-v),
    var(--wood);
  box-shadow:
    inset 0 0 0 1px rgba(30, 14, 4, 0.55),
    0 1px 1px rgba(25, 14, 6, 0.3),
    0 6px 10px -4px rgba(25, 14, 6, 0.35),
    0 20px 32px -16px rgba(25, 14, 6, 0.5);
}

.shot::before, .shot::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 0;
  right: 0;
  height: var(--rail);
  pointer-events: none;
}

/* Top rail catches the light; the bottom rail sits in shadow. */
.shot::before {
  top: 0;
  clip-path: polygon(0 0, 100% 0, calc(100% - var(--rail)) 100%, var(--rail) 100%);
  background:
    linear-gradient(180deg, rgba(255, 232, 198, 0.42), rgba(255, 228, 192, 0.1) 35%, rgba(0, 0, 0, 0.04) 60%, rgba(0, 0, 0, 0.45)),
    var(--grain-h),
    var(--wood);
}

.shot::after {
  bottom: 0;
  clip-path: polygon(var(--rail) 0, calc(100% - var(--rail)) 0, 100% 100%, 0 100%);
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.18) 35%, rgba(255, 228, 192, 0.1) 70%, rgba(0, 0, 0, 0.3)),
    var(--grain-h),
    var(--wood);
}

/* Each frame is cut from a different part of the board. */
.project:nth-child(3n + 2) .shot { background-position: left, right, 70px 210px, 0 0; }
.project:nth-child(3n) .shot { background-position: left, right, 130px 380px, 0 0; }
.project:nth-child(3n + 2) .shot::before, .project:nth-child(3n + 2) .shot::after { background-position: 0 0, 240px 60px, 0 0; }
.project:nth-child(3n) .shot::before, .project:nth-child(3n) .shot::after { background-position: 0 0, 410px 110px, 0 0; }

/* Inside the frame: a thin gilt liner, then an ivory mat with a bevel cut around each picture. */
.pic {
  --mat-grain: 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='0.7' numOctaves='2' seed='11' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.28 0 0 0 0 0.18 0 0 0 0.45 -0.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  position: relative;
  display: flex;
  gap: 4%;
  aspect-ratio: 16 / 9;
  padding: 3.6%;
  overflow: hidden;
  background: var(--mat-grain), var(--mat);
  box-shadow:
    0 0 0 1px #4a2c12,
    0 0 0 3px #b8964f,
    0 0 0 4px #3b220d,
    0 0 6px 4px rgba(20, 10, 2, 0.4);
}

/* The frame's lip shades the mat along the top and left. */
.pic::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  box-shadow: inset 3px 4px 6px rgba(40, 24, 8, 0.38), inset -1px -1px 2px rgba(40, 24, 8, 0.12);
}

.panel {
  flex: 1;
  min-width: 0;
}

/* The mat's bevel cut: a bright cut edge, lit along the top and left, then the picture set just below it. */
.shot .panel {
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(90, 70, 40, 0.28),
    -1.5px -1.5px 0 2px #fffaf0,
    1.5px 1.5px 0 2px #e4d7bb,
    0 0 0 3.5px rgba(120, 95, 55, 0.18);
}

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

/* Pictures in the walnut frames are multiplied onto the mat, so their white grounds take on its ivory tint
   (darks barely change). Experience tags keep true white. */
.shot .panel img { mix-blend-mode: multiply; }

/* Glass over each picture: a soft glare along the top and one diagonal streak that drifts on hover. */
.pic::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(112deg, transparent 0 30%, rgba(255, 255, 255, 0.34) 36%, rgba(255, 255, 255, 0.1) 44%, transparent 50%, transparent 62%, rgba(255, 255, 255, 0.14) 66%, transparent 70%) 0 0 / 220% 100% no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 38%),
    radial-gradient(120% 90% at 0% 0%, rgba(210, 228, 255, 0.16), transparent 60%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  transition: background-position 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .project:hover .pic::before { background-position: 40% 0, 0 0, 0 0; }
}

.panel.contain img {
  object-fit: contain;
  padding: 10px 0;
}

.project h3 {
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
}

.project h3 a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease-out;
}

.project h3 a:hover { border-color: var(--ink); }

.project h3 span { color: var(--ink-faint); }

.project > p {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.areas {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.areas li {
  font-size: 0.6875rem;
  line-height: 1;
  padding: 4px 8px 5px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--ink);
}

.project .langs {
  margin: 8px 0 0;
  font-size: 0.75rem;
  color: var(--ink);
}

.langs span {
  color: var(--ink-faint);
  margin-right: 4px;
}

/* App screenshots as iPhones standing in the frame: dark titanium band, black bezel, Dynamic Island. */
.pic.phones {
  align-items: center;
  justify-content: center;
  gap: 5%;
  background: linear-gradient(180deg, #f7f7f9, #eceef2);
}

.phone {
  position: relative;
  height: 84%;
  aspect-ratio: 1206 / 2622;
  padding: 1.6%;
  border-radius: 17% / 7.8%;
  background: linear-gradient(135deg, #5d5f64, #2a2b2f 30%, #1b1c1f 60%, #45474c);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 1px 2px rgba(0, 0, 0, 0.25),
    0 10px 18px -8px rgba(20, 22, 30, 0.45);
}

.phone:nth-child(2) {
  height: 92%;
  z-index: 1;
}

.phone img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 15% / 7%;
  background: #000;
  box-shadow: 0 0 0 1.5px #050505;
}

.phone::after {
  content: "";
  position: absolute;
  top: 4.4%;
  left: 50%;
  width: 30%;
  height: 3.3%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: #050505;
}

/* For employer agents: the same facts as plain, structured text. */
.agents {
  position: relative;
  z-index: 2;
  padding: 0 var(--gutter) clamp(72px, 12vh, 128px);
  background: var(--paper);
}

.agents .lede {
  max-width: 44rem;
  margin: 0 0 28px;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.agents h3 {
  margin: 40px 0 14px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 24px;
  margin: 0;
  font-size: 0.875rem;
}

.facts dt { color: var(--ink-faint); }
.facts dd { margin: 0; }

.agents a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

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

.roles {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.roles > li + li { margin-top: 18px; }
.roles .who { margin: 0 0 6px; }
.roles strong { font-weight: 500; }

.roles ul {
  margin: 0;
  padding-left: 1.1em;
  color: var(--ink-soft);
  max-width: 52rem;
}

.roles ul li + li { margin-top: 3px; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  line-height: 1.45;
}

th, td {
  padding: 10px 14px 10px 0;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid #ececec;
}

thead th {
  border-top: 0;
  font-weight: 500;
  color: var(--ink-faint);
  font-size: 0.75rem;
}

tbody th { font-weight: 500; min-width: 9rem; }
tbody th span { display: block; font-weight: 400; color: var(--ink-faint); }
td { color: var(--ink-soft); }
td em { font-style: normal; color: var(--ink-faint); }
td:nth-child(2) { min-width: 16rem; }
td:nth-child(3) { min-width: 12rem; color: var(--ink); }

.signals {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  color: var(--ink-soft);
  columns: 2 22rem;
  column-gap: 40px;
}

.signals li { break-inside: avoid; margin-bottom: 6px; }
.signals strong { font-weight: 500; color: var(--ink); margin-right: 6px; }

/* Phones: each project becomes a stacked block instead of a wide table row. */
@media (max-width: 720px) {
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
  thead { display: none; }
  table, tbody, tr, th, td { display: block; }
  tr { padding: 12px 0; border-top: 1px solid #ececec; }
  th, td { border: 0; padding: 2px 0; min-width: 0 !important; }
  td::before { content: attr(data-label) " · "; color: var(--ink-faint); }
}

/* The one measured result on a card. */
.project .result {
  margin: 8px 0 0;
  padding-left: 10px;
  border-left: 2px solid var(--ink);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--ink);
}

/* Experience: each role is a luggage tag hanging from a leather strap with a cast brass buckle. */
.role {
  position: relative;
  z-index: 0;
  min-width: 0;
  padding-top: 70px;
  transform-origin: 50% 0;
}

/* Tags hang a little off true, each its own way. */
.role:nth-child(3n + 1) { transform: rotate(-0.6deg); }
.role:nth-child(3n + 2) { transform: rotate(0.4deg); }
.role:nth-child(3n) { transform: rotate(-0.25deg); }

/* Moulded tag: a satin face, a rounded edge with visible thickness, and a soft cast shadow. */
.tag {
  position: relative;
  padding: 36px 16px 18px;
  border-radius: 22px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.15) 30%, rgba(255, 255, 255, 0) 55%),
    radial-gradient(140% 70% at 50% 0%, #f4f8fb, #e2e9f0 70%, #d9e1ea);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    inset 0 -3px 4px rgba(110, 130, 150, 0.16),
    0 0 0 1px rgba(80, 95, 115, 0.16),
    0 3px 0 -1px #c4ced8,
    0 4px 0 -1px rgba(60, 75, 95, 0.25),
    0 6px 8px -2px rgba(30, 40, 55, 0.22),
    0 22px 34px -16px rgba(30, 40, 55, 0.45);
}

/* The punched slot the strap goes through, with a pressed rim. */
.tag::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 50%;
  width: 54px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: radial-gradient(60% 120% at 50% 100%, #3a4048, #15181c);
  box-shadow:
    inset 0 2px 3px rgba(0, 0, 0, 0.75),
    0 0 0 2px rgba(255, 255, 255, 0.75),
    0 1px 0 2.5px rgba(120, 135, 155, 0.22);
}

/* Full-grain leather: dark brown, pebble grain, burnished edges, a soft sheen down the middle. */
.strap {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 1;
  width: 32px;
  height: 89px;
  transform: translateX(-50%);
  border-radius: 15px 15px 2px 2px;
  background:
    radial-gradient(circle at 50% 60px, #090605 2.4px, rgba(255, 235, 205, 0.16) 2.9px, transparent 3.6px),
    radial-gradient(circle at 50% 71px, #090605 2.4px, rgba(255, 235, 205, 0.16) 2.9px, transparent 3.6px),
    linear-gradient(180deg, transparent 84%, rgba(0, 0, 0, 0.55)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.5), transparent 14%, rgba(255, 236, 210, 0.13) 40%, rgba(255, 236, 210, 0.04) 55%, transparent 80%, rgba(0, 0, 0, 0.55)),
    var(--pebble, none),
    linear-gradient(180deg, #43301f, #2b1d13 60%, #20150e);
  box-shadow:
    inset 1.5px 0 0 rgba(10, 6, 4, 0.8),
    inset -1.5px 0 0 rgba(10, 6, 4, 0.8),
    inset 2.5px 0 0 rgba(255, 225, 190, 0.08),
    inset 0 1.5px 0 rgba(255, 225, 190, 0.12),
    0 3px 5px rgba(0, 0, 0, 0.35),
    0 8px 10px -6px rgba(30, 40, 55, 0.45);
}

.role .strap { --pebble: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -2.2 0 0 0 1.2'/%3E%3C/filter%3E%3Cfilter id='q'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' seed='9' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.9 0 0 0 0 0.78 1.2 0 0 0 -0.62'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3Crect width='100%25' height='100%25' filter='url(%23q)'/%3E%3C/svg%3E"); }

/* Saddle stitching: short waxed-thread stitches down both edges and round the top. */
.strap::before {
  content: "";
  position: absolute;
  inset: 5px 5px 14px;
  border-radius: 10px 10px 0 0;
  border: 1px dashed rgba(222, 204, 170, 0.7);
  border-bottom: 0;
  filter: drop-shadow(0 0.5px 0 rgba(0, 0, 0, 0.6));
}

/* Cast brass buckle: the ring is masked so the strap shows through it. */
.buckle {
  position: absolute;
  top: 18px;
  left: 50%;
  width: 46px;
  height: 30px;
  transform: translateX(-50%);
  filter: drop-shadow(0 1.5px 1px rgba(0, 0, 0, 0.55)) drop-shadow(0 3px 3px rgba(0, 0, 0, 0.25));
}

.buckle::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 4px;
  border-radius: 7px;
  background: linear-gradient(160deg, #fbe9b3, #c9a45a 22%, #8a6a2e 45%, #e2c682 62%, #9b7a3a 80%, #d6b874);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}

/* The tongue, through the strap's top hole. */
.buckle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 3px;
  width: 4px;
  height: 25px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: linear-gradient(90deg, #8a6a2e, #f1dc9f 45%, #a8883f);
}

/* The picture sits in a window printed on the tag. */
.window {
  position: relative;
  display: flex;
  aspect-ratio: 16 / 9;
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--frame);
  box-shadow: inset 0 0 0 1px rgba(30, 40, 55, 0.12);
}

.window .panel img { border-radius: 12px; }

.role h3 {
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.35;
}

.role .areas li { background: rgba(255, 255, 255, 0.6); }

/* Experience cards: role line and the two strongest contributions. */
.role .meta {
  margin: 0 0 6px;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.wins {
  margin: 0;
  padding-left: 1.05em;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.wins li + li { margin-top: 4px; }

/* The whole card opens its detail dialog: the title button's hit area covers the card. */
.project { position: relative; }

.project .open {
  all: unset;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease-out;
}

.project .open::after {
  content: "";
  position: absolute;
  inset: 0;
}

.project .open:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
  border-radius: 2px;
}

.project .open span {
  color: var(--ink-faint);
  display: inline-block;
  margin-left: 0.25em;
  transition: transform 160ms ease-out, color 160ms ease-out;
}

@media (hover: hover) {
  .project:hover .open { border-color: var(--ink); }
  .project:hover .open span { color: var(--ink); transform: translateX(3px); }
}

/* Project detail dialog */
html:has(dialog.detail[open]) { overflow: hidden; }

dialog.detail {
  width: min(920px, calc(100% - 32px));
  max-width: none;
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 64px -16px rgba(20, 20, 20, 0.35);
  overflow: auto;
  overscroll-behavior: contain;
}

dialog.detail::backdrop { background: rgba(20, 20, 20, 0.45); }

@media (prefers-reduced-motion: no-preference) {
  dialog.detail[open] { animation: detail-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  dialog.detail[open]::backdrop { animation: backdrop-in 200ms ease-out; }
}

@keyframes detail-in { from { opacity: 0; transform: translateY(12px) scale(0.985); } }
@keyframes backdrop-in { from { opacity: 0; } }

.sheet {
  position: relative;
  padding: clamp(24px, 4vw, 48px);
}

.detail .close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 1;
  width: 40px;
  height: 40px;
  margin: -8px -8px 0 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.375rem/1 "Instrument Sans", system-ui, sans-serif;
  cursor: pointer;
}

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

.detail .kicker {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  color: var(--ink-faint);
}

.detail h2 { margin: 0 0 12px; }

.detail .lede {
  max-width: 44rem;
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.focus {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.focus li {
  font-size: 0.75rem;
  line-height: 1;
  padding: 6px 10px 7px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 16px;
  margin: 28px 0 8px;
}

.gallery figure { margin: 0; }

.gallery img, .gallery video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
  background: var(--frame);
}

.gallery .contain img {
  max-height: 420px;
  object-fit: contain;
}

.gallery figcaption {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.dive {
  max-width: 46rem;
  margin-top: 28px;
}

.dive h3 {
  margin: 0 0 6px;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.dive h4 {
  margin: 0 0 6px;
  font-size: 1.0625rem;
  font-weight: 500;
}

.dive p, .dive li, .dive dd {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.dive p { margin: 0; }
.dive ul { margin: 0; padding-left: 1.1em; }
.dive li + li { margin-top: 6px; }

.code {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 20px;
  margin: 0;
}

.code dt { font-size: 0.9375rem; font-weight: 500; line-height: 1.6; }
.code dd { margin: 0; }

.detail .stack { margin-top: 24px; }

.detail .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 24px 0 0;
  font-size: 0.9375rem;
}

.detail .links a {
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.detail .links a:hover { border-color: var(--ink); }
.detail .links span { color: var(--ink-faint); }

/* Phones: the dialog becomes a full-screen sheet. */
@media (max-width: 640px) {
  dialog.detail {
    width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }
  .sheet { padding: 20px 16px 40px; }
  .code { grid-template-columns: 1fr; gap: 0; }
  .code dd { margin-bottom: 8px; }
}
