/* ==========================================================================
   page-head.css — 下層ページの頭（事業内容・運用実績・会社概要・プライバシーポリシー）
   --------------------------------------------------------------------------
   ・背景：TOPと同じ手描きスケッチが、ななめにゆっくり流れる
   ・大きな英字（ロゴ色のグラデーションが流れる）＋ 濃い色の札に日本語のページ名
   ・右にステッカー、まわりに浮かぶ飾り（スクロールで奥行きをもって動く。components/deco.css）
   ページを開いた瞬間に一度だけ、順番に飛び出してきます。
   別のページから来た時は、幕（page-wipe）が晴れてから始まります。
   page-head--simple … 文章だけのページ用（低め・ステッカーなし）
   ========================================================================== */

.page-head {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: calc(var(--header-height) + clamp(1.75rem, 1rem + 4vw, 4rem)) 0 clamp(3.5rem, 2.5rem + 5vw, 6.5rem);
}

/* 文字の後ろだけ明るくして、スケッチの上でも読みやすく */
.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(75% 70% at 30% 55%, rgb(246 244 250 / 0.94) 0%, rgb(246 244 250 / 0.7) 55%, rgb(246 244 250 / 0.2) 100%),
    radial-gradient(45% 40% at 92% 12%, rgb(253 214 246 / 0.75), transparent 70%),
    radial-gradient(40% 40% at 4% 96%, rgb(214 236 253 / 0.75), transparent 70%);
}

/* 下の端は、手描きの波線で切り抜く（スケッチも波の形で終わる） */
.page-head {
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14' preserveAspectRatio='none'%3E%3Cpath d='M0 7c10-7 20-7 30 0s20 7 30 0 20-7 30 0 20 7 30 0V0H0Z'/%3E%3C/svg%3E");
  -webkit-mask-image: var(--wave), linear-gradient(#000 0 0);
  mask-image: var(--wave), linear-gradient(#000 0 0);
  -webkit-mask-position: left bottom, left top;
  mask-position: left bottom, left top;
  -webkit-mask-size: 120px 14px, 100% calc(100% - 13px);
  mask-size: 120px 14px, 100% calc(100% - 13px);
  -webkit-mask-repeat: repeat-x, no-repeat;
  mask-repeat: repeat-x, no-repeat;
}

/* 波のふちに、手描きの線 */
.page-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 14'%3E%3Cpath d='M0 7c10-7 20-7 30 0s20 7 30 0 20-7 30 0 20 7 30 0' fill='none' stroke='%23b8b1cc' stroke-width='4.4' stroke-linecap='round'/%3E%3C/svg%3E") 0 50% / 120px 14px repeat-x;
}

/* ---- 背景のスケッチ ---------------------------------------------------- */

.page-head__sketches {
  position: absolute;
  inset: -60% -30% -40%;
  z-index: -2;
  display: flex;
  justify-content: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  rotate: -12deg;
}

.page-head__col {
  flex: none;
  width: clamp(6rem, 16vw, 10rem);
  animation: ph-sketch-up 64s linear infinite;
}

.page-head__col--reverse {
  animation-name: ph-sketch-down;
  animation-duration: 78s;
}

.page-head__col img {
  width: 100%;
  height: auto;
  margin-bottom: clamp(1rem, 3vw, 2rem);
}

@keyframes ph-sketch-up {
  to { translate: 0 -50%; }
}

@keyframes ph-sketch-down {
  from { translate: 0 -50%; }
  to   { translate: 0 0; }
}

/* ---- 中身の並び --------------------------------------------------------
   スマホ：パンくず → 英字 → [ページ名  ステッカー] → リード
   PC    ：パンくず → [英字  ステッカー] → ページ名 → リード
   ------------------------------------------------------------------------ */

.page-head__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "crumb crumb"
    "en    en"
    "ja    sticker"
    "lead  lead";
  align-items: center;
}

/* パンくず（ホーム ／ 今のページ） */
.breadcrumb {
  grid-area: crumb;
  margin-bottom: clamp(1rem, 0.6rem + 1.6vw, 1.75rem);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--color-ink-soft);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2em 0.6em;
}

.breadcrumb li + li::before {
  content: "／";
  margin-right: 0.6em;
  color: var(--color-sketch);
}

.breadcrumb a {
  text-decoration: underline;
  text-decoration-color: var(--color-sketch);
  text-underline-offset: 0.25em;
}

@media (hover: hover) {
  .breadcrumb a:hover {
    color: var(--color-pink);
    text-decoration-color: currentColor;
  }
}

/* 大きな英字：ロゴ色のグラデーションがゆっくり流れ続ける */
.page-head__en {
  grid-area: en;
  justify-self: start;
  padding-right: 0.06em;
  font-family: var(--font-display);
  font-weight: var(--weight-heavy);
  font-size: clamp(3rem, 1.4rem + 8.4vw, 8.5rem);
  line-height: 0.95;
  letter-spacing: 0.01em;
  background: linear-gradient(100deg, #e23ad5, #ac4fd7, #7566df, #3e7add, #088ee1, #7566df, #e23ad5);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0.05em 0.06em 0 rgb(43 37 80 / 0.92));
}

/* 日本語のページ名：濃い色の札（少しかたむけて、ポップに） */
.page-head__ja {
  grid-area: ja;
  justify-self: start;
  margin-top: clamp(0.9rem, 0.6rem + 1vw, 1.4rem);
  padding: 0.3em 0.95em 0.35em;
  border-radius: var(--radius-pill);
  background: var(--texture-grain-light), var(--color-ink);
  color: #fff;
  font-family: var(--font-display);
  font-weight: var(--weight-heavy);
  font-size: clamp(1.125rem, 0.95rem + 0.9vw, 1.6rem);
  line-height: 1.4;
  letter-spacing: 0.06em;
  rotate: -3deg;
  box-shadow: 0 5px 0 rgb(43 37 80 / 0.25);
}

.page-head__lead {
  grid-area: lead;
  max-width: 34em;
  margin-top: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  line-height: 1.9;
  color: var(--color-ink-soft);
}

/* ステッカー（「5つの事業」など） */
.sticker--page {
  --sticker-size: clamp(4.75rem, 4rem + 2.6vw, 6.75rem);
  position: relative;
  grid-area: sticker;
  align-self: center;
  margin: 0.6rem 0.25rem 0 0;
}

/* スマホ：飾りが入る分、下に少し余白 */
@media (max-width: 767px) {
  .page-head {
    padding-bottom: 4.5rem;
  }
}

@media (min-width: 768px) {
  .page-head__inner {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "crumb crumb"
      "en    sticker"
      "ja    ja"
      "lead  lead";
  }

  .sticker--page {
    justify-self: start;
    align-self: start;
    margin: -0.75rem 0 0 0.25rem;
  }

  .page-head__lead {
    font-size: var(--text-base);
  }
}

/* ---- 文章だけのページ（プライバシーポリシー） ---------------------------- */

.page-head--simple {
  padding-bottom: clamp(3.5rem, 2.5rem + 3vw, 4.5rem);
}

.page-head--simple .page-head__en {
  font-size: clamp(2.6rem, 1.4rem + 6vw, 6rem);
}


/* ==========================================================================
   登場アニメーション（ページを開いた時に一度だけ）
   スケッチ → パンくず → 英字（左から） → ページ名（ポンッ） → ステッカー（ドンッ） → リード
   ========================================================================== */

.page-head__sketches {
  animation: ph-fade 1.2s ease both;
}

.breadcrumb {
  animation: ph-rise 0.6s var(--motion-ease) 0.05s both;
}

.page-head__en {
  animation:
    ph-wipe 0.9s var(--motion-ease) 0.12s both,
    ph-grad 9s linear infinite;
}

.page-head__ja {
  animation: ph-pop 0.7s var(--ease-spring) 0.5s both;
}

.sticker--page {
  animation:
    ph-stamp 0.55s cubic-bezier(0.5, 0, 0.75, 0) 0.75s both,
    sticker-wobble 3.6s ease-in-out 1.3s infinite;
}

.page-head__lead {
  animation: ph-rise 0.7s var(--motion-ease) 0.62s both;
}

/* 別のページから来た時は、幕が晴れるまで待つ（page-wipe.js が is-wipe-in を外すと始まる） */
.is-wipe-in .page-head,
.is-wipe-in .page-head * {
  animation-play-state: paused;
}

@keyframes ph-grad {
  to { background-position: 250% 0; }
}

@keyframes ph-fade {
  from { opacity: 0; scale: 1.06; }
}

@keyframes ph-rise {
  from { opacity: 0; translate: 0 16px; }
}

@keyframes ph-wipe {
  from { clip-path: inset(-10% 100% -20% 0); translate: -0.2em 0; }
  to   { clip-path: inset(-10% -5% -20% 0); translate: 0 0; }
}

@keyframes ph-pop {
  from { opacity: 0; scale: 0.3; rotate: -14deg; }
}

@keyframes ph-stamp {
  0%   { opacity: 0; scale: 2.6; rotate: -25deg; }
  70%  { opacity: 1; scale: 0.9; rotate: -8deg; }
  100% { opacity: 1; scale: 1; rotate: -8deg; }
}

@keyframes ph-hop {
  0%  { opacity: 0; translate: 0 40px; }
  60% { opacity: 1; translate: 0 -14px; }
}
