@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-primary: #08080c;
  --bg-secondary: #121217;
  --bg-tertiary: #191922;
  --accent: #FF007F;
  --accent-hover: #D80073;
  --accent-glow: rgba(255, 0, 127, 0.15);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(255, 255, 255, 0.06);
  --transition-fast: all 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: all 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background-color: rgba(8, 8, 12, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 4%;
  will-change: transform;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  position: relative;
}

.logo:hover {
  color: var(--accent);
  text-shadow: 0 0 15px var(--accent);
}

nav {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-link:hover, .nav-link.active {
  color: var(--accent);
  text-shadow: 0 0 8px var(--accent-glow);
}

.hero {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 4% 60px 4%;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-weight: 300;
}

.hero-scroll {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  cursor: pointer;
  animation: bounce 2s infinite;
  will-change: transform;
}

.hero-scroll svg {
  width: 20px;
  height: 20px;
  fill: var(--text-secondary);
  transition: var(--transition-fast);
}

.hero-scroll:hover {
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.hero-scroll:hover svg {
  fill: var(--accent);
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40% {
    transform: translate3d(0, -8px, 0);
  }
  60% {
    transform: translate3d(0, -4px, 0);
  }
}

.portfolio-section {
  padding: 60px 4%;
}

.filters-wrapper {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.filter-btn {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 10px 24px;
  border-radius: 100px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background-color: var(--bg-tertiary);
}

.filter-btn.active {
  background-color: var(--accent);
  color: var(--text-primary);
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 32px;
  will-change: transform;
}

.gallery-item {
  background-color: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: var(--transition-normal);
  will-change: transform, opacity;
  opacity: 1;
  transform: scale(1) translate3d(0, 0, 0);
}

.gallery-item:hover {
  transform: scale(1.025) translate3d(0, -4px, 0);
  border-color: rgba(255, 0, 127, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.gallery-item.hidden {
  opacity: 0;
  transform: scale(0.9) translate3d(0, 0, 0);
  pointer-events: none;
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  margin: 0;
  border: none;
  padding: 0;
}

.image-container {
  position: relative;
  width: 100%;
  padding-top: 75%;
  background-color: #0b0b0f;
  overflow: hidden;
}

.gallery-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-normal);
  will-change: transform;
}

.gallery-item:hover .gallery-img {
  transform: scale(1.04);
}

.item-info {
  padding: 24px;
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.item-year {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

.about-section {
  padding: 100px 4%;
  background: 
    linear-gradient(to bottom, #08080c 0%, rgba(8, 8, 12, 0.8) 15%, rgba(8, 8, 12, 0.7) 50%, rgba(8, 8, 12, 0.8) 85%, #08080c 100%),
    url('обо мне.webp') no-repeat center center / cover;
}

.about-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 48px 32px;
  background: rgba(18, 18, 23, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.about-section h2 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 24px;
}

.about-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 0;
}

.contacts-section {
  padding: 80px 4% 120px 4%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.contacts-section h2 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.contacts-section p {
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 500px;
}

.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background-color: var(--accent);
  color: var(--text-primary);
  padding: 16px 36px;
  border-radius: 100px;
  font-size: 1.05rem;
  font-weight: 600;
  box-shadow: 0 8px 30px var(--accent-glow);
  transition: var(--transition-normal);
  will-change: transform;
}

.contact-btn:hover {
  background-color: var(--accent-hover);
  transform: translate3d(0, -2px, 0);
  box-shadow: 0 12px 35px rgba(255, 0, 127, 0.35);
}

.contact-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

footer {
  padding: 40px 4%;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.modal-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(5, 5, 8, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}

.modal-lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  position: relative;
  max-width: 90%;
  max-height: 85%;
  transform: scale(0.95) translate3d(0, 0, 0);
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-lightbox.active .modal-content {
  transform: scale(1) translate3d(0, 0, 0);
}

.modal-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.8);
}

.modal-caption {
  margin-top: 16px;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 500;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 1010;
}

.modal-close:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.modal-close svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.modal-arrow {
  position: absolute;
  top: 50%;
  transform: translate3d(0, -50%, 0);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
  z-index: 1010;
  will-change: transform;
}

.modal-arrow:hover {
  background-color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 15px var(--accent-glow);
}

.modal-arrow svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.modal-arrow.prev {
  left: 40px;
}

.modal-arrow.next {
  right: 40px;
}

.gallery-item.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  header {
    height: 70px;
  }
  
  nav {
    display: none;
  }
  
  .hero {
    padding: 100px 4% 40px 4%;
    min-height: 70vh;
  }
  
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .modal-close {
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
  
  .modal-arrow {
    width: 44px;
    height: 44px;
  }
  
  .modal-arrow.prev {
    left: 12px;
  }
  
  .modal-arrow.next {
    right: 12px;
  }
  
  footer {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}
