/* ===========================
   CSS CUSTOM PROPERTIES
   =========================== */

:root {
  /* Light theme (default) */
  --bg: #f5f6fa;
  --bg-alt: #eef0f7;
  --surface: #ffffff;
  --surface-hover: #f0f2fa;
  --border: #dde1f0;
  --text: #1a1d2e;
  --text-muted: #5a6080;
  --accent: #2563eb;
  --accent-light: rgba(37, 99, 235, 0.10);
  --accent-hover: #1d4ed8;
  --marker: #2563eb;
  --tag-bg: rgba(37, 99, 235, 0.08);
  --tag-text: #2563eb;
  --shadow: 0 2px 16px rgba(37, 99, 235, 0.07);
  --shadow-hover: 0 6px 28px rgba(37, 99, 235, 0.13);
  --timeline-line: #dde1f0;
  --toggle-bg: #e0e4f5;
}

[data-theme="dark"] {
  --bg: #0f1117;
  --bg-alt: #161921;
  --surface: #1b1f2e;
  --surface-hover: #222636;
  --border: #2a2f45;
  --text: #e8eaf4;
  --text-muted: #8890b0;
  --accent: #4f8ef7;
  --accent-light: rgba(79, 142, 247, 0.12);
  --accent-hover: #6aa0ff;
  --marker: #4f8ef7;
  --tag-bg: rgba(79, 142, 247, 0.12);
  --tag-text: #7db3ff;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 6px 28px rgba(0, 0, 0, 0.5);
  --timeline-line: #2a2f45;
  --toggle-bg: #2a2f45;
}

/* Auto theme: follows system preference */
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    --bg: #0f1117;
    --bg-alt: #161921;
    --surface: #1b1f2e;
    --surface-hover: #222636;
    --border: #2a2f45;
    --text: #e8eaf4;
    --text-muted: #8890b0;
    --accent: #4f8ef7;
    --accent-light: rgba(79, 142, 247, 0.12);
    --accent-hover: #6aa0ff;
    --marker: #4f8ef7;
    --tag-bg: rgba(79, 142, 247, 0.12);
    --tag-text: #7db3ff;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 6px 28px rgba(0, 0, 0, 0.5);
    --timeline-line: #2a2f45;
    --toggle-bg: #2a2f45;
  }
}

/* ===========================
   RESET & BASE
   =========================== */

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ===========================
   LAYOUT
   =========================== */

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===========================
   HEADER
   =========================== */

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo-dot {
  color: var(--accent);
}

.nav {
  display: flex;
  gap: 32px;
}

.nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--toggle-bg);
  cursor: pointer;
  font-size: 1.1rem;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
  flex-shrink: 0;
}

.theme-toggle:hover {
  transform: scale(1.08);
  border-color: var(--accent);
}

.theme-icon--dark { display: none; }
.theme-icon--light { display: inline; }

[data-theme="dark"] .theme-icon--dark,
[data-theme="auto"].dark-system .theme-icon--dark { display: inline; }
[data-theme="dark"] .theme-icon--light,
[data-theme="auto"].dark-system .theme-icon--light { display: none; }

/* ===========================
   HERO
   =========================== */

.hero {
  padding: 80px 0 96px;
  background: var(--bg);
}

.hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.hero__text {
  flex: 1;
  max-width: 580px;
}

.hero__eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.hero__name {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -2px;
  color: var(--text);
  margin-bottom: 20px;
}

.hero__sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 400;
}

.hero__location {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 36px;
}

.hero__cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.btn--ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn--ghost:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

/* Photo */
.hero__photo-wrap {
  position: relative;
  flex-shrink: 0;
}

.hero__photo {
  width: 260px;
  height: 260px;
  border-radius: 24px;
  overflow: hidden;
  border: 3px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  gap: 8px;
}

/* Для замены на фото: удалите .photo-placeholder и вставьте <img src="photo.jpg" alt="Антон Святкин"> */

.photo-placeholder__icon {
  font-size: 4rem;
  opacity: 0.4;
}

.photo-placeholder__text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.hero__badge {
  position: absolute;
  bottom: -16px;
  right: -16px;
  background: var(--accent);
  color: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
}

.badge-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.5rem;
  font-weight: 600;
}

.badge-label {
  font-size: 0.7rem;
  opacity: 0.9;
}

/* ===========================
   SECTIONS (shared)
   =========================== */

.section {
  padding: 88px 0;
  background: var(--bg);
  transition: background-color 0.3s ease;
}

.section--alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.8px;
  color: var(--text);
  margin-bottom: 8px;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 52px;
}

/* ===========================
   SERVICES
   =========================== */

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.service-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s, background-color 0.3s;
  box-shadow: var(--shadow);
}

.service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.service-icon {
  font-size: 2rem;
  margin-bottom: 14px;
}

.service-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
}

.service-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ===========================
   STACK
   =========================== */

.stack-groups {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.stack-group__title {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-family: 'JetBrains Mono', monospace;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.tag:hover {
  border-color: var(--accent);
  transform: scale(1.04);
}

/* ===========================
   EXPERIENCE / TIMELINE
   =========================== */

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: var(--timeline-line);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding-bottom: 48px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -28px;
  top: 12px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--marker);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--marker);
  transition: background-color 0.3s ease;
}

.timeline-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.timeline-company {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.timeline-role {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
  margin-top: 2px;
}

.timeline-period {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding: 4px 10px;
  background: var(--bg-alt);
  border-radius: 20px;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.timeline-list li {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
  line-height: 1.55;
}

.timeline-list li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.8rem;
}

/* ===========================
   CONTACTS
   =========================== */

.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.25s;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.contact-card--static {
  cursor: default;
}

.contact-card--static:hover {
  border-color: var(--border);
  transform: none;
  box-shadow: var(--shadow);
}

.contact-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.contact-card > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.contact-value {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
}

/* ===========================
   FOOTER
   =========================== */

.footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 32px 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer__copy {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 768px) {
  .hero__inner {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero__cta {
    justify-content: center;
  }

  .hero__photo {
    width: 180px;
    height: 180px;
  }

  .hero__badge {
    bottom: -12px;
    right: -12px;
  }

  .nav {
    gap: 16px;
  }

  .nav a {
    font-size: 0.8rem;
  }

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

  .timeline {
    padding-left: 24px;
  }

  .timeline-header {
    flex-direction: column;
  }

  .contact-cards {
    grid-template-columns: 1fr;
  }

  .footer__inner {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .header__inner {
    gap: 8px;
  }

  .nav {
    gap: 10px;
  }

  .hero {
    padding: 56px 0 72px;
  }

  .section {
    padding: 64px 0;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* ===========================
   EXPERIENCE GRID (new)
   =========================== */

.exp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.exp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s, transform 0.25s, border-color 0.25s, background-color 0.3s;
}

.exp-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent);
}

.exp-icon {
  font-size: 2rem;
  margin-bottom: 14px;
}

.exp-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.exp-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.exp-list li {
  font-size: 0.88rem;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
  line-height: 1.55;
}

.exp-list li::before {
  content: '▹';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: 0.8rem;
}

/* ===========================
   PORTFOLIO SLIDER
   =========================== */

.slider-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-viewport {
  overflow: hidden;
  border-radius: 20px;
  flex: 1;
}

.slider-track {
  display: flex;
  gap: 20px;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.slide {
  min-width: calc(33.333% - 14px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s, transform 0.25s, background-color 0.3s;
  flex-shrink: 0;
}

.slide:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.slide__img-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-alt);
}

.slide__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.slide:hover .slide__img-wrap img {
  transform: scale(1.04);
}

.slide__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
}

.slide__placeholder span:first-child {
  font-size: 2.5rem;
  opacity: 0.4;
}

.slide__body {
  padding: 20px;
}

.slide__tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.slide__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.slide__desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Slider buttons */
.slider-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.slider-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.08);
}

.slider-btn:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

/* Dots */
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.slider-dot.active {
  background: var(--accent);
  width: 24px;
  border-radius: 4px;
}

/* Responsive slider */
@media (max-width: 900px) {
  .slide {
    min-width: calc(50% - 10px);
  }
}

@media (max-width: 580px) {
  .slide {
    min-width: 100%;
  }

  .slider-btn {
    width: 36px;
    height: 36px;
  }

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