/* ДВАНОЧИ — design system.
   Theme: «Луна в два часа ночи» — ink-blue night under a giant vector Moon,
   cold moonlight everywhere, amber only on actions (the one lit window),
   red and blue only in the wordmark. Grotesque display + mono details.

   Sections: tokens → fonts → base → utilities → header → hero → blocks →
   form → footer → thanks/error pages → motion. */

/* ---------- 1. Tokens ---------- */

:root {
  color-scheme: dark;

  /* colour */
  --bg: #0b1020;
  --bg-2: #121a33;
  --ink: #f3ede4;
  --ink-2: #d8d1c4;
  --muted: #a9a79f;
  --accent: #f2a93b;
  --accent-hover: #ffbd57;
  --accent-ink: #1a1206;
  /* wordmark: ДВА / НОЧИ. Red lives nowhere else; blue is the quiet second
     colour (5:1 on --bg), --blue-2 its text-safe tint (9.7:1). */
  --red: #ef3b45;
  --blue: #4f7df5;
  --blue-2: #9db8ff;
  --moon: #c3cfe8;
  --moon-rgb: 150, 176, 232;
  --danger: #ef7d55;
  --line: rgba(243, 237, 228, 0.14);
  --line-strong: rgba(243, 237, 228, 0.32);

  /* type */
  --font-display: "Unbounded", "Arial Black", Impact, sans-serif;
  --font-text: "Golos Text", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-numeral: clamp(4.75rem, 18vw, 15rem);
  --fs-display: clamp(3rem, 8vw, 7.5rem);
  --fs-h1: clamp(1.9rem, 3.6vw, 3.75rem);
  --fs-h2: clamp(1.75rem, 3.2vw, 2.75rem);
  --fs-h3: 1.25rem;
  --fs-lead: clamp(1.0625rem, 1.5vw, 1.3125rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;
  --fs-mono: 0.8125rem;

  /* space */
  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;
  --s-8: 4.5rem;
  --section-y: clamp(3.5rem, 9vw, 7rem);

  /* layout */
  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --col-gap: clamp(1rem, 2vw, 1.5rem);
  --header-h: 4.25rem;
  --radius: 2px;
  --dur: 150ms;
  --dur-reveal: 700ms;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 2. Fonts (self-hosted, OFL; Latin + Cyrillic subsets) ----------
   Google serves Unbounded and Golos Text as variable fonts; the files are
   restricted to the weights used here (700–900 / 400–500, see README), so
   the font-weight ranges below are the whole axis. Paths are unversioned on
   purpose: the <link rel=preload> in layout.html must point at the very same
   URL or the browser downloads the font twice. Changing a font = rename it. */

@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("../fonts/unbounded-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Unbounded";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("../fonts/unbounded-latin.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/golos-text-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/golos-text-latin.woff2") format("woff2");
  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;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin.woff2") format("woff2");
  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;
}

/* latin-ext carries the ruble sign (U+20BD); prices are always set in mono. */
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- 3. Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--fs-body) / 1.6 var(--font-text);
  font-feature-settings: "kern";
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Grain: SVG noise as a fixed overlay. Images from the stylesheet fall under
   img-src, which allows data: URLs. Off when the visitor asked for less
   motion/transparency — the texture is decoration, not information. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

@media (prefers-reduced-motion: reduce), (prefers-reduced-transparency: reduce) {
  body::before {
    display: none;
  }
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  line-height: 1.06;
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-family: var(--font-text);
  font-size: var(--fs-h3);
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.3;
}

p {
  margin: 0 0 var(--s-4);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--ink);
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--blue-2);
  text-decoration-color: currentColor;
}

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

::selection {
  background: var(--blue);
  color: #fff;
}

[id] {
  scroll-margin-top: calc(var(--header-h) + var(--s-4));
}

img,
svg {
  display: inline-block;
  max-width: 100%;
}

/* ---------- 4. Utilities ---------- */

.mono {
  font-family: var(--font-mono);
  font-size: 0.875em;
  font-feature-settings: "zero";
  letter-spacing: 0;
}

/* Skip link: the first tab stop, parked above the viewport until focused. */
.skip-link {
  position: absolute;
  top: var(--s-3);
  left: var(--s-3);
  z-index: 30;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font: 500 0.9375rem / 1.2 var(--font-text);
  text-decoration: none;
  transform: translateY(calc(-100% - var(--s-5)));
}

.skip-link:focus-visible {
  transform: none;
}

#main:focus {
  outline: none; /* landed here from the skip link; the content is the cue */
}

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

.icon {
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.3em;
}

/* Buttons: square corners, one accent. */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 0.8rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 500 0.9375rem / 1.2 var(--font-text);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover {
  background-color: var(--accent-hover); /* the spot (11b) lives in background-image */
  border-color: var(--accent-hover);
  color: var(--accent-ink);
}

.btn-secondary {
  border-color: var(--line-strong);
  color: var(--ink);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  color: var(--accent);
}

/* Text link with the arrow glyph (hero secondary). */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-weight: 500;
}

.link-arrow .icon-arrow {
  transition: transform var(--dur) ease-out;
}

.link-arrow:hover .icon-arrow {
  transform: translateY(2px);
}

/* The text sits in a span so the underline (resting 1 px line, 2 px in the
   text colour drawn from the left on hover) stops before the arrow glyph. */
.link-arrow {
  text-decoration: none;
}

.link-arrow > span {
  background:
    linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat,
    linear-gradient(var(--line-strong), var(--line-strong)) 0 100% / 100% 1px no-repeat;
}

.link-arrow:hover > span,
.link-arrow:focus-visible > span {
  background-size: 100% 2px, 100% 1px;
}

/* Full-bleed bar whose content lines up with the 1200px container. */
.site-header,
.site-footer {
  padding-inline: max(var(--gutter), calc((100% - var(--container)) / 2));
}

main {
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ---------- 5. Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--s-5);
  min-height: var(--header-h);
  padding-block: var(--s-3);
  border-bottom: 1px solid transparent;
  background: rgba(11, 16, 32, 0.82);
}

/* Backdrop only after scrolling, without JS: a scroll-driven animation over the
   first 160px. Browsers without it keep the translucent bar above. */
@supports (animation-timeline: scroll()) {
  .site-header {
    background: transparent;
    animation: header-scrolled linear both;
    animation-timeline: scroll(root);
    animation-range: 0 160px;
  }

  @keyframes header-scrolled {
    to {
      background: rgba(11, 16, 32, 0.82);
      border-color: var(--line);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }
  }
}

.wordmark,
.footer-wordmark {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
}

.wm-a {
  color: var(--red);
}

.wm-b {
  color: var(--blue);
}

.wordmark:hover {
  filter: brightness(1.2);
}

.site-nav {
  margin-inline: auto;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-header .btn-primary {
  margin-left: auto;
  padding: 0.6rem 1.1rem;
  font-size: 0.875rem;
}

@media (max-width: 767px) {
  .site-nav {
    display: none; /* anchors live in the footer; no hamburger, no JS */
  }
}

/* ---------- 6. Hero ----------
   A giant vector Moon behind the copy, at z-index -2: under the flashlight
   canvas (-1) and every block. It starts beneath the header and runs on into
   «Где подвох?». The disc is turned 80° so that Tycho and its rays sit on
   the left, in the light: ::after darkens the limb and lays the night side
   over the rest, where the text is. */

.hero {
  --moon-d: min(80vw, 150vh, 80rem);
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  /* One full screen: the next block starts at the fold. */
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  align-content: center;
  padding-block: 70vw var(--section-y);
  border-bottom: 1px solid var(--line);
}

/* Viewport-wide, clipped sideways: a disc wider than a phone must not widen
   its layout viewport (body's overflow-x does not stop that). */
.moon-sky {
  position: absolute;
  z-index: -2;
  top: calc(1.5rem - var(--header-h));
  left: 50%;
  width: 100vw;
  height: var(--moon-d);
  margin-left: -50vw;
  overflow-x: clip;
  pointer-events: none;
}

.moon {
  position: absolute;
  left: 50%;
  width: var(--moon-d);
  aspect-ratio: 1;
  margin-left: calc(var(--moon-d) * -0.545);
  border-radius: 50%;
  box-shadow: 0 0 9rem rgba(var(--moon-rgb), 0.14), 0 0 1.25rem rgba(var(--moon-rgb), 0.2);
}

.moon-img {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  border-radius: 50%;
  rotate: 80deg;
}

.moon::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 2;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, transparent 80%, rgba(4, 7, 16, 0.62)),
    radial-gradient(circle at 18% 50%, rgba(11, 16, 32, 0.08) 12%, rgba(11, 16, 32, 0.86) 42%);
}

.hero-copy {
  grid-column: 1 / -1;
}

.hero-lead {
  max-width: 34em;
  margin-top: var(--s-5);
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--ink-2);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4) var(--s-6);
  margin-top: var(--s-6);
}

.hero .caption {
  margin-top: var(--s-7);
  color: var(--muted);
}

/* Phones: the disc hangs from the top right as an arc, the copy under it. */
@media (max-width: 767px) {
  .hero {
    --moon-d: 150vw;
  }

  .moon-sky {
    top: -42vw;
  }

  .moon {
    margin-left: -28vw;
  }
}

@media (min-width: 768px) {
  .hero {
    padding-top: clamp(4rem, 9vw, 8rem);
  }

  .hero-copy {
    grid-column: 6 / 13;
  }
}

/* ---------- 7. Content blocks ---------- */

main > section {
  padding-block: var(--section-y);
}

main > section + section {
  border-top: 1px solid var(--line);
}

main > section > h2 {
  margin-bottom: var(--s-6);
}

.section-lead {
  max-width: 36em;
  font-size: var(--fs-lead);
  color: var(--ink-2);
}

.dash,
.cell-note,
.table-note,
.caption,
.case-meta,
.tariff-response,
.price-from,
.optional,
.consent,
.copyright,
.made-at {
  color: var(--muted);
}

/* 7a. «Где подвох?» — 4/8 editorial grid. The left column (question mark,
   title, price line) sticks while the argument scrolls past it. */

.why {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s-6) var(--col-gap);
}

.why-aside,
.why-body {
  grid-column: 1 / -1;
}

.why-mark {
  margin: 0 0 var(--s-4);
  font-family: var(--font-display);
  font-size: clamp(5rem, 12vw, 10rem);
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.04em;
  color: var(--moon);
}

.why-aside h2 {
  margin: 0;
}

.price-from {
  margin: var(--s-5) 0 0;
}

.why-body {
  max-width: 62ch;
}

.why-body > p {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--ink-2);
}

.pull-quote {
  margin: var(--s-6) 0;
  padding-left: var(--s-5);
  border-left: 2px solid var(--blue);
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 2.4vw, 1.875rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.pull-quote p {
  color: var(--ink);
}

.facts {
  display: grid;
  gap: var(--s-5) var(--col-gap);
  margin: var(--s-7) 0 0;
  padding-top: var(--s-5);
  border-top: 1px solid var(--line);
}

.fact dt {
  margin-bottom: var(--s-2);
  font-size: var(--fs-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-2);
}

.fact dd {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-2);
}

@media (min-width: 640px) {
  .facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .why-aside {
    grid-column: 1 / 5;
    position: sticky;
    top: calc(var(--header-h) + var(--s-5));
    align-self: start;
  }

  .why-body {
    grid-column: 5 / 13;
  }
}

@media (min-width: 1100px) {
  .why-body {
    grid-column: 6 / 13;
  }
}

/* 7b. «Как работаем» — one hairline runs across the row; each step starts
   with an amber tick on it and a mono number. Stacks below 640px, 2×2 to
   1024px, four across above. */

.steps,
.tariffs,
.case-list,
.socials,
.tariff-features {
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps {
  display: grid;
  gap: 0;
}

.step {
  --k: 0;
  position: relative;
  padding: var(--s-5) var(--s-5) var(--s-6) 0;
  border-top: 1px solid var(--line);
}

.step::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 2.5rem;
  height: 2px;
  background: var(--moon);
}

.step-num {
  display: block;
  margin-bottom: var(--s-4);
  font-size: 1rem;
  color: var(--moon);
}

/* A moon phase before each number, waxing 01 → 04, in currentColor (so it
   lights up with the number, 11e). */
.step-num::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.6em;
  border-radius: 50%;
  vertical-align: -0.12em;
  box-shadow: 0 0 0 1px rgba(var(--moon-rgb), 0.4);
  background: radial-gradient(circle at 18% 50%, transparent 0.5em, currentColor calc(0.5em + 0.5px));
}

.step:nth-child(2) .step-num::before {
  background: linear-gradient(90deg, transparent 50%, currentColor 50%);
}

.step:nth-child(3) .step-num::before {
  background: radial-gradient(circle at 78% 50%, currentColor 0.5em, transparent calc(0.5em + 0.5px));
}

.step:nth-child(4) .step-num::before {
  background: currentColor;
}

/* The connector line (11e): one segment per step along its hairline. --k on
   the step is its column in the current grid, so the segments (and the
   numbers) draw left to right across a row; it follows the same breakpoints
   as the grid below. */
.steps-line {
  position: absolute;
  top: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  overflow: visible;
}

.steps-line line {
  stroke: var(--moon);
  stroke-width: 1.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 0;
}

.step-title {
  margin-bottom: var(--s-2);
}

.step-text {
  max-width: 28em;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-2);
}

@media (min-width: 640px) {
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .step:nth-child(even) {
    --k: 1;
  }
}

@media (min-width: 1024px) {
  .steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .step:nth-child(3) {
    --k: 2;
  }

  .step:nth-child(4) {
    --k: 3;
  }
}

/* 7c. «Бесплатно vs платно» — full-width hairline table. It never scrolls
   sideways: the values are ticks and short notes, so on a phone the two value
   columns shrink to their headers and the feature names wrap. */

.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.compare-table th,
.compare-table td {
  padding: var(--s-4) var(--s-4) var(--s-4) 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.compare-table thead th {
  padding-top: 0;
  border-bottom-color: var(--line-strong);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.compare-table tbody th {
  font-weight: 500;
}

.compare-table th:first-child {
  width: 44%;
  padding-right: var(--s-5);
}

.compare-table td {
  width: 28%;
  padding-left: var(--s-5);
}

.compare-table .head-short {
  display: none;
}

/* Phone: short headers and tighter gaps. The value columns shrink to their
   longest word (1% width) and the feature column takes the rest; at 360px the
   minimum content widths still leave a few px spare. */
@media (max-width: 639px) {
  .compare-table .head-long {
    display: none;
  }

  .compare-table .head-short {
    display: inline;
  }

  .compare-table th:first-child {
    width: auto;
    padding-right: var(--s-3);
  }

  .compare-table td,
  .compare-table thead th:not(:first-child) {
    width: 1%;
    padding-left: 0;
    padding-right: var(--s-3);
  }

  .compare-table td:last-child,
  .compare-table thead th:last-child {
    padding-right: 0;
  }
}

/* 320px phones: the longest words («Дополнительные», «Прожектора») no longer
   fit at full size, so step the type down. */
@media (max-width: 359px) {
  .compare-table tbody th {
    font-size: var(--fs-small);
  }

  .compare-table .cell-note {
    font-size: 0.75rem;
  }

  .compare-table th:first-child,
  .compare-table td,
  .compare-table thead th:not(:first-child) {
    padding-right: var(--s-2);
  }

  .compare-table td:last-child,
  .compare-table thead th:last-child {
    padding-right: 0;
  }
}

.check {
  display: inline-flex;
  color: var(--blue-2);
}

.check .icon {
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.2em;
}

.cell-note {
  font-size: var(--fs-small);
}

.check + .cell-note {
  display: block;
  margin-top: var(--s-1);
}

.table-note {
  max-width: 48em;
  margin-top: var(--s-5);
}

/* 7d. Тарифы — three cards; the recommended one is lifted and carries the
   amber top border and the primary button. */

.pricing .section-lead {
  margin-bottom: var(--s-7);
}

.tariffs {
  display: grid;
  gap: var(--s-5);
  align-items: stretch;
}

.tariff {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--s-6) var(--s-5) var(--s-5);
  border: 1px solid var(--line);
  border-top: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg); /* opaque: the flashlight code stays outside the cards */
}

.tariff-recommended {
  border-top: 3px solid var(--accent);
  background: var(--bg-2);
}

.tariff-badge {
  position: absolute;
  top: 0;
  right: var(--s-5);
  margin: 0;
  padding: 0.2rem 0.5rem;
  transform: translateY(-50%);
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tariff-name {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.tariff-price {
  margin: var(--s-4) 0 var(--s-3);
  font-size: clamp(1.75rem, 2.4vw, 2.25rem);
  line-height: 1;
  font-feature-settings: "tnum", "zero";
}

.tariff-price .period {
  font-size: 0.45em;
  color: var(--muted);
}

.tariff-pitch {
  color: var(--ink-2);
}

.tariff-features {
  margin-top: var(--s-5);
  border-top: 1px solid var(--line);
}

.tariff-features li {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.tariff-features li::before {
  content: "+";
  flex: none;
  font-family: var(--font-mono);
  color: var(--blue-2);
}

.tariff-response {
  margin-top: auto;
  padding-top: var(--s-5);
}

.tariff .btn {
  justify-content: center;
  margin-top: var(--s-4);
}

@media (min-width: 900px) {
  .tariffs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: var(--s-5); /* room for the lifted card */
  }

  .tariff-recommended {
    margin-top: calc(-1 * var(--s-5));
  }
}

/* 7e. «Работы» — one wide tile spanning two rows, two narrow ones stacked
   beside it. The visual is a rendered WebP (tools/cases); the result line is
   the one amber element per tile. */

.case-list {
  display: grid;
  gap: var(--col-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.case {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}

.case-visual {
  flex: 0 0 auto;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background-color: var(--bg);
}

.case-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: left top;
}

.case-link {
  color: var(--ink-2);
}

.case-link:hover {
  color: var(--blue-2);
}

.case-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: var(--s-3);
  padding: var(--s-5);
}

.case-meta {
  margin: 0;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.case-title {
  margin: 0;
  font-size: var(--fs-h3);
}

.case-result {
  margin-top: auto;
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  color: var(--moon);
}

@media (min-width: 768px) {
  .case-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case:first-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .case-list {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: minmax(0, auto);
  }

  .case:first-child {
    grid-column: 1 / 8;
    grid-row: 1 / 3;
  }

  /* The wide tile is as tall as the two beside it: the extra height goes to
     the visual, not to a gap between the title and the result line. */
  .case:first-child .case-visual {
    flex: 1 1 auto;
  }

  .case:first-child .case-body {
    flex: 0 0 auto;
  }

  .case:nth-child(n + 2) {
    grid-column: 8 / 13;
  }
}

/* 7f. FAQ — hairline rows, mono + marker drawn by CSS, native <details>.
   motion.js animates the height (11h); without it the browser toggles
   instantly. */

.faq-list {
  max-width: 48rem;
  border-top: 1px solid var(--line);
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-5);
  padding: var(--s-4) 0;
  list-style: none;
  cursor: pointer;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-question {
  margin: 0;
  font-size: 1.125rem;
}

.faq-summary:hover .faq-question {
  color: var(--blue-2);
}

.faq-marker {
  flex: 0 0 auto;
  width: 1.25rem;
  font-size: 1.25rem;
  line-height: 1;
  text-align: center;
  color: var(--blue-2);
}

.faq-marker::before {
  content: "+";
}

/* Open: the plus turns into a cross (45°) instead of swapping for a minus. */
.faq-marker {
  transition: transform 220ms var(--ease-out-expo);
}

.faq-item[open] .faq-marker {
  transform: rotate(45deg);
}

/* While motion.js runs the height animation the item clips its content. */
.faq-item.is-animating {
  overflow: clip;
}

.faq-answer {
  max-width: 40em;
  padding-bottom: var(--s-5);
  color: var(--ink-2);
}

.faq-answer p {
  margin: 0;
}

/* 7g. «О студии» — heading and a terminal card on the left, the copy on the
   right. The card is mono on --bg-2 with a moon glow in its top-left corner;
   the caret blinks (11h-style keyframe below, off under reduced motion). */

.about {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s-6) var(--col-gap);
}

.about-aside,
.about-body {
  grid-column: 1 / -1;
}

.about-aside > h2 {
  margin-bottom: var(--s-5);
}

.about-body {
  max-width: 34em;
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--ink-2);
}

.about-body p + p {
  margin-top: var(--s-4);
}

.term {
  position: relative;
  max-width: 26rem;
  padding: var(--s-5);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  line-height: 1.7;
  color: var(--ink-2);
}

.term::before {
  content: "";
  position: absolute;
  top: -6rem;
  left: -6rem;
  width: 16rem;
  height: 16rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--moon-rgb), 0.2), transparent 65%);
  pointer-events: none;
}

.term-bar {
  display: flex;
  gap: 0.4rem;
  margin-bottom: var(--s-4);
}

.term-bar i {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--line-strong);
}

/* pre-wrap keeps the two spaces after the hash; a line that does not fit
   (phones, the 768–1023 column) wraps with a hanging indent of 8ch — the
   6-char hash plus its two spaces — so the continuation sits under the
   message. Short prompt lines are unaffected. */
.term p {
  position: relative;
  margin: 0;
  padding-left: 8ch;
  text-indent: -8ch;
  white-space: pre-wrap;
}

.term-p,
.term-h {
  color: var(--muted);
}

.term-k {
  color: var(--blue-2);
}

.term-cur::after {
  content: "▍";
  color: var(--moon);
  animation: term-blink 1.1s steps(1) infinite;
}

@keyframes term-blink {
  50% { opacity: 0; }
}

@media (min-width: 768px) {
  .about-aside {
    grid-column: 1 / 6;
  }

  /* Wide enough for the longest commit line on one row at 1280; narrower
     columns cap it first and the line wraps (see .term p). */
  .term {
    max-width: 28rem;
  }

  .about-body {
    grid-column: 7 / 13;
  }
}

/* 7h. Socials (form block + footer). */

.socials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.social {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--ink);
  text-decoration: none;
}

.social:hover {
  color: var(--blue-2);
}

/* ---------- 8. Lead form ---------- */

.contact {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s-6) var(--col-gap);
}

.contact-intro,
.lead-form {
  grid-column: 1 / -1;
}

.contact-intro > h2 {
  margin-bottom: var(--s-5);
}

.socials-title {
  margin: var(--s-6) 0 var(--s-3);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.lead-form {
  display: grid;
  gap: var(--s-5);
  max-width: 36rem;
}

@media (min-width: 1024px) {
  .contact-intro {
    grid-column: 1 / 6;
  }

  .lead-form {
    grid-column: 7 / 13;
    max-width: none;
  }
}

.field {
  display: grid;
  gap: var(--s-2);
}

/* Labels and the small notes sit straight on the page, where the flashlight
   code passes under them: a halo in the page colour (invisible on the plain
   background) keeps the text separated from the code. .optional inherits it. */
.field label,
.consent {
  text-shadow: 0 0 4px var(--bg), 0 0 8px var(--bg), 0 0 14px var(--bg);
}

.field label {
  font-weight: 500;
}

.optional {
  margin-left: var(--s-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field input,
.field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-2); /* opaque, so the flashlight code never shows through */
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
}

.field textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--muted);
  opacity: 0.75;
}

.field input:hover,
.field textarea:hover {
  border-color: var(--ink-2);
}

.field input:focus-visible,
.field textarea:focus-visible {
  border-color: var(--blue-2);
  outline-offset: 1px;
}

.field [aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  color: var(--danger);
}

.form-error {
  margin: 0;
  padding: var(--s-3) var(--s-4);
  border-left: 3px solid var(--danger);
  background: rgba(239, 125, 85, 0.08);
  color: var(--ink);
}

/* Tariff picker: radios drawn as a row of segmented buttons. The inputs are
   visually hidden, not display:none, so keyboard and screen readers keep
   them; the checked label goes amber. The price is a CSS tooltip from
   data-price, on hover and keyboard focus only (touch: the prices are on
   the cards one screen up). */
.plan-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.plan-field legend {
  padding: 0;
  margin-bottom: var(--s-2);
  font-weight: 500;
  text-shadow: 0 0 4px var(--bg), 0 0 8px var(--bg), 0 0 14px var(--bg);
}

.plan-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.plan-group input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.plan-group label {
  position: relative;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--ink-2);
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color var(--dur), color var(--dur), background-color var(--dur);
}

.plan-group label:hover {
  border-color: var(--ink-2);
  color: var(--ink);
}

.plan-group input:checked + label {
  border-color: var(--accent);
  background: rgba(242, 169, 59, 0.08);
  color: var(--accent);
}

.plan-group input:focus-visible + label {
  outline: 2px solid var(--blue-2);
  outline-offset: 2px;
}

.plan-group label[data-price]::after {
  content: attr(data-price);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.5rem);
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 400;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 4px);
  pointer-events: none;
  transition: opacity var(--dur), transform var(--dur);
}

@media (hover: hover) {
  .plan-group label[data-price]:hover::after,
  .plan-group input:focus-visible + label[data-price]::after {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

.btn-lg {
  padding: 1rem 1.75rem;
  font-size: 1.0625rem;
}

.lead-form .btn-primary {
  justify-self: start;
}

.lead-form .btn-primary[disabled] {
  cursor: progress;
  opacity: 0.7;
}

.consent {
  max-width: 44em;
  margin: calc(-1 * var(--s-3)) 0 0;
  font-size: var(--fs-mono);
  line-height: 1.5;
}

/* Honeypot: off-screen, not display:none (some bots skip hidden fields). */
.hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- 9. Footer ---------- */

.site-footer {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--s-6) var(--col-gap);
  padding-block: var(--s-7) var(--s-6);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: var(--fs-small);
}

.footer-brand,
.footer-nav,
.footer-contacts {
  grid-column: 1 / -1;
}

.footer-wordmark {
  margin: 0 0 var(--s-3);
  font-size: 1.5rem;
}

.footer-nav ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-2) var(--s-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--ink);
}

.footer-contacts .socials {
  margin-bottom: var(--s-4);
}

.footer-contacts .social {
  color: var(--ink-2);
}

@media (min-width: 768px) {
  .footer-brand {
    grid-column: 1 / 5;
  }

  .footer-nav {
    grid-column: 5 / 10;
  }

  .footer-contacts {
    grid-column: 10 / 13;
  }
}

/* ---------- 10. Thanks / error pages ----------
   One huge word or numeral under a moonlight glow, a short line, a way back. */

.thanks,
.error-page {
  position: relative;
  display: grid;
  align-content: center;
  min-height: calc(100vh - var(--header-h) - 14rem);
  min-height: calc(100svh - var(--header-h) - 14rem);
}

.thanks::before,
.error-page::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -40vmin;
  left: -30vmin;
  width: 110vmin;
  height: 110vmin;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--moon-rgb), 0.2), rgba(var(--moon-rgb), 0.05) 55%, transparent 100%);
}

.thanks h1,
.error-page h1 {
  margin-bottom: var(--s-5);
  font-size: var(--fs-display);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--moon);
}

.error-page h1 {
  font-size: var(--fs-numeral);
  line-height: 0.85;
  font-feature-settings: "tnum";
}

.error-kicker,
.thanks-stamp {
  margin: 0 0 var(--s-4);
  color: var(--muted);
}

.thanks-stamp {
  order: -1;
}

.thanks-lead,
.error-lead {
  max-width: 30em;
  font-size: var(--fs-lead);
  color: var(--ink-2);
}

.thanks p:last-child,
.error-page p:last-child {
  margin-top: var(--s-6);
}

.link-back {
  text-decoration: none;
}

.link-back .icon-arrow {
  transition: transform var(--dur) ease-out;
}

.link-back:hover .icon-arrow {
  transform: translateX(-3px);
}

/* ---------- 11. Motion ----------
   Home of every animation. Rules: UI 150–700 ms, ambient slower; nothing
   bouncy on content; everything off under prefers-reduced-motion (the block
   at the end), pointer-driven effects only on a fine pointer. */

a,
.btn,
button,
summary,
input,
textarea {
  transition: color var(--dur) ease-out, background-color var(--dur) ease-out, border-color var(--dur) ease-out, text-decoration-color var(--dur) ease-out;
}

/* 11a. Section reveal — «фокус». Sections carry data-reveal, their content
   groups data-reveal-child; motion.js adds .is-in once the section scrolls
   into view and sets --i (stagger index) on each child through the CSSOM
   (the CSP has no 'unsafe-inline', so style attributes would be refused).
   Content is visible by default: the hiding rules need html.js-motion, which
   motion.js sets only after its observers are installed — so a script that
   never loads, scripts turned off, or a reduced-motion session that later
   allows motion all leave everything readable. */

[data-reveal] h2 {
  overflow: hidden;
}

[data-reveal] h2 > .h2-line {
  display: block;
}

@media (scripting: enabled) and (prefers-reduced-motion: no-preference) {
  [data-reveal] [data-reveal-child] {
    transition: opacity var(--dur-reveal) var(--ease-out-expo), filter var(--dur-reveal) var(--ease-out-expo), transform var(--dur-reveal) var(--ease-out-expo);
    transition-delay: calc(var(--i, 0) * 60ms);
  }

  [data-reveal] h2 > .h2-line {
    transition: transform var(--dur-reveal) var(--ease-out-expo);
    transition-delay: calc(var(--i, 0) * 60ms + 60ms);
  }

  html.js-motion [data-reveal]:not(.is-in) [data-reveal-child] {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(20px);
  }

  html.js-motion [data-reveal]:not(.is-in) h2 > .h2-line {
    transform: translateY(110%);
  }

  /* Layer promotion only while the transition runs (.is-moving is removed by
     motion.js after the last child settles). */
  [data-reveal].is-moving [data-reveal-child],
  [data-reveal].is-moving h2 > .h2-line {
    will-change: opacity, filter, transform;
  }

  /* Connector line fallback (no scroll-driven animations): the segments draw
     one after another when the section reveals — 300 ms each in step order
     (--i from motion.js), 1.2 s for the row — and the numbers light up as
     their segment starts. Undrawn only behind html.js-motion, like the
     reveal itself. */
  @supports not (animation-timeline: view()) {
    .steps-line line {
      transition: stroke-dashoffset 300ms linear calc((var(--i, 1) - 1) * 300ms);
    }

    .step-num {
      transition: color 200ms ease-out calc((var(--i, 1) - 1) * 300ms);
    }

    html.js-motion [data-reveal]:not(.is-in) .steps-line line {
      stroke-dashoffset: 1;
    }

    html.js-motion [data-reveal]:not(.is-in) .step-num {
      color: var(--muted);
    }
  }
}

/* 11b. Buttons — the one warm thing on the page. Primary: a diagonal sheen
   sweeps once on hover, an amber halo blooms underneath, the button presses
   in (.97). Secondary: the amber border is drawn, top-left corner first.
   Sheen and halo are drawn by background, not by overflow clipping, so the
   halo can spill below the box. Spot: a soft radial light follows the
   pointer inside both buttons; --mx/--my (%) come from motion.js (fine
   pointer only, otherwise centred), the 200 ms fade is the registered
   --spot property scaling the gradient's alpha. */

@property --spot {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

.btn-primary {
  position: relative;
  isolation: isolate;
  background-image: radial-gradient(5.5rem circle at var(--mx, 50%) var(--my, 50%), rgba(255, 238, 200, calc(0.6 * var(--spot))), transparent 70%);
  transition: --spot 200ms ease-out, transform var(--dur) ease-out, color var(--dur) ease-out, background-color var(--dur) ease-out, border-color var(--dur) ease-out;
}

.btn-primary:hover,
.btn-primary:focus-visible,
.btn-secondary:hover,
.btn-secondary:focus-visible {
  --spot: 1;
}

.btn-primary::before,
.btn-primary::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: inherit;
}

/* Sheen: a narrow diagonal stripe that slides across the face (animated
   background-position, the pseudo-element is the button box itself). */
.btn-primary::before {
  inset: 0;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%) no-repeat 200% 0 / 250% 100%;
}

.btn-primary:hover::before,
.btn-primary:focus-visible::before {
  animation: sheen 600ms var(--ease-out-expo) both;
}

@keyframes sheen {
  from { background-position: 200% 0; }
  to { background-position: -100% 0; }
}

/* Halo: a blurred amber block below the box; z-index -1 inside the button's
   own stacking context keeps it under the label. It stays inside the box
   horizontally (the blur spreads the paint, not the layout): a spill past
   the header CTA would widen the mobile layout viewport. */
.btn-primary::after {
  inset: auto 6% -55% 6%;
  height: 70%;
  z-index: -1;
  background: var(--accent);
  filter: blur(18px);
  opacity: 0;
  transition: opacity 220ms ease-out;
}

.btn-primary:hover::after,
.btn-primary:focus-visible::after {
  opacity: 0.45;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary[disabled] {
  --spot: 0;
}

.btn-primary[disabled]::before,
.btn-primary[disabled]::after {
  animation: none;
  opacity: 0;
}

/* Secondary: two L-shaped pseudo-elements grow from the top-left and the
   bottom-right corner over the resting border; the spot is a fainter amber. */
.btn-secondary {
  position: relative;
  background-image: radial-gradient(5rem circle at var(--mx, 50%) var(--my, 50%), rgba(242, 169, 59, calc(0.24 * var(--spot))), transparent 70%);
  transition: --spot 200ms ease-out, color var(--dur) ease-out, border-color var(--dur) ease-out;
}

.btn-secondary::before,
.btn-secondary::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
  width: 0;
  height: 0;
  border: 0 solid var(--accent);
  pointer-events: none;
  transition: width 260ms var(--ease-out-expo), height 260ms var(--ease-out-expo);
}

.btn-secondary::before {
  top: -1px;
  left: -1px;
  border-top-width: 1px;
  border-left-width: 1px;
}

.btn-secondary::after {
  right: -1px;
  bottom: -1px;
  border-right-width: 1px;
  border-bottom-width: 1px;
  transition-delay: 80ms;
}

.btn-secondary:hover::before,
.btn-secondary:hover::after,
.btn-secondary:focus-visible::before,
.btn-secondary:focus-visible::after {
  width: calc(100% + 2px);
  height: calc(100% + 2px);
}

/* Form busy state: site.js swaps the label for «Отправляем» + .btn-dots and
   fixes the button's min-width first, so nothing shifts. The dots pulse by
   stepping the generated content (a static «…» where content cannot be
   animated). */
.btn-dots {
  display: inline-block;
  width: 1.1em;
  text-align: left;
}

.btn-dots::after {
  content: "…";
  animation: dots 1.2s steps(1, end) infinite;
}

@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75%, 100% { content: "..."; }
}

/* 11c. Hero, on load, CSS only. The copy arrives in steps. The Moon does not
   spin (the real one keeps one face to us): it librates, a slow rocking of a
   few degrees, and lags the scroll as a far object does. It opens on a total
   eclipse: a copper wash (::before, blend "color", so the relief survives)
   clears while the disc flares to a bright full Moon and settles into the
   night blue, 4.5 s, once. The night side (::after) never moves, so the copy
   reads from the first frame. */

.moon {
  isolation: isolate;
}

.moon-img {
  will-change: transform;
  animation: moon-libration 90s ease-in-out infinite alternate, moon-flare 4.5s ease-in-out both;
}

@keyframes moon-libration {
  from { rotate: 76.5deg; }
  to { rotate: 83.5deg; }
}

.moon::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50%;
  background: #c8371f;
  box-shadow: 0 0 7rem rgba(214, 70, 32, 0.45);
  mix-blend-mode: color;
  opacity: 0;
  animation: moon-blood 4.5s ease-out both;
}

@keyframes moon-blood {
  0%, 22% { opacity: 1; }
  60%, 100% { opacity: 0; }
}

@keyframes moon-flare {
  0%, 22% { filter: brightness(0.8); }
  58% { filter: brightness(1.75); }
  100% { filter: brightness(1); }
}

@supports (animation-timeline: scroll()) {
  .moon {
    animation: moon-lag linear both;
    animation-timeline: scroll(root);
    animation-range: 0 120vh;
  }

  @keyframes moon-lag {
    to { translate: 0 14vh; }
  }
}

.hero h1,
.hero-lead,
.hero-actions,
.hero .caption {
  animation: fade-rise 460ms var(--ease-out-expo) both;
}

.hero h1 { animation-delay: 100ms; }
.hero-lead { animation-delay: 180ms; }
.hero-actions { animation-delay: 260ms; }
.hero .caption { animation-delay: 340ms; }

@keyframes fade-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* 11d. Flashlight — moonlight over the page's own source. A fixed canvas at
   z-index -1 in the root stacking context: above the body background and the
   Moon (-2), under every block. flashlight.js draws code columns and reveals
   them through a trailing light at the pointer (or a slow drift on touch).
   The canvas is 80 % opaque; the script dims it to 32 % everywhere but a
   pool on the Moon's lit side. Reduced motion hides it. */
.flashlight {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.8;
}

/* 11e. «Как работаем» — the light runs along the wire. Each step's hairline
   segment (.steps-line, 7b) is a line with pathLength="1": its dash offset
   goes 1 → 0 on a view timeline of the segment itself, so it draws as the
   hairline crosses the lower half of the viewport (cover 15 % → 55 %, one
   10 % slot per column, --k), left to right across the row; the step
   number goes muted → amber as its segment starts. The static state is the
   drawn line and amber numbers: reduced motion and browsers without scroll
   timelines (fallback in 11a) never show less. */
@keyframes wire-draw {
  from {
    stroke-dashoffset: 1;
  }
}

@keyframes wire-lit {
  from {
    color: var(--muted);
  }
}

@supports (animation-timeline: view()) {
  .step {
    timeline-scope: --wire;
  }

  .steps-line {
    view-timeline: --wire block;
  }

  .steps-line line {
    animation: wire-draw linear both;
    animation-timeline: --wire;
    animation-range: cover calc(15% + var(--k) * 10%) cover calc(25% + var(--k) * 10%);
  }

  .step-num {
    animation: wire-lit linear both;
    animation-timeline: --wire;
    animation-range: cover calc(15% + var(--k) * 10%) cover calc(19% + var(--k) * 10%);
  }
}

/* 11f. Тарифы — the card turns towards the light. On a fine pointer
   motion.js writes --rx/--ry (±4°) and the highlight position --lx/--ly as
   the mouse moves over a .tariff: the card tilts in its own perspective, a
   soft white specular (::after, no backdrop filter) follows the pointer, and
   both ease back when it leaves. The reveal (11a) owns the card's transform until
   the section has settled (.is-in without .is-moving); then the tilt's
   500 ms transition takes over. The recommended card's cold halo (::before) breathes on opacity
   for 6 s and paints above its neighbours (z-index 1) so the glow spills to
   both sides. Coarse pointers: no tilt or specular, the halo breathes, a tap
   presses the card in (.99). */
.tariff-recommended {
  z-index: 1;
  border-color: var(--accent);
}

.tariff-recommended::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  box-shadow: 0 12px 48px -12px rgba(var(--moon-rgb), 0.5);
  animation: breathe-halo 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes breathe-halo {
  0%, 100% { opacity: 0.64; }
  50% { opacity: 1; }
}

[data-reveal].is-in:not(.is-moving) .tariff {
  transition: transform 500ms var(--ease-out-expo);
}

@media (hover: hover) and (pointer: fine) {
  .tariff {
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  }

  .tariff::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(260px circle at var(--lx, 50%) var(--ly, 50%), rgba(255, 255, 255, 0.1), transparent 60%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease-out;
  }

  .tariff:hover::after {
    opacity: 1;
  }
}

@media (hover: none) {
  .tariff:active {
    transform: scale(0.99);
  }
}

/* 11g. «Спасибо» — the Moon sets. A fixed moonlight wash above the header
   (::after) collapses into the top-left corner and fades in 850 ms; the h1
   rises at 420 ms; from 900 ms the stamp types itself behind a caret, 60 ms a
   glyph (always 40: the date format is fixed, TestThanksStamp guards it), the
   caret blinks 3× and goes out, then the lead and the way back fade in. Below
   30em (phones, or large default fonts) 40ch may not fit: no typing, the stamp
   fades like the rest. */
.moon-set::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  transform-origin: 0 0;
  background: radial-gradient(circle at 0 0, rgba(var(--moon-rgb), 0.9), rgba(var(--moon-rgb), 0.35) 25%, transparent 50%);
  animation: moon-set 850ms var(--ease-out-expo) both;
}

.thanks h1,
.thanks-stamp,
.thanks-lead,
.thanks p:last-child {
  animation: fade-rise 460ms var(--ease-out-expo) both;
}

.thanks h1 { animation-delay: 420ms; }
.thanks-stamp { animation-delay: 600ms; }
.thanks-lead { animation-delay: 700ms; }
.thanks p:last-child { animation-delay: 800ms; }

@media (min-width: 30em) {
  .thanks-stamp {
    box-sizing: content-box;
    width: 40ch;
    overflow: hidden;
    white-space: nowrap;
    border-right: 1px solid transparent;
    animation: type 2.4s steps(40, end) 900ms both, caret 600ms step-start 3.3s 3 forwards;
  }

  .thanks-stamp ~ .thanks-lead { animation-delay: 3.4s; }
  .thanks-stamp ~ p:last-child { animation-delay: 3.5s; }
}

@keyframes moon-set {
  from { opacity: 0.85; }
  to {
    opacity: 0;
    transform: scale(0.02);
    visibility: hidden;
  }
}

@keyframes type {
  from { width: 0; }
  from, to { border-color: var(--moon); }
}

@keyframes caret {
  from, 50% { border-color: var(--moon); }
  to { border-color: transparent; }
}

/* 11h. FAQ — the answer fades in and rises 8 px once the item is open; the
   height itself is animated by motion.js (Web Animations, 320 ms open /
   240 ms close, --ease-out-expo) so it works in every browser. */
.faq-item[open] .faq-answer {
  animation: faq-in 260ms var(--ease-out-expo) 60ms both;
}

@keyframes faq-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }

  .link-arrow:hover .icon-arrow,
  .link-back:hover .icon-arrow {
    transform: none;
  }

  .btn-primary:active {
    transform: none;
  }

  /* The spot stays, centred and without its fade: !important beats the
     --mx/--my a running motion.js may already have written to the CSSOM. */
  .btn-primary,
  .btn-secondary {
    --mx: 50% !important;
    --my: 50% !important;
  }

  .btn-primary::before,
  .btn-dots::after {
    animation: none;
  }

  .btn-secondary::before,
  .btn-secondary::after {
    transition: none;
  }

  [data-reveal] [data-reveal-child],
  [data-reveal] h2 > .h2-line {
    opacity: 1;
    filter: none;
    transform: none;
  }

  .moon::before {
    display: none;
  }

  .moon,
  .moon-img,
  .hero h1,
  .hero-lead,
  .hero-actions,
  .hero .caption {
    animation: none;
  }

  .flashlight {
    display: none;
  }

  .steps-line line,
  .step-num {
    animation: none;
  }

  /* Cards stay flat; the specular, like the button spot, sits in the middle. */
  .tariff,
  .tariff:active {
    transform: none;
  }

  .tariff::after {
    --lx: 50% !important;
    --ly: 50% !important;
  }

  .tariff-recommended::before {
    animation: none;
  }

  /* Static thanks page: no wash, the stamp at its full width, no caret. */
  .moon-set::after {
    display: none;
  }

  .thanks h1,
  .thanks-stamp,
  .thanks-lead,
  .thanks p:last-child {
    animation: none;
  }

  .faq-item[open] .faq-answer {
    animation: none;
  }

  .faq-item[open] .faq-marker {
    transform: rotate(45deg);
    transition: none;
  }

  .term-cur::after {
    animation: none;
  }
}
