/* =========================================================================
   ЭкспериментСайт — таблица стилей
   Порядок блоков: шрифт → токены → база → типографика → утилиты → каркас
   → компоненты → страницы → адаптив.
   ========================================================================= */

/* ---------- шрифт ---------- */

@font-face {
  font-family: "Geologica";
  src: url('/assets/fonts/Geologica/Geologica-Variable-subset.woff2') format('woff2'),
       url('/assets/fonts/Geologica/Geologica-Variable-subset.woff') format('woff');
  font-weight: 100 900;
  font-style: oblique 0deg;
  font-display: swap;
  unicode-range: U+0020-007E, U+02B9-02BA, U+02BC, U+02C6-02C7, U+02D8-02DD, U+0400-045F, U+0462-0463, U+046A-046B, U+0472-0475, U+0490-049D, U+04A0-04A5, U+04AA-04AB, U+04AE-04B3, U+04B6-04BB, U+04C0-04C2, U+04CB-04CC, U+04CF-04D9, U+04DC-04DF, U+04E2-04E9, U+04EE-04F9, U+2010, U+2013-2014, U+2018-201A, U+201C-201E, U+2020-2022, U+2026, U+2030, U+2032-2033, U+2039-203A, U+2044, U+2052, U+2074, U+20A1, U+20A3-20A4, U+20A6-20A7, U+20A9, U+20AB-20AE, U+20B1-20B2, U+20B4-20B5, U+20B8-20BA, U+20BC-20BD, U+2116, U+2122, U+2190-2193, U+2196-2199;
}

/* ---------- токены ---------- */

:root {
  color-scheme: light;

  /* Чернила. Все тона тёплые, под цвет бумаги. Проверены на контраст к --bg:
     ink 14.9 · ink-700 12.5 · ink-500 5.8 · warning 5.6 · accent 6.7 — все AA. */
  --ink: #121210;
  --ink-700: #2d2d2a;
  --ink-500: #5f5f5a;
  --ink-300: #7c7c76;   /* только декор, для текста не использовать */

  /* Бумага и линии */
  --bg: #f9f9f9;
  --raised: #ffffff;    /* приподнятые плашки: меню */
  --line: #bdbdb6;

  /* Акценты */
  --accent: #4f35d6;    /* индекс каталога */
  --feed: #176b40;      /* фиды */
  --acid: #d8ff3e;      /* ховер кнопки */
  --warning: #8f5200;   /* ограничения, примечания */

  /* Линейки одной строкой — их в макете два веса */
  --rule: 1px solid var(--line);
  --rule-strong: 1px solid var(--ink);

  /* Ритм */
  --pad: clamp(18px, 3.2vw, 48px);
  --maxw: 1560px;
  --section-pad: clamp(64px, 7vw, 124px);
  --step-s: 16px;
  --step-m: 24px;
  --step-l: 40px;
  --step-xl: 56px;
}

/* ---------- база ---------- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-700);
  font-family: "Geologica", system-ui, sans-serif;
  font-variation-settings: "SHRP" 100;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}

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

/* ---------- типографика ---------- */

h1, h2, h3 { color: var(--ink); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(44px, 5.8vw, 96px); font-weight: 560; line-height: .94; letter-spacing: -.055em; }
h2 { font-size: clamp(34px, 5vw, 74px); font-weight: 520; line-height: .98; letter-spacing: -.055em; margin-bottom: clamp(24px, 3vw, 44px); }
h3 { font-size: clamp(22px, 2.1vw, 34px); font-weight: 520; line-height: 1.08; letter-spacing: -.035em; }

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

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

code { font: inherit; font-size: .9em; background: rgba(0,0,0,.06); padding: .1em .3em; }

:where(a, button, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.lead { font-size: clamp(18px, 2vw, 28px); line-height: 1.4; color: var(--ink); max-width: 48ch; letter-spacing: -.02em; }
.small { font-size: 13px; line-height: 1.5; color: var(--ink-500); }
.caption { font-size: 11px; line-height: 1.2; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-500); }

/* ---------- утилиты ---------- */

.num { font-variant-numeric: tabular-nums; }
.mt-s { margin-top: var(--step-s); }
.mt-m { margin-top: var(--step-m); }
.mt-l { margin-top: var(--step-l); }
.mt-xl { margin-top: var(--step-xl); }

/* ---------- каркас ---------- */

/* Ссылка для клавиатуры: уезжает за экран, возвращается по фокусу. */
.skip { position: absolute; left: -9999px; top: 0; z-index: 10; background: var(--ink); color: #fff; font-size: 14px; font-weight: 570; padding: 12px 18px; text-decoration: none; }
.skip:focus { left: 0; color: #fff; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }

.section { padding-block: var(--section-pad); }
.products { padding-top: clamp(48px, 6vw, 96px); }

.section__head { margin-bottom: clamp(36px, 4.5vw, 68px); }
.section__head .caption { margin-bottom: 14px; }
.section__head :is(h1, h2) { margin-bottom: 0; }

/* ---------- шапка ---------- */

.header__in { display: flex; align-items: center; gap: 18px; min-height: 78px; }

.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; flex: none; }
.logo__mark { display: block; width: 38px; height: 38px; flex: none; }
.logo__name { font-size: 18px; line-height: 1; letter-spacing: -.035em; color: var(--ink); white-space: nowrap; }
.logo__name b { font-weight: 760; }
.logo__name span { font-weight: 300; }

.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; padding: 5px; background: var(--raised); border: var(--rule); border-radius: 999px; }
.nav a { color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 520; padding: 9px 15px; border-radius: 999px; transition: background-color .2s, color .2s; }
.nav a:hover { color: var(--ink); background: var(--bg); }
.nav a[aria-current="page"],
.nav a[aria-current="page"]:hover { background: var(--ink); color: #fff; }

/* ---------- карточки продуктов ---------- */

.cards { display: grid; gap: clamp(36px, 5vw, 76px) clamp(18px, 2vw, 32px); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { min-width: 0; }

.card__media { position: relative; display: block; aspect-ratio: 1.3 / 1; overflow: hidden; color: #fff; text-decoration: none; padding: clamp(20px, 3vw, 42px); isolation: isolate; }
.card__media:hover { color: #fff; }
.card__media::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.13) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.13) 1px, transparent 1px); background-size: 12.5% 12.5%; transition: transform .6s cubic-bezier(.2,.8,.2,1); z-index: -1; }
.card__media:hover::before { transform: scale(1.05); }
.card__media--facet { background: var(--accent); }
.card__media--feed { background: var(--feed); }
.card__media strong { position: absolute; left: 5%; bottom: 3%; font-size: clamp(78px, 14vw, 220px); line-height: .8; letter-spacing: -.09em; font-weight: 620; }

.card__label, .card__media-note { position: absolute; top: clamp(20px, 3vw, 42px); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.card__label { left: clamp(20px, 3vw, 42px); }
.card__media-note { right: clamp(20px, 3vw, 42px); }

.card__body { padding-top: 22px; display: grid; grid-template-columns: 1fr auto; gap: 12px 28px; border-top: var(--rule-strong); margin-top: 14px; }
.card__body .caption, .card__body > p:not(.card__metrics), .card__body h3 { grid-column: 1 / -1; }
.card__body h3 a { text-decoration: none; }
.card__body > p:not(.caption):not(.card__metrics) { max-width: 62ch; color: var(--ink-500); }

.card__metrics { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 0; font-size: 12px; font-weight: 600; color: var(--ink); }
.card__metrics span { border: var(--rule); border-radius: 999px; padding: 6px 10px; }

.card__link { margin-top: 8px; justify-self: end; align-self: start; font-size: 13px; font-weight: 600; text-decoration: none; }
.card__link span { display: inline-block; margin-left: 4px; transition: transform .2s; }
.card__link:hover span { transform: translate(3px,-3px); }

/* ---------- герой продуктовой страницы ---------- */

.hero { padding-block: clamp(60px, 8vw, 120px); }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); gap: clamp(48px, 8vw, 140px); align-items: start; }
.hero__eyebrow { margin-bottom: 22px; }
.hero__sub { margin-top: 28px; }
.hero__figure { margin-top: 35px; }

.figure__num { font-size: clamp(100px, 15vw, 240px); font-weight: 560; line-height: .78; letter-spacing: -.09em; color: var(--accent); margin: 0 0 28px; font-variant-numeric: tabular-nums; }
.figure__num--feed { color: var(--feed); }
.figure__delta { font-size: clamp(20px, 2.4vw, 36px); font-weight: 520; color: var(--ink); margin-bottom: 14px; letter-spacing: -.035em; }
.figure__cond { max-width: 38ch; }

/* ---------- кнопки ---------- */

.cta { margin-top: 34px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.cta .small { flex-basis: 100%; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; background: var(--ink); color: #fff; font-weight: 570; font-size: 14px; text-decoration: none; padding: 14px 22px; border: var(--rule-strong); transition: background-color .2s, color .2s, transform .2s; }
.btn:hover { background: var(--acid); border-color: var(--acid); color: var(--ink); transform: translateY(-2px); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--raised); border-color: var(--ink); color: var(--ink); }

/* ---------- сетки контента ---------- */

.grid { display: grid; gap: 0; grid-template-columns: 1fr; margin-top: 54px; border-top: var(--rule); }
.grid--2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.item { padding: clamp(26px, 4vw, 58px) clamp(0px, 2.8vw, 42px); border-bottom: var(--rule); }
.grid--2 .item:nth-child(odd) { padding-left: 0; border-right: var(--rule); }
.grid--2 .item:nth-child(even) { padding-right: 0; }
.item h3 { margin-bottom: 16px; max-width: 20ch; }
.item p { max-width: 62ch; color: var(--ink-500); }

/* ---------- таблицы ---------- */

/* Прокручивается по горизонтали, поэтому в разметке имеет tabindex="0". */
.tablewrap { overflow-x: auto; margin-top: 42px; border-top: var(--rule-strong); }
.tablewrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

table { border-collapse: collapse; width: 100%; min-width: 520px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 18px 22px 18px 0; border-bottom: var(--rule); vertical-align: top; }
tbody th { color: var(--ink); font-weight: 520; }
thead th { font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-500); }
td.n { font-weight: 620; color: var(--ink); }

/* ---------- ограничения и шаги ---------- */

.limits { margin-top: 42px; display: grid; gap: 0; border-top: var(--rule-strong); }
.limit { position: relative; padding: 28px 0 28px clamp(42px, 6vw, 90px); border-bottom: var(--rule); }
.limit::before { content: "—"; position: absolute; left: 0; color: var(--warning); }
.limit h3 { font-size: clamp(19px, 2vw, 28px); margin-bottom: 10px; }
.limit p { max-width: 76ch; color: var(--ink-500); }

.steps { counter-reset: s; list-style: none; margin: 42px 0 0; padding: 0; border-top: var(--rule-strong); }
.steps li { counter-increment: s; display: grid; grid-template-columns: clamp(48px, 7vw, 104px) 1fr; gap: 20px; padding: 24px 0; border-bottom: var(--rule); font-size: clamp(17px, 1.8vw, 23px); }
.steps li::before { content: "0" counter(s); font-variant-numeric: tabular-nums; font-weight: 560; color: var(--ink-500); }

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

#support { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; }
#support h2 { font-size: clamp(38px, 5.5vw, 82px); margin-top: 18px; margin-bottom: 28px; }
#support .lead { margin-top: 0; }

.contact__mail { display: inline-flex; align-items: center; gap: 20px; padding: clamp(20px, 3vw, 42px) 0; font-size: clamp(26px, 5vw, 78px); font-weight: 480; line-height: 1; letter-spacing: -.055em; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.contact__mail::after { content: "↗"; font-size: .55em; transition: transform .2s; }
.contact__mail:hover::after { transform: translate(5px,-5px); }

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

.footer { color: var(--ink-500); padding-block: 44px; font-size: 12px; border-top: var(--rule); }
.footer__in { display: flex; gap: 24px 48px; flex-wrap: wrap; align-items: flex-start; }
.footer .logo__name { font-size: 17px; color: var(--ink); }
.footer__legal { margin-left: auto; display: grid; grid-template-columns: repeat(2, minmax(170px,1fr)); gap: 7px 34px; }
.footer__legal a { color: var(--ink-500); text-decoration: none; }
.footer__legal a:hover { color: var(--ink); }

/* ---------- юридические страницы ---------- */

.legal { max-width: 92ch; }
.legal h1 { margin-top: 16px; margin-bottom: 14px; }
.legal h2 { font-size: clamp(22px, 2.6vw, 36px); font-weight: 540; margin: 42px 0 16px; letter-spacing: -.035em; }
.legal p, .legal li { max-width: 82ch; }
.legal__meta { margin-bottom: 44px; }
.legal__intro { margin-bottom: 8px; }

.legal__list { counter-reset: l1; list-style: none; margin: 0; padding: 0; }
.legal__list > li { counter-increment: l1; margin-top: 54px; padding-top: 1px; border-top: var(--rule); }
.legal__list > li > h2::before { content: counter(l1, decimal-leading-zero) " / "; color: var(--ink-500); font-variant-numeric: tabular-nums; font-weight: 480; }
.legal__list ol { counter-reset: l2; list-style: none; margin: 0; padding: 0; }
.legal__list ol > li { counter-increment: l2; position: relative; padding-left: 4.2em; margin-top: 14px; }
.legal__list ol > li::before { content: counter(l1) "." counter(l2) "."; position: absolute; left: 0; color: var(--ink-500); font-variant-numeric: tabular-nums; }

.legal__marks { list-style: disc; margin: 8px 0 0; padding-left: 1.25em; }
.legal__marks li { margin-top: 4px; padding-left: 0; }
.legal__note { border-left: 3px solid var(--warning); padding-left: 18px; margin-top: 28px; margin-bottom: 14px; }

.legal__req { border-top: var(--rule-strong); padding: 24px 0; margin-top: 32px; display: grid; gap: 14px 28px; grid-template-columns: 15em 1fr; }
.legal__req dt { color: var(--ink-500); font-size: 13px; }
.legal__req dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
.legal__quote { border-top: var(--rule-strong); padding: 24px 0; margin-top: 32px; }

.legal__index { list-style: none; margin: 60px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 40px; border-top: var(--rule-strong); }
.legal__index li { padding: 32px 0; border-bottom: var(--rule); }
.legal__index h2 { font-size: clamp(22px,2.4vw,34px); margin-bottom: 12px; }
.legal__index h2 a { text-decoration: none; }

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

.error-page { min-height: 100vh; display: flex; flex-direction: column; }
.error-page__main { flex: 1; display: flex; align-items: center; }
.error-page__content { width: 100%; padding-block: clamp(36px, 7vw, 100px); }
.error-page__panel { display: grid; grid-template-columns: minmax(280px,.8fr) minmax(340px,1.2fr); min-height: 520px; border-top: var(--rule-strong); border-bottom: var(--rule-strong); }
.error-page__visual { display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; padding: 50px; background: var(--accent); }
.error-page__visual::before { content: ""; position: absolute; width: 80%; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; }
.error-page__code { position: relative; color: #fff; font-size: clamp(96px, 14vw, 210px); font-weight: 570; line-height: .8; letter-spacing: -.09em; }
.error-page__mark { position: absolute; right: 32px; bottom: 32px; width: 76px; height: 76px; color: rgba(0,0,0,.16); }
.error-page__copy { padding: clamp(42px, 7vw, 100px); align-self: center; }
.error-page__copy h1 { font-size: clamp(48px,6vw,92px); margin: 14px 0 26px; }
.error-page__actions { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- адаптив ---------- */

@media (max-width: 900px) {
  .header__in { min-height: 70px; flex-wrap: wrap; padding-block: 12px; }
  .nav { order: 2; margin: 0; overflow-x: auto; border-radius: 12px; }
  .nav a { white-space: nowrap; border-radius: 12px; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__figure { max-width: 620px; margin-top: 0; }
  .figure__num { font-size: clamp(110px,30vw,220px); }
  .error-page__panel { grid-template-columns: 1fr; }
  .error-page__visual { min-height: 280px; }
}

@media (max-width: 700px) {
  h1 { font-size: clamp(44px,12vw,68px); }
  h2 { font-size: clamp(34px,11vw,58px); }
  .cards, .grid--2, .legal__index { grid-template-columns: 1fr; }
  .card__media { aspect-ratio: 1 / .9; }
  .card__media strong { font-size: clamp(110px,36vw,190px); }
  .grid--2 .item:nth-child(odd) { border-right: 0; }
  .item { padding-inline: 0; }
  .footer__legal { margin-left: 0; grid-template-columns: 1fr; width: 100%; }
  .legal__req { grid-template-columns: 1fr; }
  .error-page__copy { padding-inline: 0; }
}

@media (max-width: 430px) {
  .logo__mark { width: 32px; height: 32px; }
  .logo__name { font-size: 16px; }
  .nav a { font-size: 12px; padding: 8px 11px; }
  .card__body { grid-template-columns: 1fr; }
  .card__link { justify-self: start; }
  .contact__mail { align-items: flex-end; }
  .legal__list ol > li { padding-left: 3.4em; }
  .error-page__actions { display: grid; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
