:root {
  --bg: #09090b;
  --surface: #141418;
  --border: #292932;
  --text: #f1f1f4;
  --muted: #b8b8c2;
  --accent: #8b8bff;
  --accent-soft: rgba(139, 139, 255, 0.12);
  --timeline-progress: 0%;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 78% 0%, rgba(92, 92, 210, 0.17), transparent 30rem),
    radial-gradient(circle at 8% 38%, rgba(89, 173, 145, 0.06), transparent 25rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.container {
  width: min(100%, 1120px);
  margin-inline: auto;
  padding-inline: 24px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(9, 9, 11, 0.87);
  backdrop-filter: blur(16px);
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
}

.logo {
  flex: none;
  margin: 0;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin-left: auto;
}

.nav a {
  position: relative;
  color: #ccccd4;
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 180ms ease;
}

.nav a::after {
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transition: transform 180ms ease;
}

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

.nav a:hover::after {
  transform: scaleX(1);
}

.lang-btn {
  flex: none;
  min-width: 42px;
  padding: 7px 12px;
  border: 1px solid #3d3d4a;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.lang-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.story-section {
  width: min(100%, 980px);
  margin-inline: auto;
  padding: 92px 24px 110px;
}

.story-intro {
  position: relative;
  overflow: hidden;
  margin-bottom: 62px;
  padding: 46px 34px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background:
    radial-gradient(circle at 85% 15%, rgba(139, 139, 255, 0.17), transparent 18rem),
    linear-gradient(155deg, #17171d, #111115);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.24);
}

.story-intro::after {
  position: absolute;
  right: -55px;
  bottom: -75px;
  width: 210px;
  height: 210px;
  border: 1px solid rgba(139, 139, 255, 0.18);
  border-radius: 50%;
  content: "";
}

.section-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(2.25rem, 6vw, 4rem);
  letter-spacing: -0.05em;
  line-height: 1.05;
  text-align: left;
}

.section-subtitle {
  max-width: 560px;
  margin: 14px 0 0;
  color: #898995;
  text-align: left;
}

.timeline {
  position: relative;
  counter-reset: journey-step;
}

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 19px;
  width: 2px;
  overflow: hidden;
  border-radius: 999px;
  background: #30303a;
}

.timeline-line::after {
  display: block;
  width: 100%;
  height: var(--timeline-progress);
  border-radius: inherit;
  background: linear-gradient(var(--accent), #5dce9a);
  content: "";
  transition: height 400ms ease;
}

.timeline-item {
  position: relative;
  padding-left: 66px;
  counter-increment: journey-step;
}

.timeline-item + .timeline-item {
  margin-top: 28px;
}

.timeline-dot {
  position: absolute;
  top: 30px;
  left: 8px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: 3px solid #3d3d49;
  border-radius: 50%;
  background: var(--bg);
  cursor: pointer;
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.timeline-item:hover .timeline-dot,
.timeline-dot.completed {
  border-color: var(--accent);
  box-shadow: 0 0 0 6px rgba(139, 139, 255, 0.1);
  transform: scale(1.08);
}

.timeline-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(139, 139, 255, 0.09), transparent 15rem),
    linear-gradient(155deg, #17171c, var(--surface));
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.18);
  transition: border-color 200ms ease, transform 200ms ease;
}

.timeline-card::before {
  position: absolute;
  top: 18px;
  right: 22px;
  color: rgba(139, 139, 255, 0.22);
  content: counter(journey-step, decimal-leading-zero);
  font-size: 2.2rem;
  font-weight: 850;
  letter-spacing: -0.05em;
  line-height: 1;
}

.timeline-card::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: linear-gradient(var(--accent), rgba(139, 139, 255, 0));
  content: "";
  opacity: 0.7;
}

.timeline-item:hover .timeline-card {
  border-color: rgba(139, 139, 255, 0.48);
  transform: translateY(-2px);
}

.timeline-card h4 {
  position: relative;
  z-index: 1;
  max-width: calc(100% - 70px);
  margin: 0 0 12px;
  color: #d4d4ff;
  font-size: 1.16rem;
}

.timeline-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  white-space: pre-line;
}

.timeline-item-current .timeline-dot {
  border-color: #5dce9a;
  box-shadow: 0 0 0 6px rgba(93, 206, 154, 0.1);
}

.timeline-item-current .timeline-card {
  border-color: rgba(93, 206, 154, 0.35);
  background:
    radial-gradient(circle at 100% 0%, rgba(93, 206, 154, 0.1), transparent 16rem),
    linear-gradient(155deg, #171a1a, var(--surface));
}

.timeline-item-current .timeline-card::after {
  background: linear-gradient(#5dce9a, rgba(93, 206, 154, 0));
}

.timeline-item-next .timeline-card {
  border-style: dashed;
}

.timeline-gallery {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.timeline-photo {
  width: 100%;
  height: 230px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  background: white;
  object-fit: contain;
}

.timeline-gallery:has(.timeline-photo:only-child) {
  grid-template-columns: minmax(0, 1fr);
}

.timeline-gallery:has(.timeline-photo:only-child) .timeline-photo {
  height: auto;
  max-height: 360px;
}

@media (max-width: 980px) {
  .header .container {
    flex-wrap: wrap;
    gap: 12px 20px;
    padding-block: 14px;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    flex: none;
  }
}

@media (max-width: 600px) {
  .container,
  .story-section {
    padding-inline: 20px;
  }

  .story-section {
    padding-top: 68px;
  }

  .story-intro {
    margin-bottom: 46px;
    padding: 34px 24px;
  }

  .timeline-line {
    left: 9px;
  }

  .timeline-item {
    padding-left: 38px;
  }

  .timeline-dot {
    top: 25px;
    left: 0;
    width: 20px;
    height: 20px;
  }

  .timeline-card {
    padding: 22px;
  }

  .timeline-card::before {
    top: 16px;
    right: 18px;
    font-size: 1.75rem;
  }

  .timeline-card h4 {
    max-width: calc(100% - 55px);
  }

  .timeline-gallery {
    grid-template-columns: 1fr;
  }

  .timeline-photo {
    height: auto;
    max-height: 300px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
