html,
body {
  min-height: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  font-family: "inter", sans-serif;
  transition: background-color 0.3s ease, color 0.3s ease;
}

*,
*::before,
*::after {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

wa-page,
wa-page::part(base),
wa-page::part(body),
wa-page::part(header),
wa-page::part(footer) {
  transition: background-color 0.3s ease, color 0.3s ease;
}

img {
  vertical-align: middle;
}

/* Logo switching */
.logo-light { width: 116px; height: 32px; }
.logo-dark { display: none; width: 116px; height: 32px; }
.wa-dark .logo-light { display: none; }
.wa-dark .logo-dark { display: inline; }

/* Theme toggle button */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  font-size: 1.25rem;
  padding: 0;
  display: flex;
  align-items: center;
}

.theme-toggle wa-icon {
  --secondary-opacity: 0;
  transition: --secondary-opacity 0.8s ease-in-out;
}

.theme-toggle:hover wa-icon {
  --secondary-opacity: 0.4;
}

/* Sun shows in dark mode, moon shows in light mode */
.icon-sun { display: none; }
.icon-moon { display: flex; }
.wa-dark .icon-sun { display: flex; }
.wa-dark .icon-moon { display: none; }

.header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.5rem 1rem 0;
  font-family: "inter", sans-serif;
  font-weight: 400;
  font-size: 14px;
}

header[slot='header'] {
  padding-bottom: 0;
  margin-bottom: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-left a {
  color: inherit;
  text-decoration: none;
  font-weight: 500;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-divider {
  display: inline-block;
  width: 1px;
  height: 1rem;
  background-color: currentColor;
  opacity: 0.4;
}

.header-right a,
.theme-toggle {
  font-size: 1.25rem;
}

.header-right a {
  color: inherit;
  font-size: 1.25rem;
  text-decoration: none;
}

.wa-grid a {
  color: inherit;
  text-decoration: none;
}

.image-card {
  position: relative;
  cursor: pointer;
}

.image-card img {
  transition: filter 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.image-card::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: "inter", sans-serif;
  font-size: 0.9rem;
  font-weight: 400;
  text-align: center;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-card:hover img {
  filter: brightness(0.6);
}

.image-card:hover::after {
  opacity: 1;
}

wa-page {
  margin: auto;
  max-inline-size: 80rem;
}

wa-page *:not([slot='']) {
  padding-left: 0;
  padding-right: 0;
}

main {
  padding-left: 1rem;
  padding-right: 1rem;
}
/* Project Pages */

main.project {
  padding: 2rem 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  margin-bottom: 2rem;
  transition: opacity 0.3s ease;
}

.back-link:hover {
  opacity: 0.7;
}

.back-link wa-icon {
  font-size: 1.25rem;
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  text-decoration: underline;
  margin: 0 0 2rem 0;
}

.project h1 {
  font-family: "inter", sans-serif;
  font-weight: 500;
  font-size: 23px;
}

.project-header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 1rem;
  align-items: start;
}

.header-content {
  display: flex;
  flex-direction: column;
}

.project-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-details p {
  margin: 0;
  font-family: "inter", sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.5;
}

.project-details strong {
  font-weight: 600;
}

.hero-image {
  width: 722px;
  height: 407px;
  overflow: hidden;
  background: black;
}

.hero-image iframe {
  background: black;
  border: none;
}

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

.credits {
  padding: 1.5rem 0;
}

.carousel-wrapper {
  align-self: start;
  margin: 0;
  padding: 0;
  width: 100%;
}

wa-carousel::part(base),
wa-carousel::part(scroll-container) {
  border-radius: 0;
}

wa-carousel {
  --aspect-ratio: 4/5;
  --scroll-hint: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  display: block;
}

wa-carousel-item {
  height: auto;
}

wa-carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 1px solid black;
}

.wa-dark wa-carousel-item img {
  border: none;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.gallery-item {
  width: 100%;
  height: 202px;
  overflow: hidden;
  border-radius: 0.5rem;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

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

/* Mobile footer social links — hidden on desktop */
.mobile-footer {
  display: none;
}

/* Side margins from mobile up until the page is wide enough to self-center */
@media (max-width: 80rem) {
  .header-nav {
    margin-left: 1.5rem;
    margin-right: 1.5rem;
  }

  main {
    margin-left: 1.5rem;
    margin-right: 1.5rem;
  }
}

@media (max-width: 768px) {
  /* Header — 3-column layout: contact | logo (centered) | theme toggle */
  .header-nav {
    padding: 0.6rem 0 0;
    font-size: 14px;
    position: relative;
  }

  .header-left {
    display: contents;
  }

  .header-contact {
    order: -1;
  }

  .header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .logo-light,
  .logo-dark {
    width: 78px;
    height: auto;
  }

  /* Hide social icons from header on mobile */
  .header-social {
    display: none;
  }

  /* Hide divider when socials are gone */
  .header-divider {
    display: none;
  }

  .header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .theme-toggle {
    font-size: 1.2rem;
  }

  /* Mobile footer social links */
  .mobile-footer {
    display: flex;
    justify-content: center;
    padding: 1.5rem 1rem;
  }

  .mobile-footer-social {
    display: flex;
    gap: 1.5rem;
    align-items: center;
  }

  .mobile-footer-social a {
    color: inherit;
    text-decoration: none;
    font-size: 1.25rem;
  }


  /* Homepage grid */
  .wa-grid {
    --min-column-size: 100% !important;
  }

  /* On mobile, always show the project title below the image */
  .image-card {
    display: flex;
    flex-direction: column;
  }

  .image-card::after {
    position: static;
    opacity: 1;
    color: inherit;
    background: none;
    font-size: 0.75rem;
    padding: 0.3rem 0;
    justify-content: center;
    text-align: center;
  }

  .image-card:hover img {
    filter: none;
  }

  /* Project pages — reorder: title → video → details → images */
  .project-header {
    display: flex;
    flex-direction: column;
  }

  .header-content {
    display: contents;
  }

  .project-header h1 {
    order: 1;
  }

  .hero-image,
  .carousel-wrapper {
    order: 2;
  }

  .project-details {
    order: 3;
  }

  .hero-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

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

  h1 {
    font-size: 1.5rem;
  }

  .project h1 {
    font-size: 18px;
    margin-bottom: 0.5rem;
  }

  main.project {
    padding: 1.5rem 1rem;
  }

  .contact-page {
    padding: 1rem;
  }
}
/* Site Footer */

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1rem;
  opacity: 0.4;
  font-family: "inter", sans-serif;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.05em;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.site-footer wa-icon {
  font-size: 10px;
}

/* Contact Page */

.contact-page {
  padding: 2rem 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.contact-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: stretch;
}

.contact-image {
  flex-shrink: 0;
}

.contact-image img {
  width: 370px;
  height: 450px;
  object-fit: cover;
  display: block;
  border-radius: 0.25rem;
}

.contact-content {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact-left {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contact-left h1 {
  margin: 0;
  font-family: "inter", sans-serif;
  font-size: 23px;
  font-weight: 500;
  line-height: 1.2;
}

.contact-bio {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-bio p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

.contact-card {
  padding: 1rem;
  border: 1px solid currentColor;
  border-radius: 0.25rem;
  display: inline-block;
}

.email-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.email-link:hover {
  opacity: 0.7;
}

.email-link wa-icon {
  font-size: 1.25rem;
}

.contact-right {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  align-self: end;
}

.contact-description {
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 420px;
  margin: 0;
  text-align: right;
}

.contact-footer {
  margin-top: auto;
  padding-top: 2rem;
}

.contact-footer wa-divider {
  margin-bottom: 2rem;
}

.social-links {
  display: flex;
  gap: 2rem;
  justify-content: center;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.social-link:hover {
  opacity: 0.7;
}

.social-link wa-icon {
  font-size: 1.5rem;
}

@media (max-width: 1024px) {
  .contact-hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .contact-image img {
    width: 100%;
    height: auto;
    max-width: 370px;
  }

  .contact-right {
    justify-content: flex-start;
  }

  .contact-description {
    text-align: left;
  }

  .contact-left h1 {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .contact-page {
    padding: 1rem;
  }

  .contact-hero {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .contact-content {
    display: contents;
  }

  .contact-left {
    order: 1;
  }

  .contact-image {
    order: 2;
    display: flex;
    justify-content: center;
  }

  .contact-image img {
    width: 100%;
    max-width: 320px;
    height: auto;
  }

  .contact-right {
    order: 3;
  }

  .contact-left h1 {
    font-size: 1.5rem;
  }

  .social-links {
    flex-direction: column;
    gap: 1rem;
  }
}
