/* ───────────── Fonts ───────────── */
@font-face {
  font-family: 'Bricolage';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  src: url(/fonts/bricolage-grotesque-vietnamese-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Bricolage';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  src: url(/fonts/bricolage-grotesque-latin-ext-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  font-stretch: 75% 100%;
  src: url(/fonts/bricolage-grotesque-latin-standard-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ───────────── Tokens ───────────── */
:root {
  --paper: #f3f2fb;
  --surface: #ffffff;
  --ink: #1c1a3a;
  --ink-2: #5d5a82;
  --ink-3: #8c89ad;
  --line: #e2e0f0;
  --line-2: #d3d0e8;

  --brand: #5b3df5;
  --brand-deep: #3f23c9;
  --brand-soft: #ece8ff;
  --brand-text: #4a2fe0;

  --ember: #ff7a1a;
  --ember-deep: #d85d00;
  --ember-soft: #ffeedd;
  --jade: #12a971;
  --jade-deep: #0b8457;
  --jade-soft: #dcf6ea;
  --honey: #f6b500;
  --honey-deep: #c98f00;
  --honey-soft: #fff3cc;
  --coral: #f0436b;
  --coral-deep: #c42450;
  --coral-soft: #ffe3ea;
  --ice: #4aa8ff;
  --ice-soft: #e0f0ff;

  --night: #131129;
  --night-2: #1f1b46;
  --night-3: #2c2763;
  --on-night: #f4f2ff;
  --on-night-2: #b9b4de;
  --sun: #ffd35c;
  --sun-deep: #d9a521;

  --dot-new: #e2e0f0;
  --dot-learning: #f6c443;
  --dot-known: #a698ff;
  --dot-mastered: #5b3df5;
  --ring: #5b3df5;
  --focus: #5b3df5;

  --font: 'Bricolage', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --gutter: 20px;
  --tab-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --night: #0c0a1f;
    --night-2: #1a1640;
    --night-3: #28225c;
    --paper: #131129;
    --surface: #1d1a3b;
    --ink: #f1efff;
    --ink-2: #b2aed6;
    --ink-3: #847fb0;
    --line: #2f2a59;
    --line-2: #3b356b;
    --brand: #7b63ff;
    --brand-deep: #5137e6;
    --brand-soft: #2a2366;
    --brand-text: #b3a6ff;
    --ember-soft: #3a2513;
    --jade-soft: #11352a;
    --honey-soft: #3a3013;
    --coral-soft: #3d1624;
    --ice-soft: #142c45;
    --dot-new: #2c2856;
    --dot-learning: #f0b92e;
    --dot-known: #8b7bff;
    --dot-mastered: #c9bfff;
    --ring: #8b7bff;
    --focus: #b3a6ff;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --night: #0c0a1f;
  --night-2: #1a1640;
  --night-3: #28225c;
  --paper: #131129;
  --surface: #1d1a3b;
  --ink: #f1efff;
  --ink-2: #b2aed6;
  --ink-3: #847fb0;
  --line: #2f2a59;
  --line-2: #3b356b;
  --brand: #7b63ff;
  --brand-deep: #5137e6;
  --brand-soft: #2a2366;
  --brand-text: #b3a6ff;
  --ember-soft: #3a2513;
  --jade-soft: #11352a;
  --honey-soft: #3a3013;
  --coral-soft: #3d1624;
  --ice-soft: #142c45;
  --dot-new: #2c2856;
  --dot-learning: #f0b92e;
  --dot-known: #8b7bff;
  --dot-mastered: #c9bfff;
  --ring: #8b7bff;
  --focus: #b3a6ff;
  color-scheme: dark;
}


/* ───────────── Site base ───────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 450 17px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand-text); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
main { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3 { line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(40px, 7vw, 72px); font-weight: 800; font-stretch: 84%; letter-spacing: -0.03em; margin: 0; }
h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; font-stretch: 86%; margin: 0 0 20px; }
h3 { font-size: 20px; font-weight: 740; margin: 18px 0 6px; }
p { max-width: 68ch; }
.lede { font-size: clamp(18px, 2.2vw, 21px); color: var(--ink-2); margin: 18px 0 0; }
.fine { font-size: 14px; color: var(--ink-3); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 20px; border-radius: 16px; font-weight: 700; font-size: 17px; text-decoration: none; border: 0; transition: transform .08s, box-shadow .08s; }
.btn-lg { min-height: 58px; padding: 14px 26px; font-size: 18px; }
.btn-sm { min-height: 42px; padding: 8px 16px; font-size: 15px; border-radius: 13px; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 4px 0 var(--brand-deep); }
.btn-secondary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 var(--line); }
.btn-primary:active, .btn-secondary:active { transform: translateY(4px); box-shadow: none; }

.nav { max-width: 1080px; margin: 0 auto; padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 780; font-size: 20px; font-stretch: 90%; }

/* Landing */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding: 48px 0 72px; }
.hero-cta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.lang-pills { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lang-pills a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border: 2px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 640; font-size: 15px; }
.lang-pills a:hover { border-color: var(--brand); }
.hero-field { margin: 0; }
.hero-field canvas { display: block; width: 100%; }
.hero-field figcaption { margin-top: 14px; color: var(--ink-3); font-size: 14.5px; }

.how { padding: 56px 0; border-top: 2px solid var(--line); }
.how-steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: s; }
.how-steps li { counter-increment: s; }
.how-steps img { display: block; width: 100%; height: auto; max-width: 300px; border-radius: 30px; border: 2px solid var(--line); box-shadow: 0 8px 0 var(--line); background: var(--surface); }
.how-steps h3::before { content: counter(s); display: inline-grid; place-items: center; width: 30px; height: 30px; margin-right: 10px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 15px; vertical-align: 2px; }
.how-steps p { color: var(--ink-2); margin: 0; }

.langs { padding: 56px 0; border-top: 2px solid var(--line); }
.lang-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.lang-card { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; padding: 16px 18px; border: 2px solid var(--line); border-radius: 20px; background: var(--surface); text-decoration: none; color: var(--ink); box-shadow: 0 4px 0 var(--line); height: 100%; }
a.lang-card:hover { border-color: var(--brand); box-shadow: 0 4px 0 var(--brand-deep); }
.lang-card.is-soon { opacity: .55; box-shadow: none; }
.lc-flag { grid-row: span 2; font-size: 34px; line-height: 1; align-self: center; }
.lc-name { font-weight: 760; font-size: 19px; }
.lc-words { color: var(--ink-2); font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.why { padding: 56px 0; border-top: 2px solid var(--line); }
.features { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 28px; }
.features li { color: var(--ink-2); max-width: 46ch; }
.features strong { color: var(--ink); display: block; font-size: 19px; }

.faq { padding: 56px 0; border-top: 2px solid var(--line); max-width: 760px; }
.faq details { border-bottom: 2px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 720; font-size: 19px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--brand); font-weight: 800; font-size: 24px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { color: var(--ink-2); margin: 10px 0 0; }

.cta-end { padding: 64px 0 80px; border-top: 2px solid var(--line); text-align: center; }
.cta-end h2 { max-width: 18ch; margin: 0 auto 24px; }

.foot { border-top: 2px solid var(--line); background: var(--surface); }
.foot-inner { max-width: 1080px; margin: 0 auto; padding: 32px 20px 40px; }
.foot ul { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.foot p { color: var(--ink-2); font-size: 15px; margin: 6px 0; }

/* Language pages */
.lp-hero { padding: 36px 0 28px; max-width: 820px; }
.crumbs { margin: 0 0 14px; color: var(--ink-3); font-size: 15px; }
.crumbs a { color: var(--ink-2); }
.lp-hero h1 { font-size: clamp(36px, 6vw, 60px); }
.lp-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.jump { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 10px 20px; margin: 0 -20px; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 2px solid var(--line); scrollbar-width: none; }
.jump a { flex: none; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 2px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 640; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.wl { padding: 36px 0 8px; scroll-margin-top: 60px; }
.table-wrap { border: 2px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 16px; }
th { text-align: left; font-size: 14px; color: var(--ink-3); font-weight: 650; padding: 12px 14px; border-bottom: 2px solid var(--line); background: var(--paper); }
td { padding: 10px 14px; border-top: 1.5px solid var(--line); vertical-align: top; }
tbody tr:first-child td { border-top: 0; }
.t-rank { color: var(--ink-3); font-variant-numeric: tabular-nums; width: 3.5em; font-size: 14px; padding-top: 16px; }
.t-word { font-weight: 740; font-size: 19px; white-space: nowrap; }
.t-word small, .t-ex small { display: block; font-weight: 450; font-size: 14px; color: var(--ink-2); white-space: normal; }
.t-word small { margin-left: 40px; }
.t-mean em { font-style: normal; font-weight: 740; color: var(--brand-text); background: var(--brand-soft); border-radius: 6px; padding: 0 5px; font-size: 14px; }
.t-ex { color: var(--ink); }
.say { width: 36px; height: 36px; margin-right: 8px; border-radius: 50%; border: 0; background: var(--brand-soft); color: var(--brand-text); display: inline-grid; place-items: center; vertical-align: -8px; cursor: pointer; transition: transform .08s; }
.say:active { transform: scale(.92); }
.say.is-playing { background: var(--brand); border-color: var(--brand); color: #fff; }
.inline-cta { margin: 24px 0 0; padding: 20px 22px; border-radius: 22px; background: var(--brand-soft); display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.inline-cta p { margin: 0; color: var(--ink-2); max-width: 52ch; }
.inline-cta strong { color: var(--ink); }
.notes { padding: 48px 0 8px; max-width: 760px; }
.notes p { color: var(--ink-2); margin: 0 0 8px; }
.other { padding: 40px 0 64px; border-top: 2px solid var(--line); }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 24px; }
  .how-steps { grid-template-columns: 1fr; }
  .how-steps img { max-width: 260px; }
  .features { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .t-ex { display: none; }
  th:last-child { display: none; }
  .t-word { white-space: normal; }
  td { padding: 10px; }
}

/* Phrasebooks: links on the language page, and the topic pages */
.phrasebooks { padding: 48px 0 8px; }
.pb-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.pb-card { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 16px 18px; border: 2px solid var(--line); border-radius: 20px; background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: 0 4px 0 var(--line); }
.pb-card strong { font-size: 19px; }
.pb-card span { color: var(--ink-2); font-size: 15px; }
.pb-card small { color: var(--ink-3); font-size: 14px; margin-top: auto; }
.wl-desc { margin: -6px 0 14px; color: var(--ink-2); }
.t-full { color: var(--ink); font-weight: 640; }
.t-mean small, .t-ex small { display: block; color: var(--ink-2); font-size: 14px; margin-top: 2px; }
.pill-18 { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--line); color: var(--ink-2); font-size: 14px; vertical-align: middle; }
/* Topic pages on phones: the example goes under the meaning, what an abbreviation stands for under it */
.t-full-m, .t-ex-m { display: none; }
@media (max-width: 640px) {
  .topic-seo .t-full, .is-abbr th:nth-child(3) { display: none; }
  .topic-seo .t-full-m { display: block; margin-left: 40px; font-weight: 600; }
  .topic-seo .t-ex-m { display: block; margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: var(--paper); font-size: 15px; }
  .topic-seo .t-word span { white-space: nowrap; }
}

/* Guides (articles) */
.article { max-width: 760px; margin: 0 auto; padding-bottom: 40px; }
.art-head { padding: 36px 0 8px; }
.art-head h1 { font-size: clamp(34px, 5.4vw, 54px); line-height: 1.05; text-wrap: balance; margin: 6px 0 12px; }
.art-meta { color: var(--ink-2); font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.art-meta svg { vertical-align: -3px; color: var(--brand); }
.art-warn { margin: 12px 0 0; padding: 10px 14px; border-radius: 14px; background: var(--brand-soft); color: var(--ink); font-size: 15px; }
.prose { font-size: 18px; line-height: 1.65; }
.prose p { margin: 0 0 14px; }
.prose ul { margin: 0 0 14px; padding-left: 22px; }
.prose a, .art-tip a { color: var(--brand); text-underline-offset: 3px; }
.art-intro { margin-top: 12px; }
.toc { margin: 26px 0 6px; padding: 18px 22px; border: 2px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 4px 0 var(--line); }
.toc p { margin: 0 0 8px; font-weight: 760; }
.toc ol { margin: 0; padding-left: 22px; columns: 2 240px; column-gap: 28px; }
.toc li { margin: 3px 0; break-inside: avoid; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--brand); text-decoration: underline; }
.art-sec { padding-top: 34px; scroll-margin-top: 70px; }
.art-sec h2 { font-size: clamp(26px, 3.6vw, 34px); text-wrap: balance; margin: 0 0 12px; }
.ph-table td { vertical-align: top; }
.ph-table .t-word { min-width: 0; }
.say.is-rec { color: var(--brand); }
.art-tip { margin: 16px 0 0; padding: 14px 18px; border-radius: 18px; background: var(--honey-soft); color: var(--ink); font-size: 16px; line-height: 1.55; }
.tip-h { display: inline-block; margin-right: 6px; padding: 1px 10px; border-radius: 999px; background: var(--sun); color: #1c1a3a; font-size: 13.5px; font-weight: 760; vertical-align: 1px; }
.article .inline-cta { margin-top: 30px; }
.article .faq { padding-top: 40px; margin-top: 40px; }
.art-end { margin: 40px 0 10px; padding: 26px 24px; border-radius: 24px; background: var(--brand-soft); }
.art-end h2 { margin: 0 0 8px; font-size: 26px; }
.art-end p { margin: 0 0 16px; color: var(--ink-2); }
.guides-page .lead { font-size: 20px; color: var(--ink-2); max-width: 60ch; }
.ph-table th:last-child, .ph-table td:last-child { display: table-cell; }


/* ───────────── Home (Vietnamese first) ───────────── */
.nav-links { display: flex; gap: 22px; margin-right: auto; margin-left: 18px; }
.nav-links a { color: var(--ink-2); text-decoration: none; font-weight: 650; font-size: 15.5px; white-space: nowrap; }
.nav-links a:hover { color: var(--ink); }
@media (max-width: 760px) {
  .nav { flex-wrap: wrap; row-gap: 6px; }
  .nav-links { order: 3; width: 100%; margin: 0; gap: 18px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; }
}

/* The night band: full width without widening the page (the border image paints past the box). */
.has-band .nav, .band { border-image: conic-gradient(var(--night) 0 0) fill 0 // 0 100vw; color: var(--on-night); }
.has-band .nav .logo { color: var(--on-night); }
.has-band .nav-links a { color: var(--on-night-2); }
.has-band .nav-links a:hover { color: var(--on-night); }
.band .crumbs, .band .crumbs a { color: var(--on-night-2); }
.btn-sun { background: var(--sun); color: #1c1a3a; box-shadow: 0 4px 0 var(--sun-deep); }
.btn-sun:active { transform: translateY(4px); box-shadow: none; }
.btn-ghost { background: transparent; color: var(--on-night); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--on-night) 28%, transparent); }
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--on-night); }

.hero2 { padding: 40px 0 76px; }
.hero2-in { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 56px; align-items: center; }
.hero2 h1 { font-size: clamp(42px, 6.4vw, 76px); font-stretch: 84%; line-height: 1; letter-spacing: -0.022em; }
.hero2 .lede { color: var(--on-night-2); max-width: 44ch; }
.hero2-fine { margin: 18px 0 0; color: var(--on-night-2); font-size: 15px; }

.scene { margin: 0; padding: 18px; border-radius: 30px; background: var(--night-2); box-shadow: inset 0 0 0 1.5px var(--night-3); }
.scene figcaption { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 2px 6px 14px; font-size: 14.5px; color: var(--on-night-2); }
.scene figcaption span:first-child { color: var(--on-night); font-weight: 700; }
.bubbles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bub { display: flex; gap: 12px; align-items: flex-start; max-width: 90%; padding: 11px 16px 12px 11px; border-radius: 22px; }
.bub.is-them { align-self: flex-start; background: var(--night-3); border-bottom-left-radius: 7px; }
.bub.is-you { align-self: flex-end; background: #5b3df5; border-bottom-right-radius: 7px; }
.bub.is-you + .bub.is-you { margin-top: -5px; border-top-right-radius: 7px; }
.bub-text { min-width: 0; }
.bub-vi { display: block; font-weight: 700; font-size: 19px; line-height: 1.3; color: var(--on-night); }
.bub-en { display: block; margin-top: 2px; font-size: 14.5px; line-height: 1.35; color: var(--on-night-2); }
.bub.is-you .bub-en { color: #ddd6ff; }
.bub .say { flex: none; width: 36px; height: 36px; margin: 0; border: 0; background: var(--sun); color: #1c1a3a; vertical-align: 0; }
.bub .say.is-playing { background: #fff; color: #5b3df5; }
@media (prefers-reduced-motion: no-preference) {
  .bub { animation: bub-in .45s cubic-bezier(.2, .8, .3, 1.2) both; animation-delay: calc(var(--i) * .55s + .3s); }
  @keyframes bub-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
}

.stats ul { list-style: none; margin: 0; padding: 30px 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats li { display: flex; flex-direction: column; gap: 4px; padding: 0 20px; border-left: 2px solid var(--line); }
.stats li:first-child { padding-left: 0; border-left: 0; }
.stats strong { font-size: clamp(30px, 3.6vw, 40px); font-weight: 800; font-stretch: 86%; line-height: 1; color: var(--brand-text); font-variant-numeric: tabular-nums; }
.stats span { color: var(--ink-2); font-size: 15px; line-height: 1.35; }

.pb2, .guides2, .plans2, .langs2 { padding: 56px 0; border-top: 2px solid var(--line); }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 24px; }
.sec-head h2 { margin: 0; }
.sec-head p { margin: 0; color: var(--ink-2); }
.sec-head a { font-weight: 700; color: var(--brand-text); }

.pb2-grid, .guides2-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.pb2-card { position: relative; display: flex; flex-direction: column; gap: 12px; height: 100%; padding: 18px; border: 2px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 4px 0 var(--line); }
.pb2-card:hover { border-color: var(--brand); box-shadow: 0 4px 0 var(--brand-deep); }
.pb2-link { display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-decoration: none; }
.pb2-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.pb2-name { font-size: 20px; font-weight: 760; line-height: 1.2; }
.pb2-name small { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--coral-soft); color: var(--coral-deep); font-size: 13px; font-weight: 720; vertical-align: 2px; }
.pb2-desc { color: var(--ink-2); font-size: 15px; }
.pb2-line { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border-radius: 14px; background: var(--paper); }
.pb2-line .say { flex: none; margin: 0; }
.pb2-line > span { min-width: 0; }
.pb2-line span[lang] { display: block; font-weight: 720; font-size: 17px; line-height: 1.3; }
.pb2-line small { display: block; color: var(--ink-2); font-size: 14px; line-height: 1.35; }
.pb2-line.is-hidden { color: var(--ink-3); font-size: 14.5px; }
.pb2-n { margin-top: auto; color: var(--ink-3); font-size: 14px; font-variant-numeric: tabular-nums; }

.g2-card { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px 20px; border: 2px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--ink); text-decoration: none; }
.g2-card:hover { border-color: var(--brand); }
.g2-cat { color: var(--brand-text); font-size: 14px; font-weight: 680; }
.g2-card strong { font-size: 20px; font-weight: 760; line-height: 1.2; text-wrap: balance; }
.g2-card > span:not(.g2-cat):not(.g2-facts) { color: var(--ink-2); font-size: 15px; }
.g2-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: auto; padding-top: 6px; color: var(--ink-3); font-size: 14px; font-variant-numeric: tabular-nums; }

.plans2-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 880px; }
.plan2 { display: flex; flex-direction: column; padding: 26px; border: 2px solid var(--line); border-radius: 26px; background: var(--surface); }
.plan2 h3 { margin: 0; font-size: 22px; }
.plan2-price { margin: 6px 0 0; font-size: 46px; font-weight: 800; font-stretch: 86%; line-height: 1; }
.plan2-price small { font-size: 17px; font-weight: 600; color: var(--ink-2); font-stretch: 100%; }
.plan2-note { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; }
.plan2 ul { list-style: none; margin: 20px 0 24px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plan2 li { position: relative; padding-left: 28px; }
.plan2 li::before { content: '✓'; position: absolute; left: 2px; top: 0; color: var(--jade); font-weight: 800; }
.plan2 .btn { margin-top: auto; align-self: flex-start; }
.plan2.is-premium { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 5px 0 var(--brand); }

.home2 .faq { max-width: 760px; }
.langs2 h2 { font-size: 24px; margin: 0; }
.lang-pills .is-soon { display: inline-flex; padding: 7px 4px; color: var(--ink-3); font-size: 15px; }

.cta-dark { background: var(--night); color: var(--on-night); text-align: center; padding-block: 72px 80px; padding-inline: max(20px, env(safe-area-inset-left, 0px)) max(20px, env(safe-area-inset-right, 0px)); }
.cta-dark h2 { max-width: 16ch; margin: 0 auto 26px; font-size: clamp(32px, 5vw, 52px); }

@media (max-width: 860px) {
  .hero2 { padding: 20px 0 56px; }
  .hero2-in { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .stats ul { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
  .stats li:nth-child(3) { padding-left: 0; border-left: 0; }
  .plans2-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .scene { padding: 12px; border-radius: 24px; }
  .bub { max-width: 96%; }
  .bub-vi { font-size: 17.5px; }
  .hero-cta .btn { flex: 1 1 auto; }
}


/* ───────────── Guides ───────────── */
.art-head { padding: 32px 0 52px; }
.art-head-in { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: center; }
.art-head-copy { max-width: 760px; }
@media (min-width: 1000px) { .art-head-in { grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); gap: 52px; } }
@media (max-width: 999px) { .art-scene .bub:nth-child(3) { display: none; } }
.band .crumbs a { text-decoration: none; }
.band .crumbs a:hover { color: var(--on-night); text-decoration: underline; }
.art-head h1 { font-size: clamp(36px, 5.6vw, 60px); font-stretch: 84%; line-height: 1.02; letter-spacing: -0.022em; margin: 4px 0 0; }
.art-lede { margin: 16px 0 0; color: var(--on-night-2); font-size: clamp(18px, 2vw, 20px); max-width: 58ch; }
.art-facts { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.art-facts li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--night-3); color: var(--on-night-2); font-size: 14.5px; }
.art-facts li:first-child { background: var(--sun); box-shadow: none; color: #1c1a3a; font-weight: 680; }
.art-facts svg { width: 16px; height: 16px; }
.band .art-warn { margin: 16px 0 0; background: var(--night-3); color: var(--on-night); }

.art-layout { display: grid; grid-template-columns: minmax(0, 720px); justify-content: center; gap: 56px; padding-top: 8px; }
.art-layout .article { max-width: none; margin: 0; }
.art-side { display: none; }
@media (min-width: 1100px) {
  .art-layout { grid-template-columns: minmax(0, 720px) 264px; justify-content: space-between; }
  .art-layout .toc { display: none; }
  .art-side { display: block; }
  .side-in { position: sticky; top: 24px; margin-top: 30px; display: flex; flex-direction: column; gap: 20px; }
}
.toc-side p { margin: 0 0 10px; font-weight: 760; font-size: 15px; }
.toc-side ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc-side li { margin: 0; }
.toc-side a { display: block; margin-left: -2px; padding: 6px 0 6px 14px; border-left: 2px solid transparent; color: var(--ink-2); text-decoration: none; font-size: 15px; line-height: 1.35; }
.toc-side a:hover { color: var(--ink); }
.toc-side a.is-here { border-left-color: var(--brand); color: var(--ink); font-weight: 650; }
.side-app { padding: 16px; border-radius: 20px; background: var(--brand-soft); }
.side-app p { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; }

.art-cta { margin: 32px 0 0; padding: 20px 22px; border-radius: 22px; background: var(--night); color: var(--on-night-2); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.art-cta p { margin: 0; max-width: 46ch; }
.art-cta strong { color: var(--on-night); }
.art-end { background: var(--night); color: var(--on-night-2); padding: 28px; }
.art-end h2 { color: var(--on-night); }
.art-end p { color: var(--on-night-2); }

.ph-table td.t-word span[lang] { font-weight: 740; }
.ph-table tbody tr:hover { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.keep { max-width: 1080px; padding: 48px 0 64px; border-top: 2px solid var(--line); margin-top: 24px; }

.hub-head { padding: 36px 0 40px; }
.hub-head h1 { font-size: clamp(40px, 6vw, 64px); font-stretch: 84%; margin: 4px 0 0; }
.hub-jump { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hub-jump a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 8px 7px 14px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--night-3); color: var(--on-night); text-decoration: none; font-weight: 640; font-size: 15px; }
.hub-jump a:hover { box-shadow: inset 0 0 0 1.5px var(--on-night-2); }
.hub-jump span { min-width: 24px; padding: 1px 7px; border-radius: 999px; background: var(--night-3); color: var(--sun); font-size: 13px; text-align: center; font-variant-numeric: tabular-nums; }
.hub-sec { padding: 44px 0 0; scroll-margin-top: 16px; }
.hub-sec h2 { font-size: clamp(26px, 3.4vw, 34px); margin: 0 0 18px; }
.guides-page .phrasebooks { padding-top: 56px; margin-top: 48px; border-top: 2px solid var(--line); }
@media (max-width: 640px) {
  .ph-table .t-word span[lang] { display: inline-block; vertical-align: top; max-width: calc(100% - 44px); padding-top: 4px; }
}

/* The free-plays limit: a sheet sending people to the app */
.cap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: end center; padding: 16px max(16px, env(safe-area-inset-left, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px)); background: color-mix(in srgb, #0c0a1f 55%, transparent); }
@media (min-width: 640px) { .cap { place-items: center; } }
.cap-card { width: 100%; max-width: 460px; padding: 26px 24px 22px; border-radius: 28px; background: var(--night); color: var(--on-night-2); box-shadow: inset 0 0 0 1.5px var(--night-3), 0 20px 60px rgba(12, 10, 31, .4); }
.cap-card h2 { margin: 0 0 10px; color: var(--on-night); font-size: 28px; }
.cap-card p { margin: 0 0 20px; }
.cap-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.cap-close { border: 0; background: none; color: var(--on-night-2); font: inherit; font-weight: 650; cursor: pointer; padding: 10px 4px; text-decoration: underline; text-underline-offset: 3px; }
@media (prefers-reduced-motion: no-preference) { .cap:not([hidden]) .cap-card { animation: bub-in .3s ease-out both; } }

/* Phrasebook pages: the rest of each group is in the app */
.t-more td { padding: 0; border-top: 1.5px dashed var(--line-2); }
.t-more a { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 14px 16px; color: var(--ink); text-decoration: none; font-weight: 700; background: color-mix(in srgb, var(--brand-soft) 60%, transparent); }
.t-more a > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.t-more svg { color: var(--brand); }
.t-more-go { color: var(--brand-text); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.t-more a:hover { background: var(--brand-soft); }
.tbl-app { margin: 10px 0 0; font-size: 15px; color: var(--ink-2); }
.tbl-app a { font-weight: 700; color: var(--brand-text); }


/* Guide phrases: tiles, like the phrasebook cards on the home page */
.phrases { list-style: none; margin: 20px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.ph { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px 15px 12px; border: 2px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 3px 0 var(--line); }
.ph .say { flex: none; margin: 0; }
.ph .say.is-playing { background: var(--brand); color: #fff; }
.ph-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.ph-vi { font-weight: 760; font-size: 19px; line-height: 1.3; color: var(--ink); }
.ph-en { font-size: 16px; line-height: 1.4; color: var(--ink); }
.ph-note { margin-top: 3px; font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.art-sec .tbl-app { margin-top: 12px; }

/* Word-list and phrasebook pages: the same night header as the home page and the guides */
.lp-hero.band { max-width: none; padding: 32px 0 44px; }
.lp-hero.band > * { max-width: 820px; }
.lp-hero.band h1 { font-stretch: 84%; letter-spacing: -0.022em; }
.band .lede, .band .fine { color: var(--on-night-2); }
.band .btn-primary { background: var(--sun); color: #1c1a3a; box-shadow: 0 4px 0 var(--sun-deep); }
.band .btn-secondary { background: transparent; color: var(--on-night); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--on-night) 28%, transparent); }
.has-band .jump { margin-top: 0; }
.t-ex small.t-ex-roman { color: var(--brand-text); }

/* Privacy policy and terms */
.legal { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.legal .art-head { padding-top: 32px; }
.legal .art-head h1 { font-size: clamp(32px, 5vw, 46px); }
.legal .art-sec { padding-top: 26px; }
.legal .art-sec h2 { font-size: clamp(22px, 3vw, 28px); }
.legal .prose { font-size: 17px; }
.foot .fine a { color: inherit; }
