/* ═══════════════════════════════════════════
   STUDIO MAREL — Neo Minimalism
   Референс: тёплый лён, мягкий контраст
═══════════════════════════════════════════ */
:root {
  /* Светлые тона */
  --linen-1:   #EEEAE3;   /* hero */
  --linen-2:   #E5E2DA;   /* about */
  --linen-3:   #EBEAE4;   /* team */

  /* Тёмные тона */
  --ink:       #242220;   /* основной текст и тёмные блоки */
  --ink-soft:  #38342F;   /* чуть мягче */
  --ink-block: #2A2724;   /* фон контактов — мягче чистого чёрного */

  /* Нейтральные */
  --grey-mid:  #7A7570;
  --grey-line: #C8C4BC;
  --grey-pale: #D4D0C8;

  --cut:       clamp(36px, 8vw, 72px);

  --font-display: 'Jost', system-ui, sans-serif;
  --font-serif:   var(--font-display);
  --font-body:    var(--font-display);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
.hero, .about, .portfolio, .team, .contacts { backface-visibility: hidden; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--linen-2);
  color: var(--ink);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { border: none; background: none; cursor: pointer; }

/* ═══════════════════════════════════════════
   SHARED
═══════════════════════════════════════════ */
.section-tag {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.28em;
  color: var(--grey-mid);
  text-transform: uppercase;
  margin-bottom: 20px;
}
.section-tag.light { color: var(--grey-pale); }

.section-title {
  font-family: var(--font-body);
  font-size: clamp(14px, 3.5vw, 18px);
  font-weight: 400;
  font-style: normal;
  line-height: 1.5;
  color: var(--grey-mid);
  letter-spacing: 0.04em;
  text-transform: none;
  margin-bottom: 20px;
}
.section-title.light { color: var(--grey-pale); }

/* ═══════════════════════════════════════════
   SCROLL REVEAL
═══════════════════════════════════════════ */
.reveal-up {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1),
              transform 0.8s cubic-bezier(0.16,1,0.3,1);
}
.reveal-up.visible { opacity: 1; transform: none; }
.reveal-up:nth-child(2) { transition-delay: 0.1s; }
.reveal-up:nth-child(3) { transition-delay: 0.2s; }
.reveal-up:nth-child(4) { transition-delay: 0.3s; }

/* ═══════════════════════════════════════════
   HERO — тёплый лён, центрированная типографика
═══════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100svh;
  background: var(--linen-1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 4;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), 0 100%);
  overflow: hidden;
  text-align: center;
  transform: translateZ(0);
}

/* Переход hero→about: тонкая тень по срезу */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--cut) * 2);
  background: linear-gradient(
    to bottom-right,
    transparent 49.5%,
    rgba(0,0,0,0.06) 50%,
    transparent 50.5%
  );
  pointer-events: none;
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  padding: 100px 32px calc(var(--cut) + 64px);
  will-change: transform, opacity;
}

.hero-text-block {
  opacity: 0;
  animation: fadeUp 1s cubic-bezier(0.16,1,0.3,1) 0.1s forwards;
}

.hero-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.hero-hello {
  font-family: var(--font-body);
  font-size: clamp(24px, 6.5vw, 38px);
  font-weight: 400;
  font-style: normal;
  color: var(--ink-soft);
  line-height: 1.4;
  margin-bottom: 0;
}

.hero-name {
  font-family: var(--font-body);
  font-size: clamp(24px, 6.5vw, 38px);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0;
  line-height: 1.4;
  text-transform: none;
  margin-bottom: 0;
}

.hero-sub-text {
  font-family: var(--font-body);
  font-size: clamp(24px, 6.5vw, 38px);
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.4;
}


@keyframes fadeUp {
  to { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════
   ABOUT — чуть темнее лён, центрированный текст
   Переход hero→about: оба светлые, разный тон
═══════════════════════════════════════════ */
.about {
  position: relative;
  background: var(--linen-2);
  z-index: 3;
  margin-top: calc(-1 * var(--cut));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - var(--cut)));
  padding: calc(var(--cut) + 56px) 0 calc(var(--cut) + 80px);
  text-align: center;
  transform: translateZ(0);
}

/* Тень по верхнему срезу — видна граница двух светлых блоков */
.about::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: calc(var(--cut) * 1.5);
  background: linear-gradient(
    to top-right,
    rgba(0,0,0,0.04) 50%,
    transparent 50%
  );
  pointer-events: none;
}

.about-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 32px;
}

.about-text {
  font-family: var(--font-body);
  font-size: clamp(24px, 6.5vw, 38px);
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink-soft);
  margin-top: 24px;
  white-space: pre-line;
}

.about-cta {
  display: inline-block;
  margin-top: 48px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--grey-mid);
  text-transform: uppercase;
  border-bottom: 1px solid var(--grey-line);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}
.about-cta:hover { color: var(--ink); border-color: var(--ink); }

.about-stats {
  display: flex;
  gap: 0;
  margin-top: 52px;
  padding-top: 32px;
  border-top: 1px solid var(--grey-line);
  justify-content: center;
}
.stat {
  display: flex; flex-direction: column; gap: 4px;
  flex: 1;
  padding: 0 16px;
  border-right: 1px solid var(--grey-line);
}
.stat:last-child { border-right: none; }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(36px, 9vw, 60px);
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat-label {
  font-size: 9px; letter-spacing: 0.2em;
  color: var(--grey-mid); text-transform: uppercase;
}

/* ═══════════════════════════════════════════
   PORTFOLIO — тёмный, видео
═══════════════════════════════════════════ */
.portfolio {
  position: relative;
  background: var(--ink-block);
  z-index: 2;
  margin-top: calc(-1 * var(--cut));
  height: calc(100svh + var(--cut));
  min-height: 640px;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), 0 100%);
  transform: translateZ(0);
}
.portfolio-header {
  position: absolute;
  top: calc(var(--cut) + 20px);
  left: 0; right: 0;
  text-align: center;
  z-index: 5;
  pointer-events: none;
}
.portfolio-hint {
  font-size: 10px;
  letter-spacing: 0.25em;
  color: rgba(238,234,227,0.25);
  margin-top: 6px;
  text-transform: uppercase;
}
.portfolio-stage { position: absolute; inset: 0; overflow: hidden; }
.portfolio-slider {
  display: flex; height: 100%;
  will-change: transform;
  transition: transform 0.42s cubic-bezier(0.25,0.8,0.25,1);
  touch-action: pan-y pinch-zoom;
  user-select: none;
}
.portfolio-slide {
  position: relative;
  flex: 0 0 100%; width: 100%; height: 100%; overflow: hidden;
}
.portfolio-video {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.portfolio-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to top,
    rgba(28,25,23,0.95) 0%,
    rgba(28,25,23,0.25) 45%,
    transparent 68%
  );
  display: flex;
  align-items: flex-end;
  padding: 28px 28px calc(var(--cut) + 32px);
}
.portfolio-info { width: 100%; }
.portfolio-title {
  font-family: var(--font-body);
  font-size: clamp(20px, 5.5vw, 32px);
  font-weight: 500;
  color: var(--linen-1);
  line-height: 1.3;
  letter-spacing: 0;
  margin-bottom: 8px;
}
.portfolio-desc {
  font-family: var(--font-body);
  font-size: 14px; font-weight: 300; font-style: normal;
  color: rgba(238,234,227,0.5);
  line-height: 1.5;
  margin-bottom: 16px;
  max-width: 300px;
}
.portfolio-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.portfolio-author {
  display: inline-flex; align-items: center; gap: 12px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: opacity 0.2s;
}
.portfolio-author:active { opacity: 0.6; }
.portfolio-author-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; border: 1px solid rgba(255,255,255,0.15);
  background: var(--ink-soft);
  flex-shrink: 0;
}
.portfolio-author-name { font-size: 15px; font-weight: 400; color: var(--linen-1); }
.portfolio-author-role { font-size: 11px; color: var(--grey-pale); letter-spacing: 0.05em; }

.portfolio-dots {
  position: absolute;
  bottom: calc(var(--cut) + 12px);
  left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 10;
}
.portfolio-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: rgba(238,234,227,0.2);
  transition: all 0.3s ease;
}
.portfolio-dot.active { background: var(--linen-1); transform: scale(1.6); }

.portfolio-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 10; width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--linen-1);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s; opacity: 0;
}
@media (hover: hover) {
  .portfolio-arrow { opacity: 1; }
  .portfolio-arrow:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.3); }
}
.portfolio-arrow--prev { left: 16px; }
.portfolio-arrow--next { right: 16px; }

.video-controls {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.sound-btn,
.expand-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(28,25,23,0.7);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  color: rgba(238,234,227,0.85);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.sound-btn:hover,
.expand-btn:hover {
  border-color: rgba(255,255,255,0.4);
  color: var(--linen-1);
  background: rgba(28,25,23,0.9);
}

/* ═══ VIDEO MODAL ═══ */
.video-modal {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.video-modal.visible {
  opacity: 1;
  pointer-events: all;
}
.video-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(10,9,8,0.92);
  backdrop-filter: blur(4px);
}
.video-modal-inner {
  position: relative;
  width: min(92vw, calc(92vh * 16 / 9));
  z-index: 1;
}
.video-modal-player {
  width: 100%;
  display: block;
  border-radius: 4px;
  background: #000;
}
.video-modal-close {
  position: absolute;
  top: -44px; right: 0;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(238,234,227,0.1);
  border: 1px solid rgba(238,234,227,0.2);
  color: var(--linen-1);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.video-modal-close:hover { background: rgba(238,234,227,0.2); }

.play-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 8; cursor: pointer;
  background: rgba(28,25,23,0.4);
}

.portfolio-empty {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; color: rgba(238,234,227,0.2);
}
.portfolio-empty p {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.15em;
}

/* ═══════════════════════════════════════════
   TEAM — светлый, тот же тон что hero
═══════════════════════════════════════════ */
.team {
  position: relative;
  background: var(--linen-3);
  z-index: 3;
  margin-top: calc(-1 * var(--cut));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - var(--cut)));
  padding: calc(var(--cut) + 44px) 0 calc(var(--cut) + 68px);
  transform: translateZ(0);
}
.team-header { padding: 0 28px; margin-bottom: 36px; }

.team-carousel-wrap { overflow: hidden; }
.team-carousel {
  display: flex; gap: 14px;
  padding: 4px 28px 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.team-carousel::-webkit-scrollbar { display: none; }

.team-card {
  flex: 0 0 200px;
  background: var(--linen-1);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(28,25,23,0.07);
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1),
              box-shadow 0.35s ease;
  cursor: pointer;
}
.team-card:hover { transform: translateY(-5px); box-shadow: 0 12px 32px rgba(28,25,23,0.12); }
.team-card.highlight { outline: 1.5px solid var(--ink); outline-offset: 2px; }

.team-photo-wrap { width: 100%; aspect-ratio: 1/1; overflow: hidden; background: var(--grey-pale); }
.team-photo {
  width: 100%; height: 100%;
  object-fit: cover; object-position: top center;
  transition: transform 0.5s ease;
  filter: grayscale(15%);
}
.team-card:hover .team-photo { transform: scale(1.05); filter: grayscale(0%); }
.team-photo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--grey-pale);
  font-family: var(--font-display);
  font-size: 40px; font-weight: 800; color: var(--grey-mid);
}
.team-info { padding: 14px 16px 16px; }
.team-name {
  font-family: var(--font-body);
  font-size: 15px; font-weight: 500;
  color: var(--ink);
  margin-bottom: 3px;
  text-transform: none;
  letter-spacing: 0;
}
.team-role {
  font-size: 10px; color: var(--grey-mid);
  letter-spacing: 0.12em; text-transform: uppercase;
  margin-bottom: 10px;
}
.team-socials { display: flex; gap: 6px; }
.team-social {
  width: 26px; height: 26px;
  background: var(--linen-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--grey-mid);
  transition: all 0.2s;
}
.team-social:hover { background: var(--ink); color: var(--linen-1); }
.team-social svg { width: 13px; height: 13px; }

/* ═══════════════════════════════════════════
   CONTACTS — тёмный
═══════════════════════════════════════════ */
.contacts {
  position: relative;
  background: var(--ink-block);
  z-index: 2;
  margin-top: calc(-1 * var(--cut));
  padding: calc(var(--cut) + 60px) 0 72px;
  text-align: center;
  transform: translateZ(0);
}
.contacts-inner {
  max-width: 480px; margin: 0 auto; padding: 0 32px;
}
.contacts-phone {
  display: inline-block;
  font-family: var(--font-body);
  font-size: clamp(28px, 8vw, 52px);
  font-weight: 300;
  font-style: normal;
  color: var(--linen-1);
  letter-spacing: 0.01em;
  text-transform: none;
  margin: 24px 0 36px;
  border-bottom: 1px solid rgba(238,234,227,0.3);
  padding-bottom: 4px;
  transition: color 0.2s, border-color 0.2s;
}
.contacts-phone:hover {
  color: var(--grey-pale);
  border-color: rgba(238,234,227,0.7);
}
.contacts-messengers { display: flex; gap: 10px; justify-content: center; }
.messenger-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 28px;
  font-size: 11px; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  background: var(--linen-1); color: var(--ink);
  transition: all 0.2s;
}
.messenger-btn:hover { background: var(--grey-pale); transform: translateY(-2px); }

/* ═══════════════════════════════════════════
   FLOATING CTA
═══════════════════════════════════════════ */
.float-cta {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 28px;
  background: var(--linen-1);
  color: var(--ink);
  border-radius: 0;
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 4px 32px rgba(28,25,23,0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, background 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.float-cta.float-cta--visible {
  opacity: 1;
  pointer-events: all;
}
.float-cta:hover {
  background: var(--grey-pale);
  box-shadow: 0 8px 40px rgba(28,25,23,0.25);
}
.float-cta svg { flex-shrink: 0; }

.cta-anchor { height: 52px; }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 400px) {
  .about-stats { gap: 0; }
  .team-card { flex: 0 0 170px; }
}
@media (min-width: 768px) {
  .team-card { flex: 0 0 240px; }
  .hero-inner { padding-left: 48px; padding-right: 48px; }
  .about-inner { padding: 0 48px; }
}
