/*
 * Alpenglow landing. Tokens are the app's (spec §9, packages/app/src/styles/tokens.css).
 * Four text sizes, each with one job:
 *   display  the name, once
 *   title    the slogan and every section's claim
 *   body     what a section says
 *   small    labels, chart axes, captions, the one button
 * Outfit for the name and the claims; Inter for everything else, and every number.
 * Outfit has no Cyrillic, so in Russian the claims are Inter too; the name stays Outfit.
 */
@font-face { font-family: 'Outfit'; font-weight: 300 700; font-display: swap; src: url('fonts/outfit-latin.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400 600; font-display: swap; src: url('fonts/inter-latin.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 400 600; font-display: swap; src: url('fonts/inter-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root:lang(ru) { --display: var(--text); }
.i18n-wait body { opacity: 0; }

:root {
  color-scheme: light;
  --bg: #eef1f5;
  --surface: #ffffff;
  --line: #dde4ec;
  --ink: #17222b;
  --muted: #5b6b78;
  --deep: #16232c;
  --on-deep: #dde4ec;
  --on-deep-muted: #93a3b1;
  --accent: #b8446b;
  --cool: #2d6c99;
  --accent-soft: #f6dbe2;

  --display: 'Outfit', 'Inter', system-ui, sans-serif;
  --text: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --brand: 'Outfit', 'Inter', system-ui, sans-serif;

  --fs-display: clamp(64px, 11vw, 128px);
  --fs-title: clamp(26px, 3vw, 38px);
  --fs-body: 18px;
  --fs-small: 14px;

  --max: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 18px;
  --shadow: 0 1px 2px rgba(22, 35, 44, .04), 0 16px 40px rgba(22, 35, 44, .08);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-body)/1.55 var(--text);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--cool); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -999px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--surface); padding: 8px 12px; }

/* ---------- the bar: the name and the only link to the app. Clear over the video, solid after it. */
.bar {
  position: fixed; inset: 0 0 auto; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; padding-inline: var(--gutter);
  color: #fff; border-bottom: 1px solid transparent;
  transition: background-color .25s, color .25s, border-color .25s;
}
.bar--solid { background: var(--bg); color: var(--ink); border-bottom-color: var(--line); }
.wordmark { font: 600 var(--fs-small)/1 var(--brand); letter-spacing: .24em; text-transform: uppercase; }
.button {
  font: 500 var(--fs-small)/1 var(--text);
  text-decoration: none; color: #fff; background: var(--accent);
  padding: 12px 20px; border-radius: 999px;
}
.button:hover { background: #a33a5d; }
.button .narrow { display: none; }
.bar__end { display: flex; align-items: center; gap: 20px; }
.lang { display: flex; gap: 2px; }
.lang button {
  font: 500 var(--fs-small)/1 var(--text); letter-spacing: .06em;
  color: inherit; background: none; border: 0; cursor: pointer;
  padding: 8px 6px; opacity: .55;
}
.lang button[aria-pressed="true"] { opacity: 1; }
.lang button:hover { opacity: 1; }

/* ---------- type */
h1, .title { margin: 0; font-family: var(--display); font-weight: 500; text-wrap: balance; }
h1 { font-family: var(--brand); font-size: var(--fs-display); line-height: .95; letter-spacing: -.03em; }
.title { font-size: var(--fs-title); line-height: 1.15; letter-spacing: -.01em; }
.body, .lead { margin: 0; color: var(--muted); text-wrap: pretty; max-width: 34em; }
.body p { margin: 0; }
.body p + p { margin-top: .6em; }
.label { margin: 0; font-size: var(--fs-small); font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* ---------- hero: the video edge to edge, the name on it */
.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: flex-end;
  min-height: clamp(560px, 88vh, 900px);
  background: var(--deep); color: #fff;
}
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, rgba(8, 14, 18, .45), rgba(8, 14, 18, 0) 140px),
    linear-gradient(to top, rgba(8, 14, 18, .6), rgba(8, 14, 18, 0) 55%),
    linear-gradient(to right, rgba(8, 14, 18, .35), rgba(8, 14, 18, 0) 60%);
}
.hero__copy { position: relative; z-index: 1; padding-block: 120px clamp(56px, 9vh, 104px); }
.hero .title { margin-top: 20px; }
.hero .lead { margin-top: 12px; color: rgba(255, 255, 255, .86); }
.hero__pause {
  position: absolute; z-index: 1; right: var(--gutter); bottom: 24px; width: 40px; height: 40px;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(22, 35, 44, .45); color: #fff;
}
.hero__pause::before { content: ''; display: block; margin: auto; width: 10px; height: 12px; border-inline: 3px solid currentColor; }
.hero__pause[aria-pressed="true"]::before { width: 0; height: 0; border: 0; border-left: 11px solid currentColor; border-block: 7px solid transparent; margin-left: 15px; }

/* ---------- the split: claim left, explanation right, the chart below */
.split { padding-block: clamp(80px, 10vw, 120px) 0; }
.head { display: grid; grid-template-columns: 5fr 6fr; column-gap: 64px; row-gap: 12px; }
.head .label, .head .title { grid-column: 1; }
.head .body { grid-column: 2; grid-row: 2; align-self: end; }
.chart { margin: clamp(32px, 4vw, 48px) 0 0; }

/* ---------- a capability: picture and words side by side, sides alternating */
.row {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, .9fr);
  column-gap: clamp(40px, 5vw, 72px); align-items: center;
  padding-block: clamp(80px, 10vw, 128px) 0;
}
.row--flip { grid-template-columns: minmax(280px, .9fr) minmax(0, 1.6fr); }
.row--flip .shot { order: 2; }
.row .shot { margin: 0; }
.shot video { cursor: pointer; }
.row__text .title { margin-top: 12px; }
.row__text .body { margin-top: 16px; }

.shot img, .shot video {
  width: 100%; height: auto;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.chart {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(16px, 3vw, 32px);
}
.chart__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.toggle { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bg); }
.toggle button {
  font: 500 var(--fs-small)/1 var(--text); color: var(--muted);
  border: 0; background: none; cursor: pointer;
  padding: 10px 18px; border-radius: 999px;
}
.toggle button[aria-pressed="true"] { background: var(--deep); color: #fff; }
.chart__readout { margin: 0; font-size: var(--fs-small); color: var(--muted); display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.chart__num { font: 500 var(--fs-title)/1 var(--text); color: var(--ink); letter-spacing: -.01em; min-width: 4.2em; text-align: right; }
.chart__plot { margin-top: 24px; height: clamp(260px, 34vw, 420px); }
.chart__plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart__plot text { font: 400 var(--fs-small) var(--text); fill: var(--muted); }
.chart__plot .after { transition: opacity .6s; }
.chart__plot .faded { opacity: 0; }
.chart__plot .chart__note { opacity: 0; transition: opacity .6s; }
.chart__plot text.chart__note { fill: var(--ink); }
.chart__plot .chart__note.shown { opacity: 1; }
.chart__legend { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: var(--fs-small); }
.chart__legend li { display: flex; align-items: center; gap: 8px; transition: opacity .6s; }
.chart__legend li.gone { opacity: .35; }
.chart__legend i { width: 14px; height: 3px; border-radius: 2px; background: currentColor; }
.chart figcaption { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: var(--fs-small); color: var(--muted); max-width: 72em; }

/* ---------- caches: the planning screen, and the phone it turns into on the trail */
.shot--pair { display: grid; align-items: center; }
.shot--pair > * { grid-area: 1 / 1; }
.shot--pair img { width: 70%; }
.shot--pair img.handout {
  justify-self: end; width: 31%; margin-right: 6px;
  border: 0; border-radius: 22px;
  box-shadow: 0 0 0 6px var(--deep), 0 24px 60px rgba(22, 35, 44, .32);
}


/* ---------- who makes it: a face and a way to reach them */
.about {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .9fr);
  column-gap: clamp(40px, 5vw, 72px); align-items: center;
  padding-block: clamp(80px, 10vw, 128px) 0;
}
/* six columns: a wide shot and a tall one on top, three squares under them */
.about__photos { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.about__photos img { grid-column: span 2; aspect-ratio: 1; width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.about__photos .wide { grid-column: span 4; aspect-ratio: 4 / 3; }
.about__photos .tall { aspect-ratio: auto; min-height: 0; }
.about__text .title { margin-top: 12px; }
.about__text .body { margin-top: 16px; }
.contacts { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 16px 40px; }
.contacts li { display: grid; gap: 4px; }
.contacts a { color: var(--ink); text-decoration-color: var(--line); text-underline-offset: 4px; }
.contacts a:hover { text-decoration-color: currentColor; }
.contacts .social { display: inline-flex; align-items: center; gap: 8px; }
.contacts .social svg { flex: none; }

/* ---------- the form: the page's one ask, on the hero's colour */
.join { margin-top: clamp(96px, 12vw, 160px); background: var(--deep); color: var(--on-deep); scroll-margin-top: 64px; }
.join__in {
  display: grid; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr);
  column-gap: clamp(40px, 5vw, 72px); align-items: start;
  padding-block: clamp(72px, 9vw, 120px);
}
.join .label, .join .body { color: var(--on-deep-muted); }
.join .title { color: #fff; margin-top: 12px; }
.join__head .body { margin-top: 16px; }
.join__head { position: sticky; top: 104px; }

.form, .done {
  background: var(--surface); color: var(--ink);
  border-radius: var(--radius); box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
  padding: clamp(20px, 3vw, 36px);
}
.form { display: grid; gap: 20px; }
.form__pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; font-size: var(--fs-small); color: var(--muted); }
.join [hidden] { display: none; }
.field legend { padding: 0; margin-bottom: 8px; }
.field input, .field textarea {
  font: 400 var(--fs-body)/1.4 var(--text); color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 14px; width: 100%; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--cool); outline-offset: 0; border-color: transparent; background: var(--surface); }
.field input[aria-invalid="true"] { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips span {
  display: block; padding: 10px 16px; border-radius: 999px;
  background: var(--bg); color: var(--ink); font-size: var(--fs-small); line-height: 1;
  border: 1px solid var(--line);
}
.chips input:checked + span { background: var(--deep); border-color: var(--deep); color: #fff; }
.chips input:focus-visible + span { outline: 2px solid var(--cool); outline-offset: 2px; }
.checks { display: grid; gap: 12px; }
.checks label { display: flex; align-items: flex-start; gap: 12px; font-size: var(--fs-body); color: var(--ink); cursor: pointer; }
.checks input { width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--deep); flex: none; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; }
.form__end { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.form .button, .done .button { border: 0; cursor: pointer; font-size: var(--fs-small); padding: 14px 28px; }
.form .button[disabled] { opacity: .6; cursor: progress; }
.form__fine { margin: 0; flex: 1 1 240px; font-size: var(--fs-small); color: var(--muted); }
.form__error { margin: 0; font-size: var(--fs-small); color: var(--accent); }

.done:focus { outline: none; }
.checks a { color: var(--ink); text-underline-offset: 3px; }
.checks input[aria-invalid="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.done__share { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.done .done__share .body { margin-top: 0; }
.done .button--quiet { background: var(--deep); }
.done .button--quiet:hover { background: #22343f; }
.done .label, .done .body { color: var(--muted); }
.done .title { color: var(--ink); margin-top: 12px; }
.done .body { margin-top: 16px; }
.done__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; margin-top: 16px; }

/* ---------- footer */
.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  padding-block: 28px;
  font-size: var(--fs-small); color: var(--muted);
}

/* ---------- narrow: one column, words before the picture */
@media (max-width: 860px) {
  .row, .row--flip { grid-template-columns: 1fr; row-gap: 32px; }
  .row__text { order: -1; }
  .row--flip .shot { order: 0; }
  .head { grid-template-columns: 1fr; }
  .head .body { grid-column: 1; grid-row: auto; margin-top: 4px; }
  .about, .join__in { grid-template-columns: 1fr; row-gap: 32px; }
  .join__head { position: static; }
}
@media (max-width: 600px) {
  :root { --fs-body: 17px; }
  .shot--pair > * { grid-area: auto; }
  .shot--pair img { width: 100%; }
  .shot--pair img.handout { justify-self: center; width: 66%; margin: -24px 0 0; }
  .chart__num { text-align: left; min-width: 0; }
  .toggle button { padding-inline: 10px; white-space: nowrap; }
  .button .wide { display: none; }
  .button .narrow { display: inline; }
  .bar__end { gap: 12px; }
  .form__pair { grid-template-columns: 1fr; }
}

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