/* Inter from our own server (assets/fonts, the converter's @fontsource files): no requests to third-party
   font services. Variable font, weights 100–900; Cyrillic and Latin subsets. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("assets/fonts/inter-cyrillic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  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;
}

/* Manrope — шрифт блока 2 по макету (там же, @fontsource-variable/manrope, OFL) */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("assets/fonts/manrope-cyrillic-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url("assets/fonts/manrope-latin-wght-normal.woff2") format("woff2-variations");
  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;
}

/* Palette, type and shapes follow the converter (converter/apps/web/src/styles/tokens.css):
   flat surfaces with 24px corners, Inter, pill buttons, glass for floating bars.
   Two themes (theme.js sets <html data-theme>): dark — near-black with white as the accent,
   light — the converter's light theme with the IT blue as the accent. */
:root {
  color-scheme: dark;
  --color-bg: #0b0b0d;              /* --bg */
  --color-surface: #18181b;         /* --surface-0: cards, panels */
  --color-surface-2: #222225;       /* --surface-2: hover, cards on a panel */
  --color-default: #27272a;         /* --surface-3: secondary buttons, chips */
  --color-border: #27272a;          /* --border-1 */
  --color-border-2: #3f3f46;        /* --border-2 */
  --color-text: #fcfcfc;            /* --text-1 */
  --color-text-2: #d4d4d8;          /* --text-2 */
  --color-muted: #a1a1aa;           /* --text-3 */
  --color-accent: #fcfcfc;          /* on black the accent is white */
  --color-accent-hover: #e4e4e7;
  --color-accent-rgb: 255, 255, 255;
  --color-on-accent: #0b0b0d;       /* label on an accent fill */
  --color-hover-soft: rgba(255, 255, 255, 0.06);
  --color-danger: #ff6b86;          /* --danger */
  --focus-ring: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-accent);
  --glass-bg: rgba(24, 24, 27, 0.72);
  --glass-edge: inset 0 0 1px 0 rgba(255, 255, 255, 0.3);   /* --elev-float */
  --glass-blur: blur(22px) saturate(150%);
  /* header — clear glass: the page shows through, a strong blur keeps the menu readable, a light rim and
     a sheen from the top give the pane its edge */
  --header-bg: rgba(24, 24, 27, 0.3);
  --header-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 70%);
  --header-edge: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 32px rgba(0, 0, 0, 0.24);
  --header-blur: blur(28px) saturate(180%);
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --page-gutter: 32px;
  --font-base: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tracking-tight: -0.018em;
}

/* Light theme — the converter's [data-theme='light'] tokens; on white the accent is the IT blue */
:root[data-theme="light"] {
  color-scheme: light;
  --color-bg: #f5f5f5;
  --color-surface: #ffffff;
  --color-surface-2: #f2f2f3;
  --color-default: #ebebec;
  --color-border: #e4e4e7;
  --color-border-2: #d4d4d8;
  --color-text: #18181b;
  --color-text-2: #3f3f46;
  --color-muted: #71717a;
  --color-accent: #1f5fd6;          /* --it, light */
  --color-accent-hover: #1a50b8;
  --color-accent-rgb: 31, 95, 214;
  --color-on-accent: #ffffff;
  --color-hover-soft: rgba(11, 15, 25, 0.05);
  --color-danger: #d92d4b;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --header-bg: rgba(255, 255, 255, 0.38);
  --header-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 70%);
  --header-edge: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 0 0 1px rgba(255, 255, 255, 0.5), 0 0 0 1px rgba(11, 15, 25, 0.06), 0 8px 32px rgba(11, 15, 25, 0.08);
  --glass-edge: inset 0 0 1px 0 rgba(11, 15, 25, 0.28), 0 8px 24px rgba(11, 15, 25, 0.06);
}

/* Logo (inline SVG, ~/Documents/logo/logo.svg): the brand-blue tile with a white mark in both themes,
   the wordmark in the text colour */
.logo__tile {
  fill: #2038e2;
}

.logo__glyph {
  fill: #fff;
}

.logo__word {
  fill: var(--color-text);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-base);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(var(--color-accent-rgb), 0.35);
}

/* Page scrollbar: a blue pill (the logo's brand blue) on a clear track, in both themes.
   Chrome and Safari draw it from ::-webkit-scrollbar; Firefox only knows scrollbar-color —
   set it there alone, because in Chrome scrollbar-color would override the pill. */
html::-webkit-scrollbar {
  width: 12px;
}

html::-webkit-scrollbar-track {
  background: transparent;
}

html::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: #2038e2 padding-box;
}

html::-webkit-scrollbar-thumb:hover {
  background-color: #1a2fc4;
}

@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-color: #2038e2 transparent;
  }
}



/* Loading screen (loader.js): the dark of the first screen with the logo tile breathing in the middle.
   The dark covers the page from the very first paint — otherwise the page flashes before it — and the logo
   fades in right away; loader.js keeps the screen up for at least a moment so it doesn't just flicker. */
.loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #0b0b0d;
  transition: opacity 0.5s ease, visibility 0s linear 0.5s;
}

.loader__mark {
  animation:
    loader-in 0.3s ease both,
    loader-breathe 1.6s ease-in-out 0.3s infinite;
}

.is-loaded .loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes loader-in {
  from { opacity: 0; }
}

@keyframes loader-breathe {
  50% {
    opacity: 0.4;
    transform: scale(0.92);
  }
}

@media (prefers-reduced-motion: reduce) {
  .loader__mark {
    animation: loader-in 0.3s ease both;
  }
}

/* Each screen is one viewport tall */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

/* First screen: hero content pinned to the bottom left over the ASCII background (.hero-ascii).
   It looks the same in both themes — always the dark palette, so the light theme
   doesn't repaint it. No stacking context here, so the background stays under the particle canvas #c.
   The header takes the same dark palette while it is over the first screen, the dark cards of
   «Как это работает» or the blue features fill (header-on-hero.js): on wide screens each of its parts
   on its own (.is-on-dark), on phones the whole bar (.header--on-hero). */
.page--hero,
.page--manifest,
.header--on-hero,
.header .is-on-dark {
  color-scheme: dark;
  --color-bg: #0b0b0d;
  --color-text: #fcfcfc;
  --color-text-2: #d4d4d8;
  --color-muted: #a1a1aa;
  --color-accent: #fcfcfc;
  --color-accent-hover: #e4e4e7;
  --color-accent-rgb: 255, 255, 255;
  --color-on-accent: #0b0b0d;
  --color-default: #27272a;
  --color-hover-soft: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
}

/* the hero's top is bright: the header's glass is a little denser and the menu brighter there */
.header--on-hero,
.header .is-on-dark {
  --header-bg: rgba(11, 11, 13, 0.36);
  --glass-bg: rgba(24, 24, 27, 0.72);
  --header-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0) 70%);
  --header-edge: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 32px rgba(0, 0, 0, 0.24);
  --color-muted: #e4e4e7;
}

/* the menu pill hangs off a dark card onto the light page: denser glass, so it reads dark all the way */
.header .is-on-edge {
  --header-bg: rgba(18, 18, 21, 0.86);
}

.page--hero {
  z-index: auto;
  display: flex;
  flex-direction: column;
  --hero-bottom: 125px;          /* the button's distance from the screen's bottom edge */
  padding: 0 var(--page-gutter);
  overflow-x: clip;
}

/* Background of the first screen — GradientASCII (gradient-ascii.js) */
.hero-ascii {
  position: absolute;
  inset: 0 0 -2px;                 /* на 2 px ниже экрана, под блок 2: на дробном стыке не просвечивает светлая страница */
  z-index: -1;
  overflow: hidden;
  background: var(--color-bg);   /* dark in both themes, see .page--hero */
  pointer-events: none;
}

.hero-ascii__canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Header — fixed to the top of the window over every screen, like the converter's floating bars:
   dark glass with a thin light edge and 24px corners; inside: logo, menu, login */
.header {
  --header-top: 16px;
  position: fixed;
  top: var(--header-top);
  left: var(--page-gutter);
  right: var(--page-gutter);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 10px 0 20px;
  border-radius: 32px;           /* concentric with the 44px pills: 22px + the 10px inset */
  background-color: var(--header-bg);
  background-image: var(--header-sheen);
  box-shadow: var(--header-edge);
  -webkit-backdrop-filter: var(--header-blur);
  backdrop-filter: var(--header-blur);
}

/* scrolling down the header slides up out of the window, scrolling back brings it in (header-menu.js);
   it goes past its own top offset and the 32px shadow of the menu pill, so nothing peeks at the edge */
/* coming back: a soft glide with a long slow-down; leaving: a gentle start and stop, a little longer,
   fading out as it goes */
.header {
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
}

.header--hidden {
  opacity: 0;
  transform: translateY(calc(-100% - var(--header-top) - 40px));
  transition: transform 0.7s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.5s ease 0.15s;
}

@media (prefers-reduced-motion: reduce) {
  .header {
    transition: none;
  }
}

/* the phone menu opens inside the header over the page — there the glass is denser, so the links stay readable */
.header.is-menu-open {
  background-color: var(--glass-bg);
}

.header__logo,
.header__actions {
  flex: 0 0 200px;
}

.header__logo .logo {
  display: block;
  width: 132px;
  height: auto;
}

.header__actions {
  display: flex;
  justify-content: flex-end;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Burger (header-menu.js) — phones only, see the 768px breakpoint: two lines that turn into a cross */
.header__actions .header__burger {
  display: none;
}

.header__burger-lines,
.header__burger-lines::before {
  position: relative;
  display: block;
  width: 16px;
  height: 1.8px;
  border-radius: 1px;
  background: currentColor;
  transform: translateY(-3.5px);
  transition: transform 0.25s var(--ease);
}

.header__burger-lines::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(7px);
}

.header.is-menu-open .header__burger-lines {
  transform: rotate(45deg);
}

.header.is-menu-open .header__burger-lines::before {
  transform: rotate(-90deg);
}

.nav .btn {
  flex-shrink: 0;
}

/* Wide screens: no frame around the whole header — logo and «Войти» float on their own,
   the glass is only around the menu in the middle. The tabs are the size of «Войти» (44px, 22px sides);
   the 6px inset keeps the 56px pill inside the 64px header. On phones the header keeps its glass:
   the menu opens inside it (see the 768px breakpoint). */
@media (min-width: 769px) {
  /* без плашки — без отступов внутри: логотип и «Войти» по краям сетки страницы, вровень с блоками */
  .header {
    padding: 0;
    background: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .nav {
    padding: 6px;
    border-radius: 999px;
    background-color: var(--header-bg);
    background-image: var(--header-sheen);
    box-shadow: var(--header-edge);
    -webkit-backdrop-filter: var(--header-blur);
    backdrop-filter: var(--header-blur);
  }

  .nav .btn {
    height: 44px;
    padding: 0 22px;
  }
}

/* Buttons — the converter's pills: blue primary with white label, grey default, quiet ghost */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
}

/* <button class="btn"> — reset browser defaults without outranking the variants */
:where(button.btn) {
  background: none;
  color: inherit;
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.btn__label {
  position: relative;
}

.btn--primary,
.btn--light {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.btn--primary:hover,
.btn--light:hover {
  background: var(--color-accent-hover);
}

/* the arrow after the label, as on «Создать чертёж» in the converter */
.btn--primary::after,
.btn--light::after {
  content: '';
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s var(--ease);
}

.btn--primary:hover::after,
.btn--light:hover::after {
  transform: translateX(2px) rotate(45deg);
}

/* Solid accent without the arrow — «Войти» in the header: white on the dark hero, blue on white */
.btn--solid {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.btn--solid:hover {
  background: var(--color-accent-hover);
}

/* Secondary — the converter's «default» button */
.btn--outline {
  background: var(--color-default);
  color: var(--color-text);
}

.btn--outline:hover {
  background: var(--color-border-2);
}

/* Header menu: text only, a soft fill on hover */
.btn--ghost {
  height: 40px;
  padding: 0 14px;
  background: transparent;
  color: var(--color-muted);
}

.btn--ghost:hover {
  background: var(--color-hover-soft);
  color: var(--color-text);
}

/* Hero. Also serves as #zone — the empty area particles fly around,
   so it hugs its content instead of stretching full width. The title sits in the middle
   of the screen (rows 1fr / auto / 1fr), the button at the bottom, in the dark part of the gradient. */
.hero {
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  justify-items: center;
  align-self: center;
  flex: 1;
  text-align: center;
  max-width: 100%;
}

.hero .btn {
  grid-row: 3;
  align-self: end;
  margin-bottom: var(--hero-bottom);
}

/* Display type in medium weight */
.hero__title {
  grid-row: 2;
  max-width: 1100px;
  margin: 0;
  color: var(--color-text);
  font-size: clamp(34px, 3.3vw, 64px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: var(--tracking-tight);
  /* appears out of a blur once the loading screen goes (loader.js removes .is-loading); the delay lets
     the loading screen start fading first */
  transition: opacity 1s ease 0.15s, filter 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s;
}

.is-loading .hero__title {
  opacity: 0;
  filter: blur(20px);
}

@media (prefers-reduced-motion: reduce) {
  .is-loading .hero__title {
    filter: none;
  }
}

.page--hero .btn {
  height: 52px;
  padding: 0 28px;
  font-size: 16px;
}

.page--hero > .hero {
  position: relative;
  z-index: 1;
}

/* Block 2 — «как это работает», по макету (Figma, кадр 1920): 12 колонок с полями 32 и промежутком 24.
   Заголовок, карточки и подписи — колонки 5–12 (x 659, ширина 1229), пункты шагов — колонка 1 (x 32),
   верх пунктов вровень с первой карточкой; при прокрутке пункты прилипают, и подсвечен тот, чья
   карточка сейчас в окне (how-scroll.js). Размеры — от кадра 1920 через vw, не крупнее макета.
   Текст — Manrope, как в макете. Цвета макета — в светлой теме; в тёмной — те же роли на тёмном. */
.page--how {
  --how-text: #1a1a1a;
  --how-dim: #a1a1a1;
  --how-brand: #2038e2;
  --how-card: #888;
  --how-bg: #f1f1f1;
  --how-ink: #000;                  /* подписи под карточками в макете — чистый чёрный */
  min-height: 0;
  padding: clamp(40px, calc(69 / 1920 * 100vw), 69px) var(--page-gutter);
  background: var(--how-bg);
  color: var(--how-text);
  font-family: "Manrope", var(--font-base);
  font-feature-settings: normal;
}

/* Вход в блок (how-reveal.js): белая кнопка первого экрана сжимается в круг и опускается (.how-dot),
   блок доезжает до верха окна тёмным и стоит, пока из круга раскрывается светлый экран .how__fill (скрипт
   задаёт ему clip-path); потом по очереди проявляются заголовок, пункты и карточки (.is-open). Содержимое
   ниже обычного — чтобы при быстрой прокрутке заголовок не проскакивал. Сверху ещё лишний отступ на длину
   сцены (--how-reveal) — содержимое скрипт на столько же поднимает и по мере прокрутки опускает */
.page--how.is-scene {
  padding-top: calc(clamp(140px, 24vh, 260px) + var(--how-reveal, 0px));
  background: #0b0b0d;
}

.how-dot {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9;                      /* над страницей, под шапкой */
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px;
  color: #0b0b0d;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  will-change: transform, width;
}

.how__fill {
  display: none;
}

.page--how.is-scene .how__fill {
  display: block;
  position: absolute;
  inset: 0;
  background: var(--how-bg);
  clip-path: inset(50%);
  pointer-events: none;
}

.page--how.is-scene .how {
  position: relative;
  will-change: transform;
}

.page--how.is-scene :is(.how__title, .how__steps, .how__card) {
  opacity: 0;
  transform: translateY(40px);
  filter: blur(8px);
}

.page--how.is-ready :is(.how__title, .how__steps, .how__card) {
  transition: opacity 0.45s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.45s ease;
  transition-delay: calc(min(var(--i, 0), 3) * 0.08s);
}

.page--how.is-open :is(.how__title, .how__steps, .how__card) {
  opacity: 1;
  transform: none;
  filter: none;
}

/* назад — скрываются разом, без очереди */
.page--how.is-ready:not(.is-open) :is(.how__title, .how__steps, .how__card) {
  transition-duration: 0.3s;
  transition-delay: 0s;
}

:root:not([data-theme="light"]) .page--how {
  --how-text: var(--color-text);
  --how-dim: #52525b;
  --how-brand: #5b72ff;
  --how-card: #3f3f46;
  --how-bg: var(--color-surface);
  --how-ink: var(--color-text);
}

.how {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, calc(24 / 1920 * 100vw), 24px);
  align-items: start;
}

.how__title {
  grid-column: 5 / 13;
  margin: 0;
  font-size: clamp(26px, calc(54 / 1920 * 100vw), 54px);
  font-weight: 600;
  line-height: 1.1;                 /* 59.4 / 54 */
}

.how__brand {
  color: var(--how-brand);
}

/* пункты — колонка 1, но строки длиннее колонки: тянутся на 1–4; прилипают, пока не дойдут до низа блока —
   подписи под последней карточкой */
.how__steps {
  grid-column: 1 / 5;
  grid-row: 2;
  position: sticky;
  top: 120px;                       /* под фиксированной шапкой */
  display: flex;
  flex-direction: column;
  gap: clamp(20px, calc(40 / 1920 * 100vw), 40px);  /* шаг 80 = строка 40 + пустая строка 40 */
  margin: clamp(40px, calc(77 / 1920 * 100vw), 77px) 0 0;   /* вровень с первой карточкой */
  padding: 0;
  list-style: none;
}

.how__step {
  font-size: clamp(18px, calc(32 / 1920 * 100vw), 32px);
  font-weight: 500;
  line-height: clamp(22px, calc(40 / 1920 * 100vw), 40px);
  white-space: nowrap;
  color: var(--how-dim);
  cursor: pointer;
  transition: color 0.3s var(--ease);
}

.how__step.is-active {
  color: var(--how-text);
}

/* заголовок шага над карточкой — только на телефоне, вместо пунктов слева */
.how__label {
  display: none;
}

.how__cards {
  grid-column: 5 / 13;
  grid-row: 2;
  display: flex;
  flex-direction: column;
  gap: clamp(64px, calc(120 / 1920 * 100vw), 120px);
  margin: clamp(40px, calc(77 / 1920 * 100vw), 77px) 0 0;  /* верх карточки 324: заголовок в макете 179 (три строки по 59,4, вверх) */
  padding: 0;
  list-style: none;
}

/* заглушка карточки — серый прямоугольник 1229×606 */
.how__visual {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1229 / 606;
  background: var(--how-card);
}

/* Анимации шагов (how-upload.js, how-ascii.js) — в теме, обратной сайту: в светлой теме карточка
   тёмная, как генерация в конвертере, в тёмной — белая. Под неё же цвета папки и символов */
.how__visual:has(canvas, .how__ascii, .hf__stage, .hfm__stage) { background: #050505; }
:root[data-theme="dark"] .how__visual:has(canvas, .how__ascii, .hf__stage, .hfm__stage) { background: #fff; }

/* Карточка 2 — выбор формата (how-format.js): карточки форматов из конвертера (.fpick в
   apps/web/src/styles/app.css, тёмная тема). Размеры — от ширины карточки: --u — 1 px конвертера
   (там выбор шириной ~640 px, здесь 70cqw). Рамка — кольцо под лицевой стороной: под ним за курсором
   ходит синее пятно (.hfm__glow, координаты --x/--y ставит скрипт) — светится сквозь рамку и чуть внутри. */
.hfm {
  container-type: inline-size;
}

.hfm__stage {
  --u: 0.11cqw;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hfm__pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(12 * var(--u));
  width: 70cqw;
}

.hfm__card {
  position: relative;
  display: grid;
  padding: 1px;
  border-radius: calc(20 * var(--u));
  background: rgba(255, 255, 255, 0.08);
  transition: background-color 0.24s ease, transform 150ms ease-out;
}

.hfm__card.is-press {
  transform: scale(0.98);
}

.hfm__card[aria-checked="true"] {
  background: rgba(77, 141, 255, 0.65);
}

.hfm__glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle calc(240 * var(--u)) at var(--x, 50%) var(--y, 50%),
    #7fd4ff 0%, #3a8dff 28%, #2038e2 52%, transparent 75%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.hfm__card.is-hover .hfm__glow {
  opacity: 1;
}

.hfm__face {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: calc(12 * var(--u));
  min-height: calc(84 * var(--u));
  padding: calc(16 * var(--u)) calc(20 * var(--u)) calc(16 * var(--u)) calc(16 * var(--u));
  border-radius: calc(20 * var(--u) - 1px);
  background: rgba(6, 7, 9, 0.84);   /* почти фон карточки; пятно чуть просвечивает внутри */
  color: #f4f5f7;
  font-family: var(--font-base);
  transition: background-color 0.24s ease;
}

.hfm__card[aria-checked="true"] .hfm__face {
  background: rgba(11, 20, 36, 0.84); /* --accent-soft конвертера поверх тёмного */
}

.hfm__check {
  flex: none;
  display: grid;
  place-items: center;
  width: calc(22 * var(--u));
  height: calc(22 * var(--u));
  margin-top: calc(2 * var(--u));
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  color: transparent;
  transition: background-color 0.24s ease, border-color 0.24s ease, color 0.24s ease;
}

.hfm__check svg {
  width: calc(14 * var(--u));
  height: calc(14 * var(--u));
}

.hfm__card[aria-checked="true"] .hfm__check {
  border-color: transparent;
  background: #4d8dff;
  color: #fff;
}

.hfm__body {
  display: grid;
  gap: calc(4 * var(--u));
  min-width: 0;
}

.hfm__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: calc(12 * var(--u));
}

.hfm__title {
  font-size: calc(18 * var(--u));
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.hfm__price,
.hfm__desc {
  font-size: calc(13 * var(--u));
  line-height: 1.45;
}

.hfm__price {
  color: #868c97;
  white-space: nowrap;
}

.hfm__desc {
  color: #b3b8c2;
}

.hfm__cursor {
  position: absolute;
  left: -0.4cqw;
  top: -0.25cqw;
  width: 2.4cqw;
  height: 2.4cqw;
  opacity: 0;
  pointer-events: none;
  transform-origin: 15% 10%;
  filter: drop-shadow(0 0.2cqw 0.4cqw rgba(0, 0, 0, 0.3));
  will-change: transform, opacity;
}

.hfm__cursor svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Карточка 1 — папка загрузки из конвертера (how-upload.js): разметка и стили — как у .upl в
   apps/web/src/styles/app.css, только размеры от ширины карточки (cqw; там папка 220 px — здесь 36cqw).
   Карточка в теме, обратной сайту: в светлой теме — тёмная папка конвертера на чёрном, в тёмной —
   светлая на белом. Ниже базовые цвета светлой папки, тёмная — в правилах :root:not([data-theme="dark"]) */
.hf {
  container-type: inline-size;
}

.hf__stage {
  --upl-front-top: #eef1f5;
  --upl-front-bot: #d5dae2;
  --upl-back-top: #c9cfd8;
  --upl-back-bot: #b3bbc7;
  --upl-edge: #ffffff;
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

:root:not([data-theme="dark"]) .hf__stage {
  --upl-front-top: #3d4249;
  --upl-front-bot: #1b1e22;
  --upl-back-top: #2c3036;
  --upl-back-bot: #191b1f;
}

.hf__art {
  position: relative;
  display: block;
  width: 36cqw;
  aspect-ratio: 280 / 200;
  margin-top: 4cqw;
  perspective: 115cqw;               /* 700 px на 220 px папки */
}

.hf__back,
.hf__front {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hf__back {
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1), filter 500ms ease-out;
}

.hf__front {
  transform-origin: 50% 100%;
  filter: drop-shadow(0 1.9cqw 2.7cqw rgba(11, 15, 25, 0.22));
  transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

:root:not([data-theme="dark"]) .hf__front {
  filter: drop-shadow(0 2.4cqw 3.3cqw rgba(0, 0, 0, 0.45));
}

.hf__glow {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 26%;
  height: 26%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(11, 15, 25, 0.18), transparent 100%);
  filter: blur(1.7cqw);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 500ms ease-out, transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
}

:root:not([data-theme="dark"]) .hf__glow {
  background: radial-gradient(closest-side, #fff, rgba(255, 255, 255, 0.45) 45%, transparent 100%);
}

/* над папкой держат файл */
.hf__stage[data-state="open"] .hf__back {
  transform: translateY(-1.64cqw);
  filter: brightness(1.25);
}

.hf__stage[data-state="open"] .hf__front {
  transform: rotateX(-22deg);
}

.hf__stage[data-state="open"] .hf__glow {
  opacity: 0.55;
  transform: scale(1);
}

.hf__stage[data-state="ready"] .hf__glow {
  opacity: 0.18;
  transform: scale(0.8);
}

/* ярлычок файла в папке и файл в руке */
.hf__chip,
.hf__ghost {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 0.98cqw;
  height: 4.58cqw;
  padding: 0 1.64cqw;
  border-radius: 0.96cqw;
  border: 1px solid rgba(11, 15, 25, 0.12);
  background: linear-gradient(180deg, #ffffff, #eef0f3);
  color: #0b0f19;
  font-family: var(--font-base);
  font-size: 1.88cqw;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 1.1cqw 2.5cqw -1.4cqw rgba(11, 15, 25, 0.35);
}

:root:not([data-theme="dark"]) .hf__chip,
:root:not([data-theme="dark"]) .hf__ghost {
  border-color: rgba(255, 255, 255, 0.28);
  background: linear-gradient(180deg, #5a5e66, #3a3d43);
  color: #f4f5f7;
  box-shadow: 0 1.1cqw 2.5cqw -1.1cqw rgba(0, 0, 0, 0.6);
}

.hf__chip svg,
.hf__ghost svg {
  width: 2.16cqw;
  height: 2.16cqw;
  flex: none;
}

.hf__chip {
  left: 50%;
  top: 14%;
  opacity: 0;
  transform: translateX(-50%) rotate(-3deg);
  transition: opacity 400ms ease-out;
}

.hf__stage[data-state="ready"] .hf__chip {
  opacity: 1;
  transition: none;                 /* полёт из руки на место — how-upload.js (settle) */
}

.hf__flash {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 14%;
  height: 46%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(11, 15, 25, 0.22), transparent 100%);
  filter: blur(1.95cqw);
  opacity: 0;
  pointer-events: none;
  animation: hf-flash 1100ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

:root:not([data-theme="dark"]) .hf__flash {
  background: radial-gradient(closest-side, #fff, rgba(255, 255, 255, 0.55) 40%, transparent 100%);
  mix-blend-mode: screen;
}

/* курсор с файлом — координаты ставит how-upload.js; острие курсора — в точке руки */
.hf__hand {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.hf__ghost {
  left: 0;
  top: 0;
  opacity: 0.92;
}

.hf__cursor {
  position: absolute;
  left: -0.4cqw;
  top: -0.25cqw;
  width: 2.4cqw;
  height: 2.4cqw;
  filter: drop-shadow(0 0.2cqw 0.4cqw rgba(0, 0, 0, 0.3));
}

.hf__cursor svg {
  display: block;
  width: 100%;
  height: 100%;
}

@keyframes hf-flash {
  0% { opacity: 0; transform: scale(0.5); }
  30% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .hf__flash {
    animation: none;
  }
}
/* Карточка 3 — старт генерации (how-ascii.js): папка из карточки 1 с файлом и под ней «Создать чертёж» —
   кнопка конвертера (.ds-btn--primary.ds-btn--lg: синий --it-500, белый текст, справа шеврон). Размеры —
   от ширины карточки, как у папки. Нажали — папка и кнопка рассыпаются на символы (холст .hg__dust),
   из них собирается деталь */
.hg__ui {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3.4cqw;
  will-change: opacity;
}

.hg .hf__art {
  margin-top: 0;
}

.hg__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.9cqw;
  width: 36cqw;
  height: 5.6cqw;
  border-radius: 1.3cqw;
  background: #1f5fd6;
  color: #fff;
  font-family: var(--font-base);
  font-size: 1.95cqw;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.hg__btn svg {
  width: 2.2cqw;
  height: 2.2cqw;
  flex: none;
}

.hg__btn.is-hover {
  background: #2a6ae0;
}

.hg__btn.is-press {
  transform: scale(0.97);
}

.hg__cursor {
  position: absolute;
  left: -0.4cqw;
  top: -0.25cqw;
  width: 2.4cqw;
  height: 2.4cqw;
  opacity: 0;
  pointer-events: none;
  transform-origin: 15% 10%;
  filter: drop-shadow(0 0.2cqw 0.4cqw rgba(0, 0, 0, 0.3));
  will-change: transform, opacity;
}

.hg__cursor svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hg__dust {
  pointer-events: none;
}

.how__visual > canvas,
.how__ascii {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.how__text {
  max-width: calc(1028 / 1229 * 100%);   /* в макете подпись уже карточки: 1028 из 1229 */
  margin: clamp(12px, calc(20 / 1920 * 100vw), 20px) 0 0;
  font-size: clamp(16px, calc(26 / 1920 * 100vw), 26px);
  font-weight: 500;
  line-height: 1.2;                 /* 31.2 / 26 */
  color: var(--how-ink);
}

/* Блок 3 — «зачем мы это делаем» (manifest.js): тёмный экран с символами STEP и текстом по центру.
   В сцене (.is-scene) блок подложен под последний экран блока 2 (отрицательный отступ ставит скрипт) и
   прилипает к окну; блок 2 поверх него замирает и схлопывается в белый круг (.manifest__dot), круг опускается
   к тексту, растворяется, и текст складывается по буквам; дальше по прокрутке текст подсвечивается, потом
   проявляются подпись и кнопка.
   Высоту блока под сцену ставит скрипт. */
.page--manifest {
  position: relative;
  background: var(--color-bg);
}

/* блок 2 — поверх подложенного под него блока 3 (у всех .page z-index 1 — позже в разметке был бы сверху);
   снизу пустое светлое место — схлопывание начинается не сразу под последней карточкой */
.page--how:has(+ .page--manifest.is-scene) {
  z-index: 2;
  padding-bottom: calc(clamp(40px, calc(69 / 1920 * 100vw), 69px) + 45vh);
}

.manifest__stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 120px var(--page-gutter);
  overflow: clip;
}

.page--manifest.is-scene .manifest__stage {
  position: sticky;
  top: 0;
  height: 100vh;
}

.manifest__grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.manifest__dot {
  display: none;
}

.page--manifest.is-scene .manifest__dot {
  display: block;
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 999px;
  background: #f1f1f1;
  opacity: 0;
  pointer-events: none;
  will-change: transform, width, height, opacity;
}

/* текст, подпись и кнопка — колонкой по центру; подпись того же кегля через одну пустую строку */
.manifest__body {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: "Manrope", var(--font-base);
  font-size: clamp(22px, 2.6vw, 50px);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
}

.manifest__sub {
  margin: 1.15em 0 0;
  color: var(--color-text);
}

/* кнопка — как «Создать чертёж» на первом экране: белая на тёмном (палитра .page--manifest выше) */
.manifest__cta {
  height: 52px;
  margin-top: clamp(28px, 2.5vw, 48px);
  padding: 0 28px;
  font-family: var(--font-base);
  font-size: 16px;
}

/* подпись и кнопка проявляются по прокрутке, по очереди: .is-sub, потом .is-cta (manifest.js) */
.page--manifest.is-scene :is(.manifest__sub, .manifest__cta) {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(6px);
  transition: opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
}

.page--manifest.is-sub .manifest__sub,
.page--manifest.is-cta .manifest__cta {
  opacity: 1;
  transform: none;
  filter: none;
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.6s ease;
}

.manifest__text {
  max-width: 35em;                  /* три строки на широком экране */
  margin: 0;
  text-wrap: balance;
}

/* слова не рвутся; буквы — клетки, которые сцена прячет (.is-off) или показывает символом STEP (.is-scr)
   на месте буквы — ширина строки при этом не меняется */
.manifest__word {
  white-space: nowrap;
}

/* сложившиеся буквы сначала приглушены (.is-dim), потом по прокрутке подсвечиваются (.is-lit) */
.manifest__ch {
  transition: color 0.35s ease;
}

.manifest__ch.is-dim {
  color: rgba(244, 245, 247, 0.28);
}

.manifest__ch.is-lit {
  color: var(--color-text);
}

.manifest__ch.is-off {
  opacity: 0;
}

.manifest__ch.is-scr {
  position: relative;
  color: transparent;
  transition: none;
}

.manifest__ch.is-scr::after {
  content: attr(data-s);
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  color: #3a8dff;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-weight: 500;
}

/* Block 4 — features: a surface screen with a 3×2 grid of cards. Sizes follow the 1920px
   design frame (cards 603 wide, 24px gaps, 30px card padding), 355 tall at 1920 and lower
   (190px from the top vs 154). */
.page--features {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
}

.features__stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: max(128px, 9.9vw) var(--page-gutter) max(32px, 2.92vw);   /* top clears the fixed header */
}

/* Scroll scene (features-scroll.js): the stage sticks to the window; the surface comes from
   .features__fill, which grows out of the square from block 2 (script sets its clip-path); cards
   then fade in one by one (.is-open). .is-tall — cards are taller than the window (phones): they
   start at the top and the script scrolls them up inside the stage. */
.features__fill {
  display: none;
}

.page--features.is-scene {
  background: none;
  pointer-events: none;          /* while empty it lies over the last step of block 2 — let clicks through */
}

.page--features.is-scene .features__fill {
  display: block;
  position: absolute;
  inset: 0;
  background: var(--color-surface);
  clip-path: inset(50%);
}

.page--features.is-scene .features__stage {
  position: sticky;
  top: 0;
  height: 100vh;
  flex: none;
  overflow: clip;
}

.page--features.is-tall .features__stage {
  justify-content: flex-start;
}

.page--features .features {
  position: relative;
}

.page--features.is-scene .feature {
  opacity: 0;
  transform: translateY(40px);
}

.page--features.is-ready .feature {
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), background-color 0.15s var(--ease);
  transition-delay: calc(var(--i, 0) * 0.04s);
}

.page--features.is-open .feature {
  opacity: 1;
  transform: none;
}

.page--features.is-open {
  pointer-events: auto;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 1.25vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A card on a panel — the converter's --surface-2 */
.feature {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-height: clamp(200px, 18.5vw, 355px);
  padding: clamp(20px, 1.5625vw, 30px) clamp(20px, 1.5625vw, 30px) clamp(24px, 2.083vw, 40px);
  border-radius: var(--radius-xl);
  background: var(--color-surface-2);
}

.feature__title {
  margin: 0;
  font-size: clamp(22px, 2.083vw, 40px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: var(--tracking-tight);
}

.feature__text {
  max-width: 21em;                /* одна мера во всех карточках; переносы — браузер, без висячих коротких строк */
  margin: 0;
  text-wrap: pretty;
  font-size: clamp(16px, 1.3vw, 25px);
  font-weight: 400;
  line-height: 1.2;               /* leading = font size × 1.2 */
  color: var(--color-muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Блок 5 — вопросы на чисто белом фоне, как блок 4 над ним (его --color-surface), — стык не виден;
   карточки вопросов на белом — светло-серые */
.page--faq {
  min-height: 0;
  background: #ffffff;
}

/* Title on columns 1–5 (sticks below the header while the list scrolls), questions from column 7 —
   the same grid as the steps of block 2 */
.faq {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 1.25vw, 24px);
  align-items: start;
  padding: clamp(24px, 2.5vw, 48px) var(--page-gutter) 125px;
}

.faq__title {
  grid-column: 1 / 6;
  position: sticky;
  top: 144px;
  margin: 0;
  font-size: clamp(34px, 3.3vw, 64px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: var(--tracking-tight);
}

/* Questions — converter cards stacked with small gaps */
.faq__list {
  grid-column: 7 / 13;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.faq__item {
  --pad-x: clamp(20px, 1.5625vw, 30px);
  border-radius: var(--radius-xl);
  background: var(--color-surface-2);
  transition: background-color 0.15s var(--ease);
}

.faq__item:hover {
  background: #e9e9eb;
}

.faq__q {
  margin: 0;
  font: inherit;
}

.faq__toggle {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  padding: clamp(18px, 1.46vw, 28px) var(--pad-x);
  border: 0;
  border-radius: var(--radius-xl);
  background: none;
  color: var(--color-text);
  font: inherit;
  font-size: clamp(18px, 1.46vw, 28px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: var(--tracking-tight);
  text-align: left;
  cursor: pointer;
}

.faq__toggle:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Plus that turns into a cross */
.faq__icon {
  position: relative;
  flex: none;
  width: 0.6em;
  height: 0.6em;
  margin-top: 0.32em;
  color: var(--color-muted);
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.15s;
}

.faq__toggle:hover .faq__icon,
.faq__item.is-open .faq__icon {
  color: var(--color-accent);
}

.faq__icon::before,
.faq__icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1.5px;
  margin-top: -0.75px;
  background: currentColor;
}

.faq__icon::after {
  transform: rotate(90deg);
}

.faq__item.is-open .faq__icon {
  transform: rotate(45deg);
}

/* Answer slides open: the row grows from 0fr to 1fr */
.faq__a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.faq__item.is-open .faq__a {
  grid-template-rows: 1fr;
}

.faq__a-inner {
  overflow: hidden;
}

.faq__a p {
  max-width: 34em;
  margin: 0;
  padding: 0 var(--pad-x) clamp(20px, 1.67vw, 32px);
  font-size: clamp(16px, 1.2vw, 22px);
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-muted);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.faq__item.is-open .faq__a p {
  opacity: 1;
  transform: none;
  transition-delay: 0.1s;
}

/* Pixel band between blocks (dissolve.js): the solid colour at the top crumbles into the clear one */
.dissolve {
  --dissolve-solid: var(--color-surface);
  --dissolve-clear: var(--color-bg);
  --dissolve-ink: var(--dissolve-solid);   /* the crumbs at the bottom and the falling particles */
  height: clamp(160px, 17.7vw, 340px);
}

/* on white the crumbs are the IT blue */
:root[data-theme="light"] .dissolve {
  --dissolve-ink: var(--color-accent);
}

/* Between FAQ and contact both sides are the page background — no band needed */
.dissolve--up {
  display: none;
}

.dissolve canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

/* Block 5 — contact form (the last block): one big converter card; intro on columns 1–5,
   form from column 7. */
/* фон — чисто белый, как у вопросов над ним: иначе вокруг белой карточки виден серый край, как рамки */
.page--contact {
  min-height: 0;
  padding: 0 var(--page-gutter) clamp(24px, 2.5vw, 48px);
  background: #ffffff;
}

.contact {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 1.25vw, 24px);
  align-items: start;
  /* карточка белая на белом — её не видно, поэтому без боковых отступов: текст вровень с остальными блоками */
  padding: clamp(28px, 3.33vw, 64px) 0;
  border-radius: var(--radius-xl);
  background: var(--color-surface);
}

.contact__intro {
  grid-column: 1 / 6;
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2.08vw, 40px);
}

.contact__title {
  margin: 0;
  font-size: clamp(30px, 2.8vw, 54px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
}

.contact__lead {
  margin: 0;
  font-size: clamp(16px, 1.25vw, 22px);
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-muted);
}

.contact__direct {
  display: grid;
  gap: 16px;
  margin: 0;
}

.contact__direct dt {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-muted);
}

.contact__direct dd {
  margin: 4px 0 0;
  font-size: clamp(17px, 1.25vw, 22px);
  font-weight: 500;
}

.contact__direct a {
  color: var(--color-accent);
  text-decoration: none;
}

.contact__direct a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.contact__form {
  grid-column: 7 / 13;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 1.46vw, 28px) clamp(12px, 1.25vw, 24px);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.field--wide,
.field--topics {
  grid-column: 1 / -1;
}

.field--topics .field__label {
  margin-bottom: 10px;           /* a legend ignores the fieldset's gap */
}

.field__label {
  padding: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-2);
}

.field__opt {
  color: var(--color-muted);
  font-weight: 400;
}

/* Input — the converter's filled field: a panel tone on the card, 12px corners, blue ring on focus */
.field__input {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--color-bg);
  color: var(--color-text);
  font: inherit;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field__input::placeholder {
  color: var(--color-muted);
}

.field__input:hover {
  border-color: var(--color-border-2);
}

.field__input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(var(--color-accent-rgb), 0.2);
}

.field__input--area {
  min-height: 8em;
  resize: vertical;
}

.field.is-invalid .field__input {
  border-color: var(--color-danger);
}

.field__error {
  min-height: 0;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-danger);
}

.field__error:empty {
  display: none;
}

/* Topic chips — the converter's segmented choice: grey pills, the chosen one blue */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  height: 38px;
  padding: 0 16px;
  font-size: 14px;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip:has(input:checked) {
  background: rgba(var(--color-accent-rgb), 0.16);
  color: var(--color-accent);
  box-shadow: inset 0 0 0 1px rgba(var(--color-accent-rgb), 0.5);
}

.chip:has(input:focus-visible) {
  box-shadow: var(--focus-ring);
}

/* Consent checkbox: a rounded box that fills blue with a tick */
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--color-muted);
  cursor: pointer;
}

.check input {
  appearance: none;
  flex: none;
  position: relative;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid var(--color-border-2);
  border-radius: 6px;
  background: var(--color-bg);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.check input:checked {
  border-color: var(--color-accent);
  background: var(--color-accent);
}

.check input:checked::after {
  content: '';
  position: absolute;
  left: 5.5px;
  top: 2px;
  width: 5px;
  height: 10px;
  border-right: 2px solid var(--color-on-accent);
  border-bottom: 2px solid var(--color-on-accent);
  transform: rotate(45deg);
}

.check input:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.field.is-invalid .check input {
  border-color: var(--color-danger);
}

.contact__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
}

/* the submit button is the main action of the form — the accent, like «Создать чертёж» */
.contact__actions .btn {
  background: var(--color-accent);
  color: var(--color-on-accent);
}

.contact__actions .btn:hover {
  background: var(--color-accent-hover);
}

.contact__status {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-muted);
}

/* After sending, the form gives way to a thank-you note */
.contact__form.is-sent > :not(.contact__done) {
  display: none;
}

.contact__done {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact__done h3 {
  margin: 0;
  font-size: clamp(22px, 2.083vw, 40px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: var(--tracking-tight);
}

.contact__done p {
  margin: 0;
  font-size: clamp(16px, 1.25vw, 22px);
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-muted);
}

.contact__done:focus {
  outline: none;
}

.contact__again {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-accent);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.contact__again:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Footer — on the page background like the converter's: brand on columns 1–5,
   link columns from column 7 (the same 12-column grid), legal line at the bottom */
.footer {
  position: relative;
  z-index: 1;
  padding: 0 var(--page-gutter) 32px;
  background: var(--color-bg);
  color: var(--color-text);
}

.footer__main {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(12px, 1.25vw, 24px);
  row-gap: 40px;
  padding: clamp(40px, 3.33vw, 64px) 0;
}

.footer__brand {
  grid-column: 1 / 6;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer__brand .logo {
  display: block;
  width: 140px;
  height: auto;
}

.footer__tagline {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  color: var(--color-muted);
}

.footer__col {
  grid-column: span 2;
}

.footer__heading {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.footer__col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer__col a {
  color: var(--color-text-2);
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
  transition: color 0.15s;
}

.footer__col a:hover,
.footer__col a:focus-visible {
  color: var(--color-text);
  outline: none;
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  font-size: 13px;
  font-weight: 400;
  color: var(--color-muted);
}

.footer__legal p {
  margin: 0;
}

/* Document pages (/offer/, /terms/, … — built by tools/build-legal.py): the site's header and
   footer around a plain text column. Under the fixed header, like the other blocks. */
.doc {
  max-width: calc(860px + 2 * var(--page-gutter));
  padding: 144px var(--page-gutter) 125px;
}

/* a link to a section (/privacy/#cookies) stops below the fixed header, not under it */
.doc [id] {
  scroll-margin-top: 104px;
}

.doc__title {
  margin: 0;
  font-size: clamp(32px, 2.8125vw, 54px);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
}

.doc__updated {
  margin: 16px 0 0;
  font-size: 14px;
  font-weight: 400;
  color: var(--color-muted);
}

.doc__body {
  margin-top: 48px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-text-2);
}

.doc__body h2 {
  margin: 48px 0 16px;
  font-size: clamp(20px, 1.5vw, 26px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

.doc__body h2:first-child {
  margin-top: 0;
}

.doc__body p,
.doc__body ul,
.doc__body ol {
  margin: 0 0 16px;
}

.doc__body ul,
.doc__body ol {
  padding-left: 1.4em;
}

.doc__body li + li {
  margin-top: 8px;
}

/* маркеры списков — синие квадраты, как знак сайта */
.doc__body ul {
  list-style: square;
}

.doc__body li::marker {
  color: var(--color-accent);
}

.doc__body a {
  color: var(--color-accent);
  text-underline-offset: 3px;
}

.doc__tablewrap {
  margin: 24px 0;
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.doc__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

.doc__table th,
.doc__table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.doc__table tr:last-child td {
  border-bottom: 0;
}

.doc__table th {
  font-weight: 500;
  color: var(--color-muted);
}

/* реквизиты: подпись слева, значение справа, тонкие линии между строками */
.doc__requisites {
  margin: 0;
  border-top: 1px solid var(--color-border);
}

.doc__requisites div {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 24px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.doc__requisites dt {
  color: var(--color-muted);
}

.doc__requisites dd {
  margin: 0;
  color: var(--color-text);
}

/* Cookie notice (cookie-notice.js) — glass card in the bottom right corner, like the converter's */
.cookie {
  position: fixed;
  z-index: 30;
  right: 20px;
  bottom: 20px;
  display: grid;
  justify-items: start;
  gap: 10px;
  width: min(320px, calc(100vw - 32px));
  padding: 18px;
  border-radius: var(--radius-xl);
  background: var(--glass-bg);
  box-shadow: var(--glass-edge);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  color: var(--color-text-2);
  font-size: 14px;
  line-height: 1.45;
  animation: cookie-in 0.24s cubic-bezier(0.2, 0, 0, 1) both;
}

.cookie__head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text);
}

.cookie__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.cookie__text {
  margin: 0;
}

.cookie__text a {
  color: var(--color-accent);
  text-underline-offset: 2px;
}

.cookie__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cookie .cookie__ok {
  height: 38px;
  padding: 0 18px;
  font-size: 14px;
}

.cookie .cookie__ok::after {
  display: none;               /* no arrow: it closes, it doesn't lead anywhere */
}

@keyframes cookie-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie {
    animation: none;
  }
}

/* Сдвиги, которые держат содержимое на месте, пока идёт прокрутка (сцены how-reveal.js, manifest.js,
   features-scroll.js), ведёт сама прокрутка — animation-timeline: браузер двигает их вместе со страницей.
   Скрипт на телефоне отставал бы от прокрутки на кадр, и содержимое дрожало бы. Длины ставят скрипты
   (--how-reveal, --manifest-hold, --features-*); без поддержки сдвигают они же. Отсчёт — contain 0: верх
   блока у верха окна (блоки выше окна), дальше пиксели прокрутки, сдвиг — один к одному. */
@supports (animation-timeline: view()) {
  /* блок 2 стоит, пока раскрывается светлый экран: содержимое сдвинуто вверх и опускается с прокруткой */
  .page--how.is-scene {
    view-timeline: --how-scene block;
  }

  .page--how.is-scene .how {
    animation: how-reveal-hold linear both;
    animation-timeline: --how-scene;
    animation-range: contain 0px contain var(--how-reveal);
  }

  /* карточки выше окна (телефон) едут вверх внутри прилипшего блока */
  .page--features.is-tall {
    view-timeline: --features-scene block;
  }

  .page--features.is-tall .features {
    animation: features-slide linear both;
    animation-timeline: --features-scene;
    animation-range: contain var(--features-slide-from) contain calc(var(--features-slide-from) + var(--features-over));
  }
}

/* блок 2 замирает, пока схлопывается в круг: сдвинут вниз ровно на прокрученное от прилипания блока 3 */
@supports (animation-timeline: view()) and (timeline-scope: --a) {
  main {
    timeline-scope: --manifest-scene;
  }

  .page--manifest.is-scene {
    view-timeline: --manifest-scene block;
  }

  .page--how:has(+ .page--manifest.is-scene) {
    animation: manifest-hold linear both;
    animation-timeline: --manifest-scene;
    animation-range: contain 0px contain var(--manifest-hold);
  }
}

@keyframes how-reveal-hold {
  from { transform: translate3d(0, calc(-1 * var(--how-reveal)), 0); }
  to { transform: none; }
}

@keyframes features-slide {
  to { transform: translate3d(0, calc(-1 * var(--features-over)), 0); }
}

@keyframes manifest-hold {
  to { transform: translate3d(0, var(--manifest-hold), 0); }
}

/* Responsive */
@media (max-width: 1280px) {
  .footer__brand {
    grid-column: 1 / 4;
  }

  .footer__col {
    grid-column: span 3;
  }
}

@media (max-width: 1400px) {
  /* when the menu doesn't fit between the logo and the login button, it scrolls sideways */
  .header__logo,
  .header__actions {
    flex: 0 0 auto;
  }

  .nav {
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }
}

/* tablets: the tabs at full «Войти» size no longer fit between logo and login — a little narrower */
@media (min-width: 769px) and (max-width: 1024px) {
  .nav .btn {
    padding: 0 14px;
    font-size: 14px;
  }
}

@media (max-width: 1024px) {

  .header__logo,
  .header__actions {
    flex-basis: auto;
  }

  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .faq__title {
    grid-column: 1 / 5;
  }

  .faq__list {
    grid-column: 5 / 13;
  }

  .contact__intro {
    grid-column: 1 / 5;
  }

  .contact__form {
    grid-column: 5 / 13;
  }

  .footer__brand {
    grid-column: 1 / -1;
  }

  .footer__col {
    grid-column: span 4;
  }
}

@media (max-width: 768px) {
  :root {
    --page-gutter: 16px;
  }

  .page--hero {
    --hero-bottom: 64px;
  }

  /* one row: logo, theme, «Войти», burger; the menu opens under them inside the header */
  .header {
    --header-top: 8px;
    flex-wrap: wrap;
    height: auto;
    padding: 8px 8px 8px 16px;
    border-radius: 27px;         /* the 38px pills: 19px + the 8px inset */
  }

  .footer__brand {
    grid-column: 1 / -1;
  }

  .footer__col {
    grid-column: span 6;
    hyphens: auto;               /* long words like «конфиденциальности» break by syllable */
  }

  .header__logo .logo {
    width: 116px;
  }

  .header__actions .btn {
    height: 38px;
    padding: 0 16px;
  }

  .header__actions {
    flex: none;
    gap: 4px;
  }

  .header__actions .header__burger {
    display: inline-flex;
    width: 38px;
    padding: 0;
    color: var(--color-text);
  }

  .nav {
    display: none;
    order: 3;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin: 6px -8px 0 -16px;
    padding: 6px 0 0;
    border-top: 1px solid var(--color-hover-soft);
    box-sizing: content-box;
  }

  .header.is-menu-open .nav {
    display: flex;
    animation: menu-in 0.25s var(--ease) both;
  }

  .nav .btn {
    justify-content: flex-start;
    height: 48px;
    padding: 0 16px;
    border-radius: 16px;
    font-size: 17px;
    color: var(--color-text);
  }

  .hero__title {
    font-size: 34px;
  }

  @keyframes menu-in {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
  }

  .br-desktop {
    display: none;
  }

  /* пунктов шагов нет — у каждой карточки свой заголовок; заголовок блока, карточки и подписи — на всю ширину */
  .page--how {
    padding-top: 112px;    /* clears the fixed header on phones */
  }

  .page--how.is-scene {
    padding-top: calc(150px + var(--how-reveal, 0px));
  }

  .how__title,
  .how__cards {
    grid-column: 1 / -1;
  }

  .how__steps {
    display: none;
  }

  .how__cards {
    margin-top: 40px;
  }

  .how__label {
    display: block;
    margin: 0 0 12px;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--how-text);
  }

  /* подпись — на всю ширину карточки; последняя строка не остаётся из одного короткого слова */
  .how__text {
    max-width: none;
    text-wrap: pretty;
  }

  .features__stage {
    padding-top: 112px;    /* clears the fixed header on phones */
  }

  /* манифест — только первое предложение, подпись и кнопка */
  .manifest__more {
    display: none;
  }

  /* фраза — на всю ширину экрана ровными строками: кегль от ширины, строки выравнивает text-wrap: balance */
  .manifest__text {
    font-size: clamp(22px, 7vw, 30px);
  }

  /* все карточки — одной высоты, по самой высокой; текст — до правого поля карточки, как слева */
  .features {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: 1fr;
  }

  .feature {
    min-height: 0;
  }

  .feature__text {
    max-width: none;
  }

  .faq {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 24px;
    padding-bottom: 64px;
  }

  .faq__title,
  .faq__list {
    grid-column: 1;
  }

  .faq__title {
    position: static;
  }

  /* вопросы — плашки одной высоты: на две строки (самые длинные вопросы), короткие — по центру по высоте */
  .faq__toggle {
    align-items: center;
    min-height: calc(2 * 1.25em + 2 * 18px);
    padding-block: 18px;
    font-size: 16px;
  }

  .faq__icon {
    margin-top: 0;
  }

  .contact {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 32px;
  }

  .contact__intro,
  .contact__form {
    grid-column: 1;
  }

  .contact__form {
    grid-template-columns: minmax(0, 1fr);
  }

  .doc {
    padding-top: 112px;    /* clears the fixed header on phones */
    padding-bottom: 64px;
  }

  .doc__body {
    font-size: 15px;
  }

  .doc__requisites div {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .cookie {
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: auto;
  }
}

.nowrap {
  white-space: nowrap;
}

/* Акция в первом экране (sale.js): стеклянная плашка над заголовком, как кнопки шапки на тёмном фоне */
.hero .sale-chip {
  grid-row: 1;
  align-self: end;
  margin-bottom: 28px;
}
.sale-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(24, 24, 27, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 32px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fcfcfc;
  font-size: 15px;
  line-height: 1.2;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.sale-chip[hidden] {
  display: none;
}
.sale-chip:hover {
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(39, 39, 42, 0.8);
}
.sale-chip__badge {
  padding: 4px 10px;
  border-radius: 999px;
  background: #2f6bff;
  color: #fff;
  font-weight: 600;
}
.sale-chip__text b {
  font-weight: 600;
}
.sale-chip__text s {
  color: #a1a1aa;
}
.sale-chip__timer {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-variant-numeric: tabular-nums;
  color: #e4e4e7;
}
@media (max-width: 640px) {
  .sale-chip {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 20px;
    font-size: 14px;
    max-width: calc(100vw - 32px);
  }
}
