/* ============================================================
   52week.ru — дизайн-система v2
   Направление: светлая тема, крупная уверенная типографика,
   один яркий акцент (жёлтый) на конверсионных элементах —
   в духе больших российских продуктовых команд (Т-Банк / Яндекс).

   Токены:
   --bg #FFFFFF · --bg-soft #F3F4F6 · --ink #15171B (не чистый чёрный)
   --ink-muted #676B73 · --accent #FFDA1A (жёлтый, только на CTA/акцентах)
   --growth #00B894 (зелёный, только для позитивных метрик)
   Шрифт: Onest — везде, вес 400–800.
   Радиусы: 28px (герой/крупные визуальные блоки) → 16px (карточки) → 999px (пилюли).
   Тени — только на выделенных/hover-элементах, не на всём подряд.
   ============================================================ */

:root {
  --bg: #FFFFFF;
  --bg-soft: #F3F4F6;
  --surface: #FFFFFF;
  --ink: #15171B;
  --ink-muted: #676B73;
  --ink-faint: #9AA0A6;
  --accent: #FFDA1A;
  --accent-ink: #15171B;
  --growth: #00B894;
  --growth-soft: rgba(0, 184, 148, 0.12);
  --danger: #E63946;
  --danger-soft: rgba(230, 57, 70, 0.1);
  --border: #E5E7EB;
  --border-strong: #D3D6DA;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-soft: 0 1px 2px rgba(21,23,27,0.04), 0 8px 24px rgba(21,23,27,0.06);
  --shadow-hero: 0 20px 60px rgba(21,23,27,0.14);
  --font: 'Onest', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
}
p { margin: 0 0 1em; color: var(--ink-muted); max-width: 62ch; }
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 15px 28px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 15.5px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
  font-family: var(--font);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { box-shadow: 0 8px 20px rgba(255,218,26,0.45); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--ink); }
.btn-outline:hover { border-color: var(--ink); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 18px; font-size: 13.5px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.logo .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); display: inline-block; }
.main-nav {
  display: none;
  gap: 4px;
  align-items: center;
}
.main-nav a {
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-muted);
}
.main-nav a:hover { color: var(--ink); background: var(--bg-soft); }
.main-nav a.active { color: var(--ink); background: var(--bg-soft); }
.main-nav a.nav-cta { background: var(--ink); color: #fff !important; margin-left: 6px; }
.main-nav a.nav-cta:hover { background: #000; }

.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: none;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 18px;
  margin: 0 auto;
  background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.main-nav.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 72px;
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 20px 20px;
  gap: 4px;
  box-shadow: var(--shadow-soft);
}
.main-nav.open a { padding: 13px 16px; width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: 48px 0 56px; }
.hero-grid {
  display: grid;
  gap: 40px;
  align-items: center;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 18px;
}
.hero-kicker .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--growth); }
.hero h1 {
  font-size: clamp(32px, 6vw, 54px);
  max-width: 620px;
}
.hero .lead {
  font-size: 18px;
  max-width: 500px;
  margin-bottom: 30px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Промо-карточка в герое — главный визуальный акцент страницы */
.promo-card {
  background: var(--ink);
  border-radius: var(--radius-xl);
  padding: 28px;
  color: #fff;
  box-shadow: var(--shadow-hero);
  position: relative;
  overflow: hidden;
}
.promo-card::before {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 220px; height: 220px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0.18;
  filter: blur(10px);
}
.promo-card .promo-label {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
  margin-bottom: 4px;
}
.promo-card .promo-hypothesis {
  font-size: 15px;
  color: rgba(255,255,255,0.92);
  margin-bottom: 20px;
  line-height: 1.5;
  max-width: 90%;
}
.promo-score-row { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 20px; }
.promo-score { font-size: 56px; font-weight: 800; color: var(--accent); line-height: 1; }
.promo-score-label { font-size: 13px; color: rgba(255,255,255,0.6); padding-bottom: 6px; }
.promo-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.promo-chip {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.85);
}
.promo-chip b { color: #fff; }

/* ---------- Trust / stats bar ---------- */
.trust-bar { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 32px 0; }
.trust-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 24px; }
.trust-item .num { font-size: 30px; font-weight: 800; display: block; letter-spacing: -0.02em; }
.trust-item .label { font-size: 14px; color: var(--ink-muted); }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.section-head { margin-bottom: 36px; max-width: 640px; }
.section-head h2 { font-size: clamp(26px, 4vw, 36px); }
.section-head p { margin: 0; font-size: 16.5px; }
.section-alt { background: var(--bg-soft); }
.section-head-row { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; margin-bottom: 32px; }
.section-head-row .section-head { margin-bottom: 0; }

/* ---------- Grids / Cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: 1fr; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.case-card { display: flex; flex-direction: column; height: 100%; overflow: hidden; padding: 0; }
.case-card:hover { box-shadow: var(--shadow-soft); border-color: var(--border-strong); transform: translateY(-2px); }
.case-card .thumb {
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, #FFF3B0 0%, var(--accent) 100%);
  position: relative;
  overflow: hidden;
}
.case-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.case-card .thumb .thumb-fallback {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: rgba(21,23,27,0.35);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.case-card-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.case-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-muted);
}
.tag.tag-accent { color: #7A5D00; background: rgba(255,218,26,0.25); }
.case-card h3 { font-size: 18.5px; margin-bottom: 0; }
.case-card .meta { font-size: 13px; color: var(--ink-faint); margin-top: auto; padding-top: 8px; }

.service-card h3 { font-size: 20px; }
.service-card ul { padding-left: 18px; margin: 14px 0; color: var(--ink-muted); font-size: 14.5px; }
.service-card li { margin-bottom: 6px; }
.service-price { font-size: 24px; font-weight: 800; margin: 10px 0; }
.service-card.featured { border-color: var(--ink); box-shadow: var(--shadow-soft); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--ink);
}
input[type=text], input[type=email], input[type=number], input[type=file], select, textarea {
  width: 100%;
  padding: 13px 15px;
  background: var(--bg-soft);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: #fff;
}
input[type=range] { width: 100%; accent-color: var(--ink); }
.field-hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 6px; }
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14.5px;
  font-weight: 500;
}
.alert-success { background: var(--growth-soft); color: #007A5E; }
.alert-error { background: var(--danger-soft); color: var(--danger); }

/* ---------- Calculator ---------- */
.calc-wrap { display: grid; gap: 24px; grid-template-columns: 1fr; }
.calc-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; }
.calc-slider-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.calc-slider-value { font-weight: 800; font-size: 19px; min-width: 28px; text-align: right; }
.calc-tabs { display: flex; gap: 8px; margin-bottom: 22px; flex-wrap: wrap; }
.calc-tab {
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-muted);
  background: transparent;
  font-family: var(--font);
}
.calc-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.rice-fields { display: none; }
.rice-fields.visible { display: grid; gap: 16px; }

.score-box {
  text-align: center;
  padding: 30px 24px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: #fff;
}
.score-box .score { font-size: 52px; font-weight: 800; display: block; line-height: 1; color: var(--accent); }
.score-box .score-label { font-size: 13.5px; color: rgba(255,255,255,0.65); margin-top: 10px; }
.score-verdict { font-size: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.85); }

.backlog-table-wrap { overflow-x: auto; margin-top: 16px; }
table.backlog { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
table.backlog th, table.backlog td { padding: 12px; border-bottom: 1px solid var(--border); text-align: left; }
table.backlog th { color: var(--ink-faint); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }
table.backlog .score-cell { font-weight: 800; }
table.backlog .rank-1 { background: rgba(255,218,26,0.12); }

/* ---------- Case detail ---------- */
.case-hero { padding-bottom: 8px; }
.case-hero-image {
  width: 100%;
  aspect-ratio: 21/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
  background: var(--bg-soft);
}
.case-hero-image img { width: 100%; height: 100%; object-fit: cover; }
.case-block { margin-bottom: 34px; }
.case-block h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.02em; color: var(--ink-faint); font-weight: 700; margin-bottom: 12px; }
.metric-compare { display: flex; gap: 16px; flex-wrap: wrap; }
.metric-box { background: var(--bg-soft); border-radius: var(--radius-sm); padding: 18px 22px; min-width: 150px; }
.metric-box .val { font-size: 24px; font-weight: 800; }
.metric-box.before .val { color: var(--ink-muted); }
.metric-box.after .val { color: #007A5E; }

.case-gallery { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 10px; }
.case-gallery figure { margin: 0; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-soft); cursor: zoom-in; }
.case-gallery img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; transition: transform .3s ease; }
.case-gallery figure:hover img { transform: scale(1.03); }
.case-gallery figcaption { padding: 10px 14px; font-size: 13px; color: var(--ink-muted); }

.lightbox-overlay {
  position: fixed; inset: 0; background: rgba(21,23,27,0.92);
  display: none; align-items: center; justify-content: center;
  z-index: 1000; padding: 24px; cursor: zoom-out;
}
.lightbox-overlay.open { display: flex; }
.lightbox-overlay img { max-width: 100%; max-height: 90vh; border-radius: var(--radius-md); }

/* ---------- About ---------- */
.timeline { display: flex; flex-direction: column; gap: 24px; }
.timeline-item { padding-left: 20px; border-left: 3px solid var(--accent); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 52px 0 0; margin-top: 40px; }
.footer-inner { display: grid; gap: 32px; grid-template-columns: 1fr; }
.footer-col h4 { font-size: 14px; color: var(--ink-faint); margin-bottom: 14px; font-weight: 700; }
.footer-col a { display: block; color: var(--ink-muted); font-size: 14.5px; margin-bottom: 10px; }
.footer-col a:hover { color: var(--ink); }
.footer-col p { font-size: 14.5px; max-width: 320px; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 32px; padding: 20px; font-size: 13px; color: var(--ink-faint); }

/* ---------- Admin extras ---------- */
.msg-thread { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 10px; }
.msg-reply-bubble { background: var(--bg-soft); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; }
.msg-reply-bubble .meta { font-size: 11.5px; color: var(--ink-faint); margin-top: 6px; }
.thumb-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.thumb-grid .thumb-item { position: relative; width: 96px; }
.thumb-grid img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.thumb-grid label { display: flex; align-items: center; gap: 4px; font-size: 11px; margin-top: 4px; font-weight: 400; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-muted); }

/* ============================================================
   Breakpoints
   ============================================================ */
@media (min-width: 640px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1.4fr 1fr 1fr; }
  .trust-grid { grid-template-columns: repeat(4,1fr); }
  .case-gallery { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 860px) {
  .main-nav { display: flex; }
  .nav-toggle { display: none; }
  .main-nav.open { position: static; display: flex; flex-direction: row; background: none; border: none; padding: 0; box-shadow: none; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .calc-wrap { grid-template-columns: 1.1fr 0.9fr; align-items: start; }
  .rice-fields.visible { grid-template-columns: 1fr 1fr; }
  .hero-grid { grid-template-columns: 1.1fr 0.9fr; }
}

@media (min-width: 1024px) {
  section { padding: 84px 0; }
  .hero { padding: 64px 0 76px; }
}
