/* Homepage — colors & feel from character concept PNGs
   soft tomato pink / sage / lavender / paper white / pencil charcoal */

html.theme-impact body.page-home {
  --home-paper: #ffffff;
  --home-ink: #4a4644;
  --home-ink-soft: #7a7470;
  --home-tomato: #e8a0a8;
  --home-tomato-deep: #d88892;
  --home-tomato-wash: #f6d4d8;
  --home-leaf: #9cbc9a;
  --home-leaf-deep: #7a9e78;
  --home-oni: #b89acc;
  --home-oni-deep: #9a7eb0;
  --home-shadow: #e4e6ef;
  --home-line: #c8c4c0;
  --home-carrot: #e0c0a0;
  --home-dot: 8px;
  --home-dot-line-size: 4px;
  --home-pixel-shadow: 4px 4px 0 color-mix(in srgb, var(--home-ink) 14%, transparent);
  /* 点線は白寄せピンクで弱め（グレー混じりにしない） */
  --home-dot-line: repeating-linear-gradient(
    to right,
    color-mix(in srgb, var(--home-tomato) 42%, white) 0 var(--home-dot-line-size),
    transparent var(--home-dot-line-size) calc(var(--home-dot-line-size) * 2)
  );
  --home-dot-line-soft: repeating-linear-gradient(
    to right,
    color-mix(in srgb, var(--home-tomato-wash) 70%, white) 0 var(--home-dot-line-size),
    transparent var(--home-dot-line-size) calc(var(--home-dot-line-size) * 2)
  );
}

/* 8pxドット格子（カーソルと同系） */
html.theme-impact body.page-home .home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--home-ink) 12%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--home-ink) 12%, transparent) 1px, transparent 1px);
  background-size: var(--home-dot) var(--home-dot);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 78%);
}

html.theme-impact body.page-home .blog-section-label {
  position: relative;
  display: inline-block;
  /* ドット2つ（本体 + box-shadow）分 + 文字との隙間 */
  padding-left: calc(var(--home-dot) * 2 + 12px);
  font-family: var(--imp-display);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: none;
}

html.theme-impact body.page-home .blog-section-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: var(--home-dot);
  height: var(--home-dot);
  margin-top: calc(var(--home-dot) / -2);
  background: var(--home-tomato);
  box-shadow: var(--home-dot) 0 0 var(--home-tomato-wash);
}

html.theme-impact body.page-home .home-cta {
  border-radius: 0;
  border-width: 2px;
  box-shadow: var(--home-pixel-shadow);
  image-rendering: pixelated;
}

html.theme-impact body.page-home .home-rules {
  border-top-width: 3px;
  border-top-style: solid;
  border-top-color: var(--home-tomato);
}

html.theme-impact body.page-home .home-rules-num {
  min-width: 2em;
  font-variant-numeric: tabular-nums;
}

html.theme-impact body.page-home .page-body {
  padding-top: 0;
  background: var(--home-paper);
}

/* ヒーロー以外は少し狭め（読みやすいカラム幅） */
html.theme-impact body.page-home .page-body-inner {
  width: min(960px, 68%);
  max-width: min(960px, 68%);
}

@media (max-width: 767px) {
  html.theme-impact body.page-home .page-body-inner {
    width: calc(100% - 2 * clamp(12px, 4vw, 24px));
    max-width: calc(100% - 2 * clamp(12px, 4vw, 24px));
  }
}

html.theme-impact body.page-home .blog-section-label {
  color: var(--home-tomato-deep);
}

html.theme-impact body.page-home .blog-section-head h1,
html.theme-impact body.page-home .blog-section-head h2 {
  color: var(--home-ink);
  font-family: var(--imp-display);
  letter-spacing: 0.02em;
  line-height: 1.35;
}

html.theme-impact body.page-home .blog-section-head p {
  color: var(--home-ink-soft);
}

.home-hero {
  position: relative;
  overflow: hidden;
  min-height: min(92vh, 820px);
  display: grid;
  align-items: end;
  background:
    radial-gradient(ellipse 70% 55% at 82% 30%, color-mix(in srgb, var(--home-tomato-wash) 55%, white) 0%, transparent 70%),
    radial-gradient(ellipse 45% 40% at 8% 78%, color-mix(in srgb, var(--home-leaf) 18%, white) 0%, transparent 65%),
    #ffffff;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: -10% -5%;
  z-index: 0;
  background:
    radial-gradient(closest-side at 20% 25%, rgba(232, 160, 168, 0.18), transparent 100%),
    radial-gradient(closest-side at 70% 70%, rgba(184, 154, 204, 0.1), transparent 100%);
  filter: blur(8px);
  pointer-events: none;
}

.home-hero-inner {
  position: relative;
  z-index: 1;
  width: min(100%, var(--imp-content-width, 80%));
  margin-inline: auto;
  padding:
    clamp(96px, 14vh, 140px)
    var(--imp-gutter-x, clamp(16px, 4vw, 48px))
    clamp(40px, 7vh, 72px);
  display: grid;
  gap: clamp(28px, 5vw, 56px);
  align-items: end;
}

@media (min-width: 900px) {
  .home-hero-inner {
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  }
}

.home-hero-brand {
  margin: 0 0 0.2em;
  font-family: var(--imp-en);
  font-size: clamp(3.4rem, 10vw, 6.5rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0.06em;
  color: var(--home-tomato-deep);
}

.home-hero h1 {
  margin: 0 0 0.55em;
  max-width: 18em;
  font-family: var(--imp-display);
  font-size: clamp(1.35rem, 3.2vw, 2rem);
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: var(--home-ink);
}

.home-hero-lead {
  margin: 0 0 1.4em;
  max-width: 34em;
  font-size: clamp(0.95rem, 1.5vw, 1.08rem);
  line-height: 1.8;
  color: var(--home-ink-soft);
}

.home-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.home-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.55em 1.25em;
  border: 1.5px solid var(--home-ink);
  border-radius: 4px;
  background: var(--home-tomato);
  color: #fff;
  font-family: var(--imp-display);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-decoration: none;
  box-shadow: 3px 3px 0 color-mix(in srgb, var(--home-ink) 16%, transparent);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.home-cta:hover {
  background: var(--home-tomato-deep);
  transform: translateY(-2px);
  box-shadow: 2px 5px 0 color-mix(in srgb, var(--home-ink) 18%, transparent);
}

.home-cta--ghost {
  background: #fff;
  color: var(--home-ink);
}

.home-cta--ghost:hover {
  background: color-mix(in srgb, var(--home-tomato-wash) 70%, white);
}

.home-hero-art {
  margin: 0;
  justify-self: center;
  width: min(100%, 420px);
  animation: home-bob 3.6s ease-in-out infinite;
}

.home-hero-art img {
  display: block;
  width: 100%;
  height: auto;
  /* soft paper shadow like watercolor sitting on page */
  filter: drop-shadow(0 14px 0 var(--home-shadow));
}

@keyframes home-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-hero-art {
    animation: none;
  }
}

.home-body {
  padding-block: clamp(48px, 8vw, 96px);
}

.home-section {
  scroll-margin-top: calc(var(--header-h, 72px) + 16px);
}

.home-section + .home-section {
  margin-top: clamp(56px, 9vw, 96px);
}

html.theme-impact body.page-home .home-section--progress .blog-more-link {
  border-radius: 0;
  border-color: var(--home-ink);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--home-tomato) 70%, transparent);
}

html.theme-impact body.page-home .home-section--progress .blog-more-link:hover {
  background: var(--home-tomato);
  color: #fff;
  box-shadow: 4px 4px 0 var(--home-ink);
}

/* 進捗ブロックは読みやすい幅に絞る + 左画像／右テキスト */
.home-section--progress {
  width: min(100%, 760px);
  margin-inline: auto;
}

html.theme-impact body.page-home .home-section--progress .blog-articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

html.theme-impact body.page-home .home-section--progress .blog-article-card,
html.theme-impact body.page-home .home-section--progress .blog-note-card {
  border: 2px solid var(--home-ink);
  border-radius: 0;
  background: #fff;
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--home-tomato) 55%, transparent);
}

html.theme-impact body.page-home .home-section--progress .blog-note-card-link {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  align-items: stretch;
  height: auto;
  min-height: 120px;
}

html.theme-impact body.page-home .home-section--progress .blog-note-card-media {
  position: relative;
  width: 160px;
  height: 100%;
  min-height: 120px;
  aspect-ratio: 4 / 3;
  max-height: none;
  border-bottom: 0;
  border-right: 2px solid var(--home-ink);
  background: var(--home-tomato-wash);
  overflow: hidden;
}

html.theme-impact body.page-home .home-section--progress .blog-note-card-media :is(img, video) {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
  object-position: center;
  image-rendering: auto;
}

html.theme-impact body.page-home .home-section--progress .blog-note-card:hover .blog-note-card-media img {
  transform: none;
  filter: none;
}

html.theme-impact body.page-home .home-section--progress .blog-note-card-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  right: auto;
  font-size: 0.58rem;
  padding: 2px 4px;
  border-radius: 0;
  border: 1px solid var(--home-ink);
}

html.theme-impact body.page-home .home-section--progress .blog-note-card-body {
  display: grid;
  align-content: center;
  gap: 0.25rem;
  padding: 0.7rem 0.85rem;
}

html.theme-impact body.page-home .home-section--progress .blog-note-card-body h3 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.35;
}

html.theme-impact body.page-home .home-section--progress .blog-note-card-date,
html.theme-impact body.page-home .home-section--progress .blog-note-card-meta {
  font-size: 0.78rem;
}

/* タブレット〜やや狭い幅：比率は維持しつつ横並びを少しコンパクトに */
@media (max-width: 720px) {
  html.theme-impact body.page-home .home-section--progress .blog-note-card-link {
    grid-template-columns: minmax(120px, 36%) minmax(0, 1fr);
    min-height: 0;
  }

  html.theme-impact body.page-home .home-section--progress .blog-note-card-media {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
    align-self: stretch;
  }
}

/* スマホ：上画像・下テキスト（4:3フル幅） */
@media (max-width: 560px) {
  html.theme-impact body.page-home .home-section--progress {
    width: 100%;
  }

  html.theme-impact body.page-home .home-section--progress .blog-note-card-link {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  html.theme-impact body.page-home .home-section--progress .blog-note-card-media {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 3;
    border-right: 0;
    border-bottom: 2px solid var(--home-ink);
  }

  html.theme-impact body.page-home .home-section--progress .blog-note-card-body {
    padding: 0.85rem 0.9rem 1rem;
  }

  html.theme-impact body.page-home .home-section--progress .blog-note-card-body h3 {
    font-size: 0.95rem;
  }

  html.theme-impact body.page-home .home-section--progress .blog-note-card-tags {
    display: none;
  }
}

@media (max-width: 560px) {
  .home-hero {
    min-height: auto;
  }

  .home-hero-inner {
    padding-top: calc(var(--header-h, 72px) + 28px);
    gap: 1.5rem;
  }

  .home-hero-brand {
    font-size: clamp(2.6rem, 18vw, 3.8rem);
    letter-spacing: 0;
  }

  .home-hero-cta {
    width: 100%;
  }

  .home-cta {
    flex: 1 1 auto;
    min-width: min(100%, 9.5rem);
  }

  .home-rules li {
    grid-template-columns: 2em minmax(0, 1fr);
    gap: 0.55rem 0.75rem;
  }
}

.home-pitch-note {
  margin: 0 0 1.25rem;
  max-width: 42em;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--home-ink-soft);
}

.home-rules {
  list-style: none;
  margin: 1.75rem 0 1rem;
  padding: 0;
  display: grid;
  gap: 0;
  border-top: 3px solid var(--home-tomato);
}

.home-rules li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem 1.1rem;
  padding: 1.05rem 0;
  border-bottom: none;
  background-image: var(--home-dot-line-soft);
  background-size: 100% var(--home-dot-line-size);
  background-position: left bottom;
  background-repeat: repeat-x;
}

.home-rules-num {
  font-family: var(--imp-en);
  font-size: 0.85rem;
  font-weight: 900;
  color: var(--home-tomato-deep);
  line-height: 1.5;
  letter-spacing: 0.06em;
}

.home-rules strong {
  display: block;
  margin-bottom: 0.2em;
  font-family: var(--imp-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--home-ink);
}

.home-rules p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--home-ink-soft);
}

.home-rules-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--home-ink-soft);
}

.home-faction + .home-faction {
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: clamp(32px, 5vw, 48px);
  border-top: none;
  background-image: var(--home-dot-line);
  background-size: 100% var(--home-dot-line-size);
  background-position: left top;
  background-repeat: repeat-x;
}

/* セクション導入文と最初の派閥のあいだ */
#characters .blog-section-head + .home-faction {
  margin-top: clamp(28px, 4.5vw, 48px);
}

.home-faction-head h3 {
  margin: 0 0 0.4em;
  font-family: var(--imp-display);
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 800;
  color: var(--home-ink);
}

.home-faction-head h3 span {
  margin-left: 0.45em;
  font-size: 0.58em;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--home-tomato-deep);
  vertical-align: middle;
}

.home-faction--oni .home-faction-head h3 span {
  color: var(--home-oni-deep);
}

.home-faction-head p {
  margin: 0 0 1.1rem;
  max-width: 42em;
  line-height: 1.75;
  color: var(--home-ink-soft);
}

.home-sheet {
  margin: 0 0 1.25rem;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.home-sheet img {
  display: block;
  width: 100%;
  height: auto;
  background: transparent;
}

.home-sheet figcaption,
.home-cast figcaption {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--home-ink-soft);
}

.home-cast {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2.5vw, 28px);
}

@media (min-width: 720px) {
  .home-cast {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.home-cast figure {
  margin: 0;
  display: grid;
  align-content: end;
  justify-items: center;
  min-height: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.home-cast img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: clamp(140px, 22vw, 220px);
  height: auto;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.home-cast li:hover img {
  transform: translateY(-6px) rotate(-1.5deg);
}

.home-cast--oni img {
  max-height: clamp(160px, 26vw, 260px);
}

.home-oni-row {
  display: grid;
  gap: clamp(20px, 3vw, 32px);
}

@media (min-width: 900px) {
  .home-oni-row {
    grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
    align-items: end;
  }
}

.home-sheet--side {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.home-sheet--side img {
  max-height: 360px;
  width: auto;
  max-width: 100%;
  margin-inline: auto;
  object-fit: contain;
  background: transparent;
}

.home-faction:not(.home-faction--oni) .home-sheet {
  background: transparent;
  border: 0;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .home-cast li:hover img {
    transform: none;
  }
}
