/* ============================================================
   SALT / DATA — Wildberries "соль" category analytics report
   Design: obsidian dark, faceted crystal motifs, mineral accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@400;600;700;800&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root{
  --bg: #08090b;
  --bg-2: #0d0f12;
  --surface: #121417;
  --surface-2: #1a1d21;
  --surface-hover: #22262b;
  --border: #262b31;
  --border-soft: #1c2024;

  --text-primary: #f2f5f4;
  --text-secondary: #aeb6bd;
  --text-muted: #6b747c;

  --teal: #2fd9c0;
  --teal-dim: #1c8a79;
  --teal-glow: rgba(47, 217, 192, 0.18);

  --amber: #e8a33d;
  --amber-glow: rgba(232, 163, 61, 0.16);

  --rose: #e8607a;
  --rose-glow: rgba(232, 96, 122, 0.16);

  --display: 'Unbounded', sans-serif;
  --body: 'Manrope', sans-serif;
  --mono: 'JetBrains Mono', monospace;

  --facet: polygon(0 8px, 8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%);
  --facet-lg: polygon(0 16px, 16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);

  --container: 1180px;
}

*{ box-sizing: border-box; margin:0; padding:0; }
html{ scroll-behavior: smooth; }

body{
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--body);
  line-height: 1.5;
  overflow-x: hidden;
}

body::before{
  content:'';
  position: fixed; inset:0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black, transparent 75%);
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

a{ color: inherit; text-decoration: none; }
::selection{ background: var(--teal); color: #06110f; }

.wrap{ max-width: var(--container); margin: 0 auto; padding: 0 32px; position: relative; z-index: 1; }

/* ---------------- NAV ---------------- */
.nav{
  position: sticky; top:0; z-index: 50;
  background: rgba(8,9,11,0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-inner{
  max-width: var(--container); margin: 0 auto; padding: 18px 32px;
  display:flex; align-items:center; justify-content: space-between; gap: 24px;
}
.brand{
  display:flex; align-items:center; gap:10px;
  font-family: var(--display); font-weight:700; font-size: 15px; letter-spacing:0.02em;
  white-space: nowrap;
}
.brand .crystal{ width:18px; height:18px; flex-shrink:0; }
.brand .crystal path{ stroke: var(--teal); }
.nav-links{ display:flex; gap: 4px; flex-wrap: wrap; justify-content:flex-end; }
.nav-links a{
  font-size: 13px; color: var(--text-secondary); padding: 8px 14px;
  border-radius: 2px; transition: all .2s ease; font-weight: 500;
}
.nav-links a:hover{ color: var(--text-primary); background: var(--surface-2); }

/* ---------------- HERO ---------------- */
.hero{
  padding: 108px 0 88px;
  position: relative;
  overflow: hidden;
}
.hero-crystal{
  position: absolute; right: -120px; top: -80px; width: 620px; height: 620px;
  opacity: 0.55; z-index:0; pointer-events:none;
}
.eyebrow{
  display:inline-flex; align-items:center; gap:8px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--teal); background: var(--teal-glow); border: 1px solid rgba(47,217,192,0.3);
  padding: 6px 14px; clip-path: var(--facet); margin-bottom: 28px;
}
.eyebrow::before{ content:'●'; font-size: 8px; }

h1.headline{
  font-family: var(--display); font-weight: 800; letter-spacing: -0.01em;
  font-size: clamp(40px, 6vw, 76px); line-height: 1.02; max-width: 880px;
  margin-bottom: 24px;
}
h1.headline .accent{ color: var(--teal); }
h1.headline .accent2{ color: var(--amber); }

.hero-sub{
  font-size: 18px; color: var(--text-secondary); max-width: 620px; margin-bottom: 48px; font-weight: 400;
}
.hero-sub b{ color: var(--text-primary); font-weight: 600; }

.hero-stats{
  display:grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  clip-path: var(--facet-lg);
}
.hero-stat{
  background: var(--surface); padding: 24px 22px;
}
.hero-stat .num{
  font-family: var(--mono); font-weight: 700; font-size: clamp(22px, 2.4vw, 30px);
  color: var(--text-primary); display:block; margin-bottom: 6px;
}
.hero-stat .num.up{ color: var(--teal); }
.hero-stat .lbl{ font-size: 12.5px; color: var(--text-muted); font-weight: 500; }

@media (max-width: 760px){
  .hero-stats{ grid-template-columns: repeat(2, 1fr); }
}

/* ---------------- SECTION SHELL ---------------- */
section.block{ padding: 84px 0; border-top: 1px solid var(--border-soft); position: relative; }
.section-head{ margin-bottom: 44px; display:flex; align-items:flex-end; justify-content:space-between; gap: 24px; flex-wrap:wrap; }
.section-tag{
  font-family: var(--mono); font-size: 12px; color: var(--amber); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px; display:block;
}
h2.section-title{ font-family: var(--display); font-size: clamp(26px, 3vw, 38px); font-weight: 700; letter-spacing: -0.01em; max-width: 640px; }
.section-desc{ color: var(--text-secondary); font-size: 15px; max-width: 460px; }

/* ---------------- CARD ---------------- */
.card{
  background: var(--surface); border: 1px solid var(--border);
  clip-path: var(--facet-lg);
  padding: 28px;
}
.card + .card{ margin-top: 20px; }

.chart-card{ padding: 32px 28px 20px; }
.chart-card canvas{ max-height: 380px; }

.grid-2{ display:grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
@media (max-width: 900px){ .grid-2{ grid-template-columns: 1fr; } }

/* ---------------- LEGEND ---------------- */
.legend-row{ display:flex; gap: 20px; flex-wrap: wrap; margin-bottom: 4px; }
.legend-item{ display:flex; align-items:center; gap: 8px; font-size: 13px; color: var(--text-secondary); font-family: var(--mono); }
.legend-dot{ width: 10px; height: 10px; border-radius: 50%; display:inline-block; }

/* ---------------- KPI / GROWTH BADGES ---------------- */
.badge{
  display:inline-flex; align-items:center; gap: 6px; font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  padding: 4px 10px; clip-path: var(--facet);
}
.badge.pos{ color: var(--teal); background: var(--teal-glow); }
.badge.neg{ color: var(--rose); background: var(--rose-glow); }

/* ---------------- MONTH SELECTOR ---------------- */
.month-scroll{
  display:flex; gap: 8px; overflow-x: auto; padding-bottom: 14px; margin-bottom: 24px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.month-scroll::-webkit-scrollbar{ height: 5px; }
.month-scroll::-webkit-scrollbar-thumb{ background: var(--border); }
.month-chip{
  font-family: var(--mono); font-size: 12.5px; color: var(--text-secondary);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 8px 14px; white-space: nowrap; cursor:pointer; clip-path: var(--facet);
  transition: all .15s ease; flex-shrink:0;
}
.month-chip:hover{ color: var(--text-primary); border-color: var(--teal-dim); }
.month-chip.active{ background: var(--teal-glow); color: var(--teal); border-color: var(--teal); }

/* ---------------- RANK LIST (top sellers / fasovka bars rendered as list) ---------------- */
.rank-list{ display:flex; flex-direction:column; gap: 10px; }
.rank-item{ display:grid; grid-template-columns: 24px 1fr auto; gap: 14px; align-items:center; }
.rank-item .rank-n{ font-family: var(--mono); color: var(--text-muted); font-size: 13px; }
.rank-item .rank-name{ font-size: 13.5px; color: var(--text-primary); font-weight: 600; white-space: nowrap; overflow:hidden; text-overflow: ellipsis; }
.rank-item .rank-bar-track{ grid-column: 1 / -1; height: 6px; background: var(--surface-2); position: relative; overflow:hidden; }
.rank-item .rank-bar-fill{ position:absolute; left:0; top:0; bottom:0; background: linear-gradient(90deg, var(--teal-dim), var(--teal)); }
.rank-item .rank-val{ font-family: var(--mono); font-size: 12.5px; color: var(--text-secondary); }

/* ---------------- TABLE ---------------- */
.table-scroll{ overflow-x: auto; }
table.data-table{ width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 13px; min-width: 720px; }
table.data-table th{
  text-align: left; padding: 12px 16px; color: var(--amber); font-weight: 600; font-size: 11.5px;
  letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1px solid var(--border); cursor: pointer; user-select:none;
  white-space: nowrap;
}
table.data-table th:hover{ color: var(--text-primary); }
table.data-table th .arrow{ opacity: 0.4; margin-left: 4px; }
table.data-table td{ padding: 11px 16px; border-bottom: 1px solid var(--border-soft); color: var(--text-secondary); white-space:nowrap; }
table.data-table tr:hover td{ background: var(--surface-2); color: var(--text-primary); }
table.data-table td.year-tag{ font-family: var(--body); font-weight: 700; }
table.data-table td.year-tag.y2025{ color: var(--amber); }
table.data-table td.year-tag.y2026{ color: var(--teal); }

/* ---------------- INSIGHT CALLOUT ---------------- */
.callout{
  border-left: 2px solid var(--teal); padding: 4px 0 4px 20px; color: var(--text-secondary); font-size: 14.5px; margin-top: 20px;
}
.callout b{ color: var(--text-primary); }

/* ---------------- FOOTER ---------------- */
footer{ padding: 56px 0 60px; border-top: 1px solid var(--border-soft); }
.footer-row{ display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap: 16px; }
.footer-note{ font-size: 12.5px; color: var(--text-muted); font-family: var(--mono); }

/* ---------------- UTIL ---------------- */
.mt{ margin-top: 20px; }
.tabular{ font-family: var(--mono); font-variant-numeric: tabular-nums; }
