/* Extremum — журнал о высшей математике */

:root {
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-math: "STIX Two Text", "Times New Roman", Georgia, serif;

  --bg: #fbfbfd;
  --bg-alt: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --tint: #eef2fb;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --line: rgba(0, 0, 0, .09);
  --accent: #0071e3;
  --link: #0066cc;
  --nav-bg: rgba(251, 251, 253, .72);
  --dark-bg: #16161a;
  --dark-ink: #f5f5f7;

  --c1: #0071e3;
  --c2: #7b5cf0;
  --c3: #00a29a;
  --c4: #ff7a1a;
  --c5: #ff2d6f;
  --grid: rgba(0, 0, 0, .08);

  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 2px 8px rgba(0, 0, 0, .04);
  --shadow-lift: 0 18px 40px rgba(0, 0, 0, .12);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --wrap: 1180px;
}

[data-theme="dark"] {
  --bg: #000000;
  --bg-alt: #0a0a0b;
  --surface: #1c1c1e;
  --surface-2: #121214;
  --tint: #171a24;
  --ink: #f5f5f7;
  --ink-2: #a1a1a6;
  --ink-3: #86868b;
  --line: rgba(255, 255, 255, .12);
  --accent: #2997ff;
  --link: #2997ff;
  --nav-bg: rgba(10, 10, 11, .72);
  --dark-bg: #1c1c1e;
  --shadow: 0 2px 8px rgba(0, 0, 0, .5);
  --shadow-lift: 0 18px 40px rgba(0, 0, 0, .6);
  --c1: #2997ff;
  --c2: #a78bfa;
  --c3: #2dd4bf;
  --c4: #ffa04d;
  --c5: #ff6b9d;
  --grid: rgba(255, 255, 255, .1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --bg-alt: #0a0a0b;
    --surface: #1c1c1e;
    --surface-2: #121214;
    --tint: #171a24;
    --ink: #f5f5f7;
    --ink-2: #a1a1a6;
    --line: rgba(255, 255, 255, .12);
    --accent: #2997ff;
    --link: #2997ff;
    --nav-bg: rgba(10, 10, 11, .72);
    --dark-bg: #1c1c1e;
    --shadow: 0 2px 8px rgba(0, 0, 0, .5);
    --shadow-lift: 0 18px 40px rgba(0, 0, 0, .6);
    --c1: #2997ff;
    --c2: #a78bfa;
    --c3: #2dd4bf;
    --c4: #ffa04d;
    --c5: #ff6b9d;
    --grid: rgba(255, 255, 255, .1);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  transition: background-color .4s var(--ease), color .4s var(--ease);
}

h1, h2, h3, h4 { font-weight: 500; letter-spacing: -.025em; margin: 0; line-height: 1.1; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }

.wrap { width: min(100% - 44px, var(--wrap)); margin-inline: auto; }
.muted { color: var(--ink-3); }
.section { padding: 76px 0; }
.section + .section { padding-top: 0; }

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

.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  padding: 10px 16px; background: var(--surface); border-radius: 10px;
  box-shadow: var(--shadow-lift); transform: translateY(-160%);
  transition: transform .25s var(--ease);
}
.skip-link:focus { transform: none; }

/* ---------- nav ---------- */

.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.nav.is-stuck { border-bottom-color: var(--line); }

.nav__inner {
  width: min(100% - 32px, 1280px); margin-inline: auto;
  height: 46px; display: flex; align-items: center; gap: 8px;
}

.nav__logo { display: flex; align-items: center; gap: 7px; padding-right: 10px; }
.nav__glyph { font-family: var(--font-math); font-size: 21px; line-height: 1; transform: translateY(-1px); }
.nav__brand { font-size: 13px; font-weight: 500; letter-spacing: -.01em; }

.nav__links { display: flex; flex: 1; justify-content: center; gap: 4px; }
.nav__links a {
  font-size: 12px; font-weight: 300; color: var(--ink);
  padding: 6px 11px; border-radius: 8px; opacity: .88;
  transition: opacity .2s var(--ease), background-color .2s var(--ease);
  white-space: nowrap;
}
.nav__links a:hover { opacity: 1; background: color-mix(in srgb, var(--ink) 6%, transparent); }

.nav__actions { display: flex; align-items: center; gap: 2px; }

.icon-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; padding: 0 8px; border: 0; border-radius: 8px;
  background: transparent; cursor: pointer;
  transition: background-color .2s var(--ease);
}
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.icon-btn--lang span { font-size: 11px; font-weight: 500; letter-spacing: .04em; }
.nav__burger { display: none; }

.icon-sun { display: none; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block; }
  :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* ---------- promo strip ---------- */

.promo {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: var(--bg-alt); padding: 13px 20px; font-size: 13px; color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.promo__viewport { display: grid; max-width: min(660px, 62vw); }
.promo__item {
  grid-area: 1 / 1; text-align: center; opacity: 0;
  transform: translateY(6px); transition: opacity .5s var(--ease), transform .5s var(--ease);
  pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.promo__item.is-active { opacity: 1; transform: none; }
.promo__link { display: inline-flex; align-items: center; gap: 5px; color: var(--link); }
.promo__link:hover { text-decoration: underline; }
.promo__link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.promo__arrow {
  border: 0; background: transparent; cursor: pointer; color: var(--ink-3);
  padding: 4px; line-height: 0; border-radius: 50%;
  transition: color .2s var(--ease), transform .2s var(--ease);
}
.promo__arrow:hover { color: var(--ink); transform: scale(1.15); }
.promo__arrow svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

/* ---------- hero ---------- */

.hero {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 40px;
  padding: 86px 0 64px;
}
.hero__title {
  font-size: clamp(56px, 9vw, 108px); font-weight: 600; letter-spacing: -.045em;
  background: linear-gradient(180deg, var(--ink), color-mix(in srgb, var(--ink) 72%, var(--accent)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__aside { text-align: right; max-width: 330px; justify-self: end; }
.hero__tagline { font-size: 22px; font-weight: 500; letter-spacing: -.02em; line-height: 1.22; }
.link-arrow {
  display: block; margin-top: 12px; color: var(--link); font-size: 15px;
}
.link-arrow i { font-style: normal; display: inline-block; transition: transform .25s var(--ease); }
.link-arrow:hover { text-decoration: underline; }
.link-arrow:hover i { transform: translate(2px, -2px); }

/* ---------- topic tiles ---------- */

.tiles { padding-bottom: 34px; }
.tiles__row {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px;
  scroll-snap-type: x proximity; scrollbar-width: none;
}
.tiles__row::-webkit-scrollbar { display: none; }
.tile {
  flex: 1 0 96px; display: flex; flex-direction: column; align-items: center; gap: 12px;
  font-size: 12px; color: var(--ink-2); text-align: center; scroll-snap-align: start;
  transition: color .2s var(--ease);
}
.tile__chip {
  width: 72px; height: 72px; display: grid; place-items: center;
  font-family: var(--font-math); font-size: 34px; color: var(--ink);
  border-radius: 50%;
  background:
    radial-gradient(120% 120% at 30% 20%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.tile:hover { color: var(--ink); }
.tile:hover .tile__chip { transform: translateY(-5px) scale(1.04); box-shadow: inset 0 0 0 1px var(--line), var(--shadow-lift); }

/* ---------- section heads ---------- */

.section__head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  margin-bottom: 26px;
}
.section__head h2 {
  font-size: clamp(28px, 3.4vw, 40px); font-weight: 500; letter-spacing: -.03em;
}
.section__head h2 .muted { display: inline; font-weight: 300; }
.carousel__nav { display: flex; gap: 8px; flex-shrink: 0; }

.round-btn {
  width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer;
  background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink);
  display: grid; place-items: center;
  transition: background-color .2s var(--ease), opacity .2s var(--ease), transform .2s var(--ease);
}
.round-btn:hover { background: color-mix(in srgb, var(--ink) 14%, transparent); }
.round-btn:active { transform: scale(.92); }
.round-btn[disabled] { opacity: .3; cursor: default; }
.round-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }

/* ---------- carousel cards ---------- */

.carousel {
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 6px calc((100vw - min(100vw - 44px, var(--wrap))) / 2) 26px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }

.card {
  flex: 0 0 clamp(272px, 30vw, 348px); scroll-snap-align: center;
  border-radius: var(--radius); padding: 30px 30px 0; min-height: 460px;
  display: flex; flex-direction: column; background: var(--surface);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lift); }
.card--dark { background: var(--dark-bg); color: var(--dark-ink); }
.card--tint { background: var(--tint); }
.card__tag {
  font-size: 12px; font-weight: 500; letter-spacing: .01em; color: var(--c4);
  text-transform: uppercase; margin-bottom: 10px;
}
.card--dark .card__tag { color: var(--c4); }
.card h3 { font-size: 26px; font-weight: 500; margin-bottom: 8px; }
.card__sub { font-size: 15px; color: var(--ink-2); }
.card--dark .card__sub { color: #b9b9be; }
.card__art { margin-top: auto; padding-top: 24px; }
.card__art svg { width: 100%; height: auto; overflow: visible; }

/* ---------- feature ---------- */

.feature__box {
  background: var(--dark-bg); color: var(--dark-ink); border-radius: 28px;
  padding: clamp(30px, 4vw, 56px);
  display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px);
  align-items: center;
}
.feature__text .eyebrow {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--c4); margin-bottom: 14px;
}
.feature__text h2 { font-size: clamp(30px, 3.6vw, 46px); font-weight: 500; margin-bottom: 18px; }
.feature__text p { color: #b9b9be; font-size: 16px; margin-bottom: 14px; }
.feature__text .lead { color: var(--dark-ink); font-size: 19px; font-weight: 300; }
.feature__viz figcaption { margin-top: 12px; font-size: 13px; color: #8e8e93; }

.btn {
  display: inline-block; margin-top: 10px; padding: 11px 22px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 15px; border: 0; cursor: pointer;
  transition: transform .2s var(--ease), filter .2s var(--ease);
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.97); }

/* ---------- panels / charts ---------- */

.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel--wide { grid-column: 1 / -1; }

.panel {
  margin: 0; background: var(--surface); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow); border: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.panel h3 { font-size: 21px; margin-bottom: 8px; }
.panel__desc { font-size: 14px; color: var(--ink-2); margin-bottom: 18px; max-width: 52ch; }

.chart { position: relative; }
.chart svg { width: 100%; height: auto; }
.chart--canvas { border-radius: var(--radius-sm); overflow: hidden; }
.chart--canvas canvas { width: 100%; height: auto; }

.axis-line { stroke: var(--grid); stroke-width: 1; }
.grid-line { stroke: var(--grid); stroke-width: 1; stroke-dasharray: 2 5; }
.tick-text { font-family: var(--font-math); font-size: 12px; fill: var(--ink-3); }
.curve { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.curve--draw { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.5s var(--ease); }
.is-visible .curve--draw { stroke-dashoffset: 0; }

.controls { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.control { display: flex; flex-direction: column; gap: 8px; flex: 1 1 200px; font-size: 13px; color: var(--ink-2); }
.control b { font-family: var(--font-math); font-weight: 500; color: var(--ink); font-size: 14px; }
.control__label { font-size: 13px; color: var(--ink-2); }
.readout { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-family: var(--font-math); }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 14%, transparent); cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(0, 0, 0, .28);
  transition: transform .2s var(--ease);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(0, 0, 0, .28);
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--ink-2);
  border-radius: 999px; padding: 5px 14px; font-size: 13px; font-family: var(--font-math);
  cursor: pointer; transition: all .2s var(--ease);
}
.chip:hover { border-color: color-mix(in srgb, var(--ink) 28%, transparent); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- formulas ---------- */

.formula {
  font-family: var(--font-math); font-size: 20px; line-height: 1.6;
  display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 6px;
  margin: 18px 0;
}
.formula--sm { font-size: 16px; margin: 12px 0 0; color: var(--ink-2); }
.frac { display: inline-flex; flex-direction: column; text-align: center; vertical-align: middle; font-size: .86em; }
.frac > span:first-child { border-bottom: 1px solid currentColor; padding: 0 4px 1px; }
.frac > span:last-child { padding-top: 1px; }
.sum { font-size: 1.3em; display: inline-flex; align-items: center; }
.sum sub, .sum sup { font-size: .42em; }

/* ---------- posts ---------- */

.post {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 10px;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.post:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); border-color: transparent; }
.post__cat { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.post h3 { font-size: 22px; line-height: 1.2; }
.post__excerpt { font-size: 15px; color: var(--ink-2); }
.post__meta { margin-top: auto; padding-top: 14px; font-size: 13px; color: var(--ink-3); font-family: var(--font-math); }

/* ---------- terms ---------- */

.hint { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; }
.terms { border-top: 1px solid var(--line); }
.term { border-bottom: 1px solid var(--line); }
.term summary {
  list-style: none; cursor: pointer; padding: 22px 4px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  font-size: clamp(20px, 2.4vw, 26px); font-weight: 400; letter-spacing: -.02em;
  transition: color .2s var(--ease);
}
.term summary::-webkit-details-marker { display: none; }
.term summary:hover { color: var(--accent); }
.term summary i {
  position: relative; width: 16px; height: 16px; flex-shrink: 0; opacity: .5;
}
.term summary i::before, .term summary i::after {
  content: ""; position: absolute; inset: 50% 0 auto 0; height: 1.5px; background: currentColor;
  transition: transform .3s var(--ease);
}
.term summary i::after { transform: rotate(90deg); }
.term[open] summary i::after { transform: rotate(0); }
.term__body { padding: 0 4px 26px; max-width: 68ch; animation: fade-up .4s var(--ease) both; }
.term__body p { color: var(--ink-2); font-size: 16px; }

/* ---------- newsletter ---------- */

.news {
  background: var(--surface-2); border-radius: 28px; padding: clamp(34px, 5vw, 64px);
  text-align: center; border: 1px solid var(--line);
}
.news h2 { font-size: clamp(28px, 3.6vw, 42px); margin-bottom: 12px; }
.news .lead { color: var(--ink-2); max-width: 46ch; margin: 0 auto 26px; }
.news__form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.news__form input {
  flex: 0 1 320px; padding: 12px 18px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.news__form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.news__form .btn { margin-top: 0; }
.news__note { margin-top: 16px; font-size: 13px; color: var(--ink-3); }
.news.is-done .news__form { display: none; }

/* ---------- footer ---------- */

.footer { background: var(--bg-alt); border-top: 1px solid var(--line); padding: 34px 0 44px; font-size: 12px; color: var(--ink-3); }
.footer__note { max-width: 74ch; line-height: 1.5; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.footer__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 26px 0; }
.footer__cols h4 { font-size: 12px; font-weight: 500; color: var(--ink); margin-bottom: 10px; }
.footer__cols a { display: block; padding: 3px 0; transition: color .2s var(--ease); }
.footer__cols a:hover { color: var(--ink); text-decoration: underline; }
.footer__bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px;
  padding-top: 18px; border-top: 1px solid var(--line);
}
.footer__legal { display: flex; gap: 18px; flex: 1; }
.footer__legal a:hover { text-decoration: underline; }
.footer__lang {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  cursor: pointer; color: var(--ink-2); transition: border-color .2s var(--ease), color .2s var(--ease);
}
.footer__lang:hover { color: var(--ink); border-color: var(--ink-3); }
.footer__lang svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.3; }

/* ---------- language sheet ---------- */

.sheet { position: fixed; inset: 0; z-index: 90; }
.sheet[hidden] { display: none; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); animation: fade .3s var(--ease); }
.sheet__panel {
  position: absolute; inset: auto 0 0 0; max-height: 84vh; overflow-y: auto;
  background: var(--bg); border-radius: 22px 22px 0 0; padding: 28px clamp(20px, 5vw, 48px) 40px;
  animation: sheet-up .45s var(--ease);
}
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.sheet__head h2 { font-size: 24px; }
.sheet__note { font-size: 13px; color: var(--ink-3); margin: 8px 0 22px; }
.sheet__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.lang-opt {
  display: flex; align-items: baseline; gap: 8px; padding: 10px 14px; border-radius: 12px;
  border: 1px solid transparent; background: var(--surface); cursor: pointer; text-align: left;
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.lang-opt:hover { transform: translateY(-2px); border-color: var(--line); }
.lang-opt.is-active { border-color: var(--accent); color: var(--accent); }
.lang-opt small { font-size: 11px; color: var(--ink-3); letter-spacing: .06em; text-transform: uppercase; }

/* ---------- animations ---------- */

.reveal { opacity: 0; transform: translateY(26px); }
.reveal--d1 { --d: .06s; }
.reveal--d2 { --d: .12s; }
.reveal.is-visible {
  opacity: 1; transform: none;
  transition: opacity .8s var(--ease) var(--d, 0s), transform .8s var(--ease) var(--d, 0s);
}

@keyframes fade { from { opacity: 0 } }
@keyframes fade-up { from { opacity: 0; transform: translateY(-6px) } }
@keyframes sheet-up { from { transform: translateY(30px); opacity: 0 } }

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

/* ---------- responsive ---------- */

@media (max-width: 1040px) {
  .nav__links { display: none; }
  .nav__links.is-open {
    display: flex; position: absolute; inset: 46px 0 auto; flex-direction: column;
    background: var(--nav-bg); backdrop-filter: blur(20px); padding: 12px 24px 20px;
    border-bottom: 1px solid var(--line); gap: 2px;
  }
  .nav__links.is-open a { font-size: 15px; padding: 10px 0; }
  .nav__burger { display: inline-flex; }
  .nav__logo { flex: 1; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  body { font-size: 16px; }
  .hero { grid-template-columns: 1fr; align-items: start; padding: 56px 0 44px; gap: 22px; }
  .hero__aside { text-align: left; justify-self: start; }
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .feature__box { grid-template-columns: minmax(0, 1fr); }
  .section { padding: 56px 0; }
  .section__head { flex-direction: column; align-items: flex-start; }
  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .promo { flex-wrap: wrap; justify-content: center; }
  .promo__viewport { order: -1; max-width: 100%; }
  .promo__item { white-space: normal; }
  .tile { flex-basis: 84px; }
  .tile__chip { width: 62px; height: 62px; font-size: 28px; }
}
