/* Hmm のサイト（LP・利用規約・プライバシーポリシー・サポート）の共通スタイル。
   色・角丸・ドットの背景は、アプリのデザイントークン（Hmm/DesignSystem/Tokens/HmmColor.swift）に合わせている。
   文字は、アプリと同じく「システムの日本語フォント + 等幅（SF Mono）」。Web フォントは読み込まない。 */

/* 吹き出しの中と、QR の上の文言だけ LINE Seed JP（Bold）。使う文字だけに絞ったもの（scripts/make-bubble-font.sh。SIL OFL） */
@font-face {
  font-family: "LINE Seed JP Subset";
  src: url("/assets/fonts/LINESeedJP-Subset.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f7f7f7;
  --bg-dot: #d6d6d6;
  --surface: #ffffff;
  --text: #222222;
  --muted: #808080;
  --faint: #bdbdbd;
  --border: #ebebeb;
  --border-pill: #e0e0e0;
  --dot: #1c5efd;
  --inverse-bg: #222222;
  --inverse-text: #ffffff;
  --shadow: 0 12px 32px rgba(34, 34, 34, 0.08);
  --logo-filter: none;
  --font-body: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", "Meiryo", sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e0f;
    --bg-dot: #2a2a2c;
    --surface: #1a1a1c;
    --text: #f2f2f2;
    --muted: #98989d;
    --faint: #55555a;
    --border: #2c2c30;
    --border-pill: #3a3a3e;
    --dot: #4d7fff;
    --inverse-bg: #f2f2f2;
    --inverse-text: #0e0e0f;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    --logo-filter: invert(1);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background-color: var(--bg);
  background-image: url("./assets/bg-dot.svg");
  background-size: 14px 14px;
  font-family: var(--font-body);
  line-height: 1.8;
}

a { color: var(--text); text-underline-offset: 3px; }
a:hover { color: var(--dot); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--dot); outline-offset: 3px; }

/* ロゴの下の読み（スマホの「はじめに」画面）。アプリの Onboarding と同じく、薄いグレーの等幅 */
.reading { font-family: var(--font-mono); font-size: 12px; line-height: 1; letter-spacing: -0.02em; color: #bdbdbd; }

.logo { display: block; height: 28px; width: auto; filter: var(--logo-filter); }

/* ドキュメントページ（利用規約・プライバシーポリシー・サポート） */

.site-header {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-nav { display: flex; gap: 20px; flex-wrap: wrap; font-size: 13px; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }

.doc {
  max-width: 760px;
  margin: 32px auto 0;
  padding: 0 16px;
}

.doc-card {
  background: var(--surface);
  border-radius: 32px;
  padding: 48px clamp(24px, 6vw, 56px) 56px;
  box-shadow: var(--shadow);
}

.doc-kicker {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 4vw, 30px);
  line-height: 1.4;
  font-weight: 700;
}

h2 {
  margin: 48px 0 12px;
  font-size: 19px;
  line-height: 1.5;
  font-weight: 700;
}

h2::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 12px;
  border-radius: 2px;
  background: var(--dot);
  vertical-align: 2px;
}

h3 { margin: 28px 0 8px; font-size: 16px; font-weight: 700; }

.meta { margin: 0; color: var(--muted); font-size: 13px; font-family: var(--font-mono); }
.lead { margin: 24px 0 0; }

p { margin: 12px 0; }
ul, ol { padding-left: 22px; }
li { margin: 6px 0; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
  line-height: 1.7;
}

th, td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; vertical-align: top; }
th { background: var(--bg); font-weight: 700; }

hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

.note {
  margin: 20px 0;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--bg);
  font-size: 14px;
}

.qa { margin: 20px 0; }
.qa dt { font-weight: 700; }
.qa dd { margin: 4px 0 0; }

.site-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 56px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  color: var(--muted);
  font-size: 12px;
}

.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.footer-links li { margin: 0; }

/* LP: 1 画面に収まる構成（スマホでは縦に積んでスクロール）。
   中央のスマホをタップすると、実際のアプリ画面がめくれる。 */

body.landing { height: 100vh; height: 100dvh; overflow: hidden; }

main.landing {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 24px 28px 16px;
  overflow: hidden;
}

/* ポインターの近くで、ドットが大きく青くなる（アプリの「1 ワード = 1 ドット」を写した動き） */
.dot-field {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.landing-header { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; }

.landing-stage {
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 5vw, 80px);
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

.hero { justify-self: end; display: flex; flex-direction: column; align-items: center; gap: 14px; width: 240px; }

/* 吹き出し: 画面が変わるたびに、キャラクターのひとことが変わる */
.bubble {
  position: relative;
  margin: 0;
  padding: 16px 20px;
  background: var(--surface);
  border: 1.5px solid #ebebeb;
  border-radius: 24px;
  width: 100%;
  text-align: center;
  font-family: "LINE Seed JP Subset", var(--font-body);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  transform-origin: 50% 100%;
}

/* 吹き出しのしっぽ（角丸なし）。回した四角の下半分だけに枠線を付け、吹き出しの枠線の上に重ねる */
.bubble::after {
  content: "";
  position: absolute;
  left: calc(50% - 3.5px);
  bottom: -4px;
  width: 7px;
  height: 7px;
  clip-path: polygon(100% 0, 100% 100%, 0 100%); /* 回した四角の下半分だけ（枠線が吹き出しの中に出っぱらない） */
  background: var(--surface);
  border-right: 1.5px solid #ebebeb;
  border-bottom: 1.5px solid #ebebeb;
  transform: rotate(45deg);
}

.bubble.is-pop { animation: bubble-pop 0.18s ease-out; }

@keyframes bubble-pop {
  from { opacity: 0.4; transform: scale(0.98) translateY(2px); }
  to { opacity: 1; transform: none; }
}

.mascot { display: block; width: clamp(72px, 12vh, 104px); height: auto; }


.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.store-link { display: inline-block; }
.store-badge { display: block; width: 153px; height: auto; }
.store-links { display: flex; flex-direction: column; align-items: center; gap: 10px; }

.qr-group { justify-self: start; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.qr-text { margin: 0; text-align: center; font-family: "LINE Seed JP Subset", var(--font-body); font-size: 16px; font-weight: 700; line-height: 1.5; }
.qr-group .store-links { margin-top: 20px; } /* QR と先頭のバッジの間隔（14 + 20 = 34px） */
.qr-card { padding: 12px; background: #ffffff; border-radius: 18px; box-shadow: var(--shadow); }
.qr-card img { display: block; width: clamp(96px, 16vh, 136px); height: auto; }

.phone-frame {
  position: relative;
  height: clamp(360px, 72vh, 660px);
  aspect-ratio: 1206 / 2622;
  max-width: 84vw;
  border-radius: 46px;
  cursor: pointer;
  perspective: 2100px;
  transition: transform 0.15s ease-out;
  will-change: transform;
}

.phone-frame.is-resetting { transition: transform 0.4s ease; }
.phone-flipper { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }

.phone-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 6px solid var(--surface);
  border-radius: 46px;
  background: var(--bg);
  box-shadow: 0 24px 60px rgba(34, 34, 34, 0.2);
  opacity: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: rotateY(180deg);
  transition: transform 0.64s cubic-bezier(0.22, 0.74, 0.22, 1), opacity 0.18s ease;
}

.phone-face:not(.is-active):not(.is-exiting) { transition: none; }
.phone-face.is-active { z-index: 2; opacity: 1; transform: rotateY(0deg); }
.phone-face.is-exiting { z-index: 1; opacity: 0; transform: rotateY(-180deg); }

.phone-face img.screen { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* 1 枚目（アプリの Onboarding に合わせた「はじめに」） */
.phone-face.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background-color: #f7f7f7;
  background-image: url("./assets/bg-dot.svg");
  background-size: 14px 14px;
  color: #222222;
}

.welcome .character { width: 46%; height: auto; }
.welcome .logo { height: 34px; filter: none; }
.welcome .reading { margin-top: -2px; }
.welcome .tagline { margin: 0; font-size: 13px; line-height: 1.7; }

.flip-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 6px;
  padding: 0 20px;
  border-radius: 999px;
  background: #222222;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(34, 34, 34, 0.2);
  transition: transform 0.14s ease-out;
}

.phone-frame:hover .flip-cta, .phone-frame:focus-visible .flip-cta { transform: scale(1.04); }

.screen-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -30px;
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.landing-footer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-top: 20px;
  color: var(--muted);
  font-size: 12px;
}

.landing-footer a { color: var(--muted); text-decoration: none; }
.landing-footer a:hover { color: var(--text); }

@media (max-width: 960px) {
  body.landing { height: auto; overflow: auto; }
  main.landing { height: auto; min-height: 100dvh; overflow: visible; }
  .dot-field { position: fixed; }
  /* position / z-index を外して、固定のバー（z-index: 10）が、フッターより上に重なるようにする */
  .landing-stage { position: static; z-index: auto; display: flex; flex-direction: column; align-items: center; gap: 40px; padding: 28px 0 56px; }
  /* スマホ幅: 上から、吹き出し → 画面 → ストアのバッジ。キャラクターと QR は出さない。
     吹き出しと画面の間は 20px あける（gap 40 - 20 = マイナス 20px）。切り替えのアニメーションは無し */
  /* ストアのバッジは、下に固定（スクロールしてもついてくる）。背景は #F7F7F7、上の枠線だけ薄い色 */
  .qr-text, .qr-card { display: none; }
  .qr-group {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 10;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    background: var(--bg);
    border-top: 1px solid var(--border);
  }
  .qr-group .store-links { flex-direction: row; justify-content: center; gap: 12px; margin-top: 0; }
  .qr-group .store-badge { width: auto; height: 46px; }
  /* 固定のバーの高さ（46 + 16 × 2 + 枠線 1 = 79）ぶん、フッターの下に余白を取る（フッターと重ならないように） */
  .landing-footer { padding-bottom: calc(79px + 16px + env(safe-area-inset-bottom)); }
  .hero { order: 0; position: relative; z-index: 5; justify-self: center; width: min(240px, 100%); margin-bottom: -20px; }
  .bubble.is-pop { animation: none; }
  .mascot { display: none; }
  /* スマホ幅: 大きさは、高さではなく幅で決める（実機でスクロールしてブラウザのバーが出入りしても、大きさが変わらないように） */
  .phone-frame { order: 1; width: min(70vw, 320px); height: auto; margin-bottom: 20px; }
}

/* スマホ幅では、ヘッダーのメニューは出さない（幅が足りない。同じリンクはフッターにある） */
@media (max-width: 640px) {
  .site-nav { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .phone-frame, .phone-face, .flip-cta { transition: none !important; will-change: auto; }
  .bubble.is-pop { animation: none; }
}
