/* ジョイスクリプト 3D試作
   背景は白〜明るい色だけ（本人の絶対ルール 2026-10-06）。ダークモードでも暗くしない。 */
:root {
  color-scheme: light;
  --fg: #1f2328;
  --sub: #4b5560;
  --line: #d8dee4;
  --soft: #f6f8fa;
  --accent: #d1242f;
  --tint: #ffffff;
}
* { 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(--fg);
  background: var(--tint);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 18px;
  line-height: 1.8;
  font-feature-settings: "palt";
  transition: background-color .6s;
}
a { color: inherit; }
img { max-width: 100%; }

/* 3D */
/* 背景の色味：固定の1枚に描く（背景の固定指定は合成が重いので使わない） */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: radial-gradient(120% 90% at 70% 40%, #ffffff 0%, var(--tint) 100%); }
#stage.is-off { visibility: hidden; }
#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100lvh; z-index: 0; display: block; touch-action: pan-y; }
.fallback-hero { display: none; }
.no-webgl #stage, .no-webgl .hint { display: none; }
.no-webgl .fallback-hero { display: block; position: fixed; right: 8vw; top: 30vh; width: min(32vw, 280px); height: auto; border-radius: 22%; z-index: 0; }

/* 場面 */
main { position: relative; z-index: 1; pointer-events: none; }
.scene { min-height: 120vh; display: flex; align-items: center; padding: calc(var(--header-h) + 32px) clamp(16px, 5vw, 72px) 64px; pointer-events: none; }
.scene.hero { min-height: 100vh; min-height: 100svh; }
.scene .copy { width: min(520px, 42vw); pointer-events: auto; }
.scene.hero .copy { width: min(600px, 41vw); }
.eyebrow { font-size: 16px; font-weight: 700; letter-spacing: .08em; color: var(--accent); margin: 0 0 12px; }
h1 { word-break: keep-all; overflow-wrap: anywhere; font-size: clamp(38px, 3.9vw, 64px); line-height: 1.25; letter-spacing: -.01em; margin: 0 0 24px; font-weight: 900; }
h2 { word-break: keep-all; overflow-wrap: anywhere; font-size: clamp(32px, 3.4vw, 52px); line-height: 1.3; margin: 0 0 24px; font-weight: 900; }
.lead { font-size: clamp(18px, 1.25vw, 21px); color: var(--sub); margin: 0 0 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-block; background: var(--accent); color: #fff; font-weight: 700; font-size: 20px;
  text-decoration: none; border-radius: 12px; padding: 16px 30px; box-shadow: 0 8px 22px rgba(209,36,47,.22);
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(209,36,47,.28); }
.btn:active { transform: translateY(1px); }
.hint { display: flex; align-items: center; gap: 10px; margin: 28px 0 0; font-size: 16px; color: var(--sub); }
.hint-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(209,36,47,.5); animation: ping 1.8s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(209,36,47,.45); } 80%,100% { box-shadow: 0 0 0 12px rgba(209,36,47,0); } }

/* 悩み別のリスト */
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.items li {
  display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; border-radius: 16px;
  background: rgba(255,255,255,.92); border: 1px solid rgba(216,222,228,.8);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.items li:hover, .items li.is-hot { transform: translateX(6px); box-shadow: 0 10px 28px rgba(31,35,40,.08); border-color: #c4ccd4; }
.items li img { width: 44px; height: 44px; border-radius: 10px; flex-shrink: 0; margin-top: 4px; }
.items li { position: relative; cursor: pointer; }
.items li a { text-decoration: none; }
/* 囲み全体を押せるように（リンクの判定を枠いっぱいに広げる） */
.items li a::after { content: ""; position: absolute; inset: 0; border-radius: 16px; }
.items li a:focus-visible { outline: none; }
.items li:has(a:focus-visible) { outline: 3px solid rgba(209,36,47,.35); outline-offset: 2px; }
.items li a b { font-size: 21px; }
.items li:hover a b { text-decoration: underline; }
.items li p { margin: 2px 0 0; font-size: 17px; line-height: 1.7; color: var(--fg); }
.items li p.price { font-size: 16px; color: var(--sub); }

.finale .copy h2 { font-size: clamp(34px, 3.8vw, 58px); }

/* 通常の読む層 */
.sheet { pointer-events: auto; position: relative; z-index: 2; background: #ffffff; border-radius: 32px 32px 0 0; box-shadow: 0 -18px 50px rgba(31,35,40,.06); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 72px clamp(16px, 4vw, 40px) 24px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card { display: block; border: 1px solid var(--line); border-radius: 18px; padding: 22px; background: var(--soft); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(31,35,40,.08); background: #fff; }
.card h3 { display: flex; align-items: center; gap: 12px; font-size: 21px; margin: 0 0 8px; }
.card h3 img { width: 48px; height: 48px; border-radius: 11px; }
.card p { margin: 0; font-size: 17px; color: var(--sub); }
.op-title { margin-top: 72px; font-size: clamp(28px, 2.6vw, 36px); }
.operator p { margin: 0 0 8px; }

/* キーを押したときのカード（カード全体がリンク） */
.keycard {
  --kc: #d1242f;
  position: fixed; right: clamp(16px, 3vw, 40px); bottom: 24px; z-index: 35;
  width: min(400px, calc(100vw - 32px));
  background: #fff; border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 22px 60px rgba(31,35,40,.16);
  animation: pop .25s ease-out; overflow: hidden;
}
.keycard::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--kc); }
.keycard[hidden] { display: none; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.keycard-main { display: flex; gap: 16px; align-items: flex-start; padding: 22px 52px 20px 20px; text-decoration: none; color: var(--fg); transition: background .2s; }
.keycard-main:hover { background: #fafbfc; }
.keycard-main:focus-visible { outline: 3px solid rgba(209,36,47,.35); outline-offset: -3px; border-radius: 22px; }
.keycard-icon { width: 60px; height: 60px; border-radius: 15px; flex-shrink: 0; box-shadow: 0 8px 18px rgba(31,35,40,.14); }
.keycard-body { display: flex; flex-direction: column; min-width: 0; }
.keycard-name { font-weight: 800; font-size: 21px; line-height: 1.4; }
.keycard-desc { margin-top: 4px; font-size: 17px; line-height: 1.7; }
.keycard-price { margin-top: 4px; font-size: 16px; color: var(--sub); line-height: 1.6; }
.keycard-price[hidden] { display: none; }
.keycard-cta {
  align-self: flex-start; margin-top: 12px; display: inline-flex; align-items: center; gap: 10px;
  background: var(--kc); color: #fff; font-weight: 800; font-size: 16px; line-height: 1;
  border-radius: 999px; padding: 10px 12px 10px 16px; box-shadow: 0 6px 14px rgba(31,35,40,.16);
  transition: transform .2s, box-shadow .2s;
}
.keycard-arrow { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.25); position: relative; flex: none; }
.keycard-arrow::after { content: ""; position: absolute; left: 7px; top: 7px; width: 6px; height: 6px; border-right: 2px solid #fff; border-top: 2px solid #fff; transform: rotate(45deg); }
.keycard-main:hover .keycard-cta { transform: translateX(3px); box-shadow: 0 10px 20px rgba(31,35,40,.2); }
.keycard-close { position: absolute; top: 10px; right: 8px; width: 40px; height: 40px; border: 0; background: transparent; font-size: 24px; line-height: 1; cursor: pointer; color: var(--sub); border-radius: 10px; z-index: 2; }
.keycard-close:hover { background: var(--soft); }

/* タブレット・スマホ：3Dを上、文字を下に */
@media (max-width: 900px), (max-aspect-ratio: 4/5) {
  .scene { min-height: 0; align-items: flex-start; padding-top: 54vh; padding-top: 54svh; padding-bottom: 28vh; }
  .scene.hero { min-height: 0; padding-top: 50svh; padding-bottom: 12vh; }
  .scene .copy { width: 100%; max-width: 640px; margin: 0 auto; background: rgba(255,255,255,.92); border-radius: 22px; padding: 22px 20px; border: 1px solid rgba(216,222,228,.8); }
  .scene.hero .copy { width: 100%; background: rgba(255,255,255,.86); }
  .items li { background: #fff; }
  .no-webgl .fallback-hero { right: 50%; transform: translateX(50%); top: 14vh; width: 40vw; }
}
@media (max-width: 640px) {
  .scene { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 34px; }
  h2 { font-size: 30px; }
  .btn { font-size: 18px; padding: 15px 24px; width: 100%; text-align: center; }
  .items li { padding: 14px; gap: 12px; }
  .items li a b { font-size: 19px; }
  .keycard { right: 16px; left: 16px; width: auto; bottom: 16px; }
}
@media (max-width: 360px) {
  h1 { font-size: 30px; }
  h2 { font-size: 26px; }
}
