/* いまから の Web ページ（docs/17）。手紙の世界観: 便箋の紙・墨・鉛筆の線・Klee One（アプリの docs/05 §E と同じ） */
@font-face { font-family: "Klee One"; font-weight: 400; font-display: swap; src: url("/assets/fonts/klee-400.4e6e177bb5.woff2") format("woff2"); }
@font-face { font-family: "Klee One"; font-weight: 600; font-display: swap; src: url("/assets/fonts/klee-600.500ab55a72.woff2") format("woff2"); }

:root {
  --paper: #F7F5F0;
  --card: #FFFDF8;
  --ink: #231E16;
  --text: #2A251D;
  --line: #4F483E;
  --faint: #9E9586;
  --muted: #6F685B;
  --wrap: 1040px;
  --font: "Klee One", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --track: .06em;
}
/* 韓国語・中国語は Klee One に字が無いので、端末の字体で書く（アプリと同じ。混ぜると1行の中で手書きとゴシックが混ざる） */
html[lang="ko"] { --font: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; --track: .02em; }
html[lang="zh-Hans"] { --font: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif; --track: .04em; }
html[lang="zh-Hant"] { --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif; --track: .04em; }
html[lang="en"] { --track: .02em; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  color: var(--text);
  background-color: var(--paper);
  /* 便箋の紙の目（平均の明るさは紙の色のまま） */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='280' height='280'><filter id='p'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .42  0 0 0 0 .39  0 0 0 0 .33  .07 0 0 0 0'/></filter><rect width='100%' height='100%' filter='url(%23p)'/></svg>");
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.95;
  letter-spacing: var(--track);
  font-feature-settings: "palt" 0;
  overflow-x: hidden;
}
p, li, h1, h2, h3, dt, dd, summary { word-break: auto-phrase; overflow-wrap: anywhere; }
.nw { white-space: nowrap; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 4px; }
img { max-width: 100%; display: block; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 鉛筆の線（assets/pencil.js が描く）。JS が動く前・動かないときは、細い線で代わりに囲む */
[data-pencil] { position: relative; }
.pencil-art { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
html:not(.pencil-on) [data-pencil="frame"], html:not(.pencil-on) [data-pencil="double"],
html:not(.pencil-on) [data-pencil="chip"] { box-shadow: inset 0 0 0 1.5px var(--line); }
html:not(.pencil-on) [data-pencil="dash"] { outline: 1.2px dashed var(--faint); outline-offset: -3px; }
html:not(.pencil-on) [data-pencil="rule"] { border-top: 1.2px solid var(--faint); }
.rule { height: 8px; margin: 0; }

/* ---------- 見出しとヘッダー ---------- */
.top { padding: 18px 0 6px; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 20px; letter-spacing: .12em; color: var(--ink); }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
h1, h2, h3 { color: var(--ink); font-weight: 600; letter-spacing: .06em; }
h1 { font-size: clamp(27px, 7.4vw, 44px); line-height: 1.55; margin: 0 0 16px; }
h2 { font-size: clamp(22px, 5.6vw, 32px); line-height: 1.6; margin: 0 0 14px; }
h3 { font-size: 19px; line-height: 1.6; margin: 0 0 6px; }
html[lang="en"] h1, html[lang="en"] h2 { letter-spacing: .01em; }
.lead { font-size: 17px; margin: 0 0 8px; }
.muted { color: var(--muted); }
section { padding: 56px 0; }
section + .wrap .rule, .between { margin: 0 auto; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 10px 26px; width: 100%;
  font: inherit; font-size: 18px; letter-spacing: .16em; color: var(--ink);
  background: transparent; border: 0; cursor: pointer; text-decoration: none; text-align: center;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: rgba(35, 30, 22, .04); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .chip:focus-visible, .btn-text:focus-visible, summary:focus-visible, .store:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }
.btn[disabled] { color: var(--faint); cursor: progress; }
.btn-text { font: inherit; color: var(--muted); background: none; border: 0; padding: 10px 14px; cursor: pointer; letter-spacing: .1em; }
.stores { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 22px 0 6px; }
.store { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 8px; min-height: 64px; text-decoration: none; color: var(--ink); line-height: 1.35; }
.store b { font-size: 17px; font-weight: 600; letter-spacing: .04em; }
.store small { font-size: 12.5px; color: var(--muted); letter-spacing: .08em; }
.store:hover { background: rgba(35, 30, 22, .04); }
.free { font-size: 14px; color: var(--muted); text-align: center; margin: 4px 0 0; }

/* ---------- いちばん上（抽選機） ---------- */
.hero { padding: 18px 0 40px; }
.hero-grid { display: grid; gap: 8px; }
.machine-box { text-align: center; }
#machine:empty { aspect-ratio: 4 / 3; }
.deck-count { font-size: 15px; color: var(--muted); letter-spacing: .14em; margin: 4px 0 0; }
#machine { width: 100%; height: auto; display: block; margin: 0 auto; overflow: visible; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
#machine [data-act] { cursor: pointer; }
.draw-controls { max-width: 460px; margin: 0 auto; width: 100%; }
.filters { margin: 16px 0 0; text-align: center; }
.filters p { font-size: 13.5px; color: var(--muted); margin: 0 0 8px; letter-spacing: .08em; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 10px; }
.chip {
  font: inherit; font-size: 15px; letter-spacing: .1em; color: var(--text); background: transparent; border: 0;
  padding: 7px 14px; min-height: 42px; min-width: 64px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.chip[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
@media (min-width: 900px) {
  .hero { padding: 34px 0 64px; }
  .hero-grid { grid-template-columns: 1fr 1.08fr; grid-template-areas: "copy machine" "stores machine"; column-gap: 44px; align-items: end; }
  .hero-copy { grid-area: copy; }
  .machine-box { grid-area: machine; align-self: center; }
  .hero-stores { grid-area: stores; align-self: start; }
  .hero-stores .stores { max-width: 420px; }
  .hero-stores .free { text-align: left; }
}

/* ---------- お題のカード（白い紙・二重の鉛筆の枠） ---------- */
.card {
  background: var(--card); position: relative;
  box-shadow: 0 1px 0 rgba(35, 30, 22, .04), 0 10px 22px -16px rgba(35, 30, 22, .45);
}
.card-face { display: flex; align-items: center; justify-content: center; padding: 14% 13%; aspect-ratio: 34 / 48; }
.card-text { color: var(--text); text-align: center; letter-spacing: .04em; }
.card-text.vt { writing-mode: vertical-rl; line-height: 1.62; text-align: start; }
.card-text.vt span { display: block; white-space: nowrap; letter-spacing: .04em; text-orientation: upright; }
.card-text.ht { display: flex; flex-direction: column; justify-content: center; line-height: 1.3; }
.card-text.ht span { display: block; white-space: nowrap; }
.card-back { background: transparent; box-shadow: none; }

/* 引いたお題を大きく見せる（アプリの「お題カード」と同じ並び） */
.card-dialog { border: 0; padding: 0; background: transparent; max-width: min(420px, 92vw); width: 100%; color: var(--text); overflow: visible; }
.card-dialog::backdrop { background: rgba(247, 245, 240, .82); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.dlg-inner { background: var(--paper); padding: 22px 22px 18px; text-align: center; box-shadow: 0 24px 50px -30px rgba(35, 30, 22, .6); }
.dlg-no { margin: 0 0 12px; font-size: 14px; color: var(--muted); letter-spacing: .16em; }
.dlg-card { width: 74%; margin: 0 auto; }
.dlg-meta { font-size: 14.5px; margin: 6px 0 14px; letter-spacing: .08em; }
.dlg-note { font-size: 13px; color: var(--muted); margin: 6px 0 0; line-height: 1.8; }
.card-dialog[open] .dlg-card { animation: lift .5s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes lift { from { transform: translateY(18px) scale(.86) rotate(-2deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .card-dialog[open] .dlg-card { animation: none; } }

/* ---------- 3つの流れ ---------- */
.steps { display: grid; gap: 30px; margin-top: 28px; }
.step { display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: start; }
.num { width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 600; color: var(--ink); }
.step h3 { white-space: pre-line; }
.step p { margin: 0; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 36px; } .step { grid-template-columns: 1fr; } }

/* ---------- 手紙のページの見本 ---------- */
.pages { display: grid; gap: 34px; margin-top: 30px; justify-items: center; }
.page { background: var(--card); padding: 18px 18px 16px; width: 100%; max-width: 420px; box-shadow: 0 16px 30px -24px rgba(35, 30, 22, .55); }
.page:nth-child(1) { transform: rotate(-1.2deg); }
.page:nth-child(2) { transform: rotate(1.4deg); max-width: 360px; }
.photos { display: grid; gap: 5px; }
.photos .row { display: grid; gap: 5px; }
.photos img { width: 100%; height: 100%; object-fit: cover; background: #e9e4d8; }
.ph-lead { aspect-ratio: 5 / 4; }
.ph-sq { aspect-ratio: 1 / 1; }
.ph-port { aspect-ratio: 3 / 4; }
.page-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 12.5px; color: var(--muted); letter-spacing: .1em; }
.page-title { margin: 4px 0 0; font-size: 16px; color: var(--ink); letter-spacing: .06em; line-height: 1.7; }
.share { display: flex; justify-content: center; gap: 26px; margin-top: 18px; font-size: 14px; color: var(--muted); letter-spacing: .1em; }
@media (min-width: 900px) { .pages { grid-template-columns: 1.15fr 1fr; align-items: center; } }

/* ---------- 一緒に ---------- */
.together { display: grid; gap: 28px; margin-top: 26px; }
.invite { background: var(--card); padding: 22px 20px 20px; max-width: 420px; width: 100%; justify-self: center; transform: rotate(-.8deg); box-shadow: 0 16px 30px -24px rgba(35, 30, 22, .55); }
.invite .label { font-size: 13px; color: var(--muted); letter-spacing: .12em; margin: 0; }
.inv-title { font-size: 19px; color: var(--ink); margin: 2px 0 12px; line-height: 1.6; }
.invite .code { font-size: 30px; letter-spacing: .2em; color: var(--ink); margin: 2px 0 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.members { display: flex; flex-wrap: wrap; gap: 16px 14px; margin-top: 12px; }
.member { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 13px; min-width: 56px; white-space: nowrap; }
.avatar { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #1A1A1A; font-weight: 600; }
.avatar.empty { background: transparent; color: var(--faint); font-size: 12px; }
.facts { list-style: none; padding: 0; margin: 18px 0 0; }
.facts li { padding: 10px 0 10px 28px; position: relative; }
.facts li::before { content: ""; position: absolute; left: 4px; top: 22px; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--line); }
@media (min-width: 900px) { .together { grid-template-columns: 1fr 1fr; align-items: center; } }

/* ---------- カード帳 ---------- */
.book { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 26px; max-width: 480px; }
.book > * { min-width: 0; }
.card-face { overflow: hidden; }
.book .card-face { padding: 12% 10%; }
.book-count { margin: 14px 0 0; font-size: 14px; color: var(--muted); letter-spacing: .12em; }
@media (min-width: 900px) { .book-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; } .book { margin-top: 0; } }

/* ---------- よくある質問 ---------- */
.narrow { max-width: 760px; }
.faq { margin-top: 18px; }
.faq details { padding: 4px 0; }
.faq summary { list-style: none; cursor: pointer; padding: 14px 34px 14px 0; font-size: 17px; color: var(--ink); position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "＋"; position: absolute; right: 4px; top: 14px; color: var(--muted); }
.faq details[open] summary::after { content: "－"; }
.faq dd, .faq .a { margin: 0 0 14px; color: var(--text); }

/* ---------- おわりと足もと ---------- */
.cta { text-align: center; padding: 30px 0 40px; }
.cta .stores { max-width: 460px; margin-left: auto; margin-right: auto; }
.foot { padding: 26px 0 40px; font-size: 14px; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 14px 0 10px; }
.foot a { color: var(--muted); }

/* ---------- 規約・ポリシー・招待・見つからない ---------- */
.doc { padding: 10px 0 30px; }
.doc .wrap { max-width: 760px; }
.sheet { background: var(--card); padding: 26px 22px 30px; margin-top: 10px; box-shadow: 0 16px 30px -26px rgba(35, 30, 22, .5); }
.sheet h1 { font-size: clamp(24px, 6vw, 32px); }
.sheet h2 { font-size: 19px; margin: 34px 0 6px; }
.sheet .meta { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; }
.sheet ul, .sheet ol { padding-left: 1.3em; }
.sheet li { margin: 4px 0; }
.tbl { display: grid; gap: 0; margin: 10px 0; }
.tbl .tr { padding: 12px 0; }
.tbl .th { font-weight: 600; color: var(--ink); }
.tbl .td { margin: 2px 0 0; }
.sheet section { padding: 0; }
.invite-code { white-space: nowrap; font-size: clamp(28px, 9vw, 46px); font-weight: 600; letter-spacing: .16em; color: var(--ink); text-align: center; margin: 4px 0 6px; user-select: all; -webkit-user-select: all; font-variant-numeric: tabular-nums; }
.howto { counter-reset: s; list-style: none; padding: 0; margin: 20px 0 0; }
.howto li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 4px 12px; align-items: center; margin: 14px 0; }
.howto .stores { grid-column: 1 / -1; margin: 8px 0 6px; }
.howto .num { width: 36px; height: 36px; font-size: 16px; }
.hidden { display: none !important; }

/* ================= 2026-11-13 Pimorio の骨組みを借りた LP（docs/17 §7）。色と字と線は手紙の世界観のまま ================= */
.top .badge { font-size: 13px; color: var(--muted); letter-spacing: .08em; }
.center { text-align: center; }

/* いちばん上: 大きな見出し → 抽選機（まわりに撮った写真の紙きれ）→ ストア */
.hero { padding: 22px 0 26px; text-align: center; }
.hero h1 { font-size: clamp(30px, 8.6vw, 60px); line-height: 1.45; margin: 22px 0 10px; }
.hero .lead { max-width: 560px; margin: 0 auto; color: var(--muted); font-size: 15.5px; }
.stage { position: relative; max-width: 1040px; margin: 34px auto 0; }
.stage .machine-box { position: relative; z-index: 2; max-width: 470px; margin: 0 auto; background: var(--card); padding: 16px 18px 22px; box-shadow: 0 26px 44px -32px rgba(35, 30, 22, .6); }
.snap { position: absolute; z-index: 1; margin: 0; background: var(--card); padding: 7px 7px 20px; width: 96px; box-shadow: 0 14px 26px -18px rgba(35, 30, 22, .55); }
.snap img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.snap-1 { left: -6px; top: -24px; transform: rotate(-9deg); }
.snap-4 { right: -6px; top: -18px; transform: rotate(8deg); }
.snap-2, .snap-3, .snap-5, .snap-6 { display: none; }
.hero-stores { max-width: 460px; margin: 22px auto 0; }
.down { font-size: 22px; color: var(--muted); margin: 8px 0 0; }
@media (min-width: 900px) {
  .hero { padding: 30px 0 30px; }
  .snap { width: 158px; }
  .snap-2, .snap-3, .snap-5, .snap-6 { display: block; }
  .snap-1 { left: 3%; top: 2%; transform: rotate(-8deg); }
  .snap-2 { left: 13%; top: 38%; transform: rotate(5deg); width: 176px; }
  .snap-3 { left: 2%; top: 70%; transform: rotate(-4deg); }
  .snap-4 { right: 3%; top: 0; transform: rotate(7deg); }
  .snap-5 { right: 12%; top: 37%; transform: rotate(-6deg); width: 176px; }
  .snap-6 { right: 1%; top: 69%; transform: rotate(4deg); }
}

/* 流れ: 番号つき、画面と説明を左右交互に */
#movie h2, #pages h2, #flow h2, #more h2, #safe h2, #faq h2 { margin-bottom: 30px; }
/* 紹介動画: 画面と同じ紙の枠に、2:3 のまま */
.movie { margin: 0 auto; width: min(340px, 78vw); background: var(--card); padding: 9px; box-shadow: 0 28px 44px -32px rgba(35, 30, 22, .65); }
.movie video { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; border-radius: 20px; background: var(--paper, #F7F5F0); }
.flow-row { display: grid; gap: 20px; align-items: center; margin: 0 auto 56px; max-width: 900px; }
.phone { margin: 0 auto; width: min(270px, 70vw); background: var(--card); padding: 9px; box-shadow: 0 28px 44px -32px rgba(35, 30, 22, .65); }
.phone img { width: 100%; border-radius: 20px; }
.flow-copy { text-align: left; max-width: 400px; margin: 0 auto; width: 100%; }
.flow-copy h3 { font-size: clamp(21px, 5.4vw, 28px); line-height: 1.55; margin: 12px 0 8px; }
.flow-copy p { color: var(--muted); margin: 0; }
@media (min-width: 900px) {
  .flow-row { grid-template-columns: 1fr 1fr; gap: 64px; }
  .flow-row.rev .phone { order: 2; }
}

/* やったお題で: 大きさのちがうカードを敷き詰める */
.bento { display: grid; gap: 16px; }
.tile { background: var(--card); padding: 20px 20px 22px; overflow: hidden; min-width: 0; }
.tile h3 { font-size: 18px; margin: 0 0 6px; }
.tile .pages { grid-template-columns: 1fr; margin-top: 18px; gap: 24px; }
.tile .page { box-shadow: 0 12px 24px -20px rgba(35, 30, 22, .55); }
.tile-shot { margin: 16px auto -70px; width: 72%; max-height: 360px; overflow: hidden; }
.tile-shot img { border-radius: 18px; box-shadow: 0 18px 30px -24px rgba(35, 30, 22, .6); }
.faces { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.face { width: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.tile-invite .invite { transform: none; margin: 14px 0 0; box-shadow: none; max-width: none; }
@media (min-width: 900px) {
  .bento { grid-template-columns: 1.25fr 1fr 1fr; grid-template-areas: "share book face" "share invite invite"; }
  .tile-share { grid-area: share; } .tile-book { grid-area: book; } .tile-face { grid-area: face; } .tile-invite { grid-area: invite; }
}

/* 安心の一覧 */
.safe { background: var(--card); max-width: 580px; margin: 0 auto; padding: 6px 24px; }
.safe-row { padding: 16px 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.safe-row b { color: var(--ink); font-weight: 600; }
.safe-row span { font-size: 14px; color: var(--muted); }

/* おわり: アイコンと一言 */
.cta { padding: 40px 0 46px; }
.cta-icon { width: 112px; height: 112px; border-radius: 26px; margin: 0 auto 20px; box-shadow: 0 18px 30px -20px rgba(35, 30, 22, .5); }
.cta h2 { font-size: clamp(26px, 6.8vw, 42px); line-height: 1.5; }
/* img の width/height 属性（読みこみ中の場所取り用）を、表示の高さにしない */
.snap img, .phone img, .tile-shot img, .face { height: auto; }
.snap img { height: auto; aspect-ratio: 1; }
@media (min-width: 900px) {
  .snap-1 { top: 4%; } .snap-2 { top: 36%; } .snap-3 { top: 66%; }
  .snap-4 { top: 2%; } .snap-5 { top: 35%; } .snap-6 { top: 65%; }
  .hero-stores { margin-top: 34px; }
}
@media (max-width: 899px) {
  .hero h1 { font-size: clamp(26px, 7.4vw, 40px); }
  .snap-1 { left: 2px; } .snap-4 { right: 2px; }
}
img.avatar { object-fit: cover; height: 46px; }
.brand { white-space: nowrap; }
@media (max-width: 599px) { .top .badge { display: none; } }

/* 実際に通して書き出したページ（ひとり・ともだち・ふたり・かぞく） */
.pages-lead { max-width: 560px; margin: -14px auto 28px; }
.sample-pages { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 18px; max-width: 980px; margin: 0 auto; }
.sample-pages figure { margin: 0; text-align: center; }
.sample-pages img { display: block; width: 100%; height: auto; box-shadow: 0 18px 30px -22px rgba(35, 30, 22, .7); transform: rotate(-1.2deg); }
.sample-pages figure:nth-child(even) img { transform: rotate(1.2deg); }
.sample-pages figcaption { margin-top: 12px; font-size: 16px; color: var(--muted); }
@media (min-width: 900px) { .sample-pages { grid-template-columns: repeat(4, 1fr); gap: 28px; } }
