:root {
  --bg: #020202;
  --panel: #090909;
  --text: #ffffff;
  --muted: #b8b8b8;
  --line: #1e1e1e;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body {
  min-height: 100vh;
}

a {
  color: inherit;
}

a:visited {
  color: inherit;
}

.page-shell {
  max-width: 1600px;
  margin: 0 auto;
  padding: 22px 28px 36px;
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 44px;
}

.profile-column {
  position: sticky;
  top: 22px;
  align-self: start;
  padding: 6px 4px;
}

.name {
  margin: 8px 0 24px;
  font-size: clamp(2.8rem, 5vw, 5rem);
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.blurb {
  max-width: 210px;
  margin: 0 0 24px;
  line-height: 1.2;
  font-size: 1.05rem;
}

.meta {
  margin: 0 0 20px;
  font-size: 1.03rem;
}

.contact-links {
  display: grid;
  gap: 6px;
  margin: 0 0 30px;
}

.contact-links a {
  text-decoration-thickness: 1px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: none;
}

.filter-btn {
  border: 1px solid #d8d8d8;
  background: #ededed;
  color: #161616;
  border-radius: 5px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  text-align: center;
}

.filter-btn:hover {
  background: #fff;
}

.filter-btn.active {
  background: #111;
  color: #f1f1f1;
  border-color: #888;
}

.filter-count {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 0.95rem;
}

.projects-column {
  display: grid;
  gap: 28px;
}

.project-row {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(360px, 1fr);
  gap: 28px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.project-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.project-row.is-hidden {
  display: none;
}

.context-row {
  grid-template-columns: 1fr;
}

.context-row .project-copy p {
  max-width: 62ch;
}

.project-copy h2 {
  margin: 0 0 12px;
  font-size: 2rem;
  line-height: 1.1;
}

.project-copy h2 a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.project-copy p {
  margin: 0 0 16px;
  font-size: 1.18rem;
  line-height: 1.3;
  max-width: 34ch;
}

.tags {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  color: #ffffff;
  font-size: 1.1rem;
  line-height: 1.35;
}

.visit-link {
  display: inline-block;
  font-size: 1.1rem;
  text-underline-offset: 2px;
}

.project-media {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid #111;
  min-height: 300px;
}

.carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 310px;
  overflow: hidden;
  background: #000;
}

.slide {
  margin: 0;
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateX(100%);
  transition: transform 760ms cubic-bezier(0.22, 0.61, 0.36, 1), opacity 420ms ease;
  display: grid;
  grid-template-rows: 1fr auto;
  pointer-events: none;
  will-change: transform, opacity;
  z-index: 1;
}

.slide.active {
  opacity: 1;
  transform: translateX(0);
  z-index: 2;
  pointer-events: auto;
}

.slide.entering {
  opacity: 1;
  transform: translateX(100%);
  z-index: 3;
}

.slide.leaving {
  opacity: 1;
  transform: translateX(-100%);
  z-index: 2;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.slide figcaption {
  display: none;
}

.carousel-meta {
  border-top: 1px solid #111;
  background: #050505;
  padding: 8px 10px 10px;
}

.carousel-caption {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.2;
}

.carousel-dots {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: #5b5b5b;
  opacity: 0.75;
  cursor: pointer;
  transition: transform 220ms ease, background-color 220ms ease, opacity 220ms ease;
}

.carousel-dot:hover {
  opacity: 1;
}

.carousel-dot.active {
  background: #ffffff;
  opacity: 1;
  transform: scale(1.25);
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
  z-index: 9999;
  padding: 24px;
}

.lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-inner {
  position: relative;
  max-width: min(1400px, 96vw);
  max-height: 92vh;
  width: fit-content;
}

.lightbox-image {
  display: block;
  max-width: min(1400px, 96vw);
  max-height: 84vh;
  width: auto;
  height: auto;
  border: 1px solid #262626;
  background: #060606;
}

.lightbox-caption {
  margin: 10px 0 0;
  text-align: center;
  color: #f2f2f2;
  font-size: 0.95rem;
}

.lightbox-close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #3f3f3f;
  background: rgba(10, 10, 10, 0.9);
  color: #ffffff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(26, 26, 26, 0.95);
}
}

@media (prefers-reduced-motion: reduce) {
  .slide {
    transition: none;
  }

  .lightbox {
    transition: none;
  }
}

@media (max-width: 1150px) {
  .page-shell {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .profile-column {
    position: static;
  }

  .filters {
    max-width: none;
  }
}

@media (max-width: 900px) {
  .project-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding-top: 14px;
  }

  .project-copy p {
    max-width: 100%;
  }

  .carousel {
    min-height: 240px;
  }
}

@media (max-width: 580px) {
  .name {
    font-size: clamp(2.2rem, 17vw, 4rem);
  }

  .blurb,
  .meta,
  .project-copy p,
  .tags,
  .visit-link,
  .project-copy h2 {
    font-size: 1rem;
  }

  .project-copy h2 {
    font-size: 1.2rem;
  }

  .filter-btn {
    font-size: 1rem;
  }
}
