:root {
  --color-bg: #050505;
  --color-headings: #ebebeb;
  --color-text: #c7c7c7;
  --grey-500: #b8b8b8;
  --grey-400: #8c8c8c;
  --grey-300: #555;
  --line: #212121;
  --border-1: 1px solid var(--line);
  --green: #1ed760;
  --margin: 40px;
  --gutter: 24px;
  --sticky-h: 65px;
}

* { box-sizing: border-box; }

html {
  font-family: "Manrope", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.02em;
}

body { margin: 0; overflow-x: hidden; }
main { position: relative; background: var(--color-bg); }

a { color: inherit; text-decoration: none; }
button { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
h1, h2, h3, p { margin: 0; font-weight: 400; }
.hl { color: var(--color-headings); }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: #555; }
::-webkit-scrollbar-thumb:hover { background: #fff; }

/* ---------- top navigation ---------- */

.nav {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gutter);
  padding: 8px var(--margin) 0;
  border-bottom: var(--border-1);
  background: var(--color-bg);
}

.nav-item {
  position: relative;
  padding-top: 24px;
  margin-bottom: 32px;
  opacity: 0.4;
  transition: opacity 0.3s ease;
}
.nav-item:hover { opacity: 0.75; }
.nav-item.active { opacity: 1; }

.nav-item::after {
  content: "";
  position: absolute;
  top: 31px;
  right: 2px;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--grey-500);
  border-radius: 50%;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.nav-item.active::after { background: #fff; border-color: #fff; }

.nav-category {
  display: block;
  font-size: 19.2px;
  line-height: 26px;
  margin-bottom: 2px;
  text-transform: uppercase;
  color: var(--color-headings);
}
.nav-sub {
  display: block;
  font-size: 14.4px;
  line-height: 19px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--grey-500);
  transition: color 0.2s ease;
}
.nav-sub:hover { color: #fff; }

/* ---------- sticky bar ---------- */

.sticky-nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--sticky-h);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 var(--margin);
  border-bottom: var(--border-1);
  background: var(--color-bg);
  color: var(--grey-500);
  line-height: 22px;
  transform: translateY(-101%);
  transition: transform 0.45s cubic-bezier(0.5, 0, 0, 1);
}
.sticky-nav.show { transform: none; }
.sticky-id, .sticky-right { display: flex; flex-direction: column; }
.sticky-right { text-align: right; align-items: flex-end; }
.sticky-right a:hover { color: #fff; }

.availability { position: relative; }
.availability::before,
.availability::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--green);
}
.availability::after { animation: pulse 2.4s ease-out infinite; }
.sticky-right .availability::before,
.sticky-right .availability::after { left: -15px; }
.hero-bottom .availability::before,
.hero-bottom .availability::after { right: -15px; }

@keyframes pulse {
  0% { transform: scale(1); opacity: 0.7; }
  70%, 100% { transform: scale(3.4); opacity: 0; }
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  margin-bottom: 36px;
  overflow: hidden;
}

.hero-marquee {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 122px;
  transition: opacity 0.5s ease;
}
.marquee-row { overflow: hidden; white-space: nowrap; height: 192px; }
.marquee-row:nth-child(3) { display: none; }
.marquee-track {
  display: inline-flex;
  animation: marquee 60s linear infinite;
  will-change: transform;
}
.marquee-row:nth-child(odd) .marquee-track { animation-direction: reverse; }
.marquee-track span {
  font-family: "Bebas Neue", sans-serif;
  font-size: 192px;
  line-height: 192px;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #1a1a1a;
  margin-right: 48px;
}
@keyframes marquee { to { transform: translateX(-50%); } }

.hero-visual {
  position: absolute;
  inset: 0;
  top: 61px;
  will-change: transform;
}
.hero-visual canvas { display: block; width: 100%; height: 100%; }

.hero-bottom {
  position: absolute;
  inset: auto var(--margin) 32px;
  display: flex;
  justify-content: space-between;
  font-size: 16.8px;
  line-height: 23px;
  opacity: var(--caption-fade, 1);
}
.hero-bottom.dim { opacity: 0.1; transition: opacity 0.6s ease; }
.hero-bottom > div { display: flex; flex-direction: column; align-items: flex-start; }
.hero-bottom .right { align-items: flex-end; }
.hero-bottom small { font-size: 13.4px; line-height: 18px; text-transform: uppercase; color: var(--grey-500); }
.hero-bottom-mobile { display: none; }

/* ---------- section content ---------- */

.content { min-height: 50vh; transition: opacity 0.3s ease; }
.content.swap { opacity: 0; }

.block {
  margin: 49px var(--margin) 108px;
  padding-top: 16px;
  scroll-margin-top: calc(var(--sticky-h) + 40px);
}
.block:last-child { margin-bottom: 180px; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gutter);
}

.lead { margin-right: 136px; }
.lead h1 { font-size: 64px; line-height: 1; color: var(--color-headings); margin: 43px 0 24px; }
.lead p { font-size: 14px; line-height: 19px; letter-spacing: -0.01em; text-align: justify; margin-top: 38px; }

.col h2 { font-size: 28.8px; line-height: 1; color: var(--color-headings); margin: 58px 0 24px; }

.bracket { color: var(--color-headings); transition: color 0.2s ease; white-space: nowrap; }
.bracket::before { content: "[ "; }
.bracket::after { content: " ]"; }
.bracket:hover { color: #fff; }

/* cards */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding-bottom: 16px;
  border-bottom: var(--border-1);
}
.card-cover {
  position: relative;
  aspect-ratio: 1;
  margin-bottom: 16px;
  border: var(--border-1);
  border-radius: 4px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 64px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(120% 120% at 20% 10%, hsl(var(--hue) 55% 34% / 0.9), transparent 60%),
    radial-gradient(90% 90% at 90% 100%, hsl(calc(var(--hue) + 40) 60% 22%), transparent 70%),
    #0b0b0b;
  transition: transform 0.4s cubic-bezier(0.5, 0, 0, 1);
}
.card:hover .card-cover { transform: translateY(-4px); }
.card-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-title { font-size: 19.2px; line-height: 26px; color: var(--grey-500); }
.card-sub, .card-meta { font-size: 16px; line-height: 22px; color: var(--grey-400); opacity: 0.75; }

.col-foot { display: flex; justify-content: space-between; gap: 24px; margin-top: 16px; line-height: 22px; }
.col-foot.end { justify-content: flex-end; }
.col-foot a.plain { color: #fff; }

/* tables */
.tables { border-bottom: var(--border-1); }
.table { margin-bottom: 72px; }
.table-row {
  display: grid;
  grid-template-columns: 40% 1fr auto;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #141414;
  font-size: 16.8px;
  line-height: 22px;
  color: var(--grey-500);
  transition: color 0.2s ease;
}
.table-row.two { grid-template-columns: auto 1fr; }
.table-row > :last-child { text-align: right; }
.table-row:not(.table-head):hover { color: #fff; }
.table-head { font-size: 12.5px; text-transform: uppercase; color: var(--grey-400); padding-bottom: 2px; }

/* email */
.email-address {
  margin-top: -18px;
  font-size: clamp(32px, 4.45vw, 64px);
  line-height: 1.36;
  color: var(--color-headings);
  white-space: nowrap;
  overflow: hidden;
  border-bottom: var(--border-1);
}
.email-buttons { display: flex; justify-content: space-between; margin-top: 12px; line-height: 22px; }
.email-buttons .bracket { color: var(--color-text); }

/* writing list */
.entries { list-style: none; margin: 0; padding: 0; }
.entry { position: relative; padding: 12px 0; border-bottom: var(--border-1); }
.entry a { display: block; }
.entry h3 { font-size: 23px; line-height: 31px; color: var(--color-headings); margin: 0 48px 4px 0; }
.entry p { font-size: 15.4px; line-height: 21px; color: var(--grey-500); margin-right: 24px; }
.entry .entry-date { margin-top: 12px; color: var(--grey-400); }
.entry > h3:last-child { margin-bottom: 0; }

/* prose column */
.prose p { font-size: 16.8px; line-height: 25px; color: var(--grey-500); margin-bottom: 20px; max-width: 620px; }
.prose p:first-child { color: var(--color-headings); }
.entry svg {
  position: absolute;
  top: 14px;
  right: -4px;
  width: 28px;
  opacity: 0.3;
  transform: translate(-4px, 4px);
  transition: 0.2s all ease-out;
}
.entry:hover svg { opacity: 1; transform: none; }

/* projects */
.media-row { display: grid; grid-template-columns: 1fr; gap: 20px; margin-bottom: 20px; }
.media-row.two { grid-template-columns: 1fr 1fr; }
.media {
  position: relative;
  height: 458px;
  border-radius: 4px;
  overflow: hidden;
  background: #0a0a0a;
}
.media img, .media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media.placeholder {
  background:
    radial-gradient(60% 90% at 50% 62%, #000 30%, transparent 72%),
    radial-gradient(80% 120% at 50% 100%, hsl(var(--hue) var(--sat, 70%) 38% / 0.9), transparent 62%),
    repeating-linear-gradient(var(--angle, 115deg), hsl(var(--hue) var(--sat, 70%) 60% / 0.14) 0 1px, transparent 1px 9px),
    hsl(var(--hue) var(--sat, 70%) 6%);
}
.media.placeholder::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13.4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
}

/* figure panels */
.media.stat {
  height: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}
.media.stat::after { content: none; }
.media.stat strong { font-size: clamp(56px, 8vw, 120px); line-height: 1; font-weight: 300; letter-spacing: -0.04em; color: var(--color-headings); }
.media.stat.small strong { font-size: clamp(34px, 5vw, 72px); }
.media.stat span { font-size: 13.4px; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.6); }

.project-info { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 36px; }
.project-info h1 { font-size: 48px; line-height: 1; color: var(--color-headings); margin-top: 4px; }
.project-body { display: flex; gap: 20px; }
.project-text { flex: 1; max-width: 514px; }
.project-year { margin-left: auto; color: var(--color-headings); white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; font-size: 14.4px; line-height: 20px; text-transform: uppercase; color: var(--color-headings); margin: 12px 0 28px; }
.tags span:not(:last-child)::after { content: "·"; margin: 0 8px; }
.project-text p { font-size: 14.4px; line-height: 19px; letter-spacing: -0.01em; text-align: justify; margin-bottom: 19px; }
.project-text .bracket { display: inline-block; font-size: 16.8px; margin-top: 12px; }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s cubic-bezier(0.5, 0, 0, 1), transform 1s cubic-bezier(0.5, 0, 0, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- footer ---------- */

.footer { position: relative; padding: 0 var(--margin) 24px; }
.dots { height: 405px; margin: 0 calc(var(--margin) * -1); }
.dots canvas { display: block; width: 100%; height: 100%; }

.footer-content { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); margin-top: 45px; }
.footer-content h2 { font-size: 38.4px; line-height: 1; color: var(--color-headings); margin: 16px 0 24px; }
.footer-content > div:first-child { margin-right: 136px; }
.footer-nav-col { margin-left: 136px; }

.footer-link, .footer-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 36px;
  font-size: 18px;
  color: var(--grey-500);
  transition: color 0.2s ease;
}
.footer-link span:last-child { color: var(--grey-300); transition: color 0.2s ease; }
.footer-link:hover, .footer-nav:hover, .footer-link:hover span:last-child { color: #fff; }
.footer-nav svg { width: 22px; color: var(--grey-300); transition: transform 0.25s ease, color 0.2s ease; }
.footer-nav:hover svg { color: #fff; transform: translateY(-3px); }

.footer-credit { margin-top: 70px; line-height: 22px; }
.footer-credit small { font-size: 13.3px; color: var(--grey-500); }

.nav-mobile { display: none; }

/* ---------- mobile ---------- */

@media (max-width: 1024px) {
  :root { --margin: 20px; }

  .nav, .sticky-nav, .hero-bottom { display: none; }

  .nav-mobile { display: block; position: fixed; inset: 0 0 auto 0; z-index: 60; }
  .nav-mobile-bg { position: absolute; inset: 0 0 auto 0; height: 72px; background: var(--color-bg); transition: height 0.4s cubic-bezier(0.5, 0, 0, 1); }
  .nav-mobile.open .nav-mobile-bg { height: 180px; background: linear-gradient(var(--color-bg) 70%, transparent); }
  .nav-mobile-list { position: relative; display: flex; flex-direction: column; align-items: flex-start; padding: 20px; }
  .nav-mobile-item {
    order: 1;
    height: 0;
    overflow: hidden;
    font-size: 25.6px;
    line-height: 35px;
    font-weight: 500;
    text-transform: uppercase;
    color: #666;
    opacity: 0;
    transition: height 0.35s cubic-bezier(0.5, 0, 0, 1), opacity 0.35s ease, color 0.2s ease;
  }
  .nav-mobile-item.active { order: 0; height: 35px; opacity: 1; color: var(--color-headings); }
  .nav-mobile.open .nav-mobile-item { height: 35px; opacity: 1; }
  .nav-toggle { position: absolute; top: 0; right: 0; padding: 20px; color: var(--color-headings); line-height: 0; }

  .hero { height: 100svh; margin-bottom: 34px; }
  .hero-marquee { padding-top: 0; opacity: 0.9; }
  .marquee-row { height: 169px; }
  .marquee-row:nth-child(3) { display: block; }
  .marquee-track span { color: #121212; }
  .hero-visual { top: 0; }

  .hero-bottom-mobile {
    position: absolute;
    inset: auto 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    color: var(--color-headings);
    text-align: right;
    line-height: 22px;
    transition: opacity 0.6s ease;
  }
  .hero-bottom-mobile.dim { opacity: 0.1; }
  .hero-bottom-mobile svg { flex: none; margin: 0 0 -6px -6px; }

  .block { margin: 20px var(--margin) 64px; scroll-margin-top: 90px; }
  .block:last-child { margin-bottom: 120px; }
  .split, .project-info { grid-template-columns: minmax(0, 1fr); }
  .lead { margin-right: 0; }
  .lead h1 { font-size: 38.4px; margin-top: 26px; }
  .lead p { margin-top: 24px; }
  .col h2 { margin-top: 24px; }

  .cards {
    grid-template-columns: repeat(4, 195px);
    gap: 20px;
    overflow-x: auto;
    margin: 0 calc(var(--margin) * -1);
    padding: 0 var(--margin) 20px;
    border-bottom: 0;
    scrollbar-width: none;
  }
  .cards::-webkit-scrollbar { display: none; }
  .cards + .col-foot { border-top: var(--border-1); padding-top: 20px; margin-top: 0; }

  .table-row { grid-template-columns: 1fr auto; }
  .table-row.three > :nth-child(2) { grid-row: 2; grid-column: 1 / -1; font-size: 14.4px; color: var(--grey-400); text-align: left; }
  .table-row.three > :nth-child(3) { grid-row: 1; grid-column: 2; }
  .table-head.three > :nth-child(2) { display: none; }

  .email-address { font-size: clamp(26px, 9.6vw, 40px); margin-top: -12px; }

  .media-row.two { grid-template-columns: 1fr; }
  .media, .media.stat { height: 56vw; min-height: 200px; }
  .project-info { margin-top: 20px; gap: 8px; }
  .project-info h1 { font-size: 38.4px; }
  .project-text { max-width: none; }
  .project-body { flex-direction: column-reverse; gap: 0; }
  .project-year { margin: 12px 0 0; }
  .tags { margin-top: 8px; }

  .footer { padding-bottom: 20px; }
  .dots { height: 220px; }
  .footer-content { display: flex; flex-direction: column-reverse; }
  .footer-content > div:first-child { margin-right: 0; }
  .footer-nav-col { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-track, .availability::after { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
