/* iryna.id: сторінка «скоро». Один шрифт (Roboto Flex), одна рухома деталь: слово розтягується. */

@font-face {
  font-family: "Roboto Flex";
  font-style: normal;
  font-weight: 100 1000;
  font-stretch: 25% 151%;
  font-display: swap;
  src: url("/fonts/roboto-flex-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* Той самий файл під іншим ім'ям для великого слова: воно чекає на шрифт (block),
   бо запасний шрифт не вміє розтягуватися. Текст під ним з'являється одразу (swap). */
@font-face {
  font-family: "Roboto Flex Soon";
  font-style: normal;
  font-weight: 100 1000;
  font-stretch: 25% 151%;
  font-display: block;
  src: url("/fonts/roboto-flex-cyrillic.woff2") format("woff2");
}

@font-face {
  font-family: "Roboto Flex";
  font-style: normal;
  font-weight: 100 1000;
  font-stretch: 25% 151%;
  font-display: swap;
  src: url("/fonts/roboto-flex-latin.woff2") format("woff2");
  unicode-range: U+0020-007E, U+00A0, U+00AB, U+00BB, U+2013-2014, U+2019, U+201C-201E, U+2026;
}

:root {
  --cobalt: #2a36c9;
  --peach: #ffc2b0;
  --chalk: #f4f2ff;

  --gutter: clamp(20px, 5vw, 64px);
  /* Слово «скоро» у найширшому накресленні займає ~3.02em. Розмір підібрано так,
     щоб воно дотягувалося від лівого поля до правого й не виходило за нього. */
  --soon-size: min(calc((100vw - 2 * var(--gutter)) / 3.08), 50vh);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--cobalt);
  color-scheme: only light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: max(var(--gutter), env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right))
    max(var(--gutter), env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  overflow-x: clip;
  background: var(--cobalt);
  color: var(--chalk);
  font-family: "Roboto Flex", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: clamp(1.0625rem, 0.95rem + 0.5vw, 1.375rem);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.mark {
  margin: 0;
  font-size: 1em;
  font-stretch: 125%;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--chalk);
}

.stage {
  align-self: center;
  /* Оптичний центр трохи вище геометричного. */
  padding-bottom: 8vh;
}

.soon {
  /* Від'ємний відступ вирівнює округлу «с» по лівому краю тексту. */
  margin: 0 0 0 -0.028em;
  width: max-content;
  color: var(--peach);
  font-family: "Roboto Flex Soon", "Roboto Flex", system-ui, sans-serif;
  font-size: var(--soon-size);
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  font-variation-settings: "wdth" 151, "wght" 420, "opsz" 144;
  animation:
    reach 1.9s cubic-bezier(0.22, 1, 0.3, 1) 0.15s both,
    breathe 9s ease-in-out 2.05s infinite alternate;
}

.lede {
  margin: calc(var(--soon-size) * 0.14 + 0.4em) 0 0;
  max-width: 34ch;
  font-stretch: 110%;
  font-weight: 400;
  color: var(--chalk);
  text-wrap: pretty;
  animation: arrive 0.9s ease-out 1.1s both;
}

/* Гумка: чим ширше розтягнута, тим тонша. */
@keyframes reach {
  from {
    font-variation-settings: "wdth" 25, "wght" 900, "opsz" 144;
  }
  to {
    font-variation-settings: "wdth" 151, "wght" 420, "opsz" 144;
  }
}

@keyframes breathe {
  from {
    font-variation-settings: "wdth" 151, "wght" 420, "opsz" 144;
  }
  to {
    font-variation-settings: "wdth" 112, "wght" 620, "opsz" 144;
  }
}

@keyframes arrive {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .soon,
  .lede {
    animation: none;
  }
}

@media (orientation: landscape) and (max-height: 480px) {
  .stage {
    padding-bottom: 0;
  }

  :root {
    --soon-size: min(calc((100vw - 2 * var(--gutter)) / 3.08), 42vh);
  }
}
