@font-face {
  font-family: Inter;
  src: url("./assets/inter.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed";
  src: url("./assets/barlow-condensed.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #0a0a0a;
  --foreground: #f5f5f5;
  --muted: #a1a1a1;
  --border: #2a2a2a;
  --accent: #00aaff;
  --side: 24px;
  --heading-font: "Barlow Condensed", "Arial Narrow", sans-serif;
  background: var(--background);
  color: var(--foreground);
  font: 1rem/1.5 Inter, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, p, figure { margin: 0; }
img { display: block; max-width: 100%; }
button, a { color: inherit; }
button { font: inherit; }
a { text-underline-offset: 0.25em; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

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

.skip-link {
  position: fixed;
  z-index: 20;
  top: 8px;
  left: var(--side);
  padding: 8px 16px;
  background: var(--background);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 5;
  top: 0;
  border-bottom: 1px solid var(--border);
  background: rgb(10 10 10 / 95%);
  backdrop-filter: blur(6px);
}

.header-row, .footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-row { min-height: 55px; }
.brand { min-width: 0; }
.brand img { width: auto; height: 30px; object-fit: contain; object-position: left; }
.header-link, .footer-link {
  color: var(--accent);
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}
.header-link:hover, .footer-link:hover { text-decoration: underline; }
.header-link, .contact-artstation {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.artstation-icon {
  flex: none;
  fill: var(--accent);
}

.intro { padding-block: 88px 64px; }

h1 {
  margin-bottom: 24px;
  font: 700 clamp(2.25rem, 4.4vw, 3.5rem)/1 var(--heading-font);
  letter-spacing: -0.025em;
  text-transform: uppercase;
}

.tagline {
  max-width: 35rem;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 1.125rem;
  line-height: 1.6;
}
.location { margin-bottom: 32px; }
.contact-intro { margin-bottom: 4px; }
.location, .contact-intro, .section-heading, .footer-row { color: var(--muted); }
.location, .contact-intro, .contact, .section-heading { font-size: 1rem; }
.location span { color: var(--foreground); }

.contact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
}
.email { color: var(--accent); overflow-wrap: anywhere; text-decoration: none; }
.email:hover { text-decoration: underline; }
.contact-divider { color: var(--border); }
.contact-artstation {
  border: 1px solid var(--border);
  padding: 5px 12px;
  color: var(--muted);
  text-decoration: none;
}
.contact-artstation:hover { color: var(--foreground); border-color: var(--accent); }

.credits, .work { border-top: 1px solid var(--accent); padding-block: 64px; }
.section-heading { margin-bottom: 36px; font-weight: 400; }
.work .section-heading { margin-bottom: 32px; }

.credit-carousel {
  --columns: 6;
  --gap: 12px;
}

.credit-row {
  --credit-year-space: 1.875rem;
  position: relative;
  margin-inline: 24px;
}

.credit-track {
  display: grid;
  grid-auto-columns: calc((100% - (var(--columns) - 1) * var(--gap)) / var(--columns));
  grid-auto-flow: column;
  gap: var(--gap);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  padding: 0;
  margin: 0;
  list-style: none;
}
.credit-track::-webkit-scrollbar { display: none; }
.credit-track:focus-visible { outline-offset: 2px; }
.credit-track > li { scroll-snap-align: start; }

.credit-year {
  display: block;
  min-block-size: var(--credit-year-space);
  color: var(--foreground);
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.credit-card {
  position: relative;
  display: grid;
  align-items: center;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #111;
  border: 1px solid var(--border);
}
.credit-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 300ms;
}
.credit-card figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 18px 7px 7px;
  background: linear-gradient(transparent, rgb(0 0 0 / 90%) 60%);
  font-size: 0.8125rem;
  line-height: 1.2;
  opacity: 0;
  transition: opacity 180ms;
}
.credit-card:hover { border-color: var(--accent); }
.credit-card:hover img { transform: scale(1.035); }
.credit-card:hover figcaption, .credit-track:focus-visible figcaption { opacity: 1; }

.icon-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--background);
  cursor: pointer;
}
.icon-button:hover:not([aria-disabled="true"]) {
  border-color: var(--accent);
  color: var(--accent);
}
.icon-button[aria-disabled="true"] { opacity: 0.35; cursor: default; }
.credit-row > .icon-button {
  position: absolute;
  z-index: 1;
  top: calc(50% + var(--credit-year-space) / 2);
  transform: translateY(-50%);
  box-shadow: 0 0 14px rgb(0 0 0 / 55%);
}
.credit-row > .previous { left: -20px; }
.credit-row > .next { right: -20px; }
.chevron {
  width: 8px;
  height: 8px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
}
.previous .chevron { transform: translateX(2px) rotate(135deg); }
.next .chevron { transform: translateX(-2px) rotate(-45deg); }

.credit-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
}
.credit-dot {
  display: grid;
  place-items: center;
  width: 20px;
  height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.credit-dot::before {
  width: 6px;
  height: 6px;
  background: #626262;
  content: "";
}
.credit-dot:hover::before, .credit-dot[aria-current="true"]::before { background: var(--accent); }
.credit-dot:focus-visible { outline-offset: -2px; }

.project + .project { border-top: 1px solid var(--border); }
.project {
  display: block;
  position: relative;
  overflow: hidden;
  background: #111;
  text-decoration: none;
}
.project img {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: var(--image-position, center);
  transition: transform 420ms ease;
}
.project[data-project="pulley"] img { object-fit: contain; background: #000; }
.project::after {
  position: absolute;
  inset: auto 0 0;
  height: 35%;
  background: linear-gradient(transparent, rgb(0 0 0 / 85%));
  content: "";
  opacity: 0;
  transition: opacity 220ms;
}
.project-title {
  position: absolute;
  z-index: 1;
  bottom: 18px;
  left: 20px;
  color: white;
  font: 700 clamp(1.25rem, 2.5vw, 1.55rem)/1 var(--heading-font);
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 220ms;
}
.project:is(:hover, :focus-visible)::after,
.project:is(:hover, :focus-visible) .project-title { opacity: 1; }
.project:hover img { transform: scale(1.018); }
.project:focus-visible { outline-offset: -4px; z-index: 2; }

.site-footer { border-top: 1px solid var(--border); }
.footer-row { padding-block: 30px; font-size: 0.875rem; }
.footer-link { color: var(--muted); }
.footer-link:hover { color: var(--accent); }

body:has(.gallery[open]) { overflow: hidden; }
.gallery {
  --gallery-pad: clamp(12px, 3vw, 32px);
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: var(--gallery-pad);
  border: 0;
  background: #0a0a0a;
  color: var(--foreground);
}
.gallery[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
}
.gallery-header, .gallery-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.gallery-title {
  font: 700 clamp(1.35rem, 3vw, 2rem)/1 var(--heading-font);
  text-transform: uppercase;
}
.gallery-close {
  width: auto;
  padding-inline: 12px;
  font-size: 0.875rem;
}
.gallery-image {
  display: grid;
  width: 100%;
  min-height: 0;
  place-items: center;
  touch-action: pan-y pinch-zoom;
}
.gallery-image img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}
.gallery-actions { justify-content: center; }
.gallery-position { min-width: 6ch; color: var(--muted); text-align: center; }

@media (hover: none) {
  .project::after, .project-title { opacity: 1; }
}

@media (min-width: 1080px) {
  :root { --side: clamp(24px, 3.125vw, 64px); }
  .wrap { width: min(100% - 2 * var(--side), 1800px); }
  .credit-carousel { --columns: 7; }
}

@media (min-width: 1300px) {
  .credit-carousel { --columns: 8; }
}

@media (min-width: 1520px) {
  .credit-carousel { --columns: 9; }
}

@media (min-width: 1740px) {
  .credit-carousel { --columns: 10; }
}

@media (max-width: 767px) {
  .intro { padding-block: 68px 48px; }
  .credits, .work { padding-block: 44px; }
  .credit-carousel { --columns: 4; --gap: 9px; }
  .brand img { height: 25px; }
}

@media (max-width: 520px) {
  :root { --side: 16px; }
  .credit-carousel { --columns: 2; }
  .credit-dot { width: 17px; }
  .contact-divider { display: none; }
  .brand img { height: 21px; }
  .project-title { bottom: 12px; left: 12px; }
}

@media (max-width: 360px) {
  .brand img { height: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
