:root {
  --bg: #f5f5f4;
  --ink: #0b0b0b;
  --muted: #6b6b6b;
  --card: #0b0b0b;
  --accent: #c6ff3a;
  --accent-soft: rgba(198, 255, 58, 0.35);
  --line: rgba(0, 0, 0, 0.1);
  --font-display: 'Space Grotesk', 'Arial Narrow', Arial, sans-serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

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

html, body {
  height: 100%;
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--accent); color: #0b0b0b; }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.reveal.reveal--in {
  opacity: 1;
  transform: none;
}
.pf-card.reveal { transition-delay: 0.05s; }
.pf-card--b.reveal { transition-delay: 0.12s; }
.pf-card--c.reveal { transition-delay: 0.18s; }
.pf-card--d.reveal { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

.portfolio-section {
  flex: 1;
  padding: 200px 6vw 140px;
}

.portfolio-head {
  margin-bottom: 56px;
}
.portfolio-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.portfolio-eyebrow b { color: var(--ink); }
.portfolio-h1 {
  font-family: 'Anton', 'Arial Narrow', sans-serif;
  font-size: clamp(52px, 10vw, 150px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink);
}

.portfolio-h1 .reg {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.6em;
  vertical-align: top;
  line-height: 1;
  margin-left: 0.06em;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 200px;
  gap: 18px;
}

.pf-card--a { grid-column: span 4; grid-row: span 2; }
.pf-card--b { grid-column: span 2; grid-row: span 2; }
.pf-card--c { grid-column: span 3; grid-row: span 2; }
.pf-card--d { grid-column: span 3; grid-row: span 2; }
.pf-card--e { grid-column: span 2; grid-row: span 2; }
.pf-card--f { grid-column: span 4; grid-row: span 2; }
.pf-card--g { grid-column: span 3; grid-row: span 2; }
.pf-card--h { grid-column: span 3; grid-row: span 2; }

.pf-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: var(--card);
  cursor: pointer;
  isolation: isolate;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.12);
}

.pf-card.fx-tilt {
  transform-style: preserve-3d;
  will-change: transform;
}
.pf-card.fx-tilt.is-tilting {
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.35);
}

.pf-card .pf-video,
.pf-card .pf-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pf-poster {
  z-index: 2;
  transition: opacity 0.5s ease, transform 1.2s ease;
}
.pf-video {
  z-index: 1;
  transform: scale(1.03);
}

.pf-card.is-playing .pf-poster { opacity: 0; }
.pf-card.is-playing .pf-video {
  transform: scale(1.08);
  transition: transform 7s ease;
}

.pf-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: border-color 0.4s ease;
  pointer-events: none;
}
.pf-card:hover::after { border-color: var(--accent); }

.pf-info {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0) 28%,
    rgba(0, 0, 0, 0) 52%,
    rgba(0, 0, 0, 0.78) 100%
  );
  pointer-events: none;
}

.pf-tag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--accent-soft);
  padding: 8px 13px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.pf-info-bottom {
  transform: translateY(8px);
  opacity: 0.92;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.pf-card:hover .pf-info-bottom { transform: none; opacity: 1; }

.pf-info-bottom h3 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: #fff;
  margin-bottom: 4px;
}
.pf-card--a .pf-info-bottom h3,
.pf-card--f .pf-info-bottom h3 { font-size: 2rem; }
.pf-info-bottom p {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.72);
}

.pf-badge {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.pf-card.is-playing .pf-badge { opacity: 0; }
.pf-badge svg { width: 13px; height: 13px; fill: #fff; margin-left: 2px; }

@media (max-width: 1000px) {
  .portfolio-section { padding: 160px 5vw 100px; }
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 280px;
    gap: 16px;
  }
  .pf-card { grid-column: span 1 !important; grid-row: span 1 !important; }
  .pf-card--a .pf-info-bottom h3,
  .pf-card--f .pf-info-bottom h3 { font-size: 1.55rem; }
}

@media (max-width: 640px) {
  .portfolio-section { padding: 130px 5vw 80px; }
  .portfolio-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 300px;
  }
}

.stopka {
  margin-top: auto;
  background: #0b0b0b;
  color: #b5b5b5;
  padding: 48px 6vw 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.stopka p {
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.stopka p:last-child { opacity: 0.7; }

@media (max-width: 768px) {
  .stopka { flex-direction: column; gap: 12px; text-align: center; }
}

.nav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 64px);
  max-width: 1400px;
  height: 72px;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-radius: 999px;
  z-index: 1000;
  transition: transform 0.35s ease, opacity 0.35s ease;
}
.nav.nav--hidden {
  transform: translate(-50%, -120%);
  opacity: 0;
}

.nav .logo {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 38px;
}
.nav .logo img { height: 100%; display: block; }
.nav .logo span {
  position: relative;
  padding-left: 22px;
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.8;
  color: #fff;
}
.nav .logo span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 100%;
  background: rgba(255, 255, 255, 0.5);
}

.nav .menu { display: flex; gap: 10px; }
.nav .menu a {
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.25s ease, transform 0.25s ease, color 0.25s ease;
}
.nav .menu a:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--accent);
  transform: translateY(-1px);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}
.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav {
    width: calc(100% - 20px);
    height: 52px;
    padding: 0 8px 0 16px;
    top: 10px;
  }
  .nav .logo { height: 28px; }
  .nav .logo span { display: none; }

  .nav__toggle { display: flex; }

  .nav .menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 6px;
    width: auto;
    padding: 12px;
    background: rgba(0, 0, 0, 0.96);
    backdrop-filter: blur(12px);
    border-radius: 22px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  }

  .nav.is-open .menu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav .menu a {
    font-size: 14px;
    padding: 13px 16px;
    letter-spacing: 1px;
    text-align: center;
    background: rgba(255, 255, 255, 0.06);
  }
}
