:root {
    --rail-h: 58px;
    --card-night: #0A1128;
}

@media (prefers-color-scheme: dark) {
    :root {
        --card-night: #16213F;
    }
}

.page-dati {
    --c: var(--accent-strong);
}

.page-dati,
.chapter {
    --soft: color-mix(in srgb, var(--c) 30%, var(--surface));
}

/* Hero */

.d-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    align-items: start;
    gap: clamp(32px, 5vw, 72px);
    padding-top: clamp(32px, 6vw, 72px);
    padding-bottom: clamp(40px, 5vw, 64px);
}

.d-hero .hero-name {
    font-size: clamp(30px, 3.4vw, 44px);
}

.d-index {
    padding: 26px 26px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.d-index-title {
    font-size: 18px;
    font-weight: 600;
}

.d-index ol {
    display: grid;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.d-index li + li {
    border-top: 1px solid var(--line-soft);
}

.d-index a {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 9px 0;
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.4;
    text-decoration: none;
    transition: color .2s, transform .25s var(--ease);
}

.d-index a i {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c);
    transform: translateY(-1px);
}

.d-index a:hover {
    color: var(--ink);
    transform: translateX(3px);
}

/* Numeri in evidenza */

.hls {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0 0 clamp(48px, 6vw, 72px);
    list-style: none;
}

.hl {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.hl-value {
    color: var(--ink);
    font-size: clamp(30px, 3.2vw, 40px);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.hl-label {
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
}

.hl-src {
    margin-top: auto;
    padding-top: 6px;
    color: var(--muted);
    font-size: 12.5px;
    text-decoration: none;
}

.hl-src:hover {
    color: var(--accent-text);
}

/* Navigazione tra i capitoli */

.d-nav {
    position: sticky;
    top: var(--header-h);
    z-index: 40;
    border-block: 1px solid var(--line-soft);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(14px);
    backdrop-filter: saturate(1.4) blur(14px);
}

.d-nav-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: var(--rail-h);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.d-nav-inner::-webkit-scrollbar {
    display: none;
}

.d-nav a {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color .25s, border-color .25s, color .25s;
}

.d-nav a i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c);
    opacity: .55;
    transition: opacity .25s, transform .25s var(--ease);
}

.d-nav a:hover {
    color: var(--ink);
}

.d-nav a.is-active {
    border-color: color-mix(in srgb, var(--c) 45%, transparent);
    background: color-mix(in srgb, var(--c) 14%, var(--bg));
    color: var(--ink);
}

.d-nav a.is-active i {
    opacity: 1;
    transform: scale(1.15);
}

/* Capitoli */

.chapter {
    padding: clamp(64px, 8vw, 112px) 0 0;
}

.page-dati .chapter[id] {
    scroll-margin-top: calc(8px - clamp(64px, 8vw, 112px));
}

.chapter:last-child {
    padding-bottom: clamp(64px, 8vw, 112px);
}

.chapter-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    align-items: end;
    gap: 20px clamp(32px, 5vw, 72px);
    padding-bottom: 28px;
    border-bottom: 2px solid var(--c);
}

.chapter-title {
    font-size: clamp(34px, 4.4vw, 56px);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -.035em;
    text-wrap: balance;
}

.chapter-lede {
    margin: 0;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(17px, 1.6vw, 20px);
    line-height: 1.55;
    text-wrap: pretty;
}

.charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 32px;
}

/* Grafico */

.chart {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
    padding: 24px 24px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.chart.is-wide {
    grid-column: 1 / -1;
}

.chart-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 16px;
}

.chart-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.35;
    text-wrap: balance;
}

.chart-unit {
    color: var(--muted);
    font-size: 13px;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 12.5px;
}

.chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.sw {
    display: inline-block;
    flex: none;
    width: 11px;
    height: 11px;
    border-radius: 3px;
    background: var(--c);
}

.sw-soft {
    background: var(--soft);
}

.sw-ring {
    border: 2px solid var(--c);
    border-radius: 50%;
    background: var(--surface);
}

.sw-tick {
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--ink);
}

.chart-note {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.55;
    text-wrap: pretty;
}

.chart-source {
    margin: auto 0 0;
    padding-top: 14px;
    color: var(--muted);
    font-size: 12.5px;
}

.chart-dumbbell .chart-legend {
    margin-top: auto;
    padding-top: 12px;
}

.chart-dumbbell .chart-note {
    margin-bottom: auto;
}

.chart-dumbbell .chart-source {
    margin-top: 0;
}

.chart-note + .chart-source {
    padding-top: 8px;
}

.chart-source a,
.stat-src,
.insight-src a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
    text-underline-offset: 3px;
}

.chart-source a:hover,
.stat-src:hover {
    color: var(--accent-text);
}

/* Barre */

.bars {
    position: relative;
    margin-top: 20px;
}

.bars ol {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bar {
    display: grid;
    gap: 6px;
}

.bar-label {
    color: var(--text);
    font-size: 14px;
    line-height: 1.35;
}

.bar.is-hl .bar-label {
    color: var(--ink);
    font-weight: 500;
}

.bar-track {
    position: relative;
    display: block;
    height: 14px;
}

.bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: calc((100% - var(--reserve)) * var(--w));
    min-width: 3px;
    border-radius: 4px;
    background: var(--soft);
    transform-origin: left center;
}

.bar.is-hl .bar-fill {
    background: var(--c);
}

.bar.is-down .bar-fill {
    background: repeating-linear-gradient(-45deg, var(--soft) 0 4px, transparent 4px 8px);
    box-shadow: inset 0 0 0 1.5px var(--soft);
}

.bar.is-down.is-hl .bar-fill {
    background: repeating-linear-gradient(-45deg, var(--c) 0 4px, transparent 4px 8px);
    box-shadow: inset 0 0 0 1.5px var(--c);
}

.bar-value {
    position: absolute;
    top: 50%;
    z-index: 1;
    left: calc((100% - var(--reserve)) * var(--w) + 6px);
    padding: 3px 4px;
    border-radius: 4px;
    background: var(--surface);
    color: var(--ink);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    transform: translateY(-50%);
}

.bar:not(.is-hl) .bar-value {
    color: var(--text);
    font-weight: 500;
}

.bar.is-sub {
    padding-left: 18px;
}

.bar.is-sub .bar-label {
    color: var(--muted);
    font-size: 13px;
}

.bar.is-sub .bar-track {
    height: 9px;
}

.bar.is-sub .bar-value {
    font-size: 12.5px;
}

.bar-before {
    position: absolute;
    top: -4px;
    bottom: -4px;
    left: calc((100% - var(--reserve)) * var(--b) - 1.5px);
    width: 3px;
    border-radius: 2px;
    background: var(--ink);
}

.bar-ref {
    position: absolute;
    top: -8px;
    bottom: -8px;
    left: calc((100% - var(--reserve)) * var(--r));
    border-left: 1.5px dashed var(--muted);
}

.bar-ref-label {
    margin: 0 0 10px;
    padding-left: calc((100% - var(--reserve)) * var(--r));
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

.bar-ref-label span {
    display: inline-block;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* Colonne */

.cols {
    --plot: 210px;
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
    align-items: end;
    gap: clamp(10px, 2vw, 22px);
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.col-value {
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.col.is-hl .col-value {
    color: var(--ink);
    font-size: 16px;
    font-weight: 700;
}

.col-bar {
    position: relative;
    display: block;
    width: min(100%, 76px);
    height: max(3px, calc(var(--plot) * var(--h)));
    overflow: hidden;
    border-radius: 8px 8px 3px 3px;
    background: var(--soft);
    transform-origin: bottom center;
}

.col.is-hl .col-bar {
    background: var(--c);
}

.col.has-parts .col-bar {
    background: var(--soft);
}

.col-part {
    position: absolute;
    inset: auto 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    height: calc(var(--p) * 100%);
    padding-top: 6px;
    background: var(--c);
}

.col-part b {
    color: #091434;
    font-size: 12px;
    font-weight: 600;
}

.col-label {
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

/* Prima e dopo */

.db {
    display: grid;
    gap: 6px;
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.db-row {
    display: grid;
    grid-template-columns: minmax(120px, .8fr) minmax(0, 1.6fr);
    align-items: center;
    gap: 12px;
    min-height: 40px;
}

.db-label {
    color: var(--text);
    font-size: 14px;
    line-height: 1.35;
}

.db-row.is-hl .db-label {
    color: var(--ink);
    font-weight: 500;
}

.db-track {
    position: relative;
    display: block;
    height: 32px;
    margin-inline: 42px 72px;
}

.db-track::before {
    content: '';
    position: absolute;
    top: 50%;
    right: -72px;
    left: -42px;
    border-top: 1px dashed var(--line);
}

.db-line {
    position: absolute;
    top: calc(50% - 2px);
    left: calc(min(var(--a), var(--b)) * 100%);
    right: calc((1 - max(var(--a), var(--b))) * 100%);
    height: 4px;
    border-radius: 2px;
    background: var(--soft);
}

.db-row.is-down .db-line {
    background: repeating-linear-gradient(90deg, var(--soft) 0 5px, transparent 5px 8px);
}

.db-dot {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.db-from {
    left: calc(var(--a) * 100%);
    border: 2px solid var(--c);
    background: var(--surface);
}

.db-to {
    left: calc(var(--b) * 100%);
    background: var(--c);
    box-shadow: 0 0 0 3px var(--surface);
}

.db-row.is-flat .db-from {
    opacity: 0;
}

.db-v {
    position: absolute;
    top: 50%;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.db-v-to {
    color: var(--ink);
    font-weight: 600;
}

.db-row.is-up .db-v-from,
.db-row.is-down .db-v-to {
    right: calc((1 - min(var(--a), var(--b))) * 100% + 13px);
    transform: translateY(-50%);
}

.db-row.is-up .db-v-to,
.db-row.is-down .db-v-from,
.db-row.is-flat .db-v-to {
    left: calc(max(var(--a), var(--b)) * 100% + 13px);
    transform: translateY(-50%);
}

.db-row.is-flat .db-v-to {
    color: var(--c);
    filter: brightness(.82);
}

/* Quadratini */

.waffle {
    display: grid;
    grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
    align-items: center;
    gap: 24px;
    margin-top: 20px;
}

.waffle-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
    aspect-ratio: 1;
}

.waffle-grid i {
    border-radius: 3px;
}

.w-s0 {
    background: var(--c);
}

.w-s1 {
    background: var(--soft);
}

.w-s2 {
    background: var(--line);
}

.waffle-legend {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.waffle-legend li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 14px;
}

.waffle-legend b {
    color: var(--ink);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

/* Numeri */

.stats {
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.chart:not(.is-wide) .stats {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 0;
    border-top: 1px solid var(--line-soft);
}

.stat:first-child {
    border-top: 0;
    padding-top: 4px;
}

.chart.is-wide .stat {
    padding: 0 18px 0 0;
    border: 0;
}

.stat-value {
    color: var(--ink);
    font-size: clamp(26px, 2.6vw, 32px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}

.stat:first-child .stat-value {
    color: color-mix(in srgb, var(--c) 80%, var(--ink));
}

.stat-label {
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.45;
}

.stat-src {
    color: var(--muted);
    font-size: 12px;
}

/* Linea nel tempo */

.line {
    margin-top: 18px;
}

.line-plot {
    position: relative;
    height: 340px;
    margin: 28px 24px 0 54px;
}

.line-grid {
    position: absolute;
    right: -24px;
    bottom: var(--y);
    left: 0;
    border-top: 1px dashed var(--line);
}

.line-grid b {
    position: absolute;
    right: calc(100% + 10px);
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    transform: translateY(-50%);
}

.line-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.line-svg polyline {
    fill: none;
    stroke: var(--c);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.line-dot {
    position: absolute;
    bottom: var(--y);
    left: var(--x);
    width: 22px;
    height: 22px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    transform: translate(-50%, 50%);
}

.line-dot::before {
    content: '';
    position: absolute;
    inset: 7px;
    border-radius: 50%;
    background: var(--muted);
    opacity: .6;
    transition: transform .2s var(--ease);
}

.line-dot.is-record::before {
    inset: 5px;
    background: var(--c);
    opacity: 1;
    box-shadow: 0 0 0 3px var(--surface);
}

.line-dot:hover::before,
.line-dot:focus-visible::before {
    transform: scale(1.5);
}

.line-dot:focus-visible {
    outline: 2px solid var(--c);
    outline-offset: 2px;
    border-radius: 50%;
}

.line-label {
    position: absolute;
    bottom: var(--y);
    left: var(--x);
    display: grid;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.3;
    white-space: nowrap;
    pointer-events: none;
}

.line-label b {
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
}

.line-label.is-right {
    transform: translate(10px, calc(100% + 6px));
}

.line-label.is-left {
    text-align: right;
    transform: translate(calc(-100% - 10px), -8px);
}

.line-label.is-over {
    transform: translate(10px, -8px);
}

.line-label.is-above {
    text-align: center;
    transform: translate(-50%, -16px);
}

.line-axis {
    position: relative;
    height: 30px;
    margin: 0 24px 0 54px;
    border-top: 1px solid var(--line);
}

.line-x {
    position: absolute;
    top: 8px;
    left: var(--x);
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    transform: translateX(-50%);
}

.line-x::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    height: 5px;
    border-left: 1px solid var(--line);
}

/* Letture incrociate */

.insights {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.insights[style*='--n:3'] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.insights[style*='--n:1'] {
    grid-template-columns: minmax(0, 1fr);
}

.insight {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 28px 28px 22px;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--card-night);
    color: #D8D4CC;
    isolation: isolate;
}

.insight::before {
    content: '';
    position: absolute;
    inset: -40% -30% auto auto;
    z-index: -1;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--c) 34%, transparent), transparent 70%);
}

.insight-figure {
    margin: 0;
    color: color-mix(in srgb, var(--c) 72%, #FFFFFF);
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
    text-wrap: balance;
}

.insight-title {
    margin-top: 14px;
    color: #F5EFE6;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    text-wrap: balance;
}

.insight-text {
    margin: 12px 0 0;
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.65;
    text-wrap: pretty;
}

.insight-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-top: auto;
    padding-top: 20px;
}

.insight-src {
    margin: 0;
    color: #9CA2B4;
    font-size: 12.5px;
}

.insight-src a:hover {
    color: #F5EFE6;
}

.insight-src.is-cross {
    color: color-mix(in srgb, var(--c) 60%, #FFFFFF);
    font-weight: 500;
}

.insight-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

.insight-terms a {
    padding: 4px 10px;
    border: 1px solid rgba(245, 239, 230, .18);
    border-radius: 999px;
    color: #F5EFE6;
    font-size: 12px;
    text-decoration: none;
    transition: border-color .2s, background-color .2s;
}

.insight-terms a:hover {
    border-color: var(--c);
    background: rgba(245, 239, 230, .06);
}

.insight-events {
    display: grid;
    gap: 6px;
    margin: 18px 0 0;
    font-size: 13px;
    line-height: 1.4;
}

.insight-events span {
    color: #9CA2B4;
    font-size: 12px;
}

.insight-events a {
    color: #F5EFE6;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--c) 70%, transparent);
    text-underline-offset: 3px;
    transition: text-decoration-color .2s;
}

.insight-events a:hover {
    text-decoration-color: #F5EFE6;
}

.insight:target {
    box-shadow: 0 0 0 2px var(--c);
}

/* Metodo e fonti */

.d-method {
    padding: clamp(56px, 7vw, 96px) 0;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.d-method-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    gap: 20px clamp(32px, 5vw, 72px);
}

.d-method-text p {
    margin: 0;
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(17px, 1.6vw, 19px);
    line-height: 1.65;
    text-wrap: pretty;
}

.d-method-text p + p {
    margin-top: 16px;
}

.d-sources {
    padding: clamp(56px, 7vw, 96px) 0;
    border-top: 1px solid var(--line);
}

.d-method,
.d-sources {
    scroll-margin-top: calc(-1 * clamp(24px, 4vw, 64px));
}

.srcs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
}

.src {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    transition: border-color .3s, box-shadow .3s;
}

.src:target {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.src-pub {
    color: var(--accent-text);
    font-size: 13px;
    font-weight: 600;
}

.src-title {
    color: var(--ink);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
}

.src-title:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.src-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin-top: auto;
    color: var(--muted);
    font-size: 12.5px;
}

.src-meta a {
    color: inherit;
}

.src-via {
    flex-basis: 100%;
}

.src-note {
    padding: 1px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--c, var(--accent)) 14%, transparent);
    color: var(--ink);
    font-size: 11.5px;
    font-style: normal;
    font-weight: 500;
}

/* Comparsa */

html.js [data-reveal] {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .7s var(--ease), transform .7s var(--ease);
}

html.js [data-reveal].is-in {
    opacity: 1;
    transform: none;
}

html.js .chart .bar-fill,
html.js .chart .bar-before {
    transform: scaleX(0);
    transition: transform .9s var(--ease) calc(.15s + var(--i, 0) * 70ms);
}

html.js .chart .bar-value,
html.js .chart .db-v,
html.js .chart .col-value,
html.js .line-label {
    opacity: 0;
    transition: opacity .5s calc(.55s + var(--i, 0) * 70ms);
}

html.js .chart .bar-before {
    transform: scaleY(0);
}

html.js .chart .col-bar {
    transform: scaleY(0);
    transition: transform .9s var(--ease) calc(.15s + var(--i, 0) * 90ms);
}

html.js .chart .db-to {
    left: calc(var(--a) * 100%);
    transition: left 1s var(--ease) calc(.2s + var(--i, 0) * 90ms);
}

html.js .chart .db-line {
    right: calc((1 - var(--a)) * 100%);
    left: calc(var(--a) * 100%);
    transition: left 1s var(--ease) calc(.2s + var(--i, 0) * 90ms), right 1s var(--ease) calc(.2s + var(--i, 0) * 90ms);
}

html.js .chart .waffle-grid i {
    opacity: 0;
    transform: scale(.4);
    transition: opacity .35s, transform .45s var(--ease);
    transition-delay: calc(.1s + var(--i) * 7ms);
}

html.js .line-svg {
    clip-path: inset(-10px 100% -10px -10px);
    transition: clip-path 1.8s var(--ease) .2s;
}

html.js .line-dot {
    opacity: 0;
    transition: opacity .4s .9s;
}

html.js .chart.is-in .bar-fill,
html.js .chart.is-in .bar-before,
html.js .chart.is-in .col-bar,
html.js .chart.is-in .waffle-grid i {
    opacity: 1;
    transform: none;
}

html.js .chart.is-in .bar-value,
html.js .chart.is-in .db-v,
html.js .chart.is-in .col-value,
html.js .chart.is-in .line-label,
html.js .chart.is-in .line-dot {
    opacity: 1;
}

html.js .chart.is-in .db-to {
    left: calc(var(--b) * 100%);
}

html.js .chart.is-in .db-line {
    left: calc(min(var(--a), var(--b)) * 100%);
    right: calc((1 - max(var(--a), var(--b))) * 100%);
}

html.js .chart.is-in .line-svg {
    clip-path: inset(-10px -10px -10px -10px);
}

html.js .chart.is-in .line-label {
    transition-delay: 1.6s;
}

/* Responsive */

@media (max-width: 1080px) {
    .srcs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .insights[style*='--n:3'] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .d-hero,
    .chapter-head,
    .d-method-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .hls {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .charts,
    .insights,
    .insights[style*='--n:3'] {
        grid-template-columns: minmax(0, 1fr);
    }

    .chart.is-wide .stats {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .chart.is-wide .stat {
        padding: 14px 0;
        border-top: 1px solid var(--line-soft);
    }

    .chart.is-wide .stat:first-child {
        padding-top: 4px;
        border-top: 0;
    }
}

@media (max-width: 720px) {
    :root {
        --rail-h: 52px;
    }

    .srcs {
        grid-template-columns: minmax(0, 1fr);
    }

    .chart {
        padding: 20px 18px 18px;
    }

    .db-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
        padding: 6px 0;
    }

    .db-track {
        margin-inline: 40px 70px;
    }

    .line-plot {
        height: 300px;
        margin: 28px 10px 0 44px;
    }

    .line-axis {
        margin: 0 10px 0 44px;
    }

    .line-grid {
        right: -10px;
    }

    .line-label {
        font-size: 11.5px;
    }

    .line-label b {
        font-size: 12.5px;
    }

    .line-label.is-above {
        text-align: right;
        transform: translate(calc(-100% + 10px), -16px);
    }

    .line-label.is-over {
        transform: translate(-4px, -42px);
    }

    .insight {
        padding: 24px 22px 20px;
    }
}

@media (max-width: 520px) {
    .hls {
        grid-template-columns: minmax(0, 1fr);
    }

    .hl {
        padding: 20px;
    }

    .waffle {
        grid-template-columns: minmax(0, 1fr);
    }

    .waffle-grid {
        max-width: 220px;
    }

    .d-index {
        padding: 22px 20px 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html.js [data-reveal],
    html.js .chart .bar-fill,
    html.js .chart .bar-before,
    html.js .chart .col-bar,
    html.js .chart .waffle-grid i {
        opacity: 1;
        transform: none;
    }

    html.js .chart .bar-value,
    html.js .chart .db-v,
    html.js .chart .col-value,
    html.js .line-label,
    html.js .line-dot {
        opacity: 1;
    }

    html.js .chart .db-to {
        left: calc(var(--b) * 100%);
    }

    html.js .chart .db-line {
        left: calc(min(var(--a), var(--b)) * 100%);
        right: calc((1 - max(var(--a), var(--b))) * 100%);
    }

    html.js .line-svg {
        clip-path: none;
    }
}

@media print {
    .d-nav,
    .d-index,
    .tip {
        display: none !important;
    }

    html.js [data-reveal],
    html.js .chart * {
        opacity: 1 !important;
        transform: none !important;
        clip-path: none !important;
    }

    .chart,
    .insight {
        break-inside: avoid;
    }

    .insight {
        border: 1px solid #ccc;
        background: none;
        color: #000;
    }
}
