/**
 * Resonant LMS-XP5 GI Typography System v2.9.5
 * Loaded after style.css. Keeps phrase boundaries meaningful in Japanese.
 */
:root {
  --rs-type-hero-home: clamp(3rem, 3.35vw, 4rem);
  --rs-type-hero-page: clamp(2.625rem, 3vw, 3.5rem);
  --rs-type-section: clamp(1.875rem, 2.4vw, 2.75rem);
  --rs-type-card: clamp(1.25rem, 1.45vw, 1.75rem);
  --rs-type-body: clamp(0.9375rem, calc(0.8rem + 0.25vw), 1.0625rem);
}

/* Phrase-aware wrapping: lines may wrap only between these inline blocks. */
.hero-title__line,
.hero-subtitle__phrases,
.rs-page-title__phrases,
.rs-heading-phrases,
.rs-phrase-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.28em;
  row-gap: 0.08em;
}

.hero-title__line {
  width: 100%;
}

.hero-title__line--message {
  margin-top: 0.08em;
}

.hero-title__phrase,
.hero-title__accent,
.hero-subtitle__phrases .rs-heading-phrase,
.rs-page-title__phrases .rs-heading-phrase,
.rs-heading-phrases .rs-heading-phrase,
.rs-phrase-heading > .rs-heading-phrase,
.rs-term,
.rs-nowrap {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
}

.rs-heading-text {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
}

/* Japanese headings: strict punctuation and phrase-oriented native wrapping. */
.rs-hero__title,
.rs-page-hero__title,
.rs-heading,
.rs-experience h2,
.rs-contact-flow h2,
.rs-contact-side h2,
.rs-contact-form-card h2,
.rs-contact-privacy h2,
.rs-policy-intro h2,
.rs-policy-cta h2,
.rs-card h3,
.rs-contact-flow__card h3,
.rs-policy-card h3 {
  line-break: strict;
  overflow-wrap: normal;
  text-wrap: balance;
  word-break: normal;
  word-break: auto-phrase;
}

/* The home Hero is the only level that reaches 64px on desktop. */
body.home .rs-hero--v26 .rs-hero__grid {
  grid-template-columns: minmax(480px, 0.9fr) minmax(620px, 1.1fr);
  gap: clamp(20px, 2.5vw, 48px);
}

body.home .rs-hero--v26 .rs-hero__copy {
  min-width: 0;
  max-width: 720px;
}

body.home .rs-hero--v26 .rs-hero__title {
  font-size: var(--rs-type-hero-home);
  line-height: 1.08;
  letter-spacing: -0.045em;
  max-width: none;
}

body.home .rs-hero--v26 .rs-hero__en {
  font-size: clamp(0.875rem, 1vw, 1.125rem);
  line-height: 1.45;
}

/* All subpage templates share one Hero scale. */
body:not(.home) .rs-page-hero .rs-page-hero__title,
body:not(.home) .rs-contact-hero .rs-page-hero__title,
body:not(.home) .rs-policy-hero .rs-page-hero__title {
  font-size: var(--rs-type-hero-page);
  line-height: 1.12;
  letter-spacing: -0.035em;
  max-width: min(100%, 18em);
}

body:not(.home) .rs-contact-hero__grid,
body:not(.home) .rs-policy-hero__grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
  gap: clamp(28px, 4vw, 72px);
}

/* Shared section, card and body hierarchy. */
.rs-heading,
.rs-experience h2,
.rs-contact-flow h2,
.rs-contact-side > h2,
.rs-contact-form-card > h2,
.rs-contact-privacy h2,
.rs-policy-intro h2,
.rs-policy-cta h2,
.entry-content > h2 {
  font-size: var(--rs-type-section);
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.rs-card h3,
.rs-contact-flow__card h3,
.rs-policy-card h3,
.rs-archive-card h2,
.entry-content > h3 {
  font-size: var(--rs-type-card);
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.rs-lead,
.rs-experience p,
.rs-page-hero__lead,
.rs-contact-hero__lead,
.rs-contact-side > p,
.rs-contact-form-card__intro,
.rs-policy-intro > p,
.rs-policy-card > p,
.rs-policy-card > ol,
.rs-content-surface > p {
  font-size: var(--rs-type-body);
  line-height: 1.85;
}

@media (max-width: 1180px) {
  body.home .rs-hero--v26 .rs-hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(32px, 6vw, 64px);
  }

  body.home .rs-hero--v26 .rs-hero__copy {
    max-width: 760px;
  }
}

@media (max-width: 900px) {
  body:not(.home) .rs-contact-hero__grid,
  body:not(.home) .rs-policy-hero__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

@media (max-width: 820px) {
  :root {
    --rs-type-hero-home: clamp(2.125rem, 10.8vw, 2.625rem);
    --rs-type-hero-page: clamp(2rem, 9.5vw, 2.4375rem);
    --rs-type-section: clamp(1.75rem, 7.2vw, 2.25rem);
    --rs-type-card: clamp(1.125rem, 5.2vw, 1.375rem);
    --rs-type-body: clamp(0.9375rem, 3.9vw, 1rem);
  }

  body.home .rs-hero--v26 .rs-hero__title,
  body:not(.home) .rs-page-hero .rs-page-hero__title,
  body:not(.home) .rs-contact-hero .rs-page-hero__title,
  body:not(.home) .rs-policy-hero .rs-page-hero__title {
    line-height: 1.14;
    letter-spacing: -0.035em;
  }

  body.home .rs-hero--v26 .rs-hero__grid {
    gap: 32px;
  }
}

@media (max-width: 390px) {
  .hero-title__line,
  .hero-subtitle__phrases,
  .rs-page-title__phrases,
  .rs-heading-phrases,
  .rs-phrase-heading {
    column-gap: 0.2em;
  }

  body.home .rs-hero--v26 .rs-hero__copy,
  body:not(.home) .rs-page-hero__inner,
  body:not(.home) .rs-contact-hero__grid,
  body:not(.home) .rs-policy-hero__grid {
    min-width: 0;
  }
}
