/* JB Camp — «Экспедиционная карта». Главная, этап 1. */

:root {
  --ground: #0E1714;
  --ground-2: #13201C;
  --bone: #E9E4D8;
  --bone-70: rgba(233, 228, 216, .72);
  --bone-50: rgba(233, 228, 216, .52);
  --line: rgba(233, 228, 216, .18);
  --sage: #7E9A8C;
  --signal: #FF5B1F;
  --signal-ink: #1A0B04;
  --ochre: #C9904A;
  --mist: #9FB3AA;

  --f-display: "Unbounded", "Arial Black", sans-serif;
  --f-body: "Onest", system-ui, -apple-system, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;

  --pad: clamp(18px, 3.4vw, 56px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --header-h: 68px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--bone);
  font: 400 1rem/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
::selection { background: var(--signal); color: var(--signal-ink); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 2px; }
html { scrollbar-color: var(--sage) var(--ground); }

.mono { font: 500 .8rem/1.4 var(--f-mono); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--pad); top: -60px; z-index: 20; background: var(--signal); color: var(--signal-ink); padding: 10px 16px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }

/* Рельеф — общий грунт всей страницы */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: url(/img/contours.svg) center / cover no-repeat;
  opacity: .1;
  pointer-events: none;
}

/* ———————————————— Шапка ———————————————— */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: var(--header-h);
  padding: 0 var(--pad);
  background: linear-gradient(var(--ground) 55%, rgba(14, 23, 20, 0));
}
.top__logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.top__logo img { width: 30px; height: auto; filter: invert(1) brightness(1.6); }
.top__logo span { font: 700 .95rem/1 var(--f-display); letter-spacing: .02em; text-transform: uppercase; }
.top__nav { display: flex; gap: clamp(14px, 2.6vw, 40px); }
.top__nav a {
  font: 500 .9rem/1 var(--f-body);
  text-decoration: none; color: var(--bone-70);
  padding: 10px 0;
  background: linear-gradient(var(--bone), var(--bone)) left 100% / 0 1px no-repeat;
  transition: color .3s, background-size .45s var(--ease-out);
}
.top__nav a:hover { color: var(--bone); background-size: 100% 1px; }


/* ———————————————— Первый экран: Что такое JB Camp ———————————————— */
.opening {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  margin-top: calc(var(--header-h) * -1);
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}
.opening__photo, .opening__photo img { position: absolute; inset: 0; width: 100%; height: 100%; }
.opening__photo { z-index: -2; }
.opening__photo img { object-fit: cover; object-position: 50% 58%; filter: saturate(.9) contrast(1.03); }
/* Затемнение слева и снизу — под текстом, люди справа остаются видны */
.opening::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(14,23,20,.92) 0%, rgba(14,23,20,.78) 34%, rgba(14,23,20,.18) 62%, rgba(14,23,20,0) 78%),
    linear-gradient(0deg, rgba(14,23,20,.85) 0%, rgba(14,23,20,0) 38%),
    linear-gradient(180deg, rgba(14,23,20,.7) 0%, rgba(14,23,20,0) 22%);
}
.opening__body {
  padding: calc(var(--header-h) + 48px) var(--pad) clamp(40px, 7vh, 88px);
  max-width: min(640px, 52vw);
}
.opening__title {
  margin: 0 0 .55em;
  font: 800 clamp(2.1rem, 4.6vw, 4.8rem)/.98 var(--f-display);
  letter-spacing: -.035em;
  text-transform: uppercase;
  text-wrap: balance;
}
.opening__text { max-width: 50ch; font-size: clamp(1rem, 1.15vw, 1.12rem); line-height: 1.6; color: rgba(240, 237, 228, .86); }
.opening__text p { margin: 0 0 .8em; text-shadow: 0 1px 14px rgba(0,0,0,.45); }
.opening__lead { font-size: clamp(1.2rem, 1.6vw, 1.5rem); line-height: 1.4; color: var(--bone); }
.opening__coda {
  margin-top: 1.2em !important;
  font: 700 clamp(1rem, 1.3vw, 1.2rem)/1.3 var(--f-display);
  letter-spacing: -.01em; text-transform: uppercase; color: var(--bone);
}
.opening__jump { display: flex; gap: 10px; margin-top: 26px; flex-wrap: wrap; }
.opening__jump a {
  display: inline-flex; justify-content: space-between; align-items: center; gap: 22px;
  min-height: 48px; padding: 0 20px;
  border: 1px solid rgba(233,228,216,.38); border-radius: 999px;
  background: rgba(14,23,20,.35);
  text-decoration: none; font: 700 .82rem/1 var(--f-display); letter-spacing: .06em; text-transform: uppercase;
  transition: background .3s, border-color .3s;
}
.opening__jump a span { color: var(--signal); transition: transform .5s var(--ease-out); }
.opening__jump a:hover { background: rgba(14,23,20,.7); border-color: var(--bone); }
.opening__jump a:hover span { transform: translateY(3px); }
.opening__caption { position: absolute; right: var(--pad); bottom: 18px; margin: 0; font-size: .82rem; color: rgba(240,237,228,.78); text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.js .opening__photo img { animation: develop 1.8s var(--ease-out) both; }
.js .opening__body > * { animation: lift 1s var(--ease-out) both; }
.js .opening__text { animation-delay: .15s; }
.js .opening__jump { animation-delay: .3s; }

/* ———————————————— Два путешествия ———————————————— */
.journeys {
  display: flex;
  height: clamp(640px, calc(100svh - var(--header-h)), 980px);
  gap: 2px;
  background: var(--ground);
}
.journey {
  position: relative;
  flex: 1 1 0;
  overflow: hidden;
  isolation: isolate;
  container-type: inline-size;
  transition: flex-grow .9s var(--ease-out);
}
.journey__photo, .journey__photo img, .journey__cut {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.journey__photo img, .journey__cut {
  object-fit: cover;
  transition: transform 1.4s var(--ease-out), filter .9s var(--ease-out);
}
.journey--shaolin .journey__photo img,
.journey--shaolin .journey__cut { object-position: 50% var(--focus-y); }
.journey--phuket .journey__photo img,
.journey--phuket .journey__cut { object-position: var(--focus-x) 50%; }

/* Цветокоррекция настроения: Шаолинь — туман и камень, Пхукет — закат */
.journey--shaolin .journey__photo img { filter: saturate(.86) contrast(1.04); }
.journey--phuket .journey__photo img { filter: saturate(1.04) contrast(1.02); }

/* Затемнение снизу — только там, где стоит текст */
.journey::after {
  content: "";
  position: absolute; inset: 30% 0 0; z-index: 3;
  background: linear-gradient(rgba(14, 23, 20, 0), rgba(14, 23, 20, .62) 38%, rgba(14, 23, 20, .93) 72%, rgba(14, 23, 20, .97));
  pointer-events: none;
}

.journey__name {
  position: absolute; left: 0; right: 0; z-index: 1;
  margin: 0;
  text-align: center;
  font: 800 13.4cqw/.8 var(--f-display);
  letter-spacing: -.045em;
  text-transform: uppercase;
  color: var(--bone);
  white-space: nowrap;
  pointer-events: none;
}
.journey--shaolin .journey__name { top: 30%; color: #EEF0E8; }
.journey--phuket .journey__name { top: 36%; font-size: 15.6cqw; color: #FFF1DD; text-shadow: 0 4px 40px rgba(40, 22, 8, .45); }
.journey__cut { z-index: 2; pointer-events: none; }

.journey__body {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4;
  padding: 0 clamp(20px, 3vw, 44px) clamp(22px, 3.4vw, 44px);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "place place" "desc desc" "rail rail" "dates cta" "note cta";
  column-gap: 20px;
}
.journey__place { grid-area: place; } .journey__desc { grid-area: desc; }
.rail { grid-area: rail; } .journey__dates { grid-area: dates; } .journey__note { grid-area: note; } .journey__cta { grid-area: cta; }
.journey__place {
  margin: 0;
  font: 700 clamp(.82rem, 1vw, .95rem)/1.2 var(--f-display);
  letter-spacing: .14em; text-transform: uppercase;
}
.journey__desc { margin-top: 12px; max-width: 54ch; font-size: clamp(.98rem, 1.08vw, 1.08rem); line-height: 1.55; color: rgba(244, 241, 233, .92); text-shadow: 0 1px 12px rgba(0,0,0,.5); }
.journey__desc p { margin: 0 0 .55em; }
.journey__hook { font: 700 clamp(1.05rem, 1.35vw, 1.3rem)/1.25 var(--f-display); letter-spacing: -.01em; text-transform: uppercase; color: var(--bone); }

/* Рейка: координаты и даты висят на одной линии */
.rail {
  position: relative;
  margin: 14px 0 14px;
  height: 1px;
  background: var(--line);
}
.rail::before {
  content: "";
  position: absolute; left: 0; top: 0; height: 1px; width: 22%;
  background: var(--bone);
  transition: width .9s var(--ease-out);
}
.journey__dates {
  margin: 0; padding: 0; list-style: none; text-shadow: 0 1px 10px rgba(0,0,0,.45);
  font: 500 clamp(1rem, 1.25vw, 1.2rem)/1.45 var(--f-body);
}
.journey__note { margin: 4px 0 0; font-size: .92rem; color: rgba(244, 241, 233, .84); }
.journey__cta {
  align-self: end;
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 48px; padding: 0 22px;
  background: var(--signal); color: var(--signal-ink);
  font: 600 .95rem/1 var(--f-body);
  text-decoration: none;
  border-radius: 999px;
  transition: background .3s, transform .5s var(--ease-out);
}
.journey__cta::after { content: ""; position: absolute; inset: 0; z-index: 5; } /* вся панель — ссылка */
.journey__cta:hover { background: #FF7440; }
.arrow { width: 26px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .5s var(--ease-out); }
.journey:hover .arrow, .journey__cta:focus-visible .arrow { transform: translateX(6px); }

@media (hover: hover) and (min-width: 900px) {
  .journeys:hover .journey { flex-grow: .86; }
  .journeys:hover .journey:hover { flex-grow: 1.14; }
  .journeys:hover .journey:not(:hover) .journey__photo img { filter: saturate(.6) brightness(.62); }
  .journey:hover .journey__photo img, .journey:hover .journey__cut { transform: scale(1.04); }
  .journey:hover .rail::before { width: 100%; }
}

/* Проявление при загрузке: фото выходят из тёмного грунта, название поднимается из-за фигуры */
.js .journey__photo img { animation: develop 1.8s var(--ease-out) both; }
.js .journey__cut { animation: develop 1.8s var(--ease-out) both; }
.js .journey--phuket .journey__photo img, .js .journey--phuket .journey__cut { animation-delay: .18s; }
.js .journey__name { animation: rise 1.4s .5s var(--ease-out) both; }
.js .journey--phuket .journey__name { animation-delay: .68s; }
.js .journey__body > * { animation: lift .9s var(--ease-out) both; animation-delay: calc(.9s + var(--i, 0) * 60ms); }
@keyframes develop { from { filter: brightness(0) blur(14px); transform: scale(1.08); } }
@keyframes rise { from { transform: translateY(26%); opacity: 0; } }
@keyframes lift { from { transform: translateY(10px); opacity: 0; } }

/* ———————————————— Основатели ———————————————— */
.founders {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  gap: 28px clamp(32px, 6vw, 110px);
  align-items: center;
  max-width: 1320px;
  padding: clamp(80px, 11vw, 170px) var(--pad);
}
.founders__photo { margin: 0; }
.founders__photo img { width: 100%; max-height: 640px; aspect-ratio: 4 / 4.6; object-fit: cover; object-position: 50% 70%; filter: saturate(.9); }
.founders__title { margin: 0; font: 800 clamp(1.9rem, 3.8vw, 3.8rem)/1 var(--f-display); letter-spacing: -.03em; text-transform: uppercase; }
.founders__role { margin: 12px 0 28px; font: 700 .85rem/1.2 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--signal); }
.founders__text p:not(.founders__role) { margin: 0 0 .9em; max-width: 44ch; font-size: clamp(1.1rem, 1.5vw, 1.4rem); line-height: 1.6; color: var(--bone-70); }

/* ———————————————— Подвал с контактами ———————————————— */
.foot { padding: clamp(40px, 6vw, 72px) var(--pad) 36px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; gap: 32px 48px; align-items: end; }
.foot__title { margin: 0 0 14px; font: 700 clamp(1.2rem, 2vw, 1.7rem)/1.1 var(--f-display); letter-spacing: -.02em; text-transform: uppercase; }
.foot__links { margin: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.foot__links a { display: inline-flex; align-items: center; min-height: 46px; padding: 0 20px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; transition: border-color .3s, color .3s; }
.foot__links a:first-child { background: var(--signal); color: var(--signal-ink); border-color: var(--signal); font-weight: 600; }
.foot__links a:hover { border-color: var(--bone); }
.foot__legal { color: var(--bone-50); font-size: .82rem; display: grid; gap: 4px; text-align: right; }
.foot__legal p { margin: 0; }
.foot__legal a { color: var(--bone-70); text-underline-offset: 3px; }

/* ———————————————— Телефон ———————————————— */
@media (max-width: 899px) {
  :root { --header-h: 56px; }
  .top__nav { gap: 16px; }
  .top__nav a { font-size: .82rem; }
  .top__logo span { display: none; }
  .opening { min-height: auto; align-items: stretch; }
  .opening__photo { position: relative; height: 78vw; min-height: 300px; }
  .opening__photo img { position: absolute; object-position: 50% 62%; }
  .opening::before { background: linear-gradient(180deg, rgba(14,23,20,.55) 0%, rgba(14,23,20,0) 18%, rgba(14,23,20,0) 30%, rgba(14,23,20,.94) 52%, var(--ground) 62%); }
  .opening { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; }
  .opening__photo, .opening__body, .opening__caption { grid-column: 1; }
  .opening__photo { grid-row: 1; }
  .opening__body { grid-row: 2; max-width: none; padding: 0 var(--pad) 36px; margin-top: -48px; }
  .opening__caption { position: static; grid-row: 1; align-self: start; justify-self: end; padding: calc(var(--header-h) + 8px) var(--pad) 0; font-size: .72rem; z-index: 1; }
  .opening__title { font-size: clamp(2rem, 9.4vw, 3rem); }
  .opening__jump a { flex: 1; }
  .journeys { flex-direction: column; height: auto; gap: 2px; }
  .journey { flex: none; height: auto; display: block; scroll-margin-top: var(--header-h); }
  /* Фото — верхняя часть панели, текст ниже на тёмном грунте: фигура и название остаются видны */
  .journey__photo, .journey__photo img, .journey__cut { bottom: auto; height: 122vw; }
  .journey::after { inset: auto 0 auto 0; top: 70vw; height: 54vw; background: linear-gradient(rgba(14,23,20,0), var(--ground) 92%); }
  .journey { background: var(--ground); }
  .journey__body { position: relative; padding-top: 108vw; }
  .journey--shaolin .journey__photo img, .journey--shaolin .journey__cut { object-position: 50% 56%; }
  .journey--phuket .journey__photo img, .journey--phuket .journey__cut { object-position: var(--focus-x-m) 50%; }
  .journey--shaolin .journey__name { top: 44vw; font-size: 14.2cqw; }
  .journey--phuket .journey__name { top: 47vw; font-size: 16.4cqw; }
  .journey__name { text-shadow: 0 3px 30px rgba(14, 23, 20, .55); }
  .journey__body { grid-template-columns: 1fr; grid-template-areas: "place" "desc" "rail" "dates" "note" "cta"; }
  .journey__cta { justify-self: start; margin-top: 18px; }
  .founders { grid-template-columns: 1fr; }
  .founders__photo img { aspect-ratio: 4 / 4.4; }
  .foot { grid-template-columns: 1fr; }
  .foot__legal { text-align: left; }
}

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

/* Временные страницы направлений (этапы 2–3) */
.stub { padding: clamp(56px, 10vw, 140px) var(--pad); max-width: 900px; }
.stub__tag { margin: 0 0 18px; font: 700 .8rem/1.2 var(--f-display); letter-spacing: .12em; text-transform: uppercase; color: var(--signal); }
.stub__title { margin: 0 0 24px; font: 800 clamp(2.4rem, 7vw, 6rem)/.95 var(--f-display); letter-spacing: -.04em; text-transform: uppercase; }
.stub p { font-size: clamp(1.05rem, 1.4vw, 1.3rem); line-height: 1.6; color: var(--bone-70); max-width: 52ch; }
.stub a { color: var(--bone); text-underline-offset: 4px; }
