/* Homepage reading and layout pass. Loaded after the original styles. */
html {
  /* A chapter link must not animate through more than 100,000px of content. */
  scroll-behavior: auto !important;
}

body > main :is(h1, h2, h3) .jp-no-orphan {
  /* Display headlines without a forced four-character ending group. */
  display: contents !important;
}

/* The punctuation guard is layout-only. Section span rules were making its
   last characters 8–17px, dim, or red while the sentence remained larger. */
body > main.is-ready .jp-no-orphan {
  font: inherit !important;
  color: inherit !important;
  letter-spacing: inherit !important;
  line-height: inherit !important;
  opacity: 1 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Many emphasized sentences inherited a generic 8–17px span rule even
   though their surrounding strong text is 20–43px. Keep their type scale. */
body > main.is-ready strong > .js-split,
body > main.is-ready strong > .js-split .split-char {
  font: inherit !important;
  color: inherit !important;
  letter-spacing: inherit !important;
  line-height: inherit !important;
}

body > main.is-ready strong > .js-split {
  opacity: 1 !important;
}

body > main.is-ready :is(
  .school-money-compare p > span,
  .keizoku-examples p > span,
  .batta-three-values p > span,
  .money-steps li > span,
  .mottainai-proof-steps li > span
) {
  font-size: 12px !important;
  line-height: 1.55 !important;
  letter-spacing: .08em !important;
}

body > main.is-ready .batta-value-stand > span {
  display: block;
  margin: 0 0 clamp(16px, 2vw, 24px) !important;
  color: #f0ece3 !important;
  font-size: clamp(30px, 4vw, 42px) !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  letter-spacing: -.04em !important;
}

body > main.is-ready .batta-epilogue .batta-remember {
  font-size: clamp(48px, 4.5vw, 64px) !important;
  line-height: 1.2 !important;
  letter-spacing: -.075em !important;
}

@media (max-width: 640px) {
  body > main.is-ready .batta-epilogue .batta-remember {
    width: calc(100% + 22px) !important;
    max-width: none !important;
    margin-left: -22px;
    white-space: nowrap;
  }
}

body > main.is-ready :is(.heading-note, .discipline-body, .school-cover-lead) {
  color: rgb(240 236 227 / 88%) !important;
  font-size: clamp(16px, 1.25vw, 18px) !important;
  line-height: 1.85 !important;
}

body > main.is-ready .school-cover-hook {
  color: #f0ece3 !important;
  font-size: clamp(16px, 1.35vw, 19px) !important;
  line-height: 1.6 !important;
}

body > main.is-ready #works .discipline-main > p,
body > main.is-ready :is(.school-truth-label, .batta-label, .freedom-index, .dekinai-overline, .mottainai-overline) {
  font-size: 12px !important;
}

/* A generic nested-span rule was turning every animated character into a row. */
#freedom .freedom-manage-list .split-char,
#honki .honki-sequence strong .split-char,
#profile .profile-name .split-char {
  display: inline-block !important;
  width: auto !important;
  margin: 0 !important;
}

#freedom .freedom-manage-list .js-split,
#honki .honki-sequence strong .js-split {
  max-width: 100%;
  line-break: strict;
  overflow-wrap: normal;
}

/* Let the money chapter finish with its actual thesis, not body copy. */
body > main.is-ready .money-epilogue-inner > p:nth-of-type(2) {
  max-width: 720px;
  margin: clamp(48px, 8vw, 88px) auto 0;
  color: #f0ece3;
  font-size: clamp(28px, 4.4vw, 38px);
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: -.035em;
  text-wrap: balance;
}

body > main.is-ready .money-epilogue-inner > p:nth-of-type(2) strong {
  color: #ee4354;
  font: inherit;
}

body > main.is-ready .money-epilogue-inner > p:nth-of-type(3) {
  max-width: 700px;
  margin: 20px auto 0;
  color: #f0ece3;
  font-size: clamp(23px, 3.1vw, 27px);
  font-weight: 600;
  line-height: 1.7;
  letter-spacing: -.02em;
  text-wrap: balance;
}

/* Match the closing essays to the black, white and red stage of 手放す勇気. */
body > main.is-ready .money-manifesto,
body > main.is-ready .dekinai-theory,
body > main.is-ready .mottainai-theory {
  color: #f2f1ee;
  background: linear-gradient(rgb(255 255 255 / 1.6%) 1px, transparent 1px) 0 0 / 70px 70px,
    linear-gradient(90deg, rgb(255 255 255 / 1.6%) 1px, transparent 1px) 0 0 / 70px 70px,
    #020202 !important;
}

body > main.is-ready .money-manifesto {
  --money-red: #ff1832;
  --money-ink: #020202;
  --money-muted: rgb(255 255 255 / 72%);
  --money-line: rgb(255 255 255 / 14%);
}

body > main.is-ready .dekinai-theory {
  --dk-red: #ff1832;
  --dk-ink: #020202;
  --dk-muted: rgb(255 255 255 / 72%);
  --dk-line: rgb(255 255 255 / 14%);
}

body > main.is-ready .mottainai-theory {
  --mt-red: #ff1832;
  --mt-ink: #020202;
  --mt-muted: rgb(255 255 255 / 72%);
  --mt-line: rgb(255 255 255 / 14%);
}

body > main.is-ready :is(.money-scene, .dekinai-scene, .mottainai-scene) {
  background: linear-gradient(90deg, transparent 0 49.92%, rgb(209 8 28 / 12%) 50%, transparent 50.08%), #030303;
}

body > main.is-ready :is(.money-opening, .dekinai-opening, .mottainai-opening) {
  isolation: isolate;
  overflow: hidden;
  background: radial-gradient(circle at 72% 48%, rgb(209 8 28 / 25%), transparent 28%),
    linear-gradient(112deg, #000 0 54%, #150004 75%, #000 100%);
  border-top: 1px solid rgb(209 8 28 / 40%);
  border-bottom: 1px solid rgb(209 8 28 / 38%);
}

body > main.is-ready :is(.money-opening, .dekinai-opening, .mottainai-opening)::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 56%;
  left: -8%;
  width: 116%;
  height: clamp(33px, 5vw, 74px);
  pointer-events: none;
  opacity: .82;
  clip-path: polygon(0 43%, 8% 17%, 64% 5%, 100% 29%, 94% 69%, 20% 96%, 3% 77%);
  background: linear-gradient(90deg, transparent 0 3%, rgb(209 8 28 / 92%) 15% 84%, transparent 98%),
    repeating-linear-gradient(175deg, transparent 0 7px, rgb(255 255 255 / 24%) 8px 9px);
  transform: rotate(-2deg) scaleX(0);
  transform-origin: left center;
}

body > main.is-ready :is(.money-opening.money-seen, .dekinai-opening.dekinai-seen, .mottainai-opening.mottainai-seen)::after {
  animation: closing-essay-slash 1.25s cubic-bezier(.77, 0, .18, 1) .55s forwards;
}

body > main.is-ready :is(.money-opening-copy, .money-clock, .dekinai-opening-copy, .dekinai-wall, .mottainai-opening-copy, .mottainai-mountain) {
  position: relative;
  z-index: 2;
}

body > main.is-ready :is(.money-opening, .dekinai-opening, .mottainai-opening) h2 {
  color: #fff;
  text-shadow: 2px 0 rgb(255 255 255 / 55%), 14px 0 rgb(209 8 28 / 18%), 0 0 54px rgb(209 8 28 / 12%);
}

body > main.is-ready :is(.money-opening, .dekinai-opening, .mottainai-opening) :is(.money-overline, .dekinai-overline, .mottainai-overline) {
  color: rgb(255 255 255 / 70%);
}

body > main.is-ready .money-opening .money-lead strong {
  color: #ff334b;
  text-shadow: 0 0 24px rgb(209 8 28 / 16%);
}

body > main.is-ready :is(.money-scene.money-seen .money-char, .dekinai-scene.dekinai-seen .dekinai-char, .mottainai-scene.mottainai-seen .mottainai-char) {
  transition: none;
  animation: closing-essay-character 1.05s cubic-bezier(.16, 1, .3, 1) both;
  animation-delay: calc(var(--money-char-index, var(--dk-char-index, var(--mt-char-index, 0))) * 38ms);
}

@keyframes closing-essay-slash {
  from { transform: rotate(-2deg) scaleX(0); }
  to { transform: rotate(-2deg) scaleX(1); }
}

@keyframes closing-essay-character {
  from { opacity: 0; filter: blur(12px); transform: translate(.45em, 1.1em) rotate(6deg) scale(1.2); }
  52% { opacity: 1; filter: blur(0); transform: translate(-.05em, -.08em) rotate(-1deg) scale(1.03); }
  to { opacity: 1; filter: blur(0); transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  body > main.is-ready :is(.money-opening, .dekinai-opening, .mottainai-opening)::after,
  body > main.is-ready :is(.money-scene.money-seen .money-char, .dekinai-scene.dekinai-seen .dekinai-char, .mottainai-scene.mottainai-seen .mottainai-char) {
    animation: none !important;
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
  }
}

@media (max-width: 640px) {
  body > main.is-ready .site-header {
    height: 64px;
    padding-inline: 20px;
  }

  body > main.is-ready .header-cta {
    font-size: 12px !important;
    letter-spacing: .12em;
  }

  body > main.is-ready .hero-role {
    right: 20px;
    bottom: 23px;
    font-size: clamp(10.5px, 2.9vw, 11.5px) !important;
    letter-spacing: .12em;
  }

  body > main.is-ready :is(
    .eyebrow,
    .section-index,
    .music-portal-index,
    .novel-portal-index,
    .freedom-index,
    .lc-index,
    .lc-scene-index,
    .profile-kicker,
    .profile-roles,
    .school-cover-meta,
    .keizoku-cover-meta,
    .batta-cover-meta,
    .life-cover-meta,
    .school-truth-label,
    .batta-label,
    .release-scene-index,
    .money-overline,
    .dekinai-overline,
    .mottainai-overline
  ) {
    color: rgb(255 255 255 / 76%) !important;
    font-size: 11.5px !important;
    line-height: 1.55 !important;
    letter-spacing: .12em !important;
  }

  body > main.is-ready :is(
    .section-index,
    .music-portal-index,
    .novel-portal-index,
    .school-truth-label,
    .batta-label,
    .release-scene-index
  ) {
    color: #e65764 !important;
  }

  body > main.is-ready :is(
    .manifesto-copy p,
    .heading-note,
    .discipline-body,
    .music-portal-body,
    .school-cover-lead,
    .school-result,
    .school-copy,
    .keizoku-small,
    .keizoku-definition,
    .batta-copy,
    .honki-copy,
    .life-copy,
    .release-copy p,
    .release-memory,
    .profile-intro p,
    .closing-last-word
  ) {
    color: rgb(255 255 255 / 88%) !important;
    font-size: clamp(16px, 4.15vw, 18px) !important;
    line-height: 1.9 !important;
    letter-spacing: .01em;
  }

  body > main.is-ready #tebanasu-title {
    font-size: clamp(46px, 12vw, 54px) !important;
    line-height: 1.25 !important;
    letter-spacing: -.065em !important;
  }

  body > main.is-ready :is(#school-title, #batta-title, #honki-title, #life-title, #love-continuation-title) {
    max-width: 100%;
    overflow: visible !important;
    line-break: strict;
    overflow-wrap: normal;
  }

  body > main.is-ready :is(
    .school-scene,
    .keizoku-scene,
    .batta-scene,
    .honki-chapter,
    .life-scene,
    .release-scene,
    .freedom-scene,
    .lc-scene,
    .money-scene,
    .dekinai-scene,
    .mottainai-scene
  ) {
    min-height: min(76svh, 700px) !important;
    padding-top: clamp(96px, 14svh, 130px) !important;
    padding-bottom: clamp(96px, 14svh, 130px) !important;
  }

  body > main.is-ready .freedom-manage-list p {
    padding: 20px 12px;
    background: linear-gradient(90deg, rgb(0 0 0 / 94%), rgb(0 0 0 / 80%));
    border-left: 2px solid #d12237;
  }

  body > main.is-ready .freedom-manage-list strong {
    font-size: clamp(18px, 4.7vw, 22px);
    line-height: 1.65;
  }

  body > main.is-ready .dekinai-black-box > p {
    color: rgb(240 236 227 / 82%) !important;
    font-size: 15px !important;
    line-height: 1.65 !important;
  }

  body > main.is-ready #works .discipline-main > p {
    font-size: 11.5px !important;
    letter-spacing: .12em !important;
  }
}

@media (max-width: 360px) {
  body > main.is-ready #mottainai-title {
    width: calc(100% + 12px);
    max-width: none;
    margin-left: -6px;
    font-size: 44px !important;
  }

  body > main.is-ready .tebanasu-cover::before {
    top: 51%;
    opacity: .62;
  }

  body > main.is-ready #tebanasu-title {
    font-size: 44px !important;
  }

  body > main.is-ready .hero-role {
    font-size: 10px !important;
    letter-spacing: .08em;
  }
}

@media (prefers-reduced-motion: reduce) {
  body > main :is(.js-split, [data-reveal], .js-reveal),
  body > main :is(.split-char, .jp-no-orphan) {
    opacity: 1 !important;
    filter: none !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }
}

/* Keep the animated memory box clear of the story and conclusion on phones. */
@media (max-width: 640px) {
  body > main.is-ready .release-prologue .memory-box {
    margin: clamp(135px, 27vw, 165px) auto 52px;
    animation: memory-box-mobile 5s ease-in-out infinite;
  }
}

@keyframes memory-box-mobile {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-5px) rotate(0deg); }
}

@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
  body > main.is-ready .release-prologue .memory-box {
    animation: none;
  }
}

/* Keep the empty-cup illustration in its own space on narrow screens. */
@media (max-width: 800px) {
  .release-scene.release-cup {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
    padding: 110px 24px 108px;
  }
  .release-cup .release-copy { order: 1; }
  .release-cup h3 { order: 2; margin-top: 32px; }
  .release-cup .cup-art {
    order: 3;
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    flex: none;
    width: 110px;
    height: 180px;
    margin: 100px auto 0;
    transform: none;
  }
  .release-cup .release-boxed {
    order: 4;
    margin-top: 48px;
  }
}
