/* ==========================================================================
   Template 02: Pau Castejón Inspiration (Fullscreen Frame & Counter)
   Karol Mikina DOP / Color
   ========================================================================== */

:root {
  --bg-color: #0d0d0d;
  --bg-matte: #121212;
  --text-main: #f5f5f5;
  --text-muted: #888888;
  --text-dim: #444444;
  --border-subtle: #1c1c1c;

  --font-serif: "Playfair Display", "Cormorant Garamond", "Didot", "Bodoni MT", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ratio-cinemascope: 2.39 / 1;
  --ratio-widescreen: 16 / 9;

  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
  font-size: 16px;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  background-color: var(--bg-color);
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.5;
}

/* Accessibility focus indicator */
a:focus-visible, button:focus-visible {
  outline: 1px solid rgba(255, 255, 255, 0.8);
  outline-offset: 4px;
}

/* ==========================================================================
   Fixed Framing Chrome (Header & HUD)
   ========================================================================== */
.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 28px 48px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  pointer-events: none;
}

.fixed-header * {
  pointer-events: auto;
}

/* Castejón: Serif in name, Sans in menu */
.name-brand {
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.artist-name {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--text-main);
  font-style: italic;
}

.artist-title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-item {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 4px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.nav-item:hover, .nav-item.active {
  color: var(--text-main);
}

/* Bottom HUD: Live Project Counter */
.fixed-bottom-hud {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 24px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.project-counter {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  pointer-events: auto;
}

.project-counter .current {
  color: var(--text-main);
}

.scroll-hint {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ==========================================================================
   Fullscreen Snap Viewport
   ========================================================================== */
.snap-wrapper {
  height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none; /* Hide default scrollbar for pure gallery feel */
}

.snap-wrapper::-webkit-scrollbar {
  display: none;
}

.project-slide {
  height: 100vh;
  width: 100%;
  max-width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 48px;
  position: relative;
  overflow: hidden;
}

.slide-link {
  display: block;
  width: 100%;
  max-width: 1680px;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.cinematic-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ratio-cinemascope);
  background-color: var(--bg-matte);
  overflow: hidden;
}

.cinematic-frame.widescreen {
  aspect-ratio: var(--ratio-widescreen);
  max-width: 1400px;
  margin: 0 auto;
}

.cinematic-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity var(--transition-smooth);
}

.slide-link:hover .cinematic-frame img,
.slide-link:focus-visible .cinematic-frame img {
  opacity: 0.85;
}

/* Discrete Hover Caption in Corner (MARKA // TYTUŁ FILMU) */
.slide-caption {
  position: absolute;
  bottom: 24px;
  left: 28px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-smooth);
  pointer-events: none;
}

.slide-link:hover .slide-caption,
.slide-link:focus-visible .slide-caption {
  opacity: 1;
}

.caption-brand {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-main);
}

.caption-tech {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

/* ==========================================================================
   Project View (project.html)
   ========================================================================== */
.castejon-project-page {
  padding-top: 100px;
}

.project-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 48px 160px;
}

.back-nav {
  margin-bottom: 28px;
}

.back-btn {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.back-btn:hover {
  color: var(--text-main);
}

/* Frameless video */
.cinema-player-box {
  position: relative;
  width: 100%;
  aspect-ratio: var(--ratio-cinemascope);
  background: #000000;
  overflow: hidden;
  margin-bottom: 40px;
}

.cinema-video-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cinema-player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.cinema-player-box:hover .cinema-player-controls,
.cinema-player-box:focus-within .cinema-player-controls {
  opacity: 1;
}

.ctrl-btn {
  background: none;
  border: none;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 8px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* Project Heading */
.castejon-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 56px;
  flex-wrap: wrap;
  gap: 16px;
}

.project-title-serif {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.project-spec-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

/* Contact sheet grid (10 stills) */
.contact-sheet {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  margin-bottom: 96px;
}

.sheet-item {
  position: relative;
  background-color: var(--bg-matte);
  overflow: hidden;
}

.sheet-item.span-12 {
  grid-column: span 12;
  aspect-ratio: var(--ratio-cinemascope);
}

.sheet-item.span-6 {
  grid-column: span 6;
  aspect-ratio: var(--ratio-widescreen);
}

.sheet-item.span-4 {
  grid-column: span 4;
  aspect-ratio: var(--ratio-widescreen);
}

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

/* Credits Table */
.film-credits-block {
  max-width: 1000px;
  padding-top: 48px;
  border-top: 1px solid var(--border-subtle);
}

.credits-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.film-credits-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px 48px;
}

.credit-unit {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.unit-role {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.unit-name {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--text-main);
}

/* Next project link */
.next-project-bar {
  margin-top: 100px;
  padding-top: 36px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
}

.next-link {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color var(--transition-fast);
}

.next-link:hover {
  color: var(--text-main);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
  .fixed-header, .fixed-bottom-hud {
    padding: 20px 28px;
  }
  
  .project-slide {
    padding: 72px 28px;
  }
  
  .project-inner {
    padding: 0 28px 120px;
  }
  
  .film-credits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .fixed-header {
    background-color: rgba(13, 13, 13, 0.95);
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
  }
  
  .nav-menu {
    gap: 16px;
  }
  
  .fixed-bottom-hud {
    padding: 16px 20px;
  }
  
  .project-slide {
    padding: 80px 16px 64px;
  }
  
  .cinematic-frame {
    aspect-ratio: var(--ratio-widescreen);
  }
  
  .slide-caption {
    opacity: 1;
    bottom: 16px;
    left: 16px;
  }
  
  .contact-sheet {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .sheet-item.span-12,
  .sheet-item.span-6,
  .sheet-item.span-4 {
    grid-column: span 1;
    aspect-ratio: var(--ratio-widescreen);
  }
  
  .film-credits-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
