/* デザインの数字（A案「立体イラストで親しみやすく」）。サイトの見た目はこのファイルだけで切り替える。
   決まりの理由は knowledge/design-rules.md。値を足す時は、役割（何に使うか）を先に決める。 */
:root {
  /* 色は役割で決める。強調色は1色、ページの面積の1割まで */
  --c-bg: #ffffff;
  --c-surface: #f1f8ff;          /* 区切りの面（tone-muted） */
  --c-text: #10233f;
  --c-text-muted: #4b5f7a;       /* 補足。白地でコントラスト比 4.5 以上 */
  --c-line: #d9e8f8;
  --c-accent: #1668d0;           /* 強調色。ボタン、ラベル、番号 */
  --c-accent-strong: #0f4fa3;    /* ボタンを押した時 */
  --c-accent-soft: #e4f1ff;
  --c-on-accent: #ffffff;
  --c-inverse-bg: #0f2e5c;       /* 暗い面（tone-inverse、フッター） */
  --c-inverse-text: #f2f7ff;
  --c-inverse-muted: #b4c8e4;

  /* 書体。和文1つ＋欧文1つまで。欧文を先に書くと英数字だけ欧文になる */
  --font-sans: "Inter", "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  --font-heading: var(--font-sans);
  --font-latin: "Inter", system-ui, sans-serif;
  --fw-regular: 400;
  --fw-bold: 700;

  /* 文字の大きさ。画面幅 360px→1440px でなめらかに変わる。使うのはこの段階だけ */
  --fs-xs: 0.8125rem;                                    /* 13 注記 */
  --fs-sm: 0.875rem;                                     /* 14 ラベル・補足 */
  --fs-base: clamp(1rem, 0.979rem + 0.093vw, 1.0625rem); /* 16→17 本文 */
  --fs-lg: clamp(1.125rem, 1.083rem + 0.185vw, 1.25rem); /* 18→20 導入文 */
  --fs-h3: clamp(1.25rem, 1.167rem + 0.37vw, 1.5rem);    /* 20→24 部品の題 */
  --fs-h2: clamp(1.75rem, 1.417rem + 1.481vw, 2.75rem);  /* 28→44 セクションの見出し */
  --fs-h1: clamp(2.25rem, 1.583rem + 2.963vw, 4.25rem);  /* 36→68 ページの見出し */
  --fs-display: clamp(2.5rem, 1.9rem + 2.8vw, 4.5rem); /* 40→88 トップの一言 */
  --lh-body: 1.9;
  --lh-heading: 1.4;
  --lh-tight: 1.2;
  --tracking-body: 0.04em;
  --tracking-heading: 0.02em;
  --tracking-label: 0.14em;

  /* 余白の段階（近接）。部品の中 < 部品どうし < セクションどうし を必ず守る */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem; --sp-5: 1.5rem;
  --sp-6: 2rem; --sp-7: 3rem; --sp-8: 4rem; --sp-9: 6rem; --sp-10: 8rem;
  --gap-inner: var(--sp-4);                          /* 部品の中（題と説明の間） */
  --gap-item: clamp(1.5rem, 1.2rem + 1.4vw, 2.5rem);  /* 部品どうし */
  --gap-head: clamp(2.5rem, 2rem + 2.2vw, 4rem);      /* 見出しと中身の間 */
  --gap-section: clamp(5rem, 3.5rem + 6.5vw, 10rem);  /* セクションどうし */
  --gutter: clamp(1.25rem, 0.5rem + 3.6vw, 4rem);    /* 画面の左右の余白（最小20px） */

  /* 幅（整列）。本文の1行は日本語で35〜40字に収める */
  --w-content: 72rem;   /* 1152 */
  --w-wide: 72rem;      /* ヘッダーとメインビジュアルの左端を本文にそろえる */
  --w-narrow: 46rem;    /* 736 */
  --measure: 40em;

  /* 形（反復）。角丸は2種類だけ */
  --radius: 20px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow: 0 10px 30px -12px rgb(20 24 33 / 0.18);
  --header-h: 4.5rem;

  /* 動き */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 160ms;   /* 押した・触れた */
  --dur-2: 320ms;   /* 開く・閉じる */
  --dur-3: 900ms;   /* 表示される */

  /* 3D の色（scene3d.js が読む） */
  --scene-1: #1668d0;
  --scene-2: #7cc0ff;
  --scene-3: #e4f1ff;
}

/* 住所の番地を行の途中で折らない */
.nowrap { white-space: nowrap; }

/* サービスカードの見出しリンクを押しやすくする */
.section--services .card-title a { display: inline-block; padding-block: 0.625rem; }
.case__more { margin-top: var(--sp-4); }

/* トップだけのスマホ短縮（home.yml の compactSp。下層のページには効かない） */
@media (max-width: 767px) {
  .section.section--compact-sp { padding-block: calc(var(--gap-section) * 0.75); }
  .section.section--compact-sp [data-sp-optional] { display: none; }
  .section--services.section--compact-sp .card { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); column-gap: var(--sp-4); align-items: center; }
  .section--services.section--compact-sp .card__media { grid-column: 1; grid-row: 1; width: 4.5rem; margin: 0; }
  .section--services.section--compact-sp .card__media > * { aspect-ratio: 1 / 1 !important; width: 100%; }
  .section--services.section--compact-sp .eyebrow,
  .section--services.section--compact-sp .card-title { grid-column: 2; margin: 0; }
  .section--services.section--compact-sp .card > p:not(.eyebrow),
  .section--services.section--compact-sp .link-arrow { grid-column: 1 / -1; margin-top: var(--sp-2); }
  .section--features.section--compact-sp .card-grid,
  .section--flow.section--compact-sp .steps { gap: var(--sp-4); }
  .section--flow.section--compact-sp .step { padding-top: var(--sp-4); }
}

/* 事例の文は行頭に句点が来ないよう、語の途中でも折る */
.case__facts dd { word-break: normal; }

/* 長い題のページはスマホで文字を小さくし、語の途中で折れないようにする */
@media (max-width: 480px) {
  .page-header__title { font-size: 1.625rem; }
  .hero--long .hero__title { font-size: 1.625rem; }
}

/* 下層ページの長い題は、左半分の幅で語の途中で折れないように文字を小さくする */
@media (min-width: 768px) {
  .hero--split.hero--long .hero__title { font-size: clamp(1.75rem, 1.2rem + 1.5vw, 2.75rem); }
}
