/* Лэндинг Typodesign. Разметку собирает _tools/typodesign/page.py.

   Язык — самого инструмента (styles.css в репозитории typodesign, а тот —
   из /design-system.css сайта): бумага с зерном и узором LE, чёрная линия
   в 1 px, лист превью на кромке из двух линий, моно-подписи, Unbounded в
   заголовках, Lora в лидах, единственный акцент — терракотовый плинт под
   главной кнопкой. Теней и тёмных подложек нет. */

@property --plinth-depth {
  syntax: "<length>";
  inherits: true;
  initial-value: 8px;
}

:root {
  --white: #ffffff;
  --black: #000000;
  --n100: #f5f5f5;
  --n400: #a3a3a3;
  --n500: #737373;
  --n600: #525252;
  --ink: #242424;
  --terra: #ff5a1f;
  --terra-deep: #e8460a;
  --terra-ink: #c43a06;
  --face-r: #d8d3cb;
  --face-b: #bfb8ad;
  --paper: #f6f1e6;
  --paper-veil: rgba(246, 241, 230, 0.92);
  --rule: #a99e88;
  --grain: radial-gradient(rgba(26, 23, 20, 0.34) 0.5px, transparent 0.6px);
  --grain-tile: 3px 3px;
  --le-soft: url("/images/pattern-le.svg");
  --le-tile: 120px 196.3px;
  --raster-step: 6px;
  --raster-gray: radial-gradient(var(--n400) 1.15px, transparent 1.25px);
  --edge-gap: 4px;

  --font-display: "Unbounded", "Geologica", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-serif: "Lora", Georgia, serif;
  --font-mono: "Roboto Mono", ui-monospace, monospace;

  --gutter: clamp(16px, 3.4vw, 40px);
  --section: clamp(72px, 9vw, 128px);
  --gap: 16px;
  --focus: 2px solid #2563eb;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--black);
  background-color: var(--paper);
  background-image: var(--grain), var(--le-soft);
  background-size: var(--grain-tile), var(--le-tile);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: var(--focus); outline-offset: 2px; }

.wrap {
  width: 100%;
  max-width: calc(1200px + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ── Шрифты ───────────────────────────────────────────────────────────────── */

.h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 4.9vw, 68px);
  line-height: 1.06;
  letter-spacing: -0.025em;
  max-width: 17ch;
  text-wrap: balance;
}

.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(25px, 2.9vw, 40px);
  line-height: 1.14;
  letter-spacing: -0.02em;
  max-width: 22ch;
  text-wrap: balance;
}

.h3 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

.lead {
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.45vw, 20px);
  line-height: 1.55;
  color: var(--ink);
  max-width: 36em;
  text-wrap: pretty;
}

.h2 + .lead { margin-top: 18px; }

.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--n500);
}

/* ── Шапка ────────────────────────────────────────────────────────────────── */

.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper-veil);
  border-bottom: 1px solid var(--black);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.bar__in {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 60px;
}

.bar__brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.bar__nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
}

.bar__nav a,
.bar__home {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--n600);
  transition: color 0.2s ease-out;
}

.bar__nav a:hover,
.bar__home:hover { color: var(--black); }

.bar__home {
  padding-left: 24px;
  border-left: 1px solid var(--rule);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .bar__nav { display: none; }
  .bar__home { margin-left: auto; padding-left: 0; border-left: 0; }
}

/* ── Разделы ──────────────────────────────────────────────────────────────── */

main > section {
  padding: var(--section) 0;
  border-top: 1px solid var(--black);
}

main > section.hero {
  border-top: 0;
  padding-top: clamp(40px, 6vw, 88px);
}

/* Медиа раздела встаёт под лид на одном и том же расстоянии. */
.lead + [data-media],
.h2 + [data-media] { margin-top: clamp(36px, 4.4vw, 56px); }

/* ── Лист с кромкой (как лист превью в инструменте) ───────────────────────── */

.sheet {
  position: relative;
  background-color: var(--white);
  border: 1px solid var(--black);
}

.sheet::before,
.sheet::after {
  content: "";
  position: absolute;
  border-right: 1px solid var(--black);
  border-bottom: 1px solid var(--black);
  pointer-events: none;
}

.sheet::before {
  top: var(--edge-gap);
  left: var(--edge-gap);
  right: calc(-1 * var(--edge-gap) - 1px);
  bottom: calc(-1 * var(--edge-gap) - 1px);
}

.sheet::after {
  top: calc(2 * var(--edge-gap));
  left: calc(2 * var(--edge-gap));
  right: calc(-2 * var(--edge-gap) - 1px);
  bottom: calc(-2 * var(--edge-gap) - 1px);
}

/* ── Кнопки на плинте (из инструмента, один в один) ───────────────────────── */

.btn {
  --face-1: var(--face-r);
  --face-2: var(--face-b);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 1.6rem;
  border: 1px solid var(--black);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, --plinth-depth 0.12s ease, background-color 0.2s ease-out, color 0.2s ease-out;
}

.btn::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: calc(100% + 2px + var(--plinth-depth));
  height: calc(100% + 2px + var(--plinth-depth));
  background: conic-gradient(from 135deg at calc(100% - var(--plinth-depth)) calc(100% - var(--plinth-depth)),
      var(--face-2) 0deg 180deg, var(--face-1) 180deg 360deg);
  clip-path: polygon(calc(100% - var(--plinth-depth)) 0, 100% var(--plinth-depth), 100% 100%,
      var(--plinth-depth) 100%, 0 calc(100% - var(--plinth-depth)),
      calc(100% - var(--plinth-depth)) calc(100% - var(--plinth-depth)));
  z-index: -1;
}

.btn { isolation: isolate; }
.btn:hover { --plinth-depth: 11px; }
.btn:active { --plinth-depth: 2px; transform: translate(6px, 6px); }

.btn--primary {
  --face-1: var(--terra);
  --face-2: var(--terra-deep);
  background: var(--black);
  color: var(--white);
}

.btn--ghost {
  background: var(--white);
  color: var(--n600);
}

.btn--ghost:hover { color: var(--black); background: var(--n100); }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}

/* ── Герой ────────────────────────────────────────────────────────────────── */

.hero__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 48px;
  row-gap: 28px;
}

.hero__head .h1 { grid-column: 1 / -1; }

.hero__side {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 48px;
  flex-wrap: wrap;
}

.hero__side .lead { max-width: 34em; }
.hero__side .btn { margin-right: 11px; margin-bottom: 11px; }

.live { margin-top: clamp(40px, 5vw, 64px); }

.live__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--n500);
}

.live__label b {
  display: inline-block;
  min-width: 3ch;
  margin-left: 0.6em;
  font-weight: 500;
  color: var(--black);
  font-variant-numeric: tabular-nums;
}

.live__hint[data-hint-touch] { display: none; }
@media (hover: none), (pointer: coarse) {
  .live__hint[data-hint-mouse] { display: none; }
  .live__hint[data-hint-touch] { display: inline; }
}

.live__sheet {
  padding: clamp(32px, 5vw, 72px) clamp(20px, 6vw, 84px);
  margin-right: calc(2 * var(--edge-gap) + 1px);
  cursor: crosshair;
  touch-action: pan-y;
  /* Растр-миллиметровка под буквами, приглушённый, как в инструменте. */
  background-image: var(--raster-gray);
  background-size: var(--raster-step) var(--raster-step);
  background-position: center;
  box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, 0.72);
}

.live__word {
  width: 100%;
  height: auto;
  overflow: visible;
  -webkit-user-select: none;
  user-select: none;
}

.live__word path {
  fill: none;
  stroke: var(--black);
  stroke-width: 2px;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

@media (max-width: 600px) {
  .live__word path { stroke-width: 1.6px; }
}

/* ── Рамка браузера для фильма ────────────────────────────────────────────── */

.browser {
  position: relative;
  border: 1px solid var(--black);
  background: var(--white);
  margin-right: calc(2 * var(--edge-gap) + 1px);
}

.browser::before,
.browser::after {
  content: "";
  position: absolute;
  border-right: 1px solid var(--black);
  border-bottom: 1px solid var(--black);
  pointer-events: none;
}

.browser::before { inset: var(--edge-gap) calc(-1 * var(--edge-gap) - 1px) calc(-1 * var(--edge-gap) - 1px) var(--edge-gap); }
.browser::after { inset: calc(2 * var(--edge-gap)) calc(-2 * var(--edge-gap) - 1px) calc(-2 * var(--edge-gap) - 1px) calc(2 * var(--edge-gap)); }

.browser__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-bottom: 1px solid var(--black);
  background: var(--paper);
}

.browser__bar i {
  width: 10px;
  height: 10px;
  border: 1px solid var(--black);
  background: var(--white);
}

.browser__bar span {
  margin: 0 auto;
  padding-right: 51px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--n600);
}

.browser__screen video {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  background: var(--paper);
}

/* ── Бенто ползунков ──────────────────────────────────────────────────────── */

.bento {
  display: grid;
  row-gap: clamp(28px, 3vw, 40px);
}

.bento__row {
  display: grid;
  column-gap: var(--gap);
  align-items: start;
}

.tile__frame {
  border: 1px solid var(--black);
  background: var(--paper);
  overflow: hidden;
}

.tile__frame video {
  width: 100%;
  height: auto;
}

.tile figcaption {
  margin-top: 12px;
  max-width: 34em;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  text-wrap: pretty;
}

@media (max-width: 700px) {
  .bento__row {
    grid-template-columns: minmax(0, 1fr) !important;
    row-gap: clamp(28px, 3vw, 40px);
  }
}

/* ── Телефон ──────────────────────────────────────────────────────────────── */

.phone-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(32px, 7vw, 112px);
}

.phone { width: clamp(244px, 26vw, 312px); }

.phone__body {
  padding: 11px;
  border-radius: 52px;
  background: #121110;
  box-shadow: inset 0 0 0 1px #000, inset 0 0 0 2.5px #3b3936;
}

.phone__screen {
  position: relative;
  overflow: hidden;
  border-radius: 42px;
  background: var(--paper);
  aspect-ratio: 390 / 844;
}

.phone__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 5.2%;
  padding: 0 11% 0 12%;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  background: var(--paper);
}

.phone__status i {
  width: 22px;
  height: 10px;
  border: 1.5px solid var(--black);
  border-radius: 3px;
}

.phone__screen::before {
  content: "";
  position: absolute;
  top: 1.3%;
  left: 50%;
  width: 31%;
  height: 3.6%;
  transform: translateX(-50%);
  border-radius: 99px;
  background: #121110;
}

.phone__screen video {
  width: 100%;
  height: auto;
  aspect-ratio: 390 / 800;
}

.notes {
  list-style: none;
  display: grid;
  gap: 28px;
  max-width: 30em;
  counter-reset: note;
}

.notes li {
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}

.notes li::before {
  counter-increment: note;
  content: counter(note, decimal-leading-zero);
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--black);
}

.notes p {
  margin-top: 6px;
  color: var(--ink);
}

@media (max-width: 700px) {
  .phone-row { grid-template-columns: minmax(0, 1fr); }
  .phone { width: min(300px, 100%); }
}

/* ── Экспорт ──────────────────────────────────────────────────────────────── */

.export__row {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--gap) 40px;
  align-items: start;
}

.export__sheet {
  display: grid;
  place-items: center;
  margin-right: calc(2 * var(--edge-gap) + 1px);
  padding: clamp(40px, 7vw, 96px) clamp(24px, 5vw, 64px);
}

.export__sheet img {
  width: 100%;
  height: auto;
}

.export__file figcaption {
  margin-top: 20px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}

.code {
  margin: 0;
  padding: 20px 22px;
  border: 1px solid var(--black);
  background: var(--white);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--n600);
  overflow-x: auto;
  white-space: pre;
}

.code b { font-weight: 500; color: var(--black); }
.code i { font-style: normal; color: var(--n400); }

@media (max-width: 900px) {
  .export__row { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}

/* ── Конец и подвал ───────────────────────────────────────────────────────── */

.end__links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 28px;
  margin-top: 36px;
}

.foot {
  border-top: 1px solid var(--black);
}

.foot__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 22px;
  padding-bottom: 28px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--n600);
}

.foot a { text-decoration: none; }
.foot a:hover { color: var(--black); }
