/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --blue: #1a3a6b;
  --blue-light: #2a5298;
  --red: #c0392b;
  --red-light: #e74c3c;
  --dark: #1a1a1a;
  --light: #fafafa;
  --grey: #888;
  --grey-light: #e0e0e0;
  --grey-bg: #f5f3f0;
}

body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  color: var(--dark);
  background-color: var(--light);
  line-height: 1.6;
}

/* ===== Header ===== */
.site-header {
  text-align: center;
}

.hero-image {
  display: flex;
  justify-content: center;
  padding: 40px 0 20px;
}

.hero-image img {
  width: 220px;
  height: auto;
  display: block;
}

/* ===== Navigation ===== */
.main-nav {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 24px 0;
  border-bottom: 1.5px solid var(--blue);
}

.nav-link {
  text-decoration: none;
  color: var(--dark);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 0;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--red);
}

/* ===== Nav Dropdown ===== */
.nav-dropdown {
  position: relative;
}

.nav-dropdown > .nav-link::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 6px;
  vertical-align: 2px;
  transition: transform 0.2s;
}

.nav-dropdown:hover > .nav-link::after {
  transform: rotate(-135deg);
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1.5px solid var(--blue);
  border-radius: 8px;
  padding: 0;
  min-width: 200px;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Invisible bridge so mouse can travel from link to menu */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 16px;
}

.nav-dropdown:hover .nav-dropdown-menu {
  display: block;
}

.nav-dropdown.dropdown-closed .nav-dropdown-menu {
  display: none;
}

.nav-dropdown-item {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: none;
  border: none;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--dark);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.nav-dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.nav-dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
}

.nav-dropdown-item:hover {
  background: var(--blue);
  color: #fff;
}

.nav-dropdown-item.active {
  color: var(--red);
}

/* ===== Page Content ===== */
.page-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 24px;
  min-height: 60vh;
}


/* ===== Works Grid ===== */
.works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.work-item {
  text-decoration: none;
  color: var(--dark);
  display: block;
}

.work-thumbnail {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  aspect-ratio: 1920 / 1080;
  background: var(--grey-light);
}

.work-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.work-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 58, 107, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.work-overlay span {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: 2px solid #fff;
  padding: 10px 28px;
  border-radius: 4px;
}

.work-item:hover .work-overlay {
  opacity: 1;
}

.work-item:hover .work-thumbnail img {
  transform: scale(1.05);
}

.work-info {
  padding: 12px 4px;
  text-align: center;
}

.work-title {
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ===== Work Monitor Frame (animation items) ===== */
.work-monitor {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #1a1a1a;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
}

.work-monitor .work-thumbnail {
  border-radius: 0;
}

.work-monitor-label {
  position: absolute;
  bottom: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: 4px;
  transition: opacity 0.3s;
}

.work-item:hover .work-monitor-label {
  opacity: 0;
}

/* Video work items */
.work-item--video {
  cursor: pointer;
}

.work-item--video .work-thumbnail video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.work-item--video:hover .work-thumbnail video {
  transform: scale(1.05);
}

/* Character design image items */
.work-item--image {
  max-width: 260px;
}

.work-item--image .work-thumbnail {
  aspect-ratio: 260 / 340;
}

/* Slideshow container */
.slideshow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.slideshow .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.slideshow .slide.active {
  opacity: 1;
}

/* Turnaround slideshow */
.turnaround-slideshow {
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
}

.turnaround-slideshow .turnaround-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.turnaround-slideshow .turnaround-slide.active {
  display: block;
}

/* Grid switches for character design — smaller items, more columns */
.works-grid.grid-2 {
  grid-template-columns: repeat(auto-fill, minmax(200px, 260px));
  gap: 24px;
  justify-content: center;
}

/* Hide filtered items */
.work-item.hidden {
  display: none;
}

/* ===== Project Detail Page ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--dark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 32px;
  padding: 6px 12px;
  border: 1.5px solid var(--grey-light);
  border-radius: 24px;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.back-link:hover {
  color: var(--blue);
  border-color: var(--blue);
  background: rgba(26, 58, 107, 0.05);
}

.project-detail {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}

.project-video {
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a1a;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
}

.project-video-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #2a2a2a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.project-video-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
  transition: background 0.2s;
}

.project-video:hover .project-video-dot:nth-child(1) { background: #ff5f57; }
.project-video:hover .project-video-dot:nth-child(2) { background: #febc2e; }
.project-video:hover .project-video-dot:nth-child(3) { background: #28c840; }

.project-video video {
  width: 100%;
  height: 400px;
  display: block;
  object-fit: contain;
  background: var(--dark);
}

.project-title-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 32px;
  margin-bottom: 24px;
}

.project-title-row .back-link {
  margin-bottom: 0;
}

.project-title {
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  align-self: flex-start;
}

.project-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 30px;
  font-size: 14px;
  margin-bottom: 32px;
}

.project-meta dt {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--grey);
  align-self: center;
}

.project-meta dd {
  align-self: center;
}


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

  .project-video video {
    height: 220px;
  }
}

/* ===== Character Gallery Grid (detail page) ===== */
.character-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.character-gallery-item {
  border: none;
  padding: 0;
  background: var(--grey-bg);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.character-gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

/* ===== Gallery Overlay (lightbox) ===== */
.gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 60px;
}

.gallery-overlay[hidden] {
  display: none;
}

.gallery-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 58, 107, 0.8);
}

.gallery-viewer {
  position: relative;
  max-width: 900px;
  width: 90vw;
  z-index: 1;
}

.gallery-close {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  transition: opacity 0.2s;
}

.gallery-close:hover {
  opacity: 0.7;
}

.gallery-main {
  position: relative;
}

.gallery-main-image {
  position: relative;
  aspect-ratio: 3 / 2;
  max-height: 65vh;
  max-width: calc(65vh * 3 / 2);
  margin: 0 auto;
  background: var(--dark);
  border-radius: 6px;
  overflow: hidden;
}

.gallery-main-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: translateX(40px) scale(0.97);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.gallery-main-image img.gallery-active {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.gallery-main-image img.gallery-slide-out-left {
  opacity: 0;
  transform: translateX(-40px) scale(0.97);
}

.gallery-main-image img.gallery-slide-in-left {
  transform: translateX(-40px) scale(0.97);
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.gallery-arrow--left {
  left: 12px;
}

.gallery-arrow--right {
  right: 12px;
}

.gallery-arrow svg {
  stroke: #fff;
}

.gallery-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
  border-color: #fff;
}

.gallery-counter {
  text-align: center;
  color: #fff;
  font-size: 14px;
  margin-top: 12px;
  opacity: 0.7;
}

.gallery-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
  justify-content: center;
}

.gallery-thumb {
  flex-shrink: 0;
  width: 75px;
  height: 75px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.5;
  transition: opacity 0.2s, border-color 0.2s;
  padding: 0;
  background: none;
}

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

.gallery-thumb.gallery-thumb-active {
  opacity: 1;
  border-color: #fff;
}

.gallery-thumb:hover {
  opacity: 0.8;
}

@media (max-width: 600px) {
  .character-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .gallery-arrow {
    width: 40px;
    height: 40px;
  }

  .gallery-close {
    top: 12px;
    right: 12px;
  }

  .gallery-thumb {
    width: 100px;
    height: 100px;
  }
}

/* ===== Sketchbook Viewer (Works page) ===== */
.sketchbook-viewer {
  max-width: 900px;
  margin: 0 auto;
}

.sketchbook-viewer.hidden {
  display: none;
}

.sketchbook-frame {
  display: flex;
  align-items: center;
}

.sketchbook-image {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 65vh;
  max-width: calc(65vh * 3 / 2);
  margin: 0 auto;
  background: var(--dark);
  border-radius: 6px;
  overflow: hidden;
}

.sketchbook-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: translateX(40px) scale(0.97);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.sketchbook-slide.sketchbook-active {
  opacity: 1;
  transform: translateX(0) scale(1);
}

.sketchbook-slide.slide-out-left {
  opacity: 0;
  transform: translateX(-40px) scale(0.97);
}

.sketchbook-slide.slide-in-left {
  transform: translateX(-40px) scale(0.97);
}

.sketchbook-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.sketchbook-arrow--left {
  left: 12px;
}

.sketchbook-arrow--right {
  right: 12px;
}

.sketchbook-arrow svg {
  stroke: #fff;
}

.sketchbook-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
  border-color: #fff;
}

.sketchbook-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  overflow-x: auto;
  padding: 4px 0;
}

.sketchbook-thumb {
  flex-shrink: 0;
  width: 75px;
  height: 75px;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.5;
  transition: opacity 0.2s, border-color 0.2s;
  padding: 0;
  background: none;
}

.sketchbook-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sketchbook-thumb.sketchbook-thumb-active {
  opacity: 1;
  border-color: var(--blue);
}

.sketchbook-thumb:hover {
  opacity: 0.8;
}

.sketchbook-counter {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--grey);
}

@media (max-width: 600px) {
  .sketchbook-arrow {
    width: 36px;
    height: 36px;
  }
}

/* ===== About Page ===== */
.about-page {
  position: relative;
  min-height: 60vh;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
}

.lanyard-bg {
  position: absolute;
  top: -10vh;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: calc(100% + 10vh);
  border: none;
  z-index: 0;
  pointer-events: auto;
}

.about-section {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  width: 100%;
  margin: 0 auto;
  pointer-events: none;
}

.about-spacer {
  flex-shrink: 0;
  width: 52%;
}

.about-text {
  max-width: 380px;
  text-align: center;
  font-size: 15px;
  line-height: 1.8;
  pointer-events: auto;
}

.about-text p {
  margin-bottom: 20px;
}

.about-text strong {
  font-weight: 700;
}

.about-cta {
  display: inline-block;
  margin-top: 8px;
  padding: 12px 36px;
  border: 1.5px solid var(--blue);
  border-radius: 4px;
  text-decoration: none;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s;
}

.about-cta:hover {
  background: var(--blue);
  color: #fff;
}

@media (max-width: 600px) {
  .about-page {
    display: flex;
    flex-direction: column;
    padding: 0 0 48px 0;
  }

  .lanyard-bg {
    position: relative;
    width: 100%;
    height: 85vh;
    margin-top: -5vh;
    touch-action: pan-y;
  }

  .about-page {
    overflow: hidden;
  }

  .about-section {
    flex-direction: column;
    align-items: center;
  }

  .about-spacer {
    display: none;
  }

  .about-text {
    margin-top: -15vh;
  }
}

/* ===== Showreel (Home) ===== */
.showreel-frame {
  max-width: 960px;
  aspect-ratio: 1920 / 1080;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a1a;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.06);
}

.showreel-titlebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: #2a2a2a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.showreel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #555;
  transition: background 0.2s;
}

.showreel-frame:hover .showreel-dot:nth-child(1) { background: #ff5f57; }
.showreel-frame:hover .showreel-dot:nth-child(2) { background: #febc2e; }
.showreel-frame:hover .showreel-dot:nth-child(3) { background: #28c840; }

.showreel-titlebar-text {
  margin-left: auto;
  margin-right: auto;
  padding-right: 36px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 2px;
  color: #666;
  text-transform: uppercase;
}

.showreel {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
}

.showreel video {
  width: 100%;
  display: block;
}

/* ===== Footer ===== */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 24px;
  font-size: 13px;
  color: var(--grey);
  border-top: 1.5px solid var(--blue);
}

.social-links {
  display: flex;
  gap: 16px;
}

.social-links a {
  color: var(--grey);
  transition: color 0.2s;
}

.social-links a:hover {
  color: var(--red);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .main-nav {
    gap: 24px;
  }

  .nav-link {
    font-size: 12px;
  }

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

  /* Mobile dropdown: toggle via class instead of hover */
  .nav-dropdown:hover .nav-dropdown-menu {
    display: none;
  }

  .nav-dropdown:hover > .nav-link::after {
    transform: rotate(45deg);
  }

  .nav-dropdown.dropdown-open .nav-dropdown-menu {
    display: block;
  }

  .nav-dropdown.dropdown-open > .nav-link::after {
    transform: rotate(-135deg);
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
