/* ================================================================
   DESIGN SYSTEM — Dark Glassmorphism Portfolio
   Style:      Dark Minimal + Glassmorphism accents
   Palette:    #080808 bg / #7c3aed violet / #a855f7 purple / #06b6d4 cyan
   Fonts:      Space Grotesk (headings) + Inter (body)
   ================================================================ */

/* ── 1. Variables ── */
:root {
  /* Background */
  --bg-0: #080808;
  --bg-1: #101010;
  --bg-2: #181818;

  /* Glass surfaces */
  --glass:        rgba(255, 255, 255, 0.04);
  --glass-hover:  rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.18);

  /* Accent */
  --accent:    #7c3aed;
  --accent-2:  #a855f7;
  --accent-3:  #06b6d4;
  --accent-4:  #ec4899;
  --gradient:  linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #06b6d4 100%);
  --glow:      0 0 48px rgba(124, 58, 237, 0.25);

  /* Text */
  --text-1: #f4f4f5;
  --text-2: #a1a1aa;
  --text-3: #52525b;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.6);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 56px rgba(0,0,0,0.7);

  /* Spacing (8-pt grid) */
  --s1: 4px;  --s2: 8px;   --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px;  --s8: 32px; --s10: 40px;
  --s12: 48px;--s16: 64px; --s20: 80px;--s24: 96px;

  /* Radius */
  --r-sm: 8px; --r-md: 12px; --r-lg: 20px; --r-xl: 28px; --r-full: 9999px;

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:  cubic-bezier(0.4, 0, 1, 1);
  --dur-fast:   150ms;
  --dur-normal: 250ms;
  --dur-slow:   400ms;

  /* Z-index scale */
  --z-base: 0; --z-card: 10; --z-nav: 40;
  --z-modal: 100; --z-cursor: 200;
}

/* ── 2. Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text-1);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }
a  { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: var(--glass-border-hover); border-radius: var(--r-full); }

/* Selection */
::selection { background: rgba(124, 58, 237, 0.35); color: #fff; }

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

/* ── 3. Accessibility ── */
.skip-link {
  position: absolute; top: -100px; left: var(--s4);
  padding: var(--s2) var(--s4);
  background: var(--accent); color: #fff;
  border-radius: var(--r-sm); font-size: 14px;
  z-index: calc(var(--z-cursor) + 10);
  transition: top var(--dur-fast) var(--ease-out);
}
.skip-link:focus { top: var(--s4); outline: 2px solid #fff; outline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ── 4. Custom Cursor (desktop only) ── */
@media (hover: hover) and (pointer: fine) {
  * { cursor: none !important; }
  /* Прозрачный курсор для video — невидим, но браузер детектирует hover */
  video { cursor: url('data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7') 0 0, auto !important; }
  /* Принудительно держать весь блок контролов и таймлайн видимыми */
  video::-webkit-media-controls-panel    { opacity: 1 !important; transition: none !important; }
  video::-webkit-media-controls-timeline { display: block !important; opacity: 1 !important; }

  /* Полноэкранный режим — возвращаем настоящий курсор */
  :-webkit-full-screen,
  :-webkit-full-screen * { cursor: auto !important; }
  :fullscreen,
  :fullscreen *           { cursor: auto !important; }


  .cursor {
    position: fixed; pointer-events: none; z-index: var(--z-cursor);
    width: 10px; height: 10px;
    background: radial-gradient(circle at 35% 35%, #d8b4fe, #7c3aed);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 1;
    box-shadow:
      0 0 8px  rgba(168, 85, 247, 0.9),
      0 0 20px rgba(124, 58, 237, 0.5),
      0 0 40px rgba(124, 58, 237, 0.2);
    transition: width  200ms var(--ease-out),
                height 200ms var(--ease-out),
                box-shadow 200ms var(--ease-out),
                opacity var(--dur-fast) var(--ease-out);
    will-change: transform;
  }

  .cursor.is-hovering {
    width: 18px; height: 18px;
    box-shadow:
      0 0 12px rgba(168, 85, 247, 1),
      0 0 32px rgba(124, 58, 237, 0.7),
      0 0 60px rgba(124, 58, 237, 0.3);
  }
}

/* ── 5. Layout helpers ── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--s6);
}
@media (min-width: 768px)  { .container { padding: 0 var(--s8); } }
@media (min-width: 1024px) { .container { padding: 0 var(--s12); } }

/* ── 6. Utility ── */
.gradient-text {
  background: var(--gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 5s linear infinite;
}

@keyframes gradient-shift {
  0%   { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ── 7. Scroll Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── 8. Section header ── */
.section-header { margin-bottom: var(--s12); }

.section-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  padding: var(--s1) var(--s3);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--r-full);
  margin-bottom: var(--s4);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-1);
}

/* ── 9. Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--font-display);
  font-size: 15px; font-weight: 500;
  padding: 14px 28px;
  border-radius: var(--r-full);
  transition: transform var(--dur-normal) var(--ease-out),
              box-shadow var(--dur-normal) var(--ease-out),
              background var(--dur-normal) var(--ease-out);
  min-height: 48px;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 24px rgba(124, 58, 237, 0.35);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(124, 58, 237, 0.5);
}

.btn--ghost {
  background: var(--glass);
  color: var(--text-1);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
}
.btn--ghost:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════
   NAVIGATION
═══════════════════════════════════════════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  padding: var(--s4) 0;
  transition: background var(--dur-slow) var(--ease-out),
              border-color var(--dur-slow) var(--ease-out),
              padding var(--dur-slow) var(--ease-out);
}

.nav.is-scrolled {
  background: rgba(8, 8, 8, 0.85);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  padding: var(--s3) 0;
}

.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1200px; margin: 0 auto;
  padding: 0 var(--s6);
}
@media (min-width: 768px)  { .nav__inner { padding: 0 var(--s8); } }
@media (min-width: 1024px) { .nav__inner { padding: 0 var(--s12); } }

.nav__logo {
  display: flex; align-items: center; gap: var(--s2);
  font-family: var(--font-display);
  font-weight: 700; font-size: 18px;
  transition: opacity var(--dur-fast);
}
.nav__logo:hover { opacity: 0.8; }

.nav__logo-mark {
  width: 28px; height: 28px;
  background: var(--gradient);
  border-radius: var(--r-sm);
  display: block;
  flex-shrink: 0;
}

.nav__menu {
  display: none;
  align-items: center;
  gap: var(--s8);
}

.nav__link {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 500;
  color: var(--text-2);
  position: relative;
  padding: var(--s1) 0;
  transition: color var(--dur-fast);
}
.nav__link::after {
  content: '';
  position: absolute; bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--gradient);
  border-radius: var(--r-full);
  transition: width var(--dur-normal) var(--ease-out);
}
.nav__link:hover { color: var(--text-1); }
.nav__link:hover::after { width: 100%; }

.nav__toggle {
  display: flex; flex-direction: column; gap: 5px;
  width: 44px; height: 44px;
  align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  transition: background var(--dur-fast);
}
.nav__toggle:hover { background: var(--glass); }
.nav__toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text-1);
  border-radius: var(--r-full);
  transition: transform var(--dur-normal) var(--ease-out),
              opacity var(--dur-normal) var(--ease-out);
}
.nav__toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav__toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile menu */
.nav__menu.is-open {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: rgba(10, 10, 10, 0.97);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  padding: var(--s6) var(--s6) var(--s8);
  animation: slide-down var(--dur-normal) var(--ease-out);
}
.nav__menu.is-open .nav__link { font-size: 18px; padding: var(--s3) 0; }

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (min-width: 768px) {
  .nav__toggle { display: none; }
  .nav__menu   { display: flex; }
}

/* ═══════════════════════════════════════════════
   HERO
═══════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 120px var(--s6) var(--s20);
  overflow: hidden;
}

/* Background layers */
.hero__bg {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
}

.hero__orb {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.14;
  animation: orb-float 10s ease-in-out infinite;
  will-change: transform;
}
.hero__orb--1 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, #7c3aed, transparent 70%);
  top: -200px; right: -150px;
}
.hero__orb--2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  bottom: -100px; left: -150px;
  animation-delay: -3.5s;
}
.hero__orb--3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #ec4899, transparent 70%);
  top: 40%; left: 40%;
  animation-delay: -7s;
  opacity: 0.09;
}

@keyframes orb-float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(24px, -32px) scale(1.06); }
  66%       { transform: translate(-20px, 18px) scale(0.94); }
}

.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, black 30%, transparent 100%);
}

/* Content */
.hero__content {
  position: relative; z-index: 1;
  max-width: 800px;
  text-align: center;
}

.hero__badge {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--font-display);
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
  padding: var(--s2) var(--s4);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  backdrop-filter: blur(12px);
  margin-bottom: var(--s6);
}

.hero__badge-pulse {
  width: 8px; height: 8px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  50%       { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: var(--s6);
}
.hero__title-line {
  display: block;
  font-size: clamp(20px, 3vw, 28px);
  color: var(--text-2); font-weight: 400;
  margin-bottom: var(--s2);
}
.hero__name {
  display: block;
  font-size: clamp(48px, 9vw, 96px);
}

.hero__subtitle {
  font-size: clamp(16px, 2.5vw, 22px);
  color: var(--text-2);
  min-height: 2em;
  margin-bottom: var(--s10);
  overflow: visible;
  word-break: keep-all;
  white-space: normal;
}

.typewriter::after {
  content: '|';
  animation: blink 1s step-end infinite;
  color: var(--accent-2);
  margin-left: 1px;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.hero__actions {
  display: flex; flex-wrap: wrap; gap: var(--s3);
  justify-content: center;
  margin-bottom: var(--s12);
}

.hero__stats {
  display: flex; align-items: center; gap: var(--s8);
  justify-content: center;
  flex-wrap: wrap;
}
.hero__stat {
  text-align: center;
  font-family: var(--font-display);
}
.hero__stat-num {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  background: var(--gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero__stat-label {
  display: block;
  font-size: 12px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-top: var(--s1);
}
.hero__stat-div {
  width: 1px; height: 40px;
  background: var(--glass-border);
}

/* Scroll indicator */
.hero__scroll {
  position: absolute; bottom: var(--s10); left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  gap: var(--s2); z-index: 1;
  animation: float-up 2.5s ease-in-out infinite;
}
@keyframes float-up {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(-8px); }
}

.hero__scroll-mouse {
  width: 24px; height: 38px;
  border: 1.5px solid var(--glass-border-hover);
  border-radius: 12px;
  display: flex; justify-content: center;
  padding-top: 6px;
}
.hero__scroll-wheel {
  width: 4px; height: 8px;
  background: var(--accent-2);
  border-radius: var(--r-full);
  animation: scroll-wheel 2s ease-in-out infinite;
}
@keyframes scroll-wheel {
  0%   { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(14px); opacity: 0; }
}

/* ═══════════════════════════════════════════════
   ABOUT
═══════════════════════════════════════════════ */
.about {
  padding: var(--s24) 0;
}

.about__grid {
  display: grid;
  gap: var(--s10);
}
@media (min-width: 768px) {
  .about__grid { grid-template-columns: 1fr 1fr; gap: var(--s16); }
}

.about__lead {
  font-size: clamp(17px, 2vw, 20px);
  color: var(--text-1);
  line-height: 1.65;
  margin-bottom: var(--s5);
}
.about__text p:not(.about__lead) {
  color: var(--text-2);
  line-height: 1.75;
}

.about__skills-title {
  font-family: var(--font-display);
  font-size: 14px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-3);
  margin-bottom: var(--s5);
}

.skills-wrap {
  display: flex; flex-wrap: wrap; gap: var(--s2);
}

.skill-tag {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 500;
  padding: var(--s2) var(--s4);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-full);
  color: var(--text-2);
  transition: background var(--dur-fast), border-color var(--dur-fast),
              color var(--dur-fast), transform var(--dur-fast);
  cursor: default;
}
.skill-tag:hover {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(168, 85, 247, 0.4);
  color: var(--text-1);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════
   PROJECTS / GALLERY
═══════════════════════════════════════════════ */
.projects {
  padding: var(--s24) 0;
  background: linear-gradient(180deg, transparent 0%, rgba(124,58,237,0.03) 50%, transparent 100%);
}

/* Filter bar */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: var(--s2);
  margin-bottom: var(--s12);
}

.filter-btn {
  font-family: var(--font-display);
  font-size: 13px; font-weight: 500;
  padding: 8px 18px;
  border-radius: var(--r-full);
  color: var(--text-2);
  border: 1px solid var(--glass-border);
  background: var(--glass);
  min-height: 44px;
  transition: all var(--dur-normal) var(--ease-out);
  white-space: nowrap;
}
.filter-btn:hover {
  color: var(--text-1);
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
}
.filter-btn.active {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3);
}

/* Gallery grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: var(--s6);
}

/* Gallery card */
.gallery-card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--dur-normal) var(--ease-out),
              box-shadow var(--dur-normal) var(--ease-out),
              border-color var(--dur-normal) var(--ease-out);
  will-change: transform;

  /* Reveal animation starts hidden */
  opacity: 0;
  transform: translateY(24px) scale(0.98);
}
.gallery-card.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.gallery-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: var(--glow), var(--shadow-lg);
  border-color: var(--glass-border-hover);
}
.gallery-card:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
}

/* Thumbnail area */
.gallery-card__thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-2);
}

.gallery-card__img,
.gallery-card__video-poster {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.gallery-card:hover .gallery-card__img,
.gallery-card:hover .gallery-card__video-poster { transform: scale(1.06); }

/* Gradient placeholder when no media */
.gallery-card__placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}

/* Play button for videos */
.gallery-card__play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.gallery-card__play-icon {
  width: 52px; height: 52px;
  background: rgba(0,0,0,0.55);
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  transition: transform var(--dur-normal) var(--ease-out),
              background var(--dur-normal) var(--ease-out);
}
.gallery-card:hover .gallery-card__play-icon {
  transform: scale(1.1);
  background: rgba(124, 58, 237, 0.6);
}

/* Hover overlay */
.gallery-card__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top,
    rgba(8,8,8,0.92) 0%,
    rgba(8,8,8,0.5) 40%,
    transparent 100%);
  display: flex; align-items: flex-end;
  padding: var(--s5);
  opacity: 0;
  transition: opacity var(--dur-normal) var(--ease-out);
}
.gallery-card:hover .gallery-card__overlay { opacity: 1; }

.gallery-card__overlay-open {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--font-display);
  font-size: 13px; font-weight: 600;
  color: #fff;
  padding: 8px 16px;
  background: var(--gradient);
  border-radius: var(--r-full);
  transform: translateY(8px);
  transition: transform var(--dur-normal) var(--ease-out);
  pointer-events: none;
}
.gallery-card:hover .gallery-card__overlay-open { transform: translateY(0); }

/* Card meta */
.gallery-card__meta {
  padding: var(--s4) var(--s5);
}
.gallery-card__title {
  font-family: var(--font-display);
  font-size: 15px; font-weight: 600;
  color: var(--text-1);
  margin-bottom: var(--s2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-card__tags {
  display: flex; flex-wrap: wrap; gap: var(--s1);
}
.gallery-card__tag {
  font-size: 11px; font-weight: 500;
  color: var(--text-3);
  padding: 2px 8px;
  background: var(--bg-2);
  border-radius: var(--r-full);
  border: 1px solid var(--glass-border);
}

.gallery__empty {
  text-align: center;
  color: var(--text-3);
  font-size: 15px;
  padding: var(--s20) 0;
}

/* ═══════════════════════════════════════════════
   CONTACT
═══════════════════════════════════════════════ */
.contact { padding: var(--s24) 0; }

.contact__grid {
  display: grid; gap: var(--s10);
}
@media (min-width: 768px) {
  .contact__grid { grid-template-columns: 1fr 1fr; gap: var(--s16); align-items: start; }
}

.contact__lead {
  font-size: clamp(16px, 2vw, 19px);
  color: var(--text-2); line-height: 1.7;
  margin-bottom: var(--s8);
}

.contact__email {
  display: inline-flex; align-items: center; gap: var(--s3);
  font-family: var(--font-display);
  font-size: clamp(16px, 2vw, 20px);
  font-weight: 600;
  color: var(--text-1);
  padding: var(--s4) var(--s6);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  backdrop-filter: blur(12px);
  transition: all var(--dur-normal) var(--ease-out);
}
.contact__email:hover {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.2);
}

.contact__social-label {
  font-family: var(--font-display);
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-3);
  margin-bottom: var(--s5);
}

.social-links {
  display: flex; flex-direction: column; gap: var(--s3);
}

.social-link {
  display: inline-flex; align-items: center; gap: var(--s3);
  font-family: var(--font-display);
  font-size: 15px; font-weight: 500;
  color: var(--text-2);
  padding: var(--s3) var(--s5);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  min-height: 48px;
  transition: all var(--dur-normal) var(--ease-out);
  width: fit-content;
}
.social-link:hover {
  color: var(--text-1);
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
  transform: translateX(4px);
}

/* ═══════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════ */
.footer {
  border-top: 1px solid var(--glass-border);
  padding: var(--s8) 0;
}
.footer__copy {
  text-align: center;
  font-size: 13px; color: var(--text-3);
}

/* ═══════════════════════════════════════════════
   LIGHTBOX
═══════════════════════════════════════════════ */
.lightbox {
  position: fixed; inset: 0;
  z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
  padding: var(--s6);
}
.lightbox[hidden] { display: none; }

.lightbox__backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 4, 4, 0.92);
  backdrop-filter: blur(16px);
  animation: fade-in var(--dur-normal) var(--ease-out);
}

@keyframes fade-in   { from { opacity: 0; } to { opacity: 1; } }
@keyframes scale-in  { from { opacity: 0; transform: scale(0.93); } to { opacity: 1; transform: scale(1); } }

.lightbox__stage {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  max-width: min(90vw, 1100px);
  max-height: 88vh;
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  overflow: hidden;
  animation: scale-in var(--dur-slow) var(--ease-out);
  box-shadow: var(--shadow-lg), var(--glow);
}

.lightbox__media {
  flex: 1; min-height: 0;
  overflow: hidden;
  background: var(--bg-0);
  display: flex; align-items: center; justify-content: center;
}
.lightbox__media.has-video {
  align-items: flex-start;
}
.lightbox__media img {
  max-width: 100%; max-height: 72vh;
  object-fit: contain;
  display: block;
}

/* ── Custom video player ── */
.vid-wrap {
  display: flex;
  flex-direction: column;
  width: min(520px, 90vw);
  max-height: 65vh;
  background: #000;
  border-radius: var(--r-md);
  overflow: hidden;
}
.vid-wrap video {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}
.vid-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(10, 0, 20, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--glass-border);
}
.vid-play,
.vid-fs {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  transition: background var(--dur-fast) var(--ease-out);
}
.vid-play {
  background: var(--purple);
  font-size: 11px;
}
.vid-play:hover { background: var(--purple-light); }
.vid-fs {
  background: rgba(255,255,255,0.08);
  font-size: 14px;
}
.vid-fs:hover { background: rgba(255,255,255,0.15); }
.vid-seek {
  flex: 1;
  height: 4px;
  accent-color: var(--purple);
  border-radius: 2px;
  cursor: none;
}
.vid-time {
  flex-shrink: 0;
  font-size: 12px;
  font-family: var(--font-body);
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  min-width: 76px;
  text-align: right;
}

.lightbox__info {
  padding: var(--s5) var(--s6);
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}
.lightbox__title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 700;
  color: var(--text-1);
  margin-bottom: var(--s2);
}
.lightbox__desc {
  font-size: 14px; color: var(--text-2);
  line-height: 1.6;
  margin-bottom: var(--s3);
}
.lightbox__tags {
  display: flex; flex-wrap: wrap; gap: var(--s1);
}
.lightbox__tag {
  font-size: 12px; color: var(--accent-2);
  padding: 2px 10px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: var(--r-full);
}

/* Nav buttons */
/* Counter "2 / 5" */
.lightbox__counter {
  position: absolute; top: var(--s4); left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  z-index: 2;
  white-space: nowrap;
  pointer-events: none;
}
.lightbox__counter:empty { display: none; }

/* "N фото" badge on gallery cards */
.gallery-card__badge {
  position: absolute; top: var(--s3); right: var(--s3);
  display: flex; align-items: center; gap: 4px;
  font-family: var(--font-display);
  font-size: 11px; font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 3px 8px;
  border-radius: var(--r-full);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  pointer-events: none;
  z-index: 2;
}

.lightbox__close,
.lightbox__nav {
  position: fixed; z-index: 2;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(20,20,20,0.9);
  border: 1px solid var(--glass-border);
  color: var(--text-1);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(12px);
  transition: background var(--dur-fast), transform var(--dur-fast), border-color var(--dur-fast);
}
.lightbox__close:hover,
.lightbox__nav:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
  transform: scale(1.08);
}
.lightbox__close { top: var(--s5); right: var(--s5); }
.lightbox__nav--prev { left: var(--s4);  top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: var(--s4); top: 50%; transform: translateY(-50%); }
.lightbox__nav--prev:hover { transform: translateY(-50%) scale(1.08); }
.lightbox__nav--next:hover { transform: translateY(-50%) scale(1.08); }

/* ═══════════════════════════════════════════════
   PLACEHOLDER GRADIENTS (per category)
═══════════════════════════════════════════════ */
.ph-design { background: linear-gradient(135deg, #1a0a2e 0%, #2d1b69 50%, #1a0a2e 100%); }
.ph-dev    { background: linear-gradient(135deg, #031320 0%, #0c2a40 50%, #031320 100%); }
.ph-video  { background: linear-gradient(135deg, #1a0515 0%, #3b0764 50%, #1a0515 100%); }
.ph-photo  { background: linear-gradient(135deg, #130a02 0%, #362009 50%, #130a02 100%); }

/* ── Responsive ── */
@media (max-width: 480px) {
  .hero__stats { gap: var(--s5); }
  .hero__stat-div { display: none; }
  .lightbox__nav { display: none; }
}
