/*
  Quindecim site styles, from nyd's design (design/nyd).
  Palette: milk #F6F1E7, ink #15213B, blue #3A68BD, green #2E7A57, clay #B9431C. Font: Montserrat.
  Motion classes (is-in, is-loaded, is-scrolled...) are set by js/motion.js.
*/
:root {
  --milk: #F6F1E7;
  --ink: #15213B;
  --blue: #3A68BD;
  --green: #2E7A57;
  --clay: #B9431C;
  --line: #CFC8BA;
  --line-soft: #E4DED2;
  --muted: #5B6375;
  --blue-soft: #B8C9E7;
  --clay-soft: #E8BBA8;

  --verdict-real-up: var(--blue);
  --verdict-possible-up: var(--blue-soft);
  --verdict-not-proven: #FBF8F2;
  --verdict-possible-down: var(--clay-soft);
  --verdict-real-down: var(--clay);
  --verdict-no-data: #ECE6DA;

  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .7, .1, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: clip; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--milk); line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: clip; }
img, svg { display: block; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--milk); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ---------- buttons and pills ---------- */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 22px; border: 2px solid var(--blue); border-radius: 999px; font-weight: 600; text-decoration: none; transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease); }
.button-primary { background: var(--blue); color: var(--milk); }
.button-primary:hover { background: var(--ink); border-color: var(--ink); }
.button-outline { background: transparent; color: var(--blue); }
.button-outline:hover { background: var(--blue); color: var(--milk); }
.button .arrow { transition: transform .3s var(--ease); }
.button:hover .arrow { transform: translateX(6px); }


/* ---------- loader ---------- */
/* Without JavaScript (html without .js) there is no loading screen and nothing waits to fade in: the text just shows. */
html:not(.js) .loader, html:not(.js) .tool-loading { display: none; }
.loader { position: fixed; inset: 0; z-index: 90; background: #CFE0F2; display: grid; place-items: center; transition: clip-path .6s var(--ease), opacity .3s .45s; clip-path: inset(0 0 0 0); }
.loader-grid { position: absolute; inset: 0; background-image: linear-gradient(var(--blue-soft) 1px, transparent 1px), linear-gradient(90deg, var(--blue-soft) 1px, transparent 1px); background-size: calc(100% / 3) calc(100% / 3); background-position: center; opacity: .6; }
.loader-box { position: relative; width: min(38vw, 300px); aspect-ratio: 1; border: 1.5px solid var(--ink); display: grid; place-items: center; }
.loader-mark { width: 44%; }
.loader-mark .draw { stroke-dasharray: 363; stroke-dashoffset: 363; transform: rotate(-90deg); transform-origin: 63px 63px; animation: draw .75s var(--ease) forwards; }
.loader-mark .rise { opacity: 0; transform: translateY(16px); animation: rise .5s .3s var(--ease) forwards; }
.loader-mark .pop { transform-origin: 87.75px 37.25px; transform: scale(0); animation: pop .35s .65s var(--ease) forwards; }
@keyframes rise { to { opacity: 1; transform: none; } }
.corner { position: absolute; width: 8px; height: 8px; background: var(--ink); }
.corner.tl { top: -4px; left: -4px; } .corner.tr { top: -4px; right: -4px; }
.corner.bl { bottom: -4px; left: -4px; } .corner.br { bottom: -4px; right: -4px; }
body.is-loaded .loader { clip-path: inset(0 0 100% 0); opacity: 0; pointer-events: none; }
/* No scrolling while the loading screen is up. The page scrolls on <html>, so it is locked there; the gutter keeps the
   page from shifting sideways when a scrollbar appears afterwards. */
html { scrollbar-gutter: stable; }
html.js:has(> body.is-loading), .js body.is-loading { overflow: hidden; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { transform: scale(1); } }

/* ---------- header ---------- */
/* The header keeps its full height in the page flow (min-height) while it turns into the slimmer pill, so nothing
   under it moves when it changes; before, the page slid up 16px and scroll anchoring fought it (jitter). Only the
   pill itself takes clicks, not the empty strip under it. */
.site-header { position: sticky; top: 0; z-index: 50; min-height: 76px; padding: 0 var(--gutter); transition: padding .4s var(--ease); pointer-events: none; }
.header-inner { pointer-events: auto; }
.header-inner { max-width: var(--wrap); margin: 0 auto; display: flex; align-items: center; gap: 24px; min-height: 76px; background: var(--milk); transition: min-height .4s var(--ease), padding .4s var(--ease), border-radius .4s var(--ease), box-shadow .4s var(--ease), max-width .4s var(--ease); }
.brand img { height: 36px; width: auto; }
.main-nav { display: flex; gap: 28px; margin: 0 auto; font-weight: 500; }
.main-nav a { text-decoration: none; position: relative; white-space: nowrap; }
/* Hover: an underline under the word itself (the link box is held at its longer language's width). */
.main-nav a { text-decoration: underline 2px transparent; text-underline-offset: 6px; transition: text-decoration-color .25s var(--ease); }
.main-nav a:hover, .main-nav a:focus-visible { text-decoration-color: var(--blue); }
/* Loopsii-style: after scrolling, the header becomes a floating pill. */
.site-header.is-scrolled { padding-top: 10px; }
.site-header.is-scrolled .header-inner { min-height: 50px; padding: 0 8px 0 18px; border-radius: 999px; box-shadow: 0 6px 30px rgba(21, 33, 59, .12); max-width: 1080px; }
.site-header.is-scrolled .brand img { height: 30px; }
.site-header.is-scrolled .lang-button { padding: 5px 10px; }
.brand img { transition: height .4s var(--ease); }

.lang-switch { display: flex; gap: 2px; padding: 3px; border: 1.5px solid var(--line); border-radius: 999px; }
.lang-button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-weight: 600; transition: background .25s var(--ease), color .25s var(--ease); }
.lang-button .flag { width: 22px; height: 11px; border-radius: 2px; outline: 1px solid rgba(0, 0, 0, .15); }
.lang-button.is-active { background: var(--ink); color: var(--milk); }
.lang-button:not(.is-active):hover { color: var(--ink); background: var(--line-soft); }

/* The Alkhan border under the header and above the footer: one 60 x 36 tile repeated, drifting slowly (24px tall on phones). */
.band { height: 36px; background: url("../assets/tiles/alkhan-border.svg") repeat-x left center / 60px 36px; animation: band 40s linear infinite; }
@keyframes band { to { background-position: 600px center; } }
@keyframes band-s { to { background-position: 400px center; } }

/* ---------- frame (thin guide lines with corner squares, from the mockup) ---------- */
.frame { position: relative; max-width: var(--wrap); margin: 0 auto; padding: 96px var(--gutter); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.frame::before { content: ""; position: absolute; left: calc(50% - 50vw); right: calc(50% - 50vw); top: 0; border-top: 1px solid var(--line); }
.frame > .corner, .frame::after { display: none; }
.kicker { margin: 0 0 12px; font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; }
.section-title { font-size: clamp(1.9rem, 4vw, 3.2rem); font-weight: 700; color: var(--blue); max-width: 900px; }

/* ---------- page rails: two thin lines down the page, on the map box's left and right edges ---------- */
main { position: relative; }
main::before { content: ""; position: absolute; top: 0; bottom: 0; z-index: 0; pointer-events: none;
  left: calc(max(0px, (100% - 1400px) / 2) + var(--gutter)); right: calc(max(0px, (100% - 1400px) / 2) + var(--gutter));
  border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
main > section { position: relative; z-index: 1; }

/* ---------- hero: big headline top left (loopsii-style), tiles below with the logo in the centre ----------
   Everything scales with the window's width and height so the hero fits one screen. 112px = header (76) + band (36); phones 84px. */
.hero {
  --tile: min(calc((min(100vw, 1400px) - 2 * var(--gutter)) / 11), 12.6svh);
  max-width: 1400px; margin: 0 auto; padding: 3svh var(--gutter) 4svh;
  min-height: calc(100svh - 112px); display: flex; flex-direction: column; justify-content: center; gap: 3.5svh;
}
.hero-copy { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 32px; padding: 0 clamp(14px, 2.2vw, 36px); }
/* The headline is the rotating question, on two lines in both languages (so switching MN/EN moves nothing).
   Every piece shares one line height, and the word window clips exactly one line while the word slides. */
.hero-title { --lh: 1.15; font-size: clamp(2.6rem, min(8.2vw, 12.5svh), 8rem); line-height: var(--lh); min-height: calc(2em * var(--lh)); font-weight: 700; color: var(--blue); letter-spacing: -.03em; }
.rot-before { display: block; white-space: nowrap; }
.rot-line { display: flex; flex-wrap: wrap; align-items: flex-start; }
.rot-after { white-space: nowrap; }
.rot-after.is-line { flex-basis: 100%; }
.rot-window { display: block; overflow: hidden; height: calc(1em * var(--lh)); white-space: nowrap; transition: width .5s var(--ease); }
/* The whole headline takes the colour of the current word (set on the h1 by js/motion.js) and fades between them. */
.rot-before, .rot-line { transition: color .9s ease; }
.rot-word { display: inline-block; vertical-align: top; white-space: nowrap; transition: transform .5s var(--ease), opacity .5s; }
.rot-word.is-leaving { transform: translateY(-110%); opacity: 0; }
.rot-word.is-entering { transform: translateY(110%); opacity: 0; transition: none; }
.hero-side { display: grid; justify-items: end; gap: 2svh; text-align: right; padding-bottom: .6svh; }
.hero-sub { margin: 0; max-width: 26ch; text-wrap: balance; font-size: clamp(1.05rem, min(2vw, 2.9svh), 1.6rem); line-height: 1.3; font-weight: 600; }
/* Three headline findings under the subtitle; each opens its question on the map. */
.hero-stats { display: flex; gap: clamp(12px, 1.6vw, 22px); justify-content: flex-end; }
.hero-stat { display: grid; justify-items: inherit; gap: 2px; color: var(--ink); text-decoration: none; }
.hero-stat strong { font-size: clamp(1.7rem, min(3.4vw, 5svh), 2.6rem); line-height: 1; font-weight: 700; color: var(--c); letter-spacing: -.02em; }
.hero-stat span { max-width: 15ch; font-size: .76rem; line-height: 1.25; font-weight: 600; color: var(--muted); }
.hero-stat:hover span, .hero-stat:focus-visible span { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.hero-note { margin: 0; font-size: .74rem; color: var(--muted); }

.hero-art { position: relative; width: calc(var(--tile) * 11); margin: 0 auto; }
.hero-tiles { display: grid; grid-template-columns: repeat(11, var(--tile)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; }
.hero-tiles > .corner { z-index: 2; }
/* Find my soum: the one call to action on the hero. A plain solid button that fills the three centre tiles of the
   bottom row (under the logo's cell), inset by one gap (--g) on every side: the space to the square above, to the
   squares left and right and to the bottom edge is the same. Its size comes from the tiles, so it is the same in both
   languages and the hero keeps its height. The tiles right around it are softly blurred (.hero-find-halo). */
.hero-find { --g: calc(var(--tile) * .14); position: absolute; left: 50%; bottom: var(--g); z-index: 3; transform: translateX(-50%);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em; box-sizing: border-box;
  width: calc(var(--tile) * 3 - 2 * var(--g)); height: calc(var(--tile) - 2 * var(--g)); padding: 0 .6em;
  border: 0; border-radius: 999px; white-space: nowrap; background: var(--blue); color: var(--milk);
  font-weight: 700; font-size: min(1.5rem, calc(var(--tile) * .19)); letter-spacing: -.01em; text-decoration: none;
  box-shadow: 0 14px 30px -12px rgba(21, 33, 59, .55); transition: background .25s; }
.hero-find svg { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.hero-find:hover { background: var(--ink); }
.hero-find:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.hero-find-halo { position: absolute; left: 50%; bottom: calc(var(--tile) * -.25); z-index: 2; transform: translateX(-50%);
  width: calc(var(--tile) * 4.6); height: calc(var(--tile) * 1.5); pointer-events: none;
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); background: rgba(246, 241, 231, .18);
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%); mask-image: radial-gradient(closest-side, #000 55%, transparent 100%); }
/* Phones: the grid is five tiles wide and the label needs more room, so the button fills the whole bottom row, with
   the same gap to the row above and to both edges of the grid. */
@media (max-width: 760px) { .hero-find { width: calc(var(--tile) * 5 - 2 * var(--g)); font-size: min(1rem, calc(var(--tile) * .3)); } .hero-find-halo { width: calc(var(--tile) * 5); } }
.tile { aspect-ratio: 1; position: relative; }
/* Intro: each block grows from small to full out of one of its corners, in a diagonal wave. */
.tile-face { position: absolute; inset: 0; transform: scale(.08); opacity: 0; transform-origin: var(--ox, 50%) var(--oy, 50%);
  transition: transform .75s cubic-bezier(.34, 1.56, .64, 1), opacity .3s; transition-delay: var(--d, 0s); }
.tile-face img { width: 100%; height: 100%; }
.tile-face.solid { background: var(--c); }
.tile-face.fig svg { position: absolute; inset: 15%; width: 70%; height: 70%; }   /* a figure, 70% of the tile, centred */
.hero-tiles.is-in .tile-face { transform: translate3d(calc(var(--x, 0) * 100%), calc(var(--y, 0) * 100%), 0); opacity: 1; }
/* After the wave: js/motion.js slides faces whole cells at a time (--x, --y), full size, ease-in-out (--slide: 0.5s,
   shorter while the page scrolls). */
.hero-tiles.is-live .tile-face { transition: transform var(--slide, .5s) cubic-bezier(.45, 0, .55, 1); }

/* The travelling logo, fixed to the screen and moved by js/motion.js: it leaves the tiles, holds in the middle of the
   screen while the page scrolls (so it goes straight down the page), grows, then dissolves before the tool rises in. */
.travel-logo { position: fixed; left: 0; top: 0; z-index: 4; pointer-events: none; opacity: 0; transition: opacity .5s; transform-origin: 0 0; will-change: transform; }
.travel-disc { width: 100%; height: 100%; display: grid; place-items: center; border-radius: 50%; background: var(--milk); will-change: opacity, filter, transform;
  transition: opacity .35s ease, filter .4s ease, transform .45s var(--ease); }
/* Past the vanishing point the logo goes in a quick puff: it swells a little, blurs and fades; scroll back and it returns. */
.travel-logo.is-gone .travel-disc { opacity: 0; filter: blur(14px); transform: scale(1.3); }
/* Resting in its tile (after scrolling back up): glued to the page instead of the screen. */
.travel-logo.is-home { position: absolute; }
.travel-logo.no-anim .travel-disc { transition: none; }
/* Behind the rising glass panel js/motion.js blurs and dims the disc frame by frame, so no transition may smooth it. */
.travel-logo.is-veiled .travel-disc { transition: transform .45s var(--ease); }
.travel-disc img { width: 86%; height: 86%; transform: scale(.25); transition: transform .9s cubic-bezier(.34, 1.56, .64, 1) .15s; }
body.logo-in .travel-logo { opacity: 1; }
body.logo-in .travel-disc img { transform: none; }
/* Scroll room under the hero for the logo's short hold alone; the glass map panel then rises over it (js/motion.js). */
.logo-run { height: 14svh; }
main > .tool { z-index: 5; }


/* ---------- reveal on scroll ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.word { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }   /* room for descenders, no extra height */
.word > span { display: inline-block; transform: translateY(105%); transition: transform .9s var(--ease); transition-delay: var(--d, 0s); }
[data-split].is-in .word > span { transform: none; }

/* ---------- tool: map stage with slide-in result ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tool { position: relative; max-width: 1400px; margin: 0 auto; padding: 14px var(--gutter) 48px; scroll-margin-top: 64px; }
.sample-banner { padding: 10px 14px; border: 2px dashed var(--clay); color: var(--clay); font-weight: 700; }
.load-error { padding: 10px 14px; border: 2px solid var(--clay); }

/* The stage: the map fills it; the result panel slides in from the right.
   It is the glass panel that rises over the blurred logo (js/motion.js): a see-through milk fill, backdrop blur,
   a 1px light border, a soft shadow and round corners. Every piece of chrome on it is the same glass. */
.stage { --bar-h: 58px; --glass: rgba(246, 241, 231, .62); --glass-edge: rgba(255, 255, 255, .7); --glass-shadow: 0 10px 30px -12px rgba(21, 33, 59, .22);
  position: relative; height: clamp(440px, calc(100svh - 86px - var(--extras-room, 64px)), 1000px); overflow: hidden;
  border: 1px solid var(--glass-edge); border-radius: 22px; background: rgba(246, 241, 231, .4);
  -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: 0 30px 80px -30px rgba(21, 33, 59, .35), inset 0 1px 0 rgba(255, 255, 255, .6); }
.stage-bar, .map-legend, .map-back, .result-panel { -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2); }
/* Once the panel has settled, nothing behind the glass moves relative to it, so its blur is baked into the logo instead
   (js/motion.js: CALM): the map can zoom without the page being blurred again on every frame. It looks the same. */
.stage.is-calm, .stage.is-calm .stage-bar, .stage.is-calm .map-legend, .stage.is-calm .map-back, .stage.is-calm .result-panel { -webkit-backdrop-filter: none; backdrop-filter: none; }
/* While the panel rises the map is still fading in and takes no clicks, so nothing can catch the scroll. */
.map-svg { opacity: var(--map-in, 1); }
.stage.is-rising .map-svg { pointer-events: none; }

/* Slim bar across the top of the map: questions, years, search. */
.stage-bar { position: absolute; top: 0; left: 0; right: 0; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 9px 12px; background: var(--glass); border-bottom: 1px solid var(--glass-edge); box-shadow: 0 8px 24px -18px rgba(21, 33, 59, .35); }
/* The five questions as tabs across the top of the bar: always visible, one tap switches the map. */
.q-tabs { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.q-tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 5px 14px 5px 5px; border: 1px solid var(--glass-edge); border-radius: 999px; background: rgba(246, 241, 231, .55); box-shadow: 0 2px 8px -4px rgba(21, 33, 59, .25); font-weight: 600; font-size: .88rem; white-space: nowrap; transition: background .25s, color .25s, border-color .2s; }
.q-tab:hover { border-color: var(--blue); }
.q-tab:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.q-tab[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--milk); }
.q-icon { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--bg, var(--line-soft)); }
.q-icon svg { width: 15px; height: 15px; fill: none; stroke: var(--fg, var(--ink)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Year pickers: tap the arrows for one year, or tap the year to choose from the list. No dragging. */
.years { display: flex; align-items: center; gap: 6px; }
.year-pick { display: flex; align-items: center; gap: 2px; padding: 3px 4px 3px 10px; border: 1px solid var(--glass-edge); border-radius: 999px; background: rgba(246, 241, 231, .55); box-shadow: 0 2px 8px -4px rgba(21, 33, 59, .25); transition: border-color .2s; }
.year-pick:hover, .year-pick:focus-within { border-color: var(--blue); }
.year-label { font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.year-step { display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--blue); transition: background .2s, color .2s; }
.year-step svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.year-step:hover:not(:disabled) { background: var(--blue); color: var(--milk); }
.year-step:disabled { color: var(--line); cursor: default; }
.year-select { appearance: none; -webkit-appearance: none; border: 0; background: transparent; padding: 2px 4px; font: inherit; font-weight: 700; font-size: .95rem; color: var(--ink); font-variant-numeric: tabular-nums; text-align: center; cursor: pointer; border-radius: 6px; }
.year-select:hover { background: var(--line-soft); }
.year-select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.year-dash { color: var(--muted); font-weight: 600; }
.search-box { display: flex; align-items: center; gap: 8px; width: 230px; border: 1px solid var(--glass-edge); border-radius: 999px; padding: 0 14px; background: rgba(251, 248, 242, .6); box-shadow: 0 2px 8px -4px rgba(21, 33, 59, .25); transition: border-color .2s; }
.search-box:focus-within { border-color: var(--blue); }
.search-box svg { width: 16px; height: 16px; color: var(--blue); flex: none; }
.search-box input { flex: 1; border: 0; background: transparent; padding: 7px 0; outline: none; min-width: 0; font-size: .88rem; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-world { transform-origin: 0 0; transition: transform 1s var(--ease); }
.map-world.no-anim { transition: none; }
.aimag, .soum { vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; cursor: pointer; transition: fill .5s var(--ease), stroke .2s, opacity .6s var(--ease); }
.aimag { fill: var(--verdict-no-data); stroke: var(--milk); stroke-width: 1.6; }   /* fill: set by js/map.js */
.aimag:focus, .soum:focus, .map-svg:focus { outline: none; }   /* the keyboard focus style is the dark outline below */
/* Faded out, then hidden: shapes nobody sees are not painted on every frame of a zoom. */
.aimag.is-away { opacity: 0; visibility: hidden; pointer-events: none; transition: fill .5s var(--ease), stroke .2s, opacity .6s var(--ease), visibility 0s .6s; }
/* Under its soums, the open aimag takes the border colour, so the soft corners leave no coloured specks. */
.aimag.is-open { pointer-events: none; fill: var(--milk); stroke: var(--milk); transition-delay: .45s; }
/* Soums show only for the open aimag. Their fill is set by js/map.js. */
.soum-group { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .5s var(--ease), visibility 0s .5s; }
.soum-group.is-active { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .5s var(--ease) .45s, visibility 0s .45s; }
.soum { fill: var(--verdict-no-data); stroke: var(--milk); stroke-width: 1; }
.layer-rings { pointer-events: none; }
/* Hover and selection outlines: separate lines above all shapes (js/map.js), so neighbours never cover half of them. */
.ring { fill: none; stroke: var(--ink); vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; opacity: 0; transition: opacity .15s; }
.ring.is-on { opacity: 1; }
.ring-hover { stroke-width: 2; }
.ring-selected { stroke-width: 3; }
.layer-labels { pointer-events: none; transition: opacity .4s; }
.aimag-label.is-tiny, .aimag-label.is-cramped, .soum-label.is-hidden, .aimag-label.is-clash, .soum-label.is-clash { display: none; }
.soum-label { fill: var(--ink); font-family: var(--font); font-weight: 600; pointer-events: none; paint-order: stroke; stroke: rgba(251, 248, 242, .8); stroke-width: .28em; stroke-linejoin: round; }
.aimag-label { fill: var(--ink); font-family: var(--font); font-weight: 600; paint-order: stroke; stroke: rgba(251, 248, 242, .85); stroke-width: .25em; stroke-linejoin: round; }
.stage.is-zoomed .layer-labels { opacity: 0; visibility: hidden; transition: opacity .4s, visibility 0s .4s; }
[data-verdict="real-up"] { --v: var(--verdict-real-up); }
[data-verdict="possible-up"] { --v: var(--verdict-possible-up); }
[data-verdict="not-proven"] { --v: var(--verdict-not-proven); }
[data-verdict="possible-down"] { --v: var(--verdict-possible-down); }
[data-verdict="real-down"] { --v: var(--verdict-real-down); }
.aimag[data-verdict="not-proven"], .soum[data-verdict="not-proven"] { fill: #EFE9DD; }
/* Colours per question: each direction gets a colour that means it (greener = green, browner/yellowing = dry straw, wetter = blue,
   drier = dry orange, hotter = clay, cooler = blue, milder winters = warm orange, colder = winter blue, later frost = amber,
   earlier frost = ice blue). The map, the legend, the verdict badge, the trend line and the rate all use them. */
.tool { --up: var(--blue); --up-soft: var(--blue-soft); --down: var(--clay); --down-soft: var(--clay-soft);
  --down-deep: var(--down); --on-down: var(--milk);   /* deep: text and lines in that colour; on-down: text on its fill */
  --verdict-real-up: var(--up); --verdict-possible-up: var(--up-soft); --verdict-real-down: var(--down); --verdict-possible-down: var(--down-soft); }
.tool[data-var="ndvi_summer"] { --up: #2E7A57; --up-soft: #B9D5C3; --down: #DDA032; --down-soft: #F3E0B6; --down-deep: #A0700F; --on-down: var(--ink); }
.tool[data-var="rain_summer"] { --up: #3A68BD; --up-soft: #B8C9E7; --down: #E3802F; --down-soft: #F6D6B4; --down-deep: #B5561A; --on-down: var(--ink); }
.tool[data-var="temp_summer"] { --up: #B9431C; --up-soft: #EDBFAB; --down: #3A68BD; --down-soft: #B8C9E7; }
.tool[data-var="temp_winter"] { --up: #C46A28; --up-soft: #F0CFB2; --down: #24427E; --down-soft: #B3C2DE; }
.tool[data-var="first_frost"] { --up: #B7791F; --up-soft: #EED8AC; --down: #3F7FB5; --down-soft: #BDD6EA; }
.result-panel { --trend: var(--clay); }
.result-panel[data-dir="up"] { --trend: var(--up); }
.result-panel[data-dir="down"] { --trend: var(--down-deep); }

/* Small back arrow, a shade darker than the background. */
.map-back { position: absolute; top: calc(var(--bar-h) + 14px); left: 14px; z-index: 4; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--glass-edge); border-radius: 50%; background: var(--glass); box-shadow: var(--glass-shadow); color: var(--ink); opacity: 0; transform: translateX(-8px); transition: opacity .4s .5s var(--ease), transform .4s .5s var(--ease), background .2s; }
.map-back svg { width: 18px; height: 18px; }
.map-back:hover { background: rgba(223, 215, 200, .8); }
.stage.is-zoomed .map-back { opacity: 1; transform: none; }
.map-hint { position: absolute; top: calc(var(--bar-h) + 12px); left: 16px; z-index: 3; margin: 0; font-size: .85rem; color: var(--muted); transition: opacity .3s; }
/* Shown in the map's place only while the data is still on its way (slow connections). */
.tool-loading { position: absolute; inset: var(--bar-h) 0 0 0; z-index: 2; display: grid; place-items: center; margin: 0; font-weight: 600; color: var(--muted); }
.tool-loading span { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; } }
.stage.is-zoomed .map-hint { opacity: 0; }
/* Map key: six shades of change (down ... up) with the change at their edges, the words for both ends, and how sure. */
.map-legend { position: absolute; left: 14px; bottom: 12px; z-index: 3; display: grid; gap: 3px; justify-items: start; background: var(--glass); padding: 9px 12px 10px; border: 1px solid var(--glass-edge); border-radius: 14px; box-shadow: var(--glass-shadow); font-size: .74rem; }
.legend-title { margin: 0 0 2px; font-weight: 700; font-size: .76rem; }
.legend-scale { --cell: 26px; width: calc(6 * var(--cell)); }
.legend-ramp { display: grid; grid-template-columns: repeat(6, var(--cell)); height: 12px; border-radius: 3px; overflow: hidden; }
.legend-ramp i { display: block; transition: background .5s; }
.legend-ticks { position: relative; height: 15px; font-size: .66rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.legend-ticks span { position: absolute; top: 1px; transform: translateX(-50%); }
.legend-ticks span:nth-child(1) { left: calc(1 * var(--cell)); } .legend-ticks span:nth-child(2) { left: calc(2 * var(--cell)); }
.legend-ticks span:nth-child(3) { left: calc(3 * var(--cell)); } .legend-ticks span:nth-child(4) { left: calc(4 * var(--cell)); }
.legend-ticks span:nth-child(5) { left: calc(5 * var(--cell)); }
.legend-ends { width: calc(6 * 26px); display: flex; justify-content: space-between; gap: 8px; margin: 0; font-weight: 600; }
.legend-sure { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 3px 12px; }
.swatch { display: inline-block; flex: none; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border: 1px solid #BDB6A8; border-radius: 3px; background: var(--v); transition: background .5s; }

/* The result panel is a glass card inset in the stage; denser milk than the other chrome so the chart and text stay crisp. */
.result-panel { position: absolute; top: calc(var(--bar-h) + 10px); right: 10px; bottom: 10px; width: calc(46% - 10px); z-index: 5; background: rgba(246, 241, 231, .8); border: 1px solid var(--glass-edge); border-radius: 18px; box-shadow: 0 20px 50px -24px rgba(21, 33, 59, .4); padding: 18px 22px; overflow-y: auto; transform: translateX(calc(100% + 24px)); transition: transform .8s .15s var(--ease); }
.stage.has-panel .result-panel { transform: none; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 6px; font-size: .8rem; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; }
.breadcrumb button { border: 0; background: none; padding: 0; color: var(--blue); text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }
.breadcrumb li:last-child { color: var(--ink); font-weight: 600; }
.result-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.result-head h3 { margin: 0; font-size: 1.5rem; }
/* The result in one plain sentence, first thing under the name. */
/* One place, all five questions at a glance; the current one outlined, the others open their question. */
.glance { margin: 14px 0 0; }
.glance-title, .here-title { margin: 0 0 6px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.glance-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.glance-item { width: 100%; height: 100%; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 8px; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: rgba(251, 248, 242, .7); font: inherit; text-align: left; color: var(--ink); cursor: pointer; transition: border-color .2s, background .2s; }
.glance-item:hover { border-color: var(--blue); }
.glance-item.is-current { border: 2px solid var(--ink); padding: 5px 7px; cursor: default; }
.glance-item .q-icon { grid-row: 1 / span 3; width: 24px; height: 24px; }
.glance-name { font-size: .7rem; color: var(--muted); line-height: 1.2; }
.glance-status { font-size: .8rem; line-height: 1.2; }
.glance-years { font-size: .66rem; color: var(--muted); }
/* What the result means for the place, in words, and what it does not say. */
.here { margin: 14px 0 0; padding: 12px 14px; border-radius: 12px; background: rgba(228, 222, 210, .45); }
.here-list { margin: 0; padding-left: 1.1em; display: grid; gap: 5px; font-size: .92rem; line-height: 1.45; }
.here-list li:first-child { font-weight: 600; }
.nation-means { margin: 8px 0 0; padding: 8px 10px; border-radius: 10px; background: rgba(228, 222, 210, .45); font-size: .9rem; line-height: 1.45; }
.plain-line { margin: 10px 0 0; padding-left: 12px; border-left: 3px solid var(--trend); font-size: 1.12rem; font-weight: 600; line-height: 1.45; }
/* The whole country: one bar of all soums, the counts, and the largest real changes as shortcuts. */
.nation-sub { margin: 2px 0 0; font-size: .92rem; color: var(--muted); font-weight: 600; }
.nation-bar { display: flex; height: 14px; margin: 16px 0 10px; border-radius: 7px; overflow: hidden; background: var(--line-soft); }
.nation-bar i { display: block; min-width: 3px; }
.nation-counts { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; font-size: .95rem; }
.nation-counts li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; }
.nation-counts li.is-muted { display: block; color: var(--muted); font-size: .78rem; }
.nation-counts .num, .nation-place .num { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }   /* not the panel's trend colour: rows go both ways */
.nation-top-title { margin: 16px 0 6px; font-size: 1rem; }
.nation-top { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.nation-place { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 0 4px; padding: 5px 8px; border: 0; border-radius: 8px; background: transparent; font: inherit; font-size: .95rem; text-align: left; color: var(--ink); cursor: pointer; transition: background .2s; }
.nation-place:hover, .nation-place:focus-visible { background: rgba(58, 104, 189, .1); }
.nation-place .name { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.pill { display: inline-flex; align-items: center; justify-content: center; text-align: center; padding: 7px 14px; font-weight: 600; font-size: .8rem; border: 2px solid var(--blue); border-radius: 999px; white-space: nowrap; transition: background .4s, border-color .4s, color .4s; }
.pill-real { background: var(--up); border-color: var(--up); color: var(--milk); }
.pill-possible { background: var(--milk); border-color: var(--up); color: var(--up); }
.pill-not-proven { background: var(--milk); color: var(--ink); border: 2px dashed var(--ink); }
.pill-real-down { background: var(--down); border-color: var(--down); color: var(--on-down); }
.pill-possible-down { background: var(--milk); border-color: var(--down); color: var(--down-deep); }
#verdict-badge { animation: badge-in .6s var(--ease); }
@keyframes badge-in { from { transform: translateY(-8px) scale(.9); opacity: 0; } }

.chart { margin: 10px 0 0; }
.chart-svg { width: 100%; height: auto; overflow: visible; }
.chart-grid line { stroke: var(--line-soft); }
.chart-tick, .chart-unit { font-size: 12px; fill: var(--muted); font-family: var(--font); }
.chart-unit { font-weight: 700; fill: var(--ink); }
.chart-band { fill: #C9CED8; opacity: 0; transition: opacity .9s .5s; }
.chart-trend { stroke: var(--trend, var(--clay)); stroke-width: 3; fill: none; stroke-linecap: round; }
.chart-trend[data-level="not-proven"] { stroke-dasharray: 2 6; }
.chart-trend.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); transition: stroke-dashoffset 1.2s .2s var(--ease); }
.chart-dots circle { fill: var(--ink); transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .45s var(--ease); transition-delay: var(--d); }
.chart.is-drawn .chart-band { opacity: .55; }
.chart.is-drawn .chart-trend.draw { stroke-dashoffset: 0; }
.chart.is-drawn .chart-dots circle { transform: scale(1); }
.chart-legend { display: flex; gap: 16px; justify-content: flex-end; font-size: .76rem; font-weight: 600; }
.key::before { content: ""; display: inline-block; width: 16px; height: 3px; margin-right: 6px; vertical-align: middle; }
.key-trend { color: var(--trend, var(--clay)); } .key-trend::before { background: var(--trend, var(--clay)); }
.key-band { color: var(--blue); } .key-band::before { height: 9px; background: #C9CED8; }

.verdict-grid { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 10px 0 0; }
.verdict-grid > div { padding: 12px 14px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(10px); animation: cell-in .6s var(--ease) forwards; }
.verdict-grid > div:nth-child(2) { border-right: 0; animation-delay: .08s; }
.verdict-grid > div.wide { grid-column: 1 / -1; border-right: 0; border-bottom: 0; animation-delay: .16s; }
@keyframes cell-in { to { opacity: 1; transform: none; } }
@keyframes panel-up { from { opacity: 0; transform: translateY(24px); } }
.verdict-grid dt { font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.verdict-grid dd { margin: 0; font-size: 1.02rem; }
.num { color: var(--trend, var(--clay)); font-weight: 700; font-variant-numeric: tabular-nums; }
.source-line, .note { font-size: .78rem; color: var(--muted); margin: 10px 0 0; }
/* The small print under a result (method, areas, data source): smaller and quieter, so the result itself leads. */
.result-panel .source-line, .result-panel .note, .result-panel .source-link { font-size: .7rem; line-height: 1.45; color: #8A90A0; }
.result-panel .source-link a { color: #7C8DB5; }
/* Link to methods.html under a result. */
.source-link { margin: 6px 0 0; font-size: .78rem; }
.source-link a { color: var(--blue); text-underline-offset: 2px; }
.noscript { position: absolute; inset: var(--bar-h) 0 auto 0; z-index: 2; margin: 24px; padding: 16px 18px; border: 1.5px dashed var(--blue); border-radius: 14px; background: var(--milk); font-weight: 600; }
.noscript a { color: var(--blue); }
.too-short { margin: 24px 0; padding: 16px; border: 1.5px dashed var(--clay); color: var(--clay); font-weight: 600; }

/* Extras sit at the bottom right, under the map and the result. */
.result-extras { margin-top: 12px; animation: cell-in .5s .4s var(--ease) backwards; }
.extras-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 14px; }
.extras-toggles, .extras-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.extras-actions { gap: 10px 14px; margin-left: auto; }
.result-extras .button { padding: 8px 14px; font-size: .85rem; }
.result-extras .button:disabled { opacity: .45; cursor: default; }
/* A button with an icon on its left (Share). */
.button-icon { gap: 8px; }
.button-icon .icon { flex: none; width: 18px; height: 18px; margin: -2px 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Share as image: the picture with Save (and Share on phones). */
.card-dialog { width: min(560px, calc(100vw - 24px)); max-height: calc(100svh - 24px); padding: 16px 18px 18px; border: 1px solid var(--glass-edge); border-radius: 20px; background: var(--milk); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(21, 33, 59, .5); overflow-y: auto; }
.card-dialog::backdrop { background: rgba(21, 33, 59, .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.card-head h3 { margin: 0; font-size: 1.1rem; }
.card-close { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
.card-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.card-close:hover { background: var(--line-soft); }
.card-img { display: block; width: 100%; height: auto; max-height: calc(100svh - 230px); object-fit: contain; aspect-ratio: 4 / 5; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--line-soft); }
.card-hint { margin: 10px 0 12px; font-size: .85rem; color: var(--muted); }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.card-actions .button { padding: 9px 16px; font-size: .88rem; cursor: pointer; }
/* Toggles for the numbers and the limits: a small triangle that turns when open; the panel opens below the row. */
.extra-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 8px 0; border: 0; background: none; font: inherit; font-weight: 600; font-size: .88rem; color: var(--blue); cursor: pointer; }
.extra-toggle::before { content: ""; border: 5px solid transparent; border-left: 7px solid currentColor; border-right: 0; transition: transform .2s; }
.extra-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.extra-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.extra-panel { margin-top: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.stats-table { margin: 4px 0 8px; border-collapse: collapse; font-size: .82rem; }
.stats-table th { text-align: left; font-weight: 500; color: var(--muted); padding: 3px 14px 3px 0; vertical-align: top; }
.limits-list { margin: 4px 0 8px; padding-left: 18px; font-size: .82rem; color: var(--muted); }

/* ---------- Words: equal term cells on the left, the chosen term's meaning in a card on the right ----------
   Inset like the hero text, so the title sits inside the page rails, not on them. */
/* What is Quindecim: the simple layer under the tool (methods.html is the technical one). */
.short { max-width: 1400px; margin: 0 auto; padding: clamp(28px, 4.5svh, 48px) calc(var(--gutter) + clamp(14px, 2.2vw, 36px)) 0; scroll-margin-top: 70px; }
.short-title { margin: 0 0 14px; font-size: clamp(1.4rem, 2.5vw, 2rem); line-height: 1.1; font-weight: 700; color: var(--blue); letter-spacing: -.02em; }
.short-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); }
.short-card { padding: 0; overflow: hidden; border: 1px solid var(--glass-edge); border-radius: 22px; background: rgba(246, 241, 231, .4); box-shadow: 0 30px 80px -30px rgba(21, 33, 59, .35), inset 0 1px 0 rgba(255, 255, 255, .6); }
.short-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.2; color: var(--ink); }
/* The coloured band at the top of each card, with the title and a small figure (like the glossary cards). */
.short-head { position: relative; min-height: 76px; padding: 16px clamp(14px, 1.8vw, 22px) 16px; display: flex; flex-direction: column; justify-content: flex-end; background: var(--c); color: #fff; overflow: hidden; }
.short-head h3 { color: #fff; position: relative; z-index: 1; max-width: 80%; }
.short-head svg { position: absolute; right: -8px; top: -10px; width: 84px; height: 84px; }
.short-card p { margin: 0; padding: 14px clamp(14px, 1.8vw, 22px) 18px; font-size: .9rem; line-height: 1.5; }
.short-more { margin: 14px 0 0; font-weight: 600; }
/* Discover: the same cards as What is Quindecim, four in a row, with a bigger heading and a Read link at the bottom right. */
.discover-title { font-size: clamp(2rem, 4.4vw, 3.4rem); margin-bottom: 18px; }
.discover-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.discover-card { display: flex; flex-direction: column; }
.discover-card .short-head { min-height: 114px; justify-content: flex-start; }
.discover-card .short-head small { position: relative; z-index: 1; margin-bottom: 4px; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .9; }
.discover-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px clamp(14px, 1.8vw, 22px) 18px; }
.discover-body p, .discover-body blockquote { margin: 0; padding: 0; font-size: .9rem; line-height: 1.5; }
.discover-chip { padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, transparent); font-size: .78rem; font-weight: 600; }
.discover-body blockquote { padding-left: 12px; border-left: 3px solid var(--green); font-style: italic; }
.discover-body .discover-foot { margin-top: auto; align-self: stretch; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-top: 6px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.discover-foot a { flex: none; margin-left: auto; font-size: .86rem; font-weight: 700; color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.short-more a { color: var(--blue); text-underline-offset: 3px; }
.glossary { max-width: 1400px; margin: 0 auto; padding: clamp(36px, 6svh, 64px) calc(var(--gutter) + clamp(14px, 2.2vw, 36px)); scroll-margin-top: 70px; }
.glossary-title { margin: 0 0 18px; font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.1; font-weight: 700; color: var(--blue); letter-spacing: -.02em; }
/* Compact cards, all the same size, so the whole glossary fits on one screen: a coloured block with the number and a
   figure, then the term (up to two lines). The meaning is a pop-up on hover, keyboard focus or a tap; nothing clicks. */
.glossary-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.gcard { display: grid; position: relative; grid-template-columns: 50px minmax(0, 1fr); height: 76px; padding: 0; border: 1px solid var(--glass-edge); border-radius: 22px; background: rgba(246, 241, 231, .4); box-shadow: 0 30px 80px -30px rgba(21, 33, 59, .35), inset 0 1px 0 rgba(255, 255, 255, .6); text-align: left; font: inherit; color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.gcard:hover { border-color: var(--c); }
.gcard:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.gcard-top { position: relative; display: block; background: var(--c); color: #fff; overflow: hidden; border-radius: 21px 0 0 21px; }
/* The full meaning, on hover or focus: a popup under the card. It takes no clicks, so it blocks nothing. */
.gcard-full { position: absolute; left: 0; top: calc(100% + 8px); z-index: 30; width: 300px; max-width: 80vw; padding: 12px 14px; border: 1px solid var(--glass-edge); border-radius: 14px; background: #FBF8F2; box-shadow: 0 16px 40px -18px rgba(21, 33, 59, .45); color: var(--ink); font-size: .85rem; font-weight: 500; line-height: 1.5; text-align: left; opacity: 0; visibility: hidden; transform: translateY(-4px); pointer-events: none; transition: opacity .18s, transform .18s, visibility 0s .18s; }
.gcard:hover, .gcard:focus-visible { z-index: 30; }
.gcard:hover .gcard-full, .gcard:focus-visible .gcard-full { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
/* Touch screens have no hover: a tap focuses the card and shows its meaning; a tap anywhere else hides it. */
@media (hover: none) {
  .gcard:focus { z-index: 30; outline: none; border-color: var(--c); }
  .gcard:focus .gcard-full { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
}
.gcard-top small { display: none; }
.gcard-n { position: absolute; left: 8px; bottom: 4px; z-index: 1; font-size: 1.15rem; font-weight: 800; line-height: 1; }
.gcard-top svg { position: absolute; right: -16px; top: -12px; width: 54px; height: 54px; }
.gcard-body { display: grid; align-content: center; gap: 2px; padding: 8px 12px; }
.gcard-term { font-size: .95rem; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.gcard-term .nobr { white-space: nowrap; }
@media (max-width: 760px) {
  .glossary-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gcard { grid-template-columns: 24px minmax(0, 1fr); height: 54px; border-radius: 16px; box-shadow: none; }
  .gcard-top svg { display: none; }
  .gcard-n { left: 0; right: 0; bottom: auto; top: 50%; transform: translateY(-50%); text-align: center; font-size: .72rem; }
  .gcard-body { padding: 4px 6px 4px 8px; }
  .gcard-term .nobr { white-space: normal; }
  .gcard-term { font-size: .76rem; line-height: 1.15; -webkit-line-clamp: 3; }
  /* Two columns: the right-hand card's pop-up opens leftwards so it stays on screen. */
  .gcard:nth-child(2n) .gcard-full { left: auto; right: 0; }
}

/* ---------- footer ---------- */
.site-footer { background: var(--blue); color: var(--milk); padding: 56px var(--gutter); }
.footer-inner { max-width: var(--wrap); margin: 0 auto; display: grid; gap: 10px; }
.footer-logo { justify-self: start; display: inline-flex; padding: 10px 16px; margin-bottom: 12px; background: var(--milk); border-radius: 999px; }
.footer-logo img { height: 32px; width: auto; }
.footer-inner p { margin: 0; font-size: .9rem; opacity: .9; }
.footer-top { justify-self: start; margin-top: 16px; font-weight: 600; }
.footer-license a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .main-nav { gap: 18px; font-size: .92rem; }
}
@media (max-width: 1000px) {
  .main-nav { display: none; }
  .header-inner { justify-content: space-between; }
}
@media (max-width: 760px) {
  /* Phones: 5 columns by 3 rows of tiles (logo in the middle); headline and button stacked above. */
  .hero { --tile: min(calc((100vw - 2 * var(--gutter)) / 5), 8.5svh); min-height: calc(100svh - 84px); gap: 3svh; }
  .band { height: 24px; background-size: 40px 24px; animation-name: band-s; }
  .header-inner { min-height: 60px; }
  .site-header { min-height: 60px; }
  .hero-copy { grid-template-columns: 1fr; padding: 0 6px; }
  .hero-title { font-size: clamp(2rem, min(12.5vw, 7.5svh), 3.6rem); }
  .hero-side { justify-items: start; text-align: left; }
  .hero-sub { max-width: none; }
  .hero-stats { justify-content: space-between; width: 100%; gap: 10px; }
  .hero-stat { flex: 1 1 0; }
  .hero-stat strong { font-size: 1.6rem; }
  .hero-stat span { font-size: .68rem; max-width: none; }
  .short-grid { grid-template-columns: minmax(0, 1fr); }
  .discover-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-art { width: calc(var(--tile) * 5); }
  .hero-tiles { grid-template-columns: repeat(5, var(--tile)); }
  .frame { padding-top: 64px; padding-bottom: 64px; }
  /* Phones: the bar sits above the map, and the result appears below the map instead of beside it. */
  .stage { --bar-h: 0px; height: auto; overflow: visible; display: flex; flex-direction: column; }
  .stage-bar { position: relative; border-radius: 21px 21px 0 0; }
  .search-box { width: 100%; }
  /* Question tabs: a two-column grid, all five visible; long names take two lines. */
  .q-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .q-tab { min-width: 0 !important; justify-content: flex-start; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 16px; font-size: .76rem; line-height: 1.2; white-space: normal; text-align: left; }
  .q-tab:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .q-tab .q-icon { width: 22px; height: 22px; }
  .q-tab .q-icon svg { width: 13px; height: 13px; }
  .years { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .year-dash { display: none; }
  .year-pick { min-width: 0; justify-content: space-between; padding-left: 8px; }
  .year-label { font-size: .6rem; letter-spacing: .02em; margin-right: 0; }
  .year-step { width: 22px; height: 22px; }
  .map-svg, .tool-loading { position: relative; inset: auto; height: clamp(240px, 76vw, 52svh); }
  /* The result (the country first, then a place) appears under the map. */
  .result-panel { display: none; position: relative; inset: auto; width: auto; margin: 0 8px 8px; transform: none; overflow: visible; transition: none; }
  .stage.has-panel .result-panel { display: block; animation: panel-up .6s .25s var(--ease) both; }
  .map-legend { bottom: auto; top: auto; position: relative; left: auto; margin: 6px 12px; background: none; padding: 0; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .map-legend { display: grid; }
  .stage-bar { order: 0; } .map-hint { order: 1; } .map-back { order: 2; } .map-svg, .tool-loading { order: 3; } .map-legend { order: 4; } .result-panel { order: 5; }
  .map-back { position: relative; top: auto; left: 12px; margin: 8px 0 -46px; }
  .map-hint { position: relative; top: auto; left: auto; margin: 8px 12px 0; }
  .noscript { position: relative; inset: auto; margin: 12px; order: 3; }
  .extras-bar, .extras-actions, .extras-toggles { flex-direction: column; align-items: stretch; }   /* one per row: nothing rewraps when the language changes */
  .extras-actions { margin-left: 0; }
  .brand img { height: 30px; }
  /* Result on a phone: the verdict badge goes under the name when both do not fit, and the cells stack. */
  .result-head { flex-wrap: wrap; }
  .pill { white-space: normal; }
  .verdict-grid { grid-template-columns: minmax(0, 1fr); }
  .verdict-grid > div { border-right: 0; }
}

/* Respect people who ask for less motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
  /* Nothing waits for a scroll reveal. */
  [data-reveal], .word > span, .tile-face, .chart-band, .chart-dots circle { opacity: 1 !important; transform: none !important; }
  .travel-logo, .travel-disc img { opacity: 1 !important; }
  .chart-band { opacity: .55 !important; }
  .chart-trend.draw { stroke-dashoffset: 0 !important; }
  /* Instead of the rising panel: a short, simple crossfade once the panel is well into the screen (js/motion.js). */
  .stage { transition: opacity .4s ease !important; }
  .stage.is-faded { opacity: 0; }
}
@media (max-width: 760px) { .discover-card .short-head { min-height: 0; } }
@media (min-width: 761px) and (max-width: 1100px) { .discover-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
