/* AIカメと遊ぶ 水平思考ゲーム — 紹介サイト（デザイン: design/exports/03-white-editorial） */

/* フォントはページの文字だけを抜き出したもの（firebase/scripts/build-site-fonts.py で作り直す） */
@font-face { font-family: 'Umigame Serif'; src: url('../fonts/serif-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Umigame Serif'; src: url('../fonts/serif-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Umigame Sans'; src: url('../fonts/sans.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Umigame Latin'; src: url('../fonts/latin.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Umigame Latin'; src: url('../fonts/latin-italic.woff2') format('woff2'); font-weight: 300 700; font-style: italic; font-display: swap; }

:root {
  --paper: #FFFFFF;
  --paper-warm: #FAF9F6;
  --ink: #0A2236;
  --ink-soft: #354959;
  --muted: #5E7282;
  --ocean: #1479B8;
  --editorial-blue: #3F7DA0;
  --rule: #BACBD4;
  --serif: 'Umigame Serif', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --sans: 'Umigame Sans', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  --latin: 'Umigame Latin', 'Times New Roman', serif;
  --page-max: 1440px;
  --gutter: clamp(16px, 4vw, 64px);
  --header-h: 88px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 4px; }
h1, h2, h3, p, dl, dd, ol, figure { margin: 0; }
ol { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--ocean); outline-offset: 4px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 10px 16px; background: var(--ink); color: #fff; }
.skip:focus { top: 16px; }
.sp-only { display: none; }

/* ---------- 共通部品 ---------- */
/* App Store の公式バッジ（色・比率は変えない。高さだけ場所ごとに指定） */
.store-badge { display: inline-block; flex-shrink: 0; line-height: 0; border-radius: 8px; transition: opacity .2s var(--ease); }
.store-badge:hover { opacity: .8; }
.store-badge img { width: auto; height: 48px; }
.store-badge--nav img { height: 40px; }
.store-badge--hero img { height: 56px; }
.store-badge--closing img { height: 60px; }
.section-cta { display: flex; align-items: center; gap: 20px; }
.section-cta__note { font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.kicker { font-family: var(--latin); font-size: 12px; letter-spacing: .2em; line-height: 1.5; color: var(--muted); }
.section-title { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3vw, 40px); line-height: 1.4; letter-spacing: .02em; }

/* ---------- ヘッダー ---------- */
.site-header { position: relative; z-index: 20; background: var(--paper); }
.site-header__inner {
  max-width: var(--page-max); margin: 0 auto; height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gutter);
}
.brand { display: block; flex-shrink: 0; }
.brand__desktop { width: 360px; }
.brand__mobile { display: none; width: 210px; }
.site-nav { display: flex; align-items: center; gap: 32px; font-size: 13px; white-space: nowrap; }
.site-nav a:not(.store-badge) { text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-nav a:not(.store-badge):hover { border-color: currentColor; }
.menu-toggle { display: none; }

/* ---------- ヒーロー ---------- */
.hero { position: relative; max-width: var(--page-max); margin: 0 auto; isolation: isolate; overflow: hidden; }
.hero__bg { position: absolute; z-index: -2; top: 0; bottom: 0; left: 42%; right: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; }
.hero::before {
  content: ''; position: absolute; z-index: -1; top: 0; bottom: 0; left: 42%; width: 22%;
  background: linear-gradient(90deg, #fff 0%, rgba(255,255,255,.82) 30%, rgba(255,255,255,0) 100%);
}
.hero__inner { display: grid; grid-template-columns: 52% 48%; min-height: clamp(640px, 50vw, 760px); }
.hero__copy { padding: 28px 0 56px var(--gutter); display: flex; flex-direction: column; justify-content: center; }
.hero__eyebrow { font-family: var(--latin); font-style: italic; font-size: clamp(20px, 1.9vw, 27px); letter-spacing: .03em; color: var(--editorial-blue); line-height: 1.3; margin-bottom: 18px; }
.hero__title { font-family: var(--serif); font-weight: 400; font-size: clamp(60px, 6.6vw, 100px); line-height: 1.26; letter-spacing: -.06em; margin-bottom: 28px; }
.hero__title span { display: block; white-space: nowrap; }
.hero__app { font-family: var(--serif); font-size: 21px; letter-spacing: .04em; line-height: 1.5; margin-bottom: 20px; }
.hero__app small { display: block; font-size: 13px; letter-spacing: .3em; color: var(--ink-soft); }
.hero__lead { font-family: var(--serif); font-size: 18px; line-height: 1.8; letter-spacing: .04em; margin-bottom: 12px; padding-top: 18px; border-top: 1px solid var(--rule); width: fit-content; }
.hero__text { font-size: 13.5px; line-height: 2; color: var(--ink-soft); margin-bottom: 28px; }
.hero__download { display: flex; align-items: center; gap: 22px; }
.hero__note { font-size: 12px; letter-spacing: .06em; padding-left: 22px; border-left: 1px solid var(--rule); }

.hero__visual { position: relative; }
.hero__phone {
  position: absolute; z-index: 2; width: 270px; left: 24%; top: 50%; transform: translateY(-52%);
  filter: drop-shadow(0 18px 24px rgba(0, 29, 44, .28));
}
.hero__turtle { position: absolute; z-index: 1; width: min(42%, 340px); right: 1%; top: 10%; opacity: .95; }
.hero__vertical {
  position: absolute; z-index: 2; left: 9%; top: 26%;
  writing-mode: vertical-rl; font-family: var(--serif); font-size: 16px; letter-spacing: .24em; line-height: 2;
  color: var(--ink); text-shadow: 0 0 10px rgba(255, 255, 255, .9), 0 0 2px rgba(255, 255, 255, .9);
}

/* ---------- 遊び方 ---------- */
.how {
  max-width: var(--page-max); margin: 0 auto; padding: 56px var(--gutter) 72px;
  display: grid; grid-template-columns: 1fr 3fr; border-top: 1px solid var(--rule);
}
.how__intro { padding-right: 32px; }
.how__intro .section-title { margin: 10px 0 18px; }
.how__lead { font-family: var(--serif); font-size: 15px; line-height: 2; }
.how__steps { display: grid; grid-template-columns: repeat(3, 1fr); }
.how__cta { grid-column: 2; padding: 40px 24px 0; }
.step { padding: 0 24px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; }
.step__num { font-family: var(--latin); font-size: 32px; line-height: 1.2; color: var(--editorial-blue); }
.step__icon { display: none; }
.step h3 { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: .04em; margin: 10px 0 10px; }
.step__text { font-size: 13.5px; line-height: 1.95; color: var(--ink-soft); flex: 1; margin-bottom: 18px; }
.step__wave { width: 42px; margin-bottom: 14px; }
.step__art { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- 問題について ---------- */
.puzzles { background: var(--paper-warm); border-top: 1px solid var(--rule); }
.puzzles > * { max-width: var(--page-max); margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.puzzles__head { padding-top: 72px; }
.puzzles__head .section-title { margin: 10px 0 16px; }
.puzzles__lead { font-size: 15px; line-height: 2; color: var(--ink-soft); max-width: 720px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); margin-top: 36px; }
.puzzles__cta { margin-top: 36px; }
.fact { padding: 4px 24px; border-left: 1px solid var(--rule); }
.fact:first-child { padding-left: 0; border-left: 0; }
.fact dt { font-size: 12px; letter-spacing: .12em; color: var(--muted); }
.fact dd { font-family: var(--serif); font-size: 16px; }
.fact__num { font-family: var(--latin); font-size: 48px; line-height: 1.1; margin: 0 4px; color: var(--ink); }
.puzzles__body {
  padding-top: 48px; padding-bottom: 80px;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'samples screens'; column-gap: 64px; align-items: start;
}
.samples { grid-area: samples; }
.samples__title { font-size: 12px; font-weight: 500; letter-spacing: .14em; color: var(--muted); margin-bottom: 12px; }
.levels { border-top: 1px solid var(--rule); }
.level { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--rule); }
.level__name { font-family: var(--serif); font-size: 17px; line-height: 1.5; }
.level__name span { display: block; font-family: var(--latin); font-style: italic; font-size: 15px; color: var(--editorial-blue); letter-spacing: .06em; }
.level__sample h4 { font-family: var(--serif); font-weight: 600; font-size: 17px; letter-spacing: .04em; margin: 0 0 4px; }
.level__sample p { font-size: 13.5px; line-height: 1.95; color: var(--ink-soft); }
.puzzles__note { margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.screens { grid-area: screens; display: grid; grid-template-columns: repeat(3, 190px); gap: 20px; }
.screens figure:nth-child(2) { margin-top: 48px; }
.screens img { width: 100%; filter: drop-shadow(0 10px 16px rgba(0, 29, 44, .16)); }
.screens figcaption { margin-top: 10px; text-align: center; font-size: 12px; letter-spacing: .1em; color: var(--muted); }

/* ---------- よくある質問 ---------- */
.faq { max-width: 1080px; margin: 0 auto; padding: 80px var(--gutter); display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; }
.faq__head .section-title { margin-top: 10px; white-space: nowrap; }
.faq__list { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  list-style: none; cursor: pointer; position: relative;
  padding: 20px 44px 20px 0; font-family: var(--serif); font-weight: 600; font-size: 17px; line-height: 1.6;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; position: absolute; right: 4px; top: 50%; width: 20px; height: 20px; margin-top: -10px;
  background: url('../icons/chevron-down.svg') center / contain no-repeat; transition: transform .25s var(--ease);
}
.faq details[open] summary::after { transform: rotate(180deg); }
.faq details p { padding: 0 44px 22px 0; font-size: 14px; line-height: 2; color: var(--ink-soft); }
.faq details a { color: var(--ocean); }

/* ---------- 締め ---------- */
.closing { background: var(--paper-warm); border-top: 1px solid var(--rule); padding: 72px 16px 80px; text-align: center; }
.closing__mark { width: 56px; margin: 0 auto 18px; }
.closing__title { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3.2vw, 40px); letter-spacing: .04em; line-height: 1.4; margin-bottom: 12px; }
.closing__text { font-size: 15px; margin-bottom: 28px; }
.closing__note { margin-top: 16px; font-size: 12.5px; color: var(--muted); }

/* ---------- フッター ---------- */
.site-footer { background: var(--ink); color: #DCE6EC; }
.site-footer__inner { max-width: var(--page-max); margin: 0 auto; padding: 48px var(--gutter) 40px; display: grid; grid-template-columns: auto 1fr; gap: 24px 48px; align-items: center; }
.site-footer__logo { width: 300px; }
.site-footer__nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 28px; font-size: 13px; }
.site-footer__nav a { text-decoration: none; padding: 6px 0; }
.site-footer__nav a:hover { text-decoration: underline; }
.site-footer__legal { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .18); font-size: 11px; line-height: 1.8; color: #A9BAC6; }

/* ---------- タブレット（768〜1023px） ---------- */
@media (max-width: 1023px) {
  .brand__desktop { width: 290px; }
  .site-nav { gap: 20px; }
  .hero__inner { grid-template-columns: 56% 44%; min-height: 640px; }
  .hero__title { font-size: clamp(56px, 7.4vw, 72px); }
  .hero__download { flex-wrap: wrap; gap: 14px; }
  .hero__note { padding-left: 14px; }
  .how__cta { grid-column: 1; padding: 36px 0 0; }
  .hero__phone { width: 220px; left: 12%; }
  .hero__turtle { width: 46%; right: -6%; top: 52%; }
  .hero__vertical { display: none; }
  .how { grid-template-columns: 1fr; row-gap: 32px; }
  .how__intro { padding: 0; }
  .step { padding: 0 18px; }
  .step:first-child { padding-left: 0; border-left: 0; }
  .puzzles__body { grid-template-columns: 1fr; grid-template-areas: 'samples' 'screens'; row-gap: 40px; }
  .screens { justify-content: center; }
  .faq { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- スマホ（〜767px） ---------- */
@media (max-width: 767px) {
  :root { --header-h: 76px; }
  body { font-size: 15px; }
  .pc, .pc-only { display: none; }
  .sp-only { display: inline; }

  .site-header { position: absolute; top: 0; left: 0; right: 0; background: transparent; }
  .site-header__inner { padding: 0 16px; }
  .brand__desktop { display: none; }
  .brand__mobile { display: block; }
  .menu-toggle {
    display: grid; place-items: center; width: 48px; height: 48px; margin-right: -8px;
    border: 0; border-radius: 50%; background: rgba(255, 255, 255, .7); cursor: pointer;
  }
  .menu-toggle img { width: 26px; height: 26px; }
  .menu-toggle__close, .nav-open .menu-toggle__open { display: none; }
  .nav-open .menu-toggle__close { display: block; }
  .site-nav {
    display: none; position: absolute; top: calc(var(--header-h) - 6px); left: 12px; right: 12px;
    flex-direction: column; align-items: stretch; gap: 0; padding: 8px 20px 20px;
    background: #fff; box-shadow: 0 10px 32px rgba(10, 34, 54, .18); font-size: 15px;
  }
  .nav-open .site-nav { display: flex; }
  .site-nav a:not(.store-badge) { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .site-nav .store-badge { align-self: center; margin-top: 20px; }
  .site-nav .store-badge img { height: 48px; }

  .hero { padding-top: var(--header-h); }
  .hero__bg { left: 0; bottom: 132px; }
  .hero__bg img { object-position: 50% 30%; }
  .hero::before { display: none; }
  .hero__inner { display: flex; flex-direction: column; min-height: 0; }
  .hero__copy { display: contents; }
  .hero__title { order: 1; padding: 20px 16px 0; margin: 0; font-size: clamp(44px, 13.2vw, 64px); line-height: 1.32; letter-spacing: -.06em; }
  .hero__eyebrow { order: 2; padding: 0 16px; margin: 10px 0 18px; font-size: clamp(18px, 5.6vw, 23px); font-weight: 500; color: var(--ink-soft); text-shadow: 0 0 10px rgba(255, 255, 255, .95), 0 0 2px rgba(255, 255, 255, .9); }
  .hero__text { order: 3; padding: 0 16px; margin: 0; max-width: 360px; font-family: var(--serif); font-size: 15px; line-height: 1.9; color: var(--ink); text-shadow: 0 0 12px rgba(255, 255, 255, .95), 0 0 3px rgba(255, 255, 255, .9); }
  .hero__app, .hero__lead { display: none; }
  /* 最初の画面に「App Storeで見る」まで収まるよう、画面の高さに合わせて縮める */
  .hero__visual { order: 4; height: max(220px, min(92vw, 480px, calc(100svh - 490px))); margin-top: 4px; }
  .hero__phone { height: 100%; width: auto; max-width: none; left: auto; right: 7%; top: 0; transform: none; }
  .hero__turtle { height: 84%; width: auto; max-width: none; left: -6%; right: auto; top: 16%; }
  .hero__download {
    order: 5; flex-direction: column; flex-wrap: nowrap; align-items: center; gap: 10px; padding: 22px 16px 0;
    height: 132px; justify-content: flex-start; background: var(--paper);
  }
  .hero__download .store-badge img { height: 60px; }
  .hero__note { border: 0; padding: 0; font-size: 12px; }

  .how { padding: 48px 16px 40px; display: block; border-top: 0; }
  .how__intro { text-align: center; margin-bottom: 8px; }
  .how__intro .kicker { display: none; }
  .how__intro .section-title { display: flex; align-items: center; gap: 18px; margin: 0 0 12px; }
  .how__intro .section-title::before, .how__intro .section-title::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
  .how__lead { font-size: 15px; }
  .how__steps { display: block; }
  .step { position: relative; display: block; padding: 24px 0 22px 84px; border-left: 0; border-bottom: 1px solid var(--rule); }
  .step:first-child { padding-left: 84px; }
  .step__num { position: absolute; left: 0; top: 18px; font-size: 44px; font-style: italic; }
  .step__icon { display: block; position: absolute; left: 52px; top: 30px; width: 22px; height: 22px; }
  .step h3 { margin: 0 0 6px; font-size: 20px; }
  .step__text { margin: 0; font-size: 14px; }
  .step__wave, .step picture { display: none; }

  /* スマホでは並べ替える: ヒーロー → アプリの画面 → 遊び方 → 問題について → よくある質問 → 問題の例 → 締め */
  main { display: flex; flex-direction: column; }
  /* margin: auto のままだと flex の中で中身の幅まで縮むので、幅をいっぱいにする */
  main > section, .puzzles__head, .facts, .puzzles__cta, .samples, .screens { width: 100%; }
  .puzzles, .puzzles__body { display: contents; }
  .hero { order: 1; }
  .screens { order: 2; }
  .how { order: 3; }
  .puzzles__head { order: 4; }
  .facts, .puzzles__cta { order: 5; }
  .faq { order: 6; }
  .samples { order: 7; }
  .closing { order: 8; }

  .puzzles__head { padding-top: 56px; background: var(--paper-warm); border-top: 1px solid var(--rule); }
  .puzzles__lead { font-size: 14.5px; }
  .facts { grid-template-columns: repeat(3, 1fr); margin: 0; padding-top: 28px; padding-bottom: 32px; background: var(--paper-warm); }
  .puzzles__cta { margin: 0; padding-bottom: 56px; flex-direction: column; gap: 10px; background: var(--paper-warm); }
  .how__cta { display: flex; justify-content: center; padding: 32px 0 0; }
  .fact { padding: 0 10px; }
  .fact dd { font-size: 13px; }
  .fact__num { font-size: 38px; margin: 0 2px; }
  .samples { width: 100%; padding: 48px 16px 56px; background: var(--paper-warm); border-top: 1px solid var(--rule); }
  .samples__title { font-family: var(--serif); font-size: 22px; font-weight: 400; letter-spacing: .04em; color: var(--ink); margin-bottom: 16px; }
  .level { grid-template-columns: 1fr; gap: 6px; padding: 20px 0; }
  .level__name { display: flex; align-items: baseline; gap: 10px; font-size: 15px; }
  .level__name span { display: inline; }
  .level__sample h4 { font-size: 16px; }
  .screens { width: 100%; padding: 8px 16px 32px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .screens figure:nth-child(2) { margin-top: 28px; }

  .faq { padding: 56px 16px; }
  .faq summary { font-size: 16px; padding: 18px 36px 18px 0; }
  .faq details p { padding-right: 0; }

  .closing { padding: 56px 16px 64px; }

  .site-footer__inner { grid-template-columns: 1fr; padding: 40px 16px 32px; }
  .site-footer__logo { width: 240px; }
  .site-footer__nav { justify-content: flex-start; }
}

@media (max-width: 359px) {
  .hero__title { font-size: 40px; }
  .step, .step:first-child { padding-left: 72px; }
  .step__icon { left: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
