*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html,body{width:100%;height:100%;overflow:hidden}

:root{
  --ease: cubic-bezier(.25,.46,.45,.94);
  --ease-out: cubic-bezier(.16,1,.3,1);
  --text-soft: rgba(255,255,255,.45);
}

/* ── НАВИГАЦИОННОЕ МЕНЮ ── */
.main-nav {
  position: fixed;
  top: 0; 
  left: 0; 
  right: 0;
  padding: 20px 44px; /* Чуть уменьшил отступ для аккуратной полосы */
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000; /* Повысил z-index, чтобы меню всегда было сверху */
  
  /* Эффект Apple Glass (Темный по умолчанию для главной) */
  background: rgba(15, 15, 15, 0.4);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* Эффект Apple Glass для светлых страниц (Projects, About, Contact) */
.projects-body .main-nav,
.about-body .main-nav,
.contact-body .main-nav {
  background: rgba(68, 88, 141, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.main-nav > * {
  pointer-events: auto;
}

/* Логотип: Жирный Montserrat */
.nav-logo {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800; /* Очень жирный, как слово Byakina */
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  opacity: 0.9;
  transition: opacity 0.3s;
}
.nav-logo:hover { opacity: 0.6; }

.nav-links {
  display: flex;
  gap: 28px; /* Чуть уменьшили отступ, чтобы влезло 5 ссылок */
}
.nav-links a {
  font-family: 'Montserrat', sans-serif;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.3s ease, transform 0.3s ease;
}
.nav-links a:hover {
  color: #fff;
  transform: translateY(-1px);
}
.nav-links a.active {
  color: #fff;
}

/* ── BODY ── */
body{
  background:#000;
  font-family:'Montserrat',sans-serif;
  -webkit-font-smoothing:antialiased;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:100svh;
  overflow:hidden;
}

/* ── VIDEO BACKGROUND ── */
.video-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none; /* Запрещаем клики по видео и вызов плеера */
}

/* Затемняющий градиент поверх видео (чтобы текст лучше читался) */
.video-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.35) 0%,
    rgba(0,0,0,.15) 45%,
    rgba(0,0,0,.8) 100%
  );
  z-index: 2;
}

/* Статичная картинка, если автоплей заблокирован системой */
.video-bg .photo-fallback {
  position: absolute;
  inset: 0;
  background-image: url('https://images.unsplash.com/photo-1485095329183-d0797bf5a2b2?q=80&w=2070');
  background-size: cover;
  background-position: center;
  z-index: 0;
  opacity: 0; /* Скрыта по умолчанию */
  transition: opacity 1.5s ease-in-out;
}

.video-bg .photo-fallback.ready {
  opacity: 1; /* Показываем через JS, если видео не запустилось */
}

/* ── САМО ВИДЕО ── */
.video-bg video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* МАГИЯ ЗДЕСЬ: заполняет экран без "сумасшедшего" зума */
  z-index: 1;
  opacity: 0; /* Скрываем до полной загрузки */
  transition: opacity 1.5s ease-in-out;
}

/* Скрываем системные кнопки Play в Safari (на всякий случай) */
.video-bg video::-webkit-media-controls,
.video-bg video::-webkit-media-controls-start-playback-button,
.video-bg video::-webkit-media-controls-play-button {
  display: none !important;
  -webkit-appearance: none !important;
}

/* JS добавит этот класс, когда видео реально начнет играть */
.video-bg video.ready {
  opacity: 1;
}

/* ── GRAIN ── */
.grain {
  position: fixed;
  inset: 0;
  z-index: 1; /* Grain находится между видео (1) и градиентом (2) */
  pointer-events: none;
  opacity: .032;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

/* ── MAIN STAGE ── */
.stage{
  position:relative;
  z-index:10;
  width:100%;
  max-width:1000px;
  padding: 0 40px;
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
}

/* ── PORTFOLIO HINT ── */
.hint {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  color: rgba(255, 255, 255, 0.55);
  opacity: 0;
  pointer-events: none;
  transform-origin: center bottom;
  transform: rotate(-6deg);
  animation: fadeInHint 1.2s var(--ease-out) 3.5s forwards;
}
.hint svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  animation: bounceDown 2s ease-in-out infinite 4.5s;
}

/* ── NAME BLOCK ── */
.name-link{
  text-decoration:none;
  display:inline-flex;
  align-items:baseline;
  gap:.15em;
  flex-wrap:wrap;
  justify-content:center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.kuli{
  font-family:'Cormorant Garamond',serif;
  font-style:italic;
  font-weight:300;
  font-size:clamp(3rem,14vw,9.5rem);
  line-height:1;
  background:linear-gradient(-225deg, #CBBACC 0%, #2580B3 100%);
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  opacity:.95;
  transition:opacity .5s ease;
}
.byakina{
  font-family:'Montserrat',sans-serif;
  font-weight:800;
  font-size:clamp(3rem,14vw,9.5rem);
  letter-spacing:-.03em;
  line-height:1;
  color:#fff;
  transition:opacity .5s ease;
}
.name-link:hover .kuli,
.name-link:hover .byakina{opacity:.7}
.name-link:active { transform: scale(0.98); transition: transform 0.2s; }
.name-wrap{
  opacity:0;
  animation:up .9s var(--ease-out) .3s forwards;
}

/* ── SERVICES ── */
.services{
  margin-top: 16px; 
  font-size:clamp(.54rem,.85vw,.7rem);
  font-weight:300;
  letter-spacing:.22em;
  text-transform:uppercase;
  color:var(--text-soft);
  line-height:2.4;
  opacity:0;
  animation:up .8s var(--ease-out) .9s forwards;
}

/* ── BOTTOM BAR ── */
.bottom-bar{
  position:fixed;
  bottom:0;left:0;right:0;
  z-index:10;
  padding: 0 44px calc(34px + env(safe-area-inset-bottom));
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  opacity:0;
  animation:fadeIn .8s var(--ease-out) 1.6s forwards;
}
.location{
  font-size:clamp(.5rem,.75vw,.62rem);
  font-weight:500;
  letter-spacing:.26em;
  text-transform:uppercase;
  color:var(--text-soft);
}
.socials{
  display:flex;
  align-items:center;
  gap:28px;
}
.soc-link{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:.56rem;
  font-weight:600;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--text-soft);
  text-decoration:none;
  transition: all .3s ease;
  -webkit-tap-highlight-color:transparent;
}
.soc-link:hover{color:rgba(255,255,255,1)}
.soc-link svg{
  width:16px;height:16px;
  fill:currentColor;
  transition:transform .3s var(--ease-out);
}
.soc-link:hover svg{transform:translateY(-2px)}
.soc-sep{
  width:3px;height:3px;border-radius:50%;
  background:rgba(255,255,255,.15);
}
.corner{
  position:fixed;
  bottom:32px;left:44px;
  font-size:.48rem;
  font-weight:500;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:var(--text-soft);
  opacity:0;
  animation:fadeIn .8s var(--ease-out) 1.8s forwards;
  z-index:11;
}

/* ── KEYFRAMES ── */
@keyframes up{
  from{opacity:0;transform:translateY(16px)}
  to{opacity:1;transform:translateY(0)}
}
@keyframes fadeIn{
  from{opacity:0}to{opacity:1}
}
@keyframes fadeInHint{
  from{opacity:0; transform:translateY(-10px) rotate(-6deg)}
  to{opacity:1; transform:translateY(0) rotate(-6deg)}
}
@keyframes bounceDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); } 
}

/* ── RESPONSIVE — TABLET ── */
@media(max-width:768px){
  /* Меню на планшете ставим по центру колонкой, чтобы всё влезло */
  .main-nav {
    flex-direction: column;
    gap: 16px;
    padding: 24px;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .bottom-bar{
    padding:0 24px calc(28px + env(safe-area-inset-bottom));
    flex-direction:column-reverse;
    align-items:center;
    gap:20px;
  }
  .location{text-align:center}
  .corner{display:none}
}

/* ── RESPONSIVE — PHONE ── */
@media(max-width:480px){
  .main-nav { padding: 20px; gap: 12px; }
  .nav-logo { font-size: 1rem; }
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 0.48rem; }

  .stage{ padding: 0 20px; }
  .hint { margin-bottom: 10px; }
  .hint svg { width: 18px; height: 18px; }
  .name-link { justify-content: center; text-align: center; gap: 0.1em; }
  .kuli, .byakina { font-size: clamp(2.4rem, 13.5vw, 4rem); }
  .services {
    font-size: 0.45rem; 
    letter-spacing: .18em;
    line-height: 2;
    padding: 0 10px;
    margin-top: 12px;
  }
  .desktop-dot { display: none; }
  .mobile-break { display: block; margin: 2px 0; content: ""; }
  
  .bottom-bar{
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
    gap: 12px;
    pointer-events: none; 
  }
  .bottom-bar > * { pointer-events: auto; }
  .socials{gap: 16px;}
  .soc-link { padding: 12px; margin: -12px; opacity: 0.7; }
  .soc-link:active { opacity: 1; }
  .soc-link span{display:none}
  .soc-link svg{width:20px;height:20px} 
  .soc-link:active svg{transform:scale(.9)}
  .soc-sep {display: none;} 
  .location{display:none}
}

/* ── RESPONSIVE — VERY SMALL ── */
@media(max-width:360px){
  .kuli,.byakina{ font-size:clamp(2.1rem, 13vw, 3rem); }
  .services { font-size: 0.4rem; }
}

/* ── СПЕЦИФИЧЕСКИЕ СТИЛИ ДЛЯ СТРАНИЦЫ ПРОЕКТОВ ── */
:root {
  --bg-color-projects: #ffffff;
  --secondary-bg: #f5f5f7;
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --border-color: #d2d2d7;
  --apple-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --active-gradient: linear-gradient(-225deg, #CBBACC 0%, #2580B3 100%);
}

/* Сброс для страницы проектов (чтобы не конфликтовало с главной) */
.projects-body {
  background-color: var(--bg-color-projects) !important;
  overflow-y: auto !important; /* Здесь прокрутка нужна */
  overflow-x: hidden;
  display: block !important; 
}

/* ── НОВАЯ СЕКЦИЯ ДЛЯ АНИМАЦИИ И ФИЛЬТРОВ ── */
.projects-top-section { 
  position: relative; /* Убираем sticky, теперь секция скроллится вместе со страницей */
  width: 100%; 
  padding: 120px 0 40px; /* 120px отступ сверху, чтобы главное меню (main-nav) ничего не перекрывало */
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  z-index: 10; 
  background-color: var(--bg-color-projects, #ffffff);
}

/* Обновляем мобильную адаптацию для этой секции */
@media (max-width: 768px) { 
  .projects-top-section { 
    padding: 100px 0 30px; 
  }
}

#container-morph { 
  position: relative; 
  width: 100%; 
  height: 50px; 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  filter: url(#threshold); 
  margin-bottom: 10px; 
}

#text1, #text2 { 
  position: absolute; 
  font-weight: 800; 
  font-size: 2.5rem; 
  letter-spacing: -0.03em; 
  color: var(--text-primary); 
  text-align: center; 
  width: 100%; 
}

.filter-nav { 
  display: flex; 
  gap: 8px; 
  padding: 5px 15px; 
  background: rgba(0,0,0,0.03); 
  border-radius: 30px; 
  margin-top: 10px; 
  max-width: 95%; 
  overflow-x: auto; 
}

.filter-btn { 
  border: none; 
  background: none; 
  padding: 8px 18px; 
  font-family: inherit; 
  font-size: 0.75rem; 
  font-weight: 700; 
  color: var(--text-secondary); 
  cursor: pointer; 
  border-radius: 20px; 
  transition: all 0.4s var(--apple-ease); 
}

.filter-btn.active { 
  background: var(--active-gradient); 
  color: #ffffff; 
  box-shadow: 0 4px 12px rgba(37, 128, 179, 0.3); 
}

.gallery-wrapper { 
  width: 100%; 
  max-width: 1300px; 
  margin: 0 auto; 
  padding: 0 15px; 
}

.gallery { 
  display: grid; 
  grid-template-columns: repeat(3, 1fr); 
  gap: 15px; 
  transition: opacity 0.4s var(--apple-ease); 
}

.item { 
  position: relative; 
  width: 100%; 
  padding-bottom: 56.25%; 
  overflow: hidden; 
  border-radius: 12px; 
  background: var(--secondary-bg); 
  transition: transform 0.5s var(--apple-ease), box-shadow 0.5s var(--apple-ease); 
}

.item.hide { display: none; }

.static, .gif { 
  position: absolute; 
  top: 0; left: 0; 
  width: 100%; height: 100%; 
  object-fit: cover; 
  transition: opacity 0.5s var(--apple-ease); 
}

.gif { opacity: 0; }
.item:hover .gif { opacity: 1; }
.item:hover .static { opacity: 0; }

.text-block { 
  position: absolute; 
  left: 12px; 
  bottom: 12px; 
  z-index: 10; 
}

.text-block .title { 
  font-weight: 700; 
  font-size: 0.8rem; 
  color: #fff; 
  text-transform: uppercase; 
}

.text-block .desc { 
  font-weight: 500; 
  font-size: 0.65rem; 
  color: rgba(255,255,255,0.9); 
}

.apple-footer { 
  background-color: var(--secondary-bg); 
  padding: 40px 0 30px; 
  margin-top: 60px; 
  color: var(--text-secondary); 
  font-size: 11px; 
}

@media (max-width: 1100px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { 
  .gallery { grid-template-columns: 1fr; } 
  #text1, #text2 { font-size: 1.6rem; } 
}
/* ── СПЕЦИФИЧЕСКИЕ СТИЛИ ДЛЯ СТРАНИЦЫ ABOUT ── */
.about-body {
    background-color: #000009 !important; /* Фирменный светло-серый Apple */
    overflow-y: auto !important;
    display: block !important;
}

/* Навигация для светлых страниц */
.about-body .main-nav .nav-logo,
.about-body .main-nav .nav-links a {
    color:#eeeeee;
}
.about-body .main-nav .nav-links a {
    color: #eeeeee;
}
.about-body .main-nav .nav-links a:hover,
.about-body .main-nav .nav-links a.active {
    color: #eeeeee;
}
.about-body .main-nav {
    background: linear-gradient(to bottom, rgba(6, 0, 0, 0.8) 0%, transparent 100%);
}

/* Контент */
.about-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 24px 60px; /* Отступ сверху под меню */
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
}

.text-column {
    flex: 1;
    max-width: 600px;
}

.kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 12px;
    background: linear-gradient(-225deg, #CBBACC 0%, #2580B3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.about-body h1 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 32px;
    color: #eeeeee;
}

.bio-text {
    font-size: 16px;
    line-height: 1.65;
    font-weight: 500;
    color: #eeeeee;
    margin-bottom: 24px;
}

.divisions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 40px;
}

.division-card {
    background: linear-gradient(-225deg, #5a4b5c 0%, #10354b88 90%);;
    padding: 24px;
    border-radius: 20px;
    
    box-shadow: 0 4px 20px rgba(0,0,0,0.02);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.division-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}

.div-handle {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #eeeeee;
}

.div-desc {
    font-size: 11px;
    font-weight: 500;
    color: #eeeeee;
}

.portrait-frame {
    flex: 0.8;
    max-width: 420px;
    aspect-ratio: 3 / 4;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 20px 30px 60px rgba(0,0,0,0.15);
    transform: rotate(2deg);
    transition: transform 0.6s ease;
}

.portrait-frame:hover {
    transform: rotate(0deg) scale(1.02);
}

.portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Мобильная адаптация */
@media (max-width: 900px) {
    .about-container {
        flex-direction: column-reverse;
        padding-top: 100px;
        gap: 40px;
    }
    .portrait-frame {
        max-width: 300px;
        transform: rotate(0deg);
    }
    .divisions-grid {
        grid-template-columns: 1fr;
    }
}
/* ── СПЕЦИФИЧЕСКИЕ СТИЛИ ДЛЯ СТРАНИЦЫ CONTACT ── */
.contact-body {
    background-color: #f5f5f7 !important;
    background: radial-gradient(circle at 50% 0%, #ffffff 0%, #ececf2 80%) !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
    overflow: hidden !important; /* На этой странице прокрутка обычно не нужна */
}

/* Навигация для светлого фона (как в About) */
.contact-body .main-nav .nav-logo,
.contact-body .main-nav .nav-links a {
    color: #f5f5f7
}
.contact-body .main-nav .nav-links a {
    color: rgba(255, 255, 255, 0.5);
}
.contact-body .main-nav .nav-links a:hover,
.contact-body .main-nav .nav-links a.active {
    color: #f5f5f7
}

.contact-card {
    background-image: linear-gradient(-225deg, #CBBACC 0%, #2580B3 100%);
    width: 90%;
    max-width: 440px;
    padding: 60px 40px;
    border-radius: 32px;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 30px 60px rgba(147, 165, 207, 0.25), 
                inset 0 0 0 1px rgba(255, 255, 255, 0.3);
    opacity: 0;
    transform: translateY(20px);
    animation: cinematicFadeIn 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    z-index: 10;
}

.contact-card h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    letter-spacing: -0.01em;
    font-size: 34px;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.contact-card .subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 48px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 700;
}

.action-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 48px;
}

.action-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 20px 24px;
    border-radius: 20px;
    text-decoration: none;
    color: #ffffff;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.action-link:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.02);
}

.text-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2px;
    font-weight: 700;
}

.detail {
    font-size: 15px;
    font-weight: 600;
}

.languages {
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    padding-top: 32px;
}

.lang-list {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.lang-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes cinematicFadeIn {
    from { opacity: 0; transform: scale(0.97) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Адаптация для мобильных */
@media (max-width: 480px) {
    .contact-card {
        padding: 40px 24px;
    }
    .contact-card h1 { font-size: 28px; }
    .detail { font-size: 13px; }
}