/* ============================================================
   FolioSort — Korean typography layer
   ============================================================

   Loaded LAST in <head> on /ko/ pages only, so it wins over both
   the inline <style> of the v6 homepage and css/foliosort-v2.css.

   Same reason as css/foliosort-zh.css: Outfit, DM Sans and JetBrains
   Mono ship as `-latin` subsets with no Hangul, so every Korean glyph
   falls through to the next family in the stack. The stacks below name
   the real Korean faces instead of relying on `system-ui`, which only
   resolves to a Korean face when the operating system itself is Korean.

   The Latin faces stay in front on purpose: FolioSort, macOS, EXIF,
   GPS and version numbers keep rendering in Outfit/DM Sans, and only
   the Hangul runs fall through to the Korean face.

   Two things differ from the Chinese layer:
     * Korean separates words with spaces, so lines must break at those
       spaces, not between any two syllables: `word-break: keep-all`.
     * Hangul is less dense than Han, so the leading can be a little
       tighter than the Chinese layer's.
   ============================================================ */

:root {
  /* Apple SD Gothic Neo: macOS and iOS. Malgun Gothic (맑은 고딕):
     Windows Vista+ everywhere. Noto Sans KR: Linux, Android, and anyone
     who has it. Gulim/Batang are deliberately absent — they are the old
     defaults a bare `sans-serif` can still fall back to on Windows. */
  --ko-sans: 'Apple SD Gothic Neo', 'Malgun Gothic', '맑은 고딕',
             'Noto Sans KR', 'Noto Sans CJK KR', sans-serif;
  --ko-mono: 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', monospace;

  --display: 'Outfit', var(--ko-sans);
  --body: 'DM Sans', var(--ko-sans);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, var(--ko-mono);
}

/* ── Headings ────────────────────────────────────────────────
   The Latin design sets `letter-spacing: -.015em; line-height: 1.12`.
   Negative tracking makes Hangul syllable blocks touch, and 1.12 is too
   tight for stacked jamo (받침) on two lines. */
h1, h2, h3, h4, h5,
.hero h1, .hero h2 {
  letter-spacing: normal;
  line-height: 1.4;
}

h1, .hero h1 { line-height: 1.3; }

/* ── Body copy ───────────────────────────────────────────────
   Hangul fills more of its em box than Latin, so it wants more leading
   than the Latin design; less than Chinese, since the texture is lighter. */
body {
  font-family: var(--body);
  line-height: 1.75;
}

p, li, dd, figcaption, blockquote {
  line-height: 1.8;
}

/* ── Line breaking ───────────────────────────────────────────
   Korean puts spaces between words (어절). The browser default for CJK
   text lets a line break between any two Hangul syllables, which splits
   words in the middle ("정리합니/다"). `keep-all` makes Korean break only
   at spaces, like Latin text — the standard setting on Korean sites.

   `overflow-wrap: break-word` stays as the escape hatch for a single
   word longer than its box (a long URL, a file name). `anywhere` is
   deliberately NOT used: it would let "FolioSort" split mid-word. */
body, p, li, h1, h2, h3, h4, h5, td, th, dd, dt, figcaption, blockquote {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ── Eyebrow / label text ────────────────────────────────────
   These labels carry .06em–.16em tracking plus uppercase. Uppercase is a
   no-op on Hangul, and tracking that wide pulls a Korean label apart into
   loose syllables. Same explicit list as the Chinese layer: .up__tier,
   .pr-card__tier ("PRO" / "ELITE") and .how__num ("STEP 01") are Latin by
   definition and keep the wide setting, so they are absent below. */
.eyebrow, .kicker, .act__n, .hero__eyebrow, .hero--feature .hero__eyebrow, .hero__badge,
.glance__eyebrow, .glance__card th, .mess__label, .sim__bar-title, .sim__pane-label,
.demo__col-label, .up__eyebrow, .up__badge, .foot h4, .fmt__group h3,
.tri__tag, .tag, .pill, .badge, .pcard__badge, .pcard__for,
.pr-badge, .pr-promo, .pr-table .grp td, .pr-anchor__item .who,
.tldr__facts dt, .rail span, .act__tag, .feat .new, .tools__tab .new,
.slider-mock label, .ps-panel__label, .aud .mono-tag, .says__q figcaption, .vfy__by {
  letter-spacing: .04em;
}

/* ── Italics ─────────────────────────────────────────────────
   Korean faces have no italic cut; a synthesised oblique looks like a
   rendering fault. `<i>` is left alone because it is used for icons. */
em {
  font-style: normal;
  font-weight: 600;
}

/* ── Numerals and units ──────────────────────────────────────
   Prices, version numbers and file counts stay in the Latin face. */
.price, .pcard__price, .num, time, .version {
  font-family: 'DM Sans', var(--ko-sans);
  font-feature-settings: 'tnum' 1;
}

/* ── `ch`-based measures ─────────────────────────────────────
   `ch` is the width of the digit "0" — about half a Hangul syllable —
   so a measure set in `ch` is roughly half as wide as intended once the
   text is Korean. One em is one full-width syllable. (The /ko/upgrade
   page carries its own copy of this correction for .up h1 / .up__sub,
   which live in that page's inline <style>.) */
.act__lede { max-width: 38em; }

/* ── Buttons ─────────────────────────────────────────────────
   Korean CTA labels can run longer than the English source and overflow
   buttons sized for it; let them wrap and drop the tracking. */
.btn, .btn--lg, .btn--sub {
  letter-spacing: normal;
  white-space: normal;
  text-align: center;
}
