/* 新しいホーム。サイト全体と同じトンマナ (style.css の色・丸い見出し・厚みのあるボタンとカード) で、
   昼の紙の上に、ヨルの夜は丸い窓と締めにだけ置く。Duolingo のように、絵を大きく、ボタンは押すと沈む。
   広い画面の動き (.hs.is-scrolly) は home-story.js が付ける。付かないとき (狭い画面・動きを減らす・スクリプトなし) は
   手順ごとの図を上から順に並べる。 */

.story-body {
  --hs-sky: #e6f0f2;
  --hs-lilac: #eeebf8;
  --hs-butter: #fff4dc;
  --hs-mint: #e5f2e9;
  --hs-text: #44555a;
  --hs-relief: var(--relief);
  --hs-tired: var(--tired);
  --hs-joy: var(--joy);
  --hs-gold: var(--glow);
  --hs-moon: #f6dd95;
  --hs-ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}
.story-body .site-footer { margin-top: 0; }

.home-story { overflow-x: clip; }
.hs { --hs-gutter: clamp(20px, 5vw, 40px); }
.hs h1, .hs h2, .hs h3 { text-wrap: balance; margin: 0; }
.hs p { margin: 0; }
.hs-icon { width: 1.15em; height: 1.15em; flex: none; }
.hs a { text-underline-offset: 0.2em; }
.hs :focus-visible { outline: 3px solid var(--glow); outline-offset: 3px; border-radius: 10px; }

/* ---------- ボタン ---------- */
.hs-btn, .hs-store {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 14px 26px; border-radius: 18px;
  font-family: var(--font-round), var(--font-base); font-weight: 800; font-size: 1.05rem; line-height: 1.3; text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.hs-btn { background: var(--accent); color: #fff; box-shadow: 0 5px 0 var(--accent-deep); }
.hs-btn:hover { filter: brightness(1.08); }
.hs-btn:active, .hs-btn.is-pressed { transform: translateY(5px); box-shadow: 0 0 0 var(--accent-deep); }
.hs-btn .hs-icon { transition: transform 0.3s var(--hs-ease); }
.hs-btn:hover .hs-icon { transform: translateY(2px); }
.hs-store { background: var(--card); color: var(--ink); border: 2px solid var(--line); box-shadow: 0 5px 0 var(--line); }
.hs-store-soon { color: var(--muted); }
a.hs-store { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 5px 0 #000; }
a.hs-store:active { transform: translateY(5px); box-shadow: 0 0 0 #000; }
.hs-trial { font-size: 0.9rem; line-height: 1.7; }
.hs-trial a { color: var(--muted); text-decoration-style: dotted; text-decoration-thickness: 1.5px; }
.hs-trial a:hover { color: var(--ink); }

/* ---------- 夜の丸い窓 ---------- */
.hs-porthole, .hs-stage-window, .hs-closing-art {
  background:
    radial-gradient(1.6px 1.6px at 22% 30%, #fff9 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 38% 18%, #fff8 50%, transparent 52%),
    radial-gradient(1.8px 1.8px at 64% 44%, #fffb 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 30% 58%, #fff7 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 80% 62%, #fff8 50%, transparent 52%),
    radial-gradient(120% 90% at 70% 20%, #3b4282 0, var(--night-2) 45%, var(--night) 80%);
}
.hs-moon { position: absolute; width: 16%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 70% 35%, transparent 52%, var(--hs-moon) 53%); rotate: -20deg; }

/* ---------- 冒頭 ---------- */
.hs-hero { background: var(--paper); }
.hs-hero-inner {
  max-width: 1160px; margin: 0 auto;
  padding: clamp(28px, 5vw, 72px) var(--hs-gutter) clamp(48px, 7vw, 96px);
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(24px, 5vw, 64px); align-items: center;
}
.hs-hero-art { position: relative; width: 100%; max-width: 470px; aspect-ratio: 1; justify-self: center; display: grid; place-items: center; }
.hs-porthole {
  position: absolute; inset: 4% 4% 12%; border-radius: 50%; overflow: hidden;
  border: 12px solid var(--card); box-shadow: 0 0 0 2px var(--line), 0 8px 0 2px var(--line);
}
.hs-porthole .hs-moon { right: 18%; top: 14%; }
.hs-cloud { position: absolute; height: 18%; border-radius: 999px; background: rgba(255, 255, 255, 0.1); }
.hs-cloud-1 { left: -6%; bottom: 8%; width: 60%; }
.hs-cloud-2 { right: -10%; bottom: -2%; width: 70%; background: rgba(255, 255, 255, 0.07); }
.hs-poke {
  position: relative; z-index: 2; appearance: none; border: 0; padding: 0; margin: 10% 0 0; background: none; cursor: pointer;
  width: 70%; border-radius: 40%; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.hs-poke .yoru-pic { width: 100%; filter: drop-shadow(0 12px 10px rgba(12, 16, 40, 0.28)); }
.hs-say {
  position: absolute; z-index: 3; top: 10%; left: 2%; max-width: 15em;
  padding: 10px 16px; border-radius: 18px; border-end-start-radius: 6px; background: var(--card); color: var(--ink);
  border: 2px solid var(--line); border-bottom-width: 4px;
  font-family: var(--font-round), var(--font-base); font-weight: 800; font-size: 0.98rem; line-height: 1.45;
  opacity: 0; transform: translateY(8px) scale(0.85); transform-origin: 0% 100%;
  transition: opacity 0.22s, transform 0.32s var(--hs-ease); pointer-events: none;
}
.hs-say.is-showing { opacity: 1; transform: none; }
.hs-say:empty { visibility: hidden; }

.hs-hero-copy { display: grid; gap: 22px; justify-items: start; }
.hs-fine { display: grid; gap: 4px; }
.hs-spec { font-size: 0.82rem; color: var(--muted); }
.hs-hero h1 { font-size: clamp(2rem, 3.8vw, 3rem); line-height: 1.28; letter-spacing: -0.01em; color: var(--ink); }
.hs-hero h1 span { display: block; }
/* 日本語・中国語・韓国語のつぶやきは1行が数文字なので、大きく置く */
.hs-hero h1:lang(ja), .hs-hero h1:lang(zh), .hs-hero h1:lang(ko) { font-size: clamp(2.5rem, 4.8vw, 3.7rem); line-height: 1.22; }
.hs-hero:is(:lang(en), :lang(de), :lang(fr), :lang(it), :lang(pt), :lang(es), :lang(id)) h1 { line-height: 1.12; letter-spacing: -0.02em; hyphens: auto; }
.hs-hero:is(:lang(ar), :lang(hi)) h1 { line-height: 1.55; letter-spacing: 0; }
.hs-lead { display: grid; gap: 12px; max-width: 34em; font-size: 1.06rem; line-height: 1.95; color: var(--hs-text); }
.hs-hero:is(:lang(en), :lang(de), :lang(fr), :lang(it), :lang(pt), :lang(es), :lang(id)) .hs-lead { line-height: 1.7; }
.hs-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 16px; margin-top: 4px; }

/* ---------- ヨル (アプリの 3D のヨルの静止画。冒頭は動かせる端末で 3D に替わる) ---------- */
/* 表情ごとの絵を重ね、data-pose の絵だけを見せる。新しい絵は上に重ねて薄く出し、前の絵はそのあと消す (間に透けない) */
.yoru-pic { display: block; position: relative; transition: rotate 0.4s var(--hs-ease); }
.yoru-float { display: grid; position: relative; }
.yoru-float > img { grid-area: 1 / 1; display: block; width: 100%; height: auto; opacity: 0; z-index: 0; transition: opacity 0s 0.25s; }
.yoru-pic[data-pose="idle"] [data-pose-img="idle"],
.yoru-pic[data-pose="happy"] [data-pose-img="happy"],
.yoru-pic[data-pose="giggling"] [data-pose-img="giggling"],
.yoru-pic[data-pose="blushing"] [data-pose-img="blushing"],
.yoru-pic[data-pose="curious"] [data-pose-img="curious"],
.yoru-pic[data-pose="listen"] [data-pose-img="listen"],
.yoru-pic[data-pose="write"] [data-pose-img="write"] { opacity: 1; z-index: 1; transition: opacity 0.25s; }
.hs-yoru-hero .yoru-float > img { transition-duration: 0s; transition-delay: 0.15s; }
.hs-yoru-hero[data-pose="idle"] [data-pose-img="idle"],
.hs-yoru-hero[data-pose="happy"] [data-pose-img="happy"],
.hs-yoru-hero[data-pose="giggling"] [data-pose-img="giggling"],
.hs-yoru-hero[data-pose="blushing"] [data-pose-img="blushing"] { transition-duration: 0.15s; transition-delay: 0s; }
/* まばたきは一瞬で */
.yoru-pic[data-blink] [data-pose-img="blink"] { opacity: 1; z-index: 2; transition: none; }
/* 3D: 静止画の上に重ね、出るまでは透明。出たら静止画は 3D の下で消す (戻すときは静止画を先に出してから 3D を薄くする) */
.yoru-3d { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; opacity: 0; pointer-events: none; transition: opacity 0.35s ease; }
.yoru-pic.is-3d .yoru-3d { opacity: 1; }
.yoru-pic.is-3d .yoru-float > img { opacity: 0 !important; transition: opacity 0s 0.4s !important; }
.yoru-pic.is-3d-leaving .yoru-float > img { transition: none !important; }

/* ---------- 会話の見本 (手順) ---------- */
.hs-story { position: relative; isolation: isolate; }
.hs-intro { padding: clamp(36px, 6vw, 64px) var(--hs-gutter) clamp(28px, 4vw, 40px); text-align: center; display: grid; justify-items: center; gap: 12px; border-top: 2px solid var(--line); }
.hs-intro-label {
  display: inline-block; font-size: 0.92rem; font-weight: 800; letter-spacing: 0.04em; color: var(--glow-text);
  background: var(--glow-soft); border: 2px solid #f0dca9; padding: 5px 16px; border-radius: 999px;
}
.hs-intro p { max-width: 36em; font-size: 1.05rem; line-height: 1.85; color: var(--hs-text); }
.hs-note { font-size: 0.82rem !important; color: var(--muted) !important; }

.hs-steps { max-width: 1120px; margin: 0 auto; }
.hs-step {
  position: relative; isolation: isolate; padding: clamp(40px, 6vw, 72px) var(--hs-gutter);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center;
}
.hs-step::before { content: ""; position: absolute; z-index: -1; inset: 0 -100vw; background: var(--band); }
.hs-step-photo { --band: var(--hs-sky); }
.hs-step-talk { --band: var(--hs-lilac); }
.hs-step-diary { --band: var(--hs-butter); }
.hs-step-album { --band: var(--hs-mint); }
.hs-step-text { display: grid; gap: 14px; align-content: center; justify-items: start; max-width: 30em; }
.hs-step-n {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-round), var(--font-base); font-weight: 800; font-size: 1.05rem;
  background: var(--accent); color: #fff; box-shadow: 0 4px 0 var(--accent-deep);
}
.hs-step h2 { font-size: clamp(1.5rem, 2.7vw, 2.2rem); line-height: 1.4; color: var(--accent-deep); }
.hs-step:is(:lang(en), :lang(de), :lang(fr), :lang(it), :lang(pt), :lang(es), :lang(id)) h2 { line-height: 1.2; hyphens: auto; }
.hs-step:is(:lang(ar), :lang(hi)) h2 { line-height: 1.6; }
.hs-step-text p { font-size: 1.05rem; line-height: 1.95; color: var(--hs-text); }
.hs-step:is(:lang(en), :lang(de), :lang(fr), :lang(it), :lang(pt), :lang(es), :lang(id)) .hs-step-text p { line-height: 1.7; }
.hs-fig { margin: 0; min-width: 0; }

/* 写真と手がかり */
.hs-polaroid {
  position: relative; background: #fff; padding: 10px 10px 34px; border-radius: 6px;
  border: 2px solid var(--line); box-shadow: 0 6px 0 var(--line); rotate: -4deg;
}
.hs-polaroid img { display: block; width: 100%; height: auto; aspect-ratio: 1.13; object-fit: cover; border-radius: 2px; }
.hs-polaroid-cap { position: absolute; left: 12px; right: 12px; bottom: 8px; display: flex; justify-content: space-between; gap: 8px; font-size: 0.8rem; color: var(--muted); font-weight: 700; }
.hs-clue {
  display: inline-flex; align-items: center; gap: 10px; padding-block: 8px; padding-inline: 8px 14px; border-radius: 16px;
  background: var(--card); color: var(--ink); font-weight: 800; font-size: 0.9rem; line-height: 1.25;
  border: 2px solid var(--line); border-bottom-width: 4px;
}
.hs-clue > span { display: grid; }
.hs-clue small { font-weight: 600; font-size: 0.74rem; color: var(--muted); }
.hs-clue .hs-icon { width: 32px; height: 32px; padding: 6px; border-radius: 10px; background: var(--hs-sky); color: var(--accent); }
.hs-clue-plan .hs-icon { background: var(--hs-butter); color: #8a6a2a; }

.hs-fig-photo { display: grid; gap: 22px; }
.hs-fig-clues { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; align-items: center; }
.hs-fig-clues .hs-polaroid { grid-row: span 2; }
.hs-fig-clues .hs-clue { justify-self: start; }
.hs-fig-ask { display: flex; align-items: flex-end; gap: 10px; }
.hs-fig-yoru { width: 92px; height: auto; flex: none; filter: drop-shadow(0 4px 5px rgba(60, 46, 30, 0.14)); }
.hs-ask {
  position: relative; padding: 12px 18px; border-radius: 22px; border-end-start-radius: 6px; background: var(--card); color: var(--ink);
  border: 2px solid var(--line); border-bottom-width: 4px;
  font-family: var(--font-round), var(--font-base); font-weight: 800; font-size: 1.05rem; margin-bottom: 26px !important;
}

/* 話した順 */
.hs-spoken-label { font-size: 0.84rem; font-weight: 800; letter-spacing: 0.04em; color: #7a6230; margin-bottom: 8px !important; }
.hs-spoken ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hs-chip {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 16px;
  background: var(--card); color: var(--ink); font-size: 0.92rem; font-weight: 700; line-height: 1.4;
  border: 2px solid var(--line); border-bottom-width: 4px;
  transition: transform 0.2s var(--hs-ease);
}
.hs-chip:hover { transform: translateY(-1px); }
.hs-chip b, .ph-badge { display: inline-grid; place-items: center; flex: none; border-radius: 50%; color: #fff; font-weight: 800; }
.hs-chip b { width: 26px; height: 26px; font-size: 0.82rem; }
.hs-relief b, .ph-badge.ph-relief { background: var(--hs-relief); }
.hs-tired b, .ph-badge.ph-tired { background: var(--hs-tired); }
.hs-joy b, .ph-badge.ph-joy { background: var(--hs-joy); }
.hs-fig-diary { display: grid; gap: 10px; justify-items: stretch; max-width: 460px; width: 100%; justify-self: center; }
.hs-fig-arrow { justify-self: center; color: #b49450; }
.hs-fig-arrow .hs-icon { width: 28px; height: 28px; }

/* ---------- アプリの画面 (描き直し) ---------- */
.hs-screen-lite, .hs-screen {
  font-size: 13px; line-height: 1.5; color: #1f2a30; background: #faf7f1; text-align: start;
}
.hs-screen-lite :lang(ja), .hs-screen :lang(ja) { line-height: 1.6; }
.hs-screen-lite {
  max-width: 380px; margin: 0 auto; border-radius: 30px; overflow: hidden;
  box-shadow: 0 24px 50px rgba(5, 25, 30, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.04);
}
.ph-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 14px 8px; }
.ph-pill { background: #fff; border-radius: 999px; padding: 4px 11px; font-weight: 700; font-size: 11.5px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.ph-ghost-pill { visibility: hidden; }
.ph-title { display: grid; text-align: center; font-size: 13px; line-height: 1.25; }
.ph-title small { font-size: 9.5px; color: #8a9499; }
.ph-chat { display: flex; flex-direction: column; }
.ph-scroll { position: relative; overflow: hidden; }
.ph-list { display: flex; flex-direction: column; gap: 9px; padding: 6px 14px 14px; transition: transform 0.7s var(--hs-ease); }
.ph-row { display: flex; gap: 7px; align-items: flex-start; }
.hs-ava { width: 30px; height: 30px; flex: none; }
/* 会話のアイコン: アプリの会話と同じく、ヨルの全身を枠なしで */
.hs-ava-space { display: block; }
.ph-bubble { margin: 0; padding: 8px 12px; border-radius: 17px; max-width: 82%; font-size: 12.5px; }
.ph-yoru { background: #edf1f2; border-start-start-radius: 6px; }
.ph-you { align-self: flex-end; background: #3f6e7a; color: #fff; border-start-end-radius: 6px; }
.ph-clue { margin-block: -2px 2px; margin-inline: 37px 0; width: 64%; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); }
.ph-clue-img { display: block; width: 100%; height: auto; aspect-ratio: 1.13; object-fit: cover; }
.ph-clue figcaption { display: flex; align-items: center; gap: 5px; padding: 5px 9px; font-size: 10px; color: #6a777b; font-weight: 600; }
.ph-clue .hs-icon { width: 12px; height: 12px; }
.ph-input {
  display: flex; align-items: center; gap: 6px; margin: 4px 12px 0; padding-block: 5px; padding-inline: 13px 5px;
  background: #fff; border-radius: 999px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07); color: #9aa3a7; font-size: 12px;
}
.ph-field { flex: 1; }
.ph-send { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #dfe7e9; color: #fff; }
.ph-send .hs-icon { width: 14px; height: 14px; }
.ph-voice { position: relative; display: grid; justify-items: center; gap: 2px; padding: 9px 0 13px; color: #8a9499; font-size: 9.5px; }
.ph-mic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #3f6e7a; color: #fff; box-shadow: 0 4px 10px rgba(63, 110, 122, 0.35); }
.ph-mic .hs-icon { width: 20px; height: 20px; }
.ph-done { position: absolute; inset-inline-end: 12px; top: 18px; background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 10px; font-weight: 700; color: #3f6e7a; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

.ph-diary { display: flex; flex-direction: column; }
.ph-t-day { display: none; }
.ph-diary[data-saved] .ph-t-draft { display: none; }
.ph-diary[data-saved] .ph-t-day { display: block; }
.ph-yoru-says { display: flex; gap: 7px; align-items: flex-start; padding: 0 14px 9px; }
.ph-diary[data-saved] .ph-yoru-says, .ph-diary[data-saved] .ph-actions { display: none; }
.ph-seg { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 14px 10px; padding: 2px; border-radius: 10px; background: #ece6da; }
.ph-tab { text-align: center; padding: 5px 0; border-radius: 8px; font-size: 11px; font-weight: 600; color: #6a777b; transition: background 0.3s, color 0.3s, box-shadow 0.3s; }
.ph-diary[data-view="text"] .ph-tab[data-v="text"],
.ph-diary[data-view="album"] .ph-tab[data-v="album"] { background: #fff; color: #1f2a30; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
.ph-views { position: relative; margin: 0 12px; }
.ph-paper, .ph-album { transition: opacity 0.45s var(--hs-ease), translate 0.45s var(--hs-ease), visibility 0s 0.45s; }
.ph-diary[data-view="text"] .ph-album, .ph-diary[data-view="album"] .ph-paper { opacity: 0; translate: 0 8px; visibility: hidden; }
.ph-diary[data-view="text"] .ph-paper, .ph-diary[data-view="album"] .ph-album { transition-delay: 0s; }
.ph-paper { position: absolute; inset: 0 0 auto; background: #fffdf8; border-radius: 16px; padding: 14px 15px 16px; box-shadow: 0 2px 10px rgba(60, 45, 20, 0.08); }
.ph-paper-date { font-size: 13px; font-weight: 700; margin: 0 0 8px; }
.ph-paper p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.9; }
.ph-paper:lang(ja), .ph-paper :lang(ja) { font-family: "YuGothic", "Yu Gothic", "Hiragino Sans", system-ui, sans-serif; font-weight: 500; }
.ph-s { border-radius: 4px; transition: background 0.35s; }
.ph-badge { width: 15px; height: 15px; font-size: 9px; margin-inline-end: 3px; vertical-align: 1px; font-family: system-ui, sans-serif; }
.ph-s.is-lit { background: rgba(229, 184, 78, 0.22); }
.ph-edit { text-decoration: none; }
.ph-edit span { display: inline-block; border-radius: 4px; background: rgba(229, 184, 78, 0.28); padding: 0 2px; }
.ph-edit-label { display: flex; align-items: center; gap: 6px; font-size: 11px !important; color: #8a6d2c; font-weight: 700; margin: 4px 0 0 !important; }
.ph-edit-label .hs-icon { width: 13px; height: 13px; }
.ph-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 12px 14px; }
.ph-actions span { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 9px 4px; border-radius: 14px; background: #ece6da; font-size: 11px; font-weight: 700; color: #3c4a4f; }
.ph-actions .ph-primary { background: #3f6e7a; color: #fff; }
.ph-actions .hs-icon { width: 13px; height: 13px; }

.ph-album { position: absolute; inset: 0; }
.ph-road { position: absolute; inset: 0; width: 100%; height: 100%; }
.ph-moment-photo { position: absolute; inset-inline-start: 3%; top: 1%; width: 47%; margin: 0; }
.ph-polaroid { background: #fff; padding: 5px 5px 16px; border-radius: 3px; rotate: -3deg; box-shadow: 0 6px 14px rgba(60, 45, 20, 0.14); position: relative; }
.ph-polaroid img { display: block; width: 100%; height: auto; aspect-ratio: 1.13; object-fit: cover; }
.ph-polaroid span { position: absolute; inset-inline-end: 7px; bottom: 2px; font-size: 9px; color: #6a777b; }
.ph-moment-photo figcaption, .ph-moment-title { display: inline-block; margin-top: 7px; padding: 3px 8px; background: #fff; border-radius: 6px; font-size: 10.5px; font-weight: 700; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); }
.ph-cloud { position: absolute; padding: 8px 10px 7px; border-radius: 16px; font-size: 10.5px; line-height: 1.45; box-shadow: 0 3px 10px rgba(60, 45, 20, 0.1); }
.ph-cloud p { margin: 0 0 3px; }
.ph-cloud-a { inset-inline-end: 1%; top: 3%; width: 46%; background: #e4f0e7; }
.ph-cloud-b { inset-inline-start: 2%; top: 55%; width: 49%; background: #e6eaf3; }
.ph-mood { display: inline-flex; align-items: center; gap: 4px; font-size: 9px; font-weight: 700; color: #4e6a59; }
.ph-tired .ph-mood { color: #4f5f7d; }
.ph-mood i { width: 7px; height: 7px; border-radius: 50%; background: var(--hs-relief); }
.ph-tired .ph-mood i { background: var(--hs-tired); }
.ph-moment-plan { position: absolute; inset-inline-end: 6%; top: 47%; display: grid; justify-items: center; gap: 3px; }
.ph-time { font-size: 9px; font-weight: 700; color: #6a777b; background: #fff; border-radius: 6px; padding: 1px 6px; }
.ph-node { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--hs-tired); color: #fff; box-shadow: 0 0 0 4px rgba(127, 150, 186, 0.25); }
.ph-node .hs-icon { width: 20px; height: 20px; }
.ph-moment-title { margin-top: 2px; }
.ph-note {
  position: absolute; left: 9%; right: 9%; bottom: 2%; padding: 8px 11px 9px; background: #fff3c8; rotate: -1.5deg;
  box-shadow: 0 4px 12px rgba(60, 45, 20, 0.14); font-size: 10.5px; line-height: 1.55;
}
.ph-note b { display: block; font-size: 9px; color: #8a6d2c; margin-bottom: 2px; }
.ph-note p { margin: 0; }

/* 狭い画面の図 (lite) */
.hs-screen-lite .ph-views { height: 400px; }
.hs-screen-lite .ph-paper { position: relative; }
.hs-fig-talk .ph-list { padding-bottom: 6px; }
.hs-paper-lite { position: relative; inset: auto; }
.hs-written { display: grid; }
.hs-fig-album .ph-views { height: 410px; }

/* 狭い画面の図 (lite) は、厚みのあるカード */
.hs-screen-lite { border: 2px solid var(--line); border-bottom-width: 5px; box-shadow: none !important; }
.hs-switch { display: inline-flex; gap: 6px; padding: 5px; border-radius: 18px; background: var(--card); border: 2px solid var(--line); justify-self: start; }
.hs-switch-btn {
  display: inline-flex; align-items: center; gap: 6px; appearance: none; border: 0; cursor: pointer;
  padding: 9px 16px; border-radius: 13px; background: transparent; color: var(--muted);
  font-family: var(--font-round), var(--font-base); font-weight: 800; font-size: 0.98rem;
  transition: background 0.2s, color 0.2s, transform 0.12s, box-shadow 0.12s;
}
.hs-switch-btn[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: 0 3px 0 var(--accent-deep); }
.hs-switch-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--accent-deep); }

/* ---------- 広い画面: 端末を止めて、中身だけ変える ---------- */
.hs-stage { display: none; }
@media (min-width: 1040px) and (min-height: 620px) {
  .hs.is-scrolly .hs-scrolly {
    display: grid; grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
    max-width: 1240px; margin: 0 auto; padding-inline: 32px;
  }
  .hs.is-scrolly .hs-steps { grid-column: 1; grid-row: 1; margin: 0; }
  .hs.is-scrolly .hs-step { display: flex; align-items: center; min-height: 96vh; padding-block: 8vh; padding-inline: 0 24px; }
  .hs.is-scrolly .hs-step-text { opacity: 0.3; translate: 0 10px; transition: opacity 0.5s, translate 0.6s var(--hs-ease); }
  .hs.is-scrolly .hs-step.is-active .hs-step-text { opacity: 1; translate: 0 0; }
  /* 図は読み上げのために残し、見た目は右の端末にまかせる */
  .hs.is-scrolly .hs-fig { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .hs.is-scrolly .hs-step-album .hs-switch { margin-top: 6px; }
  .hs.is-scrolly .hs-stage { display: block; grid-column: 2; grid-row: 1; position: sticky; top: 0; height: 100vh; height: 100svh; }
}
.hs-stage-inner { position: relative; height: 100%; }
.hs-stage-window {
  position: absolute; inset-inline-end: 0; top: 9%; width: min(330px, 44%); aspect-ratio: 1; border-radius: 50%;
  border: 12px solid var(--card); box-shadow: 0 0 0 2px var(--line), 0 8px 0 2px var(--line);
}
.hs-stage-window i { position: absolute; right: 22%; top: 16%; width: 16%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 70% 35%, transparent 52%, var(--hs-moon) 53%); rotate: -20deg; }

.hs-phone {
  position: absolute; z-index: 2; inset-inline-end: 14%; top: 50%; translate: 0 -50%;
  height: min(660px, 84vh); aspect-ratio: 300 / 640;
  padding: 10px; border-radius: 48px; background: #1b2124;
  box-shadow: 0 8px 0 rgba(27, 33, 65, 0.16), inset 0 0 0 2px #3b4448, inset 0 0 0 4px #121618;
}
.hs-screen { position: relative; height: 100%; border-radius: 38px; overflow: hidden; }
.ph-status { position: relative; height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 4px 26px 0 30px; font-size: 12px; }
.ph-island { position: absolute; left: 50%; top: 9px; width: 84px; height: 24px; translate: -50% 0; border-radius: 999px; background: #0d0f10; }
.ph-signal { width: 46px; height: 10px; background: linear-gradient(90deg, #1f2a30 0 10px, transparent 10px 15px, #1f2a30 15px 25px, transparent 25px 30px, #1f2a30 30px); border-radius: 2px; opacity: 0.85; }
.hs-screen-chat, .hs-screen-diary { position: absolute; inset: 40px 0 0; transition: opacity 0.45s var(--hs-ease), visibility 0s 0.45s; }
.hs-screen-chat .ph-chat, .hs-screen-diary .ph-diary { height: 100%; }
.hs-screen-chat .ph-scroll { flex: 1; }
.hs-screen-diary .ph-views { flex: 1; }
.hs-screen-diary { opacity: 0; visibility: hidden; }
.hs-stage[data-i="3"] .hs-screen-chat, .hs-stage[data-i="4"] .hs-screen-chat { opacity: 0; visibility: hidden; }
.hs-stage[data-i="3"] .hs-screen-diary, .hs-stage[data-i="4"] .hs-screen-diary { opacity: 1; visibility: visible; transition-delay: 0s; }

.hs-stage-photo { position: absolute; z-index: 3; inset-inline-start: 0; top: 13%; width: min(210px, 32%); display: grid; gap: 12px; justify-items: start; transition: opacity 0.6s, translate 0.6s var(--hs-ease); }
.hs-stage-photo .hs-polaroid { width: 100%; }
.hs-stage-photo .hs-clue { margin-inline-start: 14px; }
.hs-stage[data-i="3"] .hs-stage-photo { translate: -8px 0; }
.hs-stage[data-i="3"] .hs-stage-photo .hs-clue { opacity: 0 !important; }
.hs-stage[data-i="4"] .hs-stage-photo .hs-clue { opacity: 0.45 !important; }
.hs-stage .hs-spoken { position: absolute; z-index: 3; inset-inline-start: 0; top: 43%; width: min(250px, 36%); }
.hs-stage-yoru { position: absolute; z-index: 4; inset-inline-start: 26%; bottom: 9%; width: 128px; }
.hs-stage-yoru .yoru-pic { width: 100%; filter: drop-shadow(0 6px 6px rgba(60, 46, 30, 0.16)); }
.hs-hum {
  position: absolute; inset-inline-start: 70%; top: -26px; padding: 4px 11px; border-radius: 12px; background: var(--card); color: var(--ink);
  border: 2px solid var(--line); border-bottom-width: 4px;
  font-family: var(--font-round), var(--font-base); font-weight: 800; font-size: 0.85rem; white-space: nowrap;
  opacity: 0; scale: 0.8; transition: opacity 0.25s, scale 0.35s var(--hs-ease);
}
.hs-stage[data-i="2"] .hs-hum { opacity: 1; scale: 1; transition-delay: 0.9s; }
.hs-threads { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; overflow: visible; pointer-events: none; }
.hs-threads path { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; }
.hs-threads circle { fill: currentColor; stroke: none; }
.hs-threads .t-gold { color: #d9a33a; }
.hs-threads path.t-gold { stroke-width: 2.6; stroke-dasharray: 1 7; }
.hs-threads .t-relief { color: var(--hs-relief); }
.hs-threads .t-tired { color: var(--hs-tired); }
.hs-threads .t-joy { color: var(--hs-joy); }

/* いつ出すか (data-at)。.is-on は home-story.js が付ける */
.hs.is-scrolly .hs-stage [data-at] { opacity: 0; translate: 0 10px; scale: 0.97; transition: opacity 0.45s var(--hs-ease), translate 0.6s var(--hs-ease), scale 0.6s var(--hs-ease); }
.hs.is-scrolly .hs-stage [data-at].is-on { opacity: 1; translate: 0 0; scale: 1; }
.hs.is-scrolly .hs-stage .ph-row[data-at], .hs.is-scrolly .hs-stage .ph-clue[data-at] { transform-origin: 0 0; }
.hs.is-scrolly .hs-stage .ph-you[data-at] { transform-origin: 100% 0; }

/* 狭い画面で、見えたら出す */
.hs.is-js [data-reveal] .hs-r { opacity: 0; translate: 0 12px; transition: opacity 0.45s var(--hs-ease), translate 0.6s var(--hs-ease); }
.hs.is-js [data-reveal].is-in .hs-r { opacity: 1; translate: 0 0; }
.hs.is-js [data-reveal] .hs-ask.hs-r { scale: 0.85; transform-origin: 0 100%; transition: opacity 0.3s, translate 0.5s var(--hs-ease), scale 0.5s var(--hs-ease); }
.hs.is-js [data-reveal].is-in .hs-ask.hs-r { scale: 1; }

/* 書き足す (短く、1回だけ) */
.hs.is-js .ph-edit:not(.is-typed) span { clip-path: inset(0 100% 0 0); }
.hs.is-js .ph-edit.is-typed span { animation: hs-type 0.9s steps(9, end) 1 both; }
.hs.is-js .ph-edit.is-done span { animation: none; clip-path: none; }
@keyframes hs-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---------- 無理なく使える ---------- */
.hs-calm { background: var(--paper); padding: clamp(56px, 8vw, 96px) var(--hs-gutter) clamp(24px, 4vw, 40px); }
.hs-calm-inner { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.hs-calm-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: start; padding: clamp(22px, 3vw, 32px);
  border-radius: 28px; background: var(--card); border: 2px solid var(--line); border-bottom-width: 5px;
}
.hs-calm-card h2 { font-size: clamp(1.25rem, 2vw, 1.55rem); line-height: 1.45; margin-bottom: 10px; color: var(--ink); }
.hs-calm-card p { line-height: 1.9; color: var(--hs-text); }
.hs-calm-card p + p { margin-top: 10px; }
.hs-calm-card:is(:lang(en), :lang(de), :lang(fr), :lang(it), :lang(pt), :lang(es), :lang(id)) p { line-height: 1.65; }
.hs-easy img { width: 104px; height: auto; filter: drop-shadow(0 4px 5px rgba(60, 46, 30, 0.14)); }
.hs-access-icons { display: grid; gap: 10px; }
.hs-access-icons .hs-icon { width: 48px; height: 48px; padding: 11px; border-radius: 16px; }
.hs-access-icons .hs-icon:nth-child(1) { background: var(--hs-sky); color: var(--accent); }
.hs-access-icons .hs-icon:nth-child(2) { background: var(--hs-mint); color: #3f7a5a; }
.hs-access-icons .hs-icon:nth-child(3) { background: var(--hs-butter); color: #8a6a2a; }

/* ---------- 食事・運動・睡眠 ---------- */
.hs-records { background: var(--paper); padding: clamp(24px, 4vw, 40px) var(--hs-gutter) clamp(24px, 4vw, 40px); }
.hs-records-inner { max-width: 1120px; margin: 0 auto; display: grid; gap: 18px; }
.hs-records h2 { font-size: clamp(1.55rem, 2.7vw, 2.1rem); line-height: 1.4; color: var(--ink); }
.hs-records-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hs-record { display: grid; gap: 10px; align-content: start; padding: clamp(20px, 3vw, 28px); border-radius: 28px; background: var(--card); border: 2px solid var(--line); border-bottom-width: 5px; }
.hs-record .hs-icon { width: 48px; height: 48px; padding: 11px; border-radius: 16px; }
.hs-record-meal .hs-icon { background: var(--hs-butter); color: #8a6a2a; }
.hs-record-move .hs-icon { background: var(--hs-mint); color: #3f7a5a; }
.hs-record-sleep .hs-icon { background: var(--hs-lilac); color: #5b4f93; }
.hs-record h3 { font-size: 1.15rem; color: var(--ink); }
.hs-record p { line-height: 1.85; color: var(--hs-text); }
.hs-record:is(:lang(en), :lang(de), :lang(fr), :lang(it), :lang(pt), :lang(es), :lang(id)) p { line-height: 1.65; }
.hs-records-note { font-size: 0.92rem; line-height: 1.8; color: var(--hs-text); }

/* ---------- 料金 ---------- */
.hs-price { background: var(--paper); padding: clamp(36px, 5vw, 56px) var(--hs-gutter) clamp(56px, 8vw, 96px); }
.hs-price-inner { max-width: 1000px; margin: 0 auto; display: grid; gap: 18px; }
.hs-price h2 { font-size: clamp(1.55rem, 2.7vw, 2.1rem); line-height: 1.4; color: var(--ink); }
.hs-trial-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.hs-trial-steps li { position: relative; padding-block: 22px; padding-inline: 70px 22px; border-radius: 24px; background: var(--card); border: 2px solid var(--line); border-bottom-width: 5px; }
.hs-trial-n {
  position: absolute; inset-inline-start: 20px; top: 20px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-family: var(--font-round), var(--font-base); font-weight: 800; box-shadow: 0 3px 0 var(--accent-deep);
}
.hs-trial-steps h3 { font-size: 1.08rem; margin-bottom: 6px; color: var(--ink); }
.hs-trial-steps p { line-height: 1.85; color: var(--hs-text); }
.hs-after { font-family: var(--font-round), var(--font-base); font-weight: 800; color: var(--glow-text); margin-top: 8px !important; }
.hs-tiers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.hs-tier {
  display: flex; flex-direction: column; gap: 14px; padding: clamp(20px, 3vw, 28px); border-radius: 28px;
  background: var(--card); border: 2px solid var(--line); border-bottom-width: 5px;
}
.hs-tier-premium { border-color: var(--accent); border-bottom-color: var(--accent-deep); }
.hs-tier-head h3 { font-family: var(--font-round), var(--font-base); font-size: clamp(1.4rem, 2.4vw, 1.75rem); font-weight: 800; line-height: 1.3; color: var(--ink); }
.hs-tier-premium .hs-tier-head h3 { color: var(--accent-deep); }
.hs-tier-lead { margin-top: 4px; font-size: 0.95rem; color: var(--hs-text); }
.hs-tier-includes { font-size: 0.88rem; font-weight: 800; color: var(--glow-text); }
.hs-tier-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hs-tier-items li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.hs-tier-items .hs-icon { width: 22px; height: 22px; padding: 3px; margin-top: 2px; border-radius: 50%; background: var(--hs-mint); color: #3f7a5a; stroke-width: 2.6; }
.hs-tier-premium .hs-tier-items .hs-icon { background: var(--hs-sky); color: var(--accent); }
.hs-tier-items b { display: block; font-weight: 800; color: var(--ink); line-height: 1.5; }
.hs-tier-items small { display: block; font-size: 0.86rem; line-height: 1.6; color: var(--hs-text); }
.hs-tier-prices { margin-top: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding-top: 6px; }
.hs-plan {
  padding: 14px 16px; border-radius: 20px; background: var(--paper); border: 2px solid var(--line);
  display: grid; gap: 4px; align-content: start; transition: transform 0.2s var(--hs-ease);
}
.hs-plan:hover { transform: translateY(-2px); }
.hs-plan-annual { border-color: var(--accent); background: var(--card); }
.hs-plan-label { font-size: 0.9rem; font-weight: 800; color: var(--muted); }
.hs-plan-price { font-family: var(--font-round), var(--font-base); font-size: clamp(1.5rem, 2.8vw, 1.9rem); font-weight: 800; line-height: 1.2; color: var(--ink); white-space: nowrap; }
.hs-plan-price span { font-size: 0.9rem; font-weight: 700; color: var(--muted); margin-inline-start: 2px; }
.hs-plan-billing, .hs-plan-equivalent { font-size: 0.84rem; line-height: 1.6; color: var(--hs-text); }
.hs-plan-saving { justify-self: start; margin-top: 4px !important; padding: 3px 10px; border-radius: 999px; background: var(--glow-soft); color: var(--glow-text); font-size: 0.8rem; font-weight: 800; line-height: 1.5; }
.hs-compare, .hs-fine { font-size: 0.88rem; line-height: 1.8; color: var(--muted); }

/* ---------- 困ったとき ---------- */
.hs-help { background: var(--paper); padding: 0 var(--hs-gutter) clamp(56px, 8vw, 96px); }
.hs-help-inner { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: 32px; }
.hs-help h2 { font-size: 1.35rem; margin-bottom: 12px; color: var(--ink); }
.hs-links { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.hs-links a {
  display: block; position: relative; padding-block: 13px; padding-inline: 18px 44px; border-radius: 18px; background: var(--card); color: var(--ink);
  text-decoration: none; font-weight: 700; border: 2px solid var(--line); border-bottom-width: 4px; transition: transform 0.12s, border-bottom-width 0.12s, margin 0.12s;
}
.hs-links a::after { content: "›"; position: absolute; inset-inline-end: 18px; top: 50%; translate: 0 -54%; font-size: 1.4rem; color: var(--accent); font-weight: 800; }
.hs-links a:hover { border-color: var(--accent); }
.hs-links a:active { transform: translateY(2px); }
.hs-faq > p { font-size: 0.92rem; color: var(--muted); }

/* ---------- 締め (夜) ---------- */
.hs-closing {
  position: relative; text-align: center; color: var(--on-night);
  background: radial-gradient(1.4px 1.4px at 18% 26%, #fff7 50%, transparent 52%), radial-gradient(1.2px 1.2px at 40% 62%, #fff5 50%, transparent 52%), radial-gradient(1.6px 1.6px at 74% 20%, #fff8 50%, transparent 52%), radial-gradient(1.2px 1.2px at 88% 70%, #fff5 50%, transparent 52%), linear-gradient(180deg, var(--night-2), var(--night));
}
.hs-closing-inner { position: relative; max-width: 720px; margin: 0 auto; padding: clamp(56px, 8vw, 96px) var(--hs-gutter) clamp(40px, 6vw, 64px); display: grid; justify-items: center; gap: 20px; }
.hs-closing-art { position: relative; width: 190px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; border: 8px solid rgba(255, 255, 255, 0.12); }
.hs-closing-art .hs-moon { right: 12%; top: 10%; }
.hs-closing-yoru { width: 150px; height: auto; margin-top: 18px; }
.hs-closing h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.4; color: #fff; }
.hs-closing .hs-trial a { color: var(--on-night-soft); }
.hs-closing .hs-trial a:hover { color: #fff; }
.hs-store-light.hs-store-soon { background: transparent; color: var(--on-night); border-color: rgba(255, 255, 255, 0.3); box-shadow: 0 5px 0 rgba(255, 255, 255, 0.12); }

/* ---------- 狭い画面 ---------- */
@media (max-width: 860px) {
  .hs-calm-inner, .hs-help-inner { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .hs-hero-inner { grid-template-columns: 1fr; gap: 8px; padding-top: 12px; }
  .hs-hero-art { max-width: 260px; }
  .hs-hero-copy { justify-items: center; text-align: center; gap: 18px; }
  .hs-hero h1 { font-size: clamp(1.75rem, 7.6vw, 2.4rem); }
  .hs-hero h1:lang(ja), .hs-hero h1:lang(zh), .hs-hero h1:lang(ko) { font-size: clamp(2.2rem, 10vw, 3rem); }
  .hs-hero:is(:lang(en), :lang(de), :lang(fr), :lang(it), :lang(pt), :lang(es), :lang(id)) h1 { font-size: clamp(1.85rem, 8vw, 2.4rem); }
  .hs-lead { font-size: 1rem; }
  .hs-hero-actions { display: grid; width: 100%; gap: 14px; }
  .hs-hero-actions .hs-btn, .hs-hero-actions .hs-store { width: 100%; }
  .hs-say { left: -2%; top: 6%; }
  .hs-step { grid-template-columns: 1fr; padding-block: 48px; }
  .hs-step-text { max-width: none; }
  .hs-fig-clues { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr); }
  .hs-trial-steps, .hs-tiers, .hs-records-grid { grid-template-columns: 1fr; }
  .hs-calm-card { grid-template-columns: 1fr; }
  .hs-easy img { width: 88px; }
  .hs-access-icons { display: flex; }
}
@media (max-width: 480px) {
  .hs-fig-clues { grid-template-columns: minmax(0, 1fr) auto; }
  .hs-fig-clues .hs-polaroid { width: 100%; max-width: 230px; }
  .hs-clue { padding-block: 7px; padding-inline: 7px 11px; font-size: 0.84rem; }
  .hs-clue .hs-icon { width: 28px; height: 28px; padding: 5px; }
}

/* ---------- 動きを減らす ---------- */
@media (prefers-reduced-motion: reduce) {
  .hs *, .hs *::before, .hs *::after { transition: none !important; animation: none !important; }
  .hs [data-reveal] .hs-r { opacity: 1 !important; translate: none !important; scale: none !important; }
  .hs .ph-edit span { clip-path: none !important; }
}

/* 保存したあとの日記では、書き足した印と番号は外す */
.ph-diary[data-saved] .ph-edit span { background: none; padding: 0; }
.ph-diary[data-saved] .ph-badge { display: none; }

/* 右から左の言語 (アラビア語): 道すじの絵と矢印を左右反対に */
[dir="rtl"] .ph-road { scale: -1 1; }
[dir="rtl"] .hs-links a::after { content: "‹"; }
[dir="rtl"] .hs-stage-window i { right: auto; left: 22%; }
