/* Balise — Japanese typography. Loaded after palette.css on lang="ja" pages.
   Latin and numerals keep the Iowan / SF stacks (they come first in the list),
   kana and kanji fall through to Hiragino / Yu / Noto. Looser leading, no
   italics, no negative tracking on display type. */
:root:lang(ja) {
  --serif:
    "Iowan Old Style", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Yu Mincho",
    YuMincho, "Noto Serif JP", "Noto Serif CJK JP", "Palatino Linotype", Palatino, Georgia,
    serif;
  --sans:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Yu Gothic Medium", "Yu Gothic", YuGothic, "Noto Sans JP", "Noto Sans CJK JP", Meiryo,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
/* The custom elements carry their own :host font tokens; the outer document
   wins over :host, so hand them the same stacks. */
:lang(ja) balise-reveal,
:lang(ja) balise-roll,
:lang(ja) balise-ledger,
:lang(ja) balise-phone {
  --serif:
    "Iowan Old Style", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Yu Mincho",
    YuMincho, "Noto Serif JP", "Noto Serif CJK JP", "Palatino Linotype", Palatino, Georgia,
    serif;
  --sans:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Yu Gothic Medium", "Yu Gothic", YuGothic, "Noto Sans JP", "Noto Sans CJK JP", Meiryo,
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:lang(ja) body {
  line-height: 1.8;
  font-feature-settings: "palt" 0;
  text-autospace: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  line-break: strict;
}

/* Phrase-level wrapping: headline spans break between phrases (分かち書き),
   never mid-word. */
:lang(ja) h1 > span,
:lang(ja) h2 > span,
:lang(ja) h3 > span,
:lang(ja) .hero-sub > span {
  display: inline-block;
}
:lang(ja) .band h2 {
  max-width: none;
}
:lang(ja) .eyebrow,
:lang(ja) .pledges li,
:lang(ja) .stat-cap {
  text-transform: none;
}
:lang(ja) .screen-picker .pick {
  font-size: 0.8rem;
  padding: 0.5rem 0.2rem;
  white-space: nowrap;
}

/* Display type: Japanese needs air, not the −0.03em Latin squeeze. */
:lang(ja) h1,
:lang(ja) h2,
:lang(ja) h3 {
  letter-spacing: 0.01em;
  font-weight: 600;
  text-wrap: balance;
}
:lang(ja) h2 {
  font-size: clamp(1.7rem, 3vw, 2.65rem);
  line-height: 1.28;
}
:lang(ja) h2.huge {
  font-size: clamp(2rem, 4.6vw, 3.9rem);
  line-height: 1.22;
  letter-spacing: 0.01em;
}
:lang(ja) .hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.4rem);
  line-height: 1.16;
  letter-spacing: 0.01em;
}
:lang(ja) .hero-sub {
  font-size: clamp(1.25rem, 2.3vw, 1.95rem);
  line-height: 1.4;
  letter-spacing: 0.01em;
}
:lang(ja) .hero-lede,
:lang(ja) .lede,
:lang(ja) .note-a,
:lang(ja) .proof p,
:lang(ja) .open-list p,
:lang(ja) .stepline li,
:lang(ja) footer.site {
  line-height: 1.8;
}
:lang(ja) .lede {
  font-size: clamp(1rem, 1.25vw, 1.12rem);
}
:lang(ja) .hero-lede {
  font-size: clamp(0.98rem, 1.15vw, 1.08rem);
}
:lang(ja) .note-q,
:lang(ja) .tally b,
:lang(ja) .print-title,
:lang(ja) .fc-head,
:lang(ja) .open-list h3,
:lang(ja) .proof h3,
:lang(ja) .footer-brand,
:lang(ja) .brand-name {
  letter-spacing: 0.005em;
}
:lang(ja) .note-q {
  line-height: 1.45;
  font-size: 1.05rem;
}
:lang(ja) .proof h3 {
  font-size: 1.22rem;
  line-height: 1.4;
}
:lang(ja) .open-list h3 {
  line-height: 1.4;
}
:lang(ja) .fc-head {
  line-height: 1.35;
}
:lang(ja) .print-title {
  line-height: 1.35;
  font-size: 1.15rem;
}
:lang(ja) .fc-val {
  line-height: 1.45;
}

/* Legal pages (ja/privacy, ja/terms): the section h2 keeps the legal size, not the
   homepage display size; the in-page style block sets the rest. */
:lang(ja) .legal h2 {
  font-size: 1.25rem;
  line-height: 1.5;
  margin: 1.75rem 0 0.55rem;
  text-wrap: pretty;
}
:lang(ja) .legal h2.legal-title {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  line-height: 1.4;
  margin: 0 0 0.5rem;
}
:lang(ja) .legal p,
:lang(ja) .legal li {
  line-height: 1.85;
}

/* Legal / FAQ page headings: no balancing (it splits kanji words); the short
   tile titles break at punctuation first, anywhere only as a last resort. */
:lang(ja) .legal h3,
:lang(ja) .pg-flow strong,
:lang(ja) .pg-faq summary,
:lang(ja) .pg-faq-group h2,
:lang(ja) .pg-flow-head,
:lang(ja) .pg-plain h1,
:lang(ja) .pg-faq h1 {
  text-wrap: pretty;
}
:lang(ja) .pg-tile h2 {
  text-wrap: pretty;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

/* No italics in Japanese: the roman numeral in the proofs stays roman. */
:lang(ja) .proof-num {
  font-style: normal;
  font-weight: 600;
}
:lang(ja) em {
  font-style: normal;
}

/* Kickers and small caps labels: Latin stays mono-caps; Japanese kicker text
   is set in the sans, tracked, never uppercase-transformed (no-op anyway). */
:lang(ja) .kicker,
:lang(ja) .eyebrow,
:lang(ja) .note-tag,
:lang(ja) .stat-cap,
:lang(ja) .pledges li,
:lang(ja) .tally span,
:lang(ja) .fc-kicker,
:lang(ja) .fc-lbl,
:lang(ja) .print-kick,
:lang(ja) .roll-head {
  font-family: var(--mono), var(--sans);
  letter-spacing: 0.1em;
}
:lang(ja) .kicker,
:lang(ja) .eyebrow {
  font-size: 0.72rem;
}
:lang(ja) .stat-cap {
  font-size: 0.74rem;
  line-height: 1.7;
}
:lang(ja) .stat-num small {
  font-family: var(--sans);
  font-size: 0.2em;
  letter-spacing: 0.02em;
  vertical-align: 0.65em;
  font-weight: 650;
}
:lang(ja) .stepline b {
  letter-spacing: 0.06em;
}
:lang(ja) .stepline .ticket em {
  letter-spacing: 0.06em;
}
:lang(ja) .stepline li {
  grid-template-columns: 4.2rem minmax(0, 1fr);
}
:lang(ja) .tally span {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  line-height: 1.6;
}
:lang(ja) .pledges li {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  font-weight: 600;
}
:lang(ja) .fc-lbl {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  line-height: 1.3;
}
:lang(ja) .print-count {
  white-space: nowrap;
}
:lang(ja) .print-meta,
:lang(ja) .roll-note {
  line-height: 1.6;
}
:lang(ja) .waitlist-dialog h2 {
  line-height: 1.25;
  font-size: clamp(1.8rem, 3.6vw, 2.3rem);
}
:lang(ja) .dialog-lede,
:lang(ja) .dialog-fine {
  line-height: 1.75;
}

/* Buttons and inputs: a hair bigger, Japanese needs the x-height. */
:lang(ja) .btn {
  letter-spacing: 0.02em;
  font-weight: 650;
}
:lang(ja) nav.primary a:not(.btn) {
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}
:lang(ja) .screen-picker .pick {
  letter-spacing: 0.02em;
}

/* Language switcher (footer). */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  font-weight: 600;
}
.lang-switch::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--balise-gold);
}

/* Narrow screens: Japanese display type shrinks a touch more than Latin. */
@media (max-width: 959px) {
  :lang(ja) .hero h1 {
    font-size: clamp(2rem, 9vw, 2.75rem);
    line-height: 1.2;
  }
  :lang(ja) .hero-sub {
    font-size: clamp(1.1rem, 4.6vw, 1.35rem);
  }
}
@media (max-width: 640px) {
  :lang(ja) h2 {
    font-size: 1.6rem;
  }
  :lang(ja) h2.huge {
    font-size: 1.95rem;
  }
  :lang(ja) .stat-cap {
    max-width: 15rem;
  }
}
