/* Portfolio · Vertical Story Flow — premium 2026 cinema layout */

/* Strict snap on every case section (mandatory) */
html.is-portfolio { scroll-snap-type: y mandatory; scroll-behavior: smooth; }
html.is-portfolio body { padding-bottom: 0; }
.pf-section {
  position: relative;
  width: 100%;
  min-height: 100svh;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
}

/* Alternating dark / light theme */
.pf-section--dark {
  background: #0A0A0C;
  color: white;
}
.pf-section--light {
  background: #FAFAF8;
  color: #0A0A0C;
}

/* Top hairline gold accent on each section */
.pf-section::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 168, 118, 0.42), transparent);
  z-index: 5;
}

/* Hero entry section */
.pf-hero {
  text-align: center;
  padding: 120px 24px 60px;
}
.pf-hero__inner { max-width: 920px; margin: 0 auto; }
.pf-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.4px;
  color: #C8A876;
  padding: 6px 14px;
  border: 1px solid rgba(229, 200, 150, 0.42);
  border-radius: 999px;
  background: rgba(232, 184, 95, 0.06);
  margin-bottom: 26px;
}
.pf-hero__eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #C8A876;
  box-shadow: 0 0 10px rgba(229, 200, 150, 0.85);
  animation: pulse 1.8s ease-in-out infinite;
}
.pf-hero__title {
  margin: 0 0 22px;
  font-size: clamp(40px, 7vw, 84px);
  font-weight: 200;
  letter-spacing: -2.6px;
  line-height: 1.0;
  color: white;
}
.pf-hero__title em {
  font-style: normal;
  font-weight: 300;
  background: linear-gradient(135deg, #F5DEB3 0%, #E5C896 35%, #C8A876 70%, #8C7A52 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pf-hero__lead {
  margin: 0 auto 32px;
  max-width: 56ch;
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.65);
  font-weight: 400;
}
.pf-hero__categories {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: center;
  margin-bottom: 38px;
}
.pf-hero__cat {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.05px;
  color: rgba(255, 255, 255, 0.55);
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.3s ease-out;
}
.pf-hero__cat:hover { color: #C8A876; border-color: rgba(229, 200, 150, 0.55); }
.pf-hero__count {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 36px;
}
.pf-hero__count-item {
  text-align: center;
}
.pf-hero__count-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 200;
  letter-spacing: -1px;
  color: white;
  line-height: 1;
  display: block;
  margin-bottom: 6px;
}
.pf-hero__count-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}
.pf-hero__scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
  animation: pfScrollBob 2.6s ease-in-out infinite;
}
.pf-hero__scroll svg { color: #C8A876; }
@keyframes pfScrollBob {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.6; }
  50%      { transform: translateX(-50%) translateY(6px); opacity: 1; }
}

/* === Case section (each project) === */
.pf-case__container {
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
  padding: 60px 32px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  align-items: center;
}
@media (min-width: 900px) {
  .pf-case__container {
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    padding: 80px 40px;
  }
  .pf-case--reverse .pf-case__container {
    grid-template-columns: 1fr 1fr;
  }
  .pf-case--reverse .pf-case__media { order: -1; }
}

.pf-case__body { max-width: 540px; }

.pf-case__num {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: #C8A876;
  margin-bottom: 16px;
}
.pf-case__cat {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #C8A876;
  padding: 4px 10px;
  border: 1px solid rgba(200, 168, 118, 0.45);
  border-radius: 4px;
  margin-bottom: 18px;
  background: rgba(200, 168, 118, 0.05);
}
.pf-section--light .pf-case__cat {
  color: #8C7A52;
  border-color: rgba(200, 168, 118, 0.55);
}
.pf-section--light .pf-case__num { color: #8C7A52; }

.pf-case__title {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(36px, 5.2vw, 60px);
  font-weight: 200;
  letter-spacing: -2px;
  line-height: 1.02;
}
.pf-section--dark .pf-case__title { color: white; }
.pf-section--light .pf-case__title { color: #0A0A0C; }
.pf-case__title em {
  font-style: normal;
  font-weight: 300;
  background: linear-gradient(135deg, #E5C896 0%, #C8A876 50%, #8C7A52 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pf-case__desc {
  margin: 0 0 28px;
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.6;
  font-weight: 400;
  letter-spacing: -0.05px;
}
.pf-section--dark .pf-case__desc { color: rgba(255, 255, 255, 0.68); }
.pf-section--light .pf-case__desc { color: rgba(10, 10, 16, 0.62); }

.pf-case__metrics {
  display: flex;
  gap: 32px;
  margin-bottom: 28px;
  padding: 18px 0;
  border-top: 1px solid;
  border-bottom: 1px solid;
}
.pf-section--dark .pf-case__metrics { border-color: rgba(255, 255, 255, 0.10); }
.pf-section--light .pf-case__metrics { border-color: rgba(10, 10, 16, 0.10); }

.pf-case__metric strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.pf-section--dark .pf-case__metric strong { color: white; }
.pf-section--light .pf-case__metric strong { color: #0A0A0C; }
.pf-case__metric span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.pf-section--dark .pf-case__metric span { color: rgba(255, 255, 255, 0.42); }
.pf-section--light .pf-case__metric span { color: rgba(10, 10, 16, 0.42); }

.pf-case__cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.1px;
  text-decoration: none;
  padding: 14px 0;
  border-bottom: 1px solid;
  transition: padding 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.pf-section--dark .pf-case__cta { color: white; border-color: rgba(255, 255, 255, 0.20); }
.pf-section--light .pf-case__cta { color: #0A0A0C; border-color: rgba(10, 10, 16, 0.20); }
.pf-case__cta svg { color: #C8A876; transition: transform 0.4s; }
.pf-case__cta:hover { padding-right: 12px; }
.pf-case__cta:hover svg { transform: translateX(6px); }

/* === Media (photo) side === */
.pf-case__media {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-width: 520px;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  box-shadow:
    0 40px 80px -20px rgba(10, 10, 16, 0.50),
    0 12px 28px -8px rgba(10, 10, 16, 0.20);
}
.pf-section--light .pf-case__media {
  box-shadow:
    0 40px 80px -20px rgba(10, 10, 16, 0.18),
    0 12px 28px -8px rgba(10, 10, 16, 0.10);
}
@media (min-width: 900px) {
  .pf-case__media { aspect-ratio: 5 / 6; max-width: 600px; }
}
.pf-case__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}
.pf-section.is-active .pf-case__media img { transform: scale(1.04); }

/* Vignette overlay on photos */
.pf-case__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.18) 100%),
              radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.10) 100%);
  pointer-events: none;
  z-index: 2;
}

/* Placeholder media (no image) */
.pf-case__media--placeholder {
  background:
    radial-gradient(circle at 30% 30%, rgba(200, 168, 118, 0.32) 0%, transparent 60%),
    linear-gradient(165deg, #1A1A1F 0%, #0A0A0C 100%);
  display: grid;
  place-items: center;
}
.pf-section--light .pf-case__media--placeholder {
  background:
    radial-gradient(circle at 30% 30%, rgba(200, 168, 118, 0.18) 0%, transparent 60%),
    linear-gradient(165deg, #FAFAF8 0%, #EFEEE9 100%);
}
.pf-case__media-mark {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 200;
  letter-spacing: -3px;
  background: linear-gradient(135deg, #E5C896 0%, #8C7A52 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  z-index: 1;
}

/* Floating glass card overlay on photo (App Store-style) */
.pf-case__overlay {
  position: absolute;
  bottom: 22px;
  left: 22px;
  right: 22px;
  z-index: 3;
  padding: 12px 14px;
  background: rgba(10, 10, 16, 0.65);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pf-case__overlay-name {
  font-size: 13px;
  font-weight: 700;
  color: white;
  letter-spacing: -0.2px;
}
.pf-case__overlay-stack {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-mono);
}

/* === Final CTA section === */
.pf-final {
  text-align: center;
  padding: 100px 24px;
}
.pf-final__inner {
  max-width: 680px;
  margin: 0 auto;
}
.pf-final__title {
  margin: 0 0 18px;
  font-size: clamp(36px, 5.6vw, 64px);
  font-weight: 200;
  letter-spacing: -2px;
  line-height: 1.05;
  color: white;
}
.pf-final__title em {
  font-style: normal;
  font-weight: 300;
  background: linear-gradient(135deg, #E5C896 0%, #C8A876 50%, #8C7A52 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pf-final__sub {
  margin: 0 0 36px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.55;
}
.pf-final__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px;
  background: linear-gradient(135deg, #E5C896 0%, #C8A876 50%, #8C7A52 100%);
  color: #0A0A0C;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.1px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 40px -8px rgba(229, 200, 150, 0.55);
}
.pf-final__cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.7s ease;
}
.pf-final__cta:hover::before { transform: translateX(100%); }

/* === Snap rail for portfolio (right vertical) — mirrors hero rail === */
.pf-rail {
  position: fixed;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  z-index: 70;
  height: 64vh;
  max-height: 460px;
  pointer-events: none;
}
.pf-rail__list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  pointer-events: auto;
}
.pf-rail__item {
  position: relative;
  width: 24px; height: 24px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.pf-rail__item::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.30);
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.pf-rail__item.is-active::before {
  width: 8px; height: 8px;
  background: #C8A876;
  box-shadow: 0 0 0 5px rgba(200, 168, 118, 0.14), 0 0 14px rgba(200, 168, 118, 0.55);
}
body[data-rail-bg="light"] .pf-rail__item::before { background: rgba(10, 10, 16, 0.32); }
.pf-rail__item-label {
  position: absolute;
  right: 30px;
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: rgba(10, 10, 16, 0.94);
  backdrop-filter: blur(16px);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pf-rail__item.is-active .pf-rail__item-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
body[data-rail-bg="light"] .pf-rail__item-label {
  background: rgba(255, 255, 255, 0.96);
  color: #0A0A0C;
  box-shadow: 0 8px 22px rgba(10, 10, 16, 0.12);
}
.pf-rail__line {
  position: absolute;
  top: 6px; bottom: 6px;
  right: 11px;
  width: 1px;
  background: rgba(255, 255, 255, 0.10);
  z-index: -1;
}
body[data-rail-bg="light"] .pf-rail__line { background: rgba(10, 10, 16, 0.08); }
.pf-rail__line-fill {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 0%;
  background: linear-gradient(180deg, #E5C896 0%, #8C7A52 100%);
  transition: height 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 6px rgba(200, 168, 118, 0.65);
}
@media (max-width: 600px) {
  .pf-rail { height: 56vh; right: 10px; }
}

/* Snap pill (bottom progress) */
.pf-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 95;
  padding: 10px 18px;
  background: rgba(10, 10, 16, 0.85);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 14px 38px rgba(10, 10, 16, 0.30);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.pf-pill.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.pf-pill__num {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.50);
}
.pf-pill__num i { font-style: normal; color: #C8A876; font-weight: 800; }
.pf-pill__sep { margin: 0 4px; color: rgba(255, 255, 255, 0.30); }
.pf-pill__name {
  font-size: 13px;
  font-weight: 700;
  color: white;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
}

/* Site-header on portfolio — белый bar над cinema-секциями (logo + nav читаемы на любом фоне) */
html.is-portfolio .site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(10, 10, 12, 0.08);
  box-shadow: 0 1px 0 rgba(10, 10, 12, 0.03), 0 8px 24px -16px rgba(10, 10, 12, 0.12);
  z-index: 90;
}
html.is-portfolio .site-header .header__bar-top { display: none; }
/* На portfolio первая секция начинается под белым header — добавим отступ только на hero */
html.is-portfolio .pf-hero { padding-top: calc(80px + 60px); }
@media (max-width: 899px) {
  html.is-portfolio .pf-hero { padding-top: calc(70px + 40px); }
}

/* Reveal animation entry */
.pf-case__body { opacity: 0; transform: translateY(20px); transition: opacity 0.8s, transform 0.8s; }
.pf-case__media { opacity: 0; transform: translateY(28px); transition: opacity 1s 0.1s, transform 1s 0.1s; }
.pf-section.is-active .pf-case__body,
.pf-section.is-active .pf-case__media { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html.is-portfolio { scroll-snap-type: none; scroll-behavior: auto; }
  .pf-case__body, .pf-case__media, .pf-case__media img { transition: none !important; opacity: 1; transform: none; }
}

/* Mobile adjustments */
@media (max-width: 899px) {
  .pf-section { min-height: 100svh; padding: 60px 0; }
  .pf-case__container { padding: 24px 22px; gap: 28px; }
  .pf-case__media { aspect-ratio: 5 / 7; max-width: 320px; }
  .pf-hero { padding: 100px 22px 60px; }
  .pf-hero__count { gap: 18px; }
  .pf-hero__count-num { font-size: 26px; }
  .pf-hero__categories { gap: 6px 10px; }
  .pf-hero__cat { font-size: 11px; padding: 5px 11px; }
  .pf-final { padding: 60px 22px; }
}
