/*
 * トップページ（/ と /en/）専用。ほかのページの styles.css / app.css とは独立させる。
 *
 * 見た目の軸はアプリそのもの:
 *   - 夜の紺 (--night) はスペクトログラム表示の静かな部分の色
 *   - 藍 (--indigo) はアプリのボタンと選択中の色
 *   - 赤 (--rec) は録音ボタンの点。録音中を示すところにだけ使う
 *   - 波形は、スペクトログラムと同じ 紺 → 青緑 → 緑 → 黄 で塗る
 */

:root {
  --night: #0e1330;
  --night-2: #1a2152;
  --indigo: #4c57d6;
  --indigo-deep: #3843b8;
  --rec: #f0466e;
  --paper: #f4f5fa;
  --ink: #191c2b;
  --mist: #5a5e74;
  --line: #dde0ec;
  --on-night: #eef0ff;
  --on-night-mist: #b2b7da;
  --font: "IBM Plex Sans JP", system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.85;
  color: var(--ink);
  background: #fff;
}

a { color: var(--indigo-deep); text-underline-offset: .2em; }
a:hover { color: var(--indigo); }
a:focus-visible,
summary:focus-visible {
  outline: 3px solid #8f98ff;
  outline-offset: 3px;
  border-radius: 4px;
}

img { max-width: 100%; height: auto; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3 { line-height: 1.35; margin: 0; font-weight: 700; }
/* 英文は和文ほど行間を取らない */
html[lang="en"] body { line-height: 1.65; }
html[lang="en"] .hero h1 { letter-spacing: 0; line-height: 1.15; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); letter-spacing: .01em; }
h3 { font-size: 1.125rem; }
p { margin: 0; }

/* ---------- ヘッダー（ヒーローの上に重ねる） ---------- */

.site-header { color: var(--on-night); }
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  padding-top: 18px;
  padding-bottom: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--on-night);
  text-decoration: none;
  font-weight: 700;
}
.brand:hover { color: #fff; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: .9375rem; }
.site-nav a { color: var(--on-night-mist); text-decoration: none; }
.site-nav a:hover { color: #fff; text-decoration: underline; }

/* ---------- ヒーロー ---------- */

.hero {
  background:
    radial-gradient(1200px 520px at 85% 0%, rgba(76, 87, 214, .35), transparent 70%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%);
  color: var(--on-night);
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  gap: 40px;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 8px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  line-height: 1.25;
  letter-spacing: .015em;
  color: #fff;
}
.hero-lead {
  margin-top: 20px;
  max-width: 34em;
  font-size: 1.0625rem;
  color: var(--on-night-mist);
}
.stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}
.stores a { display: inline-block; line-height: 0; border-radius: 8px; }
.stores img { height: 48px; width: auto; }
.hero-note { margin-top: 14px; font-size: .875rem; color: var(--on-night-mist); }

.hero-phone {
  margin: 0;
  justify-self: center;
  width: min(280px, 100%);
}
.hero-phone img {
  display: block;
  width: 100%;
  border-radius: 34px;
  border: 8px solid #05081c;
  box-shadow: 0 30px 60px rgba(3, 5, 25, .55), 0 0 0 1px rgba(255, 255, 255, .08);
}

/* 録音から文字になるまでを 1 本の帯で見せる（画面に入ったときに一度だけ動く） */
.take {
  margin: 36px 0 56px;
  padding: 18px 20px 20px;
  border-radius: 18px;
  background: rgba(5, 8, 28, .55);
  border: 1px solid rgba(178, 183, 218, .18);
}
.take-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .875rem;
  color: var(--on-night-mist);
}
.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rec);
  box-shadow: 0 0 0 4px rgba(240, 70, 110, .2);
}
.take.is-done .rec-dot { background: var(--on-night-mist); box-shadow: none; }
.take-time { font-variant-numeric: tabular-nums; margin-left: auto; }
.take-wave { display: block; width: 100%; height: 96px; margin-top: 10px; }
.take-text {
  margin-top: 12px;
  min-height: 3.6em;
  font-size: clamp(1.0625rem, 2.2vw, 1.3rem);
  line-height: 1.75;
  color: #fff;
}
.take-text .caret {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: var(--on-night);
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- 録ってから渡すまで（実際に順番のある流れ） ---------- */

.flow { padding: 72px 0 64px; }
.flow h2 { max-width: 20em; }
.steps {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  position: relative;
}
/* 4 つの段階をつなぐ線。録音の時間軸に見立てる */
.steps::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #1f8a9a, #7fd36b 60%, #f2e35b);
  opacity: .7;
}
.steps li { position: relative; padding-top: 34px; }
.steps li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--indigo);
}
.steps h3 { font-size: 1.25rem; }
.steps p { margin-top: 8px; color: var(--mist); font-size: .9375rem; }
.footnote { margin-top: 28px; font-size: .8125rem; color: var(--mist); }

/* ---------- こんな記録に ---------- */

.uses { padding: 64px 0; background: var(--paper); }
.use-list {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 32px;
}
.use-list li { padding-top: 18px; border-top: 2px solid var(--ink); }
.use-list h3 { font-size: 1.375rem; }
.use-list h3 a { color: var(--ink); text-decoration: none; }
.use-list h3 a:hover { color: var(--indigo-deep); text-decoration: underline; }
.use-list p { margin-top: 8px; color: var(--mist); font-size: .9375rem; }
.uses .more { margin-top: 32px; }

/* ---------- 端末の中で ---------- */

.device {
  padding: 72px 0;
  background: var(--night);
  color: var(--on-night);
}
.device-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}
.device h2 { color: #fff; }
.device p { color: var(--on-night-mist); }
.device p + p { margin-top: 14px; }
.device a { color: #c9ceff; }
.device a:hover { color: #fff; }
.device small { display: block; margin-top: 18px; font-size: .8125rem; color: var(--on-night-mist); }

/* ---------- Android と iPhone ---------- */

.platforms { padding: 72px 0 40px; }
.compare {
  width: 100%;
  margin-top: 28px;
  border-collapse: collapse;
  font-size: .9375rem;
}
.compare th, .compare td {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.compare thead th { font-size: .875rem; color: var(--mist); font-weight: 500; }
.compare tbody th { width: 22%; font-weight: 500; color: var(--mist); }
.compare td { width: 39%; }

.spec { margin-top: 32px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.spec summary {
  cursor: pointer;
  padding: 16px 0;
  font-weight: 500;
}
.spec[open] summary { color: var(--indigo-deep); }
.spec-body { padding: 0 0 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px; }
.spec-body h3 { font-size: .9375rem; margin-top: 12px; }
.spec-body ul { margin: 6px 0 0; padding-left: 1.2em; color: var(--mist); font-size: .875rem; line-height: 1.8; }

/* ---------- 最後の入手先 ---------- */

.cta { padding: 64px 0 80px; }
.cta-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 32px 36px;
  border-radius: 22px;
  background: linear-gradient(120deg, var(--night) 0%, var(--night-2) 60%, #2a3290 100%);
  color: var(--on-night);
}
.cta-box h2 { color: #fff; font-size: clamp(1.4rem, 3vw, 1.75rem); }
.cta-box p { margin-top: 6px; color: var(--on-night-mist); font-size: .9375rem; }
.cta-box .stores { margin-top: 0; }

/* ---------- フッター ---------- */

.site-footer {
  padding: 40px 0 48px;
  background: var(--paper);
  color: var(--mist);
  font-size: .875rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.footer-links a { color: var(--mist); }
.footer-links a:hover { color: var(--indigo-deep); }

/* ---------- 狭い画面 ---------- */

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; padding-top: 16px; }
  .hero-phone { width: min(240px, 70%); }
  .steps { grid-template-columns: 1fr; gap: 26px; }
  .steps::before { top: 0; bottom: 0; left: 7px; right: auto; width: 2px; height: auto;
    background: linear-gradient(180deg, #1f8a9a, #7fd36b 60%, #f2e35b); }
  .steps li { padding: 0 0 0 36px; }
  .use-list { grid-template-columns: 1fr; gap: 28px; }
  .device-grid { grid-template-columns: 1fr; gap: 20px; }
  .spec-body { grid-template-columns: 1fr; }
  .compare tbody th { width: 26%; }
}

/* 3 列の表は狭い画面で読みにくいので、項目ごとに「Android / iPhone」を縦に並べる */
@media (max-width: 600px) {
  .compare thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .compare, .compare tbody, .compare tr, .compare th, .compare td { display: block; width: auto; }
  .compare tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .compare th, .compare td { padding: 0; border: 0; }
  .compare tbody th { width: auto; margin-bottom: 6px; color: var(--ink); font-weight: 700; }
  .compare td { display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 8px; padding: 2px 0; }
  .compare td::before { content: attr(data-label); color: var(--mist); font-size: .8125rem; line-height: 2; }
}

@media (max-width: 480px) {
  .site-nav { font-size: .875rem; gap: 2px 14px; }
  .nav-extra { display: none; }
  .stores img { height: 44px; }
  .take { padding: 14px 14px 16px; margin-bottom: 44px; }
  .take-wave { height: 72px; }
  .cta-box { padding: 26px 22px; }
  .compare th, .compare td { padding-right: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .take-text .caret { animation: none; }
}
