@font-face { font-family: "Favorit"; src: url("fonts/Favorit-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Favorit"; src: url("fonts/Favorit-Book.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Favorit"; src: url("fonts/Favorit-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Favorit Mono"; src: url("fonts/FavoritMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Favorit Mono"; src: url("fonts/FavoritMono-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --ground: #000;
  --s3: #171614;
  --rule: #1e1d1b;
  --rule-2: #2b2825;
  --ink: #fff;
  --ink-2: #c9c5bf;
  --ink-3: #8f8b86;
  --ink-4: #5f5b55;
  --accent: #c89f6d;
  --sans: "Favorit", system-ui, -apple-system, sans-serif;
  --mono: "Favorit Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  --max: 68rem;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; }
body {
  background: var(--ground);
  color: var(--ink-2);
  font: 400 1rem/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
ol, ul { list-style: none; }
::selection { background: var(--accent); color: #000; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

.eyebrow {
  font: 500 .7rem/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* header */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.1rem var(--pad);
  background: rgba(0, 0, 0, .82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.mark { color: var(--ink); font-weight: 500; letter-spacing: -.02em; white-space: nowrap; }
.top nav { display: flex; gap: clamp(1rem, 3vw, 2rem); }
.top nav a {
  font: 500 .7rem/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); padding: .4rem 0; transition: color .15s;
}
.top nav a:hover { color: var(--ink); }

/* layout */
main { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
section { padding: clamp(2.25rem, 5vw, 3.5rem) 0; border-top: 1px solid var(--rule); }
section > .eyebrow { margin-bottom: clamp(1.1rem, 2.5vw, 1.6rem); }

/* hero */
.hero { border-top: 0; padding: clamp(2.5rem, 7vw, 4.5rem) 0 clamp(2rem, 4.5vw, 3rem); }
.hero h1 {
  color: var(--ink);
  font-size: clamp(2.2rem, 6.4vw, 4.6rem);
  font-weight: 500; line-height: 1.04;
  letter-spacing: -.045em;
  max-width: 17ch; margin: 1rem 0 .9rem;
  text-wrap: balance;
}
.lede { font-size: clamp(1rem, 1.6vw, 1.15rem); color: var(--ink-3); max-width: 44ch; }

/* projects */
.projects li { border-top: 1px solid var(--rule); }
.projects li:last-child { border-bottom: 1px solid var(--rule); }
.projects .row {
  position: relative;
  display: grid; grid-template-columns: 3.5rem 1fr auto; gap: 1.5rem;
  align-items: start;
  padding: clamp(1.5rem, 3.5vw, 2.25rem) clamp(.5rem, 1.5vw, 1rem);
  margin: 0 calc(-1 * clamp(.5rem, 1.5vw, 1rem));
  transition: background .2s;
}
.projects .row:hover { background: var(--s3); }
.title::after { content: ""; position: absolute; inset: 0; }
.title:focus-visible { outline: none; }
.title:focus-visible::after { outline: 1px solid var(--accent); }
.watch { position: relative; z-index: 1; margin-top: .7rem; font: 400 .75rem/1.5 var(--mono); color: var(--ink-3); }
.watch a { color: var(--ink-2); margin-left: .6rem; border-bottom: 1px solid var(--rule-2); transition: color .15s, border-color .15s; }
.watch a:hover { color: var(--ink); border-color: var(--accent); }
.num { font: 400 .75rem/2.4 var(--mono); color: var(--ink-4); }
.projects h3 {
  color: var(--ink);
  font-size: clamp(1.5rem, 3.4vw, 2.25rem);
  font-weight: 500; line-height: 1.1; letter-spacing: -.04em;
  margin-bottom: .7rem;
}
.arrow {
  display: inline-block; font-weight: 400; color: var(--ink-4);
  transition: transform .2s, color .2s;
}
.projects .row:hover .arrow { color: var(--accent); transform: translate(3px, -3px); }
.projects .body p { max-width: 52ch; }
.projects .stack { font: 400 .75rem/1.5 var(--mono); color: var(--ink-3); margin-top: .9rem; }
.stat { text-align: right; padding-top: .35rem; min-width: 9rem; }
.stat b { display: block; color: var(--ink); font-size: 1.35rem; font-weight: 500; letter-spacing: -.03em; line-height: 1.2; }
.stat span { font: 400 .72rem/1.4 var(--mono); color: var(--ink-3); }

/* experience */
.jobs li {
  display: grid; grid-template-columns: 9rem 1fr; gap: 1.5rem;
  padding: 1.4rem 0; border-top: 1px solid var(--rule);
}
.jobs li:first-child { border-top: 0; padding-top: 0; }
.when { font: 400 .75rem/1.9 var(--mono); color: var(--ink-3); }
.jobs h3 { color: var(--ink); font-size: 1.1rem; font-weight: 500; letter-spacing: -.02em; }
.jobs h3 span { color: var(--ink-3); font-weight: 400; margin-left: .5rem; }
.jobs p { margin-top: .35rem; max-width: 58ch; }

/* stack */
.stackgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.stackgrid dt { color: var(--ink); font-weight: 500; margin-bottom: .4rem; }

/* contact */
.mail {
  display: inline-block; color: var(--ink);
  font-size: clamp(1.05rem, 5.6vw, 3rem); font-weight: 500; letter-spacing: -.04em; line-height: 1.15;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--rule-2); padding-bottom: .15em;
  transition: border-color .2s;
}
.mail:hover { border-color: var(--accent); }
.links { display: flex; flex-wrap: wrap; gap: 2rem; margin-top: 1.5rem; }
.links a { color: var(--ink-2); transition: color .15s; }
.links a span { color: var(--ink-4); transition: color .15s; }
.links a:hover { color: var(--ink); }
.links a:hover span { color: var(--accent); }

footer {
  max-width: var(--max); margin: 0 auto; padding: 1.5rem var(--pad) 2.5rem;
  display: flex; justify-content: space-between;
  font: 400 .72rem/1 var(--mono); color: var(--ink-4);
  border-top: 1px solid var(--rule);
}

@media (max-width: 720px) {
  .projects .row { grid-template-columns: 1fr; gap: .6rem; }
  .num { line-height: 1; }
  .stat { text-align: left; display: flex; align-items: baseline; gap: .5rem; padding-top: .4rem; }
  .stat b { font-size: 1.05rem; }
  .jobs li { grid-template-columns: 1fr; gap: .25rem; }
  .jobs h3 span { display: block; margin: .1rem 0 0; font-size: .95rem; }
  .stackgrid { grid-template-columns: 1fr; gap: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
.nw { white-space: nowrap; }
.top { gap: 1rem; }
@media (max-width: 420px) { .top nav { gap: .8rem; } .top nav a { letter-spacing: .06em; font-size: .66rem; } }
.about-lede { color: var(--ink); font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.2; max-width: 26ch; margin-bottom: clamp(1.5rem, 3vw, 2rem); }
.stackgrid.about { row-gap: 2rem; }
@media (max-width: 420px) { .top nav { gap: .6rem; } .top nav a { letter-spacing: .04em; font-size: .62rem; } .mark { font-size: .92rem; } }

/* about page */
.namelink { border-bottom: 2px solid var(--rule-2); transition: border-color .2s; }
.namelink:hover { border-color: var(--accent); }
.top nav a[aria-current="page"] { color: var(--ink); }
.about-hero { padding-bottom: clamp(2rem, 4.5vw, 3rem); }
.about-hero h1 { max-width: 20ch; }
.photos {
  border-top: 0; padding-top: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: clamp(10rem, 22vw, 16rem); gap: .75rem;
}
.ph { position: relative; overflow: hidden; background: var(--s3); }
.ph.tall { grid-row: span 2; }
.ph.wide { grid-column: span 2; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(.15); transition: filter .3s; }
.ph:hover img { filter: none; }
.ph figcaption:not(:empty) {
  position: absolute; left: .75rem; bottom: .65rem;
  font: 400 .68rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.photos:not(:has(.ph)) { display: none; }
.back a { font: 500 .75rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); transition: color .15s; }
.back a:hover { color: var(--ink); }
@media (max-width: 720px) {
  .photos { grid-template-columns: 1fr 1fr; grid-auto-rows: 11rem; }
  .ph.wide { grid-column: span 2; }
}

/* motion */
:root { --ease: cubic-bezier(.16, 1, .3, 1); }

@view-transition { navigation: auto; }
.top { view-transition-name: header; }
::view-transition-old(root) { animation: page-out .35s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: page-in .75s var(--ease) both; }
@keyframes page-out { to { opacity: 0; transform: translateY(-16px); filter: blur(6px); } }
@keyframes page-in { from { opacity: 0; transform: translateY(28px); filter: blur(6px); } }

.js [data-reveal] { opacity: 0; }
.js [data-reveal].in {
  animation: rise 1s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
@keyframes rise {
  from { opacity: 0; transform: translateY(28px); filter: blur(8px); }
  to { opacity: 1; transform: none; filter: none; }
}

.hero { transform: translateY(var(--drift, 0)); opacity: var(--fade, 1); will-change: transform, opacity; }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .js [data-reveal] { opacity: 1; animation: none !important; }
  .hero { transform: none; opacity: 1; }
}
@media (max-width: 420px) { .mark .last { display: none; } }

/* about reel */
.reel { border-top: 0; padding-top: 0; position: relative; }
.track {
  position: relative;
  display: flex; gap: .75rem;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; cursor: grab;
  margin: 0 calc(-1 * var(--pad)); padding: 0 var(--pad);
  scroll-padding: 0 var(--pad);
}
.track::-webkit-scrollbar { display: none; }
.track.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
.slide { flex: none; height: clamp(20rem, 62vh, 34rem); scroll-snap-align: start; background: var(--s3); overflow: hidden; }
.slide img, .slide video { height: 100%; width: auto; display: block; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.reel-nav { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.reel-nav button {
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: transparent; color: var(--ink-2); border: 1px solid var(--rule-2);
  font: 400 1rem/1 var(--sans); cursor: pointer; transition: color .15s, border-color .15s, opacity .2s;
}
.reel-nav button:hover { color: var(--ink); border-color: var(--accent); }
.reel-nav button:disabled { opacity: .3; cursor: default; border-color: var(--rule-2); }
@media (max-width: 720px) { .slide { height: 26rem; } }
@media (hover: none) { .reel-nav { display: none; } }
.ps { color: var(--ink-2); font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 40ch; margin-bottom: 1.25rem; }
.links li { white-space: nowrap; }
@media (max-width: 390px) { .top { gap: .6rem; } .top nav { gap: .55rem; } .top nav a { letter-spacing: .02em; font-size: .58rem; } }

/* about: pixel chase */
.scene { width: 100%; overflow: hidden; margin-top: clamp(1.25rem, 3vw, 2rem); background: #000; }
.scene canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.spy { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9; image-rendering: pixelated; image-rendering: crisp-edges; }
