/* ============================================
   JONAS KOROSCHETZ – PORTFOLIO
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap');

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

:root {
  --black: #000000;
  --white: #ffffff;
  --gray-light: #f0f0f0;
  --gray-mid: #888888;
  --gray-dark: #333333;
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-xs:   11px;
  --font-sm:   12px;
  --font-base: 14px;
  --font-md:   16px;
  --font-lg:   20px;
  --font-xl:   28px;
  --font-2xl:  42px;
  --header-h:  52px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: var(--font-base);
  background: var(--white);
  color: var(--black);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; padding-top: var(--header-h); }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================
   HEADER
   ============================================ */

.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--black);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.header__left {
  display: flex;
  align-items: baseline;
  gap: 0;
  min-width: 0;
}

.header__name {
  font-size: var(--font-base);
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.header__name:hover { text-decoration: none; }

/* Disciplines */
.header__disc-wrap {
  display: flex;
  align-items: baseline;
  gap: 0;
  white-space: nowrap;
}

.header__disc-link {
  font-size: var(--font-sm);
  font-weight: 400;
  color: var(--gray-mid);
  letter-spacing: 0.04em;
  transition: color 0.15s;
}
.header__disc-link:hover {
  color: var(--black);
  text-decoration: none;
}
.header__disc-link--active {
  color: var(--black);
  font-weight: 700;
}
.header__disc-link--desktop { display: inline; }

.header__disc-sep {
  font-size: var(--font-sm);
  color: var(--gray-mid);
}
.header__disc-sep--desktop { display: inline; }

/* Desktop Nav */
.header__nav {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-shrink: 0;
}

.header__nav a,
.header__nav-btn {
  font-size: var(--font-sm);
  font-weight: 400;
  letter-spacing: 0.08em;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  color: var(--black);
  padding: 0;
}
.header__nav a:hover,
.header__nav-btn:hover {
  text-decoration: none;
  border-bottom: 1px solid var(--black);
}
.header__nav .nav-active {
  font-weight: 700;
}

/* Burger */
.header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 28px; height: 28px;
  background: none; border: none;
  cursor: pointer; padding: 0;
}
.header__burger span {
  display: block; width: 100%; height: 1.5px;
  background: var(--black);
  transition: transform 0.2s, opacity 0.2s;
}
.header__burger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.header__burger.is-open span:nth-child(2) { opacity: 0; }
.header__burger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ============================================
   MOBILE MENU
   ============================================ */

.mobile-menu {
  display: none;
  position: fixed;
  top: var(--header-h); left: 0; right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--black);
  z-index: 99;
  flex-direction: column;
}
.mobile-menu.is-open { display: flex; }

.mobile-menu__link,
.mobile-menu__link--btn {
  display: block;
  padding: 18px 20px;
  font-size: var(--font-base);
  font-family: var(--font);
  font-weight: 400;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--gray-light);
  background: none; border-left: none; border-right: none; border-top: none;
  text-align: left;
  cursor: pointer;
  color: var(--black);
  width: 100%;
}
.mobile-menu__link:hover,
.mobile-menu__link--btn:hover {
  background: var(--gray-light);
  text-decoration: none;
}

/* ============================================
   ABOUT OVERLAY
   ============================================ */

.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--white);
  overflow-y: auto;
  transform: translateY(-100%);
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}
.about-overlay.is-open {
  transform: translateY(0);
}

.about-overlay__inner {
  min-height: 100vh;
  padding: calc(var(--header-h) + 48px) 40px 60px;
  display: flex;
  flex-direction: column;
}

.about-overlay__close {
  position: fixed;
  top: 16px; right: 20px;
  background: none; border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--gray-mid);
  z-index: 201;
  transition: color 0.15s;
}
.about-overlay__close:hover { color: var(--black); }

.about-overlay__content {
  max-width: 680px;
  width: 100%;
}

.about-overlay__title {
  font-size: var(--font-2xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 32px;
}

.about-overlay__grid {
  display: block;
}

.about-overlay__text p {
  font-size: var(--font-md);
  line-height: 1.75;
  color: var(--gray-dark);
  margin-bottom: 20px;
}
.about-overlay__text p:last-child { margin-bottom: 0; }

.about-overlay__details { display: none; }

.detail-label {
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gray-mid);
}
.detail-value {
  font-size: var(--font-sm);
  line-height: 1.5;
}
.detail-value a:hover { text-decoration: underline; }

/* ============================================
   MAIN / SECTIONS
   ============================================ */


.section-title {
  font-size: var(--font-xl);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--black);
}

/* ============================================
   WORKS / FILMS GRID
   ============================================ */

.works {
  padding: 52px 40px 80px;
}

.works__title {
  font-size: var(--font-2xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 40px;
  line-height: 1;
}

/* Desktop 4 columns on selected works, 5 on films page */
.works__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 24px;
}

/* Films page gets 5 columns, compact to fit 3 rows without scrolling */
.stills-section ~ * { /* unused, see below */ }
.films-page .works__grid {
  grid-template-columns: repeat(5, 1fr);
}
.films-page .works {
  padding: 24px 40px 24px;
}
.films-page .works__title {
  margin-bottom: 16px;
}
.films-page .works__grid {
  gap: 16px 16px;
}
.films-page .work-item__thumb {
  aspect-ratio: 16 / 9;
}
.films-page .work-item__name {
  font-size: 11px;
}
.films-page .work-item__meta {
  font-size: 10px;
}
.films-page .work-item__info {
  padding: 4px 0 0;
}

/* Work Item */
.work-item { display: flex; flex-direction: column; }

.work-item__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--gray-light);
  overflow: hidden;
  cursor: pointer;
}

.work-item__img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.work-item__img--placeholder {
  background: linear-gradient(135deg, #d0d0d0 0%, #a8a8a8 50%, #c0c0c0 100%);
}
.work-item__thumb:hover .work-item__img { transform: scale(1.03); }

.work-item__play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: none; border: none;
  cursor: pointer;
  width: 44px; height: 44px; padding: 0;
  opacity: 0.9;
  transition: opacity 0.2s, transform 0.2s;
}
.work-item__thumb:hover .work-item__play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.08);
}

.work-item__duration {
  position: absolute;
  bottom: 6px; right: 8px;
  font-size: var(--font-xs);
  color: var(--white);
  letter-spacing: 0.04em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.work-item__info { padding: 10px 0 0; }

.work-item__name {
  font-size: var(--font-sm);
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.3;
  margin-bottom: 2px;
}
.work-item__meta {
  font-size: var(--font-xs);
  color: var(--gray-mid);
  letter-spacing: 0.02em;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 48px 0 0;
  font-size: var(--font-sm);
  letter-spacing: 0.06em;
}
.pagination__sep { color: var(--gray-mid); }
.pagination__next {
  background: none; border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: var(--font-sm);
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pagination__next:hover { color: var(--gray-dark); }

/* ============================================
   STILLS GRID
   ============================================ */

.stills__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px 24px;
}

.still-item { display: flex; flex-direction: column; cursor: pointer; }

.still-item__img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
  overflow: hidden;
}
.still-item__img--placeholder {
  background: linear-gradient(135deg, #d0d0d0 0%, #a8a8a8 50%, #c0c0c0 100%);
}
.still-item:hover .still-item__img { transform: scale(1.03); }

.still-item__caption {
  padding: 8px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.still-item__title {
  font-size: var(--font-sm);
  font-weight: 700;
  letter-spacing: 0.03em;
}
.still-item__meta {
  font-size: var(--font-xs);
  color: var(--gray-mid);
}

/* Stills Lightbox */
.stills-lightbox {
  display: none;
  position: fixed; inset: 0;
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.stills-lightbox.is-open { display: flex; }

.stills-lightbox__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.15);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.stills-lightbox__content {
  position: relative; z-index: 1;
  width: 92vw;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.stills-lightbox__close {
  position: fixed; top: 20px; right: 24px;
  width: 36px; height: 36px;
  background: none; border: none;
  cursor: pointer; padding: 4px;
  opacity: 0.8; transition: opacity 0.2s;
}
.stills-lightbox__close:hover { opacity: 1; }

.stills-lightbox__img-wrap {
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stills-lightbox__placeholder {
  width: 100%;
  aspect-ratio: 3 / 2;
  max-height: 80vh;
  object-fit: contain;
}

.stills-lightbox__meta {
  display: flex;
  gap: 14px;
  color: var(--white);
  font-size: var(--font-sm);
  letter-spacing: 0.06em;
}

/* ============================================
   VIMEO LIGHTBOX
   ============================================ */

.vimeo-lightbox {
  display: none;
  position: fixed; inset: 0;
  z-index: 300;
  align-items: center;
  justify-content: center;
}
.vimeo-lightbox.is-open { display: flex; }

.vimeo-lightbox__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.vimeo-lightbox__content {
  position: relative; z-index: 1;
  width: 92vw; max-width: 1300px;
  display: flex; flex-direction: column;
  align-items: center; gap: 20px;
}

.vimeo-lightbox__close {
  position: fixed; top: 20px; right: 24px;
  width: 36px; height: 36px;
  background: none; border: none;
  cursor: pointer; padding: 4px;
  opacity: 0.8; transition: opacity 0.2s;
}
.vimeo-lightbox__close:hover { opacity: 1; }

.vimeo-lightbox__player { width: 100%; }

.vimeo-lightbox__iframe-wrap {
  position: relative; width: 100%;
  padding-bottom: 56.25%;
  background: #000;
}
.vimeo-lightbox__iframe-wrap iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: none; display: block;
}

.vimeo-lightbox__meta {
  display: flex; align-items: center;
  gap: 14px; flex-wrap: wrap;
  justify-content: center;
}
.vimeo-lightbox__title {
  font-size: var(--font-sm);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--white);
  text-transform: uppercase;
}
.vimeo-lightbox__sep { color: rgba(255,255,255,0.4); font-size: var(--font-sm); }
.vimeo-lightbox__director,
.vimeo-lightbox__role {
  font-size: var(--font-sm);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
}

/* ============================================
   CONTACT
   ============================================ */

.contact {
  padding: 60px 20px;
  border-top: 1px solid var(--black);
}

/* Contact as standalone page */
.contact--page {
  min-height: calc(100vh - var(--header-h) - 61px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-top: none;
  padding: 80px 20px;
}

/* Contact card (new design) */
.contact-page {
  min-height: calc(100vh - var(--header-h) - 53px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.contact-card {
  width: 420px;
  max-width: 100%;
  padding: 60px 48px 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}

.contact-card__name {
  font-size: var(--font-xl);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: center;
  line-height: 1.1;
}

.contact-card__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.contact-card__links a {
  font-size: var(--font-base);
  color: var(--black);
  letter-spacing: 0.01em;
}

.contact-card__links a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .contact-card {
    width: 100%;
    padding: 48px 32px 40px;
  }
  .contact-card__name {
    font-size: var(--font-lg);
  }
}
.contact__inner { max-width: 1200px; }
.contact__content { display: flex; flex-direction: column; gap: 24px; }

.contact__email {
  font-size: var(--font-xl);
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: opacity 0.2s;
}
.contact__email:hover { opacity: 0.6; text-decoration: none; }

.contact__links { display: flex; gap: 28px; }
.contact__links a {
  font-size: var(--font-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--black);
  padding-bottom: 1px;
}
.contact__links a:hover { text-decoration: none; opacity: 0.6; }

/* ============================================
   FOOTER
   ============================================ */

.footer {
  padding: 12px 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.footer__copy { font-size: var(--font-xs); color: var(--gray-mid); letter-spacing: 0.05em; }
.footer__links { display: flex; gap: 20px; }
.footer__links a { font-size: var(--font-xs); letter-spacing: 0.05em; color: var(--gray-mid); }
.footer__links a:hover { color: var(--black); text-decoration: none; }

/* ============================================
   MODALS
   ============================================ */

.modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 400;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.is-open { display: flex; }
.modal__box {
  background: var(--white);
  padding: 40px;
  max-width: 500px; width: 100%;
  position: relative;
}
.modal__box h3 {
  font-size: var(--font-md);
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}
.modal__box p {
  font-size: var(--font-sm);
  line-height: 1.7;
  color: var(--gray-dark);
  margin-bottom: 16px;
}
.modal__box p:last-child { margin-bottom: 0; }
.modal__close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none;
  cursor: pointer; font-size: var(--font-md);
  line-height: 1; color: var(--gray-mid);
}
.modal__close:hover { color: var(--black); }

/* ============================================
   RESPONSIVE – TABLET (≤ 900px)
   ============================================ */

@media (max-width: 900px) {
  .works__grid { grid-template-columns: repeat(3, 1fr); gap: 28px 20px; }
  .stills__grid { grid-template-columns: repeat(3, 1fr); gap: 28px 20px; }
  .works { padding: 40px 28px 60px; }

  .about-overlay__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

}

/* ============================================
   RESPONSIVE – MOBILE (≤ 600px)
   ============================================ */

@media (max-width: 600px) {
  :root {
    --font-2xl: 28px;
    --font-xl: 22px;
  }

  .header__nav { display: none; }
  .header__burger { display: flex; }

  .works__grid { grid-template-columns: repeat(2, 1fr); }
  .stills__grid { grid-template-columns: repeat(2, 1fr); }

  .works { padding: 28px 16px 60px; }
  .works__title { font-size: var(--font-2xl); margin-bottom: 24px; }
  .works__grid { gap: 20px 12px; }
  .stills__grid { gap: 20px 12px; }

  .work-item__play { width: 36px; height: 36px; }

  .about-overlay__grid { grid-template-columns: 1fr; gap: 32px; }
  .about-overlay__inner { padding: calc(var(--header-h) + 24px) 12px 40px; }

  .contact { padding: 40px 12px; }
  .contact__email { font-size: var(--font-lg); }

  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px; padding: 12px 16px 16px;
  }

  .vimeo-lightbox__content { width: 100vw; gap: 14px; }
  .vimeo-lightbox__meta { gap: 8px; padding: 0 12px; }

  .stills-lightbox__content { width: 100vw; }

  .modal__box { padding: 24px 20px; }
}
