/* Pera Pera landing v2 — one bold idea per section, motion carries the page. */
:root {
  --bg: #090c12;
  --surface: #131823;
  --surface-2: #1b2130;
  --line: rgba(255, 255, 255, .08);
  --text: #f4f6f8;
  --text-2: #9aa3b2;
  --ink: #0a120d;

  /* Muted brand green for big surfaces; the app's #1db954 glares at hero size */
  --green: #3dae6c;
  --green-2: #4fd486;
  --blue: #5fa0fc;
  --pink: #e879c0;
  --orange: #fb7e5b;
  --streak: #ff9a1f;
  --purple: #9178e6;
  --yellow: #ffc93d;
  --teal: #00c386;

  --r: 28px;
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --out: cubic-bezier(.22, 1, .36, 1);
  --container: 1240px;
  --gutter: clamp(16px, 4vw, 40px);

  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-jp: "Noto Sans JP", "Hiragino Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
/* Vietnamese stacked marks (Ỗ, Ậ) clip below ~1.15 line-height */
h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -.025em; line-height: 1.16; }
p { margin: 0; }
[lang="ja"] { font-family: var(--font-jp); letter-spacing: 0; }
::selection { background: var(--green); color: var(--ink); }
:focus-visible { outline: 3px solid var(--green-2); outline-offset: 3px; border-radius: 12px; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 10px; font-weight: 700; }
.skip:focus { left: 8px; }

/* ---------- Buttons: chunky pill with a pressed lip ---------- */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 999px; background: #fff; color: var(--ink); font-weight: 800; white-space: nowrap;
  transition: transform .2s var(--out);
}
.pill:hover { transform: translateY(-4px); }
.pill:active { transform: translateY(2px); }
.pill--xl { padding: 26px 52px; font-size: clamp(22px, 2.4vw, 32px); }
.pill--md { padding: 13px 24px; font-size: 16px; }
.pill--md svg { width: 20px; height: 20px; }

/* ---------- Header ---------- */
.nav { position: fixed; inset: 0 0 auto; z-index: 50; padding: 18px 0; pointer-events: none; }
.nav__inner { display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(16px, 2vw, 28px); }
.nav a, .nav button { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 26px; letter-spacing: -.03em; color: var(--ink); }
.brand img { width: 52px; height: 52px; border-radius: 14px; transition: transform .4s var(--spring); }
.brand span { white-space: nowrap; transition: opacity .25s, transform .35s var(--out); }
.nav.is-docked .brand span { opacity: 0; transform: translateX(-10px); pointer-events: none; }
.nav.is-docked .brand img { transform: scale(.88); }
.nav__cta { opacity: 0; transform: translateY(-150%); padding: 13px 24px; }
.nav.is-docked .nav__cta { animation: cta-drop .3s var(--out) forwards; }
.nav.is-undocking .nav__cta { animation: cta-lift .3s var(--out) forwards; }
@keyframes cta-drop { from { opacity: 0; transform: translateY(-150%); } to { opacity: 1; transform: none; } }
@keyframes cta-lift { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-150%); } }

/* language menu: a white pill at the far right; "Tải app" drops in to its left once docked */
.nav__end { position: relative; display: flex; align-items: center; }
/* out of the flow so the hidden button never squeezes the logo; it drops in just left of the language pill */
.nav__end .nav__cta { position: absolute; right: calc(100% + 10px); top: 0; }
.lang { position: relative; pointer-events: auto; }
.lang summary { display: flex; align-items: center; gap: 6px; height: 50px; padding: 0 16px; border-radius: 999px; background: #fff; color: var(--ink); font-weight: 800; font-size: 15px; line-height: 1; cursor: pointer; list-style: none; transition: transform .2s var(--out); }
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: ""; width: 7px; height: 7px; margin: -3px 2px 0 2px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .2s var(--out); }
.lang[open] summary::after { transform: translateY(3px) rotate(-135deg); }
.lang summary:hover { transform: translateY(-2px); }
.lang summary svg { width: 18px; height: 18px; }
.lang ul { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; margin: 0; padding: 8px; list-style: none; border-radius: 20px; background: #fff; box-shadow: 0 18px 40px rgba(0, 0, 0, .28); animation: menu-in .18s var(--out); }
@keyframes menu-in { from { opacity: 0; transform: translateY(-6px); } }
.lang li a { display: block; padding: 10px 14px; border-radius: 12px; font-weight: 700; color: var(--ink); }
.lang li a:hover { background: rgba(10, 18, 13, .06); }
.lang li a[aria-current] { background: var(--green); }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  /* Leaves the topic strip peeking on the dark page below, like the reference */
  height: min(calc(100svh - 84px), 900px); min-height: 600px;
  background: var(--green); color: var(--ink);
  border-radius: 0 0 clamp(32px, 4vw, 56px) clamp(32px, 4vw, 56px);
  display: flex; flex-direction: column;
}
/* pinned to the page edge like the reference (~5.8vw), not to the centred content column */
.hero__inner { flex: 1; display: flex; flex-direction: column; justify-content: center; padding-top: 80px; position: relative; z-index: 2; max-width: none; margin: 0; padding-left: clamp(20px, 5.8vw, 140px); padding-right: clamp(20px, 5.8vw, 140px); }
.hero__title { font-size: clamp(40px, 5.8vw, 92px); line-height: 1.3; letter-spacing: -.04em; text-transform: uppercase; }
.hero__title span { display: block; white-space: nowrap; }
.hero__title .hero__accent { color: #fff; }
.hero__title span > i { display: block; font-style: normal; }
.hero__cta { margin-top: clamp(28px, 4vw, 48px); }

.hero__mascot {
  position: absolute; z-index: 1; right: max(-60px, calc(50% - 760px)); bottom: 0;
  width: clamp(300px, 46vw, 720px);
  translate: 0 var(--sink, 0%);
  will-change: translate;
}
.hero__mascot .sprite { width: 100%; transform: translateY(100%); animation: mascot-in .8s .25s var(--out) forwards; margin-bottom: -18%; }
@keyframes mascot-in { to { transform: translateY(0); } }
.is-restoring .hero__mascot .sprite { animation: none; transform: none; }

.strip { display: flex; align-items: center; gap: 14px; padding: 18px 0 0; }
.strip__label { flex: none; padding-left: var(--gutter); font-weight: 700; font-size: 14px; color: var(--text-2); }
.strip__track { overflow: hidden; flex: 1; -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.strip__list { display: flex; gap: 10px; width: max-content; margin: 0; padding: 0; list-style: none; animation: marquee 90s linear infinite; }
.strip__list li { padding: 10px 18px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 15px; display: inline-flex; gap: 10px; align-items: center; }
.strip__list li i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Section heads ---------- */
.section { padding: clamp(140px, 16vw, 240px) 0 0; }
.head { text-align: center; margin: 0 auto clamp(40px, 5vw, 64px); max-width: 900px; padding: 0 var(--gutter); }
.head__icon { width: 72px; height: 72px; margin: 0 auto 20px; }
.head h2 { font-size: clamp(40px, 5.4vw, 68px); text-wrap: balance; }
.head p { margin-top: 14px; font-size: clamp(16px, 1.5vw, 19px); color: var(--text-2); text-wrap: balance; }
/* desktop: title and subtitle each hold one line; the title is ~17em wide, so it scales with
   the viewport instead of the usual cap to stay inside the gutters */
@media (min-width: 1021px) {
  .head--wide { max-width: none; }
  .head--wide h2 { font-size: min(4.6vw, 68px); white-space: nowrap; }
  .head--wide p { white-space: nowrap; }
}

/* scroll-in for heads */
.js [data-in] { opacity: 0; transform: translateY(40px); transition: opacity .8s var(--out), transform .8s var(--out); transition-delay: calc(var(--i, 0) * 90ms); }
.js [data-in].in { opacity: 1; transform: none; }

/* ---------- Color cards (features, daily) ---------- */
.cards {
  display: flex; gap: 20px; overflow-x: auto;
  padding: 10px max(var(--gutter), calc((100vw - var(--container)) / 2 + var(--gutter))) 40px;
  scrollbar-width: none;
}
/* the endless row lines up with the hero title's left edge */
.cards[data-loop] { padding-left: clamp(20px, 5.8vw, 140px); padding-right: clamp(20px, 5.8vw, 140px); }
.cards::-webkit-scrollbar { display: none; }
.cards { cursor: grab; -webkit-user-select: none; user-select: none; }
.cards img { -webkit-user-drag: none; }
.cards.is-dragging { cursor: grabbing; }
.cards.is-dragging .card, .cards.is-scrolling .card { pointer-events: none; }
.card {
  flex: none;
  width: clamp(290px, 29vw, 420px); aspect-ratio: 420 / 520;
  border-radius: var(--r); background: var(--c); color: var(--ink);
  padding: clamp(22px, 2.4vw, 32px); display: flex; flex-direction: column; gap: 22px;
  transition: transform .35s var(--out);
}
/* one-shot staggered entrance when the row comes into view (not scroll-linked) */
.js .cards:not([data-stack]) .card { opacity: 0; translate: 0 56px; transition: opacity .7s var(--out) var(--d, 0ms), translate .9s var(--out) var(--d, 0ms), transform .35s var(--out); }
.js .cards:not([data-stack]) .card.in { opacity: 1; translate: 0 0; }
/* feature row waits as a pile on the first card's slot, each card peeking 10px, then deals
   out in one move when it scrolls into view (v2.js flips data-reveal) */
.cards[data-stack] .card { transition: translate .5s cubic-bezier(.215, .61, .355, 1), transform .35s var(--out); }
.cards[data-stack][data-reveal="pending"] .card { translate: calc(var(--i, 0) * (10px - 100% - 20px)) 0; }
.card:hover { transform: translateY(-8px); }
.card h3 { text-align: center; font-size: clamp(28px, 2.6vw, 38px); letter-spacing: -.03em; text-wrap: balance; }
.card p { margin-top: -14px; text-align: center; font-weight: 600; font-size: 15.5px; line-height: 1.45; color: rgba(10, 18, 13, .72); text-wrap: balance; }
.card__art {
  flex: 1; min-height: 0; border-radius: 22px; position: relative; overflow: hidden;
  background: rgba(255, 255, 255, .28);
  display: grid; place-items: center;
}
.card__pic { position: relative; display: block; width: 76%; aspect-ratio: var(--ratio, 1); transition: transform .5s var(--spring); }
.card__pic img { width: 100%; height: 100%; }
.card__pic.has-lottie img { visibility: hidden; }
.card__pic .lot { position: absolute; inset: 0; }
/* the chest sits small in its 450px Lottie canvas */
.card__pic[data-kind="chest"] { width: 100%; }
.card__pic[data-kind="chest"] .lot { inset: -14%; }
.card__pic:hover { transform: scale(1.06); }
.cards.is-dragging .card__pic { transform: none; }
.card__art--bleed { place-items: end center; }

/* ---------- Outfit cards: the app's star gem intro fan (_Fan + _OutfitCard) ---------- */
/* app card: surfaceElevated, radiusMd 20, 1.5px rarity border (common = 10% white), 4px inset,
   square art at radiusSm 12, then rarity chip + star gem price; 1 : 1.5. The fan opens five cards
   (the app shows three), rarest in the middle at 1.12×, each dealt with easeOutBack from the
   outside in: 550ms, 140ms apart, fading in over the first 30% */
.deck { --w: clamp(150px, 16vw, 230px); position: relative; height: calc(var(--w) * 1.5 * 1.12 + 96px); max-width: var(--container); margin: 0 auto; overflow: hidden; overflow: clip visible; }
.tcard {
  --s: 1; --sp: .86; --a: calc(var(--o) * 8deg); --y: calc(var(--o) * var(--o) * 14px);
  position: absolute; left: 50%; top: 24px; width: var(--w); margin-left: calc(var(--w) / -2);
  z-index: calc(10 - var(--o) * var(--o));
  transform: translate(calc(var(--o) * var(--w) * var(--sp)), var(--y)) rotate(var(--a)) scale(var(--s));
}
.tcard[style*="--o:0"] { --s: 1.12; }
.js .deck:not(.is-dealt) .tcard { opacity: 0; transform: translate(0, calc(var(--w) * .5)) scale(calc(var(--s) * .6)); }
.js .deck .tcard { transition: transform .55s cubic-bezier(.175, .885, .32, 1.275) calc(var(--n) * 140ms), opacity .165s linear calc(var(--n) * 140ms); }
.tcard__body {
  --rc: #9aa4b2; --edge: rgba(255, 255, 255, .1);
  position: relative; display: flex; flex-direction: column; aspect-ratio: 1 / 1.5; padding: 4px;
  background: #1e1e1e; border: 1.5px solid var(--edge); border-radius: 20px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .25); overflow: hidden;
}
.tcard--rare .tcard__body { --rc: #4fa3ff; --edge: rgba(79, 163, 255, .8); }
.tcard--epic .tcard__body { --rc: #b06bff; --edge: rgba(176, 107, 255, .8); box-shadow: 0 6px 16px rgba(0, 0, 0, .25), 0 0 48px rgba(176, 107, 255, .35); }
.tcard__pic { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #2a2a2a; }
.tcard__pic img { width: 100%; height: 100%; object-fit: cover; }
.tcard__info { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 0 4px; text-align: center; }
.tcard__name { font-size: calc(var(--w) * .075); font-weight: 800; line-height: 1.2; white-space: nowrap; }
.tcard__name small { font-weight: 600; color: var(--text-2); font-size: .8em; }
.tcard__rarity { padding: 2px 10px; border-radius: 22px; background: color-mix(in srgb, var(--rc) 16%, transparent); color: var(--rc); font-size: calc(var(--w) * .058); font-weight: 700; line-height: 1.4; }
.tcard__price { display: flex; align-items: center; gap: 4px; color: #f9bf08; font-size: calc(var(--w) * .062); font-weight: 700; }
.tcard__price img { width: 1.15em; height: 1.15em; }

/* ---------- Badge fan ---------- */
/* clip only sideways (the arc runs off both edges); the radiance behind a tapped badge may
   spill above the section */
.fan { position: relative; height: clamp(600px, 50vw, 740px); overflow: hidden; overflow: clip visible; }
/* radius grows with badge size so neighbours on the 8° arc don't overlap */
.fan__ring { position: absolute; left: 50%; top: calc(var(--R) + 140px); width: 0; height: 0; will-change: rotate; --R: 1550px; }
.fan__item {
  position: absolute; left: 0; top: 0; width: var(--size, 204px);
  transform: translate(-50%, -50%) rotate(calc(var(--a) * var(--spread, 1))) translateY(calc(var(--R) * -1));
}
.fan__item button { display: block; width: 100%; transition: transform .35s var(--spring); }
.fan__item button:hover { transform: translateY(-10px) scale(1.08); }
.fan__item button { position: relative; }
.fan__item .art { display: block; position: relative; z-index: 1; aspect-ratio: 720 / 768; }
.art__lot, .art__lot > div, .art__lot .lot { position: absolute; inset: 0; }
.art.has-lottie > img { visibility: hidden; }
.art__scene.is-locked { filter: url(#badge-locked); }
.radiance { position: absolute; left: 50%; top: 47%; z-index: 0; translate: -50% -50%; pointer-events: none; }
.fan__item .art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.fan__item.pop .art { animation: pop .55s var(--spring); }
@keyframes pop { 30% { transform: scale(.82) rotate(-6deg); } 100% { transform: none; } }
.fan__fade { position: absolute; inset: auto 0 0; height: 55%; background: linear-gradient(transparent, var(--bg) 52%); pointer-events: none; }
.fan__copy { position: absolute; inset: auto 0 0; text-align: center; padding: 0 var(--gutter) 10px; }
.fan__copy h2 { font-size: clamp(40px, 5.4vw, 68px); text-wrap: balance; }
.fan__copy p { margin: 14px auto 0; max-width: 46ch; font-size: clamp(16px, 1.5vw, 19px); color: var(--text-2); text-wrap: balance; }
@media (min-width: 1021px) { .fan__copy p { max-width: none; white-space: nowrap; } }
.fan__copy small { display: block; margin-top: 16px; font-size: 14px; color: #5d6574; }

/* ---------- Versus ---------- */
.versus-wrap { padding: 0 clamp(10px, 1.6vw, 20px); }
.versus {
  position: relative; overflow: hidden; isolation: isolate;
  border-radius: clamp(32px, 4vw, 56px); background: var(--purple); color: var(--ink);
  min-height: clamp(620px, 62vw, 820px);
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: clamp(56px, 7vw, 96px) var(--gutter) 0;
}
.versus h2 { font-size: clamp(44px, 8vw, 124px); line-height: 1.12; letter-spacing: -.045em; text-transform: uppercase; }
.versus p { margin-top: 12px; max-width: 40ch; font-weight: 600; font-size: clamp(16px, 1.5vw, 20px); color: rgba(10, 18, 13, .74); }
/* ---------- VS intro: the app's CombatVersusIntro, drawn straight on the panel ---------- */
.vs { --k: 1; width: min(980px, 100%); margin: clamp(28px, 4vw, 48px) auto clamp(48px, 6vw, 80px); display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 4vw, 56px); }
/* the opponent's band is mirrored so the two lanes face each other */
.vs__lane[data-mirror] .vs__slot { transform: scaleX(-1); }
.vs__lane { opacity: var(--appear, 0); }
.vs__slot { position: relative; height: calc(230px * var(--k)); }
.vs__slot canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.vs__clip { position: absolute; inset: 0; }
/* the web sheets carry ~22% headroom above the ears (the app measures 16%): pull up so the head
   pokes out over the band like in the app */
.vs__mascot { position: absolute; left: 50%; top: calc(-33px * var(--k)); width: calc(300px * var(--k)); translate: -50% 0; transform-origin: 50% 70%; scale: var(--pop, 0); }
.versus .vs__name { margin: calc(8px * var(--k)) 0 0; max-width: none; text-align: center; font-weight: 700; font-size: 17px; color: var(--ink); }
.vs__name small { display: block; font-weight: 600; font-size: 13px; color: rgba(10, 18, 13, .7); }

/* ---------- Download ---------- */
.get { display: flex; justify-content: center; align-items: center; gap: clamp(32px, 6vw, 80px); flex-wrap: wrap; }
.get__qr { position: relative; }
.get__qr .card-qr { position: relative; z-index: 1; background: #fff; border-radius: 30px; padding: 20px; width: clamp(210px, 22vw, 270px); transition: transform .4s var(--spring); }
.get__qr:hover .card-qr { transform: rotate(-3deg) scale(1.03); }
.get__qr .sprite { position: absolute; z-index: 0; width: 64%; left: -40%; bottom: -2%; transform: rotate(-12deg); transition: transform .45s var(--spring); }
.get__qr:hover .sprite { transform: rotate(-20deg) translate(-12px, -12px); }
.get h2 { font-size: clamp(36px, 4.6vw, 64px); }
.get p { margin-top: 10px; color: var(--text-2); font-weight: 600; }
.get .row { margin-top: 24px; gap: 12px; }
/* store buttons share one width (the wider label sets it) so the pair lines up as a block */
.get .row, .footer__brand .row, .dl__card .row { display: grid; width: max-content; max-width: 100%; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }

/* ---------- FAQ ---------- */
.faq { max-width: 880px; margin: 0 auto; padding: 0 var(--gutter); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 26px 0; font-weight: 800; font-size: clamp(17px, 1.6vw, 21px); transition: color .2s; }
.faq summary:hover { color: var(--green-2); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 18px; height: 18px; background: linear-gradient(currentColor, currentColor) center / 100% 2.5px no-repeat, linear-gradient(currentColor, currentColor) center / 2.5px 100% no-repeat; transition: transform .35s var(--spring); }
.faq details[open] summary::after { transform: rotate(135deg); }
.faq .ans > p { color: var(--text-2); max-width: 70ch; padding-bottom: 26px; }

/* ---------- Footer ---------- */
.footer { padding: clamp(140px, 16vw, 240px) clamp(10px, 1.6vw, 20px) clamp(10px, 1.6vw, 20px); }
.footer__card { position: relative; overflow: hidden; border-radius: clamp(32px, 4vw, 56px); background: var(--green); color: #fff; padding: clamp(36px, 4.4vw, 60px) clamp(24px, 5vw, 64px) 0; }
/* white type on the green card; the brand column carries a line about the app so it isn't empty */
.footer__grid { display: grid; grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px); }
.footer .brand { color: #fff; font-size: 30px; }
.footer__tagline { margin-top: 14px; max-width: 340px; font-weight: 700; font-size: 18px; line-height: 1.45; color: rgba(255, 255, 255, .86); }
.footer__brand .row { margin-top: 24px; gap: 10px; }
.footer__col summary { margin-bottom: 14px; font-weight: 900; font-size: 20px; color: #fff; list-style: none; pointer-events: none; }
.footer__col summary::-webkit-details-marker { display: none; }
.footer__col a { display: block; padding: 5px 0; font-weight: 600; font-size: 17px; color: rgba(255, 255, 255, .82); transition: color .2s, transform .2s var(--out); }
.footer__col a:hover { color: #fff; transform: translateX(4px); }
.footer__giant { position: relative; margin-top: clamp(16px, 2vw, 28px); color: #fff; font-weight: 900; font-size: clamp(56px, 18.5vw, 300px); line-height: .8; letter-spacing: -.06em; white-space: nowrap; text-align: center; translate: 0 var(--gy, 30%); user-select: none; }
.footer__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: clamp(32px, 4vw, 48px); padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .28); }
.footer__copy { font-weight: 700; font-size: 15px; color: rgba(255, 255, 255, .86); }
.footer__langs { display: flex; flex-wrap: wrap; gap: 6px 20px; font-weight: 700; font-size: 15px; }
.footer__langs a { color: rgba(255, 255, 255, .8); transition: color .2s; }
.footer__langs a:hover, .footer__langs a[aria-current] { color: #fff; }
.footer__langs a[aria-current] { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }

/* ---------- QR modal ---------- */
.qr-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(9, 12, 18, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.qr-modal[hidden] { display: none; }
.qr-modal__box { position: relative; background: #fff; color: var(--ink); border-radius: var(--r); padding: 30px; text-align: center; animation: modal-in .35s var(--spring); }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
.qr-modal__box p { margin-top: 14px; font-weight: 900; font-size: 20px; }
.qr-modal__box span { display: block; margin-top: 4px; font-size: 14px; color: #4b5563; }
.qr-modal__close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; background: #eef0f3; font-size: 22px; line-height: 1; }

/* ---------- Sprite: 3×3 mascot reaction sheet ---------- */
.sprite { display: block; aspect-ratio: 1; position: relative; }
/* MascotView keeps both sheets mounted and only flips opacity, so a pose change never waits on a
   decode; the squash (its 420ms TweenSequence) covers the swap */
.sprite::before, .sprite::after { content: ""; position: absolute; inset: 0; background: var(--dir, var(--sheet)) var(--dp, 50% 50%) / 300% 300% no-repeat; transform-origin: 50% 88%; pointer-events: none; }
.sprite::after { background-image: var(--react, none); background-position: var(--rp, 0 0); opacity: 0; }
.sprite.is-react::before { opacity: 0; }
.sprite.is-react::after { opacity: 1; }
.sprite.is-squash::before, .sprite.is-squash::after { animation: squash .42s linear; }
@keyframes squash {
  0% { transform: scale(1, 1); animation-timing-function: ease-in; }
  18% { transform: scale(1.10, .86); animation-timing-function: ease-out; }
  45% { transform: scale(.95, 1.08); animation-timing-function: ease-in-out; }
  72% { transform: scale(1.03, .97); animation-timing-function: ease-in-out; }
  100% { transform: scale(1, 1); }
}

/* ---------- Subpages: legal, credits, contact, download ---------- */
/* the green card that opens every subpage, same shape as the home hero */
.page-hero { background: var(--green); color: var(--ink); border-radius: 0 0 clamp(32px, 4vw, 56px) clamp(32px, 4vw, 56px); padding: clamp(128px, 13vw, 176px) 0 clamp(48px, 6vw, 80px); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-weight: 700; font-size: 14px; color: rgba(10, 18, 13, .6); }
.crumbs a { transition: color .2s; }
.crumbs a:hover { color: var(--ink); }
.page-hero h1 { margin-top: 16px; font-size: clamp(44px, 6.4vw, 96px); line-height: 1.12; letter-spacing: -.04em; text-wrap: balance; }
.page-hero__meta { margin-top: 18px; max-width: 640px; font-weight: 600; font-size: clamp(16px, 1.4vw, 19px); color: rgba(10, 18, 13, .72); text-wrap: pretty; }
.page-hero__jp { font-weight: 900; font-size: clamp(16px, 1.6vw, 20px); color: rgba(10, 18, 13, .55); margin-top: 16px; }

.page-body { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); align-items: start; padding-top: clamp(56px, 7vw, 96px); }
.page-body--single { grid-template-columns: minmax(0, 760px); }
.toc { position: sticky; top: 100px; max-height: calc(100vh - 130px); overflow: auto; padding: 22px 14px; border-radius: 24px; background: var(--surface); scrollbar-width: thin; }
.toc__title { padding: 0 10px 10px; font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.toc a { display: flex; gap: 10px; padding: 8px 10px; border-radius: 12px; font-weight: 600; font-size: 14.5px; line-height: 1.35; color: var(--text-2); transition: color .2s, background .2s; }
.toc a::before { counter-increment: toc; content: counter(toc); flex: none; min-width: 20px; font-weight: 800; }
.toc a:hover { color: var(--text); background: var(--surface-2); }
.toc a.is-active { color: var(--ink); background: var(--green); }

.prose { max-width: 760px; }
.prose section { scroll-margin-top: 110px; }
.prose section + section { margin-top: clamp(44px, 5vw, 64px); }
.prose h2 { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; font-size: clamp(24px, 2.4vw, 32px); line-height: 1.2; }
.prose h2 span { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--green); color: var(--ink); font-size: 18px; letter-spacing: 0; }
.prose p, .prose li { color: var(--text-2); font-size: 17px; line-height: 1.75; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 14px; }
.prose ul { margin: 14px 0 0; padding-left: 22px; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--green-2); }
.prose strong { color: var(--text); font-weight: 700; }
.prose a:not(.mail) { color: var(--green-2); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.prose a:not(.mail):hover { color: #fff; }
/* the support address, wherever it appears, as a white pill */
.mail { display: inline-flex; align-items: center; max-width: 100%; margin-top: 6px; padding: 15px clamp(18px, 4vw, 26px); border-radius: 999px; background: #fff; color: var(--ink); font-weight: 800; font-size: clamp(14px, 4vw, 17px); transition: transform .2s var(--out); }
.mail:hover { transform: translateY(-3px); }

/* credits */
.credit-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(24px, 4vw, 56px); align-items: center; margin-top: clamp(56px, 7vw, 96px); padding: clamp(28px, 4vw, 56px); border-radius: var(--r); background: var(--purple); color: var(--ink); }
.credit-hero .kicker { font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: rgba(10, 18, 13, .6); }
.credit-hero h2 { margin-top: 8px; font-size: clamp(30px, 3.4vw, 46px); }
.credit-hero p:not(.kicker) { margin-top: 14px; max-width: 620px; font-weight: 600; line-height: 1.65; color: rgba(10, 18, 13, .78); }
.credit-hero a { text-decoration: underline; text-underline-offset: 3px; }
.credit-hero__badge { display: flex; flex-direction: column; gap: 6px; min-width: 240px; padding: 22px 26px; border-radius: 22px; background: #fff; }
.credit-hero__label { font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: rgba(10, 18, 13, .5); }
.credit-hero__badge strong { font-size: 22px; }
.credit-hero__badge a { font-weight: 700; font-size: 14px; text-decoration: none; color: #6b4fd6; }
.credit-group { margin-top: clamp(40px, 5vw, 64px); }
.credit-group h2 { font-size: clamp(26px, 2.6vw, 34px); }
.credit-group ul { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin: 22px 0 0; padding: 0; list-style: none; }
.credit-group li { display: flex; flex-direction: column; gap: 10px; padding: 26px; border-radius: 24px; background: var(--surface); }
.credit-group h3 { font-size: 20px; }
.credit-group h3 a, .credit-group p a { color: var(--green-2); text-decoration: underline; text-underline-offset: 3px; }
.credit-group li p { color: var(--text-2); line-height: 1.65; }
.lic { align-self: flex-start; margin-top: auto; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-weight: 700; font-size: 13px; color: var(--text); }
.credits__contact { margin-top: 26px; color: var(--text-2); }
.credits__contact a { color: var(--green-2); text-decoration: underline; text-underline-offset: 3px; }

/* download: the QR lands here; phones are sent on to their store before this shows */
/* short pages don't need the home page's long run-up to the footer */
.page + .footer { padding-top: clamp(80px, 10vw, 140px); }

.dl { min-height: 100svh; display: grid; place-items: center; padding: 20px; }
.dl__card { width: min(560px, 100%); padding: clamp(36px, 6vw, 64px) clamp(24px, 5vw, 56px); border-radius: clamp(32px, 4vw, 48px); background: var(--green); color: var(--ink); text-align: center; }
.dl__card img { width: 96px; height: 96px; margin: 0 auto; border-radius: 24px; }
.dl__card h1 { margin-top: 24px; font-size: clamp(36px, 5vw, 56px); }
.dl__card p { margin-top: 10px; font-weight: 600; font-size: 18px; color: rgba(10, 18, 13, .72); }
.dl__card .row { margin: 28px auto 0; }
.dl__langs { font-size: 14px !important; }
.dl__langs a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.dl__card .dl__note { margin-top: 14px; font-size: 14px; }
.dl__back { display: inline-block; margin-top: 26px; font-weight: 700; color: rgba(10, 18, 13, .7); }
.dl__back:hover { color: var(--ink); }

/* ---------- Scripts Montserrat lacks: Latin stays Montserrat, Hangul/Myanmar fall to Noto ---------- */
/* Noto goes ahead of the system fonts in --font, or the OS face picks up the glyphs first */
:lang(ko) body, :lang(ko) button { font-family: "Montserrat", "Noto Sans KR", system-ui, sans-serif; word-break: keep-all; }
:lang(my) body, :lang(my) button { font-family: "Montserrat", "Noto Sans Myanmar", system-ui, sans-serif; }
:lang(ko) :is(h1, h2, h3, .hero__title, .brand), :lang(my) :is(h1, h2, h3, .hero__title) { letter-spacing: -.01em; }
/* Myanmar stacks marks above and below the line: it needs far more leading than Latin */
:lang(my) :is(h1, h2, h3) { line-height: 1.6; }
:lang(my) .hero__title { line-height: 1.55; }
:lang(my) p, :lang(my) li, :lang(my) .faq summary { line-height: 1.85; }

/* ---------- Responsive ---------- */
@media (max-width: 1020px) {
  .page-body { grid-template-columns: minmax(0, 1fr); }
  /* one column: the sections are numbered already, a 19-line list would only push them down */
  .toc { display: none; }
  .credit-hero { grid-template-columns: 1fr; }
  .credit-group ul { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: repeat(3, 1fr); }
  .footer__brand { grid-column: 1 / -1; }
  .fan__ring { --R: 1100px; }
  .fan__item { --size: 150px; }
}
/* tablets: the desktop clamps bottom out here and the titles look lost on the wide screen */
@media (min-width: 641px) and (max-width: 1020px) {
  .hero__title { font-size: 9vw; line-height: 1.16; }
  :lang(en) .hero__title { font-size: 8.4vw; }
  .head h2, .fan__copy h2, .get h2 { font-size: 7.2vw; line-height: 1.1; }
  .versus h2 { font-size: 8.6vw; line-height: 1.08; }
  .head p, .fan__copy p, .versus p, .get p { font-size: 19px; }
  :lang(my) :is(.head h2, .fan__copy h2, .get h2, .versus h2) { font-size: 5.6vw; line-height: 1.5; }
}
@media (max-width: 640px) {
  .brand { font-size: 21px; }
  .brand img { width: 44px; height: 44px; }
  .hero { height: auto; min-height: calc(100svh - 72px); }
  .hero__inner { justify-content: flex-start; padding-top: 120px; padding-bottom: 300px; padding-left: 16px; padding-right: 16px; }
  /* as large as "NÓI TIẾNG NHẬT" can go on one line: narrower gutters, tighter tracking */
  .hero__title { font-size: 11vw; line-height: 1.12; letter-spacing: -.05em; }
  :lang(en) .hero__title { font-size: 10.2vw; } /* "SPEAK JAPANESE" runs longer */
  /* Knowunity-style phone CTA: the hero button spans the width */
  .hero__cta .pill--xl { display: flex; width: 100%; }
  /* phones: the mascot stands centred under the title (keeps its scroll sink on the y axis) */
  .hero__mascot { width: 360px; left: 50%; right: auto; bottom: 0; translate: -50% var(--sink, 0%); }
  .pill--xl { padding: 16px 28px; font-size: 19px; }
  /* phones: smaller badges on a gentler arc so about five show at once, a 3-line title
     under them and no dead space below */
  .fan { height: 402px; }
  .fan__fade { height: 40%; }
  .fan__ring { --R: 660px; top: calc(var(--R) + 46px); }
  .fan__item { --size: 102px; --spread: 1.12; }
  /* phone type scale after Knowunity: one big title size with tight leading for every section,
     17px subtitles, 64px above and below each section */
  /* one 96px rhythm between every block: 48px either side of a section, and the blocks that
     carried their own slack (card row, badge arc, outfit fan) lose it */
  .section { padding: 48px 0; }
  .footer { padding-top: 48px; }
  .strip { padding-bottom: 48px; }
  .cards { padding-bottom: 8px; }
  .fan__copy { padding-bottom: 0; }
  .head { margin-bottom: 32px; }
  .head h2, .fan__copy h2, .versus h2, .get h2 { font-size: min(34px, 9vw); line-height: 1.08; letter-spacing: -.03em; }
  .head p, .fan__copy p, .versus p, .get p { margin-top: 12px; font-size: 17px; line-height: 1.45; }
  .fan__copy small { margin-top: 10px; font-size: 14px; }
  .fan__copy h2 { text-wrap: pretty; } /* no lone "Nhật." on the last line */
  /* Myanmar marks need the room back, and its words run long */
  :lang(my) :is(.head h2, .fan__copy h2, .versus h2, .get h2) { font-size: min(28px, 7.4vw); line-height: 1.5; }
  :lang(my) .fan { height: 418px; }
  .versus { min-height: 0; }
  /* footer columns fold into an accordion on phones, like Knowunity's */
  .footer__grid { grid-template-columns: 1fr; gap: 0; }
  .footer__brand { margin-bottom: 20px; }
  .footer__col { border-top: 1px solid rgba(255, 255, 255, .28); }
  .footer__col summary { display: flex; align-items: center; justify-content: space-between; margin: 0; padding: 16px 0; font-size: 18px; pointer-events: auto; cursor: pointer; }
  .footer__col summary::after { content: ""; width: 9px; height: 9px; margin-right: 4px; border: solid currentColor; border-width: 0 2.5px 2.5px 0; transform: translateY(-3px) rotate(45deg); transition: transform .25s var(--out); }
  .footer__col[open] summary::after { transform: translateY(2px) rotate(-135deg); }
  .footer__col nav { padding-bottom: 14px; }
  .footer__bottom { margin-top: 0; }
  .get { text-align: center; flex-direction: column; }
  .get h2 { margin: 0 auto; }
  .get .row { margin-inline: auto; }
  .pill--md { gap: 8px; padding: 13px 14px; font-size: 15px; }
  .get__qr .sprite { left: -30%; }
  .vs { grid-template-columns: 1fr; gap: 32px; width: min(460px, 100%); }
  .deck { --w: min(31vw, 150px); height: calc(var(--w) * 1.5 * 1.12 + 24px); }
  .tcard[style*="--o:-2"], .tcard[style*="--o:2"] { display: none; }
  .tcard { --sp: .98; --a: calc(var(--o) * 10deg); --y: calc(var(--o) * var(--o) * 12px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .js [data-in] { opacity: 1; transform: none; }
}

/* Bản iOS chưa qua duyệt App Store: chỉ hiện Google Play. Có link ios trong store.js thì gỡ luật này
   (và dòng .dl__note "Bản iOS sắp ra mắt" ở trang tải). */
[data-store="ios"] { display: none; }
