/* ==========================================================================
   Blungie — design system
   Light "paper" pages, deep indigo "night" sections, iris + logo-lime accents.
   English vocabulary always wears the display face (.en-word).
   ========================================================================== */

:root {
  /* surfaces */
  --paper: #fbfaf6;
  --paper-2: #f4f1ea;
  --mist: #f1eefc;
  --card: #ffffff;
  --night: #120f28;
  --night-2: #1b1739;
  --night-3: #262150;

  /* text */
  --ink: #16132d;
  --ink-2: #46435e;
  --ink-3: #67647e; /* ≥4.9:1 on paper, mist and paper-2 (WCAG AA) */
  --on-night: #f6f4ff;
  --on-night-2: #bdb8dc;
  --on-night-3: #8a85ad;

  /* lines */
  --line: rgba(22, 19, 45, 0.1);
  --line-2: rgba(22, 19, 45, 0.16);
  --night-line: rgba(255, 255, 255, 0.12);

  /* brand + accents */
  --iris: #5a45ff;
  --iris-600: #4431e8;
  --iris-700: #3523c4;
  --iris-100: #ebe8ff;
  --iris-50: #f5f3ff;
  --lime: #84d645;
  --leaf: #5faf3a;
  --leaf-700: #37721e; /* 5.3:1 on lime-100 */
  --lime-100: #ecf8e1;
  --coral: #ff6b5b;
  --coral-100: #ffe8e4;
  --sun: #ffc23d;
  --sun-100: #fff3d6;
  --sky: #38b4ef;
  --sky-100: #e1f4fd;
  --rose: #ff7eb6;
  --rose-100: #ffe9f3;

  /* type */
  --font-sans: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-word: "Unbounded", "Onest", system-ui, sans-serif;
  --fs-display: clamp(2.65rem, 1.1rem + 5.4vw, 5.75rem);
  --fs-h1: clamp(2.25rem, 1.35rem + 3.4vw, 4.1rem);
  --fs-h2: clamp(1.85rem, 1.25rem + 2.3vw, 3.15rem);
  --fs-h3: clamp(1.2rem, 1.08rem + 0.55vw, 1.5rem);
  --fs-lead: clamp(1.06rem, 0.98rem + 0.38vw, 1.3rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-xs: 0.8125rem;
  --track-tight: -0.035em;
  --track-head: -0.022em;
  --lh-head: 1.06;

  /* shape + depth */
  --r-xs: 8px;
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --r-xl: 40px;
  --shadow-sm: 0 1px 2px rgba(22, 19, 45, 0.06), 0 2px 8px rgba(22, 19, 45, 0.05);
  --shadow: 0 2px 6px rgba(22, 19, 45, 0.05), 0 14px 40px -12px rgba(22, 19, 45, 0.16);
  --shadow-lg: 0 4px 10px rgba(22, 19, 45, 0.05), 0 30px 80px -24px rgba(22, 19, 45, 0.28);
  --shadow-iris: 0 10px 30px -8px rgba(90, 69, 255, 0.55);

  /* layout */
  --container: 1200px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: clamp(72px, 9vw, 136px);
  --header-h: 72px;

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Script-specific type: no negative tracking outside Latin/Cyrillic, taller lines. */
[data-script="arabic"] { --font-sans: "IBM Plex Sans Arabic", "Onest", system-ui, "Segoe UI", Tahoma, sans-serif; --track-tight: 0; --track-head: 0; --lh-head: 1.25; }
[data-script="devanagari"] { --font-sans: "Noto Sans Devanagari", "Onest", system-ui, "Nirmala UI", sans-serif; --track-tight: 0; --track-head: 0; --lh-head: 1.3; }
[data-script="cjk"] { --track-tight: -0.01em; --track-head: -0.005em; --lh-head: 1.22; }
html[lang="ja"] { --font-sans: "Onest", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans JP", system-ui, sans-serif; }
html[lang="ko"] { --font-sans: "Onest", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif; }
html[lang="zh-Hans"] { --font-sans: "Onest Hans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif; }
[data-script="cjk"] body { line-break: strict; word-break: normal; }
html[lang="ja"] h1, html[lang="ja"] h2, html[lang="zh-Hans"] h1, html[lang="zh-Hans"] h2 { word-break: keep-all; overflow-wrap: anywhere; }
/* Korean breaks between words (eojeol), never inside one; a word longer than its line may still wrap. */
html[lang="ko"] body { word-break: keep-all; overflow-wrap: break-word; }
/* Japanese headings: break between phrases (bunsetsu) where supported, instead of anywhere in a clause. */
@supports (word-break: auto-phrase) {
  html[lang="ja"] :is(h1, h2, h3, summary, .hq__qt) { word-break: auto-phrase; }
}
/* German/Russian: a compound longer than its line wraps instead of overflowing (safety net only). */
:is(html[lang="de"], html[lang="ru"]) :is(h1, h2, h3, summary) { overflow-wrap: break-word; }
/* English sentences inside RTL pages keep their punctuation on the right side. */
[dir="rtl"] :is(p, span, li, ol, ul)[lang="en"]:not([dir]) { direction: ltr; unicode-bidi: isolate; }

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video, canvas, picture { display: block; max-width: 100%; }
img { height: auto; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
h1, h2, h3, h4 { line-height: var(--lh-head); letter-spacing: var(--track-head); font-weight: 700; text-wrap: balance; }
p, li { text-wrap: pretty; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
::selection { background: var(--iris); color: #fff; }
:focus-visible { outline: 3px solid var(--iris); outline-offset: 3px; border-radius: 6px; }
main:focus { outline: none; }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: 12px; inset-inline-start: 12px; z-index: 100;
  padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600;
  transform: translateY(-160%); transition: transform 0.2s var(--ease-out);
}
.skip-link:focus { transform: none; }

/* ---------- layout ---------- */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: calc(820px + var(--gutter) * 2); }
.container--wide { max-width: calc(1360px + var(--gutter) * 2); }
.section { position: relative; padding-block: var(--section); }
.section--tight { padding-block: calc(var(--section) * 0.6); }
.section--mist { background: var(--mist); }
.section--paper2 { background: var(--paper-2); }
.section--night { background: var(--night); color: var(--on-night); }
.section--night .lead, .section--night .muted { color: var(--on-night-2); }
.section--round { border-radius: var(--r-xl); margin-inline: clamp(8px, 1.5vw, 20px); }
.section-head { max-width: 760px; margin-bottom: clamp(36px, 5vw, 64px); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head .lead { margin-top: 18px; }
.stack > * + * { margin-top: var(--stack, 16px); }
.grid { display: grid; gap: clamp(16px, 2vw, 24px); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- type ---------- */
.display { font-size: var(--fs-display); letter-spacing: var(--track-tight); line-height: 0.98; font-weight: 750; }
[data-script="arabic"] .display, [data-script="devanagari"] .display { line-height: 1.2; }
[data-script="cjk"] .display { line-height: 1.12; font-size: calc(var(--fs-display) * 0.86); }
.h1 { font-size: var(--fs-h1); letter-spacing: var(--track-tight); font-weight: 750; }
.h2 { font-size: var(--fs-h2); font-weight: 720; }
.h3 { font-size: var(--fs-h3); font-weight: 650; letter-spacing: -0.012em; line-height: 1.25; }
[data-script="cjk"] .h1 { font-size: calc(var(--fs-h1) * 0.9); }
[data-script="cjk"] .h2 { font-size: calc(var(--fs-h2) * 0.9); }
.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--ink-2); max-width: 62ch; text-wrap: pretty; }
.muted { color: var(--ink-3); }
.small { font-size: var(--fs-small); }
.xs { font-size: var(--fs-xs); }
.center { text-align: center; }
.balance { text-wrap: balance; }
.en-word { font-family: var(--font-word); font-weight: 600; letter-spacing: -0.02em; direction: ltr; unicode-bidi: isolate; }
.hl { position: relative; white-space: nowrap; color: var(--iris); }
.section--night .hl { color: var(--lime); }
.hl-marker {
  background: linear-gradient(transparent 62%, color-mix(in srgb, var(--sun) 65%, transparent) 62%, color-mix(in srgb, var(--sun) 65%, transparent) 92%, transparent 92%);
  padding-inline: 0.06em; border-radius: 4px;
}
.gradient-text {
  background: linear-gradient(100deg, var(--iris) 0%, #8a5bff 38%, var(--rose) 72%, var(--sun) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 10px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.02em; color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.eyebrow .icon { color: var(--iris); }
.eyebrow__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px var(--lime-100); }
.section--night .eyebrow { background: rgba(255, 255, 255, 0.06); border-color: var(--night-line); color: var(--on-night-2); box-shadow: none; }
.section--night .eyebrow .icon { color: var(--lime); }
.kicker { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--iris); }
[data-script="arabic"] .kicker, [data-script="cjk"] .kicker, [data-script="devanagari"] .kicker,
[data-script="arabic"] .mobile-nav__label, [data-script="cjk"] .mobile-nav__label, [data-script="devanagari"] .mobile-nav__label { letter-spacing: 0.02em; text-transform: none; }
.section--night .kicker { color: var(--lime); }

/* ---------- buttons ---------- */
.btn {
  --btn-h: 48px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--btn-h); padding: 0 22px; border-radius: 999px;
  font-weight: 650; font-size: 1rem; line-height: 1.1; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; isolation: isolate;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out), background-color 0.25s, color 0.25s, border-color 0.25s;
}
.btn .icon { flex: none; transition: transform 0.35s var(--ease-out); }
.btn:hover .icon-end, .btn:hover > .icon:last-child:not(:first-child) { transform: translateX(3px); }
[dir="rtl"] .btn .icon-flip { transform: scaleX(-1); }
[dir="rtl"] .btn:hover .icon-flip { transform: scaleX(-1) translateX(3px); }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn--sm { --btn-h: 40px; padding: 0 16px; font-size: 0.9375rem; }
.btn--md { --btn-h: 48px; }
.btn--lg { --btn-h: 58px; padding: 0 28px; font-size: 1.0625rem; }
.btn--primary { background: var(--iris); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), var(--shadow-iris); }
.btn--primary:hover { background: var(--iris-600); transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 16px 36px -10px rgba(90, 69, 255, 0.65); }
.btn--ink { background: var(--ink); color: #fff; }
.btn--ink:hover { background: #2a2650; transform: translateY(-2px); }
.btn--light { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.btn--light:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn--ghost { border-color: var(--line-2); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); background: rgba(22, 19, 45, 0.03); }
.section--night .btn--ghost, .on-night .btn--ghost { border-color: var(--night-line); color: var(--on-night); }
.section--night .btn--ghost:hover, .on-night .btn--ghost:hover { border-color: rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.05); }
.btn--lime { background: var(--lime); color: #11240a; }
.btn--lime:hover { background: #95e25b; transform: translateY(-2px); }
.btn--soon { gap: 12px; }
.soon-dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--lime); flex: none; }
.soon-dot::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--lime); opacity: 0; animation: soon-ping 2.2s var(--ease-out) infinite; }
@keyframes soon-ping { 0% { transform: scale(0.4); opacity: 0.9; } 80%, 100% { transform: scale(1.5); opacity: 0; } }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.text-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; color: var(--iris); text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.text-link .icon { transition: transform 0.3s var(--ease-out); }
.text-link:hover .icon { transform: translateX(3px); }
[dir="rtl"] .text-link .icon { transform: scaleX(-1); }
[dir="rtl"] .text-link:hover .icon { transform: scaleX(-1) translateX(3px); }

/* ---------- cards + chips ---------- */
.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: clamp(22px, 2.6vw, 32px); box-shadow: var(--shadow-sm);
}
.card--hover { transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out), border-color 0.3s; }
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.section--night .card { background: var(--night-2); border-color: var(--night-line); box-shadow: none; color: var(--on-night); }
.icon-tile {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  background: var(--iris-100); color: var(--iris-600);
}
.icon-tile--lime { background: var(--lime-100); color: var(--leaf-700); }
.icon-tile--coral { background: var(--coral-100); color: #d43c2c; }
.icon-tile--sun { background: var(--sun-100); color: #a86d00; }
.icon-tile--sky { background: var(--sky-100); color: #087fb6; }
.icon-tile--rose { background: var(--rose-100); color: #c8317a; }
.section--night .icon-tile { background: rgba(255, 255, 255, 0.08); color: var(--lime); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); font-size: var(--fs-small); font-weight: 550; color: var(--ink-2);
}
.chip--iris { background: var(--iris-100); border-color: transparent; color: var(--iris-700); }
.chip--lime { background: var(--lime-100); border-color: transparent; color: var(--leaf-700); }
.tag { display: inline-block; padding: 3px 9px; border-radius: 6px; background: var(--iris-50); color: var(--iris-700); font-size: var(--fs-xs); font-weight: 650; letter-spacing: 0.02em; }

/* ---------- phone (shared device frame) ---------- */
.phone {
  --pw: 300px;
  position: relative; width: var(--pw); aspect-ratio: 9 / 19.2; flex: none;
  border-radius: calc(var(--pw) * 0.15); padding: calc(var(--pw) * 0.032);
  background: linear-gradient(145deg, #2c2a3a, #0d0c14 60%, #23212f);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.12), inset 0 0 0 calc(var(--pw) * 0.012) #050409, 0 50px 100px -30px rgba(22, 19, 45, 0.55), 0 30px 60px -30px rgba(90, 69, 255, 0.35);
}
.phone__screen {
  position: relative; width: 100%; height: 100%; overflow: hidden; isolation: isolate;
  border-radius: calc(var(--pw) * 0.12); background: #111a16; color: #f5f7ef;
}
.phone__island {
  position: absolute; top: calc(var(--pw) * 0.045); left: 50%; translate: -50% 0; z-index: 5;
  width: 30%; height: calc(var(--pw) * 0.085); border-radius: 999px; background: #000;
}
.phone::before { /* side buttons */
  content: ""; position: absolute; inset-inline-end: -3px; top: 22%; width: 3px; height: 14%; border-radius: 2px; background: #1a1925;
}

/* ---------- app card (replica of the app's dark feed card) ---------- */
.app-card { display: flex; flex-direction: column; height: 100%; background: #111a16; color: #f5f7ef; font-family: var(--font-sans); }
.app-card__art { position: relative; flex: 0 0 55%; overflow: hidden; }
.app-card__art img { width: 100%; height: 100%; object-fit: cover; }
.app-card__body { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.app-card__word { display: flex; align-items: center; gap: 8px; }
.app-card__word .en-word { font-size: 1.45rem; color: #fff; }
.app-card__level { margin-inline-start: auto; padding: 2px 8px; border-radius: 999px; background: #1f3a1b; color: #95e85e; font-size: 0.7rem; font-weight: 700; }
.app-card__meaning { font-size: 1rem; font-weight: 650; color: #95e85e; line-height: 1.3; }
.app-card__ctx { font-size: 0.82rem; color: #f5f7ef; line-height: 1.4; margin-top: 2px; }
.app-card__tr { font-size: 0.78rem; color: #a4b4a8; line-height: 1.4; }
.app-card__add { margin-top: auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: 999px; background: #7ddd43; color: #0e1a0d; font-weight: 700; font-size: 0.82rem; }

/* audio button */
.audio-btn {
  position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%;
  background: var(--iris-100); color: var(--iris-700); transition: transform 0.25s var(--ease-spring), background-color 0.2s;
}
.audio-btn:hover { transform: scale(1.08); }
.audio-btn--app { width: 30px; height: 30px; background: #243429; color: #95e85e; }
.audio-btn__wave { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 2px; }
.audio-btn__wave i { width: 3px; height: 10px; border-radius: 2px; background: currentColor; animation: wave 0.9s ease-in-out infinite; }
.audio-btn__wave i:nth-child(2) { animation-delay: 0.15s; } .audio-btn__wave i:nth-child(3) { animation-delay: 0.3s; }
.audio-btn.is-playing .icon { opacity: 0; }
.audio-btn.is-playing .audio-btn__wave { display: flex; }
@keyframes wave { 0%, 100% { transform: scaleY(0.4); } 50% { transform: scaleY(1.2); } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  transition: background-color 0.35s, box-shadow 0.35s, color 0.35s, backdrop-filter 0.35s;
}
.site-header__inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.site-header__brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); margin-inline-end: auto; }
.site-header.is-scrolled, .site-header.is-open {
  background: rgba(251, 250, 246, 0.82); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  box-shadow: 0 1px 0 var(--line);
}
.logo { display: inline-flex; align-items: center; gap: 9px; direction: ltr; }
.logo__mark { width: auto; height: 30px; }
.logo__word { width: auto; height: 22px; color: var(--ink); }
.logo--light .logo__word { color: #fff; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav__link {
  position: relative; padding: 9px 14px; border-radius: 999px; font-weight: 550; font-size: 0.97rem; text-decoration: none; color: var(--ink-2);
  transition: color 0.2s, background-color 0.2s;
}
.nav__link:hover { color: var(--ink); background: rgba(22, 19, 45, 0.05); }
.nav__link[aria-current="page"] { color: var(--ink); }
.nav__link[aria-current="page"]::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; border-radius: 50%; translate: -50% 0; background: var(--iris); }
.site-header__actions { display: flex; align-items: center; gap: 10px; }

/* dark hero pages: light header until it scrolls */
.has-dark-hero .site-header:not(.is-scrolled):not(.is-open) .logo__word { color: #fff; }
.has-dark-hero .site-header:not(.is-scrolled):not(.is-open) .nav__link { color: rgba(255, 255, 255, 0.78); }
.has-dark-hero .site-header:not(.is-scrolled):not(.is-open) .nav__link:hover,
.has-dark-hero .site-header:not(.is-scrolled):not(.is-open) .nav__link[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, 0.08); }
.has-dark-hero .site-header:not(.is-scrolled):not(.is-open) .lang__button { color: #fff; border-color: rgba(255, 255, 255, 0.2); }
.has-dark-hero .site-header:not(.is-scrolled):not(.is-open) .menu-toggle { color: #fff; border-color: rgba(255, 255, 255, 0.2); }
.has-dark-hero .site-header { margin-bottom: calc(var(--header-h) * -1); }

/* language picker */
.lang { position: relative; }
.lang__button {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); font-weight: 600; font-size: 0.875rem; color: var(--ink);
  transition: border-color 0.2s, background-color 0.2s;
}
.lang__button:hover { border-color: var(--ink-3); }
.lang__chev { transition: transform 0.3s var(--ease-out); }
.lang__button[aria-expanded="true"] .lang__chev { transform: rotate(180deg); }
.lang__menu {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0; z-index: 60; width: 360px; max-width: calc(100vw - 32px);
  padding: 10px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  animation: pop-in 0.28s var(--ease-out);
}
.lang__list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.lang__list a, .mobile-nav__lang-grid a {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 10px;
  text-decoration: none; font-weight: 550; font-size: 0.95rem; color: var(--ink-2);
}
.lang__list a:hover { background: var(--mist); color: var(--ink); }
.lang__list a[aria-current="true"], .mobile-nav__lang-grid a[aria-current="true"] { background: var(--iris-100); color: var(--iris-700); }
.lang__list a[aria-current="true"]::after, .mobile-nav__lang-grid a[aria-current="true"]::after { content: "✓"; font-weight: 700; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(0.98); } to { opacity: 1; transform: none; } }

/* mobile menu */
.menu-toggle { display: none; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-2); place-items: center; color: var(--ink); }
.menu-toggle__bars { display: grid; gap: 4px; width: 18px; }
.menu-toggle__bars span { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform 0.35s var(--ease-out), opacity 0.2s; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.mobile-nav {
  position: fixed; inset: var(--header-h) 0 0; z-index: 49; overflow-y: auto; overscroll-behavior: contain;
  background: rgba(251, 250, 246, 0.97); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  animation: fade-in 0.25s ease;
}
.mobile-nav__panel { padding-block: 20px 48px; }
.mobile-nav__links { display: grid; }
.mobile-nav__links a {
  padding: 16px 4px; border-bottom: 1px solid var(--line); font-size: 1.5rem; font-weight: 650; letter-spacing: -0.02em; text-decoration: none;
  animation: slide-up 0.5s var(--ease-out) both;
}
.mobile-nav__links a:nth-child(2) { animation-delay: 40ms; } .mobile-nav__links a:nth-child(3) { animation-delay: 80ms; }
.mobile-nav__links a:nth-child(4) { animation-delay: 120ms; } .mobile-nav__links a:nth-child(5) { animation-delay: 160ms; }
.mobile-nav__links a[aria-current="page"] { color: var(--iris); }
.mobile-nav__langs { margin-top: 28px; }
.mobile-nav__label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.mobile-nav__lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
body.menu-open { overflow: hidden; }

@media (max-width: 900px) {
  .nav, .site-header__cta { display: none; }
  .menu-toggle { display: inline-grid; }
  .site-header .lang { display: none; }
}

/* ---------- footer ---------- */
.site-footer { background: var(--night); color: var(--on-night-2); padding-block: clamp(56px, 7vw, 96px) 32px; margin-top: 0; }
.footer__top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.9fr); gap: clamp(40px, 6vw, 96px); }
.footer__brand .logo__mark { height: 34px; }
.footer__brand .logo__word { height: 25px; }
.footer__tagline { margin: 18px 0 24px; max-width: 34ch; font-size: 1.05rem; color: var(--on-night-2); }
.footer__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.footer__title { color: #fff; font-weight: 650; margin-bottom: 14px; }
.footer__col li + li { margin-top: 10px; }
.footer__col a { text-decoration: none; color: var(--on-night-2); transition: color 0.2s; overflow-wrap: anywhere; }
.footer__col a:hover { color: #fff; }
.footer__bottom {
  display: flex; flex-wrap: wrap; gap: 8px 28px; justify-content: space-between; align-items: center;
  margin-top: clamp(48px, 6vw, 80px); padding-top: 24px; border-top: 1px solid var(--night-line); font-size: var(--fs-small); color: var(--on-night-3);
}
.footer__small { font-size: var(--fs-xs); flex: 1 1 320px; }
.footer__mail { color: var(--on-night-2); }
.site-footer .btn--light { background: rgba(255, 255, 255, 0.08); color: #fff; border-color: var(--night-line); box-shadow: none; }
.site-footer .btn--light:hover { background: rgba(255, 255, 255, 0.14); }
@media (max-width: 820px) {
  .footer__top { grid-template-columns: 1fr; }
  .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- FAQ accordion ---------- */
.faq { display: grid; gap: 12px; }
.faq__item { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); transition: border-color 0.3s, box-shadow 0.3s; }
.faq__item[open] { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.faq__item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px;
  font-weight: 650; font-size: 1.06rem; cursor: pointer; list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__icon { position: relative; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--mist); }
.faq__icon::before, .faq__icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; border-radius: 2px; background: var(--ink); translate: -50% -50%; transition: transform 0.35s var(--ease-out); }
.faq__icon::after { transform: rotate(90deg); }
.faq__item[open] .faq__icon { background: var(--iris); }
.faq__item[open] .faq__icon::before, .faq__item[open] .faq__icon::after { background: #fff; }
.faq__item[open] .faq__icon::after { transform: rotate(0deg); }
.faq__body { padding: 0 22px 22px; color: var(--ink-2); }
.faq__body > * + * { margin-top: 10px; }
.js .faq__body { animation: faq-open 0.4s var(--ease-out); }
@keyframes faq-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- forms ---------- */
.field { display: grid; gap: 8px; }
.field label { font-weight: 600; font-size: var(--fs-small); }
.input, .textarea, .select {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.textarea { min-height: 140px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--iris); box-shadow: 0 0 0 4px var(--iris-100); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-small); color: var(--ink-2); }
.check input { width: 20px; height: 20px; accent-color: var(--iris); margin-top: 2px; flex: none; }

/* ---------- notices ---------- */
.notice { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: var(--r); background: var(--iris-50); border: 1px solid var(--iris-100); color: var(--ink-2); }
.notice .icon { color: var(--iris); flex: none; margin-top: 2px; }
.notice--lime { background: var(--lime-100); border-color: #d6efc0; }
.notice--lime .icon { color: var(--leaf-700); }
.notice--sun { background: var(--sun-100); border-color: #ffe5a3; }
.notice--sun .icon { color: #a86d00; }

/* ---------- page hero (inner pages) ---------- */
.page-hero { position: relative; padding-block: clamp(56px, 8vw, 112px) clamp(40px, 6vw, 80px); overflow: hidden; }
.page-hero .lead { margin-top: 20px; }
.page-hero__glow {
  position: absolute; inset: -40% -10% auto; height: 120%; z-index: -1; pointer-events: none;
  background: radial-gradient(40% 50% at 20% 30%, rgba(90, 69, 255, 0.14), transparent 70%), radial-gradient(35% 45% at 80% 20%, rgba(132, 214, 69, 0.16), transparent 70%), radial-gradient(30% 40% at 60% 70%, rgba(255, 126, 182, 0.1), transparent 70%);
}

/* ---------- reveal on scroll ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); transition-delay: var(--d, 0ms); }
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal="scale"] { transform: scale(0.94); }
.js [data-reveal="left"] { transform: translateX(-32px); }
.js [data-reveal="right"] { transform: translateX(32px); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- marquee ---------- */
.marquee { --gap: 14px; --speed: 40s; display: flex; overflow: hidden; gap: var(--gap); user-select: none; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; flex: none; gap: var(--gap); min-width: 100%; justify-content: space-around; animation: marquee var(--speed) linear infinite; }
.marquee--reverse .marquee__track { animation-direction: reverse; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-100% - var(--gap))); } }
[dir="rtl"] .marquee__track { animation-name: marquee-rtl; }
@keyframes marquee-rtl { to { transform: translateX(calc(100% + var(--gap))); } }

/* ---------- legal / long-form prose ---------- */
.prose { color: var(--ink-2); font-size: 1.0625rem; line-height: 1.75; }
.prose > * + * { margin-top: 1em; }
.prose h2 { color: var(--ink); font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.85rem); margin-top: 2.4em; scroll-margin-top: calc(var(--header-h) + 24px); }
.prose h3 { color: var(--ink); font-size: 1.2rem; margin-top: 1.8em; }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--iris); }
.prose a { color: var(--iris-600); font-weight: 550; }
.prose strong { color: var(--ink); font-weight: 650; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.97rem; margin-block: 1.4em; }
.prose th, .prose td { text-align: start; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--ink); font-weight: 650; background: var(--mist); }
.prose .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.prose .table-wrap table { margin: 0; }
.prose code { font-size: 0.9em; padding: 2px 6px; border-radius: 6px; background: var(--mist); color: var(--ink); }

/* ---------- utilities ---------- */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; } .mt-5 { margin-top: 48px; } .mt-6 { margin-top: 64px; }
.nowrap { white-space: nowrap; }
.flip-rtl { }
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
}
