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

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

html {
  scroll-behavior: smooth;
}

body {
  background: rgb(0, 0, 0);
  color: rgb(244, 245, 243);
  font-family: 'Lato', sans-serif;
  font-weight: 400;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: rgb(244, 245, 243);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #ff4937;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========== HEADER ========== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 60px;
  position: relative;
}

.header__name {
  font-size: 18px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 40px;
}

.header__nav a {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.03em;
}

.header__nav .instagram-link {
  display: flex;
  align-items: center;
}

.header__nav .instagram-link svg {
  width: 20px;
  height: 20px;
  fill: rgb(244, 245, 243);
  transition: fill 0.3s ease;
}

.header__nav .instagram-link:hover svg {
  fill: #ff4937;
}

.header__mobile-right {
  display: none;
}

/* ========== MOBILE MENU ========== */
.burger-menu {
  display: none;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  z-index: 1001;
  padding: 10px;
}

.burger-menu span {
  display: block;
  width: 28px;
  height: 2px;
  background: rgb(255, 255, 255);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.burger-menu.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.burger-menu.active span:nth-child(2) {
  opacity: 0;
}
.burger-menu.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(0, 0, 0);
  z-index: 1000;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 30px;
}

.mobile-overlay.active {
  display: flex;
}

.mobile-overlay a {
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========== PORTFOLIO / HOME ========== */
.section-title {
  text-align: left;
  font-size: 96px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin: 60px 0 20px;
  padding: 0 40px;
}

.section-subtitle {
  text-align: left;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: normal;
  margin-bottom: 40px;
  padding: 0 40px;
}

/* ========== PROJECT GRID ========== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 40px;
}

.project-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  cursor: pointer;
  display: block;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, filter 0.5s ease;
}

.project-card:hover img {
  transform: scale(1.05);
  filter: brightness(0.55);
}

.project-card__overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 24px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0) 100%);
  opacity: 0.5;
  transition: opacity 0.4s ease;
  display: flex;
  align-items: flex-end;
}

.project-card:hover .project-card__overlay {
  opacity: 1;
}

.project-card__title {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgb(244, 245, 243);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* ========== PROJECT PAGE ========== */
.project-header {
  text-align: center;
  padding: 60px 60px 20px;
}

.project-header__title {
  font-size: 96px;
  font-weight: 400;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

.project-header__description {
  font-size: 20px;
  font-weight: 300;
  line-height: 1.2;
  max-width: 700px;
  margin: 0 auto 10px;
}

.project-header__icons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 24px;
}

.project-header__icons img {
  width: 28px;
  height: 28px;
  display: block;
}

.project-header__video-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 0.03em;
  color: rgb(244, 245, 243);
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.project-header__video-link:hover {
  color: rgb(244, 245, 243);
  opacity: 1;
}

/* Credit line placed under images, above footer */
.project-credit-footer {
  text-align: center;
  padding: 50px 60px 0;
}

.project-credit-footer__text {
  font-size: 16px;
  font-weight: 300;
  font-style: italic;
  opacity: 0.7;
}

.project-credit-footer__text a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(244, 245, 243, 0.3);
  transition: border-color 0.3s ease, color 0.3s ease;
}

.project-credit-footer__text a:hover {
  color: #ff4937;
  border-bottom-color: #ff4937;
}

.project-images {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 40px;
}

.project-images img {
  width: 100%;
  border-radius: 0;
}

.project-images .image-row {
  display: flex;
  gap: 10px;
}

.project-images .image-row img {
  flex: 1 1 0;
  min-width: 0;
  object-fit: cover;
}

/* Extra breathing room before a row (e.g. Ekologie Kultury logo grid) */
.project-images .image-row--spacious {
  margin-top: 40px;
}

/* Small images rendered at natural size (page-specific logos, not full-width) */
.project-images .project-image--logo {
  width: auto;
  max-width: 180px;
  height: auto;
  margin: 20px auto;
  align-self: center;
}

.project-images .project-image--spacious {
  margin-top: 40px;
  margin-bottom: 40px;
}

.project-images .project-video {
  width: 50%;
  max-width: 720px;
  display: block;
  border-radius: 0;
  margin: 20px auto;
  align-self: center;
}

.project-video-link {
  position: relative;
  display: block;
  width: 50%;
  max-width: 720px;
  margin: 20px auto;
  align-self: center;
  cursor: pointer;
}

.project-video-link .project-video {
  width: 100%;
  margin: 0;
  transition: filter 0.4s ease;
}

.project-video-link__label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 0.05em;
  color: rgb(244, 245, 243);
  opacity: 0;
  transition: opacity 0.4s ease;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

.project-video-link:hover .project-video {
  filter: brightness(0.5);
}

.project-video-link:hover .project-video-link__label {
  opacity: 1;
}

/* ========== ABOUT PAGE ========== */
.about-section {
  padding: 40px 60px;
  max-width: 1000px;
  margin: 0 auto;
}

.about-title {
  font-size: 96px;
  font-weight: 400;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 20px;
}

.about-greeting {
  font-size: 18px;
  font-weight: 300;
  text-align: center;
  margin-bottom: 30px;
}

.about-bio {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto 20px;
  text-align: center;
}

.about-tools {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 40px 0;
}

.about-tools img {
  width: 46px;
  height: 46px;
}

.about-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 60px 0;
}

.about-photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-photos img:first-child {
  aspect-ratio: 0.7056;
}

.about-photos img:last-child {
  aspect-ratio: 0.8803;
}

/* ========== FOOTER ========== */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 80px 40px;
}

.footer__text {
  font-size: 72px;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.footer__home-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
}

.footer__home-link svg {
  width: 20px;
  height: 20px;
  fill: rgb(244, 245, 243);
  transition: fill 0.3s ease;
}

.footer__home-link:hover svg {
  fill: #ff4937;
}

/* ========== BACK LINK ========== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  letter-spacing: 0.03em;
}

.back-link svg {
  width: 16px;
  height: 16px;
  fill: rgb(244, 245, 243);
  transition: fill 0.3s ease;
}

.back-link:hover svg {
  fill: #ff4937;
}

/* ========== RESPONSIVE ========== */

/* Tablet */
@media (max-width: 1439px) {
  .section-title,
  .project-header__title,
  .about-title,
  .about-greeting {
    font-size: 72px;
  }

  .header {
    padding: 30px 40px;
  }

  .project-grid {
    grid-template-columns: repeat(3, 1fr);
    padding: 0 30px;
  }

  .project-images {
    padding: 30px 40px;
  }

  .project-credit-footer {
    padding: 40px 40px 0;
  }

  .about-section {
    padding: 30px 40px;
  }

  .footer {
    padding: 60px 30px;
  }

  .footer__text {
    font-size: 56px;
  }
}

/* Mobile */
@media (max-width: 809px) {
  .header__nav {
    display: none;
  }

  /* On project pages (which have .back-link), hide the name on mobile.
     On the home page (no .back-link), show it normally. */
  .header:has(.back-link) .header__name {
    display: none;
  }

  /* Home page: remove absolute centering so name flows in flex row */
  .header__name {
    position: static !important;
    left: auto !important;
    transform: none !important;
    font-size: 14px;
  }

  .back-link {
    font-size: 14px;
    white-space: nowrap;
  }

  .burger-menu {
    display: flex;
  }

  .header__mobile-right {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .instagram-link--mobile {
    display: flex;
    align-items: center;
  }

  .instagram-link--mobile svg {
    width: 20px;
    height: 20px;
    fill: rgb(244, 245, 243);
    transition: fill 0.3s ease;
  }

  .header {
    padding: 20px 20px;
  }

  .section-title,
  .project-header__title,
  .about-title,
  .about-greeting {
    font-size: 36px;
  }

  .section-subtitle {
    font-size: 16px;
  }

  .project-grid {
    grid-template-columns: 1fr;
    padding: 0 20px;
    gap: 15px;
  }

  .project-card__title {
    font-size: 14px;
  }

  .project-images .project-video {
    width: 100%;
    max-width: none;
  }

  .project-video-link {
    width: 100%;
    max-width: none;
  }

  .project-video-link__label {
    opacity: 0.8;
    font-size: 16px;
  }

  /* Always show overlay on mobile (no hover on touch) */
  .project-card__overlay {
    opacity: 0.7;
  }

  .project-header {
    padding: 40px 20px 20px;
  }

  .project-header__description {
    font-size: 16px;
  }

  .project-images {
    padding: 20px;
    gap: 15px;
  }

  .project-images .image-row {
    flex-direction: column;
  }

  .project-credit-footer {
    padding: 30px 20px 0;
  }

  .project-header__icons img {
    width: 24px;
    height: 24px;
  }

  .project-images .project-image--logo {
    max-width: 140px;
  }

  .about-section {
    padding: 20px;
  }

  .about-bio {
    font-size: 16px;
  }

  .about-photos {
    grid-template-columns: 1fr;
  }

  .about-tools img {
    width: 32px;
    height: 32px;
  }

  .footer {
    padding: 40px 20px;
  }

  .footer__text {
    font-size: 36px;
  }
}
