@font-face {
  font-family: "Apercu";
  src: url("/fonts/Apercu.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Apercu";
  src: url("/fonts/Apercu-Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Apercu";
  src: url("/fonts/Apercu-Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

html {
  scrollbar-gutter: stable;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: #1a1a1a;
  color: #fff;
  text-decoration: none;
  z-index: 100;
  border-radius: 4px;
  font-size: 0.85rem;
}
.skip-link:focus {
  top: 1rem;
}

/* Focus styles */
:focus-visible {
  outline: 2px solid #666;
  outline-offset: 2px;
}

/* Page transition */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInOnly {
  from { opacity: 0; }
  to { opacity: 1; }
}

main > .page-intro,
main > .section-heading {
  animation: fadeIn 0.3s ease-out forwards;
}

.project-card {
  animation: fadeInOnly 0.3s ease-out;
}

.project-detail > *,
.about-content > * {
  opacity: 0;
  animation: fadeIn 0.3s ease-out forwards;
}

body {
  font-family: "Apercu", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: #1a1a1a;
  background: #ffffff;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Nav */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo img {
  height: 56px;
  width: auto;
  display: block;
}

body.dark .logo img {
  filter: invert(1);
}

.nav-links {
  display: flex;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: #666;
  font-size: 18px;
  font-weight: 500;
  transition: color 0.2s;
}

/* Optical spacing: wider words get less margin, narrower words get more */
.nav-links a:nth-child(1) { margin-right: 1.45rem; } /* Featured (wide) */
.nav-links a:nth-child(2) { margin-right: 1.5rem; }  /* Work */
.nav-links a:nth-child(3) { margin-right: 1.45rem; } /* Play (narrowest) */
.nav-links a:nth-child(4) { margin-right: 1.4rem; }  /* Music */

.nav-links a:hover,
.nav-links a.active {
  color: #1a1a1a;
}

/* Main */
main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 2rem 4rem;
}

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.hero p {
  font-size: 1.25rem;
  color: #666;
  margin-bottom: 2rem;
}

.cta {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: #1a1a1a;
  color: #fff;
  text-decoration: none;
  border-radius: 0;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.cta:hover {
  background: #333;
}

/* Work page */
main h1 {
  font-size: 2rem;
  font-weight: 500;
  margin-bottom: 2rem;
}

.page-intro {
  max-width: 640px;
  color: #444;
  margin-bottom: 3rem;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.25rem;
}
.page-intro a {
  color: inherit;
  text-decoration: underline;
}
.page-intro a:hover {
  color: #fff;
}

body.dark .page-intro {
  color: #aaa;
}

.section-heading {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 2.5rem;
  margin-top: 2.5rem;
}

.section-heading:first-of-type {
  margin-top: 0;
}


.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-flow: dense;
  gap: 1rem;
}

.project-card {
  text-decoration: none;
  color: #1a1a1a;
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-4px);
}

.project-card.wide {
  grid-column: span 2;
}

.project-image-wrap {
  overflow: hidden;
  margin-bottom: 0.35rem;
  aspect-ratio: 3 / 4;
  background: #e5e5e5;
  flex: 1;
  min-height: 0;
}

.project-card.wide .project-image-wrap {
  aspect-ratio: 3 / 2;
}

.project-image-wrap.square {
  aspect-ratio: 1 / 1;
  flex: none;
}

.project-image {
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
  display: block;
}

.project-card h3 {
  font-size: 0.8rem;
  font-weight: 400;
  margin-bottom: 0.25rem;
  text-align: center;
}

.project-card p {
  font-size: 0.85rem;
  color: #666;
}

.project-subtitle {
  font-size: 0.75rem;
  color: #888;
  text-align: center;
  margin-top: -0.15rem;
}

/* About page */
.about-content {
  max-width: 640px;
  margin: 0 auto;
}

.about-content p {
  color: #444;
  margin-bottom: 1.25rem;
}

.about-content p a {
  color: #1a1a1a;
  text-decoration: underline;
}

body.dark .about-content p a {
  color: #fff;
}

.about-separator {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 2rem 0;
}

body.dark .about-separator {
  border-top-color: #333;
}

.about-details {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

.about-details h3 {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.about-details ul {
  list-style: none;
}

.about-details li {
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 0.15rem;
}

.about-details a {
  color: #1a1a1a;
  text-decoration: none;
  border-bottom: 1px solid #ccc;
  transition: border-color 0.2s;
}

.about-details a:hover {
  border-color: #1a1a1a;
}

/* Project prev/next nav */
.project-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0.75rem 2rem;
}

.project-nav-prev,
.project-nav-next {
  font-size: 1.2rem;
  text-decoration: none;
  color: #555;
  transition: color 0.15s;
}

.project-nav-prev:hover,
.project-nav-next:hover {
  color: #1a1a1a;
}

body.dark .project-nav-prev:hover,
body.dark .project-nav-next:hover {
  color: #e0e0e0;
}

.project-nav-next {
  margin-left: auto;
}

/* Project detail page */
.password-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 2rem;
}

.password-gate-inner {
  text-align: center;
  max-width: 360px;
}

.password-gate-inner h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.password-gate-inner > p {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.password-gate form {
  display: flex;
  gap: 0.5rem;
}

.password-gate input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1px solid #333;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font-size: 0.95rem;
  font-family: inherit;
}

.password-gate input:focus {
  outline: none;
  border-color: #666;
}

.password-gate button {
  padding: 0.6rem 1rem;
  border: 1px solid #333;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.password-gate button:hover {
  border-color: #666;
}

.password-error {
  color: #e55;
  font-size: 0.85rem;
  margin-top: 1rem;
}

.project-detail {
  max-width: 1200px;
  padding: 1rem 2rem 4rem;
}

.wide-videos .project-video {
  margin-left: -2rem;
  margin-right: -2rem;
}

.project-video {
  width: 100%;
  border-radius: 0;
  overflow: hidden;
  margin-bottom: 2.5rem;
  position: relative;
}

.project-video iframe {
  transition: opacity 0.3s ease;
}


.project-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.spotify-embed {
  margin-bottom: 2.5rem;
}

.video-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

.video-pair .project-video {
  margin-bottom: 0;
}

.image-grid {
  display: grid;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.image-grid img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.image-grid-2 {
  grid-template-columns: 1fr 1fr;
}

.image-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.image-grid-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

.image-grid-5 {
  grid-template-columns: repeat(5, 1fr);
}

.image-grid-padded {
  gap: 0;
  padding: 1rem;
  background: #fff;
}
.image-grid-padded img {
  width: 100%;
  padding: 30%;
}

.image-grid-bg {
  padding: 1rem;
  background: #fff;
}
.image-grid-bg img {
  padding: 15%;
}
.image-grid-bg img:first-child {
  padding: 8%;
}
.video-grid.image-grid-bg {
  gap: 0;
}
.video-grid.image-grid-bg .project-video {
  padding: 10%;
}

.video-single-bg {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 8rem;
  padding-top: 6rem;
  padding-bottom: 10rem;
}
.video-single-bg .project-video {
  margin-bottom: 0;
  padding: 0 18%;
}
.video-single-bg .project-video:nth-child(3) {
  padding: 0;
}
.video-single-bg .project-video:nth-child(4) {
  padding: 0 8%;
}

.video-mixed-bg {
  margin-bottom: 2.5rem;
}
.video-mixed-bg .video-grid {
  gap: 0;
  margin-bottom: 0;
}
.video-mixed-bg .video-grid .project-video {
  padding: 10%;
}
.video-mixed-bg .video-full {
  margin-bottom: 0;
  padding: 2% 10% 5%;
}
.video-mixed-bg .video-full:first-of-type {
  padding: 0;
}

.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.video-grid .project-video {
  margin-bottom: 0;
}

.side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
  margin-bottom: 2.5rem;
}

.side-by-side .project-video {
  margin-bottom: 0;
}

.side-by-side img {
  width: 100%;
  height: auto;
  display: block;
}

.project-images {
  columns: 2;
  column-gap: 1rem;
  margin-bottom: 2.5rem;
}

.project-images img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 1rem;
  break-inside: avoid;
}

.project-images img.wide {
  column-span: all;
}

.hero-image {
  max-width: 65%;
  margin: 0 auto 2.5rem;
}
.hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

.project-info {
  max-width: 640px;
}

.project-info h1 {
  margin-bottom: 2.5rem;
}

.project-info > p {
  color: #444;
  margin-bottom: 2.5rem;
}

.project-info a {
  color: inherit;
  text-decoration: underline;
}

.project-info a:hover {
  color: #1a1a1a;
}

body.dark .project-info a:hover {
  color: #fff;
}

.project-credits h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.project-credits ul {
  list-style: none;
}

.project-credits li {
  font-size: 0.9rem;
  color: #444;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

.project-credits li span {
  color: #999;
  white-space: nowrap;
}

/* Dark mode toggle */
.dark-mode-toggle {
  background: none;
  border: none;
  padding: 0;
  font-size: 1.25rem;
  color: #999;
  cursor: pointer;
  margin-top: 0.75rem;
  transition: color 0.2s;
  line-height: 1;
}

.dark-mode-toggle:hover {
  color: #1a1a1a;
}

/* 404 */
.not-found {
  text-align: center;
  padding-top: 6rem;
}
.not-found h1 {
  font-size: 4rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}
.not-found p {
  color: #666;
  margin-bottom: 2rem;
}
.not-found a {
  color: inherit;
  text-decoration: underline;
}

/* Footer */
footer {
  padding: 2rem;
  text-align: center;
  font-size: 0.8rem;
  color: #999;
}

/* Dark mode */
body.dark {
  background: #000;
  color: #e0e0e0;
}

body.dark .nav-links a {
  color: #888;
}

body.dark .nav-links a:hover,
body.dark .nav-links a.active {
  color: #e0e0e0;
}

body.dark .project-card {
  color: #e0e0e0;
}

body.dark .project-image-wrap {
  background: #222;
}

body.dark .project-image {
  background: #222;
}

body.dark .about-content p,
body.dark .about-details li,
body.dark .project-info > p,
body.dark .project-credits li {
  color: #aaa;
}

body.dark .about-details a {
  color: #e0e0e0;
  border-bottom-color: #444;
}

body.dark .about-details a:hover {
  border-bottom-color: #e0e0e0;
}

body.dark .project-credits li {
  border-bottom-color: #333;
}

body.dark .project-credits li span {
  color: #666;
}

body.dark footer {
  color: #555;
}

body.dark .dark-mode-toggle {
  color: #555;
}

body.dark .dark-mode-toggle:hover {
  color: #e0e0e0;
}

/* Responsive - Tablet */
@media (max-width: 768px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .project-card.wide {
    grid-column: span 1;
  }

  .project-card.wide .project-image-wrap {
    aspect-ratio: 3 / 4;
  }

  .project-credits li {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .project-images {
    grid-template-columns: 1fr;
  }

  .video-pair {
    grid-template-columns: 1fr;
  }

  .page-intro {
    font-size: 1.1rem;
  }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
  nav {
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem 1.25rem;
  }

  .logo img {
    height: 44px;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .nav-links a {
    font-size: 1rem;
    margin-right: 0 !important;
  }

  .project-nav {
    flex-direction: row;
    padding: 0.5rem 1.25rem;
    justify-content: space-between;
  }

  .project-nav-next {
    margin-left: 0;
  }

  main {
    padding: 2rem 1.25rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .video-grid,
  .side-by-side,
  .video-pair {
    grid-template-columns: 1fr;
  }

  .page-intro {
    font-size: 1rem;
  }

  .wide-videos .project-video {
    margin-left: -1.25rem;
    margin-right: -1.25rem;
  }

  .project-detail {
    padding: 1rem 1.25rem 2rem;
  }

  .project-info h1 {
    font-size: 1.5rem;
  }

  .project-credits li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .about-details {
    grid-template-columns: 1fr;
    text-align: center;
  }

  footer {
    padding: 1.5rem 1.25rem;
  }
}
