/*
 * RingiQuest LP（ランディングページ）スタイルシート。
 *
 * アプリ本体（src/client/index.css）と同じ「ミッドナイト・オフィス」テーマの
 * デザイントークンを踏襲する。ただし LP はライトテーマ対応が不要なため、
 * ここでは `:root[data-theme=...]` の出し分けは行わず、常にこの1色に固定する。
 *
 * ビルドステップを持たない静的ページのため、Tailwind 等は使わずすべて手書き。
 * インラインの <style>/style= 属性は使用しない（_headers の CSP と両立させるため、
 * すべてこのファイルに集約する）。
 */

/* ---------- リセット（最小限） ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

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

a {
  color: inherit;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

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

/* ---------- デザイントークン ---------- */
:root {
  --bg: #0b0e14;
  --surface: #131826;
  --surface-raised: #1a2133;
  --text: #e7ecf5;
  --text-muted: #8b94a8;
  --accent: #22e2d6;
  --accent-strong: #0ff0e0;
  --border: #232b3f;
  --stamp: #c8302a;

  /* 日本語向けシステムフォントスタック。Web フォントは読み込まない。 */
  --font-sans:
    system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;

  --max-width: 1100px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;

  color-scheme: dark;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- レイアウト共通 ---------- */
.container {
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2rem);
}

section {
  padding-block: clamp(3rem, 7vw, 6rem);
}

.section-heading {
  max-width: 42rem;
  margin-inline: auto;
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

h2 {
  font-size: clamp(1.5rem, 3.6vw, 2.25rem);
  line-height: 1.4;
  letter-spacing: 0.01em;
}

/*
 * 日本語見出しの孤立行（「に。」「り。」のような1〜2文字だけの行）対策。
 *
 * `text-wrap: balance` だけでは、日本語は分かち書きされないため
 * ブラウザがどの文字の間でも改行してよいと判断してしまい、意味の切れ目と
 * 無関係な位置で折り返されることがある。そこで、意味の区切り（読点など）で
 * 各見出しのテキストを `<span class="text-chunk">` に手動分割し、
 * `display: inline-block` にして「そのspanの外でしか改行できない」ように
 * 制約する（inline-block の内部では通常の折り返しルールが働くので、
 * 1つの chunk 自体が狭い画面で複数行になるのは許容する——ただし各 chunk は
 * 「読点の前後」という意味の単位なので、そこで改行されても不自然ではない）。
 * `text-wrap: balance` は対応ブラウザで見た目をさらに整える上乗せとして残す
 * （未対応ブラウザでは単に無視される＝実害無し）。
 */
h1,
h2,
h3 {
  text-wrap: balance;
}

.text-chunk {
  display: inline-block;
}

.section-lead {
  margin-top: 0.75rem;
  color: var(--text-muted);
  font-size: clamp(1rem, 1.6vw, 1.125rem);
}

/* ---------- スキップリンク ---------- */
.skip-link {
  position: absolute;
  top: -3rem;
  left: 1rem;
  z-index: 100;
  background: var(--accent);
  color: var(--bg);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus-visible {
  top: 1rem;
}

/* ---------- 共通: フォーカスリング ---------- */
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ---------- ボタン ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.button--primary {
  background-color: var(--accent);
  color: var(--bg);
}

.button--primary:hover {
  background-color: var(--accent-strong);
}

.button--primary:active {
  transform: translateY(1px);
}

.button--ghost {
  background-color: transparent;
  color: var(--text);
  border-color: var(--border);
}

.button--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.button--large {
  padding: 1rem 2.25rem;
  font-size: 1.0625rem;
}

.button--small {
  padding: 0.6rem 1.25rem;
  font-size: 0.9375rem;
}

/* ---------- ヘッダー ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: rgba(11, 14, 20, 0.88);
  backdrop-filter: blur(6px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.9rem;
}

.site-header__logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
  text-decoration: none;
  color: var(--text);
}

.site-header__logo:hover {
  color: var(--accent);
}

/*
 * ヘッダー内の「ブログ」導線。ロゴと CTA ボタンの間に置く単独リンク
 * （ページ数がまだ少ないため <nav> でまとめるほどの数ではない）。
 * blog.css ではなくここに置くのは、LP トップ（index.html）は
 * blog.css を読み込まないため。
 */
.site-header__nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
}

.site-header__nav-link:hover,
.site-header__nav-link:focus-visible {
  color: var(--accent);
}

/* ---------- 稟議書モチーフ: 見出し前の件名欄風タグ ---------- */
.eyebrow {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.9rem;
  margin-bottom: 1.25rem;
}

/* ---------- ヒーロー ---------- */
.hero {
  padding-block: clamp(2.5rem, 7vw, 5rem);
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
}

.hero h1 {
  font-size: clamp(1.875rem, 5vw, 3rem);
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.hero__lead {
  margin-top: 1.25rem;
  font-size: clamp(1rem, 1.8vw, 1.125rem);
  color: var(--text-muted);
  max-width: 38rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

.hero__note {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.hero__media {
  position: relative;
  justify-self: center;
  max-width: 320px;
  width: 100%;
}

.hero__media img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 0 0 1px rgba(34, 226, 214, 0.08);
}

/* ---------- カードグリッド ---------- */
.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card h3 {
  font-size: 1.0625rem;
  line-height: 1.5;
}

.card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* ---------- 読みもの（トップページからブログへの導線） ---------- */
.reads {
  background-color: var(--surface);
  border-block: 1px solid var(--border);
}

.reads__card h3 a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.reads__card h3 a:hover,
.reads__card h3 a:focus-visible {
  color: var(--accent);
}

.reads__more {
  margin-top: 1.75rem;
  text-align: center;
}

.reads__more a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* ---------- #why ---------- */
.why {
  background-color: var(--surface);
  border-block: 1px solid var(--border);
}

/* ---------- #how ---------- */
.steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 6vw, 4.5rem);
}

.step {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  /* テキスト側の開始位置（番号バッジ・見出し・本文）を画像の上端に揃える。
     縦長画像に対して中央揃えだと、ステップごとに視線の始点がバラつくため。 */
  align-items: start;
  gap: clamp(1.75rem, 5vw, 3.5rem);
}

.step:nth-child(even) .step__media {
  order: 2;
}

.step__media {
  justify-self: center;
  max-width: 240px;
  width: 100%;
}

.step__media img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.step__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  background-color: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--accent);
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 0.9rem;
}

.step__content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.6rem;
}

.step__content p {
  color: var(--text-muted);
}

/* ---------- #features ---------- */
/*
 * 「保護者の景色」ショーケース（insights.png + home-parent.png の2枚）。
 *
 * `auto-fit` + `minmax(240px, 1fr)` により、画像2枚分の横幅（240px×2＋gap）が
 * 収まる画面幅では自動的に横並びの2列、収まらない狭い画面では自動的に
 * 1列（縦積み）に折り返る——メディアクエリ無しで「デスクトップは横並び、
 * モバイルは縦積み」を実現する。各 img 自体は `max-width: 260px` で
 * キャップしているので、グリッドの列が広くなるワイド画面でも間延びしない。
 */
.features__showcase {
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.5rem);
}

.features__showcase-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(1.25rem, 4vw, 2rem);
  justify-items: center;
}

.features__showcase-images img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 260px;
}

.features__showcase-caption {
  margin-top: clamp(1.5rem, 4vw, 2rem);
  text-align: center;
  max-width: 34rem;
  margin-inline: auto;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.features__showcase-caption strong {
  display: block;
  color: var(--text);
  font-size: 1.0625rem;
  margin-bottom: 0.5rem;
}

/* ---------- #privacy ---------- */
.privacy {
  background-color: var(--surface);
  border-block: 1px solid var(--border);
}

.privacy-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  list-style: none;
}

.privacy-grid li {
  background-color: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.privacy-grid__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.9375rem;
  font-weight: 800;
  margin-bottom: 0.85rem;
}

.privacy-grid h3 {
  font-size: 1.0625rem;
  margin-bottom: 0.5rem;
}

.privacy-grid p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/*
 * 広告の開示文。上の privacy-grid（「広告も解析ツールもありません」）が
 * 指しているのはアプリ本体であって、この紹介サイト自体には AdSense が
 * 入っている——その境界を読み手に伝えるための注記。
 * 見落とされると誤認につながるので、本文より小さくはするが薄くしすぎない。
 */
.privacy-note {
  max-width: 44rem;
  margin: clamp(2rem, 5vw, 3rem) auto 0;
  padding: 1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--surface-raised);
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.8;
}

.privacy-note strong {
  color: var(--text);
}

.privacy-link {
  text-align: center;
  margin-top: clamp(1.5rem, 4vw, 2rem);
}

.privacy-link a {
  font-weight: 700;
  color: var(--accent);
  text-decoration-color: transparent;
  text-underline-offset: 0.25em;
  transition: text-decoration-color 0.15s ease;
}

.privacy-link a:hover,
.privacy-link a:focus-visible {
  text-decoration-color: currentColor;
}

/* ---------- #faq ---------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 44rem;
  margin-inline: auto;
}

.faq-item {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.25rem 1.25rem;
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
  font-weight: 700;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item__icon {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  position: relative;
}

.faq-item__icon::before,
.faq-item__icon::after {
  content: "";
  position: absolute;
  background-color: var(--accent);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.faq-item__icon::before {
  width: 0.6rem;
  height: 2px;
}

.faq-item__icon::after {
  width: 2px;
  height: 0.6rem;
  transition: transform 0.15s ease;
}

.faq-item[open] .faq-item__icon::after {
  transform: translate(-50%, -50%) scaleY(0);
}

.faq-item p {
  color: var(--text-muted);
  padding-bottom: 1.25rem;
  margin-top: -0.4rem;
}

/* ---------- 決裁印モチーフ: 最終CTAの背景装飾 ---------- */
.cta-final {
  position: relative;
  overflow: hidden;
}

.cta-final__stamp {
  position: absolute;
  top: 50%;
  right: clamp(-2rem, 4vw, 2rem);
  transform: translateY(-50%) rotate(-12deg);
  width: clamp(140px, 20vw, 220px);
  height: clamp(140px, 20vw, 220px);
  border: 3px solid var(--stamp);
  border-radius: 999px;
  opacity: 0.22;
  pointer-events: none;
}

.cta-final__stamp::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--stamp);
  border-radius: 999px;
}

.cta-final__inner {
  position: relative;
  text-align: center;
  max-width: 40rem;
  margin-inline: auto;
}

.cta-final p {
  margin-top: 1rem;
  color: var(--text-muted);
}

.cta-final .button {
  margin-top: 2rem;
}

/* ---------- フッター ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: clamp(2rem, 5vw, 3rem);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.site-footer__brand {
  font-weight: 800;
  font-size: 1.0625rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
}

.site-footer nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
}

.site-footer nav a:hover,
.site-footer nav a:focus-visible {
  color: var(--accent);
}

.site-footer__copyright {
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* ---------- 404ページ ---------- */
.not-found {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.not-found__inner {
  max-width: 28rem;
}

.not-found__code {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.not-found h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 0.75rem;
}

.not-found p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

/* ---------- レスポンシブ: タブレット以下 ---------- */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
  }

  .hero__media {
    max-width: 260px;
    order: -1;
    margin-inline: auto;
  }

  .step {
    grid-template-columns: 1fr;
  }

  .step:nth-child(even) .step__media {
    order: 0;
  }

  .step__media {
    max-width: 220px;
  }
}

@media (max-width: 560px) {
  .site-header__inner {
    flex-wrap: wrap;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero__actions .button {
    width: 100%;
  }
}
