/* История — scroll-progress timeline (left spine, no images) */

body.history-page {
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(47, 107, 79, 0.07), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(26, 36, 32, 0.04), transparent 50%),
    #f1f4eb;
  color: #1a2420;
}

body.history-page section[id],
body.history-page footer[id] {
  scroll-margin-top: 5.5rem;
}

.history-intro {
  padding: clamp(2rem, 4vw, 3rem) 0 clamp(1.25rem, 2.5vw, 2rem);
}

.history-intro__inner {
  margin-inline: 0 auto;
  max-width: none;
  width: 100%;
  padding-inline: 1rem;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .history-intro__inner {
    margin-inline: 0;
    max-width: 80%;
    padding-inline: 2rem;
  }
}

@media (min-width: 1280px) {
  .history-intro__inner {
    padding-inline: max(2rem, calc((100vw - 80rem) / 2 + 2rem));
  }
}

.history-intro__eyebrow {
  margin: 0 0 0.65rem;
  font-family: "Sofia Sans Condensed", sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #2f6b4f;
}

.history-intro h2 {
  margin: 0;
  font-family: "Sofia Sans Condensed", sans-serif;
  font-size: clamp(1.65rem, 3.4vw, 2.35rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #1a2420;
  text-wrap: balance;
}

.history-intro p {
  margin: 0.85rem 0 0;
  max-width: none;
  font-size: clamp(1rem, 1.5vw, 1.08rem);
  line-height: 1.55;
  color: #3d4a44;
}

.history-section {
  padding: 0 0 clamp(3.5rem, 7vw, 5.5rem);
}

.history-shell {
  margin-inline: 0 auto;
  max-width: none;
  width: 100%;
  padding-inline: 1rem;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .history-shell {
    margin-inline: 0;
    max-width: 80%;
    padding-inline: 2rem;
  }
}

@media (min-width: 1280px) {
  .history-shell {
    padding-inline: max(2rem, calc((100vw - 80rem) / 2 + 2rem));
  }
}

.history-timeline {
  position: relative;
  margin: 0;
  padding: 0.5rem 0 0;
}

.history-timeline__list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Track + progress fill — left edge of content, centered on nodes */
.history-timeline__rail {
  position: absolute;
  top: 0.35rem;
  bottom: 0.35rem;
  left: calc(0.875rem - 1px);
  width: 2px;
  background: rgba(26, 36, 32, 0.12);
  border-radius: 999px;
  pointer-events: none;
}

.history-timeline__progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, #2f6b4f 0%, #3d8a62 100%);
  border-radius: inherit;
  transform-origin: top center;
  will-change: height;
}

.history-item {
  position: relative;
  display: grid;
  grid-template-columns: 1.75rem minmax(0, 1fr);
  gap: 0 1rem;
  padding: 0 0 clamp(2rem, 4vw, 2.75rem);
  opacity: 0.42;
  transform: translateY(0.65rem);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}

@media (min-width: 768px) {
  .history-item {
    gap: 0 1.25rem;
  }
}

.history-item.is-visible {
  opacity: 1;
  transform: none;
}

.history-item:last-child {
  padding-bottom: 0.25rem;
}

/* Outer year column retired — years live inside the box */
.history-item__year {
  display: none;
}

.history-item__node {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-self: start;
  width: 1.75rem;
  height: 1.75rem;
  margin-top: clamp(1.15rem, 2.2vw, 1.55rem);
}

.history-item__dot {
  box-sizing: border-box;
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.2rem;
  border-radius: 999px;
  border: 2px solid rgba(26, 36, 32, 0.22);
  background: #f1f4eb;
  transition:
    background 0.35s ease,
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.35s ease;
}

.history-item.is-active .history-item__dot {
  border-color: #2f6b4f;
  background: #2f6b4f;
  box-shadow: 0 0 0 4px rgba(47, 107, 79, 0.18);
  transform: scale(1.08);
}

.history-item__body {
  min-width: 0;
  padding: clamp(1.15rem, 2.2vw, 1.55rem) clamp(1.2rem, 2.4vw, 1.75rem);
  border: 1px solid #ececec;
  border-radius: 1.2rem;
  background: #fff;
  box-shadow: 0 4px 16px rgba(20, 32, 24, 0.06);
}

.history-item__year-mobile {
  display: block;
  margin: 0 0 0.35rem;
  font-family: "Sofia Sans Condensed", sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: #2f6b4f;
  transition: color 0.35s ease;
}

@media (min-width: 1024px) {
  .history-item__year-mobile {
    margin-bottom: 0.5rem;
    font-size: clamp(1.85rem, 2.4vw, 2.35rem);
    letter-spacing: -0.02em;
  }
}

.history-item__title {
  margin: 0;
  font-family: "Sofia Sans Condensed", sans-serif;
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: #1a2420;
  text-wrap: balance;
}

.history-item__text {
  margin: 0.55rem 0 0;
  font-size: clamp(0.95rem, 1.4vw, 1.02rem);
  line-height: 1.62;
  color: #3d4a44;
}

.history-item__text p {
  margin: 0 0 0.65rem;
}

.history-item__text p:last-child {
  margin-bottom: 0;
}

.history-close {
  margin: clamp(1.5rem, 3vw, 2.5rem) 0 0;
  padding: clamp(1.35rem, 2.5vw, 1.75rem) 0 0;
  border-top: 1px solid rgba(26, 36, 32, 0.1);
  text-align: left;
}

.history-close p {
  margin: 0;
  max-width: 36rem;
  font-family: "Sofia Sans Condensed", sans-serif;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 700;
  line-height: 1.35;
  color: #2f6b4f;
  text-wrap: balance;
}

@media (prefers-reduced-motion: reduce) {
  .history-item {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .history-timeline__progress,
  .history-item__dot,
  .history-item__year-mobile {
    transition: none;
  }
}
