@font-face {
  font-family: Geist;
  src: url("assets/geist-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Geist;
  src: url("assets/geist-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --background: #11121a;
  --surface: #191b26;
  --surface-raised: #202331;
  --ink: #f5f5fb;
  --muted: #acb0c4;
  --blue: #9b91fa;
  --blue-hover: #b1a9ff;
  --blue-dark: #beb7ff;
  --blue-light: #222139;
  --red: #ff939e;
  --line: #303244;
  --input-line: #6b6b87;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  font-family: Geist, Arial, sans-serif;
  font-weight: 400;
  color: var(--ink);
  background: var(--background);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; }
h1, h2, p, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button, summary { cursor: pointer; }
[hidden], .symbol-library { display: none !important; }
::selection { background: #514587; color: var(--ink); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
h1:focus, main:focus { outline: none; }
.shell { width: min(calc(100% - 64px), 1160px); margin-inline: auto; }

.skip-link { position: fixed; top: 8px; left: 8px; z-index: 2; padding: 10px 14px; transform: translateY(calc(-100% - 16px)); background: var(--surface); }
.skip-link:focus { transform: none; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.site-header { position: sticky; top: 0; z-index: 1; background: #11121aef; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; justify-content: space-between; align-items: center; min-height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 24px; font-weight: 650; letter-spacing: -.045em; }
.brand-domain, .header-link { color: var(--muted); }
.header-link, .text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; font-size: 14px; font-weight: 650; }
.header-link[aria-current], .text-link { color: var(--blue-dark); }
.text-link .icon { width: 17px; height: 17px; }

.home { padding-block: clamp(55px, 9vw, 118px) 65px; }
.calculator {
  padding: clamp(27px, 5vw, 64px) clamp(20px, 5vw, 64px);
  background: radial-gradient(ellipse at 50% 0%, #292542, transparent 76%), var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  text-align: center;
}
.calculator h1 {
  max-width: 940px;
  margin-inline: auto;
  font-size: clamp(42px, 7vw, 84px);
  font-weight: 650;
  line-height: 1;
  letter-spacing: -.062em;
  text-wrap: balance;
}
.calculator h1 span { color: var(--blue-dark); white-space: nowrap; }
.hero-subtitle { max-width: 42ch; margin: 21px auto 0; color: var(--muted); font-size: clamp(16px, 1.8vw, 20px); line-height: 1.45; }
#channel-form { margin: clamp(24px, 4vw, 35px) auto 0; max-width: 640px; text-align: left; }
#channel-form > label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.channel-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); margin-top: 24px; }
.overview > div { min-width: 0; padding: 15px 18px 22px; }
.overview > div + div { border-left: 1px solid var(--line); }
.overview dt { font-size: 16px; font-weight: 650; }
.overview dd { color: var(--muted); margin-top: 4px; font-size: 14px; line-height: 1.45; }
.link-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-inline: 15px;
  border: 1px solid var(--input-line);
  border-radius: 12px;
  background: var(--background);
  color: var(--muted);
}
.link-field:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.link-field:has([aria-invalid="true"]) { border-color: var(--red); }
.link-field input { width: 100%; min-width: 0; min-height: 55px; padding: 0; border: 0; outline: none; color: var(--ink); caret-color: var(--blue); background: none; font-size: 16px; }
.link-field input::placeholder { color: var(--muted); opacity: 1; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #16112d;
  font-size: 15px;
  font-weight: 650;
  transition: background-color 160ms ease, transform 140ms var(--ease-out);
}
.button:disabled { cursor: wait; opacity: .72; }
.button:active:not(:disabled) { transform: scale(.98); }
.form-error, .status:not(:empty) { margin-top: 11px; font-size: 14px; font-weight: 700; }
.form-error { color: var(--red); }
.status, .muted { color: var(--muted); }

.report, .methodology { padding-block: 28px 65px; }
.back { margin-bottom: 18px; }
.profile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; margin-bottom: 24px; }
.profile-mark { display: grid; place-items: center; width: 55px; height: 55px; border-radius: 13px; background: #292747; color: var(--blue-dark); font-size: 25px; font-weight: 650; }
.profile h1, .methodology h1 { font-size: clamp(30px, 4.3vw, 52px); line-height: 1.08; letter-spacing: -.045em; overflow-wrap: anywhere; }
.source-date { margin-top: 5px; color: var(--muted); font-size: 13px; }
.source-link { justify-self: end; }

.estimates, .insights, .scenario-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.estimate, .insight, .publications, .scenario, .metrics, .history {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.estimate, .insight, .history { padding: clamp(16px, 2.4vw, 28px); }
.estimate-partner { background: var(--blue-light); border-color: #454067; }
.estimate h2 { font-size: 15px; font-weight: 650; }
.estimate-value { margin-block: 4px; font-size: clamp(27px, 4.2vw, 48px); font-weight: 650; line-height: 1.13; letter-spacing: -.05em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.estimate .muted { font-size: 13px; }

.scenario { margin-top: 13px; }
.scenario summary { padding: 12px 18px; color: var(--blue-dark); font-size: 14px; font-weight: 650; }
.scenario form { padding: 0 18px 18px; }
.scenario fieldset { margin: 0; min-width: 0; padding: 0; border: 0; }
.scenario legend { padding: 0; margin-bottom: 7px; font-size: 14px; font-weight: 650; }
.scenario label { display: block; min-width: 0; font-size: 13px; color: var(--muted); }
.scenario input { display: block; width: 100%; min-width: 0; min-height: 42px; padding: 7px 9px; margin-top: 3px; border: 1px solid var(--input-line); border-radius: 8px; color: var(--ink); background: var(--surface); font-size: 16px; }
.scenario input[aria-invalid] { border-color: var(--red); }
.input-hint { margin-top: 4px; color: var(--muted); font-size: 12px; }
.range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.scenario-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 13px; }
.scenario-actions .status { margin-top: 0; }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-block: 15px; }
.metrics > div { padding: 15px clamp(10px, 2.4vw, 28px); }
.metrics > div + div { border-left: 1px solid var(--line); }
.metrics dt, .metrics .muted { font-size: 13px; color: var(--muted); }
.metrics dd { margin-top: 4px; font-size: clamp(21px, 3.5vw, 34px); font-weight: 650; line-height: 1.1; letter-spacing: -.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metrics dd.metric-unknown { font-size: 15px; line-height: 1.45; letter-spacing: 0; }
.metrics dd.muted { font-size: 12px; font-weight: 500; letter-spacing: 0; }
.metrics:has(> div[data-video-report][hidden]) { grid-template-columns: 1fr; }
.history { margin-bottom: 15px; }
.history-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 14px 24px; margin-top: 13px; }
.history-grid h3 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.history-value { font-size: clamp(23px, 3vw, 32px); font-weight: 650; line-height: 1.13; letter-spacing: -.035em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.history-grid p + p { margin-top: 4px; }
.history-grid .muted { font-size: 13px; }
.history-change { color: var(--blue-dark); font-size: 14px; }
.insight-heading, .publications-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 11px; }
.insight h2, .publications h2, .history h2 { font-size: clamp(19px, 2.4vw, 25px); letter-spacing: -.025em; font-weight: 650; }
.insight p { margin-top: 6px; line-height: 1.55; overflow-wrap: anywhere; }
.insight-label { padding: 2px 6px; border-radius: 5px; background: var(--blue-light); color: var(--blue-dark); font-size: 12px; font-weight: 650; }
.references:not(:empty) { display: flex; flex-wrap: wrap; gap: 7px 13px; margin-top: 10px; }
.references a { color: var(--blue-dark); font-size: 13px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }

.publications { margin-top: 15px; }
.publications-heading, .empty { padding: 17px clamp(12px, 2.4vw, 28px); }
.result-count { padding: 2px 8px; border-radius: 20px; background: var(--blue-light); color: var(--blue-dark); font-size: 13px; font-variant-numeric: tabular-nums; }
.empty { padding-top: 0; color: var(--muted); }
.table-scroll { max-width: 100%; overflow-x: auto; }
.table-scroll:focus-visible { outline-offset: -2px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 14px; text-align: right; vertical-align: top; }
thead { background: var(--surface-raised); }
thead th { color: var(--muted); font-size: 12px; }
th:first-child { text-align: left; padding-left: clamp(12px, 2.4vw, 28px); width: 100%; }
th:last-child, td:last-child { padding-right: clamp(12px, 2.4vw, 28px); }
td, th:not(:first-child) { white-space: nowrap; }
tbody tr + tr { border-top: 1px solid var(--line); }
tbody th { font-weight: 650; }
tbody th a { display: inline-block; min-width: 145px; overflow-wrap: anywhere; text-decoration: underline; text-decoration-color: #7165ab; text-underline-offset: 3px; }

.methodology { max-width: 830px; }
.method-intro { margin-top: 14px; max-width: 56ch; color: var(--muted); line-height: 1.6; }
.method-content { margin-top: 26px; }
.method-content section { border-top: 1px solid var(--line); padding-block: 21px; }
.method-content h2 { font-size: 22px; letter-spacing: -.025em; font-weight: 650; }
.method-content p { margin-top: 7px; max-width: 70ch; color: var(--muted); line-height: 1.55; }
.method-content .formula { color: var(--blue-dark); font-variant-numeric: tabular-nums; font-weight: 600; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding-block: 17px; }
.footer-inner a { color: var(--blue-dark); }
@media (hover: hover) and (pointer: fine) {
  .button:not(:disabled):hover { background: var(--blue-hover); }
  a:hover { text-decoration: underline; text-underline-offset: 3px; }
  tbody tr:hover { background: var(--surface-raised); }
}

@media (max-width: 700px) {
  .shell { width: calc(100% - 36px); }
  .calculator { padding-inline: clamp(21px, 5.7vw, 42px); }
  .calculator h1 { font-size: clamp(35px, 8.4vw, 59px); }
  .hero-break { display: none; }
  .profile { margin-bottom: 17px; }
  .source-link { grid-column: 2; justify-self: start; }
  .profile-mark { width: 44px; height: 44px; }
  .metrics > div { padding-inline: 10px; }
  th, td { padding-inline: 10px; }
}

@media (max-width: 500px) {
  .header-inner { min-height: 58px; }
  .home { padding-block: 34px 44px; }
  .calculator { border-radius: 18px; }
  .overview { grid-template-columns: 1fr; margin-top: 12px; }
  .overview > div { padding: 12px 3px; }
  .overview > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .brand { font-size: 21px; }
  .brand img { width: 28px; height: 28px; }
  .channel-controls, .insights, .scenario-fields { grid-template-columns: 1fr; gap: 9px; }
  .channel-controls .button { justify-content: space-between; }
  .link-field input { min-height: 49px; }
  .estimates { gap: 8px; }
  .estimate { padding: 12px 9px; }
  .estimate h2, .estimate .muted, .metrics dt, .metrics .muted { font-size: 12px; }
  .estimate-value { font-size: clamp(20px, 5.9vw, 28px); }
  .metrics dd.metric-unknown { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .button { transition-property: background-color; }
  .button:active:not(:disabled) { transform: none; }
}
