/* =====================================================
   ДИЗАЙН-СИСТЕМА: Персональный сайт Владимира Суглоба
   Тёмная тема с тёплыми золотистыми акцентами
   ===================================================== */

/* === CSS Variables === */
:root {
  /* Цветовая палитра */
  --bg-primary: #0a0806;
  --bg-secondary: #151210;
  --bg-card: #1a1614;
  --bg-card-hover: #221e1b;

  --accent: #c9a87c;
  --accent-light: #e5d4b8;
  --accent-dark: #9a7d54;

  --text-primary: #f5f0ea;
  --text-secondary: #a8a099;
  --text-muted: #6b6560;

  --border: rgba(201, 168, 124, 0.15);
  --border-accent: rgba(201, 168, 124, 0.3);

  /* Типографика */
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Размеры */
  --container-width: 1200px;
  --section-padding: clamp(4rem, 10vw, 8rem);

  /* Анимации */
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

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

/* === Типографика === */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.02em;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.5rem);
}

p {
  color: var(--text-secondary);
  max-width: 65ch;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-light);
}

/* === Контейнер === */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 clamp(1.5rem, 4vw, 3rem);
}



/* === Секция === */
.section {
  padding: var(--section-padding) 0;
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-title {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin: 1.5rem auto 0;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.2rem;
  font-weight: 300;
  text-align: center;
  max-width: none;
}

/* === Кнопки === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: all var(--transition-smooth);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: var(--accent-light);
  color: var(--bg-primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(201, 168, 124, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-accent);
}

.btn-secondary:hover {
  background: rgba(201, 168, 124, 0.1);
  border-color: var(--accent);
}



/* === BEAMS BACKGROUND === */
.beams-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.beams-bg canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* === HERO СЕКЦИЯ === */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(201, 168, 124, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero > .container {
  position: relative;
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 10;
}

.hero-label {
  display: inline-block;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.2s forwards;
}

.hero-title {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.4s forwards;
}

/* === Animated Gradient Text === */
.gradient-text-animated {
  background: linear-gradient(
    90deg,
    #f5f0ea,
    #c9a87c,
    #ffffff,
    #e5d4b8,
    #c9a87c,
    #f5f0ea
  );
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title.gradient-text-animated {
  animation: fadeInUp 0.8s ease 0.4s forwards, gradientShift 8s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.hero-description {
  font-size: 1.15rem;
  margin-bottom: 2.5rem;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.6s forwards;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeInUp 0.8s ease 0.8s forwards;
}

.hero-image-wrapper {
  position: relative;
  z-index: 2;
  opacity: 0;
  animation: fadeIn 1.2s ease 0.4s forwards;
}

.hero-image {
  width: 100%;
  max-width: 500px;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.5);
}

.hero-image-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at center, rgba(201, 168, 124, 0.15) 0%, transparent 70%);
  z-index: -1;
  filter: blur(40px);
}

/* === ABOUT СЕКЦИЯ === */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  align-items: center;
}

.about-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

.about-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  will-change: transform;
  transition: transform 0.1s linear;
}

.about-image-frame {
  position: absolute;
  inset: 20px;
  border: 1px solid var(--border-accent);
  border-radius: 8px;
  pointer-events: none;
  z-index: -1;
}

.about-content h2 {
  margin-bottom: 1.5rem;
}

.about-text {
  margin-bottom: 2rem;
}

/* Publications block */
.about-publications {
  margin-bottom: 2rem;
}

.about-publications p {
  margin-bottom: 1rem;
}

.btn-publications {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-accent);
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
}

.btn-publications:hover {
  background: rgba(201, 168, 124, 0.1);
  border-color: var(--accent);
  color: var(--accent-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(201, 168, 124, 0.15);
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Ссылки в тексте */
.link-inline {
  color: var(--accent);
  border-bottom: 1px solid var(--border-accent);
  transition: all var(--transition-fast);
}

.link-inline:hover {
  color: var(--accent-light);
  border-color: var(--accent-light);
}

/* === СПЕЦИАЛИЗАЦИЯ === */
.specialization-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.spec-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2.5rem;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.spec-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity var(--transition-smooth);
}

.spec-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-4px);
}

.spec-card:hover::before {
  opacity: 1;
}

.spec-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 1.5rem;
  color: var(--accent);
}

.spec-title {
  color: var(--text-primary);
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.spec-description {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* === ПРОЕКТЫ === */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  transition: all var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.project-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-icon svg {
  width: 28px;
  height: 28px;
  color: var(--bg-primary);
}

.project-title {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.project-description {
  flex-grow: 1;
  margin-bottom: 1.5rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  font-weight: 500;
  transition: gap var(--transition-fast);
}

.project-link:hover {
  gap: 0.75rem;
}

.project-link svg {
  width: 18px;
  height: 18px;
}

/* === ПРЕПОДАВАНИЕ === */
.teaching-content {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: center;
}

.teaching-text h2 {
  margin-bottom: 1.5rem;
}

.teaching-list {
  list-style: none;
  margin-top: 2rem;
}

.teaching-list li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.teaching-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

.teaching-image {
  position: relative;
}

.teaching-image img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

/* === КОНТАКТЫ === */
.contacts {
  background: var(--bg-secondary);
}

.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contacts-info h2 {
  margin-bottom: 1.5rem;
}

.contacts-info>p {
  margin-bottom: 2.5rem;
}

.contact-list {
  list-style: none;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.contact-item:last-child {
  border-bottom: none;
}

.contact-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: 8px;
  color: var(--accent);
  flex-shrink: 0;
}

.contact-icon svg {
  width: 20px;
  height: 20px;
}

.contact-text {
  display: flex;
  flex-direction: column;
}

.contact-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.contact-value {
  color: var(--text-primary);
  font-weight: 500;
}

.contact-value a {
  color: var(--text-primary);
}

.contact-value a:hover {
  color: var(--accent);
}

.contacts-cta {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.contacts-cta h3 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.contacts-cta p {
  margin: 0 auto 2rem;
}

.cta-avatar {
  width: 100px;
  height: 100px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  border: 3px solid var(--accent);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.cta-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
}

/* === FOOTER === */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer .container {
  display: flex;
  justify-content: center;
}

.footer-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
}

/* === АНИМАЦИИ === */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.fade-in-delay-1 {
  transition-delay: 0.1s;
}

.fade-in-delay-2 {
  transition-delay: 0.2s;
}

.fade-in-delay-3 {
  transition-delay: 0.3s;
}

.fade-in-delay-4 {
  transition-delay: 0.4s;
}

/* === АДАПТИВНОСТЬ === */

/* --- Tablet (≤1024px) --- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-content {
    order: 2;
  }

  .hero-image-wrapper {
    order: 1;
    max-width: 400px;
    margin: 0 auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .about-grid,
  .teaching-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .about-image-wrapper {
    max-width: 500px;
    margin: 0 auto;
  }

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

/* --- Mobile (≤768px) --- */
@media (max-width: 768px) {
  :root {
    --section-padding: clamp(3rem, 8vw, 5rem);
  }

  .specialization-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

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

  .spec-card {
    padding: 1.75rem;
  }

  .project-card {
    padding: 1.75rem;
  }

  .about-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .btn {
    padding: 0.875rem 1.5rem;
  }

  .section-header {
    margin-bottom: 2.5rem;
  }

  .hero-image-wrapper {
    max-width: 300px;
  }

  .hero-image {
    max-width: 100%;
  }

  .contacts-cta {
    padding: 2rem;
  }

  .teaching-image img {
    aspect-ratio: 4/3;
  }
}

/* --- Small Mobile (≤480px) --- */
@media (max-width: 480px) {
  h1 {
    font-size: clamp(2rem, 8vw, 2.5rem);
  }

  h2 {
    font-size: clamp(1.75rem, 6vw, 2.25rem);
  }

  .hero {
    min-height: auto;
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .hero-grid {
    gap: 2rem;
  }

  .hero-image-wrapper {
    max-width: 250px;
  }

  .hero-description {
    font-size: 1rem;
  }

  .hero-actions {
    flex-direction: column;
    width: 100%;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .about-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .stat-number {
    font-size: 1.6rem;
  }

  .stat-label {
    font-size: 0.7rem;
  }

  .spec-card {
    padding: 1.5rem;
  }

  .spec-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 1rem;
  }

  .spec-title {
    font-size: 1.15rem;
  }

  .spec-description {
    font-size: 0.9rem;
  }

  .project-card {
    padding: 1.5rem;
  }

  .contacts-cta {
    padding: 1.5rem;
  }

  .cta-avatar {
    width: 80px;
    height: 80px;
  }

  .about-publications {
    text-align: center;
  }

  .btn-publications {
    width: 100%;
    justify-content: center;
  }

  .footer-text {
    font-size: 0.8rem;
  }
}

/* === SIDE NAVIGATION === */
.side-nav {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.side-nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  text-decoration: none;
}

.side-nav-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all var(--transition-smooth);
  position: relative;
}

.side-nav-dot::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid transparent;
  transition: all var(--transition-smooth);
}

.side-nav-item:hover .side-nav-dot,
.side-nav-item.active .side-nav-dot {
  background: var(--accent);
  transform: scale(1.2);
}

.side-nav-item.active .side-nav-dot::before {
  border-color: var(--accent);
}

.side-nav-label {
  position: absolute;
  right: 24px;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-card);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateX(10px);
  transition: all var(--transition-fast);
  pointer-events: none;
}

.side-nav-item:hover .side-nav-label {
  opacity: 1;
  transform: translateX(0);
}

/* Hide side nav on mobile */
@media (max-width: 768px) {
  .side-nav {
    display: none;
  }
}