/* ポスター型サイトの土台。色・文字・写真は index.html 側で差し替える（このファイルは基本そのまま）。
   動きは transform と opacity だけ。英字は同梱の書体（MP Display・SIL OFL 1.1）で、幅を自動で伸び縮みさせる */
@font-face {
  font-family: "MP Display";
  src: url("fonts/mp-display.woff2") format("woff2");
  font-weight: 500 1000;
  font-stretch: 50% 151%;
  font-display: swap;
}

:root {
  /* ここから3色は index.html の <style> で上書きする */
  --main: #f82d78;
  --ink: #0a0d13;
  --paper: #ffffff;

  --muted: color-mix(in srgb, var(--ink) 62%, var(--paper));
  --f-display: "MP Display", "Avenir Next", "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  --f-jp: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP", "Yu Gothic", "Meiryo", system-ui, sans-serif;

  /* 写真の縦横比（横÷縦）。縦長の画面では、枠をこの比率に合わせるので、写真の端が切れない */
  --photo-ratio: 0.47;
  /* 広い画面で写真を横に広い枠へ切り抜く時に、写真のどの高さを見せるか（0＝上の端・1＝下の端）。顔の高さに合わせる */
  --focus-x: 0.5;
  --focus-y: 0.25;

  --pad: 10px;
  --line-h: 34px;
  --gap: 6px;
  /* 画面の下に固定する移動用の帯のぶん（高さ52px＋すき間）を、冒頭の下にあけておく */
  --dock: calc(66px + env(safe-area-inset-bottom, 0px));
  --frame-h: clamp(380px, calc(100svh - 2 * var(--pad) - 2 * var(--line-h) - var(--dock)), calc((68vw - 32px) / var(--photo-ratio)));
  --hero-h: calc(var(--frame-h) + 2 * var(--line-h) + 2 * var(--pad) + var(--dock));
  --big: min(21vw, calc(var(--frame-h) / 4.8));
  --pin: 50svh;
  /* スクロールで左右の英字がずれる量。上下の帯の英文に届かない大きさにする */
  --shift: 10px;
}

@media (min-width: 700px) and (min-aspect-ratio: 1/1) {
  :root {
    --pad: 20px;
    --line-h: 44px;
    --gap: 16px;
    --dock: calc(72px + env(safe-area-inset-bottom, 0px));
    --frame-h: max(340px, calc(100svh - 2 * var(--pad) - 2 * var(--line-h) - var(--dock)));
    --big: min(11.4vw, calc(var(--frame-h) / 4.8));
    --pin: 70svh;
    --shift: 14px;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-jp);
  font-size: 16px;
  line-height: 1.9;
  line-break: strict;
  overflow-wrap: anywhere;
  word-break: auto-phrase;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ---------- 冒頭｜元の1枚と同じ骨格（色の面・左右の巨大な英字・まん中の写真） ---------- */

.ps-hero { background: var(--main); }
/* 縦に長い画面では、ポスターを画面のまん中に置いて、上下を色の面で埋める */
.js .ps-hero { height: calc(max(var(--hero-h), 100svh) + var(--pin)); }
.js.ps-still .ps-hero { height: auto; }

.ps-stage {
  position: sticky;
  top: 0;
  height: max(var(--hero-h), 100svh);
  padding: var(--pad) var(--pad) calc(var(--pad) + var(--dock));
  display: grid;
  align-content: center;
  /* 写真の列は、写真の縦横比より広げない（余りは左右の色の面へ） */
  grid-template-columns: auto minmax(0, calc(var(--frame-h) * var(--photo-ratio))) auto;
  justify-content: center;
  /* 下の帯の英文が長くて折り返す時は、行の高さを広げる（英字や写真に重ねない） */
  grid-template-rows: var(--line-h) var(--frame-h) minmax(var(--line-h), auto);
  grid-template-areas: "top top top" "wl frame wr" "foot foot foot";
  column-gap: var(--gap);
  overflow: clip;
  background: var(--main);
}

.ps-line {
  grid-area: top;
  /* 横に長い1行が、左右の英字の列を押し広げないようにする */
  contain: inline-size;
  align-self: center;
  text-align: center;
  white-space: nowrap;
  font-family: var(--f-display);
  font-weight: 800;
  font-stretch: 112%;
  font-size: clamp(10px, 0.5vw + 8.4px, 14px);
  line-height: 1;
  letter-spacing: 0.12em;
}
.ps-line--foot { grid-area: foot; line-height: 1.35; letter-spacing: 0.07em; white-space: normal; }

.ps-col { display: flex; justify-content: center; align-items: flex-start; height: var(--frame-h); }
.ps-col--l { grid-area: wl; }
.ps-col--r { grid-area: wr; }
/* 巨大な英字。幅（font-stretch）は、枠の高さにぴったり合うよう poster-site.js が決める */
.ps-word {
  display: block;
  writing-mode: vertical-rl;
  white-space: nowrap;
  font-family: var(--f-display);
  font-weight: 1000;
  font-stretch: 106%;
  font-size: var(--big);
  line-height: 0.76;
  will-change: transform;
}

.ps-frame { grid-area: frame; position: relative; height: var(--frame-h); overflow: hidden; background: color-mix(in srgb, var(--ink) 12%, var(--paper)); }
.ps-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: calc(var(--focus-x) * 100%) calc(var(--focus-y) * 100%);
  will-change: transform;
}

/* 写真を切り出す道具がない時｜元の画像（ポスター全体）をそのまま置き、写真の範囲だけを見せる。
   --crop-x・--crop-y は写真の左上の位置、--crop-w・--crop-h は写真の幅と高さ。どれも元の画像に対する割合（0〜1）。
   高さは画像の縦横比のまま（伸び縮みしない）。写真の範囲が枠を覆う大きさにし、
   範囲の中の --focus-x・--focus-y の点を、枠の同じ割合の位置に置く（object-position と同じ考え方。範囲の外は出ない） */
.ps-photo--crop {
  inset: auto;
  top: calc(var(--focus-y) * 100%);
  left: calc(var(--focus-x) * 100%);
  width: calc(max(100%, var(--frame-h) * var(--photo-ratio)) / var(--crop-w));
  height: auto;
  object-fit: fill;
  translate: calc((var(--crop-x) + var(--crop-w) * var(--focus-x)) * -100%) calc((var(--crop-y) + var(--crop-h) * var(--focus-y)) * -100%);
  transform-origin: calc((var(--crop-x) + var(--crop-w) * var(--focus-x)) * 100%) calc((var(--crop-y) + var(--crop-h) * var(--focus-y)) * 100%);
}
/* 広い画面用の横長の写真（任意）。あれば広い画面ではこちらを使う */
.ps-photo--wide { display: none; }

/* 題名は枠の中で折り返し、左右の英字に重ならない */
.ps-title { grid-area: frame; align-self: end; justify-self: start; z-index: 2; max-width: 100%; margin-bottom: clamp(14px, 3svh, 40px); }
.ps-kicker { width: fit-content; max-width: 100%; padding: 5px 9px; background: var(--ink); color: var(--paper); font-size: 11px; font-weight: 700; line-height: 1.2; letter-spacing: 0.04em; }
.ps-title h1 { font-size: min(clamp(19px, 5.9vw, 34px), calc(var(--frame-h) * var(--photo-ratio) / 9.5)); font-weight: 800; line-height: 1.25; letter-spacing: 0.01em; }
.ps-title h1 span { display: block; width: fit-content; max-width: 100%; margin-top: 4px; padding: 0.14em 0.42em 0.16em; background: var(--main); }
.ps-lead, .ps-note { display: none; }

/* 広い画面｜プレゼントページと同じ組み方。写真の枠をほぼ正方形に広げて写真を切り抜き、題名は枠の右下に大きく重ねる */
@media (min-width: 700px) and (min-aspect-ratio: 1/1) {
  .ps-stage { grid-template-columns: auto minmax(0, calc(var(--frame-h) * 1.02)) auto; }
  .ps-line--foot { letter-spacing: 0.12em; }
  .ps-frame:has(> .ps-photo--wide) > .ps-photo:not(.ps-photo--wide) { display: none; }
  .ps-photo--wide { display: block; }

  .ps-title { justify-self: end; margin-bottom: clamp(14px, calc(var(--frame-h) * 0.04), 44px); }
  .ps-kicker { margin-left: auto; font-size: 13px; padding: 6px 11px; }
  .ps-title h1 { font-size: clamp(22px, 3.1vw, 46px); }
  .ps-title h1 span { margin-top: 6px; margin-left: auto; }
  .ps-note {
    display: block;
    grid-area: frame;
    z-index: 2;
    align-self: start;
    justify-self: end;
    margin: 28px 30px 0 0;
    text-align: right;
    font-family: var(--f-display);
    font-weight: 900;
    font-stretch: 112%;
    font-size: clamp(15px, 1.5vw, 22px);
    line-height: 1.2;
    letter-spacing: 0.05em;
    white-space: pre-line;
  }
}

/* ---------- 本文 ---------- */

.ps-sec { padding: clamp(72px, 12vw, 144px) 0; }
.ps-wrap { width: min(100% - 40px, 1040px); margin-inline: auto; }
.ps-eyebrow { font-family: var(--f-display); font-weight: 900; font-stretch: 120%; font-size: 13px; line-height: 1.2; letter-spacing: 0.14em; }
.ps-sec h2 { margin-top: 16px; font-size: clamp(28px, 6.6vw, 60px); font-weight: 800; line-height: 1.3; letter-spacing: 0.01em; text-wrap: balance; }
.ps-sec h2 + p { max-width: 34em; margin-top: 24px; font-size: clamp(16px, 1.2vw + 12px, 19px); }

.js .ps-reveal { opacity: 0; transform: translate3d(0, 20px, 0); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); }
.js .ps-reveal.is-in, .js.ps-still .ps-reveal { opacity: 1; transform: none; }
.js.ps-still .ps-reveal { transition: none; }

/* 流れる英字の帯 */
.ps-marquee { overflow: hidden; padding: 14px 0; background: var(--ink); color: var(--main); }
.ps-marquee-track { display: flex; width: max-content; font-family: var(--f-display); font-weight: 1000; font-stretch: 125%; font-size: clamp(22px, 5vw, 44px); line-height: 1; white-space: nowrap; }
.ps-marquee-track span { padding-right: 0.9em; }
.ps-marquee.is-in .ps-marquee-track { animation: ps-marquee 26s linear infinite; }
.ps-still .ps-marquee-track { animation: none !important; }
@keyframes ps-marquee { to { transform: translate3d(-50%, 0, 0); } }

/* 3つの要点 */
.ps-points { background: var(--ink); color: var(--paper); }
.ps-points ol { margin-top: 44px; }
.ps-points li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 20px; align-items: start; padding: 26px 0; border-top: 1px solid color-mix(in srgb, var(--paper) 26%, transparent); }
.ps-points li::before { content: attr(data-n); grid-row: span 2; min-width: 1.1em; font-family: var(--f-display); font-weight: 1000; font-stretch: 130%; font-size: clamp(48px, 9vw, 104px); line-height: 0.8; color: var(--main); }
.ps-points h3 { font-size: clamp(19px, 1.2vw + 15px, 26px); font-weight: 800; line-height: 1.5; }
.ps-points li p { font-size: 15px; line-height: 1.85; color: color-mix(in srgb, var(--paper) 80%, var(--ink)); }

/* 最後の呼びかけ */
.ps-cta { background: var(--main); text-align: center; overflow: hidden; }
/* 幅いっぱいの英字。文字の大きさは poster-site.js が幅に合わせる */
.ps-shout { font-family: var(--f-display); font-weight: 1000; font-stretch: 151%; font-size: 22vw; line-height: 0.82; white-space: nowrap; }
.ps-cta h2 { margin-top: 28px; font-size: clamp(22px, 4.6vw, 40px); }
.ps-btn { display: inline-flex; align-items: center; justify-content: center; width: min(100%, 420px); min-height: 66px; margin-top: 32px; padding: 12px 24px; background: var(--ink); color: var(--paper); font-size: 17px; font-weight: 800; line-height: 1.4; text-decoration: none; transition: transform 0.2s; }
.ps-btn:hover { transform: translate3d(0, -3px, 0); }
.ps-still .ps-btn { transition: none; }

.ps-foot { padding: 40px 20px 100px; background: var(--ink); color: var(--paper); text-align: center; font-family: var(--f-display); font-weight: 900; font-stretch: 120%; font-size: 12px; letter-spacing: 0.14em; }

/* ---------- 画面の下の移動用の帯（目次・最後の呼びかけへ・上へ戻る・動きを止める） ---------- */

.ps-dock {
  position: fixed;
  z-index: 60;
  left: max(8px, env(safe-area-inset-left));
  right: max(8px, env(safe-area-inset-right));
  bottom: max(8px, env(safe-area-inset-bottom));
  display: flex;
  align-items: stretch;
  height: 52px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--paper) 24%, transparent), 0 10px 28px rgba(10, 13, 19, 0.3);
}
.ps-dock > a, .ps-dock > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: none;
  min-width: 50px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: 700 13px/1 var(--f-jp);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: inset 1px 0 0 color-mix(in srgb, var(--paper) 20%, transparent);
}
/* いまいる場面。押すと目次が開く */
.ps-dock > .ps-dock-menu { flex: 1 1 auto; justify-content: flex-start; min-width: 0; box-shadow: none; }
.ps-dock-menu b { flex: none; font-family: var(--f-display); font-weight: 900; font-stretch: 112%; font-size: 15px; color: var(--main); }
.ps-dock-menu [data-ps-place] { overflow: hidden; text-overflow: ellipsis; }
.ps-dock-burger { flex: none; position: relative; width: 16px; height: 12px; }
.ps-dock-burger::before, .ps-dock-burger::after { content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 2px; background: currentColor; transition: transform 0.2s; }
.ps-dock-burger::before { transform: translate3d(0, -4px, 0); }
.ps-dock-burger::after { transform: translate3d(0, 4px, 0); }
.ps-dock-menu[aria-expanded="true"] .ps-dock-burger::before { transform: rotate(45deg); }
.ps-dock-menu[aria-expanded="true"] .ps-dock-burger::after { transform: rotate(-45deg); }
/* 最後の呼びかけへ。帯の中で1つだけ色を付ける（面ではなく文字に色を付ける） */
.ps-dock > .ps-dock-cta { color: var(--main); font-weight: 800; }
.ps-dock-cta[hidden] { display: none; }
.ps-dock-cta span { overflow: hidden; max-width: 11em; text-overflow: ellipsis; }
.ps-dock-cta i, .ps-dock-top i { flex: none; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; }
.ps-dock-cta i { transform: translate3d(0, -2px, 0) rotate(45deg); }
.ps-dock-top i { transform: translate3d(0, 2px, 0) rotate(-135deg); }
/* いちばん上にいる間は、上へ戻るを薄くしておく */
.ps-dock.is-top .ps-dock-top { opacity: 0.35; }
.ps-motion[hidden] { display: none; }
.ps-motion [data-ps-label] { display: none; }
.ps-motion i { width: 10px; height: 12px; border-inline: 3px solid currentColor; }
.ps-still .ps-motion i { width: 0; height: 0; border: 6px solid transparent; border-left: 10px solid currentColor; border-right: 0; }
/* 帯の地は黒いので、キーボードで選んだ時の枠は白にする */
.ps-dock :focus-visible { outline-color: var(--paper); }
/* スクリプトが動かない時は、押しても何も起きないボタンを出さない（最後の呼びかけへ・上へは、ふつうのリンクとして働く） */
html:not(.js) .ps-dock-menu, html:not(.js) .ps-motion { display: none; }
html:not(.js) .ps-dock > .ps-dock-cta { flex: 1 1 auto; justify-content: flex-start; box-shadow: none; }

/* どこまで読んだかの線。帯の上辺に重ねる */
.ps-dock-progress { position: absolute; left: 0; right: 0; bottom: 100%; height: 3px; overflow: hidden; }
.ps-dock-progress i { display: block; height: 100%; background: var(--main); transform-origin: 0 50%; transform: scaleX(0); will-change: transform; }
.ps-still .ps-dock-progress, html:not(.js) .ps-dock-progress { display: none; }

/* 目次。帯のすぐ上に開く */
.ps-dock-nav { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); padding: 6px 0; background: var(--ink); box-shadow: 0 0 0 1px color-mix(in srgb, var(--paper) 24%, transparent), 0 10px 28px rgba(10, 13, 19, 0.3); animation: ps-dock-in 0.2s ease-out; }
.ps-dock-nav[hidden] { display: none; }
.ps-dock-nav a { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 0 18px; color: color-mix(in srgb, var(--paper) 66%, var(--ink)); font-size: 15px; font-weight: 700; line-height: 1.3; text-decoration: none; }
.ps-dock-nav b { min-width: 1.9em; font-family: var(--f-display); font-weight: 900; font-stretch: 112%; font-size: 15px; }
.ps-dock-nav a[aria-current="true"] { color: var(--paper); }
.ps-dock-nav a[aria-current="true"] b { color: var(--main); }
@media (hover: hover) { .ps-dock-nav a:hover { color: var(--paper); } }
@keyframes ps-dock-in { from { opacity: 0; transform: translate3d(0, 8px, 0); } }
.ps-still .ps-dock-nav { animation: none; }
.ps-still .ps-dock-burger::before, .ps-still .ps-dock-burger::after { transition: none; }

/* 幅のせまいスマホ｜場面の名前は入りきらないので、番号だけにする（目次を開けば名前が出る） */
@media (max-width: 359px) {
  .ps-dock-menu [data-ps-place] { display: none; }
}

/* 広い画面｜右下に小さくまとめ、「動きを止める」は文字も出す */
@media (min-width: 700px) {
  .ps-dock { left: auto; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
  .ps-dock > .ps-dock-menu { min-width: 176px; }
  .ps-motion [data-ps-label] { display: inline; }
  .ps-dock-nav { right: auto; min-width: 260px; }
}

/* ほかのページの中に小さく見せる時は、スクロールバーと「動きを止める」を出さない（外のページが動きを決める） */
.ps-embedded { scrollbar-width: none; }
.ps-embedded::-webkit-scrollbar { display: none; }
.ps-embedded .ps-motion { display: none; }
