/* Running Buddies — main stylesheet */

@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/inter-tight-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/inter-tight-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f5f4f1;
  --paper: #ffffff;
  --ink: #0d0d0d;
  --muted: #6b6a66;
  --line: rgba(13, 13, 13, 0.14);
  --accent: #e2492b; /* цвет беговой дорожки */
  --accent-dark: #c93c20;

  --font: "Inter Tight", "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --pad: clamp(20px, 4vw, 56px);
  --section: clamp(88px, 13vw, 190px);
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

::selection { background: var(--accent); color: #fff; }

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  transition: top 0.2s;
}
.skip-link:focus { top: 16px; }

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

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

/* ---------- Typography ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
}
.eyebrow--light { color: rgba(255, 255, 255, 0.82); }

.h2 {
  margin-top: 22px;
  font-size: clamp(40px, 6.6vw, 104px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.h2--latin { letter-spacing: -0.04em; }

/* ---------- Buttons ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 56px;
  padding: 0 30px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease),
              border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.btn::after {
  content: "";
  width: 7px;
  height: 7px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.3s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:hover::after { transform: translateX(5px) rotate(45deg); }
.btn:active { transform: translateY(0); }

.btn--accent { background: var(--accent); color: #fff; }
.btn--accent:hover { background: #fff; color: var(--ink); }

.btn--ghost-light { border-color: rgba(255, 255, 255, 0.55); color: #fff; }
.btn--ghost-light:hover { background: #fff; border-color: #fff; color: var(--ink); }

.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: var(--accent); }

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  color: #fff;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease),
              box-shadow 0.35s var(--ease);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--pad);
  padding-left: max(var(--pad), env(safe-area-inset-left));
  padding-right: max(var(--pad), env(safe-area-inset-right));
}
.site-header.is-scrolled {
  background: rgba(245, 244, 241, 0.88);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
}

.logo {
  position: relative;
  z-index: 2;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.site-nav__list {
  display: flex;
  gap: clamp(22px, 3vw, 44px);
}
.site-nav a {
  position: relative;
  padding: 8px 0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease);
}
.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-toggle {
  display: none;
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.nav-toggle__bar {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.35s var(--ease), top 0.35s var(--ease);
}
.nav-toggle__bar:nth-child(1) { top: 17px; }
.nav-toggle__bar:nth-child(2) { top: 26px; }
.nav-open .nav-toggle__bar:nth-child(1) { top: 21.5px; transform: rotate(45deg); }
.nav-open .nav-toggle__bar:nth-child(2) { top: 21.5px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: #17120e;
  color: #fff;
}
.hero__media {
  position: absolute;
  inset: -6% 0 -6% 0;
  will-change: transform;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 40%;
  animation: hero-in 1.6s var(--ease) both;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 8, 6, 0.42) 0%, rgba(10, 8, 6, 0.05) 30%, rgba(10, 8, 6, 0.3) 60%, rgba(10, 8, 6, 0.8) 100%);
  pointer-events: none;
}
.hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 40px) var(--pad) clamp(32px, 5vw, 64px);
}
.hero__eyebrow { animation: rise 0.9s var(--ease) 0.15s both; }
.hero__title {
  margin-top: clamp(16px, 2vw, 28px);
  font-size: clamp(60px, 14.2vw, 232px);
  font-weight: 800;
  line-height: 0.86;
  letter-spacing: -0.05em;
}
.hero__word {
  display: inline-block;
  margin-right: 0.12em;
  animation: rise 1s var(--ease) both;
}
.hero__word:nth-child(1) { animation-delay: 0.2s; }
.hero__word:nth-child(2) { animation-delay: 0.3s; }
.hero__word:nth-child(3) { animation-delay: 0.4s; margin-right: 0; }

.hero__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px 48px;
  flex-wrap: wrap;
  margin-top: clamp(28px, 4vw, 56px);
  padding-top: clamp(22px, 2.4vw, 32px);
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  animation: rise 1s var(--ease) 0.55s both;
}
.hero__lead {
  max-width: 30em;
  font-size: clamp(17px, 1.45vw, 22px);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
  text-wrap: pretty;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}
@keyframes hero-in {
  from { opacity: 0; transform: scale(1.06); }
  to { opacity: 1; transform: none; }
}

/* ---------- Sections ---------- */

.section { padding: var(--section) 0; }

.section-head { margin-bottom: clamp(48px, 7vw, 104px); }
.section-head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px 48px;
}
.section-head__note {
  max-width: 22em;
  color: var(--muted);
  font-size: 17px;
}

/* ---------- About ---------- */

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(40px, 7vw, 120px);
  align-items: center;
}
.prose {
  max-width: 30em;
  margin-top: clamp(32px, 4vw, 56px);
  font-size: clamp(17px, 1.25vw, 19px);
  color: #3b3a37;
}
.prose p + p { margin-top: 1.1em; }
.prose__lead {
  font-size: clamp(21px, 1.9vw, 28px);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.about__media {
  position: relative;
  padding-bottom: clamp(40px, 6vw, 88px);
  padding-left: clamp(0px, 5vw, 72px);
}
.frame {
  overflow: hidden;
  background: #e6e4df;
}
.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.frame--tall { aspect-ratio: 4 / 5; }
.frame--small {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 44%;
  aspect-ratio: 4 / 3;
  border: 8px solid var(--bg);
  border-left-width: 0;
  border-bottom-width: 0;
}

/* ---------- Why ---------- */

.why { background: var(--paper); }
.why__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 clamp(20px, 3vw, 48px);
}
.why-card {
  position: relative;
  padding-top: 28px;
  border-top: 1px solid var(--ink);
  font-size: 17px;
  color: #3b3a37;
}
.why-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}
.why-card:hover::before { transform: scaleX(1); }
.why-card__num {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.why-card__title {
  margin: clamp(48px, 7vw, 112px) 0 14px;
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--ink);
}
.why-card p { max-width: 19em; text-wrap: pretty; }

/* ---------- Distance ---------- */

.distance {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: min(100vh, 980px);
  min-height: min(100svh, 980px);
  overflow: hidden;
  background: #161514;
  color: #fff;
}
.distance__media { position: absolute; inset: 0; }
.distance__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.distance::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.3) 0%, rgba(10, 10, 10, 0.45) 45%, rgba(10, 10, 10, 0.86) 100%);
  pointer-events: none;
}
.distance__content {
  position: relative;
  z-index: 1;
  padding-top: 120px;
  padding-bottom: clamp(48px, 7vw, 104px);
}
.distance__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.06em 0.22em;
  margin-top: 24px;
  font-size: clamp(44px, 8.3vw, 142px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}
.distance__title span { white-space: nowrap; }
.distance__title i {
  font-style: normal;
  font-weight: 400;
  color: var(--accent);
}
.distance__lead {
  margin-top: clamp(24px, 3vw, 40px);
  font-size: clamp(19px, 1.9vw, 28px);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.92);
}

/* ---------- Goals ---------- */

.goals__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.goals__grid > li { background: var(--bg); }
.goal {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: clamp(260px, 27vw, 420px);
  padding: clamp(20px, 2.2vw, 32px);
  overflow: hidden;
  cursor: default;
  transition: color 0.45s var(--ease);
}
.goal::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform 0.55s var(--ease);
}
.goal > * { position: relative; }
.goal__index {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
  transition: color 0.45s var(--ease);
}
.goal__km {
  margin-top: auto;
  font-size: clamp(56px, 6.4vw, 112px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  transition: transform 0.55s var(--ease);
}
.goal__km small {
  margin-left: 0.3em;
  font-size: 0.2em;
  font-weight: 600;
  letter-spacing: 0.12em;
  vertical-align: 0.35em;
}
.goal__label {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.goal__arrow {
  position: absolute;
  top: clamp(20px, 2.2vw, 32px);
  right: clamp(20px, 2.2vw, 32px);
  width: 22px;
  height: 22px;
  opacity: 0;
  transform: translate(-10px, 10px);
  transition: opacity 0.4s var(--ease), transform 0.55s var(--ease);
}
.goal__arrow::before,
.goal__arrow::after {
  content: "";
  position: absolute;
  background: var(--accent);
}
.goal__arrow::before {
  top: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background: none;
  border-top: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
}
.goal__arrow::after {
  top: 10px;
  left: -2px;
  width: 27px;
  height: 2px;
  transform: rotate(-45deg);
}
.goal:hover,
.goal:focus-visible { color: #fff; }
.goal:hover::before,
.goal:focus-visible::before { transform: none; }
.goal:hover .goal__index,
.goal:focus-visible .goal__index { color: rgba(255, 255, 255, 0.6); }
.goal:hover .goal__km,
.goal:focus-visible .goal__km { transform: translateY(-8px); }
.goal:hover .goal__arrow,
.goal:focus-visible .goal__arrow { opacity: 1; transform: none; }
.goal:focus-visible { outline-offset: -4px; }

/* ---------- Strip ---------- */

.strip {
  overflow: hidden;
  background: #c9553d;
}
.strip img {
  width: 100%;
  height: clamp(220px, 34vw, 560px);
  object-fit: cover;
}

/* ---------- CTA ---------- */

.cta {
  padding: clamp(104px, 15vw, 230px) 0;
  background: var(--paper);
  text-align: center;
}
.cta__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cta__title {
  font-size: clamp(52px, 12vw, 200px);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.05em;
}
.cta__lead {
  margin: clamp(28px, 3.4vw, 48px) 0 clamp(32px, 3.4vw, 48px);
  font-size: clamp(18px, 1.7vw, 24px);
  color: #3b3a37;
  text-wrap: balance;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: #fff;
  padding: clamp(40px, 5vw, 64px) 0;
  padding-bottom: max(clamp(40px, 5vw, 64px), env(safe-area-inset-bottom));
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px 40px;
}
.site-footer__logo {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.14em;
}
.site-footer__links {
  display: flex;
  gap: clamp(20px, 3vw, 40px);
}
.site-footer__links a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  transition: color 0.3s var(--ease);
}
.site-footer__links a:hover { color: var(--accent); }
.site-footer__copy {
  justify-self: end;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

/* ---------- Scroll reveal (только когда работает JS) ---------- */

@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
    transition-delay: var(--d, 0s);
  }
  .reveal.is-visible {
    opacity: 1;
    transform: none;
  }
  .reveal-img img {
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 1.2s var(--ease), transform 1.6s var(--ease);
  }
  .reveal-img.is-visible img {
    opacity: 1;
    transform: none;
  }
  .why__grid > :nth-child(2),
  .goals__grid > :nth-child(2) { --d: 0.08s; }
  .why__grid > :nth-child(3),
  .goals__grid > :nth-child(3) { --d: 0.16s; }
  .why__grid > :nth-child(4),
  .goals__grid > :nth-child(4) { --d: 0.24s; }
}

/* ---------- Tablet ---------- */

@media (max-width: 1024px) {
  .why__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 56px; }
  .why-card__title { margin-top: 56px; }
  .goals__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .goal { min-height: clamp(220px, 34vw, 340px); }
}

@media (max-width: 900px) {
  .about__grid { grid-template-columns: minmax(0, 1fr); }
  .about__media { padding-left: clamp(24px, 10vw, 96px); }
  .site-footer__inner {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .site-footer__copy { justify-self: start; }
}

/* ---------- Mobile ---------- */

@media (max-width: 760px) {
  :root { --header-h: 64px; }
  body { font-size: 16px; }

  .nav-toggle { display: block; }

  .site-nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    padding: calc(var(--header-h) + 24px) var(--pad) max(40px, env(safe-area-inset-bottom));
    background: var(--bg);
    color: var(--ink);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--ease), visibility 0s linear 0.35s;
  }
  .site-nav__list {
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }
  .site-nav a {
    display: block;
    padding: 10px 0;
    font-size: clamp(34px, 11vw, 52px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    text-transform: none;
    border-bottom: 1px solid var(--line);
  }
  .site-nav a::after { display: none; }

  .nav-open .site-header { color: var(--ink); background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav-open .site-nav {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
  }
  .nav-open body,
  .nav-open { overflow: hidden; }

  .hero__title { font-size: clamp(64px, 23vw, 132px); line-height: 0.84; }
  .hero__word { display: block; margin-right: 0; }
  .hero__bottom { flex-direction: column; align-items: stretch; }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; justify-content: space-between; }

  .distance__title { font-size: clamp(52px, 17vw, 96px); }
  .distance__title span { flex-basis: 60%; }

  .section-head--row { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .why__grid { grid-template-columns: minmax(0, 1fr); row-gap: 44px; }
  .why-card__title { margin-top: 32px; }
  .goals__grid { grid-template-columns: minmax(0, 1fr); }
  .goal { min-height: 190px; }
  .goal__km { font-size: 72px; }
  .frame--small { width: 52%; }
}

/* ---------- Reduced motion ---------- */

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