/*
 * Look: quiet plaster (light) or volcanic ash (dark), a terracotta clay accent, pastel asset
 * colors, a light grain, and one typeface: Geist. The eroded sculptures are the art.
 */
:root {
    color-scheme: light;
    --page: #efede8;
    --surface: #f7f6f2;
    --surface-2: #ebe9e3;
    --plaster-hi: #fbfaf7;
    --wall: #a8a398;
    --border: rgba(60, 52, 40, 0.10);
    --border-strong: rgba(60, 52, 40, 0.20);
    --ink: #1e1d1b;
    --ink-2: #4f4c46;
    --muted: #7a766d;
    --grid: #e2dfd8;
    --axis: #c4c0b6;
    --series-1: #6a9cc4;
    --series-2: #9f8fd0;
    --series-3: #df8fae;
    --series-4: #d6a650;
    --series-5: #e0906f;
    --series-6: #7fae86;
    --neutral-series: #a8a196;
    --good: #3f7a52;
    --critical: #8e3b4a;
    --focus: #b46a4e;
    --accent: #b46a4e;
    --cast: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 1px 2px rgba(60, 52, 40, 0.06), 0 12px 32px -12px rgba(60, 52, 40, 0.18);
    --shadow: 0 12px 40px rgba(60, 52, 40, 0.16);
    --grain-opacity: 0.35;
    --font-display: Geist, "Noto Sans Georgian", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-body: Geist, "Noto Sans Georgian", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --page: #1c1b19;
        --surface: #242321;
        --surface-2: #2c2b28;
        --plaster-hi: #31302d;
        --wall: #8a857b;
        --border: rgba(255, 255, 255, 0.08);
        --border-strong: rgba(255, 255, 255, 0.15);
        --ink: #efede8;
        --ink-2: #c7c3ba;
        --muted: #8f8a80;
        --grid: #33322f;
        --axis: #4a4844;
        --series-1: #7aaed6;
        --series-2: #ad9fdc;
        --series-3: #e69fbc;
        --series-4: #ddb060;
        --series-5: #e8a080;
        --series-6: #8fbf96;
        --neutral-series: #a39d92;
        --good: #8cc49a;
        --critical: #e09aa8;
        --focus: #d99a80;
        --accent: #d99a80;
        --cast: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 12px 32px -12px rgba(0, 0, 0, 0.6);
        --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
        --grain-opacity: 0.22;
    }
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --page: #1c1b19;
    --surface: #242321;
    --surface-2: #2c2b28;
    --plaster-hi: #31302d;
    --wall: #8a857b;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    --ink: #efede8;
    --ink-2: #c7c3ba;
    --muted: #8f8a80;
    --grid: #33322f;
    --axis: #4a4844;
    --series-1: #7aaed6;
    --series-2: #ad9fdc;
    --series-3: #e69fbc;
    --series-4: #ddb060;
    --series-5: #e8a080;
    --series-6: #8fbf96;
    --neutral-series: #a39d92;
    --good: #8cc49a;
    --critical: #e09aa8;
    --focus: #d99a80;
    --accent: #d99a80;
    --cast: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 12px 32px -12px rgba(0, 0, 0, 0.6);
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    --grain-opacity: 0.22;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 24px; }
/* Turned on after load, so a reload with #section lands at once instead of gliding. */
html.smooth { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html.smooth { scroll-behavior: auto; } }
body {
    font-family: var(--font-body);
    background: var(--page);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    position: relative;
}
/* Plaster grain over the whole page. */
body::before {
    content: "";
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    opacity: var(--grain-opacity);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.42 0 0 0 0 0.36 0 0 0 0.35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button, input { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 600px) { .container { padding: 0 18px; } }

/* Header */
.header-row { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.02em; text-decoration: none; font-size: 16px; }
.brand-tld { color: var(--muted); font-weight: 500; }
.brand-mark { display: block; width: auto; height: 30px; filter: drop-shadow(0 2px 3px rgba(30, 26, 20, 0.2)); }
/* The logo keeps burning: flames are drawn on a canvas that extends above the bill. */
.brand-fire { position: relative; display: block; }
#logoFire { position: absolute; left: -10px; top: -30px; width: calc(100% + 20px); height: calc(100% + 34px); pointer-events: none; }
.header-actions { display: flex; align-items: center; gap: 8px; }

/* Language menu */
.lang { position: relative; }
.lang-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 999px;
    border: 1px solid var(--border); background: none; color: var(--ink-2); cursor: pointer; font-size: 13px; font-weight: 600;
}
.lang-btn:hover, .lang-btn[aria-expanded="true"] { color: var(--ink); background: var(--surface); }
.lang-chevron { transition: transform 0.2s; }
.lang-btn[aria-expanded="true"] .lang-chevron { transform: rotate(180deg); }
.lang-menu {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 168px; padding: 6px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
    display: grid; gap: 2px; transform-origin: top right; animation: menu-in 0.16s ease;
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }
@media (prefers-reduced-motion: reduce) { .lang-menu { animation: none; } }
.lang-menu button {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
    padding: 9px 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); cursor: pointer;
    font-size: 14px; font-weight: 500; text-align: left;
}
.lang-menu button:hover, .lang-menu button:focus-visible { background: var(--surface-2); outline: none; }
.lang-menu button svg { color: var(--accent); visibility: hidden; }
.lang-menu button[aria-checked="true"] svg { visibility: visible; }

.icon-btn {
    display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 999px;
    border: 1px solid var(--border); background: none; cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); background: var(--surface); }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="light"] .icon-moon { display: block; }
:root[data-theme="light"] .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-sun { display: block; }
    :root:not([data-theme="light"]) .icon-moon { display: none; }
}

/* Hero: headline and intro, then five dollar bills burned by lost buying power, with their values. */
.hero { padding: 40px 0 56px; }
/* Headline and intro read as one block on the left; the bills carry the width below. */
.hero-text { max-width: 760px; }
@media (max-width: 860px) { .hero { padding: 20px 0 40px; } }
.hero h1 {
    font-family: var(--font-display); font-weight: 600;
    font-size: clamp(44px, 7vw, 86px); line-height: 1.02; letter-spacing: -0.042em;
    text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.intro { margin-top: 22px; font-size: clamp(17px, 1.7vw, 20px); line-height: 1.55; color: var(--ink-2); max-width: 46ch; text-wrap: pretty; }

.sequence { margin-top: 48px; }
/* Five bills of the same size; each one is burned by the share of buying power lost. */
.dollar-steps {
    list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(10px, 2.4vw, 28px); align-items: end;
}
.dollar-steps li { display: grid; justify-items: center; }
.bill {
    display: block; width: 100%; height: auto; aspect-ratio: 600 / 258;
    /* drop-shadow follows the burned outline, unlike box-shadow. */
    filter: drop-shadow(0 1px 1px rgba(30, 26, 20, 0.18)) drop-shadow(0 10px 14px rgba(30, 26, 20, 0.22));
}
.dollar-steps strong { margin-top: 14px; font-size: clamp(16px, 2.2vw, 24px); font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.dollar-steps li:last-child strong { color: var(--accent); }
.step-year { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sequence-caption { text-align: center; font-size: 13px; color: var(--muted); margin-top: 6px; }

/* Controls: amount and period */
.controls {
    background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
    padding: 26px 28px 22px; box-shadow: var(--cast); margin-bottom: 72px;
}
@media (max-width: 600px) { .controls { padding: 20px 18px 18px; border-radius: 20px; margin-bottom: 56px; } }
.controls-row { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 36px; align-items: start; }
@media (max-width: 760px) { .controls-row { grid-template-columns: 1fr; gap: 22px; } }
.label { font-size: 13px; font-weight: 500; color: var(--muted); }
.amount { display: grid; gap: 8px; }
.amount-input {
    display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 16px;
    border: 1px solid var(--border-strong); border-radius: 14px; background: var(--plaster-hi);
    font-size: 26px; font-weight: 600; letter-spacing: -0.02em;
}
.amount-input span { color: var(--muted); font-weight: 500; }
.amount-input input { border: none; background: none; outline: none; width: 100%; min-width: 0; font-variant-numeric: tabular-nums; }
.amount-input:focus-within { outline: 2px solid var(--focus); outline-offset: 0; }

.period-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.period-value { display: inline-flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; font-size: 26px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.period-len { font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--muted); }

/* Two handles on one timeline. The track is inset by the thumb radius so the ticks line up. */
.year-range { position: relative; height: 40px; margin-top: 2px; }
.year-track { position: absolute; left: 11px; right: 11px; top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: var(--grid); }
.year-fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--accent); }
.year-input {
    position: absolute; inset: 0; width: 100%; height: 40px; margin: 0;
    -webkit-appearance: none; appearance: none; background: none; pointer-events: none;
}
.year-input::-webkit-slider-runnable-track { height: 40px; background: none; }
.year-input::-moz-range-track { background: none; }
.year-input::-webkit-slider-thumb {
    -webkit-appearance: none; pointer-events: auto; cursor: grab; margin-top: 9px;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--plaster-hi); border: 2px solid var(--accent); box-shadow: 0 1px 4px rgba(30, 26, 20, 0.25);
}
.year-input::-moz-range-thumb {
    pointer-events: auto; cursor: grab; width: 18px; height: 18px; border-radius: 50%;
    background: var(--plaster-hi); border: 2px solid var(--accent); box-shadow: 0 1px 4px rgba(30, 26, 20, 0.25);
}
.year-input:focus-visible { outline: none; }
.year-input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 30%, transparent); }
.year-ticks { position: relative; height: 18px; margin: 0 11px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.year-ticks span { position: absolute; transform: translateX(-50%); }


.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.chip {
    border: 1px solid var(--border-strong); background: transparent; color: var(--ink-2); cursor: pointer;
    font-size: 13px; font-weight: 500; padding: 6px 14px; border-radius: 999px;
}
.chip:hover { color: var(--ink); background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--page); border-color: var(--ink); }

/* Section heads */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.15; }
.sub { color: var(--muted); font-size: 15px; margin-top: 6px; }
.btn {
    display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--border-strong); background: var(--plaster-hi); color: var(--ink); cursor: pointer;
    font-size: 13px; font-weight: 500;
}
.btn:hover { background: var(--surface-2); }

/* Asset rows */
.results { margin-bottom: 80px; }
.asset, .list-head {
    display: grid; grid-template-columns: 76px minmax(150px, 1fr) minmax(0, 1.25fr) 170px;
    gap: 24px; align-items: center;
}
.list-head { font-size: 12px; font-weight: 500; color: var(--muted); padding: 6px 0 8px; }
.list-head-value { text-align: right; }
.asset-list { list-style: none; border-top: 1px solid var(--border-strong); }
.asset { position: relative; padding: 14px 0; border-bottom: 1px solid var(--border); }
/* One invisible button covers the row, so the whole row opens the asset modal. */
.asset-open { position: absolute; inset: 0; z-index: 1; width: 100%; border: 0; background: none; cursor: pointer; border-radius: 12px; }
.asset-open:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.asset-chevron { position: absolute; right: -26px; top: 50%; transform: translateY(-50%); font-size: 22px; color: var(--muted); line-height: 1; }
@media (max-width: 1160px) { .asset-chevron { display: none; } }
.asset-photo {
    width: 76px; height: 76px; display: block; object-fit: cover; border-radius: 16px;
    background: #efede8; box-shadow: var(--cast);
}
.asset-name { display: grid; gap: 2px; min-width: 0; }
.asset-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.asset-note { font-size: 13px; color: var(--muted); }

/* Small buying-power line. All rows share one scale; the dashed line is what you put in. */
.asset-spark { position: relative; height: 46px; }
.spark { display: block; width: 100%; height: 100%; overflow: visible; }
.spark-line { stroke-width: 2.25; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark-base { stroke: var(--ink-2); stroke-opacity: 0.45; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.spark-dot {
    position: absolute; right: -4px; width: 9px; height: 9px; border-radius: 50%;
    transform: translateY(-50%); box-shadow: 0 0 0 2px var(--page);
}

.asset-value { display: grid; justify-items: end; text-align: right; font-variant-numeric: tabular-nums; }
.asset-real { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.asset-rate { font-size: 13px; font-weight: 600; }
.asset-nominal { font-size: 12px; color: var(--muted); }
.up { color: var(--good); }
.down { color: var(--critical); }
/* Phones: name on its own line, then the values, then the line, so long names never collide. */
@media (max-width: 720px) {
    .list-head { display: none; }
    .asset {
        grid-template-columns: 60px minmax(0, 1fr); gap: 6px 14px; padding: 16px 0;
        grid-template-areas: "photo name" "photo value" "photo spark";
    }
    .asset-photo { grid-area: photo; width: 60px; height: 60px; border-radius: 13px; align-self: start; }
    .asset-name { grid-area: name; }
    .asset-title { overflow-wrap: anywhere; }
    .asset-value { grid-area: value; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; justify-items: start; text-align: left; }
    .asset-spark { grid-area: spark; height: 36px; margin-right: 6px; }
    .asset-note { display: none; }
}
}

/* Chart */
.chart-section {
    background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
    padding: 28px; box-shadow: var(--cast); margin-bottom: 80px;
}
@media (max-width: 600px) { .chart-section { padding: 20px 16px; border-radius: 20px; } }
.chart-box { position: relative; height: 380px; margin-top: 16px; }
@media (max-width: 600px) { .chart-box { height: 300px; } }

/* About */
.about { padding-top: 8px; }
.about-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 18px; }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; gap: 14px; } }
.about-grid p { font-size: 15px; color: var(--ink-2); }
.about-grid strong { color: var(--ink); font-weight: 600; }
.sources { margin-top: 28px; font-size: 14px; color: var(--muted); }
.sources a { color: var(--ink-2); text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.sources a:hover { color: var(--ink); }
.disclaimer { margin-top: 8px; font-size: 13px; color: var(--muted); }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 48px 0 40px; margin-top: 48px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.footer-links { display: inline-flex; gap: 16px; }
.footer a { color: var(--ink-2); text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* Asset modal */
html.modal-open { overflow: hidden; }
.modal {
    border: 0; padding: 0; margin: auto; background: transparent; color: var(--ink);
    width: min(980px, calc(100vw - 48px)); max-width: none; max-height: min(720px, calc(100dvh - 48px)); overflow: visible;
}
.modal::backdrop { background: rgba(30, 26, 20, 0.42); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.modal[open] { animation: modal-in 0.38s cubic-bezier(0.2, 0.8, 0.2, 1); }
.modal[open]::backdrop { animation: fade-in 0.3s ease; }
.modal.closing { animation: modal-out 0.18s ease forwards; }
.modal.closing::backdrop { animation: fade-out 0.18s ease forwards; }
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(10px) scale(0.985); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .modal[open], .modal[open]::backdrop { animation: none; } }

.modal-panel {
    display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
    background: var(--surface); border-radius: 28px; overflow: hidden;
    box-shadow: 0 40px 120px -20px rgba(30, 26, 20, 0.45), 0 0 0 1px var(--border);
    /* A fixed height with a 0-min row lets the text column scroll inside the panel. */
    height: min(720px, calc(100dvh - 48px)); grid-template-rows: minmax(0, 1fr);
}
.modal-media { background: #efede8; position: relative; overflow: hidden; }
.modal-media { display: grid; place-items: center; }
.modal-media img {
    width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; display: block;
    /* Soft top and bottom edges, so the photo melts into the backdrop color around it. */
    -webkit-mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
    mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}
.modal[open] .modal-media img { animation: media-in 1.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes media-in { from { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .modal[open] .modal-media img { animation: none; } }
.modal-body { position: relative; overflow-y: auto; padding: 34px 34px 24px; overscroll-behavior: contain; }
.modal-body:focus-visible { outline: none; }
.modal-close {
    position: sticky; top: 0; float: right; margin: -14px -14px 0 0; z-index: 2;
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.modal-close:hover { color: var(--ink); }
.m-kicker { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.m-title { font-size: clamp(34px, 4vw, 46px); letter-spacing: -0.045em; line-height: 1; margin-top: 8px; }
.m-lede { font-size: 17px; color: var(--ink-2); margin-top: 10px; max-width: 34ch; }

.m-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.m-stat { display: grid; gap: 1px; padding: 12px 14px; border-radius: 14px; background: var(--plaster-hi); border: 1px solid var(--border); }
.m-stat-label { font-size: 12px; font-weight: 500; color: var(--muted); }
.m-stat-value { font-size: 22px; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.m-stat-detail { font-size: 12px; color: var(--muted); }

.m-chart { margin-top: 22px; }
.m-chart-plot .asset-spark { height: 96px; }
.m-chart-plot .spark-line { stroke-width: 2.5; }
.m-chart-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.m-chart-caption { font-size: 12px; color: var(--muted); margin-top: 2px; }

.m-facts { display: grid; gap: 16px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.m-facts dt { font-size: 13px; font-weight: 600; color: var(--ink); }
.m-facts dd { font-size: 15px; color: var(--ink-2); margin-top: 2px; }
.m-note { margin-top: 16px; font-size: 13px; color: var(--muted); padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.m-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--border); }
.m-nav-btn { border: 1px solid var(--border-strong); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 500; cursor: pointer; }
.m-nav-btn:hover { color: var(--ink); background: var(--surface-2); }

@media (max-width: 760px) {
    .modal { width: 100vw; max-height: 100dvh; margin: auto 0 0; }
    .modal-panel { grid-template-columns: 1fr; border-radius: 24px 24px 0 0; height: 92dvh; grid-template-rows: auto minmax(0, 1fr); }
    .modal-media { height: 34dvh; display: flex; justify-content: center; }
    .modal-media img {
        width: auto; height: 100%;
        -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
        mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
    }
    .modal-panel { position: relative; }
    .modal-body { position: static; padding: 22px 20px 20px; }
    /* On phones the close button sits over the photo, so it is always in reach. */
    .modal-close { position: absolute; top: 14px; right: 14px; margin: 0; float: none; }
    @keyframes modal-in { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
}

.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 500;
    background: var(--ink); color: var(--page); padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow);
}

/* Georgian letters are wider and taller than Latin ones: less negative tracking, more line height. */
:lang(ka) .hero h1 { letter-spacing: -0.02em; line-height: 1.12; font-size: clamp(38px, 6vw, 72px); }
:lang(ka) h2, :lang(ka) .m-title { letter-spacing: -0.01em; line-height: 1.25; }
:lang(ka) .asset-title, :lang(ka) .period-value, :lang(ka) .asset-real { letter-spacing: 0; }

/* ---------- Phones ---------- */
button, .asset-open, a { -webkit-tap-highlight-color: transparent; }
.chart-legend { display: none; }
@media (max-width: 600px) {
    .chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin-top: 14px; font-size: 12px; color: var(--ink-2); }
    .chart-legend li { display: inline-flex; align-items: center; gap: 6px; }
    .chart-legend i { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
    .chart-box { margin-top: 10px; }
    .m-title { font-size: 30px; }
    .modal-body { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
@media (max-width: 400px) {
    .brand-tld, .lang-chevron { display: none; }
    .lang-btn { padding: 0 10px; }
    .header-actions { gap: 6px; }
    .brand { gap: 8px; }
}
@media (max-width: 360px) {
    .m-stats { grid-template-columns: 1fr; }
    .dollar-steps { gap: 6px; }
}
:lang(ka) .hero h1 { font-size: clamp(30px, 9.2vw, 72px); }

/* ---------- Phones: calmer, larger, aligned ---------- */
@media (max-width: 600px) {
    .hero { padding: 16px 0 36px; }
    .sequence { margin-top: 32px; }
    /* Three bills (start, middle, end) instead of five, so each one is big enough to read. */
    .dollar-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    .dollar-steps li:nth-child(2), .dollar-steps li:nth-child(4) { display: none; }
    .dollar-steps strong { font-size: 20px; margin-top: 12px; }
    .sequence-caption { text-align: left; margin-top: 14px; }

    .controls { padding: 20px 18px; margin-bottom: 48px; }
    .controls-row { gap: 20px; }
    .amount-input { height: 52px; font-size: 24px; }
    /* Label above the value, the same as "Amount". */
    .period-head { flex-direction: column; align-items: flex-start; gap: 4px; }
    .period-value { font-size: 22px; }
    .year-ticks span { display: none; }
    .year-ticks span:nth-child(3n + 1) { display: block; }   /* 1930, 1960, 1990, 2020 */
    .chips { gap: 8px; margin-top: 16px; padding-top: 16px; }
    .chip { padding: 6px 12px; font-size: 13px; }
}
