/* KCD Japanese composition, 2026-10-28.
   This is the sole owner of wrapping for data-jp blocks. Build-time <wbr>
   candidates work without JS and without browser-specific phrase detection.
   The page styles own layout, illustration, color, and scroll choreography. */
:root {
  --jp-body-size: clamp(1rem, .94rem + .16vw, 1.125rem);
  --jp-body-leading: 1.95;
  --jp-body-tracking: .025em;
  --jp-reading-measure: 43em;
  --jp-paragraph-gap: 1.5em;
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html[lang="ja"] body [data-jp] {
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere; /* emergency escape for a phrase wider than its box */
  line-break: strict;
  text-wrap: wrap;
  min-inline-size: 0;
}
/* Inline presentation wrappers cannot override the paragraph's break model. */
html[lang="ja"] body [data-jp] :where(.jp-keep,.jp-phrase,.editorial-line,.display-line,.hero-line,.fr-semantic-line,.fr-word-unit,.fuku-traces-quote-line,.services-title-line,.contact-title-line,.kcd-unified-phrase) {
  white-space: inherit;
  word-break: inherit;
  overflow-wrap: inherit;
}
/* Authored short titles (.keep) retain their original protection. These bonds
   implement paired-punctuation kinsoku only; they are not word-unit spans. */
html[lang="ja"] body [data-jp] [data-jp-punct] {
  all: unset; /* page-local span labels must never style punctuation bonds */
  white-space: nowrap;
}
html[lang="ja"] body [data-jp="prose"] {
  font-size: var(--jp-body-size);
  line-height: var(--jp-body-leading);
  letter-spacing: var(--jp-body-tracking);
  max-inline-size: var(--jp-reading-measure);
}
html[lang="ja"] body [data-jp="prose"] + [data-jp="prose"] {
  margin-block-start: var(--jp-paragraph-gap);
}
html[lang="ja"] body [data-jp="quote"] {
  line-height: 1.9;
  letter-spacing: .025em;
}
html[lang="ja"] body [data-jp="caption"],
html[lang="ja"] body [data-jp="note"] {
  line-height: 1.9;
  letter-spacing: .025em;
}
html[lang="ja"] body [data-jp-fallback] { word-break: normal; }
html[lang="ja"] body .error-page h1[data-jp] {
  font-size: clamp(1.75rem, 6.5vw, 5.5rem);
  line-height: 1.5;
  letter-spacing: .025em;
}
/* Bounded scale across all acts, including multi-column desktop scenes. */
.form-record {
  --fr-reading: 48rem;
  --jp-body-size: clamp(1.03125rem, .95rem + .2vw, 1.25rem);
}
.form-record .fr-reading--offset { margin-inline-start: 0; }
.form-record .fr-title { font-size: clamp(2.75rem, 4vw, 4.875rem); line-height: 1.5; letter-spacing: .04em; }
.form-record .fr-display { font-size: clamp(2.625rem, 3vw, 3.625rem); line-height: 1.7; letter-spacing: .035em; }
.form-record .fr-display--b { font-size: clamp(2.25rem, 2.4vw, 2.75rem); }
.form-record .fr-display--c { font-size: clamp(1.75rem, 1.8vw, 2.25rem); }
.form-record .fr-act-heading,
.form-record .fr-epilogue-title { font-size: clamp(2.25rem, 2.4vw, 3rem); line-height: 1.7; letter-spacing: .035em; }
.form-record .fr-dir-conclusion { font-size: clamp(1.75rem, 2vw, 2.25rem); line-height: 1.75; letter-spacing: .025em; }
.form-record .fr-observe-step p { font-size: clamp(1.75rem, 2vw, 2.375rem); line-height: 1.8; letter-spacing: .025em; }
.form-record br.fr-editorial-break { display: block; }
/* Browser adjustments belong here, never in a browser-specific page patch. */
.yamanikiru-record-page .yk-record-ending p:first-of-type { line-height: 1.72; letter-spacing: .015em; }
@media (max-width: 900px) {
  .form-record .fr-title { font-size: clamp(1.5625rem, 7.5vw, 3.375rem); line-height: 1.65; letter-spacing: .025em; }
  .form-record .fr-display { font-size: clamp(1.5rem, 6.5vw, 2.5rem); line-height: 1.8; letter-spacing: .025em; }
  .form-record .fr-display--b { font-size: clamp(1.25rem, 5.6vw, 2rem); }
  .form-record .fr-display--c { font-size: clamp(1.125rem, 5vw, 1.75rem); }
  .form-record .fr-act-heading,
  .form-record .fr-epilogue-title { font-size: clamp(1.3125rem, 5.5vw, 2rem); line-height: 1.8; letter-spacing: .025em; }
  .form-record .fr-dir-conclusion,
  .form-record .fr-observe-step p { font-size: clamp(1.25rem, 5.2vw, 1.75rem); line-height: 1.85; }
  .form-record [data-jp] br.fr-editorial-break,
  html[lang="ja"] body [data-jp="heading"] br { display: none; }
  /* Poetic quotations and addresses retain their authored line endings. */
  .form-record .fr-element-copy { margin-block-start: clamp(3rem, 10vw, 5rem); }
  .form-record .fr-element-end { margin-block-start: clamp(3.5rem, 12vw, 6rem); }
  .yamanikiru-record-page .yk-record-ending p:first-of-type { font-size: clamp(1.4375rem, 6.35vw, 1.5625rem); }
  .yamanikiru-record-page .yk-record-ending p+p { font-size: clamp(1rem, 4.65vw, 1.125rem); line-height: 2.08; letter-spacing: .018em; }
}

/* Real-device Safari hero lineation: keep each subject readable on phones. */
@media (max-width:560px) {
  .yamanikiru-record-page .yk-record-hero h1[data-jp="heading"] br {
    display: block;
  }
  html[lang="ja"] body .fuku-hero--photo h1[data-jp="heading"] br {
    display: block;
  }
}
