/* ---------- Темы ----------
 * Акцент — бургунди. На светлом фоне он работает как цвет текста.
 * На тёмном фоне светлый бордо превращается в розовый, поэтому там бордо — это заливки,
 * крупные цифры, маркеры и подчёркивания, а мелкий текст остаётся светлым.
 */
:root {
  --bg: #fbfbf9;
  --surface: #ffffff;
  --text: #15171c;
  --muted: #5d6370;
  --line: #e7e6e1;

  --accent: #8c1d40;        /* акцентный текст: клиент в кейсе */
  --accent-mark: #8c1d40;   /* крупные цифры, маркеры, подчёркивания, фокус */
  --accent-fill: #8c1d40;   /* заливки: основная кнопка */
  --on-accent: #ffffff;
  --badge-bg: #f6e4ea;
  --badge-fg: #8c1d40;
  --link: #8c1d40;
  --link-line: transparent; /* на светлом ссылки выделены цветом */

  --award: #9a6b00;
  --award-soft: #fff4d6;
  --ok: #1f9d55;

  /* полоса «Собственные продукты» — тёмная в обеих темах */
  --band-bg: #14161b;
  --band-surface: #1d2027;
  --band-text: #f1f2f4;
  --band-muted: #a4aab5;
  --band-line: #2c303a;
  --band-mark: #d1305b;     /* насыщенный винный: контраст >= 3:1 для крупных цифр */

  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014;
    --surface: #15181e;
    --text: #e9ebef;
    --muted: #9aa1ad;
    --line: #262a33;

    --accent: var(--text);
    --accent-mark: #d1305b;
    --accent-fill: #9e1f45;
    --on-accent: #ffffff;
    --badge-bg: #6e1530;
    --badge-fg: #f7e3e9;
    --link: var(--text);
    --link-line: #d1305b;

    --award: #f0c45a;
    --award-soft: #2e2511;
    --ok: #3ccf7f;

    --band-bg: #1a1e26;
    --band-surface: #222733;
    --band-text: #f1f2f4;
    --band-muted: #a9afba;
    --band-line: #323848;
    --band-mark: #d63a63;
  }
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a {
  color: var(--link);
  text-decoration: underline 1.5px var(--link-line);
  text-underline-offset: 3px;
}
a:hover { text-decoration-color: currentColor; }
.brand, .nav a, .btn { text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent-mark); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 800px; margin: 0 auto; padding: 0 24px; }
.wrap-wide { max-width: 1040px; }

section { padding: 96px 0; }
section + section { border-top: 1px solid var(--line); }

.section-title {
  font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
.section-lead { font-size: 22px; line-height: 1.45; letter-spacing: -.01em; max-width: 640px; margin-bottom: 48px; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; max-width: 1040px; }
.brand { display: flex; align-items: center; }
.brand-logo { display: block; width: 30px; height: 30px; border-radius: 8px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 24px; font-size: 15px; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); text-decoration: none; }
.lang {
  font: 600 13px/1 var(--font); letter-spacing: .04em;
  color: var(--text); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; cursor: pointer;
}
.lang:hover { border-color: var(--muted); }


/* ---------- Hero ---------- */
.hero { padding: 88px 0 72px; border-top: 0; }
.hero-top { display: flex; align-items: center; gap: 20px; margin-bottom: 32px; }
.avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; flex: none; }
.eyebrow { font-size: 15px; color: var(--muted); margin-bottom: 2px; }
.name { font-size: clamp(30px, 4vw, 40px); font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.tagline {
  font-size: clamp(32px, 5vw, 48px); font-weight: 700; letter-spacing: -.035em; line-height: 1.06;
  margin-bottom: 24px; text-wrap: balance;
}
.about { font-size: 19px; color: var(--muted); max-width: 640px; margin-bottom: 24px; }
.status { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; margin-bottom: 32px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 20%, transparent); }

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 64px; }
.btn {
  display: inline-flex; align-items: center; height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font-weight: 500; font-size: 15px;
}
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn-primary { background: var(--accent-fill); color: var(--on-accent); border-color: var(--accent-fill); }
.btn-primary:hover { opacity: .9; border-color: var(--accent-fill); }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.metric { padding: 20px 16px 0 0; display: flex; flex-direction: column; gap: 6px; }
.metric + .metric { padding-left: 16px; border-left: 1px solid var(--line); }
.metric-value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; }
.metric-label { font-size: 14px; line-height: 1.4; color: var(--muted); }

/* ---------- Карьера ---------- */
.timeline { display: flex; flex-direction: column; gap: 64px; }
.job { display: grid; grid-template-columns: 132px 1fr; gap: 24px; }
.job-when { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; position: sticky; top: 84px; align-self: start; }
.job-period { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
.job-duration { font-size: 13px; color: var(--muted); }
.job-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.job-head { display: flex; align-items: center; gap: 16px; }
.job-head-text { min-width: 0; }

/* Логотипы компаний: монохромный силуэт в плашке */
.logo {
  flex: none; width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
  color: color-mix(in srgb, var(--text) 80%, transparent);
}
.logo-mark {
  width: 28px; height: 28px; background: currentColor;
  -webkit-mask: no-repeat center / contain; mask: no-repeat center / contain;
}
.logo-mark-wide { width: 40px; height: 40px; }
.logo-mono { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }

.job-company { font-size: 24px; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
.job-about { font-weight: 400; color: var(--muted); font-size: 17px; letter-spacing: 0; }
.job-role { font-size: 16px; }
.job-loc { color: var(--muted); }

.case {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; gap: 18px;
}
.case-title { font-size: 19px; font-weight: 650; letter-spacing: -.01em; line-height: 1.3; }
.case-client { font-size: 15px; color: var(--accent); margin-top: 2px; display: flex; align-items: center; gap: 8px; }
.case-client::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--accent-mark); }
/* Полоса продуктовых метрик кейса */
.case-metrics {
  display: flex; flex-wrap: wrap;
  gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
/* плитки тянутся, чтобы ряды заполнялись без пустых ячеек */
.case-metrics li { flex: 1 1 100px; background: var(--surface); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.case-metric-value { font-size: 20px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; color: var(--accent-mark); white-space: nowrap; font-variant-numeric: tabular-nums; }
.case-metric-label { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.case-body { display: flex; flex-direction: column; gap: 12px; }
.case-row { display: grid; grid-template-columns: 104px 1fr; gap: 16px; }
.case-row dt { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.case-row dd { font-size: 16px; line-height: 1.55; }
.case-row-result dd { font-weight: 550; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { font-size: 13px; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: var(--badge-bg); color: var(--badge-fg); }
.badge-award { background: var(--award-soft); color: var(--award); }
.badge-up { background: var(--accent-fill); color: var(--on-accent); font-weight: 600; }

.stack { font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: var(--muted); }

.highlights { display: flex; flex-direction: column; gap: 8px; }
.highlights li { position: relative; padding-left: 20px; font-size: 16px; }
.highlights li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 8px; height: 2px; background: var(--muted); }

/* ---------- Собственные продукты ---------- */
.band {
  background: var(--band-bg); color: var(--band-text);
  --text: var(--band-text); --muted: var(--band-muted); --line: var(--band-line);
  --surface: var(--band-surface);
  --accent: var(--band-text); --accent-mark: var(--band-mark);
  --link: var(--band-text); --link-line: var(--band-mark);
}
section.band, section.band + section { border-top: 0; }
.products { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.product {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 10px;
}
.product-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 8px; }
.product-audience { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
/* Плитка продукта: монохромная иконка или SVG-силуэт на сером градиенте */
.product-tile {
  flex: none; width: 64px; height: 64px; border-radius: 16px; object-fit: cover;
  display: grid; place-items: center;
  background: linear-gradient(145deg, #5d6370, #14161b 85%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 6px 18px rgba(0, 0, 0, .25);
}
.product-tile-mark {
  width: 38px; height: 38px; background: #ccd0d8;
  -webkit-mask: no-repeat center / contain; mask: no-repeat center / contain;
}
.product-num { font-size: 48px; font-weight: 750; letter-spacing: -.04em; line-height: 1; color: var(--accent-mark); }
.product-unit { font-size: 15px; color: var(--muted); }
.product-name { font-size: 21px; font-weight: 650; letter-spacing: -.01em; }
.product-meta { font-size: 14px; color: var(--muted); }
.product-role { font-size: 15px; font-weight: 500; }
.product-proves { font-size: 15.5px; line-height: 1.55; color: var(--text); opacity: .92; }
.product-foot { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.product-links { display: flex; gap: 14px; flex: none; }
.product-link { font-size: 14px; white-space: nowrap; }
.product-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -2px 0 6px; font-size: 14px; color: var(--muted); }
.product-stats strong { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- Компетенции ---------- */
.competencies { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px 40px; }
.competency-group + .competency-group { margin-top: 48px; }
.competency-group-title {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
  font-size: 13px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text);
}
.competency-group-title::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent-mark); }
.competency h4 { font-size: 17px; font-weight: 650; margin-bottom: 6px; }
.competency p { font-size: 15.5px; color: var(--muted); }

/* ---------- Образование ---------- */
.edu { display: flex; flex-direction: column; }
.edu-item { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.edu-item:first-child { border-top: 1px solid var(--line); }
.edu-year { color: var(--muted); font-variant-numeric: tabular-nums; }
.edu-item a { font-size: 14px; white-space: nowrap; }

/* ---------- Контакт ---------- */
.contacts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 24px 0 48px; }
/* нечётное число контактов: последний — на всю ширину, без пустой ячейки */
.contacts li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.contacts li { background: var(--surface); padding: 20px 24px; display: flex; flex-direction: column; gap: 2px; }
.contact-label { font-size: 13px; color: var(--muted); }
.contacts a { font-size: 17px; font-weight: 500; overflow-wrap: anywhere; }
.copyright { font-size: 14px; color: var(--muted); }

/* ---------- Появление ---------- */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Адаптив ---------- */
@media (max-width: 820px) {
  section { padding: 72px 0; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(3) { border-left: 0; padding-left: 0; }
  .metric:nth-child(n+3) { padding-top: 24px; }
  .products, .competencies { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { gap: 16px; font-size: 14px; }
  .hero { padding: 56px 0 56px; }
  .avatar { width: 64px; height: 64px; }
  .logo { width: 42px; height: 42px; border-radius: 10px; }
  .logo-mark { width: 24px; height: 24px; }
  .logo-mark-wide { width: 35px; height: 35px; }
  .product-tile { width: 54px; height: 54px; border-radius: 14px; }
  .product-tile-mark { width: 32px; height: 32px; }
  .section-lead { font-size: 19px; margin-bottom: 36px; }
  .job { grid-template-columns: 1fr; gap: 8px; }
  .job-when { position: static; flex-direction: row; gap: 10px; align-items: baseline; }
  .case { padding: 20px; }
  .case-row { grid-template-columns: 1fr; gap: 2px; }
  .case-row dt { padding-top: 0; }
  .product { padding: 22px; }
  .product-num { font-size: 40px; }
  .product-foot { flex-direction: column; align-items: flex-start; }
  .contacts { grid-template-columns: 1fr; }
}
