/* ============================================================
   安住マップ — ランディングページ
   トークン名は style.css と揃えるが、LP はダーク固定なので dark の値だけを持つ。
   style.css は読み込まない（地図 UI 専用のスタイルが 9 割を占めるため）。
   ============================================================ */

:root {
  color-scheme: dark;

  --font: "Inter", "Noto Sans JP", system-ui, -apple-system, "Hiragino Sans", "Yu Gothic UI", sans-serif;

  --bg: #0b1220;
  --surface: rgba(17, 24, 39, 0.82);
  --surface-solid: #111827;
  --surface-2: #1f2937;

  --text: #e5e7eb;
  --muted: #94a3b8;
  /* 出典・注記のいちばん弱い階層。#0b1220 に対して 5.5:1（AA）を下回らない範囲で暗くしている。 */
  --muted-2: #828d9e;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  --accent: #2dd4bf;
  --accent-ink: #052e2b;
  --accent-soft: rgba(45, 212, 191, 0.14);

  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -14px rgba(0, 0, 0, 0.75);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --blur: saturate(1.5) blur(18px);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --fast: 140ms;
  --base: 240ms;

  --nav-h: 56px;
  --gutter: 24px;
  --measure: 1200px;
  --section-y: clamp(80px, 9vw, 148px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body.lp {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
p,
figure,
dd,
dl {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.lp-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.lp-skip:focus {
  left: 12px;
  top: 12px;
}

/* ============================================================
   タイポグラフィ
   ============================================================ */

.lp-nowrap {
  white-space: nowrap;
}

.lp-h1 {
  /* 最長行「暮らしやすいまちを、」の 10 文字が折り返さない上限。左カラム幅（下の .lp-hero-inner）とセット。 */
  font-size: clamp(38px, 5vw, 72px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.lp-h2 {
  font-size: clamp(26px, 3.2vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  text-wrap: balance;
}

.lp-h3 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.5;
}

.lp-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--accent);
  text-transform: uppercase;
}

.lp-lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 34em;
}

.lp-section-head {
  max-width: var(--measure);
  margin: 0 auto clamp(32px, 4vw, 56px);
}

.lp-section-lead {
  margin-top: 16px;
  font-size: 16px;
  color: var(--muted);
  max-width: 46em;
}

/* ============================================================
   ボタン
   ============================================================ */

.lp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease),
    transform var(--fast) var(--ease), color var(--fast) var(--ease);
}

.lp-btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.lp-btn-primary:hover {
  background: #5eead4;
  transform: translateY(-1px);
}

.lp-btn-ghost {
  border-color: var(--border-strong);
  color: var(--text);
}

.lp-btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.lp-btn-sm {
  height: 36px;
  padding: 0 16px;
  font-size: 13px;
}

.lp-btn-lg {
  height: 56px;
  padding: 0 30px;
  font-size: 16px;
}

.lp-btn-arrow {
  width: 18px;
  height: 18px;
  transition: transform var(--base) var(--ease);
}

.lp-btn:hover .lp-btn-arrow {
  transform: translateX(3px);
}

/* ============================================================
   ナビ
   ============================================================ */

.lp-nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--gutter);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--base) var(--ease), border-color var(--base) var(--ease),
    backdrop-filter var(--base) var(--ease);
}

.lp-nav.is-scrolled {
  background: rgba(11, 18, 32, 0.78);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom-color: var(--border);
}

.lp-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.lp-brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
}

.lp-brand-mark svg {
  width: 17px;
  height: 17px;
}

.lp-brand-name {
  font-size: 15px;
}

.lp-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lp-nav-link {
  padding: 0 12px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  border-radius: 999px;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}

.lp-nav-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

/* 言語切り替えは他のナビと違い、狭い画面でも残す */
.lp-lang {
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 600;
  white-space: nowrap;
}

/* ============================================================
   ヒーロー
   ============================================================ */

.lp-hero {
  position: relative;
  overflow: hidden;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 48px) var(--gutter) 64px;
}

/* 上端の微かな明度差だけで、ナビの下に「面」があることを示す。 */
.lp-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 70% at 50% -10%, rgba(45, 212, 191, 0.07), transparent 60%);
  pointer-events: none;
}

.lp-hero-inner {
  position: relative;
  width: 100%;
  /* 見出しを 72px のまま 3 行に収めるため、他セクションより広く取って左を優先配分する。 */
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 0.72fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}

.lp-hero-copy > * + * {
  margin-top: 24px;
}

.lp-hero-copy .lp-h1 {
  margin-top: 18px;
}

.lp-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.lp-trustline {
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--muted-2);
  border-top: 1px solid var(--border);
  padding-top: 18px;
  max-width: 40em;
}

.lp-dot {
  color: var(--border-strong);
  padding: 0 2px;
}

/* --- 点群 --- */

.lp-hero-map {
  position: relative;
  aspect-ratio: 1;
  /* 列島は viewBox の対角線上に細長く載るので、枠いっぱいだと小さく見える。右へはみ出させて拡大する。 */
  width: 128%;
  margin-left: -6%;
}

.lp-glow {
  position: absolute;
  inset: -12%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(45, 212, 191, 0.16), transparent 70%);
  filter: blur(24px);
  pointer-events: none;
}

.lp-dots {
  position: relative;
  width: 100%;
  height: 100%;
}

.lp-dots circle {
  /* 単位を省くと Safari は宣言ごと無効にし、r=0 で点が消える（Chrome だけが SVG 属性の流儀で受け付ける）。 */
  r: 2.6px;
  opacity: 0;
  animation: lp-dot-in 620ms var(--ease) forwards;
  /* r への transition は SVG で効かないので、fill-box 基準の scale で代替する。 */
  transform-box: fill-box;
  transform-origin: center;
  transition: transform var(--fast) var(--ease);
}

.lp-dots circle:hover {
  transform: scale(1.9);
}

@keyframes lp-dot-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 0.92;
  }
}

.lp-legend {
  position: absolute;
  /* 点群は右へ 28% はみ出しているので、凡例は元の列幅（100/128）の内側に戻して切れないようにする */
  right: 21.9%;
  bottom: 2%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  box-shadow: var(--shadow-sm);
}

.lp-legend-bar {
  width: 76px;
  height: 8px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.lp-legend-labels {
  display: grid;
  gap: 1px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}

.lp-legend-ends {
  display: flex;
  gap: 5px;
  color: var(--muted-2);
}

/* ============================================================
   数字の帯
   ============================================================ */

.lp-stats {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.lp-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.lp-stat {
  padding: clamp(28px, 3.4vw, 44px) clamp(16px, 2vw, 28px);
  border-left: 1px solid var(--border);
}

.lp-stat:first-child {
  border-left: 0;
  padding-left: 0;
}

.lp-stat-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.lp-stat-value {
  margin-top: 6px;
  font-size: clamp(34px, 4.6vw, 60px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.lp-stat-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

/* ============================================================
   プロダクト / スクリーンショット枠
   ============================================================ */

.lp-product,
.lp-steps,
.lp-metrics,
.lp-trust,
.lp-final {
  max-width: var(--measure);
  margin: 0 auto;
  padding: var(--section-y) var(--gutter);
}

.lp-shot {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.lp-shot-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.lp-shot-bar span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border-strong);
}

.lp-shot img {
  width: 100%;
  height: auto;
}

.lp-shot-lg {
  will-change: transform;
}

.lp-phone {
  width: min(220px, 70%);
  margin: 0 auto;
  padding: 7px;
  border-radius: 30px;
  border: 1px solid var(--border-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow);
}

.lp-phone img {
  width: 100%;
  height: auto;
  border-radius: 24px;
}

/* ============================================================
   3 ステップ
   ============================================================ */

.lp-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 32px);
}

.lp-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: clamp(22px, 2.4vw, 30px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
}

.lp-step-num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.lp-step-text {
  font-size: 14px;
  color: var(--muted);
}

.lp-step > .lp-shot,
.lp-step > .lp-phone {
  margin-top: auto;
}

.lp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
  padding-top: 6px;
}

.lp-pill {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  font-weight: 500;
  transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease),
    color var(--fast) var(--ease);
}

.lp-pill:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ============================================================
   指標グリッド
   ============================================================ */

.lp-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.lp-metric-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: clamp(20px, 2.2vw, 28px);
  background: var(--bg);
  transition: background var(--base) var(--ease);
}

.lp-metric-card:hover {
  background: #101a2b;
}

.lp-metric-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 4px;
}

.lp-metric-icon svg {
  width: 19px;
  height: 19px;
}

.lp-metric-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.5;
}

.lp-metric-desc {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--muted);
}

.lp-metric-src {
  margin-top: auto;
  padding-top: 10px;
  font-size: 11.5px;
  letter-spacing: 0.02em;
  color: var(--muted-2);
}

/* ============================================================
   データの姿勢
   ============================================================ */

.lp-trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 48px);
}

.lp-trust-item {
  border-top: 2px solid var(--accent);
  padding-top: 18px;
}

.lp-trust-item p {
  margin-top: 10px;
  font-size: 14.5px;
  color: var(--muted);
}

.lp-trust-foot {
  margin-top: clamp(28px, 3vw, 40px);
  font-size: 13px;
  color: var(--muted);
}

.lp-trust-foot a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

/* ============================================================
   最後の CTA
   ============================================================ */

.lp-final {
  text-align: center;
}

.lp-final-h {
  margin-bottom: clamp(28px, 3.5vw, 44px);
}

.lp-final-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  text-align: left;
}

.lp-preset {
  display: grid;
  gap: 4px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0));
  transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease),
    background var(--fast) var(--ease);
}

.lp-preset:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
}

.lp-preset-label {
  font-size: 15px;
  font-weight: 700;
}

.lp-preset-desc {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.lp-final-cta {
  margin-top: clamp(28px, 3.5vw, 44px);
}

/* ============================================================
   フッター
   ============================================================ */

.lp-footer {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(40px, 5vw, 64px) var(--gutter) 56px;
  border-top: 1px solid var(--border);
}

.lp-footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.lp-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 13px;
  color: var(--muted);
}

.lp-footer-links a:hover {
  color: var(--accent);
}

.lp-footer-sources {
  margin-top: 32px;
}

.lp-footer-head {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.lp-footer-sources ul {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 32px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

.lp-footer-legal {
  margin-top: 28px;
  font-size: 12px;
  line-height: 1.8;
  color: var(--muted-2);
  max-width: 60em;
}

.lp-copyright {
  margin-top: 24px;
  font-size: 12px;
  color: var(--muted-2);
}

/* ============================================================
   スクロール演出
   JS が付ける .lp-js が無いときは常に表示のままにし、
   スクリプトが落ちても本文が読める状態を保つ。
   ============================================================ */

.lp-js .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}

.lp-js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ============================================================
   レスポンシブ
   ============================================================ */

@media (max-width: 1080px) {
  .lp-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  :root {
    --gutter: 20px;
  }

  .lp-hero {
    min-height: 0;
    padding-top: calc(var(--nav-h) + 40px);
  }

  .lp-hero-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  /* 1 カラムになると見出しに使える幅が広がるので、2 カラム用の縮小カーブから切り替える。 */
  .lp-h1 {
    font-size: clamp(32px, 6vw, 56px);
  }

  /* 1 カラムでは点群と凡例を縦に積む。SVG に幅だけ与えれば viewBox から高さが決まり、
     枠をはみ出さない。 */
  .lp-hero-map {
    order: 2;
    width: 100%;
    margin-left: 0;
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .lp-dots {
    width: min(100%, 420px);
    height: auto;
  }

  .lp-glow {
    inset: -8% -8% 18%;
  }

  .lp-legend {
    position: static;
  }

  .lp-steps-grid,
  .lp-trust-grid,
  .lp-final-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lp-nav-link {
    display: none;
  }

  .lp-lang {
    display: inline-flex;
  }
}

@media (max-width: 720px) {
  .lp-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lp-stat {
    border-left: 0;
    padding-left: 0;
    border-top: 1px solid var(--border);
  }

  .lp-stat:first-child,
  .lp-stat:nth-child(2) {
    border-top: 0;
  }

  .lp-steps-grid,
  .lp-trust-grid,
  .lp-final-grid,
  .lp-metric-grid,
  .lp-footer-sources ul {
    grid-template-columns: minmax(0, 1fr);
  }

  /* 狭い幅では作者の改行より自然な折り返しのほうが行長が揃う。 */
  .lp-h1 br {
    display: none;
  }

  .lp-h1 {
    line-height: 1.2;
  }

  .lp-lead {
    font-size: 16px;
  }

  .lp-cta-row .lp-btn {
    flex: 1 1 220px;
  }

  .lp-shot-bar {
    height: 24px;
  }

  .lp-footer-legal,
  .lp-copyright {
    margin-top: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .lp-dots circle {
    opacity: 0.92;
    animation: none;
    transition: none;
  }

  .lp-js .reveal,
  .lp-js .reveal.is-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .lp-btn,
  .lp-preset,
  .lp-btn-arrow {
    transition: none;
  }

  .lp-btn-primary:hover,
  .lp-preset:hover {
    transform: none;
  }
}
