/* glebov.pro — этап 1. Токены синхронизированы с design/tokens.json. */

@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-cyrillic-wght.woff2?v=c69cb3a431") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: "Onest";
  src: url("../fonts/onest-latin-wght.woff2?v=9b7650d2e1") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  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+2190-2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --ink: #0b0b0b;
  --muted: #5c5c5c;
  --line: #d6d6d6;
  --accent: #c8260e;
  --on-ink: #ffffff;
  --muted-on-ink: #b8b8b8;

  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --gutter: 20px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 112px;

  --text-label: 0.8125rem;
  --text-body: 1.0625rem;
  --text-lead: clamp(1.25rem, 1rem + 1.2vw, 1.875rem);
  --text-item: clamp(1.375rem, 1rem + 1.8vw, 2.5rem);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (min-width: 720px) {
  :root { --gutter: 40px; }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
}

h1, h2, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }

a { color: inherit; }

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

.wrap {
  padding-inline: var(--gutter);
  max-width: 1840px;
  margin-inline: auto;
}

.label {
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ——— верхняя строка ——— */

.bar {
  display: flex;
  align-items: baseline; /* низ букв знака — на одной линии с доменом и телефоном */
  gap: var(--space-2);
  padding-block: var(--space-2);
  border-bottom: 1px solid var(--line);
}

/* Словесный знак «Глебов» (0046): inline SVG из design/logo/glebov-wordmark.svg, зона нажатия 44px */
.mark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
}

/* Рамка знака на 8 единиц ниже базовой линии (1028 против 1020, 0047): поле под круглые буквы.
   Буквы того же размера и на том же месте: для выравнивания по базовой линии рамка та же, что до 0047
   (margin-top), картинка сдвинута на место (top), поле уходит под линию. Ширина — как до 0047
   (при width: auto ее задала бы пропорция атрибутов 75×26, и знак стал бы шире). overflow: visible —
   при плотности 1 Chrome округляет обрезку svg до целого пикселя и иначе снова срезал бы низ букв. */
.mark__logo {
  display: block;
  overflow: visible;
  height: calc(26px * 1028 / 1020);
  width: 75px;
  margin-top: calc(-26px * 8 / 1020);
  position: relative;
  top: calc(26px * 8 / 1020);
}

.bar__domain {
  font-weight: 500;
  color: var(--muted);
}

.bar__phone {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.bar__phone:hover { text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 400px) {
  .bar__domain { display: none; }
}

/* ——— первый экран ——— */

.hero {
  container-type: inline-size;
  padding-block: var(--space-5) var(--space-5);
}

.hero .label { margin-bottom: var(--space-4); }

/* Подпись-знак: размерная линия меряет ширину имени */
.sign { width: fit-content; max-width: 100%; }

/* Размерная линия как на строительном чертеже */
.dim {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-2);
  height: 20px;
}

.dim::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 1px solid var(--ink);
}

.dim__text {
  position: relative;
  padding-inline: 12px;
  background: var(--bg);
  font-size: var(--text-label);
  font-weight: 500;
  line-height: 20px;
  color: var(--ink);
  white-space: nowrap;
}

@media (max-width: 400px) {
  .dim__text { font-size: 0.75rem; padding-inline: 8px; }
}

.dim::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--ink), var(--ink)) left center / 1px 100% no-repeat,
    linear-gradient(var(--ink), var(--ink)) right center / 1px 100% no-repeat;
}

.name {
  font-weight: 700;
  font-size: 30cqi;
  line-height: 0.86;
  letter-spacing: -0.055em;
  margin-left: -0.04em;
}

.name__line { display: block; }

.lead {
  max-width: 30ch;
  margin-top: var(--space-4);
  font-size: var(--text-lead);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

@media (min-width: 720px) {
  .name { font-size: 16.2cqi; white-space: nowrap; }
  .name__line { display: inline; }
  .hero { padding-block: var(--space-6) var(--space-6); }
}

/* 0042: телефон — плотнее первый экран, крупнее вводная */
@media (max-width: 719px) {
  .hero { padding-block: var(--space-4) var(--space-5); }
  .hero .label { margin-bottom: var(--space-3); }
  .lead { margin-top: var(--space-3); font-size: 1.375rem; font-weight: 600; }
}

/* ——— страница 404 ——— */

/* Мельче .name: длинное «страницы» должно влезть в 360px, на ПК — перенос вместо nowrap */
.lost__title {
  font-size: clamp(2.75rem, 13cqi, 8rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.045em;
  margin-left: -0.03em;
  text-wrap: balance;
}

.lost__home {
  max-width: 40rem;
  margin-top: var(--space-5);
  border-top: 1px solid var(--ink);
}

/* ——— секции ——— */

.section {
  display: grid;
  gap: var(--space-3);
  padding-block: var(--space-4) var(--space-5);
  border-top: 1px solid var(--line);
}

.section__title { padding-top: var(--space-1); }

@media (min-width: 960px) {
  .section {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--space-3);
    padding-block: var(--space-5) var(--space-6);
  }
  .section__title { grid-column: 1 / span 3; }
  .section > :not(.section__title) { grid-column: 4 / -1; }
}

/* ——— что делаем ——— */

.works__item {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  column-gap: var(--space-2);
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.works__item:first-child { padding-top: 0; }

.works__num {
  grid-row: span 2;
  padding-top: 0.45em;
  font-size: var(--text-label);
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.works__name {
  font-size: var(--text-item);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.works__note {
  margin-top: var(--space-1);
  color: var(--muted);
}

/* ——— личный кабинет (скоро) ——— */

.soon {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--ink);
}

.soon::after {
  content: "";
  flex: 1;
  border-top: 1px dashed var(--ink);
}

.cabinet__lead {
  max-width: 30ch;
  font-size: var(--text-lead);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-wrap: pretty;
}

.features__item {
  display: grid;
  padding-block: var(--space-3);
  border-bottom: 1px dashed var(--line);
}

.features__item:first-child { padding-top: 0; }

.features__name {
  font-size: var(--text-item);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.features__note {
  margin-top: var(--space-1);
  color: var(--muted);
}

/* ——— контакты ——— */

.contacts { border-top: 1px solid var(--ink); }

.contact {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "channel arrow"
    "value arrow";
  align-items: center;
  column-gap: var(--space-2);
  min-height: 88px;
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--ink);
  text-decoration: none;
  transition: background-color 200ms var(--ease), color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.contact__channel {
  grid-area: channel;
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 200ms var(--ease);
}

.contact__value {
  grid-area: value;
  font-size: var(--text-item);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.contact__value--phone {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.contact__arrow {
  grid-area: arrow;
  font-size: var(--text-item);
  line-height: 1;
  transition: transform 200ms var(--ease);
}

@media (min-width: 720px) {
  .contact {
    grid-template-columns: 12rem 1fr auto;
    grid-template-areas: "channel value arrow";
  }
}

@media (hover: hover) {
  .contact:hover {
    background: var(--ink);
    color: var(--on-ink);
    box-shadow: calc(var(--space-2) * -1) 0 0 var(--ink), var(--space-2) 0 0 var(--ink);
  }
  .contact:hover .contact__channel { color: var(--muted-on-ink); }
  .contact:hover .contact__arrow { transform: translateX(6px); }
}

/* ——— подвал ——— */

.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-1) var(--space-3);
  padding-block: var(--space-3);
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--muted);
}

/* ——— панель связи (0042): телефон, зона большого пальца ——— */

.dock { display: none; }

@media (max-width: 719px) {
  .dock {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--ink);
    color: var(--on-ink);
  }
  .dock__link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    font-weight: 600;
    text-decoration: none;
  }
  .dock__link + .dock__link { border-left: 1px solid var(--muted); }
  .dock__link:focus-visible { outline-color: var(--on-ink); outline-offset: -6px; }
  /* Место под панель: последний блок и подвал не уходят под нее */
  body:has(> .dock) { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
}

/* ——— появление блоков при прокрутке (0042): только CSS, без JS ——— */

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .section > * {
      animation: rise linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 70%;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
