/*
  hungiai.com on the taste-skill kit (public/assets, MIT). Loaded after the kit's stylesheets.

  1. :root as start.mjs brand printed it for the client's own colours (the app's "Biển xanh": ink #14213d,
     action #2f62e6, sky surface), plus the app's four skill colours, used only inside pictures of the product.
  2. Two changes to the kit's numbers, both for this audience (Vietnamese adults, many over fifty):
     body text 18px (the kit allows 16 or more), and the lit ground "sky" in the app's own sky blue.
  3. Page CSS only inside visuals (the phone, the result card, the stage row) and the blog's reading column.
*/
:root {
  --p-bg: #ffffff; --p-surface: #eef4ff; --p-ink: #14213d; --p-muted: #5b6478;
  --p-accent: #2f62e6; --p-accent-ink: #ffffff; --p-action: #2f62e6; --p-action-ink: #ffffff;
  --p-inv-bg: #14213d; --p-inv-surface: #212e49; --p-inv-ink: #ffffff; --p-inv-muted: #a9b0bf;
  --p-inv-accent: #ffffff; --p-inv-accent-ink: #14213d; --p-inv-action: #ffffff; --p-inv-action-ink: #14213d;
  --font-display: "Onest", system-ui, sans-serif;
  --font-text: "Onest", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display-weight: 400;
  --display-tracking: -0.035em;
  --display-tracking-xl: -0.04em;

  /* the app's skill colours (app/src/theme.ts): say, hear, read, write */
  --say: #ff6b5b; --hear: #2f6bff; --read: #22c79a; --write: #ffc93c;

  --t-body: 18px;
}
@media (min-width: 1024px) { :root { --t-lead: 21px; } }
body { font-size: var(--t-body); line-height: 1.65; }

/* the app's own sky as the lit ground (system.css html[data-ground="sky"] is a grey blue) */
html[data-ground="sky"] { --ground-bg: #dbe8ff; --ground-surface: #eef4ff; --ground-ink: #14213d; --ground-muted: #47536b; --ground-accent: #2f62e6; }

/* Japanese and Traditional Chinese: Onest has no CJK, so the system's own faces take those glyphs */
:lang(ja) { --font-display: "Onest", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif; --font-text: var(--font-display); }
:lang(zh-Hant) { --font-display: "Onest", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif; --font-text: var(--font-display); }
:is(:lang(ja), :lang(zh-Hant)) :is(h1, h2) { letter-spacing: 0; line-break: strict; word-break: keep-all; overflow-wrap: anywhere; }

/* the logo: the app icon beside the name */
.nav__logo { display: inline-flex; align-items: center; gap: var(--s-3); }
.logo-icon { width: 32px; height: 32px; border-radius: 8px; flex: none; }

/* ---------------------------------------------------------------- a phone (page CSS: .device) */
.device {
  position: relative; aspect-ratio: 640 / 1391; border-radius: 13% / 6%; overflow: hidden;
  background: #fff; box-shadow: 0 0 0 1px color-mix(in oklab, var(--p-ink) 14%, transparent), 0 24px 48px -24px color-mix(in oklab, var(--p-ink) 40%, transparent);
}
.device > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }

/* hero: the phone stands in the frame's right part, cut by its foot; the card over the lower left */
.hero__art > .ly-piece--main.phone-piece { left: auto; right: var(--s-8); top: var(--s-8); width: min(320px, 56%); }
.hero__art > .say-card { left: var(--s-6); bottom: var(--s-6); width: 300px; }
@media (max-width: 1023px) {
  .hero__art > .ly-piece--main.phone-piece { right: auto; left: 50%; transform: translateX(-50%); top: var(--s-6); width: min(260px, 60%); }
}
@media (max-width: 639px) {
  .hero__art > .ly-piece--main.phone-piece { top: var(--s-4); width: min(220px, 64%); }
}

/* the result card: the app's Say step after a sentence (its own words) */
.say-card {
  z-index: 2; display: grid; gap: var(--s-3); padding: var(--s-5);
  background: #fff; color: var(--p-ink); border-radius: var(--r-md);
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--p-ink) 10%, transparent), 0 16px 32px -16px color-mix(in oklab, var(--p-ink) 35%, transparent);
  font-size: 15px; line-height: 1.45;
}
.say-card p { margin: 0; }
.say-card__head { display: flex; align-items: center; justify-content: space-between; }
.say-card__step { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 500; }
.say-card__step i { width: 10px; height: 10px; border-radius: 50%; }
.say-card__ring {
  display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  font: 500 20px/1 var(--font-text); color: var(--p-ink);
  background: radial-gradient(closest-side, #fff 78%, transparent 80% 100%), conic-gradient(var(--read) 86%, #e6ecf5 0);
}
.say-card__ring small { display: block; font-size: 10px; color: var(--p-muted); margin-top: -10px; }
.say-card__sentence { font-size: 20px; font-weight: 500; }
.w-ok { color: #138a68; }
.w-fix { color: #d9412f; text-decoration: underline 2px; text-underline-offset: 4px; }
.say-card__heard { color: var(--p-muted); }
.say-card__fix { display: flex; align-items: center; gap: var(--s-3); font-weight: 500; }
.say-card .chip { display: inline-flex; align-items: center; height: 24px; padding: 0 var(--s-3); border-radius: 999px; background: color-mix(in oklab, var(--say) 18%, #fff); color: #a3291b; font-size: 13px; }

/* lesson: two phones side by side in the lit frame, both cut by its foot */
.phones { align-items: flex-start; justify-content: center; gap: var(--s-6); padding: var(--s-8) var(--s-6) 0; overflow: hidden; }
.phones > .device { flex: 0 1 260px; }
.phones > .phones__b { margin-top: var(--s-8); }
@media (max-width: 1023px) { .phones { min-height: 320px; padding-top: var(--s-6); } .phones > .device { flex-basis: 200px; } }
@media (max-width: 639px) { .phones > .device { flex-basis: 150px; } .phones { gap: var(--s-4); min-height: 200px; } }

/* the four steps, a real sequence: one dot in its skill colour each */
.steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.steps-list li { display: block; }
.steps-list__dot { display: inline-block; width: 12px; height: 12px; margin-right: var(--s-2); border-radius: 50%; }
.steps-list strong { font-weight: 500; }

/* courses: rows, then the levels of the English path */
.course-rows { list-style: none; margin: 0; padding: 0; }
.course-rows li { display: grid; grid-template-columns: 1fr auto; gap: var(--s-1) var(--s-4); padding: var(--s-3) 0; border: 0; }
.course-rows__name { font-weight: 500; font-size: var(--t-card); }
.course-rows__status { font-size: var(--t-label); font-weight: 500; align-self: center; }
.course-rows__level { grid-column: 1 / -1; }
.course-rows li.is-soon .course-rows__name { color: var(--muted); }

/* plus: the plan's name with who it is for */
.plan-name { font: 500 var(--t-card)/1.3 var(--font-text); }
.plan-name__who { display: block; font-size: var(--t-body); font-weight: 400; }

/* review: each card's picture panel takes what the screen leaves */
.review-grid > .card { display: flex; flex-direction: column; }
.review-grid > .card > .panel { position: relative; flex: 1 1 auto; min-height: 220px; overflow: hidden; }
.review-grid .panel > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- blog: a reading column under the nav */
.page { padding: calc(var(--nav) + var(--s-8)) 0 var(--s-9); }
.page .measure, .post { max-width: 720px; }
.post-list { list-style: none; margin: var(--s-7) 0 0; padding: 0; display: grid; gap: var(--s-7); }
.post-list a { display: grid; gap: var(--s-3); color: inherit; text-decoration: none; }
.post-list img, .post__cover { width: 100%; height: auto; border-radius: var(--r-lg); aspect-ratio: 3 / 2; object-fit: cover; }
.post-list h2 { font-size: var(--t-h3); }
.post__meta { color: var(--muted); font-size: var(--t-small); }
.post__body { font-size: var(--t-body); line-height: 1.75; }
.post__body :is(h2, h3) { margin-top: var(--s-7); }
.post__body p, .post__body ul, .post__body ol { margin: var(--s-4) 0; }
.post__body a { color: var(--action); }
.chooser { min-height: 100svh; display: grid; place-items: center; padding: var(--s-7) var(--gut); }
.chooser__box { display: grid; justify-items: start; gap: var(--s-5); }
.chooser__box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.chooser__box a { font-size: var(--t-lead); }
.missing { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); max-width: 640px; }

/* a phone: the four steps a little closer; under 390 the nav's button loses its arrow so the longest
   label (ja) stays inside the right line */
@media (max-width: 639px) { .steps-list { gap: var(--s-3); } }
@media (max-width: 389px) { .nav__actions .btn > .m-arrow { display: none; } }

/* the close's word: Onest's capitals rise above the kit's .86 line, which its overflow clip cut */
.close__word { line-height: 1.02; }
/* a phone: body 17px so the splits fit one screen (still above the kit's 16) */
@media (max-width: 639px) { :root { --t-body: 17px; } }
/* the FAQ split on a tablet and a small laptop: six open answers take two screens */
@media (min-width: 1024px) and (max-width: 1279px) { #faq { --h: 2; } html:lang(zh-Hant) #faq { --h: 1; } }
@media (min-width: 640px) and (max-width: 1023px) { #faq .faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gutter); } #faq .faq > .faq__item:nth-child(2) { padding-top: 0; } }
/* a phone: the splits a little closer so words and picture fit one screen */
@media (max-width: 639px) {
  .split-col { gap: var(--s-4); }
  .grid.fill:has(> .frame--fill) { gap: var(--s-5); }
  .course-rows li { padding: var(--s-2) 0; }
  .checks { gap: var(--s-2); }
}
/* the FAQ's open answers a little closer, so five fit one screen at 1440 */
#faq .faq > .faq__item { padding-bottom: var(--s-4); }
#faq .faq > .faq__item:not(:first-child) { padding-top: var(--s-4); }
/* the footer's three link columns fill the row on a tablet */
@media (min-width: 640px) and (max-width: 1023px) { .closing__links .footer__col { grid-column: auto / span 4; } }
/* a phone: the menu holds the product links, so the footer keeps legal and languages; the courses' lead and the call's
   link to Plus (the next section) give way so words and picture fit one screen; the Plus phone stands larger */
@media (max-width: 639px) {
  .closing__links .footer__col--product { display: none; }
  .desk-lead, .desk-link { display: none; }
  #plus .phones { min-height: 760px; }
  #plus .phones > .device { flex-basis: 300px; }
}
/* the hero's second action is a text link: its words start on the page's left line when it wraps under the first */
.hero .btn-row > .btn--secondary { padding-inline: 0; }
/* a very small phone (320): the splits with a picture take two screens */
@media (max-width: 359px) {
  #lesson, #courses, #call { --hm: 2; }
  #plus .phones { min-height: 480px; }
  #plus .phones > .device { flex-basis: 200px; }
  /* the bar keeps the logo and the menu; the hero's button is the first action on screen */
  .nav:not(.is-open) .nav__actions { display: none; }
  .nav:not(.is-open) .nav__actions + .nav__toggle { margin-left: auto; }
}
