/* ============================================
   Alex Kobak — Portfolio
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #0c0c0e;
  --color-bg-elevated: #141418;
  --color-bg-card: #1a1a20;
  --color-text: #eeeef0;
  --color-text-muted: #8a8a96;
  --color-text-subtle: #5a5a66;
  --color-accent: #c8a86e;
  --color-accent-light: #dfc896;
  --color-border: #2a2a32;
  --color-border-light: #3a3a44;
  --font-sans: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'DM Serif Display', Georgia, serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

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

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

/* --- Container --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.5rem 0;
  transition: all 0.4s var(--ease-out);
}

.nav.scrolled {
  background: rgba(12, 12, 14, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--color-accent);
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.3s ease;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width 0.3s var(--ease-out);
}

.nav-links a:hover {
  color: var(--color-text);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--color-text);
}

.nav-links a.active::after {
  width: 100%;
  background: var(--color-accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 24px;
  position: relative;
  z-index: 110;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s var(--ease-out);
  position: absolute;
  left: 0;
}

.nav-toggle span:first-child { top: 4px; }
.nav-toggle span:last-child { bottom: 4px; }

.nav-toggle.active span:first-child {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.nav-toggle.active span:last-child {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-bg);
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
}

.mobile-menu.active {
  opacity: 1;
  pointer-events: all;
}

.mobile-menu a {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: var(--color-text);
  transition: color 0.3s ease;
}

.mobile-menu a:hover {
  color: var(--color-accent);
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 6rem 2rem 4rem;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 80%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(200, 168, 110, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.5;
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-label {
  font-size: 0.8125rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(4rem, 12vw, 10rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin-bottom: 2rem;
  color: var(--color-text);
}

.hero-tagline {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--color-text-muted);
  line-height: 1.7;
  max-width: 540px;
  margin: 0 auto 3rem;
}

.hero-scroll {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-subtle);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: color 0.3s ease;
  border: 1px solid var(--color-border);
  padding: 0.75rem 1.5rem;
  border-radius: 100px;
}

.hero-scroll:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.hero-scroll svg {
  transition: transform 0.3s var(--ease-out);
}

.hero-scroll:hover svg {
  transform: translate(3px, -3px);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* --- Page Header (subpages) --- */
.page-header {
  padding: 10rem 0 3rem;
  border-bottom: 1px solid var(--color-border);
}

.page-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 8vw, 5rem);
  line-height: 1;
  color: var(--color-text);
}

/* --- Sections --- */
.section {
  padding: 8rem 0;
  position: relative;
}

.section-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 4rem;
}

.section-label {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding-top: 0.5rem;
}

.label-text {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--color-text-subtle);
  white-space: nowrap;
}

.label-line {
  display: block;
  height: 1px;
  width: 40px;
  background: var(--color-border);
  margin-top: 0.5em;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
  margin-bottom: 2.5rem;
  color: var(--color-text);
}

/* --- About --- */
.about {
  border-top: 1px solid var(--color-border);
}

.about-intro {
  display: flex;
  gap: 3rem;
  align-items: center;
  margin-bottom: 2.5rem;
}

.about-photo-wrap {
  flex-shrink: 0;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--color-border-light);
  box-shadow: 0 0 0 6px var(--color-bg), 0 0 0 8px var(--color-accent);
}

.about-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  filter: grayscale(20%);
  transition: filter 0.4s var(--ease-out);
}

.about-photo-wrap:hover .about-photo {
  filter: grayscale(0%);
}

.about-intro-text .section-title {
  margin-bottom: 0;
}

.about-text p {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: 1.5rem;
  max-width: 640px;
}

.about-stats {
  display: flex;
  gap: 4rem;
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid var(--color-border);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--color-accent);
  line-height: 1;
}

.stat-suffix {
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--color-accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.about-footnote {
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
  font-style: italic;
  margin-top: 1.5rem;
}

/* --- Work --- */
.work-section {
  padding-top: 72px; /* clear fixed nav */
}

.video-grid-full {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.video-cell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}


.video-cell .thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* --zoom can be overridden per-cell via inline style for stubborn letterboxes */
  transform: scale(var(--zoom, 1.36)) translateY(10px);
  transform-origin: center center;
  opacity: 0;
  transition: transform 0.7s var(--ease-out), filter 0.5s var(--ease-out), opacity 0.7s var(--ease-out);
}

.video-cell.thumb-ready .thumb-img {
  opacity: 1;
  transform: scale(var(--zoom, 1.36)) translateY(0);
}

.video-cell:hover .thumb-img {
  transform: scale(calc(var(--zoom, 1.36) * 1.044)) translateY(0);
  filter: brightness(0.6);
}

.video-thumb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 1.25rem 1.5rem;
  pointer-events: none;
}

.video-thumb-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.video-thumb-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
  text-shadow: 0 1px 8px rgba(0,0,0,0.8);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.video-thumb-director {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s var(--ease-out) 0.04s, transform 0.35s var(--ease-out) 0.04s;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.video-cell:hover .video-thumb-title,
.video-cell:hover .video-thumb-director {
  opacity: 1;
  transform: translateY(0);
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out);
}

.lightbox.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-bg {
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 8, 0.95);
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  z-index: 1;
  width: 88vw;
  max-width: 1280px;
  transform: scale(0.96);
  transition: transform 0.35s var(--ease-out);
}

.lightbox.active .lightbox-content {
  transform: scale(1);
}

.lightbox-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 0.5rem;
  transition: color 0.2s ease, transform 0.2s ease;
  line-height: 1;
}

.lightbox-close:hover {
  color: #fff;
  transform: rotate(90deg);
}

.lightbox-meta {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 1rem;
}

.lightbox-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--color-text-muted);
}

.lightbox-director {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--color-text-subtle);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (max-width: 1024px) {
  .video-grid-full {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 640px) {
  .video-grid-full {
    grid-template-columns: repeat(2, 1fr);
  }
  .lightbox-content {
    width: 96vw;
  }
  .lightbox-close {
    top: -2.5rem;
  }
}

/* --- Approach --- */
.approach {
  border-top: 1px solid var(--color-border);
}

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

.approach-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 2.5rem;
  transition: all 0.4s var(--ease-out);
}

.approach-card:hover {
  border-color: var(--color-border-light);
  transform: translateY(-4px);
}

.approach-number {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: var(--color-accent);
  opacity: 0.4;
  line-height: 1;
  display: block;
  margin-bottom: 1.25rem;
}

.approach-card h3 {
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.approach-card p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* --- Marquee --- */
.marquee-section {
  padding: 2rem 0;
  overflow: hidden;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
}

.marquee-track {
  display: flex;
  white-space: nowrap;
  animation: marquee 20s linear infinite;
}

.marquee-track span {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  color: var(--color-text-subtle);
  padding-right: 1rem;
  flex-shrink: 0;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* --- Contact --- */
.contact {
  padding: 10rem 0;
}

.contact-content {
  text-align: center;
  max-width: 700px;
  margin: 0 auto;
}

.contact-title {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 7vw, 5rem);
  line-height: 1.05;
  margin-bottom: 1.5rem;
}

.contact-subtitle {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 3rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  transition: all 0.3s var(--ease-out);
}

.contact-link:hover {
  border-color: var(--color-accent);
  background: rgba(200, 168, 110, 0.04);
}

.contact-link:hover svg {
  transform: translate(3px, -3px);
}

.contact-link-label {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-subtle);
  width: 60px;
  text-align: left;
}

.contact-link-value {
  flex: 1;
  text-align: left;
  font-size: 1rem;
  color: var(--color-text);
}

.contact-link svg {
  color: var(--color-accent);
  transition: transform 0.3s var(--ease-out);
  flex-shrink: 0;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--color-text-subtle);
}

.footer-note {
  font-style: italic;
}

/* --- Animations --- */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 0.8s var(--ease-out) forwards;
}

.delay-1 { animation-delay: 0.15s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.45s; }

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .section-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .section-label {
    padding-top: 0;
  }

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

  .about-stats {
    gap: 2.5rem;
    flex-wrap: wrap;
  }

  .about-intro {
    flex-direction: column;
    text-align: center;
  }

  .about-photo-wrap {
    width: 160px;
    height: 160px;
  }


}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .section {
    padding: 5rem 0;
  }

  .hero {
    padding: 5rem 1.5rem 3rem;
  }

  .container {
    padding: 0 1.25rem;
  }

  .hero-tagline {
    font-size: 1rem;
  }

  .hide-mobile {
    display: none;
  }

  .about-stats {
    gap: 2rem;
  }

  .stat-number, .stat-suffix {
    font-size: 2.25rem;
  }

  .contact {
    padding: 6rem 0;
  }

  .contact-link {
    flex-wrap: wrap;
  }

  .contact-link-label {
    width: 100%;
  }

  .footer-inner {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* --- Selection --- */
::selection {
  background: rgba(200, 168, 110, 0.3);
  color: var(--color-text);
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-light);
}
