/* Hutoo · hutoo.app. Everything about languages: the picker in the top bar, the note that offers the
   visitor's own language, and type settings per script. Loaded after site.css / legal.css. */

/* ---------- Picker ---------- */
.nav-end { display: flex; align-items: center; gap: 10px; }
.lang-pick { position: relative; }
.lang-pick summary { display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px 0 11px; border-radius: 999px; border: 1px solid rgba(20, 18, 24, .14); font: 600 14px/1 var(--body); letter-spacing: .02em; color: inherit; cursor: pointer; list-style: none; user-select: none; transition: background .3s, border-color .3s; }
.lang-pick summary::-webkit-details-marker { display: none; }
.lang-pick summary:hover, .lang-pick[open] summary { background: rgba(20, 18, 24, .06); }
.lang-pick summary svg { width: 17px; height: 17px; }
.on-dark .lang-pick summary { border-color: rgba(255, 255, 255, .28); }
.on-dark .lang-pick summary:hover, .on-dark .lang-pick[open] summary { background: rgba(255, 255, 255, .1); }
.lang-list { position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 60; display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 2px; width: max-content; max-height: min(70vh, 560px); overflow-y: auto; margin: 0; padding: 8px; list-style: none; border-radius: 20px; background: #FFFDF8; color: #141218; box-shadow: 0 24px 60px -18px rgba(20, 18, 24, .35), 0 0 0 1px rgba(20, 18, 24, .06); transform-origin: top right; animation: lang-in .35s cubic-bezier(.16, 1, .3, 1); }
[dir='rtl'] .lang-list { transform-origin: top left; }
@keyframes lang-in { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.lang-list a { display: block; padding: 10px 14px; border-radius: 12px; font: 500 15px/1.2 system-ui, -apple-system, 'Segoe UI', sans-serif; letter-spacing: 0; color: inherit; text-decoration: none; white-space: nowrap; }
.lang-list a:hover { background: rgba(20, 18, 24, .06); }
.lang-list a[aria-current] { background: #141218; color: #fff; }
@media (max-width: 560px) {
  .lang-pick summary { height: 34px; padding: 0 10px 0 9px; font-size: 13px; }
  .lang-list { position: fixed; top: 64px; inset-inline: 12px; width: auto; grid-template-columns: 1fr 1fr; }
  .lang-list a { padding: 10px 11px; font-size: 14px; white-space: normal; }
}


/* ---------- Offer the visitor's language (lang.js) ---------- */
.lang-note { position: fixed; z-index: 70; inset-inline: 0; bottom: max(16px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100% - 32px); margin: 0 auto; padding: 8px 8px 8px 20px; border-radius: 999px; background: rgba(20, 18, 24, .92); color: #fff; font: 500 15px/1.3 system-ui, -apple-system, 'Segoe UI', sans-serif; letter-spacing: 0; box-shadow: 0 20px 50px -16px rgba(0, 0, 0, .5); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); opacity: 0; transform: translateY(24px); transition: opacity .5s, transform .7s cubic-bezier(.16, 1, .3, 1); }
.lang-note[dir='rtl'] { padding: 8px 20px 8px 8px; }
.lang-note.is-in { opacity: 1; transform: none; }
.lang-note a { flex: none; padding: 9px 16px; border-radius: 999px; background: #fff; color: #141218; font-weight: 600; text-decoration: none; }
.lang-note button { flex: none; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; opacity: .7; }
.lang-note button:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
.lang-note button svg { width: 18px; height: 18px; }
@media (max-width: 560px) { .lang-note { font-size: 14px; border-radius: 22px; } }
@media (prefers-reduced-motion: reduce) { .lang-note, .lang-list { transition: none; animation: none; } }

/* ---------- Type per script ----------
   Inter (self-hosted) covers Latin, Cyrillic, Greek and Vietnamese. Inter Tight only has Latin here, so those
   languages set headings in Inter throughout rather than mixing the two. Arabic, Devanagari, Thai, Chinese,
   Japanese and Korean use the device's own fonts (system-ui; <html lang> picks the right one), and drop the
   tight negative tracking, which breaks joined Arabic letters and crowds the others. */
html:is([lang='ru'], [lang='uk'], [lang='el'], [lang='vi']) { --head: 'Inter', system-ui, sans-serif; }
html:is([lang='ar'], [lang='hi'], [lang='th'], [lang='ja'], [lang='ko'], [lang|='zh']) {
  --head: system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', sans-serif;
}
html:is([lang='ar'], [lang='hi'], [lang='th'], [lang='ja'], [lang='ko'], [lang|='zh']) body * { letter-spacing: normal !important; }
html:is([lang='ar'], [lang='hi'], [lang='th'], [lang='ja'], [lang='ko'], [lang|='zh']) :is(h1, h2, .big) { line-height: 1.12; }
/* Scripts with marks above and below need more room inside the clipped reveal lines */
html:is([lang='ar'], [lang='hi'], [lang='th'], [lang='vi']) :is(h1, h2, .big) { line-height: 1.25; }
html:is([lang='ar'], [lang='hi'], [lang='th'], [lang='vi']) .line { padding-block: .1em .14em; margin-bottom: -.14em; }
html[lang='ko'] body { word-break: keep-all; }
html:is([lang='ja'], [lang|='zh']) body { line-break: strict; }
/* Uppercase tracking means nothing without capitals */
html:is([lang='ar'], [lang='hi'], [lang='th'], [lang='ja'], [lang='ko'], [lang|='zh']) .eyebrow { font-size: 14px; }
/* The wordmark stays Latin and left-to-right */
[dir='rtl'] .wordmark { direction: ltr; }

/* Translated privacy policy and terms: the English version is binding */
.binding { margin: 14px 0 0; padding: 12px 16px; border-radius: 14px; background: rgba(20, 18, 24, .05); font-size: 15px; line-height: 1.5; color: var(--ink-2, #57535E); }
/* Long compound words (German, Dutch…) and longer table headings hyphenate or wrap instead of widening the page */
.wrap :is(p, li, h1, h2, h3, address) { overflow-wrap: break-word; hyphens: auto; }
.wrap :is(td, th) { overflow-wrap: anywhere; hyphens: auto; }
