:root {
  --bg: #05060a;
  --ink: #f3f1ec;
  --muted: #c9c5bc;
  --line: rgba(255, 255, 255, 0.16);
  --card: rgba(14, 16, 24, 0.82);
  --focus: #b9d6ff;
  --overlay: rgba(5, 6, 10, 0.94);
  --measure: 40rem;
}

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

html {
  scroll-behavior: smooth;
  touch-action: manipulation;
}

body {
  margin: 0;
  background:
    radial-gradient(900px 520px at 50% -10%, rgba(48, 72, 130, 0.28), transparent 62%),
    var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

#stars {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

img {
  max-width: 100%;
  height: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: 1.25rem;
  top: 0;
  transform: translateY(-120%);
  background: var(--ink);
  color: var(--bg);
  padding: 0.5rem 0.75rem;
  z-index: 20;
}

.skip:focus {
  transform: none;
}

.site-header,
main {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--measure));
  margin-inline: auto;
}

.site-header {
  padding: calc(1.25rem + env(safe-area-inset-top, 0px)) 0 1.15rem;
}

h1,
h2 {
  font-weight: 640;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

h1 {
  margin: 0;
  font-size: 2.35rem;
}

h2 {
  margin: 0.2rem 0 0.55rem;
  font-size: 1.65rem;
}

.lede {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.contact {
  margin: 1.15rem 0 0;
}

.contact a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
}

.contact a:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.45);
}

main {
  padding-bottom: 3rem;
}

.project {
  margin: 0 0 1rem;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
}

.eyebrow {
  margin: 0;
  color: var(--focus);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow span {
  margin-right: 0.45rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.project p {
  margin: 0;
  color: var(--muted);
}

.project-copy p + p {
  margin-top: 0.45rem;
}

.project p.stack {
  margin-top: 0.7rem;
  color: var(--ink);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
}

.shots {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.reel {
  position: relative;
}

.project:not(.project-wide) .reel {
  width: 100%;
  width: min(100%, calc((100lvh - 6.5rem) * 1206 / 2622 + 0.56rem));
  max-width: 100%;
  margin: 0.85rem auto 0;
}

.project:not(.project-wide) .reel .shots {
  margin-top: 0;
}

.project:not(.project-wide) .shot {
  padding: 0.28rem;
  border-radius: 1.85rem;
  background: #07080c;
  border-color: rgba(255, 255, 255, 0.16);
}

.project:not(.project-wide) .shot img {
  width: 100%;
  max-height: none;
  border-radius: 1.57rem;
}

.shots:has(.shot + .shot) {
  display: flex;
  gap: 0;
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.shots:has(.shot + .shot)::-webkit-scrollbar {
  display: none;
}

.reel-nav {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.icon-btn.reel-btn {
  background: #12141c;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.shots:has(.shot + .shot) .shot {
  flex: 0 0 100%;
  scroll-snap-align: center;
}

.shot {
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0;
  padding: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.35);
  cursor: zoom-in;
  overflow: hidden;
}

.shot img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 28rem;
  object-fit: contain;
  border-radius: 10px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

.icon-btn svg {
  width: 1.35rem;
  height: 1.35rem;
}

.icon-btn[hidden] {
  display: none;
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

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

.lightbox :focus-visible {
  outline-color: #fff;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding:
    max(0.75rem, env(safe-area-inset-top))
    max(0.75rem, env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom))
    max(0.75rem, env(safe-area-inset-left));
}

.lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

.lightbox-title {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0.65rem 3.25rem 0.35rem 0.25rem;
  color: #fff;
  font-size: 0.95rem;
}

.lightbox-close {
  position: absolute;
  z-index: 2;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
}

.lightbox-stage {
  position: relative;
  z-index: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
}

.lightbox-stage img {
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform: translate(var(--x, 0px), var(--y, 0px)) scale(var(--scale, 1));
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-stage img.is-anim {
  transition: transform 220ms ease;
}

.lightbox-tools {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding-top: 0.75rem;
}

html.lightbox-open {
  overflow: hidden;
}

html.js .project-copy,
html.js .project > .shots,
html.js .reel {
  opacity: 0;
  transform: translateY(0.85rem);
  transition: opacity 480ms ease, transform 480ms ease;
}

html.js .project.is-in .project-copy,
html.js .project.is-in .shots,
html.js .project.is-in .reel {
  opacity: 1;
  transform: none;
}

@media (min-width: 48rem) {
  :root {
    --measure: 52rem;
  }

  body {
    font-size: 1.0625rem;
  }

  h1 {
    font-size: 3.25rem;
  }

  .site-header {
    padding-top: 4.5rem;
  }

  .project {
    padding: 1.35rem 1.4rem 1.4rem;
  }

  .project:not(.project-wide) {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.25rem 1.5rem;
    align-items: start;
  }

  .project:not(.project-wide) .reel,
  .project:not(.project-wide) > .shots {
    width: calc(28rem * 1206 / 2622);
    margin: 0;
    justify-self: end;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  html.js .project-copy,
  html.js .project > .shots,
  html.js .reel {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .lightbox-stage img.is-anim {
    transition: none;
  }
}
