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

:root {
  --bg-deep: #030308;
  --bg-surface: #0a0a10;
  --text-primary: #f0f0f2;
  --text-secondary: #9a9aac;
  --text-muted: #5a5a6e;
  --accent: #8b6fcf;
  --accent-subtle: #2a2340;
  --transition-premium: cubic-bezier(0.2, 0.9, 0.4, 1.1);
  --navbar-bg: rgba(3, 3, 8, 0.55);
  --border-light: rgba(255, 255, 255, 0.06);
}

/* BASE */
.page {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  line-height: 1.35;
  overflow-x: hidden;
}

.page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0MDAiIGhlaWdodD0iNDAwIj48ZmlsdGVyIGlkPSJmIj48ZmVUdXJidWxlbmNlIHR5cGU9ImZyYWN0YWxOb2lzZSIgYmFzZUZyZXF1ZW5jeT0iLjUiIC8+PC9maWx0ZXI+PHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsdGVyPSJ1cmwoI2YpIiBvcGFjaXR5PSIwLjAxNSIvPjwvc3ZnPg==');
  pointer-events: none;
  opacity: 0.3;
  z-index: 1000;
}

html {
  scroll-behavior: smooth;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 64px;
}

/* HEADER */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(20px);
  background: var(--navbar-bg);
  padding: 24px 0;
  transition: background 0.3s ease;
}

.header__container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.header__logo {
  font-family: 'Space Grotesk', monospace;
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #fff;
  text-decoration: none;
  transition: color 0.3s ease;
  z-index: 1002;
}

.header__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1002;
}

/* NAVIGATION */
.nav__list {
  display: flex;
  gap: 56px;
  list-style: none;
}

.nav__link {
  position: relative;
  text-decoration: none;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  transition: color 0.2s;
  padding-bottom: 6px;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: #ffffff;
  transition: width 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.nav__link:hover::after,
.nav__link.active::after {
  width: 100%;
}

.nav__link:hover {
  color: #fff;
}

/* THEME TOGGLE */
.theme-toggle {
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 6px;
  border-radius: 50%;
  font-size: 1rem;
  color: var(--text-secondary);
}

/* LANG TOGGLE */
.lang-toggle {
  cursor: pointer;
  background: transparent;
  padding: 6px 12px;
  border-radius: 40px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
}

.lang-toggle:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

/* BURGER */
.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 20px;
  cursor: pointer;
  background: transparent;
  border: none;
  z-index: 1002;
}

.burger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #fff;
  transition: all 0.3s ease;
}

.burger-btn.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.burger-btn.active span:nth-child(2) {
  opacity: 0;
}

.burger-btn.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* MOBILE MENU */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 70%;
  max-width: 320px;
  height: 100vh;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  z-index: 1001;
  padding: 100px 40px 40px;
  transition: right 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  box-shadow: -5px 0 30px rgba(0, 0, 0, 0.3);
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu__close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1003;
}

.mobile-menu__close::before,
.mobile-menu__close::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background-color: var(--text-primary);
  transition: transform 0.2s;
}

.mobile-menu__close::before {
  transform: rotate(45deg);
}

.mobile-menu__close::after {
  transform: rotate(-45deg);
}

.mobile-menu__close:hover::before,
.mobile-menu__close:hover::after {
  background-color: var(--accent);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.mobile-nav__link {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 500;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  transition: color 0.2s;
}

.mobile-nav__link:hover {
  color: var(--accent);
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.mobile-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* HERO */
.hero {
  min-height: 95vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero__canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: auto;
  display: block;
}

.hero__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at 30% 40%,
    rgba(3, 3, 8, 0.2) 0%,
    rgba(3, 3, 8, 0.85) 90%
  );
  z-index: 1;
  pointer-events: none;
  backdrop-filter: blur(3px);
}

.hero__content {
  position: relative;
  z-index: 3;
  padding: 80px 0;
  overflow: hidden;
}

.hero__headline {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 700;
  line-height: 1.02;
  max-width: 900px;
  text-align: center;
  margin: 0 auto;
}

.hero__typewriter {
  display: inline-block;
  color: var(--accent);
  position: relative;
}

.hero__typewriter .cursor {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: var(--accent);
  margin-left: 3px;
  animation: blink 0.8s step-end infinite;
  vertical-align: inherit;
}

.hero__subtitle {
  margin-top: 32px;
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 100%;
  line-height: 1.5;
  text-align: center;
}

.hero__actions {
  margin-top: 56px;
  display: flex;
  gap: 28px;
  align-items: center;
  justify-content: center;
}

/* BUTTONS */
.btn {
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition: all 0.25s ease;
  display: inline-block;
}

.btn--primary {
  background: var(--accent);
  color: #ffff;
  padding: 14px 40px;
  border-radius: 0;
}

.btn--primary:hover {
  background: #a086e0;
}

.btn--text {
  color: var(--text-primary);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 6px;
}

/* SECTION LABEL */
.section-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 32px;
  display: block;
  font-family: 'Space Grotesk', monospace;
  min-height: 1.2rem;
}

.section-label .cursor {
  display: inline-block;
  width: 2px;
  height: 12px;
  background-color: var(--accent);
  margin-left: 4px;
  animation: blink 0.8s step-end infinite;
  vertical-align: middle;
  margin-top: -4px;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* FEATURED SECTION */
.section-featured {
  padding: 80px 0 20px;
  position: relative;
  background: linear-gradient(
    180deg,
    var(--bg-deep) 0%,
    rgba(139, 111, 207, 0.06) 5%,
    var(--bg-surface) 12%,
    var(--bg-surface) 88%,
    rgba(139, 111, 207, 0.06) 95%,
    var(--bg-deep) 100%
  );
}

.section-featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent),
    var(--accent),
    transparent
  );
  opacity: 0.4;
  pointer-events: none;
}

.featured-item {
  margin-bottom: 120px;
}

.featured-item__media {
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #0c0c14;
}

.featured-item__image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 1.2s var(--transition-premium);
}

.featured-item:hover .featured-item__image {
  transform: scale(1.02);
}

.featured-item__details {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 24px;
}

.featured-item__title {
  font-size: 1.6rem;
  font-weight: 500;
}

.featured-item__meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  letter-spacing: 0.05em;
}

.featured-item__description {
  max-width: 480px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.5;
}

.featured-item__link {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 4px;
  font-size: 1rem;
}

/* PORTFOLIO SECTION */
.section-portfolio {
  padding-top: 100px;
  position: relative;
  background: linear-gradient(
    180deg,
    var(--bg-deep) 0%,
    rgba(139, 111, 207, 0.06) 5%,
    var(--bg-surface) 12%,
    var(--bg-surface) 88%,
    rgba(139, 111, 207, 0.06) 95%,
    var(--bg-deep) 100%
  );
}

.section-portfolio::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent),
    var(--accent),
    transparent
  );
  opacity: 0.4;
  pointer-events: none;
}

/* FILTER BAR */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 48px 0 40px;
  border-bottom: 1px solid rgba(139, 111, 207, 0.2);
  padding-bottom: 16px;
}

.filter-bar__btn {
  background: transparent;
  border: none;
  padding: 8px 24px;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  cursor: pointer;
  transition: 0.2s;
  font-family: 'Inter', sans-serif;
}

.filter-bar__btn--active {
  color: var(--accent);
  background: rgba(139, 111, 207, 0.12);
}

.filter-bar__btn:hover {
  color: var(--text-primary);
}

/* PROJECTS GRID */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 32px;
  margin-top: 24px;
}

.project-card {
  background: rgba(10, 10, 16, 0.6);
  backdrop-filter: blur(2px);
  transition: all 0.4s var(--transition-premium);
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-6px);
  background: rgba(20, 20, 32, 0.8);
}

.project-card__media {
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #12121a;
}

.project-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s;
}

.project-card:hover .project-card__image {
  transform: scale(1.03);
}

.project-card__info {
  padding: 20px 20px 28px;
}

.project-card__category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 8px;
}

.project-card__title {
  font-size: 1.2rem;
  margin-bottom: 8px;
  font-weight: 500;
}

.project-card__description {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 30px;
}

.project-card__link {
  font-size: 1rem;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
  padding-bottom: 3px;
}

.project-card.hidden {
  display: none;
}

.projects-actions {
  text-align: center;
  margin: 50px 0px;
}

.btn-more {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  padding: 12px 32px;
  transition: 0.2s;
}

.btn-more:hover {
  color: var(--accent);
}

/* ABOUT SECTION */
.section-about {
  padding: 100px 0;
  position: relative;
  background: linear-gradient(
    180deg,
    var(--bg-deep) 0%,
    rgba(139, 111, 207, 0.06) 5%,
    var(--bg-surface) 12%,
    var(--bg-surface) 88%,
    rgba(139, 111, 207, 0.06) 95%,
    var(--bg-deep) 100%
  );
}

.section-about::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent),
    var(--accent),
    transparent
  );
  opacity: 0.4;
  pointer-events: none;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 80px;
  align-items: center;
}

.about__text {
  font-size: 1.2rem;
  line-height: 1.5;
  margin-bottom: 20px;
  color: var(--text-secondary);
}

.about__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  list-style: none;
}

.about__tag {
  background: rgba(139, 111, 207, 0.08);
  padding: 6px 16px;
  font-size: 0.75rem;
  color: var(--accent);
}

.about__photo {
  width: 280px;
  flex-shrink: 0;
}

.about__photo-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 30px;
  overflow: hidden;
  position: relative;
}

.about__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.2) contrast(1.05);
  transition: transform 0.6s var(--transition-premium);
}

.about__photo-frame:hover .about__image {
  transform: scale(1.02);
}

/* CONTACT SECTION */
.section-contact {
  padding: 80px 0 140px;
  text-align: center;
  position: relative;
  background: radial-gradient(
    ellipse at 50% 20%,
    rgba(139, 111, 207, 0.18) 0%,
    rgba(139, 111, 207, 0.04) 40%,
    var(--bg-deep) 85%
  );
  border-top: 1px solid rgba(139, 111, 207, 0.25);
  border-bottom: 1px solid rgba(139, 111, 207, 0.25);
}

.section-contact::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at 50% 100%,
    rgba(139, 111, 207, 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.contact__headline {
  font-size: clamp(2rem, 5vw, 3rem);
  max-width: 720px;
  margin: 48px auto 48px;
  line-height: 1.2;
}

.contact__title {
  display: block;
}

.contact__subtitle {
  display: block;
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-top: 16px;
  font-weight: 400;
}

.contact__links {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.contact__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  padding-bottom: 6px;
  transition: color 0.2s ease;
}

.contact__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.contact__link:hover::after {
  width: 100%;
}

.contact__link:hover {
  color: var(--accent);
}

.contact__link i {
  font-size: 1rem;
  color: var(--text-secondary);
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}

.contact__link:hover i {
  color: var(--accent);
}

/* FOOTER */
.footer {
  padding: 60px 0 80px;
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* ANIMATIONS */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.9s var(--transition-premium),
    transform 0.9s ease;
}

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

/* LIGHT THEME */
.page.light {
  --bg-deep: #f6f6f9;
  --bg-surface: #ffffff;
  --text-primary: #111114;
  --text-secondary: #4a4a5a;
  --accent: #6b4dae;
  --navbar-bg: rgba(197, 197, 197, 0.55);
  --border-light: rgba(0, 0, 0, 0.06);
}

.page.light .hero__overlay {
  background: radial-gradient(
    ellipse at 30% 40%,
    rgba(246, 246, 249, 0.2) 0%,
    rgba(246, 246, 249, 0.85) 90%
  );
}

.page.light .project-card {
  background: rgba(255, 255, 255, 0.7);
}

.page.light .nav__link {
  color: #111114;
}

.page.light .nav__link::after {
  background: #111114;
}

.page.light .header__logo,
.page.light .theme-toggle i {
  color: #111114;
}

.page.light .burger-btn span {
  background-color: #111114;
}

.page.light .mobile-menu {
  background: rgba(255, 255, 255, 0.95);
}

.page.light .mobile-menu__close::before,
.page.light .mobile-menu__close::after {
  background-color: var(--text-primary);
}

.page.light .contact__link::after {
  background: var(--accent);
}

.page.light .contact__link:hover {
  color: var(--accent);
}

.page.light .section-featured,
.page.light .section-portfolio,
.page.light .section-about {
  background: linear-gradient(
    180deg,
    var(--bg-deep) 0%,
    #ffffff 10%,
    #ffffff 90%,
    var(--bg-deep) 100%
  );
}

.page.light .section-featured::before,
.page.light .section-portfolio::before,
.page.light .section-about::before {
  opacity: 0.2;
}

.page.light .section-contact {
  background: radial-gradient(
    ellipse at 50% 20%,
    rgba(107, 77, 174, 0.08) 0%,
    var(--bg-deep) 85%
  );
  border-top: 1px solid rgba(107, 77, 174, 0.15);
  border-bottom: 1px solid rgba(107, 77, 174, 0.15);
}

.page.light .section-contact::after {
  display: none;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .container {
    padding: 0 32px;
  }

  .header__container {
    padding: 0 32px;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
  }

  .about__photo {
    width: 240px;
    margin: 0 auto;
  }

  .about__tags {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .nav__list {
    display: none;
  }

  .burger-btn {
    display: flex;
  }

  .featured-item__details {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero__headline {
    font-size: 2.5rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .contact__headline {
    margin-top: 32px;
  }

  .contact__links {
    gap: 28px;
  }

  .header__logo {
    font-size: 1.1rem;
  }

  .featured-item {
    margin-bottom: 50px;
  }

  .section-portfolio {
    padding-top: 50px;
  }

  .projects-actions {
    margin: 25px 0px;
  }

  .section-about {
    padding: 50px 0;
    padding-bottom: 0;
  }

  .about-grid {
    text-align: left;
  }

  .about__image {
    width: 70%;
    height: 70%;
  }

  .about__photo-frame {
    text-align: center;
  }

  .contact__link {
    font-size: 0.8rem;
  }

  .contact__link i {
    font-size: 0.9rem;
  }

  .filter-bar__btn {
    font-size: 0.875rem;
  }

  .featured-item__meta {
    padding-top: 10px;
  }

  .section-contact,
  .footer {
    padding: 40px 0;
  }
}

@media (max-width: 550px) {
  .hero__actions {
    flex-direction: column;
  }

  .project-card__category {
    font-size: 0.75rem;
  }

  .lang-toggle {
    font-size: 0.875rem;
  }

  .header__controls {
    gap: 16px;
  }

  .about__text {
    font-size: 1rem;
  }
}
