@import url('https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,400;0,500;0,700;1,400&display=swap');

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

:root {
  --bg: #000;
  --fg: #fff;
  --font: 'Public Sans', sans-serif;
  --page-padding: 1.5rem;
  --ui-size: clamp(1rem, 1.5vw, 1.25rem);
}

html,
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  min-height: 100vh;
}

body.lightbox-open {
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: var(--page-padding);
  top: 0.75rem;
  transform: translateY(-200%);
  background: var(--fg);
  color: var(--bg);
  padding: 0.55rem 0.8rem;
  text-decoration: none;
  font-size: 0.9rem;
  z-index: 2000;
}

.skip-link:focus {
  transform: translateY(0);
}

/* ── Header ── */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--page-padding);
  padding-bottom: 1.25rem;
}

.site-title {
  font-size: var(--ui-size);
  font-weight: 700;
  line-height: 1;
}

.site-title-link {
  color: inherit;
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: baseline;
  gap: 2.5rem;
}

.site-nav a {
  color: var(--fg);
  text-decoration: none;
  font-size: var(--ui-size);
  font-weight: 400;
}

.site-nav a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-nav a.active {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.page-intro {
  padding: 0 var(--page-padding) 2.5rem var(--page-padding);
  max-width: 800px;
}

.page-intro p {
  font-size: var(--ui-size);
  line-height: 1.5;
  font-weight: 400;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .page-intro {
    padding-bottom: 1.5rem;
  }
  
  .page-intro p {
    font-size: 0.9rem;
  }

  .page-intro br {
    display: none;
  }
}

@media (max-width: 768px) {
  .site-header {
    align-items: center;
  }

  .site-nav {
    gap: 1.25rem;
  }

  .site-nav a {
    font-size: 0.75rem;
  }
}

/* ── Grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem 0.5rem;
  padding: var(--page-padding);
  padding-top: 0;
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* ── Card ── */
.card {
  text-decoration: none;
  color: var(--fg);
  display: block;
}

.card figure {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #1a1a1a;
  transition: transform 0.4s ease;
}

.card:hover figure {
  transform: scale(1.02);
}

.card figure img,
.card figure video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: transparent;
  transition: filter 0.25s ease;
}

.card figure:hover img,
.card figure:hover video {
  filter: blur(6px);
}

/* ── Hover overlay ── */
.card .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.card figure:hover .overlay {
  opacity: 1;
}

.tease {
  color: #fff;
  font-style: italic;
  font-weight: 400;
  font-size: 1.3rem;
  text-align: center;
}

/* ── Caption ── */
.card figcaption {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.01em;
}

/* ── Project page ── */
.project {
  padding: var(--page-padding);
  padding-top: 0;
  display: grid;
  grid-template-columns: 1fr 2fr;
  grid-template-areas:
    "title   title"
    "desc    video"
    "gallery gallery";
  gap: 0 3rem;
  align-items: start;
}

.project-title {
  grid-area: title;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.project-description {
  grid-area: desc;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
}

.project-description p {
  margin-bottom: 1.25rem;
}

.project-description a {
  color: var(--fg);
  text-underline-offset: 3px;
}

.project-description a:hover {
  opacity: 0.7;
}

.project-awards {
  list-style: none;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.project-awards li {
  font-size: 0.9rem;
  opacity: 0.85;
}

.project-video {
  grid-area: video;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 3rem;
}

.project-video iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.project-video-pair {
  grid-area: auto;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0;
  margin-bottom: 2.25rem;
}

.project-video-pair .video-tile {
  aspect-ratio: 16 / 9;
}

.project-gallery.project-gallery-after-videos {
  grid-area: gallery;
  grid-column: 1 / -1;
  margin-top: 0;
}

.project-gallery {
  grid-area: gallery;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 2rem;
  margin-bottom: 3rem;
}

@media (min-width: 769px) {
  .project-gallery {
    opacity: 0.25;
    transition: opacity 0.7s ease;
  }

  .project-gallery.gallery-revealed {
    opacity: 1;
  }
}

.battleofbaron-gallery {
  grid-template-columns: repeat(12, 1fr);
}

.battleofbaron-gallery .gallery-item:nth-child(1),
.battleofbaron-gallery .gallery-item:nth-child(2),
.battleofbaron-gallery .gallery-item:nth-child(3),
.battleofbaron-gallery .gallery-item:nth-child(8),
.battleofbaron-gallery .gallery-item:nth-child(9) {
  grid-column: span 4;
}

.battleofbaron-gallery .gallery-item:nth-child(4),
.battleofbaron-gallery .gallery-item:nth-child(5),
.battleofbaron-gallery .gallery-item:nth-child(6),
.battleofbaron-gallery .gallery-item:nth-child(7) {
  grid-column: span 3;
}

.battleofbaron-gallery .gallery-item.portrait {
  aspect-ratio: 3 / 5;
}

@media (max-width: 768px) {
  .project {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "desc"
      "video"
      "gallery";
    gap: 0;
  }

  .project-title {
    margin-bottom: 1.5rem;
  }

  .project-description {
    margin-bottom: 2rem;
  }

  .project-video {
    margin-bottom: 2rem;
  }

  .project-video-pair {
    grid-template-columns: 1fr;
    margin-top: 0;
    margin-bottom: 2rem;
  }

  .project-gallery.project-gallery-after-videos {
    grid-row: auto;
  }

  .project-gallery {
    grid-template-columns: 1fr;
    margin-top: 0;
    margin-bottom: 2rem;
  }

  .battleofbaron-gallery {
    grid-template-columns: 1fr;
  }

  .battleofbaron-gallery .gallery-item {
    grid-column: span 1 !important;
  }
}

/* ── Lightbox ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-dialog {
  position: relative;
  width: min(90vw, calc(90vh * 1.6));
  max-height: 90vh;
}

.lightbox-image {
  width: 100%;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: -2.75rem;
  right: 0;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: var(--fg);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font: inherit;
}

.gallery-item {
  cursor: pointer;
  transition: opacity 0.2s;
}

.gallery-item:hover {
  opacity: 0.85;
}

.gallery-item:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
  opacity: 1;
}

.project-gallery .gallery-item {
  aspect-ratio: 16 / 10;
  background: #1a1a1a;
  overflow: hidden;
}

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

.project-gallery .gallery-item.portrait img {
  object-fit: contain;
  background: #111;
}

/* ── Collage variant — natural proportions, no forced crop ── */
.collage {
  align-items: start;
  grid-template-columns: repeat(6, 1fr);
}

.collage .gallery-item {
  aspect-ratio: unset;
}

.collage .gallery-item img {
  height: auto;
  object-fit: unset;
}

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

/* ── About page ── */
.about {
  padding: var(--page-padding);
  padding-top: 0;
}

/* Intro: bio+career left, photo right */
.about-intro {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 5rem;
  align-items: start;
  margin-top: 4rem;
  margin-bottom: 4rem;
}

.about-photo {
  position: sticky;
  top: 1.5rem;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

.about-bio {
  font-size: 1.35rem;
  line-height: 1.6;
  max-width: 60ch;
  margin-bottom: 2.5rem;
}

.about-bio p {
  margin-bottom: 1.25rem;
}

.about-bio p:last-child {
  margin-bottom: 0;
}

.about-bio a {
  color: var(--fg);
  text-underline-offset: 3px;
}

.about-bio a:hover {
  opacity: 0.7;
}

.about-career {
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  line-height: 1.8;
}

.about-career p {
  font-size: 0.95rem;
  opacity: 0.85;
}

.about-career p em {
  font-style: normal;
}

/* Divider */
.about-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  margin: 0 0 4rem;
}

/* Press + Awards columns */
.about-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
  padding-bottom: 4rem;
}

.about-section-heading {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 2rem;
}

/* Press list — ruled rows */
.press-list {
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.press-list li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.9rem 0;
}

.press-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.press-list li a {
  color: var(--fg);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.45;
  text-decoration: none;
  flex: 1;
  transition: opacity 0.15s;
}

.press-list li::after {
  content: '→';
  font-size: 1rem;
  opacity: 0.3;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.15s;
}

.press-list li:hover a {
  opacity: 0.7;
}

.press-list li:hover::after {
  opacity: 1;
  transform: translateX(3px);
}

/* Awards list */
.awards-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.awards-year h4 {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.6rem;
}

.awards-year ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.awards-year ul li {
  font-size: 0.875rem;
  line-height: 1.55;
  opacity: 0.75;
}

@media (max-width: 768px) {
  .about-intro {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-photo {
    order: -1;
    position: static;
  }

  .about-photo img {
    aspect-ratio: 4 / 3;
    object-position: center top;
  }

  .about-columns {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}

/* ── Page Intro ── */
.page-intro {
  padding: 0 var(--page-padding) 3rem var(--page-padding);
  max-width: 900px;
  margin: 0 auto;
  margin-top: 4rem;
  text-align: center;
}

.page-intro p {
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  font-weight: 500;
  line-height: 1.4;
  opacity: 0.9;
}

/* ── 3D Model Canvas (Weekends) ── */
.model-canvas {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 2.5rem 1rem;
  padding: var(--page-padding);
  padding-top: 0;
  align-items: start;
  grid-auto-flow: row;
}

.model-card {
  position: relative;
  text-decoration: none;
  color: var(--fg);
  display: grid;
  gap: 0.7rem;
}

.model-card model-viewer {
  width: 100%;
  border-radius: 18px;
  background-color: transparent;
  --poster-color: transparent;
  --progress-bar-color: transparent;
  --progress-bar-height: 0px;
  transition: filter 0.25s ease, transform 0.35s ease;
}

.static-image-frame {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
}

.static-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: filter 0.25s ease, transform 0.35s ease;
}

.model-card:hover .static-image-frame img {
  filter: blur(6px);
  transform: scale(1.02);
}

@media (max-width: 1100px) {
  .model-canvas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 0.9rem;
  }

  .model-canvas .model-card {
    grid-column: span 1 !important;
  }
}

@media (max-width: 768px) {
  .model-canvas {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .model-canvas .model-card {
    grid-column: span 1 !important;
  }
}

.model-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  pointer-events: none;
}

.model-card:hover .model-overlay {
  opacity: 1;
}

.model-card:hover model-viewer {
  filter: blur(6px);
  transform: scale(1.02);
}


.model-card .model-label {
  color: var(--fg);
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
  padding: 0 0.1rem;
}

/* ── Animations ── */
@keyframes pageFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes cardUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body {
  animation: pageFade 0.2s ease both;
}

.grid .card,
.model-canvas .model-card {
  animation: cardUp 0.5s ease both;
  animation-delay: calc(0.2s + var(--i, 0) * 0.07s);
}

/* ── Footer ── */
.site-footer {
  display: flex;
  gap: 0.75rem;
  padding: var(--page-padding);
  padding-top: 3rem;
  padding-bottom: 3rem;
  justify-content: center;
}

.footer-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg);
  text-decoration: none;
  padding: 0.4rem;
  transition: opacity 0.2s ease;
}

.footer-btn:hover {
  opacity: 0.5;
}

/* ── About contact ── */
.about-contact {
  display: flex;
  gap: 0.75rem;
  margin-top: 2rem;
}

@media (max-width: 768px) {
  .tease {
    display: none;
  }

  .card .overlay,
  .model-card .model-overlay {
    display: none;
  }
}

/* ── Touch devices: tease always visible ── */
@media (hover: none) {
  .card .overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.5);
  }

  .card figure img,
  .card figure video {
    filter: none;
  }

  .model-card .model-overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.5);
  }

  .model-card model-viewer,
  .model-card .static-image-frame img {
    filter: none;
  }
}

/* ── Focus states ── */
.site-nav a:focus-visible {
  outline: none;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.card:focus-visible figure {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.model-card:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.model-credits {
  padding: 2rem var(--page-padding) 1.5rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.3);
  line-height: 1.6;
}

.model-credits a {
  color: inherit;
  text-underline-offset: 2px;
}

.footer-btn:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 4px;
  opacity: 1;
}

.project-description a:focus-visible {
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.7;
}

.project-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 1rem;
}

.project-nav-link {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
  opacity: 0.4;
  transition: opacity 0.15s;
}

.project-nav-link:hover {
  opacity: 1;
}

.project-nav-empty {
  pointer-events: none;
}

@media (max-width: 768px) {
  .project-nav {
    padding: 1.5rem 0 2rem;
  }
}

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