/* ==========================================================================
   Languages — the switch in the nav, the one-time "read in …" nudge, and the
   type settings each script needs (see js/i18n.js).
   ========================================================================== */
.lang { position: relative; margin-inline-end: 12px; }
.lang[hidden] { display: none; }
.lang__btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line, rgba(14,23,38,.16));
  background: transparent; color: inherit; font: 500 12px/1 var(--mono); letter-spacing: .08em; cursor: pointer; transition: border-color .3s, background .3s; }
.lang__btn:hover, .lang__btn[aria-expanded="true"] { border-color: var(--royal); }
.lang__btn .ic { width: 16px; height: 16px; }
.nav.is-dark .lang__btn { border-color: rgba(255,255,255,.28); }
.lang__menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 168px; margin: 0; padding: 6px; list-style: none; border-radius: 14px;
  background: var(--paper-2); color: var(--ink); box-shadow: 0 18px 50px -18px rgba(7,16,31,.45), 0 0 0 1px rgba(14,23,38,.08); z-index: 60; }
.lang__menu a { display: block; padding: 10px 12px; border-radius: 9px; text-decoration: none; font: 500 15px/1.2 var(--sans); }
.lang__menu a:hover { background: var(--paper); }
.lang__menu a[aria-current] { color: var(--royal); font-weight: 600; }
.lang__menu a[aria-current]::after { content: ' ✓'; }
.lang__nudge { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; display: flex; align-items: center; gap: 2px; white-space: nowrap; z-index: 59;
  border-radius: 999px; background: var(--navy); color: #fff; box-shadow: 0 14px 40px -14px rgba(7,16,31,.55);
  opacity: 0; transform: translateY(-6px); transition: opacity .5s, transform .5s var(--ease, ease); pointer-events: none; }
.lang__nudge.is-on { opacity: 1; transform: none; pointer-events: auto; }
.lang__nudge button { border: 0; background: none; color: inherit; cursor: pointer; font: 500 14px/1.2 var(--sans); padding: 11px 6px 11px 16px; }
.lang__nudge [data-no] { padding: 11px 14px 11px 6px; opacity: .65; font-size: 18px; }
@media (max-width: 560px) { .lang { margin-inline-end: 6px; } .lang__btn { padding: 0 10px; } }

/* ------------------------------------------------------------ type per script */
html.lang-ml { --wide: 'Archivo', 'Noto Sans Malayalam', sans-serif; --sans: 'Geist', 'Noto Sans Malayalam', system-ui, sans-serif; --mono: 'Geist Mono', 'Noto Sans Malayalam', ui-monospace, monospace; }
html.lang-ar { --wide: 'Archivo', 'Noto Kufi Arabic', sans-serif; --sans: 'Geist', 'Noto Kufi Arabic', system-ui, sans-serif; --mono: 'Geist Mono', 'Noto Kufi Arabic', ui-monospace, monospace; }
html.lang-zh { --wide: 'Archivo', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans SC', sans-serif;
  --sans: 'Geist', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans SC', system-ui, sans-serif;
  --mono: 'Geist Mono', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', ui-monospace, monospace; }
/* joined and stacked scripts: no tracking, more room between lines */
html.lang-ml :not(svg *, [lang="en"], [lang="en"] *), html.lang-ar :not(svg *, [lang="en"], [lang="en"] *) { letter-spacing: 0 !important; }
html.lang-ml .wide { line-height: 1.22; font-weight: 800; }
html.lang-ar .wide { line-height: 1.35; font-weight: 800; }
html.lang-zh .wide { line-height: 1.12; letter-spacing: .02em; }
html.lang-ml .eyebrow, html.lang-ar .eyebrow { font-size: 13px; }
html.lang-ml body, html.lang-ar body { line-height: 1.75; }
/* the drawn worlds always read left-to-right (their labels are positioned for it) */
html[dir="rtl"] svg { direction: ltr; }
/* Malayalam letters are wide: shrink the display type ~15% so headlines keep their shape */
@supports (font-size-adjust: 0.4) { html.lang-ml .wide { font-size-adjust: 0.45; } }
