/* 外部フォント（Google Fonts 等）は読み込まない。OS 標準フォントを使う（CLAUDE.md ルール4）。 */

:root {
  --fg: #1b2027;
  --muted: #5c6673;
  --bg: #ffffff;
  --bg-alt: #f5f7f9;
  --line: #dfe4ea;
  --accent: #1f5f8b;
  --accent-fg: #ffffff;
  --radius: 8px;
  --wrap: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: "Yu Gothic UI", "Yu Gothic", "Hiragino Sans", "Noto Sans JP",
               system-ui, sans-serif;
  line-height: 1.8;
  font-size: 16px;
}

img, iframe { max-width: 100%; }

a { color: var(--accent); }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 720px; }

/* ---- header / footer ---- */

.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 60px; flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--fg); }
.site-header nav { display: flex; gap: 20px; }
.site-header nav a { text-decoration: none; color: var(--muted); font-size: 0.94rem; }
.site-header nav a:hover { color: var(--accent); }

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
  margin-top: 64px; padding: 32px 0;
  font-size: 0.9rem; color: var(--muted);
}
.site-footer .company { font-weight: 600; color: var(--fg); margin: 0 0 8px; }
.site-footer nav { margin-bottom: 8px; display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer .copyright { margin: 0; }

/* ---- sections ---- */

.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
h1 { font-size: 2rem; line-height: 1.45; margin: 0 0 16px; }
h2 { font-size: 1.5rem; margin: 0 0 28px; }
h3 { font-size: 1.1rem; margin: 0 0 8px; }

/* ---- hero ---- */

.hero { padding: 56px 0; border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.hero .lead { color: var(--muted); margin: 0 0 28px; }

.hero-viewer { aspect-ratio: 4 / 3; }
#viewer, .viewer-placeholder {
  width: 100%; height: 100%;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.9rem;
}
/* 準備中の枠。3D が載る #viewer とはルールを分ける（破線と余白が canvas に効くため） */
.viewer-placeholder {
  border: 1px dashed var(--line);
  background: var(--bg-alt);
}
/* 3D ビューア。canvas を枠いっぱいに伸ばす（flex の子は既定で伸びない）。
   背景は viewer.js が scene.background で塗る（Scene3D.jsx:1463 と同じ #000）。
   読み込みに失敗したときは viewer.js が .viewer-placeholder を付け直す */
#viewer { overflow: hidden; background: #000; }
#viewer > canvas { width: 100%; height: 100%; display: block; }

/* ---- video ---- */

.video { max-width: 800px; margin: 0 auto 48px; }
.video iframe,
.video-placeholder {
  width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius);
  display: block;
}
.video-placeholder {
  border: 1px dashed var(--line); background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.9rem;
}

/* ---- features ---- */

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.feature {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; background: var(--bg);
}
.feature p { margin: 0; color: var(--muted); font-size: 0.94rem; }

/* ---- plans ---- */

.trial-note {
  margin: -12px 0 24px; color: var(--accent); font-weight: 600; font-size: 0.95rem;
}
/* 幅に応じて 3 列 → 2 列 → 1 列。製品を増減しても崩れない。 */
.products { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

.product {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); overflow: hidden;
  display: flex; flex-direction: column;
}

/* 動画を開くサムネイル部。クリックでモーダルが開く */
.product-thumb {
  appearance: none; border: 0; width: 100%; aspect-ratio: 16 / 9;
  background: var(--bg-alt); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; cursor: pointer; color: var(--accent);
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
}
.product-thumb:hover:not(:disabled) { background: #eaf0f5; }
.product-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.product-thumb:disabled { cursor: default; color: var(--muted); }
.product-thumb .play {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--accent); color: var(--accent-fg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; padding-left: 4px;
}

.product-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.product-body h3 { margin: 0 0 8px; }
.product .summary { margin: 0 0 16px; color: var(--muted); font-size: 0.94rem; }
.product .price { font-size: 1.7rem; font-weight: 700; margin: 0 0 8px; }
.product .note { margin: 0 0 20px; color: var(--muted); font-size: 0.86rem; }
.product .unit { font-size: 0.9rem; font-weight: 400; color: var(--muted); margin-left: 4px; }
.product .btn { margin-top: auto; }

/* ---- 動画モーダル ---- */

.video-modal {
  border: 0; border-radius: var(--radius); padding: 0;
  width: min(900px, 92vw); background: #12161b; color: #fff;
}
.video-modal::backdrop { background: rgba(0, 0, 0, 0.7); }
.video-modal .modal-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 16px;
}
.video-modal .modal-title { margin: 0; font-weight: 600; font-size: 0.98rem; }
.video-modal .modal-close {
  appearance: none; border: 1px solid #444c55; background: transparent;
  color: #fff; border-radius: var(--radius); padding: 6px 16px;
  cursor: pointer; font-family: inherit; font-size: 0.9rem;
}
.video-modal .modal-close:hover { background: #232a31; }
.video-modal iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }

/* ---- buttons ---- */

.btn {
  display: inline-block; text-align: center;
  padding: 12px 28px; border-radius: var(--radius);
  text-decoration: none; font-weight: 600; font-size: 0.98rem;
}
.btn-primary { background: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { opacity: 0.9; }
.btn-disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }

/* ---- contact / legal ---- */

.contact-lines { font-size: 1.05rem; }

.legal { display: grid; grid-template-columns: 220px 1fr; gap: 0; margin: 0; }
.legal dt, .legal dd {
  border-top: 1px solid var(--line); padding: 14px 4px; margin: 0;
}
/* 返品・キャンセル条件のような複数行の値を、改行を保ったまま表示する */
.legal dd { white-space: pre-line; }
.legal dt { font-weight: 600; }
.legal .todo { color: #b03a2e; }

/* プライバシーポリシー。本文の改行を保ったまま表示する */
.privacy-body { white-space: pre-line; margin: 0 0 32px; }
.privacy-updated { color: var(--muted); font-size: 0.9rem; }

/* ---- responsive ---- */

@media (max-width: 760px) {
  .hero-grid { grid-template-columns: 1fr; }
  .products { grid-template-columns: 1fr; } /* スマホでは 1 列に落とす */
  .legal { grid-template-columns: 1fr; }
  .legal dd { border-top: 0; padding-top: 0; }
  h1 { font-size: 1.6rem; }
}
