/* ============================================================
   SMAGALSKI.COM — main.css
   ============================================================ */

/* --- Variables --- */
:root {
  --bg:        #0a0a0a;
  --bg-card:   #111111;
  --fg:        #ffffff;
  --muted:     #666666;
  --accent:    #c9b99a;
  --border:    #1e1e1e;
  --font-head: 'Anton', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --nav-h:     64px;
}

/* --- Page slide transitions --- */
@keyframes slide-in-right  { from { transform: translateX(100%);  } to { transform: translateX(0); } }
@keyframes slide-in-left   { from { transform: translateX(-100%); } to { transform: translateX(0); } }
@keyframes slide-out-left  { from { transform: translateX(0); } to { transform: translateX(-100%);  } }
@keyframes slide-out-right { from { transform: translateX(0); } to { transform: translateX(100%);   } }

body.page-enter-right { animation: slide-in-right  0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; }
body.page-enter-left  { animation: slide-in-left   0.38s cubic-bezier(0.25, 0.46, 0.45, 0.94) both; }
body.page-exit-left   { animation: slide-out-left  0.32s cubic-bezier(0.55, 0, 1, 0.45)       both; }
body.page-exit-right  { animation: slide-out-right 0.32s cubic-bezier(0.55, 0, 1, 0.45)       both; }

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: auto; overscroll-behavior-y: none; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }

/* ============================================================
   NAV
   ============================================================ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  background: transparent;
  transition: background 0.3s ease, border-color 0.3s ease;
  border-bottom: 1px solid transparent;
}
nav.scrolled {
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--border);
}
.nav-logo {
  font-family: var(--font-head);
  font-size: 17px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}
.nav-links a {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--fg); }

/* Homepage: nav hidden until scrolled 40 % through hero */
body.is-home nav {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, background 0.3s ease, border-color 0.3s ease;
}
/* Reveal when JS adds .nav-visible, or when mobile menu is open */
body.is-home nav.nav-visible,
body.is-home nav.nav-open {
  opacity: 1;
  pointer-events: auto;
}

/* --- Hamburger button (injected by JS) --- */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 110;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}
/* Animate to X when open */
nav.nav-open .nav-hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
nav.nav-open .nav-hamburger span:nth-child(2) { opacity: 0; transform: scaleX(0); }
nav.nav-open .nav-hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO (homepage)
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  /* Strong in center for text legibility, light on sides so images read through */
  background: radial-gradient(ellipse 55% 65% at 50% 50%, rgba(10,10,10,0.55) 0%, rgba(10,10,10,0.12) 58%, rgba(10,10,10,0.28) 100%);
  pointer-events: none;
  z-index: 1;
}
.hero-name {
  font-family: var(--font-head);
  font-size: clamp(52px, 11vw, 164px);
  line-height: 0.88;
  letter-spacing: -0.01em;
  color: var(--fg);
  position: relative;
  z-index: 3;
}
.hero-tagline {
  margin-top: 28px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  z-index: 3;
}

/* ============================================================
   HERO TILES
   ============================================================ */
.hero-tiles {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;
  gap: 3px;
  z-index: 0;
  overflow: hidden;
}

.hero-tile {
  overflow: hidden;
  will-change: transform, opacity;
}

.hero-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.42) saturate(0.55);
}

@media (max-width: 768px) {
  .hero-tiles { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   HERO CTA BUTTONS
   ============================================================ */
.hero-cta {
  display: flex;
  gap: 12px;
  margin-top: 40px;
  position: relative;
  z-index: 3;
  flex-wrap: wrap;
  justify-content: center;
}
.hero-cta-btn {
  font-family: var(--font-head);
  font-size: 15px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg);
  border: 1px solid rgba(232, 224, 208, 0.45);
  padding: 14px 36px;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.hero-cta-btn:hover {
  border-color: var(--fg);
  background: rgba(0, 0, 0, 0.55);
}

/* Scroll hint chevron */
.hero-scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: rgba(232, 224, 208, 0.5);
  display: flex;
  animation: chevron-bounce 2s ease-in-out infinite;
}
@keyframes chevron-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}
/* Hidden on non-home (JS shows it only via .hero-scroll-hint display:flex) */
/* Hides once user has scrolled */
.hero-scroll-hint.hidden { opacity: 0; transition: opacity 0.4s ease; }

/* ============================================================
   SECTION
   ============================================================ */
.section {
  padding: 72px 40px 80px;
  max-width: 1440px;
  margin: 0 auto;
}
.section-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 36px;
}

/* ============================================================
   PORTFOLIO GRID
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
/* Quantity queries: fewer cards → fewer columns */
.grid:not(:has(.card:nth-child(5))) {
  grid-template-columns: repeat(2, 1fr);
}
.grid:has(.card:nth-child(13)) {
  grid-template-columns: repeat(4, 1fr);
}
.card {
  background: var(--bg-card);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.card-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease, filter 0.35s ease;
  filter: brightness(0.82) saturate(0.85);
}
.card:hover .card-thumb img {
  transform: scale(1.05);
  filter: brightness(0.5) saturate(0.7);
}
.card-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card:hover .card-overlay { opacity: 1; }
.play-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid rgba(232, 224, 208, 0.75);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.card:hover .play-btn {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.55);
  border-color: rgba(232, 224, 208, 1);
}
.play-btn svg {
  width: 18px;
  height: 18px;
  fill: var(--fg);
  margin-left: 4px;
}
.card-info {
  padding: 18px 20px 22px;
}
.card-title {
  font-family: var(--font-head);
  font-size: 16px;
  letter-spacing: 0.03em;
  margin-bottom: 5px;
}
.card-meta {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Coming Soon card variant */
.card--coming-soon { cursor: default; }
.card-overlay--soon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 14px 16px;
  opacity: 1;
}
.coming-soon-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--accent);
  padding: 5px 10px;
}

/* ============================================================
   PAGE HERO (inner pages)
   ============================================================ */
.page-hero {
  padding: calc(var(--nav-h) + 72px) 40px 52px;
  border-bottom: 1px solid var(--border);
}
.page-hero-inner {
  max-width: 1440px;
  margin: 0 auto;
}
.page-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(44px, 7vw, 96px);
  letter-spacing: -0.01em;
  line-height: 0.9;
}
.page-hero p {
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.05em;
  max-width: 560px;
}

/* ============================================================
   ABOUT SECTION (homepage)
   ============================================================ */
.about-section {
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.about-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 72px 40px 80px;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-photo {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  display: block;
  filter: brightness(0.88) saturate(0.78);
  position: sticky;
  top: calc(var(--nav-h) + 24px);
}
.about-content {
  display: flex;
  flex-direction: column;
  gap: 36px;
}
.about-strip {
  width: 100%;
  display: block;
  object-fit: cover;
  flex-shrink: 0;
}
/* Timeline: show full image, no crop */
.about-strip:not(.about-strip--directing) {
  height: auto;
  object-fit: contain;
  filter: brightness(0.85) saturate(0.7);
}
/* Directing photo: landscape */
.about-strip--directing {
  aspect-ratio: 16 / 7;
  filter: brightness(0.88) saturate(0.78);
}
.about-body h2 {
  font-family: var(--font-head);
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.1;
  margin-bottom: 24px;
}
.about-body p {
  font-size: 16px;
  line-height: 1.75;
  color: #ffffff;
  margin-bottom: 20px;
}
.about-sidebar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}
.about-sidebar .label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
  margin-top: 24px;
}
.about-sidebar .label:first-child { margin-top: 0; }
.about-sidebar p {
  font-size: 14px;
  color: var(--fg);
  margin-bottom: 0;
}
.about-sidebar a:hover { color: var(--accent); transition: color 0.2s; }

/* ============================================================
   ABOUT — entrance animation
   ============================================================ */
/* Initial (hidden) state for animated children */
.about-section > .about-strip {
  opacity: 0;
  transition: opacity 0.9s ease;
}
.about-section.in-view > .about-strip {
  opacity: 1;
}
.about-section .about-inner > .about-photo:first-child {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.85s ease, transform 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.about-section .about-inner > .about-content {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s ease 0.12s, transform 0.75s ease 0.12s;
}
.about-section .about-inner > .about-photo:last-child {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.85s ease 0.22s, transform 0.85s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.22s;
}
/* In-view state — JS adds .in-view to .about-section */
.about-section.in-view .about-inner > .about-photo:first-child,
.about-section.in-view .about-inner > .about-content,
.about-section.in-view .about-inner > .about-photo:last-child {
  opacity: 1;
  transform: none;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  border-top: 1px solid var(--border);
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
footer a:hover { color: var(--fg); transition: color 0.2s; }

/* ============================================================
   YOUTUBE LIGHTBOX
   ============================================================ */
.yt-lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.90);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.yt-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.yt-lightbox-inner {
  position: relative;
  width: min(92vw, 1100px);
  aspect-ratio: 16 / 9;
}
.yt-lightbox-inner iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.yt-lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.2s;
  padding: 4px 8px;
}
.yt-lightbox-close:hover { opacity: 1; }

/* ============================================================
   404
   ============================================================ */
.not-found {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
}
.not-found h1 {
  font-family: var(--font-head);
  font-size: clamp(80px, 18vw, 220px);
  line-height: 1;
  color: var(--border);
}
.not-found p {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.not-found a {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: border-color 0.2s;
}
.not-found a:hover { border-color: var(--fg); }

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

/* --- Tablet (≤ 1024px) --- */
@media (max-width: 1024px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  /* Keep 3-col portrait layout but tighten up */
  .about-inner { grid-template-columns: 1fr 2fr 1fr; gap: 24px; }
  .about-photo { position: static; aspect-ratio: 2 / 3; }
  .about-sidebar { grid-template-columns: repeat(3, 1fr); }
}
/* --- Mobile (≤ 768px): collapse to single column, hide second portrait --- */
@media (max-width: 768px) {
  .about-inner { grid-template-columns: 1fr; gap: 20px; padding: 28px 20px 32px; }
  .about-photo { aspect-ratio: 3 / 2; max-height: 220px; object-position: top center; }
  .about-photo:last-of-type { display: none; }
}

/* --- Mobile nav + layout (≤ 768px) --- */
@media (max-width: 768px) {
  nav { padding: 0 20px; }

  /* Show hamburger, hide inline links */
  .nav-hamburger { display: flex; }
  /* nav expands to full-screen when open (backdrop-filter on nav creates a new
     containing block, so fixed children are constrained to nav's height — we
     expand nav itself and use position:absolute for the link overlay instead) */
  nav.nav-open {
    height: 100dvh;
    align-items: flex-start;
  }
  /* Keep logo + hamburger pinned to the top bar area */
  nav.nav-open .nav-logo,
  nav.nav-open .nav-hamburger {
    position: relative;
    z-index: 110;
    margin-top: calc((var(--nav-h) - 40px) / 2);
  }
  .nav-links {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    list-style: none;
    z-index: 105;
  }
  nav.nav-open .nav-links { display: flex; }
  .nav-links li { width: 100%; text-align: center; }
  .nav-links a {
    display: block;
    padding: 20px 24px;
    font-size: 18px;
    letter-spacing: 0.14em;
    color: var(--fg);
    border-bottom: 1px solid var(--border);
  }
  .nav-links li:first-child a { border-top: 1px solid var(--border); }

  /* Hero tiles: 2-col on mobile */
  .hero-tiles { grid-template-columns: repeat(2, 1fr); }

  /* Hero text + CTA */
  .hero-name {
    font-size: clamp(44px, 13vw, 100px);
    line-height: 0.9;
  }
  .hero-tagline {
    font-size: 10px;
    letter-spacing: 0.18em;
    white-space: nowrap;
    margin-top: 20px;
  }
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 0 32px;
    width: 100%;
    max-width: 340px;
    margin-top: 28px;
  }
  .hero-cta-btn { text-align: center; padding: 16px 24px; font-size: 13px; }

  /* Scroll chevron */
  .hero-scroll-hint { display: flex; }

  /* Sections */
  .section { padding: 48px 20px 56px; }
  .page-hero { padding: calc(var(--nav-h) + 40px) 20px 36px; }

  /* About */
  .about-sidebar { grid-template-columns: 1fr 1fr; }

  /* Footer */
  footer { padding: 24px 20px; flex-direction: column; gap: 10px; text-align: center; }
}

/* --- Small mobile (≤ 480px) --- */
@media (max-width: 480px) {
  /* Hero */
  .hero-name { font-size: clamp(36px, 12.5vw, 44px); }
  .hero-cta { padding: 0 24px; max-width: 100%; }

  /* Cards: single column */
  .grid { grid-template-columns: 1fr; }
  .card-thumb { aspect-ratio: 16 / 9; }

  /* Page hero */
  .page-hero { padding: calc(var(--nav-h) + 28px) 20px 28px; }
  .page-hero h1 { font-size: clamp(38px, 12vw, 60px); }

  /* About */
  .about-body h2 { font-size: clamp(28px, 9vw, 40px); }
  .about-sidebar { grid-template-columns: 1fr 1fr; gap: 0 20px; }

  /* Section */
  .section { padding: 36px 16px 48px; }
}
