/* ------------------------------------------------------------------ tokens */
:root {
  --ink: #16130f;          /* warm black  */
  --paper: #ffffff;        /* white       */
  --surface: #f2f0ec;      /* soft neutral gray */
  --line: #e2ded7;         /* hairline, derived from surface */
  --muted: #6f6a63;        /* gray text   */

  --bar-top: 3.5rem;
  --bar-bottom: 2.75rem;
  --gutter: clamp(1rem, 3.2vw, 2.5rem);
  --maxw: 82rem;

  --radius: 2px;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);

  --fs-micro: 0.6875rem;
  --fs-small: 0.8125rem;
  --fs-body: 1rem;

  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica,
    Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.55;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--bar-top);
  padding-bottom: var(--bar-bottom);
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

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

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

.skip {
  position: fixed;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 0.5rem 0.875rem;
  font-size: var(--fs-small);
}
.skip:focus {
  left: 0.5rem;
  top: 0.5rem;
}

/* -------------------------------------------------------------- fixed bars */
.bar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 var(--gutter);
  background: var(--paper);
  font-size: var(--fs-small);
}

.bar--top {
  top: 0;
  height: var(--bar-top);
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.bar--bottom {
  bottom: 0;
  min-height: var(--bar-bottom);
  height: var(--bar-bottom);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  justify-content: space-between;
}

.bar__name {
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.bar__name:hover {
  opacity: 0.55;
}

.bar__nav {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
}

.bar__tab {
  color: var(--muted);
  transition: color 0.2s var(--ease);
}
.bar__tab:hover,
.bar__tab.is-active {
  color: var(--ink);
}
.bar__tab.is-active {
  text-decoration: underline;
  text-underline-offset: 0.35em;
  text-decoration-thickness: 1px;
}

.bar__contacts {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.25rem);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  white-space: nowrap;
  margin: 0 -0.25rem;
  padding: 0 0.25rem;
}
.bar__contacts::-webkit-scrollbar {
  display: none;
}

.contact {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  flex: 0 0 auto;
}
.contact__label {
  color: var(--muted);
  font-size: var(--fs-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.contact__value {
  transition: opacity 0.2s var(--ease);
}
a.contact:hover .contact__value {
  opacity: 0.55;
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}

.bar__note {
  color: var(--muted);
  font-size: var(--fs-micro);
  white-space: nowrap;
}

/* ------------------------------------------------------------------ layout */
.main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) clamp(4rem, 10vw, 7rem);
}
.main--bleed {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0;
}
.main--bleed > * {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.page {
  max-width: var(--maxw);
  margin: 0 auto;
}

.page__head {
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
}

.page__title {
  font-size: clamp(2rem, 6vw, 3.75rem);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.page__sub {
  margin-top: 0.75rem;
  color: var(--muted);
  max-width: 46ch;
  text-wrap: pretty;
}

.empty {
  color: var(--muted);
  padding: 3rem 0;
}
.empty a,
.frame--placeholder a {
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* ------------------------------------------------------------------ frames */
.frame {
  position: relative;
  background: var(--surface);
  overflow: hidden;
  border-radius: var(--radius);
}
.frame > img,
.frame > video,
.frame > iframe {
  width: 100%;
  height: auto;
  display: block;
  border: 0;
}
.frame--embed {
  aspect-ratio: 16 / 9;
}
.frame--embed > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.frame--reel {
  aspect-ratio: 16 / 9;
  /* Never taller than the space between the two fixed bars. */
  max-height: calc(100vh - var(--bar-top) - var(--bar-bottom) - 5rem);
}
.frame--reel > video,
.frame--reel > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame--placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: var(--fs-small);
}

.frame__sound {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  color: var(--paper);
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font: inherit;
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: opacity 0.2s var(--ease);
}
.frame__sound:hover {
  opacity: 0.75;
}

/* -------------------------------------------------------------------- home */
.reel {
  padding-top: clamp(1rem, 3vw, 2rem);
}
.reel__caption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: var(--fs-small);
}

.intro {
  max-width: var(--maxw);
  margin: clamp(3.5rem, 10vw, 7rem) auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
}

.intro__lead {
  font-size: clamp(1.6rem, 3.6vw, 2.75rem);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
  margin: 0;
}

.intro__body {
  color: var(--muted);
  max-width: 44ch;
}

.intro__more {
  grid-column: 1 / -1;
  margin-top: clamp(1rem, 3vw, 2rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-small);
}
.link-arrow::after {
  content: "→";
  transition: transform 0.25s var(--ease);
}
.link-arrow:hover::after {
  transform: translateX(0.35rem);
}

/* -------------------------------------------------------------------- work */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
}
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: var(--fs-small);
  color: var(--muted);
  transition: all 0.2s var(--ease);
}
.chip:hover {
  color: var(--ink);
  border-color: var(--ink);
}
.chip sup {
  font-size: 0.625rem;
  color: var(--muted);
}

.group {
  margin-bottom: clamp(3rem, 8vw, 5.5rem);
  scroll-margin-top: calc(var(--bar-top) + 1.5rem);
}

.group__head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.875rem;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
}

.group__title {
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.group__blurb {
  color: var(--muted);
  font-size: var(--fs-small);
  flex: 1;
}

.group__count {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--fs-micro);
  font-variant-numeric: tabular-nums;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(20rem, 100%), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1rem, 2.5vw, 2rem);
}

.card {
  display: block;
}

.cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface);
  overflow: hidden;
  border-radius: var(--radius);
}
.cover img,
.cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), opacity 0.3s var(--ease);
}
.card:hover .cover img,
.card:hover .cover video {
  transform: scale(1.025);
}
.cover--empty {
  border: 1px solid var(--line);
  background: var(--surface);
}

.card__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.875rem;
}

.card__title {
  font-size: var(--fs-body);
  font-weight: 500;
  letter-spacing: -0.015em;
}
.card:hover .card__title {
  text-decoration: underline;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 1px;
}

.card__date {
  color: var(--muted);
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card__desc {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: var(--fs-small);
  max-width: 42ch;
  text-wrap: pretty;
}

/* ----------------------------------------------------------------- project */
.project__cover {
  padding-top: clamp(1rem, 3vw, 2rem);
}
.project__cover .frame {
  max-height: 78vh;
}
.project__cover .frame > img,
.project__cover .frame > video {
  width: 100%;
  max-height: 78vh;
  object-fit: cover;
}

.project__head,
.project__cols,
.gallery,
.pager {
  max-width: var(--maxw);
  margin-inline: auto;
}

.project__head {
  padding-top: clamp(2rem, 6vw, 4rem);
  padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
}

.project__title {
  font-size: clamp(2rem, 6.5vw, 4.25rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1;
  text-wrap: balance;
}

.project__lead {
  margin-top: 1rem;
  font-size: clamp(1.0625rem, 1.7vw, 1.375rem);
  color: var(--muted);
  max-width: 52ch;
  text-wrap: pretty;
}

.project__cols {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4.5rem);
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  border-top: 1px solid var(--line);
}

.project__meta {
  position: sticky;
  top: calc(var(--bar-top) + 2rem);
  align-self: start;
}

.meta {
  display: grid;
  gap: 1.125rem;
}
.meta__row {
  display: grid;
  gap: 0.2rem;
}
.meta__label {
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.meta__value {
  font-size: var(--fs-small);
  margin: 0;
  text-wrap: pretty;
}
.meta__value a {
  text-decoration: underline;
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1px;
}
.meta__value a:hover {
  opacity: 0.6;
}

/* ------------------------------------------------------------------- prose */
.prose {
  max-width: 62ch;
  text-wrap: pretty;
}
.prose--wide {
  max-width: 68ch;
  font-size: clamp(1rem, 1.4vw, 1.125rem);
}
.prose > * + * {
  margin-top: 1.1em;
}
.prose h2 {
  font-size: 1.375rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-top: 2em;
}
.prose h3 {
  font-size: 1.125rem;
  font-weight: 500;
  margin-top: 1.75em;
}
.prose h4 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 1.5em;
}
.prose a {
  text-decoration: underline;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}
.prose a:hover {
  opacity: 0.6;
}
.prose ul,
.prose ol {
  padding-left: 1.15em;
}
.prose li + li {
  margin-top: 0.35em;
}
.prose blockquote {
  margin: 1.5em 0;
  padding-left: 1.25rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
}
.prose code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--surface);
  padding: 0.1em 0.35em;
  border-radius: var(--radius);
}
.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.5em 0;
}

/* ----------------------------------------------------------------- gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2.5vw, 2rem);
  margin-top: clamp(3rem, 8vw, 5.5rem);
}
.gallery__item {
  margin: 0;
}
.gallery__item--full {
  grid-column: 1 / -1;
}
.gallery__item figcaption {
  margin-top: 0.625rem;
  color: var(--muted);
  font-size: var(--fs-small);
}

/* ------------------------------------------------------------------- pager */
.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: clamp(3.5rem, 9vw, 6rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.pager__link {
  display: grid;
  gap: 0.2rem;
  max-width: 45%;
}
.pager__link--next {
  text-align: right;
}
.pager__hint {
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.pager__title {
  font-size: var(--fs-small);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pager__link:hover .pager__title {
  text-decoration: underline;
  text-underline-offset: 0.3em;
  text-decoration-thickness: 1px;
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 60rem) {
  .intro,
  .project__cols {
    grid-template-columns: 1fr;
  }
  .project__meta {
    position: static;
  }
  .project__cols {
    gap: 2rem;
  }
}

@media (max-width: 40rem) {
  :root {
    --bar-top: 3.25rem;
    --bar-bottom: 2.5rem;
  }
  .gallery {
    grid-template-columns: 1fr;
  }
  .gallery__item--half {
    grid-column: 1 / -1;
  }
  .bar__note {
    display: none;
  }
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .bar,
  .skip {
    display: none;
  }
  body {
    padding: 0;
  }
}
