/* ==========================================================================
   Каркас: шрифты, токены, базовые стили, компоненты (кнопки, ссылки)
   Единицы: 1rem = 16px на макете 1920. На ширинах 1440–1920 root
   масштабируется (см. html), поэтому всё в rem подстраивается само.
   ========================================================================== */

/* ---------- Шрифты (self-host) ---------- */
@font-face {
  font-family: "Cascadia Mono";
  src: url("../fonts/CascadiaMono-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cascadia Mono";
  src: url("../fonts/CascadiaMono-Bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sofia Sans Extra Condensed";
  src: url("../fonts/SofiaSansExtraCondensed-ExtraBold.woff") format("woff");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Sofia Sans Extra Condensed";
  src: url("../fonts/SofiaSansExtraCondensed-Black.woff") format("woff");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Токены ---------- */
:root {
  /* цвета (переменные Figma) */
  --white: #ffffff;
  --black: #2b2e33;
  --gray: #949698;
  --orange: #fb230a;
  --blue: #0797ff;

  /* радиусы (Figma: s = 8) */
  --r-s: 0.5rem;
  --r-m: 1rem;
  --r-l: 1.5rem;

  /* шрифты */
  --font-mono: "Cascadia Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --font-display: "Sofia Sans Extra Condensed", "Arial Narrow", Impact, sans-serif;

  /* боковое поле страницы */
  --gutter: 4rem; /* 64px */
  --page-max: 120rem; /* 1920px */
}

/* ---------- Масштаб ---------- */
html {
  /* ≥1280: макет 1920 масштабируется целиком (1920 → 16px, 1280 → 10.67px).
     Уже 1280 включается адаптивная раскладка (см. sections.css), там root = 16px */
  font-size: clamp(10.667px, calc(100vw / 120), 16px);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

/* ---------- Сброс ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
body,
h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
img,
svg,
video {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

body {
  background: var(--white);
  color: var(--black);
  font-family: var(--font-mono);
  font-size: 1rem;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Контейнер страницы: макет 1920, шире — центрируем */
.container {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- Типографика ---------- */
/* Sofia Sans набирается жирным и плотным: между словами два пробела.
   В HTML пробелы схлопываются, поэтому добавляем word-spacing,
   равный ширине одного пробела шрифта (0.126em). */
.t-display {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  word-spacing: 0.126em;
}

.t-h1 {
  font-size: 8rem; /* 128 */
  line-height: 0.9;
  letter-spacing: -0.02em;
}
.t-h2 {
  font-size: 5rem; /* 80 */
  line-height: 1;
  letter-spacing: -0.02em;
}
.t-h5 {
  font-size: 2rem; /* 32 */
  line-height: 1;
  letter-spacing: -0.02em;
}
.t-h3 {
  font-size: 3.5rem; /* 56 */
  line-height: 1;
  letter-spacing: -0.02em;
}

.t-h4 {
  font-weight: 800;
  font-size: 2.5rem; /* 40 */
  line-height: 1;
  letter-spacing: -0.02em;
}
.t-numbers {
  font-size: 12.5rem; /* 200 */
  line-height: 1;
  letter-spacing: -0.02em;
}

.t-txt-xl {
  font-size: 1.5rem; /* 24 */
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.t-txt-l {
  font-size: 1.25rem; /* 20 */
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.t-txt-m {
  font-size: 1rem; /* 16 */
  line-height: 1.4;
  letter-spacing: -0.04em;
}

/* мелкий моноширинный текст не уходит ниже 12px при сжатии макета */
.t-txt-m,
.nav-link,
.btn--outline {
  font-size: max(1rem, 12px);
}
.t-txt-l {
  font-size: max(1.25rem, 14px);
}
.t-txt-xl {
  font-size: max(1.5rem, 16px);
}

/* ---------- Компоненты ---------- */
.icon {
  flex: none;
  display: block;
}
/* иконка-маска: красится в currentColor, поэтому меняет цвет вместе с текстом */
.icon--mask {
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.icon--download {
  --icon: url("../assets/download.svg");
}
.icon--telegram {
  --icon: url("../assets/telegram.svg");
}
.icon--globe {
  --icon: url("../assets/globe.svg");
}
.icon--figma {
  --icon: url("../assets/figma.svg");
}
.icon--arrow {
  --icon: url("../assets/arrow-up-right.svg");
}
.icon--16 {
  width: 1rem;
  height: 1rem;
}
.icon--24 {
  width: 1.5rem;
  height: 1.5rem;
}
.icon--32 {
  width: 2rem;
  height: 2rem;
}

/* кнопка-заливка (CTA) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--r-s);
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.3;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
}
.btn--cta {
  padding: 1.5rem 2.5rem;
  background: var(--orange);
  color: var(--white);
  font-size: 1.125rem; /* 18 */
  letter-spacing: -0.02em;
}
.btn--cta:hover {
  background: #e01d06;
}
.btn--cta:active {
  transform: translateY(1px);
}

/* кнопка-контур (шапка, подвал на тёмном/цветном фоне) */
.btn--outline {
  min-height: 3rem;
  padding: 0.4375rem 2rem;
  border: 1px solid var(--white);
  color: var(--white);
  font-size: 1rem;
  letter-spacing: -0.02em;
}
.btn--outline:hover {
  background: var(--white);
  color: var(--blue);
}

/* ссылка навигации [ Кейсы ] */
.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 3rem;
  padding: 0.625rem 1rem;
  font-size: 1rem;
  line-height: 1.3;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: opacity 0.2s;
}
.nav-link:hover {
  opacity: 0.6;
}
