/* imanum.app look, single light theme (sources listed in the README). */

@font-face {
  font-family: "ABC Social Cyrillic Plus";
  src: url("fonts/ABCSocialCyrillicPlusVariable-Regular.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font-display: "ABC Social Cyrillic Plus", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Aeonik Fono Pro only if the visitor has it installed. */
  --font-label: "Aeonik Fono Pro", "ABC Social Cyrillic Plus", system-ui, sans-serif;
  --fs-hero: clamp(32px, 5vw, 56px);
  --fs-h3: clamp(18px, 1.5vw, 20px);
  --fs-caption: 14px;
  --radius-pill: 50px;
  --radius-card: 20px;
  --radius-md: 16px;
  --container: 1200px;
  --gutter: 24px;

  --ink: #17130d;
  --ink-55: rgba(23, 19, 13, 0.55);
  --ink-35: rgba(23, 19, 13, 0.35);
  --ink-12: rgba(23, 19, 13, 0.12);
  --ink-08: rgba(23, 19, 13, 0.08);
  --ink-06: rgba(23, 19, 13, 0.06);
  --ink-04: rgba(23, 19, 13, 0.04);
  --cream: #f2ebe0;
  --bg-grad: linear-gradient(180deg, #ede1d8 0%, #e4d4c6 55%, #d7c1af 100%);

  /* Chart colours, checked with the dataviz validator against the cream card (#f2ebe0):
     one green for sales (IMANUM's #1a6b4a nudged to clear the chroma floor), its light
     step for unfinished periods, red-orange only for decline, and a light-to-dark green
     ramp for instalment terms (ordinal: longer term, darker). */
  --series: #1f7a50;
  --series-hover: #145a3a;
  --series-partial: #6db592;
  --up: #1f7a50;
  --down: #c2410c;
  --term-1: #6db592; --term-2: #4a9f79; --term-3: #2b825a;
  --term-4: #1a6646; --term-5: #0f4a32; --term-6: #08321f;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background-color: #e4d4c6;
  background-image: var(--bg-grad);
  color: var(--ink);
  font: 16px/1.4 var(--font-display);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* No tabular-nums: in ABC Social it also widens the space glyph. */
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* Label type: header links / buttons */
.header__link, .header__download, .lang__btn, .kpi .label, th, .badge, .status,
.as-table summary, .docs .detail {
  font-family: var(--font-label);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- header ---------- */
.header {
  max-width: var(--container); margin: 0 auto; padding: 24px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 96px;
}
.header__left { display: flex; align-items: center; gap: 20px; }
.header__link {
  font-size: var(--fs-caption); opacity: 0.85;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
  text-decoration-color: var(--ink-35); transition: opacity 0.2s ease, text-decoration-color 0.2s ease;
}
.header__link:hover { opacity: 1; text-decoration-color: var(--ink); }
.header__download {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 28px; border-radius: var(--radius-pill);
  background: var(--ink-06); border: 1px solid var(--ink-12);
  font-size: var(--fs-caption); transition: background 0.2s ease;
}
.header__download:hover { background: rgba(23, 19, 13, 0.1); }

/* language menu */
.lang { position: relative; }
.lang__btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px;
  border: 1px solid var(--ink-12); border-radius: var(--radius-pill); background: var(--ink-04);
  font-size: var(--fs-caption);
}
.lang__chev { font-size: 10px; transition: transform 0.2s ease; }
.lang__btn[aria-expanded="true"] .lang__chev { transform: rotate(180deg); }
.lang__menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 100%; list-style: none;
  background: var(--cream); border: 1px solid var(--ink-12); border-radius: 14px; padding: 6px; z-index: 50;
}
.lang__item { display: block; width: 100%; text-align: left; padding: 8px 14px; border-radius: 8px; font-size: var(--fs-caption); white-space: nowrap; }
.lang__item[aria-pressed="true"], .lang__item:hover { background: rgba(23, 19, 13, 0.07); }
.lang__btn:focus-visible, .lang__item:focus-visible, .header__link:focus-visible, .header__download:focus-visible,
summary:focus-visible, .hit:focus-visible, .docs a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- hero ---------- */
main { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter) 96px; }
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(8px, 3vh, 32px) 0 clamp(40px, 7vh, 72px); }
.hero__logo { width: 40px; height: 40px; }
.hero__title { margin-top: clamp(28px, 5vh, 56px); font-size: var(--fs-hero); font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; max-width: 18ch; }
.hero__subtitle { margin-top: 12px; max-width: 40ch; font-size: var(--fs-h3); line-height: 1.5; color: var(--ink-55); }
.hero__subtitle b { color: var(--ink); font-weight: 600; }
.hero__meta { margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.status, .badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 12px;
  border: 1px solid var(--ink-12); border-radius: var(--radius-pill); background: var(--ink-04); color: var(--ink-55);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--series); box-shadow: 0 0 0 0 rgba(31, 122, 80, 0.5); animation: live 2s ease-out infinite; }
@keyframes live { to { box-shadow: 0 0 0 7px rgba(31, 122, 80, 0); } }
.status.stale { color: var(--down); background: var(--ink-08); }
.status.stale .dot { background: transparent; border: 1.5px solid var(--down); animation: none; }
.up, .down { font-weight: 600; }
.up { color: var(--up); }
.down { color: var(--down); }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

/* ---------- cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi, .card { background: var(--cream); border: 1px solid var(--ink-12); border-radius: var(--radius-card); }
.kpi { padding: 20px 22px; }
.kpi .label { font-size: 12px; color: var(--ink-55); }
.kpi .value { font-size: clamp(26px, 2.4vw, 34px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 14px 0 8px; }
.kpi .unit { font-size: 0.5em; font-weight: 500; letter-spacing: 0; color: var(--ink-55); margin-left: 4px; white-space: nowrap; }
.kpi .meta { color: var(--ink-55); font-size: var(--fs-caption); }
.kpi { display: flex; flex-direction: column; }
.kpi .hint { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--ink-08); margin-block-start: 12px; color: var(--ink-55); font-size: 12px; line-height: 1.4; }
.units-note { color: var(--ink-55); font-size: 12px; margin: -12px 0 24px; text-align: center; }

/* ---------- how it works ---------- */
.how { margin-bottom: 24px; }
.how h2 { font-size: var(--fs-h3); font-weight: 600; text-align: center; margin-bottom: 16px; }
.how__steps { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.how__step { position: relative; padding: 20px 22px; border: 1px dashed var(--ink-35); border-radius: var(--radius-card); }
.how__num {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--series); color: var(--cream); font-weight: 600; font-size: 14px; margin-bottom: 10px;
}
.how__step h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.how__step p { color: var(--ink-55); font-size: var(--fs-caption); line-height: 1.5; }

/* ---------- growth ---------- */
.growth { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.growth__item { padding: 16px 18px; border-radius: var(--radius-md); background: var(--ink-04); border: 1px solid var(--ink-08); }
.growth__item .label { font-family: var(--font-label); font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; font-size: 12px; color: var(--ink-55); }
.growth__item .meta { color: var(--ink-55); font-size: var(--fs-caption); margin-top: 6px; line-height: 1.4; }
.delta { display: inline-flex; align-items: baseline; gap: 4px; font-weight: 600; white-space: nowrap; }
.delta .arrow { font-size: 0.7em; }
.delta.flat { color: var(--ink-55); font-weight: 400; }
.delta.big { font-size: clamp(26px, 2.4vw, 32px); letter-spacing: -0.02em; margin-top: 10px; }

.grid { display: grid; gap: 24px; margin-bottom: 24px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { padding: 24px; min-width: 0; }
main > .card { margin-bottom: 24px; }
.card h2 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: -0.01em; }
.sub { color: var(--ink-55); font-size: var(--fs-caption); margin: 4px 0 20px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; color: var(--ink-55); font-size: 11px; padding: 10px; border-bottom: 1px solid var(--ink-12); white-space: nowrap; }
td { padding: 11px 10px; border-bottom: 1px solid var(--ink-12); white-space: nowrap; }
tbody tr:hover td { background: var(--ink-04); }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; }
/* Region and category names may wrap so the amount column stays visible. */
.feed td:nth-child(2), .feed td:nth-child(3) { white-space: normal; }
.muted { color: var(--ink-55); }
.empty { color: var(--ink-55); padding: 18px 10px; white-space: normal; }

/* ---------- charts: ink bars, translucent ink for the unfinished period ---------- */
.chart { position: relative; height: 280px; }
.chart.tall { height: 300px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .gridline { stroke: var(--ink-08); stroke-width: 1; }
.chart .axis { fill: var(--ink-55); font-size: 12px; font-family: var(--font-display); }
/* Bars sit above their hit rect; let the pointer pass through so hovering a bar keeps the tooltip. */
.chart .bar { fill: var(--series); pointer-events: none; transition: fill 0.15s ease; }
.chart .bar.partial { fill: var(--series-partial); }
.chart .hit { fill: transparent; }
.chart .hit:hover + .bar, .chart .hit:focus + .bar { fill: var(--series-hover); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; color: var(--ink-55); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--series); }
.legend i.partial { background: var(--series-partial); }

.as-table { margin-top: 10px; font-size: var(--fs-caption); }
.as-table summary { color: var(--ink-55); cursor: pointer; font-size: 11px; }
.as-table > div { max-height: 260px; overflow: auto; margin-top: 8px; }

.bars { list-style: none; display: grid; gap: 12px; }
.bars li { display: grid; grid-template-columns: minmax(120px, 1.1fr) 2fr minmax(110px, auto); align-items: center; gap: 16px; font-size: 15px; }
.bars .track { height: 10px; background: var(--ink-08); border-radius: var(--radius-pill); overflow: hidden; }
.bars .fill { height: 100%; background: var(--series); border-radius: var(--radius-pill); min-width: 4px; }
.bars .fill.other { background: var(--ink-35); }
.bars .fill.partial { background: var(--series-partial); }
.bars .fill.peak { background: var(--series-hover); }
.bars .val .delta { margin-left: 6px; font-size: 13px; }
.bars .fill.t1 { background: var(--term-1); } .bars .fill.t2 { background: var(--term-2); }
.bars .fill.t3 { background: var(--term-3); } .bars .fill.t4 { background: var(--term-4); }
.bars .fill.t5 { background: var(--term-5); } .bars .fill.t6 { background: var(--term-6); }
.bars .val { text-align: right; color: var(--ink-55); white-space: nowrap; }

/* ---------- trust docs + method ---------- */
.docs { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.docs li { border: 1px solid var(--ink-12); background: var(--ink-04); border-radius: var(--radius-md); padding: 16px; }
.docs .name { display: block; font-weight: 600; }
.docs a.name { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; text-decoration-color: var(--ink-35); }
.docs a.name:hover { text-decoration-color: var(--ink); }
.docs .detail { color: var(--ink-55); font-size: 11px; margin-top: 6px; }

.method { color: var(--ink-55); font-size: var(--fs-caption); max-width: 820px; padding-top: 24px; border-top: 1px solid var(--ink-12); }
.method h2 { color: var(--ink); font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.method ul { padding-left: 18px; display: grid; gap: 6px; }
.note { margin-top: 12px; }

.tooltip {
  position: fixed; z-index: 30; pointer-events: none; background: var(--ink); color: var(--cream);
  border-radius: 10px; padding: 7px 11px; font-size: 13px; line-height: 1.35; white-space: nowrap;
}
.tooltip b { font-weight: 600; }
.tooltip__line { opacity: 0.8; font-size: 12px; }

/* ---------- FAQ ---------- */
.faq details { border-top: 1px solid var(--ink-12); }
.faq details:first-child { border-top: 0; }
.faq summary {
  list-style: none; cursor: pointer; padding: 14px 28px 14px 0; position: relative; font-weight: 600; font-size: 15px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 20px; font-weight: 400; color: var(--ink-55); }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--ink-55); font-size: var(--fs-caption); line-height: 1.55; padding: 0 0 16px; max-width: 760px; }

@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .growth { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid.two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  :root { --gutter: 16px; }
  .header { padding-block: 16px; min-height: 0; }
  .header__link { display: none; }
  .header__download { padding: 12px 18px; font-size: 12px; white-space: nowrap; }
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
  .how__steps { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .growth { gap: 10px; }
  @media (max-width: 480px) { .growth { grid-template-columns: minmax(0, 1fr); } }
  .growth__item { padding: 14px; }
  .delta.big { font-size: 24px; }
  .kpi { padding: 16px; }
  .kpi .value { font-size: 24px; }
  .card { padding: 18px; }
  .chart { height: 220px; }
  .chart.tall { height: 240px; }
  .bars li { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  /* Feed as two-line cards: time | category, amount / region, term. No sideways scroll. */
  .feed thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .feed tr { display: grid; grid-template-columns: 3.2em minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--ink-12); }
  .feed tr:last-child { border-bottom: 0; }
  .feed td { padding: 0; border: 0; }
  .feed td:nth-child(1) { grid-row: 1 / 3; color: var(--ink-55); }
  .feed td:nth-child(3) { grid-column: 2; grid-row: 1; }
  .feed td:nth-child(5) { grid-column: 3; grid-row: 1; font-weight: 600; }
  .feed td:nth-child(2) { grid-column: 2; grid-row: 2; color: var(--ink-55); }
  .feed td:nth-child(4) { grid-column: 3; grid-row: 2; color: var(--ink-55); }
  .feed td.empty { grid-column: 1 / -1; grid-row: auto; }
  /* Monthly table as two-line rows: month, amount / labelled growth figures. */
  .stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--ink-12); }
  .stack td { padding: 0; border: 0; }
  .stack td:nth-child(3), .stack td:nth-child(4) { font-size: 13px; text-align: left; }
  .stack td:nth-child(4) { text-align: right; }
  .stack td:nth-child(3)::before, .stack td:nth-child(4)::before { content: attr(data-label) ": "; color: var(--ink-55); }
  .stack td:empty { display: none; }
  .stack tbody tr:hover td { background: none; }
  .feed tbody tr:hover td { background: none; }
  .bars .track { grid-column: 1 / -1; grid-row: 2; }
  .docs { grid-template-columns: minmax(0, 1fr); }
}
