/* 公開ページ (joinboops.com) の共通の見た目。ピンク地のページ (トップ・招待・404) と、白地の長文 (プライバシー・規約) */

/* ロゴの「Boops」と判子の「Boop!」だけに使う。ios/Shared/Fonts/Rubik.ttf を太さ 900 に固定し、
   "Boops! 404" の文字だけ切り出したもの (作り方は README)。Rubik: SIL Open Font License 1.1 */
@font-face {
  font-family: "Boops Rubik";
  src: url("/fonts/rubik-black-subset.woff2") format("woff2");
  font-weight: 900;
  font-display: block;
}

:root {
  --pink: #FF4280;            /* アプリの BrandColor.pink (1.0, 0.26, 0.5) */
  --pink-deep: #CC3566;       /* ピンクに黒 20%。小さい白い字を置く帯 (白との差 4.7:1) */
  --pink-ink: #E62E6E;        /* 白いボタンの上のピンクの字 (少し濃くして読みやすく) */
  --paper: #fff;
  --ink: #222;
  --ink-soft: #555;
  --rule: #e6e6e6;
  --link: #D81B60;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Segoe UI", system-ui, sans-serif;
  --brand: "Boops Rubik", var(--sans);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* 日英: どのページも英語と日本語の両方を lang="en" / lang="ja" の要素で書き、<head> のスクリプトが決めた
   <html lang> に合わないほうを隠す (スクリプトが無ければ英語だけ)。下の帯の切り替え (.lang-switch) は
   「いま見せていないほうの言語」を出す。スクリプトが無いと押しても変わらないので出さない */
html:not([lang="ja"]) [lang="ja"]:not(.lang-switch),
html[lang="ja"] [lang="en"]:not(.lang-switch),
html:not([lang="ja"]) .lang-switch[lang="en"],
html[lang="ja"] .lang-switch[lang="ja"],
html:not(.js) .lang-switch { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); }

/* ── ピンク地のページ ─────────────────────────────── */

body.pink {
  background: var(--pink);
  color: #fff;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.6;
}
.pink a { color: #fff; }

.hero {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: max(40px, env(safe-area-inset-top)) 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* 文字を 200% にしたとき、大きなロゴで画面が横にずれないように、はみ出た分は切る (切る線は画面の端か、
     広い画面では幅 560px の端。ふだんの大きさでは何も切れない) */
  overflow-x: clip;
}

.logo {
  margin: 8px 0 0;
  font: 900 clamp(84px, 24vw, 128px)/1 var(--brand);
  letter-spacing: -0.027em;
  transform: rotate(-6deg);
  animation: logo-pulse 1.5s ease-in-out infinite alternate;
}
.logo.small { font-size: clamp(64px, 18vw, 88px); }
@keyframes logo-pulse {
  from { transform: rotate(-6deg) scale(1); }
  to   { transform: rotate(-6deg) scale(1.05); }
}

.headline {
  margin: 0;
  font-size: clamp(24px, 6.4vw, 30px);
  font-weight: 800;
  line-height: 1.4;
  text-wrap: balance;
}
.lead {
  margin: 14px 0 0;
  /* 幅を中身に合わせて縮めると、Safari (WebKit) の text-wrap: pretty が <br> の前の行をさらに折り、
     3 行になる (「The iPhone app where / one tap / …」)。幅は親いっぱいに取る (字は中央揃えのまま) */
  width: 100%;
  max-width: 26em;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.65;
  text-wrap: pretty;
}
/* 言葉のまとまりを行の途中で切らない。行より長いとき (文字を大きくしたとき) だけ中で折り返す
   (white-space: nowrap だと画面からはみ出して横にずれる) */
.nowrap { display: inline-block; }
a .nowrap { text-decoration: underline; }   /* リンクの下線は inline-block の中に届かない */

/* ── 何が起きるかの絵: タイルを押す → ギューッ → ポンッ → 暗くなって「Boop!」──
   アプリの BoopEffectLayer の bounce と同じ時間の並び (秒は 9 秒の周期の中の割合に直してある)
   0.16 秒で 0.82 倍に縮む → ばね (response 0.38 / damping 0.3) で戻る → 戻った瞬間に
   写真が 50% 暗くなり (0.12 秒)、判子がばね (0.35 / 0.5) で 0.5 → 1 倍 → 1.5 秒見せて 0.25 秒で消える。
   3 枚が 3 秒ずつずれて順に Boop される */

.demo {
  --t: clamp(88px, 26vw, 128px);
  display: flex;
  gap: clamp(12px, 3.5vw, 20px);
  justify-content: center;
  margin: 44px 0 36px;
}
.tile {
  position: relative;
  width: var(--t);
  height: var(--t);
  flex: none;
}
.tile .photo {
  position: absolute;
  inset: 0;
  border-radius: 24%;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(120, 0, 40, .28);
  animation: squeeze 9s infinite var(--d) both;
}
/* 写真の代わりの、顔のない人の形 */
.tile .photo::before,
.tile .fig {
  content: "";
  position: absolute;
  left: 50%;
  background: rgba(255, 255, 255, .9);
}
.tile .photo::before {   /* 頭 */
  width: 34%; height: 34%;
  top: 20%;
  margin-left: -17%;
  border-radius: 50%;
}
.tile .fig {             /* 肩 */
  width: 66%; height: 44%;
  top: 60%;
  margin-left: -33%;
  border-radius: 50% 50% 0 0 / 80% 80% 0 0;
}
.tile .photo::after {    /* 判子の下のピンクの幕 (アプリと同じ: ピンクの 60%) */
  content: "";
  position: absolute;
  inset: 0;
  background: var(--pink);
  opacity: 0;
  animation: veil 9s infinite var(--d) both;
}
.tile .stamp {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 900 calc(var(--t) * .24)/1 var(--brand);
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 calc(var(--t) * .015) calc(var(--t) * .04) var(--pink-deep);
  opacity: 0;
  transform: scale(.5);
  animation: stamp 9s infinite var(--d) both;
}
.tile .tap {             /* 指が触れた印 */
  position: absolute;
  left: 50%; top: 50%;
  width: 56%; height: 56%;
  margin: -28% 0 0 -28%;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .95);
  opacity: 0;
  animation: tap 9s infinite var(--d) both;
  pointer-events: none;
}
.tile .streak {
  position: absolute;
  right: -6px; top: -8px;
  padding: 2px 9px 3px;
  border-radius: 999px;
  background: #fff;
  color: #222;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
  box-shadow: 0 3px 10px rgba(120, 0, 40, .25);
  z-index: 1;
}
.g1 .photo { background: linear-gradient(140deg, #FFE27A, #FF9F5A); }
.g2 .photo { background: linear-gradient(140deg, #9BE7FF, #6E8BFF); }
.g3 .photo { background: linear-gradient(140deg, #C6F58E, #3FCFA2); }
.g1 { --d: 6.8s; }
.g2 { --d: 0.8s; }   /* 真ん中から始める */
.g3 { --d: 3.8s; }

@keyframes squeeze {
  0%     { transform: scale(1);     animation-timing-function: cubic-bezier(0, 0, .58, 1); }
  1.78%  { transform: scale(.82);   animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  3.89%  { transform: scale(1.067); animation-timing-function: ease-in-out; }
  6%     { transform: scale(.975);  animation-timing-function: ease-in-out; }
  8.1%   { transform: scale(1.009); animation-timing-function: ease-in-out; }
  10.2%, 100% { transform: scale(1); }
}
@keyframes veil {
  0%, 1.78% { opacity: 0;  animation-timing-function: ease-out; }
  3.11%     { opacity: .6; }
  18.44%    { opacity: .6; animation-timing-function: ease-in; }
  21.22%, 100% { opacity: 0; }
}
@keyframes stamp {
  0%, 1.78% { opacity: 0; transform: scale(.5);  animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  2.67%     { opacity: 1; }
  3.72%     { transform: scale(1.08); animation-timing-function: ease-in-out; }
  5.67%     { transform: scale(.987); animation-timing-function: ease-in-out; }
  7.8%      { transform: scale(1); }
  18.44%    { opacity: 1; transform: scale(1); animation-timing-function: ease-in; }
  21.22%    { opacity: 0; transform: scale(1); }
  100%      { opacity: 0; transform: scale(.5); }
}
@keyframes tap {
  0%    { opacity: 0;  transform: scale(.45); animation-timing-function: ease-out; }
  .6%   { opacity: .9; transform: scale(.55); animation-timing-function: ease-out; }
  4%    { opacity: 0;  transform: scale(1.4); }
  100%  { opacity: 0;  transform: scale(.45); }
}

@media (prefers-reduced-motion: reduce) {
  .logo, .tile .photo, .tile .photo::after, .tile .stamp, .tile .tap { animation: none; }
  /* 止めた絵でも分かるよう、真ん中のタイルを「Boop!」の状態で見せる */
  .g2 .photo::after { opacity: .6; }
  .g2 .stamp { opacity: 1; transform: none; }
}

/* ── ボタン ─────────────────────────────── */

.cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 32px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  width: 100%;
  max-width: 340px;
  min-height: 58px;
  padding: 12px 28px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--pink-ink);
  font: 800 19px/1.3 var(--sans);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(120, 0, 40, .28);
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s ease-out;
}
.pink a.btn { color: var(--pink-ink); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .pink a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.pink a.btn.copied { color: #13804A; }
/* まだ押せない (App Store に出る前)。壊れたボタンに見えないよう、点線の枠だけにする */
.pink .btn[aria-disabled="true"] {
  background: transparent;
  color: #fff;
  box-shadow: none;
  border: 2px dashed rgba(255, 255, 255, .85);
  cursor: default;
}
.pink .btn[aria-disabled="true"]:active { transform: none; }
.sub { margin: 0; font-size: 19px; font-weight: 700; }

/* 白い小さめの字を置く濃いピンクの面 */
.panel {
  width: 100%;
  max-width: 400px;
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 20px;
  background: var(--pink-deep);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.65;
  text-wrap: pretty;
}
.panel p { margin: 0; }
.panel p + p { margin-top: 8px; }
.panel strong { font-size: 19px; font-weight: 800; }

/* コピーできなかったときに招待リンクを見せる欄 (16px 未満だと iPhone が拡大する) */
.copy-field {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: 600 16px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
  overflow-wrap: anywhere;   /* 幅が足りなければ 2 行に (1 行の欄だとリンクの後ろが隠れる) */
  resize: none;
}
.copy-field:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

.minor-link {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 8px;     /* 押せる高さ 44px を確保 */
  font-size: 19px;       /* ピンク地の白い字は 19px 以上の太字 (差 3.3:1 は大きい字でだけ足りる) */
  font-weight: 700;
  text-underline-offset: 4px;
}

.qr {
  display: inline-block;
  margin: 16px auto 4px;
  padding: 14px;
  border-radius: 18px;
  background: #fff;
  line-height: 0;
}
.qr img, .qr canvas { display: block; width: 176px; height: 176px; image-rendering: pixelated; }

/* ── 下の帯 ─────────────────────────────── */

.site-footer {
  background: var(--pink-deep);
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 4px; }
.site-footer nav a { display: inline-block; padding: 10px; text-decoration: none; max-width: 100%; overflow-wrap: anywhere; }   /* 押せる高さ 44px */
.site-footer nav a:hover { text-decoration: underline; }
.site-footer small { display: block; font-size: 14px; }   /* 薄くすると濃いピンクとの差が 4.5:1 を切る */

@media (min-width: 760px) {
  .hero { padding-top: 72px; }
  .headline { font-size: 34px; }
  .lead { font-size: 21px; }
}

/* ── 長文 (プライバシー・規約) ─────────────────────────────── */

body.legal {
  background: var(--paper);
  color: var(--ink);
  line-height: 1.8;
  color-scheme: light dark;
}
.legal .bar {
  background: var(--pink);
  /* ロゴの左端を本文の左端にそろえる (本文は幅 720px・左右 20px の余白) */
  padding: max(10px, env(safe-area-inset-top)) max(20px, calc((100% - 680px) / 2)) 10px;
}
.legal .bar a {
  display: inline-block;
  padding: 6px 0;
  color: #fff;
  font: 900 34px/1.1 var(--brand);
  letter-spacing: -0.027em;
  text-decoration: none;
  transform: rotate(-6deg);
}
.legal .doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 20px 48px;
  font-size: 16px;
  overflow-wrap: break-word;   /* 長い英単語・メールアドレスを、文字を大きくしても画面の中で折り返す */
}
.legal h1 { font-size: 1.5em; line-height: 1.4; margin: 1.2em 0 .6em; }
.legal h2 { font-size: 1.15em; margin-top: 2em; }
.legal a { color: var(--link); }
/* 押せる範囲を上下に広げる (余白は負のマージンで打ち消すので、行の高さは変わらない) */
.legal .doc a[href^="mailto:"] { display: inline-block; padding: 10px 0; margin: -10px 0; overflow-wrap: anywhere; }
.legal .lang-switch { display: inline-block; padding: 10px 8px; margin: -10px -8px; }
.legal hr { border: 0; border-top: 1px solid var(--rule); margin: 3em 0; }
.legal footer { margin-top: 3em; font-size: .85em; color: var(--ink-soft); }
.legal footer p { margin: .4em 0; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141214;
    --ink: #ECE8EA;
    --ink-soft: #B3ABAF;
    --rule: #333;
    --link: #FF8AB0;
  }
}
