*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-elevated: #1a1a26;
  --text: #f0f0f5;
  --text-muted: #9494a8;
  --accent: #ff3b3b;
  --accent-glow: rgba(255, 59, 59, 0.35);
  --redring: #e63900;
  --vk: #0077ff;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  --font: 'Manrope', system-ui, sans-serif;
  --transition: 0.25s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  background-image: url('../images/bg.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.45);
  pointer-events: none;
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: min(1200px, 92vw);
  margin: 0 auto;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.55);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.logo__img {
  height: 72px;
  width: auto;
  display: block;
}

.logo__img--footer {
  height: 80px;
}

.logo__live {
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-glow);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.85); }
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}

.nav a:hover {
  color: var(--text);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn--sm {
  padding: 0.55rem 1.1rem;
  font-size: 0.85rem;
}

.btn--lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 24px var(--accent-glow);
}

.btn--primary:hover {
  background: #ff5555;
  transform: translateY(-2px);
}

.btn--outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.btn--outline:hover {
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
}

.btn--redring {
  background: #0a0a0f;
  color: #fff;
  border-color: rgba(230, 57, 0, 0.55);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.btn--redring:hover {
  background: #14141c;
  border-color: var(--redring);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(230, 57, 0, 0.25);
}

.btn--vk {
  background: var(--vk);
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 119, 255, 0.3);
}

.btn--vk:hover {
  background: #1a85ff;
  transform: translateY(-2px);
}

.btn--with-logo {
  gap: 0.55rem;
}

.btn__logo {
  height: 22px;
  width: auto;
  display: block;
  object-fit: contain;
}

.btn__logo--lg {
  height: 28px;
}

.btn--outline .btn__logo {
  height: 20px;
}

/* Hero */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 88px;
}

.hero__bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero__bg-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: heroZoom 20s ease-in-out infinite alternate;
}

@keyframes heroZoom {
  from { transform: scale(1); }
  to { transform: scale(1.06); }
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(10, 10, 15, 0.55) 0%, rgba(10, 10, 15, 0.25) 55%, rgba(10, 10, 15, 0.4) 100%),
    linear-gradient(to top, rgba(10, 10, 15, 0.55) 0%, transparent 45%);
}

.hero__scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(255, 255, 255, 0.008) 2px,
    rgba(255, 255, 255, 0.008) 4px
  );
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
}

.hero__content {
  position: relative;
  z-index: 2;
  padding: 4rem 0 6rem;
  max-width: 760px;
}

.hero__badge {
  display: inline-block;
  padding: 0.4rem 1rem;
  background: rgba(255, 59, 59, 0.15);
  border: 1px solid rgba(255, 59, 59, 0.3);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #ff6b6b;
  margin-bottom: 1.5rem;
  letter-spacing: 0.02em;
}

.hero__title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.hero__text {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 560px;
}

.hero__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollLine 2s infinite;
}

@keyframes scrollLine {
  0% { opacity: 0; transform: scaleY(0); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); }
  100% { opacity: 0; transform: scaleY(0); transform-origin: bottom; }
}

/* Stats */
.stats {
  background: rgba(18, 18, 26, 0.55);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0;
}

.stats__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat__value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.3rem;
}

.stat__label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Sections */
.section {
  padding: 6rem 0;
}

.section--dark {
  background: rgba(18, 18, 26, 0.55);
  backdrop-filter: blur(8px);
}

.section--contact {
  padding-bottom: 4rem;
}

.section__header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 3.5rem;
}

.section__tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.section__desc {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.section__desc a {
  color: var(--vk);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Services */
.services__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: rgba(18, 18, 26, 0.65);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  transition: all var(--transition);
}

.section:not(.section--dark) .service-card {
  background: rgba(26, 26, 38, 0.65);
}

.service-card:hover {
  border-color: rgba(255, 59, 59, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.service-card__icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.service-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Features */
.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.feature {
  padding: 1.5rem;
  border-left: 2px solid var(--accent);
}

.feature__num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
}

.feature h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.feature p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Portfolio */
.portfolio__featured {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.portfolio__featured--reverse {
  grid-template-columns: 1fr 1.35fr;
}

.portfolio-item--featured {
  aspect-ratio: 16 / 10;
  min-height: 320px;
}

.portfolio-item--featured .portfolio-item__caption {
  opacity: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, transparent 65%);
}

.portfolio__featured-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portfolio__featured-info {
  background: rgba(26, 26, 38, 0.65);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  flex: 1;
}

.portfolio__featured-info h3 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0.4rem 0 0.85rem;
  letter-spacing: -0.02em;
}

.portfolio__featured-info p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.55;
}

.portfolio__featured-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.portfolio__featured-thumbs img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.portfolio__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.portfolio-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
}

.portfolio-item--wide {
  grid-column: span 2;
  aspect-ratio: 16 / 7;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-item:hover img {
  transform: scale(1.06);
}

.portfolio-item figcaption,
.portfolio-item__caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition);
}

.portfolio-item:hover figcaption,
.portfolio-item:hover .portfolio-item__caption {
  opacity: 1;
}

.portfolio-item__tag {
  display: inline-block;
  width: fit-content;
  padding: 0.2rem 0.6rem;
  background: var(--accent);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.portfolio-item strong,
.portfolio-item__caption strong {
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.portfolio-item p,
.portfolio-item__caption p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
}

/* Gallery */
.gallery__toggle {
  margin-top: 1.5rem;
}

.gallery__toggle-icon {
  display: inline-block;
  font-size: 1.25rem;
  transition: transform var(--transition);
}

.gallery__toggle[aria-expanded="true"] .gallery__toggle-icon {
  transform: rotate(180deg);
}

.gallery__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
}

.gallery__grid[hidden] {
  display: none;
}

.gallery__status {
  grid-column: 1 / -1;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 1rem;
  margin: 0;
}

.gallery__item {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  background: transparent;
  font: inherit;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.gallery__item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.gallery__item:hover img {
  transform: scale(1.06);
}

.gallery__item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 15, 0.15);
  opacity: 0;
  transition: opacity var(--transition);
}

.gallery__item:hover::after {
  opacity: 1;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
  padding: 2rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__img {
  max-width: min(1100px, 92vw);
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: #fff;
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  background: rgba(255, 59, 59, 0.35);
}

.lightbox__close {
  top: 1.25rem;
  right: 1.25rem;
  font-size: 2rem;
}

.lightbox__prev {
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__next {
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
}

/* CTA Banner */
.cta-banner {
  background: linear-gradient(135deg, rgba(26, 8, 8, 0.55) 0%, rgba(42, 16, 16, 0.5) 50%, rgba(26, 8, 8, 0.55) 100%);
  border-top: 1px solid rgba(255, 59, 59, 0.2);
  border-bottom: 1px solid rgba(255, 59, 59, 0.2);
  padding: 4rem 0;
}

.cta-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.cta-banner__text h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.cta-banner__text p {
  color: var(--text-muted);
  max-width: 480px;
}

.cta-banner__buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* About */
.about {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: start;
}

.about__content p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 1.02rem;
}

.about__list {
  list-style: none;
  margin-top: 1.5rem;
}

.about__list li {
  padding: 0.6rem 0;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-muted);
}

.about__list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.about__card {
  background: rgba(18, 18, 26, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.about__card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.about__card-live {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1.5rem;
  letter-spacing: 0.1em;
}

.about__card blockquote {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.5;
  font-style: italic;
  position: relative;
  z-index: 1;
}

.about__card-meta {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

/* Contact */
.contact__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.contact-card {
  background: rgba(18, 18, 26, 0.6);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: all var(--transition);
}

.contact-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.contact-card--vk:hover {
  border-color: rgba(0, 119, 255, 0.4);
  background: rgba(0, 119, 255, 0.08);
}

.contact-card--mail:hover {
  border-color: rgba(255, 59, 59, 0.35);
  background: rgba(255, 59, 59, 0.06);
}

.contact-card--redring:hover {
  border-color: rgba(230, 57, 0, 0.4);
  background: rgba(230, 57, 0, 0.08);
}

.contact-card__with-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.contact-card__logo {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.contact-card__label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.contact-card strong {
  font-size: 1.05rem;
}

.contact-card--static {
  cursor: default;
}

/* Footer */
.footer {
  background: rgba(18, 18, 26, 0.7);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  padding: 3rem 0 2rem;
}

.footer__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
}

.footer__brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.logo--footer {
  font-size: 1rem;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.footer__links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer__links a:hover {
  color: var(--text);
}

.footer__redring {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.footer__rr-logo {
  height: 22px;
  width: auto;
  object-fit: contain;
}

.footer__copy {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Mobile nav */
.nav.open {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 88px;
  left: 0;
  right: 0;
  background: rgba(10, 10, 15, 0.98);
  padding: 2rem;
  gap: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.burger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.burger.active span:nth-child(2) {
  opacity: 0;
}

.burger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Responsive */
@media (max-width: 900px) {
  .nav {
    display: none;
  }

  .burger {
    display: flex;
  }

  .stats__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .portfolio__featured {
    grid-template-columns: 1fr;
  }

  .portfolio__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .portfolio-item--wide {
    grid-column: span 2;
  }

  .about {
    grid-template-columns: 1fr;
  }

  .cta-banner__inner {
    flex-direction: column;
    text-align: center;
  }

  .cta-banner__buttons {
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .lightbox__prev,
  .lightbox__next {
    width: 40px;
    height: 40px;
    font-size: 1.4rem;
  }

  .logo__img {
    height: 56px;
  }

  .header__actions .btn--outline,
  .header__actions .btn--vk.btn--sm {
    display: none;
  }

  .hero__buttons {
    flex-direction: column;
  }

  .hero__buttons .btn {
    width: 100%;
  }

  .stats__grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .portfolio__grid {
    grid-template-columns: 1fr;
  }

  .portfolio-item--wide {
    grid-column: span 1;
    aspect-ratio: 4 / 3;
  }

  .footer__inner {
    grid-template-columns: 1fr;
  }
}
