/* ============================================
   Vitalik Doyniak - Personal Landing Page
   Premium, minimalistic, conversion-focused
   ============================================ */

/* --- CSS Variables — Premium Dark Theme (Graphite/Anthracite) --- */
:root {
  --color-primary: #3b82f6;
  --color-primary-hover: #60a5fa;
  --color-accent: #f59e0b;
  --color-accent-hover: #fbbf24;
  --color-bg: #1a1a1d;
  --color-bg-soft: #232326;
  --color-bg-alt: #2b2b2f;
  --color-bg-card: #2d2d31;
  --color-text: #f5f5f7;
  --color-text-muted: #94a3b8;
  --color-border: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.5), 0 6px 12px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.6);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* --- Accessibility --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--color-primary);
  color: white;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: top var(--transition);
}
.skip-link:focus {
  top: 1rem;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--color-text);
}

.section-subtitle {
  text-align: center;
  color: var(--color-text-muted);
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(26, 26, 29, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  transition: var(--transition);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
}

.nav-logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--color-primary);
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-menu a {
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition);
}
.nav-menu a:hover {
  color: var(--color-text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8rem 1.5rem 4rem;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Mesh gradient — многослойный градиент с плавными переходами */
.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 100% 80% at 20% 20%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse 80% 100% at 80% 10%, rgba(99, 102, 241, 0.1) 0%, transparent 45%),
    radial-gradient(ellipse 70% 90% at 60% 80%, rgba(245, 158, 11, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 90% 60% at 5% 70%, rgba(59, 130, 246, 0.06) 0%, transparent 40%),
    radial-gradient(ellipse 60% 80% at 90% 60%, rgba(245, 158, 11, 0.05) 0%, transparent 45%);
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 80px 80px;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  color: var(--color-text);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  font-weight: 500;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-md);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid rgba(59, 130, 246, 0.6);
}
.btn-secondary:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px);
}

.btn-full {
  width: 100%;
}

/* --- Animations --- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-up {
  animation: fadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  opacity: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Hero scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.hero-scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(148, 163, 184, 0.6), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.5); transform-origin: top; }
  50% { opacity: 1; transform: scaleY(1); transform-origin: top; }
}

/* --- About --- */
.about {
  background: var(--color-bg-soft);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  align-items: center;
}

.about-image .about-photo {
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  aspect-ratio: 4/5;
  border: 1px solid var(--color-border);
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-name {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.about-title {
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.about-bio {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.about-content .btn {
  margin-top: 1rem;
}

/* --- Services --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.service-card {
  background: var(--color-bg-card);
  padding: 2.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}
.service-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(59, 130, 246, 0.3);
}

.service-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(245, 158, 11, 0.08));
  border-radius: var(--radius-md);
  color: var(--color-primary);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.service-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.service-card p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

/* --- Projects --- */
.projects {
  background: var(--color-bg-soft);
}

.projects-filter {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
}

.filter-btn {
  padding: 0.5rem 1rem;
  font-weight: 500;
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  transition: var(--transition);
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--color-primary);
  color: white;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.project-card {
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}
.project-card.hidden {
  display: none;
}

.project-image {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--color-bg-alt);
}
.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.project-card:hover .project-image img {
  transform: scale(1.08);
}

.project-content {
  padding: 1.5rem;
}

.project-content h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.project-content p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.project-link {
  font-weight: 600;
  color: var(--color-primary);
  transition: color var(--transition);
}
.project-link:hover {
  color: var(--color-primary-hover);
}

/* --- Videos --- */
.videos-embed-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.video-embed {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}
.video-embed:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.video-embed iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  display: block;
}

.video-embed h3 {
  font-size: 1rem;
  font-weight: 700;
  padding: 1rem 1rem 0.25rem;
}

.video-embed p {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  padding: 0 1rem 1rem;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.video-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  transition: var(--transition);
}
.video-card:hover {
  transform: translateY(-4px);
}

.video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--color-bg-alt);
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.video-card:hover .video-thumb img {
  transform: scale(1.05);
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.video-play::after {
  content: '';
  margin-left: 4px;
  border: 12px solid transparent;
  border-left: 20px solid white;
}

.video-card:hover .video-play {
  background: var(--color-primary);
  transform: translate(-50%, -50%) scale(1.1);
}

.video-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
}

.video-card p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* --- Testimonials --- */
.testimonials {
  background: var(--color-bg-soft);
}

.testimonials-slider {
  max-width: 800px;
  margin: 0 auto;
}

.testimonials-track {
  position: relative;
}

.testimonial-card {
  background: var(--color-bg-card);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.testimonial-card p {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 1.5rem;
  font-style: italic;
}

.testimonial-card footer {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.testimonial-logo {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.testimonial-card cite {
  font-style: normal;
  font-weight: 600;
}

.testimonial-card span {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* --- Contact --- */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  max-width: 900px;
  margin: 0 auto;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
  padding: 0.875rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  background: var(--color-bg-alt);
  color: var(--color-text);
  transition: var(--transition);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
}
.form-group input.error,
.form-group textarea.error {
  border-color: #ef4444;
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.form-error {
  font-size: 0.8rem;
  color: #ef4444;
}

.contact-messengers p {
  font-weight: 600;
  margin-bottom: 1rem;
}

.messenger-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: var(--transition);
}

.messenger-btn.whatsapp {
  background: #25d366;
  color: white;
}
.messenger-btn.whatsapp:hover {
  background: #20bd5a;
  transform: translateX(4px);
}

.messenger-btn.telegram {
  background: #0088cc;
  color: white;
}
.messenger-btn.telegram:hover {
  background: #007ab8;
  transform: translateX(4px);
}

.messenger-btn.email {
  background: var(--color-bg-card);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.messenger-btn.email:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: var(--color-bg-alt);
  transform: translateX(4px);
}

/* --- Footer --- */
.footer {
  background: #141416;
  color: rgba(255, 255, 255, 0.7);
  padding: 4rem 0 2rem;
  border-top: 1px solid var(--color-border);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-logo {
  font-weight: 800;
  font-size: 1.5rem;
  color: white;
}

.footer-brand p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.footer-links h4,
.footer-social h4 {
  color: white;
  font-size: 1rem;
  margin-bottom: 1rem;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a:hover,
.footer-social a:hover {
  color: white;
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.footer-bottom p {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .about-image {
    max-width: 400px;
    margin: 0 auto;
  }
  .services-grid {
    grid-template-columns: 1fr;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .videos-embed-grid {
    grid-template-columns: 1fr;
  }
  .videos-grid {
    grid-template-columns: 1fr;
  }
  .contact-wrapper {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--color-bg-soft);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transition: right var(--transition);
  }
  .nav-menu.open {
    right: 0;
  }
  .nav-toggle {
    display: flex;
    z-index: 60;
  }
  .section {
    padding: 4rem 0;
  }
  .hero-buttons {
    flex-direction: column;
  }
  .hero-buttons .btn {
    width: 100%;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  .footer-links ul,
  .social-links {
    align-items: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1rem;
  }
  .projects-filter {
    flex-wrap: wrap;
    justify-content: center;
  }
}
