/* =============================================
  DANIEL MÁREL PORTFOLIO — STYLES v2
   ============================================= */

:root {
  --black: #0a0a0a;
  --white: #eceae5;
  --paper: #f0ede6;
  --paper-soft: #e9e4da;
  --red: #7a1f3d;
  --red-dark: #5c1630;
  --gray: #6b6b6b;
  --gray-light: #d4d4d0;
  --gray-bg: #e3e1dc;
  --border: rgba(10,10,10,0.12);

  --font-display: 'Bebas Neue', sans-serif;
  --font-serif: 'Playfair Display', serif;
  --font-body: 'DM Sans', sans-serif;

  --nav-h: 72px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-inout: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.35s var(--ease-inout);
}

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

html { scroll-behavior: auto; font-size: 16px; } /* Lenis handles smooth scroll */

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--black);
  overflow-x: hidden;
  cursor: none; /* скрываем нативный курсор */
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

a { text-decoration: none; color: inherit; cursor: none; }
ul { list-style: none; }
img { display: block; width: 100%; height: 100%; object-fit: cover; }
button { cursor: none; }

/* =============================================
   SCROLLBAR
   ============================================= */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--white); }
::-webkit-scrollbar-thumb { background: var(--red); }

/* =============================================
   КАСТОМНЫЙ КУРСОР
   ============================================= */
.cursor-dot {
  position: fixed;
  top: -4px; left: -4px;
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.3s ease, width 0.2s var(--ease-out), height 0.2s var(--ease-out);
  will-change: transform;
}

.cursor-ring {
  position: fixed;
  top: -20px; left: -20px;
  width: 40px; height: 40px;
  border: 1.5px solid var(--red);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.5;
  transition: opacity 0.3s ease, width 0.4s var(--ease-out), height 0.4s var(--ease-out), border-color 0.3s ease;
  will-change: transform;
}

.cursor-ring.ring--hover {
  width: 64px; height: 64px;
  top: -32px; left: -32px;
  opacity: 0.3;
  border-color: var(--black);
}

.cursor-dot.dot--hover {
  width: 12px; height: 12px;
  top: -6px; left: -6px;
  background: var(--black);
}

/* =============================================
   ПРОГРЕСС-БАР
   ============================================= */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0%;
  background: var(--red);
  z-index: 1000;
  transition: width 0.05s linear;
}

/* =============================================
   WORD WRAP — для анимации заголовков
   ============================================= */
.word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}

.word-inner {
  display: inline-block;
  will-change: transform;
}

/* =============================================
   NAV
   ============================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3rem;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition), background 0.4s ease;
}

.nav.scrolled {
  box-shadow: 0 2px 32px rgba(0,0,0,0.07);
  background: rgba(236,234,229,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav__logo {
  font-family: 'Playfair Display', serif; /* более строгий шрифт */
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  color: var(--black);
  transition: letter-spacing 0.4s var(--ease-out);
}

.nav__logo:hover { letter-spacing: 0.08em; }

.hero__title em {
  font-family: 'Playfair Display', serif;
  font-style: normal;
  letter-spacing: 0.03em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav__link {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray);
  transition: color var(--transition);
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -3px; left: 0;
  width: 0; height: 1px;
  background: var(--red);
  transition: width 0.4s var(--ease-out);
}

.nav__link:hover { color: var(--black); }
.nav__link:hover::after,
.nav__link.active::after { width: 100%; }
.nav__link.active { color: var(--black); }

.nav__link--cta {
  color: #fff;
  background: linear-gradient(180deg, rgba(128,28,65,0.92) 0%, rgba(108,23,55,0.95) 100%);
  border: 1px solid rgba(255,255,255,0.34);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 10px 20px rgba(54,9,27,0.28);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 0.62rem 1.45rem;
  letter-spacing: 0.1em;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease, background var(--transition), letter-spacing 0.4s var(--ease-out);
}

.nav__link--cta::after { display: none; }
.nav__link--cta:hover {
  background: linear-gradient(180deg, rgba(142,34,73,0.95) 0%, rgba(120,25,61,0.98) 100%);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 12px 24px rgba(54,9,27,0.34);
}

.nav__burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 0;
  transition: background 0.35s ease, border-color 0.35s ease, transform 0.25s ease;
}

.nav__burger:hover {
  background: rgba(255,255,255,0.95);
  border-color: rgba(0,0,0,0.15);
  transform: translateY(-1px);
}

.nav__burger span {
  display: block;
  width: 24px; height: 2px;
  background: var(--black);
  transition: transform 0.35s var(--ease-out), opacity 0.25s ease, background 0.25s ease;
  transform-origin: center;
}

.nav__burger.is-open {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.28);
}

.nav__burger.is-open span {
  background: var(--white);
}

.nav__burger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__burger.is-open span:nth-child(2) {
  opacity: 0;
}

.nav__burger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =============================================
   MOBILE MENU
   ============================================= */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--nav-h); left: 0; right: 0; bottom: 0;
  background: linear-gradient(145deg, rgba(12,12,12,0.96), rgba(23,22,20,0.96));
  backdrop-filter: blur(12px);
  z-index: 99;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(-10px) scale(0.985);
  pointer-events: none;
  overflow: hidden;
  transition: opacity 0.24s var(--ease-out), transform 0.26s var(--ease-out);
}

.mobile-menu::before,
.mobile-menu::after {
  content: "";
  position: absolute;
  width: 48vw;
  height: 48vw;
  border-radius: 999px;
  filter: blur(22px);
  opacity: 0.22;
  pointer-events: none;
  animation: none;
}

.mobile-menu::before {
  top: -16vw;
  left: -12vw;
  background: rgba(164, 21, 77, 0.55);
}

.mobile-menu::after {
  right: -15vw;
  bottom: -18vw;
  background: rgba(109, 130, 163, 0.35);
  animation-delay: 1.8s;
}

.mobile-menu.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.mobile-menu.closing {
  opacity: 0;
  transform: translateY(-14px) scale(0.985);
  pointer-events: none;
}

.mobile-menu ul {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  text-align: center;
}

.mobile-menu ul li {
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  transition: opacity 0.2s ease, transform 0.24s var(--ease-out);
}

.mobile-menu.open ul li {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.mobile-menu.closing ul li {
  opacity: 0;
  transform: translateY(16px) scale(0.985);
}

.mobile-menu ul::after {
  content: "Tap outside to close";
  display: block;
  margin-top: 1rem;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
}

.mobile-link {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 8vw, 3rem);
  letter-spacing: 0.06em;
  color: var(--white);
  line-height: 0.92;
  text-shadow: 0 8px 18px rgba(0,0,0,0.35);
  transition: color 0.3s ease, letter-spacing 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.mobile-menu.open li:nth-child(1) { transition-delay: 0.04s; }
.mobile-menu.open li:nth-child(2) { transition-delay: 0.06s; }
.mobile-menu.open li:nth-child(3) { transition-delay: 0.08s; }
.mobile-menu.open li:nth-child(4) { transition-delay: 0.1s; }
.mobile-menu.open li:nth-child(5) { transition-delay: 0.12s; }
.mobile-menu.open li:nth-child(6) { transition-delay: 0.14s; }
.mobile-menu.open li:nth-child(7) { transition-delay: 0.16s; }

.mobile-menu.closing li:nth-child(7) { transition-delay: 0s; }
.mobile-menu.closing li:nth-child(6) { transition-delay: 0.02s; }
.mobile-menu.closing li:nth-child(5) { transition-delay: 0.04s; }
.mobile-menu.closing li:nth-child(4) { transition-delay: 0.06s; }
.mobile-menu.closing li:nth-child(3) { transition-delay: 0.08s; }
.mobile-menu.closing li:nth-child(2) { transition-delay: 0.1s; }
.mobile-menu.closing li:nth-child(1) { transition-delay: 0.12s; }

.mobile-link:hover { color: var(--red); letter-spacing: 0.12em; }

@keyframes menuFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(2vw, -1.5vw) scale(1.06); }
}

/* =============================================
   HERO
   ============================================= */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 4rem) 3rem 4rem;
  overflow: hidden;
  background:
    radial-gradient(740px 360px at 82% 12%, rgba(122,31,61,0.06), transparent 72%),
    linear-gradient(160deg, #efede7 0%, #eceae5 58%, #e8e4db 100%);
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 680px;
  will-change: transform, opacity;
}

.hero__sub {
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 1.2rem;
  font-weight: 500;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(5rem, 12vw, 11rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
  color: var(--black);
  margin-bottom: 1.5rem;
}

.hero__title em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--red);
}

.hero__desc {
  font-size: 1rem;
  color: var(--gray);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 300;
  margin-bottom: 3rem;
}

.hero__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.85) 0%, rgba(231,225,215,0.86) 100%);
  color: var(--black);
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 12px 24px rgba(20,20,20,0.12);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 1rem 2.2rem;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  position: relative;
  overflow: visible;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s ease, background 0.3s ease, color 0.3s ease;
  will-change: transform;
}

.hero__btn::after { content: '→'; font-size: 1rem; }
.hero__btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(238,232,223,0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), 0 14px 30px rgba(20,20,20,0.16);
}

.hero__scroll {
  position: absolute;
  bottom: 3rem;
  left: 3rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gray);
}

.hero__scroll-line {
  width: 60px;
  height: 1px;
  background: rgba(10,10,10,0.2);
  position: relative;
  overflow: hidden;
}

.hero__scroll-line::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: var(--red);
  animation: scanline 1.2s var(--ease-inout) infinite;
}

@keyframes scanline {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* =============================================
   REVEAL АНИМАЦИИ
   ============================================= */

/* Текст с маской */
.reveal-text {
  overflow: hidden;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
}

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

/* Fade + slide up */
.reveal-fade {
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.42s var(--ease-out), transform 0.42s var(--ease-out);
}

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

/* Slide from right */
.reveal-slide-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.reveal-slide-right.is-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Gallery cards */
.gallery__item {
  opacity: 0;
  transform: translateY(35px) scale(0.97);
  transition: opacity 0.38s var(--ease-out), transform 0.38s var(--ease-out);
}

.gallery__item.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* =============================================
   SECTION COMMONS
   ============================================= */
.section {
  padding: 7rem 3rem;
  position: relative;
}

.section__label {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 500;
  margin-bottom: 1rem;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  color: var(--black);
  margin-bottom: 3.5rem;
}

.section__title em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--red);
}

.section__title--sub {
  color: var(--red);
  font-family: var(--font-serif);
  font-style: italic;
}

/* =============================================
   ABOUT
   ============================================= */
.about { background: var(--black); color: var(--white); }
.about .section__label { color: var(--red); }
.about .section__title { color: var(--white); }

.about__grid {
  display: block;
  max-width: 1100px;
}

.about__text {
  max-width: 1000px;
}

.about__text p {
  font-size: 1rem;
  line-height: 1.8;
  color: rgba(245,245,240,0.7);
  margin-bottom: 1.5rem;
  font-weight: 300;
}

.about__stats {
  display: flex;
  gap: 3rem;
  margin-top: 3rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(245,245,240,0.12);
}

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

.stat__num {
  font-family: var(--font-display);
  font-size: 3.5rem;
  color: var(--red);
  line-height: 1;
}

.stat__label {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(245,245,240,0.4);
}

.about__image-wrap { position: relative; will-change: transform; }

.about__image-placeholder {
  aspect-ratio: 3/4;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.about__image-placeholder span {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.15);
}

.about__image-deco {
  position: absolute;
  bottom: -2px; right: -2px;
  width: 60%; height: 60%;
  border-right: 2px solid var(--red);
  border-bottom: 2px solid var(--red);
  transition: width 0.6s var(--ease-out), height 0.6s var(--ease-out);
}

.about__image-wrap:hover .about__image-deco { width: 80%; height: 80%; }

/* =============================================
   GALLERY
   ============================================= */
.gallery-section {
  background: #eceae5;
}
.gallery-section:nth-child(even) {
  background: #e3e1dc;
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

/* Canvas галерея — квадратные превью */
#canvasGrid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

#canvasGrid .gallery__item {
  aspect-ratio: 1/1;
}

/* gallery__item — базовые стили (opacity/transform задаётся reveal) */
.gallery__item {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--gray-light);
}

.gallery__item-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--ease-out);
}

/* Плейсхолдер */
.gallery__item-placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--gray-light);
  transition: background 0.5s ease;
}

.ph-num {
  font-family: var(--font-display);
  font-size: 3rem;
  color: rgba(10,10,10,0.1);
  line-height: 1;
}

.ph-title {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray);
  text-align: center;
  padding: 0 1rem;
}

.ph-year {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: rgba(107,107,107,0.5);
}

.gallery__item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10,10,10,0);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 1.5rem;
  transition: background 0.25s ease;
  overflow-wrap: break-word;
  word-break: break-word;
}

.gallery__item-count {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: rgba(10, 10, 10, 0.7);
  color: var(--white);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  padding: 0.3rem 0.5rem;
  border-radius: 999px;
  z-index: 2;
}

.gallery__item-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--white);
  letter-spacing: 0.05em;
  transform: translateY(10px);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s var(--ease-out);
}

.gallery__item-sub {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(244,220,220,0.8);
  transform: translateY(8px);
  opacity: 0;
  transition: opacity 0.35s ease 0.05s, transform 0.35s var(--ease-out) 0.05s;
}

.gallery__item:hover .gallery__item-img { transform: scale(1.07); }
.gallery__item:hover .gallery__item-placeholder { background: #c5c3c0; }
.gallery__item:hover .gallery__item-overlay { background: rgba(10,10,10,0.58); }
.gallery__item:hover .gallery__item-title { opacity: 1; transform: translateY(0); }
.gallery__item:hover .gallery__item-sub { opacity: 1; transform: translateY(0); }

.gallery__video-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery__item-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: rgba(255,255,255,0.92);
  text-shadow: 0 0 15px rgba(0,0,0,0.75);
  pointer-events: none;
}

.gallery__item--video .gallery__item-overlay {
  background: rgba(0,0,0,0.24);
}

.gallery__item-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  color: rgba(255,255,255,0.95);
  background: rgba(8,8,8,0.9);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lightbox__nav-btn--secondary {
  background: rgba(255,255,255,0.08);
  color: var(--white);
}

/* Стрелка-уголок */
.gallery__item::after {
  content: '↗';
  position: absolute;
  top: 1rem; right: 1rem;
  width: 34px; height: 34px;
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  opacity: 0;
  transform: scale(0.6) rotate(-15deg);
  transition: opacity 0.35s ease, transform 0.4s var(--ease-out);
}

.gallery__item:hover::after { opacity: 1; transform: scale(1) rotate(0deg); }

/* =============================================
   COLLAB
   ============================================= */
.collab__intro {
  max-width: 600px;
  margin-bottom: 3rem;
  margin-top: -2rem;
}

.collab__intro p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--gray);
  font-weight: 300;
}

/* =============================================
   CONTACT
   ============================================= */
.contact {
  background: var(--black);
  color: var(--white);
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.contact .section__label { color: var(--red); }
.contact__inner { position: relative; z-index: 2; }

.contact__title {
  font-family: var(--font-display);
  font-size: clamp(4rem, 10vw, 9rem);
  line-height: 0.9;
  margin-bottom: 4rem;
  color: var(--white);
}

.contact__title em {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--red);
}

.contact__links { display: flex; flex-direction: column; }

.contact__item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255,255,255,0.07);
  transition: padding-left 0.4s var(--ease-out);
}

.contact__item:last-child { border-bottom: 1px solid rgba(255,255,255,0.07); }
.contact__item:hover { padding-left: 1.2rem; }

.contact__icon {
  width: 44px; height: 44px;
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--red);
  flex-shrink: 0;
  transition: background 0.35s ease, border-color 0.35s ease, transform 0.35s var(--ease-out);
}

.contact__item:hover .contact__icon {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
  transform: rotate(10deg);
}

.contact__item > div { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; }

.contact__type {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

.contact__value { font-size: 1rem; color: var(--white); font-weight: 300; }

.contact__arrow {
  color: var(--red);
  font-size: 1.2rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.35s ease, transform 0.4s var(--ease-out);
}

.contact__item:hover .contact__arrow { opacity: 1; transform: translateX(0); }

.contact__bg-text {
  position: absolute;
  bottom: -0.15em;
  right: -0.05em;
  font-family: var(--font-display);
  font-size: clamp(10rem, 20vw, 18rem);
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.03);
  pointer-events: none;
  line-height: 1;
}

/* =============================================
   FOOTER
   ============================================= */
.footer {
  background: var(--black);
  border-top: 1px solid rgba(255,255,255,0.05);
  padding: 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer span {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
}

.footer a {
  color: rgba(255,255,255,0.62);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s ease;
}

.footer a:hover {
  color: rgba(255,255,255,0.9);
}

/* =============================================
   LIGHTBOX
   ============================================= */
.lightbox__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.94);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

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

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 201;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior: contain;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

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

.lightbox__close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--white);
  width: 44px; height: 44px;
  font-size: 1rem;
  transition: background 0.3s ease, transform 0.4s var(--ease-out);
  z-index: 10;
}

.lightbox__close:hover { background: var(--red); transform: rotate(90deg); }

.lightbox__inner {
  display: grid;
  grid-template-columns: 1fr 380px;
  height: 80vh;
  max-width: 1300px;
  margin: auto;
  width: 95%;
}

@media (max-width: 1100px) {
  .lightbox__inner {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
  .lightbox__info {
    padding: 1.5rem 1rem;
    max-height: none;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    border-left: none;
    border-top: 1px solid rgba(0,0,0,0.12);
  }
  .lightbox__category,
  .lightbox__title,
  .lightbox__desc,
  .lightbox__meta-item {
    text-align: left;
  }
  .lightbox__nav {
    position: sticky;
    left: 0;
    transform: none;
    bottom: 0;
    padding: 0.75rem 1rem calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
    justify-content: center;
    width: 100%;
    background: linear-gradient(to top, rgba(9,9,9,0.92), rgba(9,9,9,0));
    flex-wrap: wrap;
    z-index: 8;
  }
}

@media (max-width: 768px) {
  .gallery__grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
  }
  .gallery__item {
    aspect-ratio: 3/2;
  }
  .gallery__item-overlay {
    padding: 0.8rem;
  }
  .gallery__item-title {
    font-size: 1rem;
  }
  .gallery__item-sub {
    font-size: 0.6rem;
  }
  .gallery__item-pages {
    font-size: 0.65rem;
  }
  .lightbox__inner {
    width: 100%;
    margin: 0;
    min-height: 100dvh;
  }
  .lightbox__image-wrap {
    min-height: min(55vh, 460px);
  }
  .lightbox__info {
    margin-top: 0;
    padding-bottom: 1.5rem;
  }
  .lightbox__nav-btn {
    font-size: 0.75rem;
    padding: 0.5rem 0.8rem;
  }
  .lightbox__category,
  .lightbox__title,
  .lightbox__desc {
    font-size: 0.9rem;
  }
}

.lightbox__image-wrap {
  position: relative;
  background: #0d0d0d;
  overflow: hidden;
  transition: opacity 0.3s ease;
}

.lightbox--canvas .lightbox__inner {
  background: var(--white);
  column-gap: 0;
}

.lightbox--canvas .lightbox__image-wrap,
.lightbox--canvas .lightbox__placeholder {
  background: var(--white);
}

.lightbox--performance .lightbox__inner {
  background: var(--white);
  column-gap: 0;
}

.lightbox--performance .lightbox__image-wrap,
.lightbox--performance .lightbox__placeholder,
.lightbox--performance .lightbox__image-wrap video {
  background: var(--white);
}

.lightbox--performance .lightbox__image-wrap video {
  object-fit: contain;
}

.lightbox__image-wrap.swipe-left img,
.lightbox__image-wrap.swipe-right img,
.lightbox__image-wrap.swipe-left video,
.lightbox__image-wrap.swipe-right video {
  transition: transform 0.22s ease;
}
.lightbox__image-wrap.swipe-left img,
.lightbox__image-wrap.swipe-left video { transform: translateX(-20px); }
.lightbox__image-wrap.swipe-right img,
.lightbox__image-wrap.swipe-right video { transform: translateX(20px); }

.lightbox__image-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  background: #000;
}

.gallery__item-media,
.lightbox__image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery__item-media {
  display: block;
}

.lightbox__thumb.lightbox__thumb--video {
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__thumb.lightbox__thumb--video span {
  color: rgba(255,255,255,0.85);
  font-size: 0.8rem;
  font-weight: 700;
}

.lightbox__thumbs {
  position: absolute;
  left: 50%;
  bottom: 0.8rem;
  transform: translateX(-50%);
  display: flex;
  gap: 0.45rem;
  z-index: 2;
}

.lightbox__thumb {
  width: 42px;
  height: 30px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  opacity: 0.55;
  transition: border-color 0.18s ease, opacity 0.18s ease, transform 0.2s ease;
}

.lightbox__thumb:hover {
  opacity: 1;
  transform: scale(1.03);
}

.lightbox__thumb.active {
  border-color: var(--red);
  opacity: 1;
}

.gallery__item-pages {
  margin-top: 0.5rem;
  font-size: 0.7rem;
  color: rgba(244,220,220,0.96);
  letter-spacing: 0.08em;
}

.lightbox__image-wrap img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: none;
}

.lightbox__image-wrap img.visible { display: block; }

.lightbox__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0d0d0d;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.1);
}

.lightbox__info {
  background: var(--white);
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  will-change: transform, opacity;
  border-left: 1px solid rgba(0,0,0,0.12);
  box-shadow: inset 10px 0 18px -18px rgba(0,0,0,0.45);
}

.lightbox__download {
  margin: 0.75rem 0;
  align-self: flex-start;
  text-decoration: none;
  color: var(--red);
  border: 1px solid var(--red);
  padding: 0.35rem 0.8rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  transition: background 0.2s ease, color 0.2s ease;
}
.lightbox__download:hover { background: var(--red); color: var(--white); }


.lightbox__category {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 500;
  margin-bottom: 1rem;
}

.lightbox__title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  letter-spacing: 0.03em;
  color: var(--black);
  line-height: 1;
  margin-bottom: 1.5rem;
}

.lightbox__desc {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--gray);
  font-weight: 300;
  margin-bottom: 2rem;
  white-space: pre-line;
}

.lightbox__meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.lightbox__meta-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lightbox__meta-label { color: var(--gray); text-transform: uppercase; font-weight: 500; letter-spacing: 0.12em; }
.lightbox__meta-value { color: var(--black); }

/* 1328 canvas item — ручная подгонка */
.gallery-section#canvas .gallery__item-img,
.gallery-section#canvas .gallery__item-placeholder {
  object-fit: contain;
}

.lightbox__nav {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.lightbox__nav-btn {
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.08) 100%);
  border: 1px solid rgba(255,255,255,0.34);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.24), 0 10px 20px rgba(0,0,0,0.25);
  backdrop-filter: blur(10px);
  color: var(--white);
  padding: 0.6rem 1.4rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s var(--ease-out), box-shadow 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.lightbox__nav-btn:hover {
  background: linear-gradient(180deg, rgba(149,36,77,0.95) 0%, rgba(124,26,63,0.98) 100%);
  border-color: rgba(255,255,255,0.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.24), 0 12px 24px rgba(53,8,26,0.35);
  transform: scale(1.03);
}

.lightbox__counter {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.35);
  min-width: 50px;
  text-align: center;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }
  .mobile-menu { display: flex; }

  .about__grid { grid-template-columns: 1fr; gap: 3rem; }
  .about__image-wrap { order: -1; }
  .about__image-placeholder { aspect-ratio: 4/3; }

  .lightbox {
    justify-content: flex-start;
    align-items: stretch;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-bottom: 0;
  }
  .lightbox__inner {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    overflow: visible;
    touch-action: auto;
    padding-bottom: 0;
  }
  .lightbox__image-wrap { height: clamp(260px, 40vh, 420px); }
  .lightbox__info { padding: 2rem 1.25rem 1.25rem; }
  .lightbox__close {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    margin: 0;
  }
  .lightbox__nav {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    inset: auto !important;
    transform: none !important;
    width: 100%;
    justify-content: initial;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas: "prev counter next";
    align-items: center;
    padding: 0.55rem 0.6rem calc(env(safe-area-inset-bottom, 0px) + 0.75rem);
    background: rgba(12,12,12,0.88);
    border-top: 1px solid rgba(255,255,255,0.14);
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    box-shadow: none;
    gap: 0.5rem;
    z-index: 25;
    margin-top: 0.5rem;
  }
  .lightbox--mobile-nav-inline .lightbox__nav {
    margin-top: 0;
    border-top: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    border-left: none;
    border-right: none;
    border-radius: 0;
    background: rgba(12,12,12,0.96);
    padding: 0.65rem 0.75rem;
  }
  .lightbox__nav.has-play {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas: "prev play counter next";
  }
  .lightbox__nav-btn {
    padding: 0.48rem 0.75rem;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    min-width: 0;
    width: 100%;
    justify-content: center;
  }
  #lightboxPrev {
    grid-area: prev;
  }
  #lightboxNext {
    grid-area: next;
  }
  .lightbox__nav-btn--secondary {
    grid-area: play;
    min-width: 0;
    background: rgba(116,12,44,0.88);
    border-color: rgba(186,41,89,0.75);
  }
  .lightbox__nav-btn--secondary:hover {
    background: rgba(150,24,67,0.95);
    border-color: rgba(204,65,109,0.95);
  }
  .lightbox__counter {
    grid-area: counter;
    min-width: 42px;
    text-align: center;
    font-size: 0.72rem;
    color: rgba(255,255,255,0.7);
  }
  .lightbox--mobile-nav-inline .lightbox__info {
    padding-top: 1.4rem;
  }

  /* На мобильных — стандартный курсор */
  body, a, button { cursor: default; }
  .cursor-dot, .cursor-ring { display: none; }
}

@media (max-width: 600px) {
  .nav { padding: 0 1.5rem; }
  .section { padding: 5rem 1.5rem; }
  .hero { padding: calc(var(--nav-h) + 3rem) 1.5rem 3rem; }
  .hero__scroll { left: 1.5rem; }
  .about__stats { gap: 2rem; }
  .contact { padding: 5rem 1.5rem; }
  .footer { padding: 1.5rem; flex-direction: column; gap: 0.5rem; text-align: center; }
  .gallery__grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .lightbox__close { top: 1rem; right: 1rem; }
}
