/* 同窓会サイト。パーツの配置（left/top/width と動きの変数）は css/stage.css（tools/build.py が生成） */

@font-face { font-family: "Zen Maru"; src: url(../fonts/zenmaru-500.woff2?v=91d288fe46) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Zen Maru"; src: url(../fonts/zenmaru-900.woff2?v=f7716a00ae) format("woff2"); font-weight: 900; font-style: normal; font-display: swap; }

:root {
  /* フライヤーの色 */
  --yellow: #F5B41B;
  --paper: #F2F2F2;
  --blue: #0084C5;
  --red: #DB382B;
  --green: #1F8E63;
  --ink: #141414;
  --font: "Zen Maru", "Hiragino Maru Gothic ProN", "Hiragino Sans", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  /* 紙のざらつき（フライヤーの黄色の質感）を色の上に重ねる */
  background: url(../img/grain.png?v=64ec8e9cfb) repeat, var(--yellow);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  line-height: 1.7;
  overflow-x: hidden;
}
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- 舞台（フライヤーをパーツから組み直したもの） ---------- */
.hero { display: flex; flex-direction: column; align-items: center; padding-top: clamp(20px, 6vw, 44px); }
.hero, .info, .foot { position: relative; z-index: 1; }

/* 雪（ページ全体。舞台や案内の後ろを降る） */
.snow { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.flake { position: absolute; display: block; }
.flake img { display: block; width: 100%; height: auto; }
.motion .flake { top: -40px; animation: fall var(--fd) linear var(--fdel) infinite; }
.motion .flake img { animation: drift var(--sw) ease-in-out infinite alternate; }
@keyframes fall { to { transform: translateY(calc(100vh + 80px)); } }
@keyframes drift { from { transform: translateX(-12px) rotate(-30deg); } to { transform: translateX(12px) rotate(30deg); } }
.stage {
  position: relative;
  width: 100%;
  max-width: 620px;
  container-type: inline-size;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.p { position: absolute; display: block; margin: 0; }
img.p, .p img { height: auto; }
.p img { display: block; width: 100%; }
.motion .stage { cursor: pointer; }
.stage:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; border-radius: 8px; }
.fig .sway, .center .sway, .rise .sway { transform-origin: 50% 100%; }
/* 乾杯する人: テーブルの陰になる下の部分はいつも切っておく */
.rise { clip-path: inset(0 0 var(--hide) 0); }


/* ---------- 動き（.motion＝動いてよい端末、.play＝再生中） ---------- */
.motion .stage:not(.play) .p { visibility: hidden; }

.play .circle { animation: circle-in .8s cubic-bezier(.2, 1.25, .4, 1) both; }
@keyframes circle-in { from { transform: scale(.55); opacity: 0; } }

.play .title { animation: drop .6s cubic-bezier(.3, 1.45, .5, 1) both; animation-delay: calc(.15s + var(--i) * 50ms); }
@keyframes drop { from { transform: translateY(-70%) rotate(var(--r)); opacity: 0; } }

.play .date { animation: pop .45s cubic-bezier(.3, 1.7, .5, 1) both; animation-delay: calc(1.05s + var(--i) * 55ms); }
@keyframes pop { from { transform: scale(0); opacity: 0; } }

/* 真ん中のテーブルが先に現れ、まわりの人がそこへ集まってくる */
.play .center { transform-origin: 50% 60%; animation: center-in .8s cubic-bezier(.3, 1.5, .5, 1) var(--d) both; }
@keyframes center-in { from { transform: scale(.4); opacity: 0; } }
.play .center .sway { animation: cheer 1.4s ease-in-out calc(var(--d) + 1s) infinite alternate; }
@keyframes cheer { to { transform: translateY(-.6cqw); } }

.play .fig { animation: walk-in var(--dur) cubic-bezier(.3, .6, .35, 1) var(--d) both; }
@keyframes walk-in { from { transform: translate(var(--dx), var(--dy)); } }
.play .fig .bob { animation: step var(--st) ease-in-out var(--d) var(--sn) alternate both; }
@keyframes step { from { transform: translateY(0) rotate(-2.5deg); } to { transform: translateY(-2.2cqw) rotate(2.5deg); } }
.play .drive .bob { animation-name: rumble; }
@keyframes rumble { from { transform: translate(0, 0); } to { transform: translate(.25cqw, -.35cqw); } }
.play .fig .sway { animation: sway var(--sw) ease-in-out calc(var(--d) + var(--dur)) infinite alternate; }
@keyframes sway { from { transform: rotate(-1.4deg); } to { transform: rotate(1.4deg); } }

/* 乾杯する人はテーブルの後ろから立ち上がる（見える範囲の下端をテーブルの線に固定したまま持ち上げる） */
.play .rise { animation: rise-up .9s cubic-bezier(.3, 1.35, .5, 1) var(--d) both; }
@keyframes rise-up { from { transform: translateY(var(--lift)); clip-path: inset(0 0 100% 0); } }
.play .rise .sway { animation: cheer 1.2s ease-in-out calc(var(--d) + 1s) infinite alternate; }

/* 矢印は人が集まりはじめてから現れ、中心へ向かって押し続ける */
.play .arrow { animation: arrow-in .6s cubic-bezier(.3, 1.4, .5, 1) var(--d) both, push 1.4s ease-in-out calc(var(--d) + .8s) infinite; }
@keyframes arrow-in { from { transform: translate(calc(var(--ax) * -4), calc(var(--ay) * -4)); opacity: 0; } }
@keyframes push { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(var(--ax), var(--ay)); } }


/* 人や文字を押すと跳ねる（他の動きより後に書いて上書きする） */
.play .hop { animation: hop .55s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes hop { 30% { transform: translateY(-4cqw) scale(1.04); } 60% { transform: translateY(0) scale(.98, 1.02); } }

/* ---------- ごあんない ---------- */
.info { max-width: 560px; margin: 0 auto; padding: 8px 16px 40px; }
.lead { margin: 28px 0 10px; text-align: center; font-weight: 900; font-size: clamp(22px, 6vw, 30px); line-height: 1.5; }
.count { margin: 0 0 34px; text-align: center; font-weight: 900; font-size: 17px; }
.count b {
  display: inline-grid;
  place-items: center;
  min-width: 2.4em;
  height: 2.4em;
  margin: 0 .35em;
  padding: 0 .35em .14em; /* 数字が下寄りのフォントなので、丸の真ん中に来るよう少し持ち上げる */
  border-radius: 999px;
  background: var(--paper);
  color: var(--red);
  font-size: 1.7em;
  line-height: 1;
  vertical-align: middle;
}
.card { position: relative; padding: 34px 20px 24px; border-radius: 32px; background: var(--paper); }
.card-title {
  position: absolute;
  top: -17px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 3px 18px 3px 24px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: .3em;
  white-space: nowrap;
}
.facts { display: grid; gap: 20px; margin: 0; }
.facts div { display: grid; grid-template-columns: 5.4em 1fr; align-items: center; gap: 12px; }
.facts dt {
  justify-self: start;
  padding: 2px 10px 2px 13px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .2em;
  white-space: nowrap;
}
.facts dd { display: flex; flex-direction: column; margin: 0; line-height: 1.35; }
.big { color: var(--red); font-weight: 900; font-size: clamp(22px, 6.4vw, 30px); letter-spacing: .03em; }
.sub { color: var(--blue); font-size: 14px; }
.mid { font-weight: 900; font-size: 17px; }
.nw { display: inline-block; }
.contact { margin: 26px 0 0; text-align: center; font-weight: 900; }

/* ---------- 参加のしかた（サイトのゴール＝公式LINEの友だち追加） ---------- */
.card + .card { margin-top: 46px; }
.steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 12px; font-weight: 900; font-size: 16px; line-height: 1.5; counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding-bottom: 2px; /* 数字が下寄りのフォントなので少し持ち上げる */
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 16px;
  line-height: 1;
}
.steps em { color: var(--blue); font-style: normal; }
.note { margin: 20px 0 0; color: var(--blue); font-size: 14px; line-height: 1.7; text-align: center; }
.cta { position: relative; margin: 34px 0 6px; }
.ribbon {
  position: absolute;
  top: -15px;
  left: 50%;
  z-index: 1;
  transform: translateX(-50%);
  padding: 1px 22px 2px;
  background: var(--yellow);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .12em;
  white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 50%, 100% 100%, 0 100%, 9px 50%);
}
.line-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 66px;
  padding: 16px 18px 14px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-weight: 900;
  font-size: clamp(18px, 5.2vw, 21px);
  line-height: 1.3;
  text-decoration: none;
  box-shadow: 0 5px 0 #146246;
  transition: transform .08s, box-shadow .08s;
}
.line-btn svg { flex: none; width: 28px; height: 28px; color: var(--green); }
.line-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #146246; }
.line-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.notfound { padding-top: 30vh; text-align: center; }
.notfound a { color: var(--blue); }
.foot { padding: 0 16px 32px; text-align: center; font-size: 12px; }
.foot p { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .stage *, .stage, .snow * { animation: none !important; }
}
