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

@font-face { font-family: "Zen Maru"; src: url(../fonts/zenmaru-500.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Zen Maru"; src: url(../fonts/zenmaru-900.woff2) 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) 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; }
.stage {
  position: relative;
  width: 100%;
  max-width: 620px;
  aspect-ratio: 1329 / 1654;
  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%; }
.fig, .center, .title, .date { cursor: pointer; }
.fig .sway, .center .sway { transform-origin: 50% 100%; }
.place { color: var(--blue); text-align: center; font-size: 3.1cqw; line-height: 1.35; white-space: nowrap; }
.place b { display: block; margin-top: .4cqw; color: var(--red); font-weight: 900; font-size: 5cqw; letter-spacing: .04em; }

.replay {
  margin: 6px auto 0;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
}
.replay:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.replay[hidden] { display: none; }

/* ---------- 動き（.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 .sparkle { animation: twinkle 2.6s ease-in-out infinite both; animation-delay: calc(var(--i) * -.41s); }
@keyframes twinkle { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(30deg) scale(.78); } }

.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 .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 .band { animation: rise .6s ease-out 2.3s both; }
@keyframes rise { from { transform: translateY(2cqw); opacity: 0; } }

/* タップで跳ねる（他の動きより後に書いて上書きする） */
.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;
  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; }
.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 { animation: none !important; }
}
