/* =========================================================
   UMIDAS – 全ページ共通の土台
   小規模事業者・家族経営の経営者（多くは高齢）が主読者。
   可読性を最優先に、明るい背景・大きな文字・高コントラスト・
   動きの少ない構成で組んでいる。
   ・文字サイズ
       PC   … 本文 17px ／ カード見出し 20-21px ／ 大見出し clamp
       スマホ… 本文 13px ／ 注記 12px ／ カード見出し 17px ／
                大見出しは据え置き
     参照用の表記（フッターの法定リンク、グラフの目盛り・凡例）は 11px。
     スマホは情報密度を優先した設定で、当初の下限14pxより小さくしている
   ・文字色はすべて背景に対して WCAG AA（4.5:1）以上
   ・ループするアニメーションは置かない（fade-in のみ）

   読み込み順：
     base.css（このファイル）→ ページ固有のCSS
   ページ固有ファイル：
     style.css     … トップページ
     showcase.css  … 自社サービス／制作実績の一覧ページ
   ========================================================= */

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

/* hidden 属性を確実に効かせる。
   ブラウザ標準の [hidden]{display:none} は作成者スタイルより弱いため、
   .btn や .app-card のように display を指定したクラスが付くと打ち消されてしまう */
[hidden] {
  display: none !important;
}

:root {
  /* 背景・面 */
  --bg: #fdfcfa;
  --surface: #ffffff;
  --surface-2: #f6f3ee;
  --surface-3: #efeae2;

  /* 罫線 */
  --line: #e3ddd4;
  --line-strong: #cfc7bb;

  /* 文字（コントラスト比は --bg #fdfcfa 上の実測値） */
  --text: #1f1d1b;       /* 16.4:1 */
  --text-sub: #55504a;   /*  7.8:1 */
  --text-weak: #6e6862;  /*  5.4:1 ← これより薄い色は使わない */

  /* アクセント（白文字を載せて 5.0:1、地色に対して 4.9:1） */
  --accent: #c93f00;
  --accent-hover: #a83400;
  --accent-soft: #fdf0e9;
  --accent-line: rgba(201, 63, 0, 0.3);

  /* 制作実績（Works）系の色 */
  --blue: #1d5fb4;       /*  6.1:1 */
  --blue-soft: #eef3fb;
  --blue-line: rgba(29, 95, 180, 0.3);

  /* 状態を示す色。いずれも白文字を載せて 4.5:1 以上 */
  --live: #1a7f45;       /* 稼働中 */
  --dev: #8a5a00;        /* 開発中 */
  --plan: #4a5568;       /* 構想中 */
  --beta: #7239a8;       /* ベータ版 */

  --font-en: 'Inter', sans-serif;
  --font-jp: 'Noto Sans JP', sans-serif;

  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(31, 29, 27, 0.05);
  --shadow: 0 4px 16px rgba(31, 29, 27, 0.07);
  --shadow-lg: 0 18px 48px rgba(31, 29, 27, 0.12);
}

html {
  scroll-behavior: smooth;
  /* 固定ヘッダーの分だけアンカー位置を下げる */
  scroll-padding-top: 88px;
}

body {
  font-family: var(--font-jp);
  font-size: 1.0625rem;   /* 17px */
  font-weight: 400;
  line-height: 1.95;
  letter-spacing: 0.02em;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

/* キーボード操作でも現在位置が分かるように、共通のフォーカスリング */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─────────────────────────────────────────
   日本語の折り返し
   行末に1〜2文字だけ残る「ぶら下がり」は、画面幅ごとに出る箇所が変わるので
   文字サイズの調整では潰しきれない。ブラウザ側に行を均してもらう。
   いずれも未対応ブラウザでは無視されるだけで、従来どおりの折り返しになる
   ───────────────────────────────────────── */

/* 見出しは各行の長さを揃える */
h1, h2, h3, h4,
.solution-headline,
.inline-cta-text strong,
.cta-social-title {
  text-wrap: balance;
}

/* 本文は最終行が極端に短くならないようにする */
p, li, dd,
.section-sub,
.page-lead,
.app-card-desc {
  text-wrap: pretty;
}

/* 単語単位ではなく文節単位で折り返す。html の lang="ja" が前提 */
h1, h2, h3, h4, p, li,
.solution-headline,
.section-sub,
.page-lead {
  word-break: auto-phrase;
}

/* 読み上げ専用 */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ─────────────────────────────────────────
   ヘッダー（全ページ共通）
   ───────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(253, 252, 250, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--font-en);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.logo span {
  color: var(--accent);
}

/* ロゴ横のページ名（下層ページで使う） */
.logo small {
  font-family: var(--font-jp);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-sub);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 12px 14px;      /* タップ領域を 44px 以上に */
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-sub);
  text-decoration: none;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

/* いま見ているページ */
.nav-links a[aria-current="page"] {
  color: var(--accent);
  font-weight: 700;
  background: var(--accent-soft);
}

/* ヘッダー右端の相談ボタン */
.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
  white-space: nowrap;
  transition: background 0.2s;
}

.nav-cta:hover {
  background: var(--accent-hover);
}

.nav-cta svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ハンバーガー（PCでは非表示） */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-jp);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.nav-toggle-bars {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 18px;
  height: 14px;
}

.nav-toggle-bars span {
  display: block;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* メニュー内の相談ボタンはスマホ専用（PCではヘッダー右の .nav-cta を使う） */
.nav-links .nav-cta-mobile {
  display: none;
}

/* ─────────────────────────────────────────
   ボタン
   ───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 16px 36px;
  font-family: var(--font-jp);
  font-size: 1.125rem;    /* 18px */
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
}

.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn--outline {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--lg {
  min-height: 64px;
  font-size: 1.1875rem;
  padding: 18px 44px;
}

/* ─────────────────────────────────────────
   セクション共通
   ───────────────────────────────────────── */
section {
  padding: 92px clamp(24px, 6vw, 80px);
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-header {
  margin-bottom: 52px;
  max-width: 760px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-family: var(--font-en);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-label::before {
  content: '';
  width: 28px;
  height: 2px;
  background: var(--accent);
}

.section-title {
  font-size: clamp(1.65rem, 3.6vw, 2.4rem);
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.01em;
  margin-bottom: 16px;
}

.section-sub {
  font-size: 1.125rem;
  line-height: 1.95;
  color: var(--text-sub);
}

/* ─────────────────────────────────────────
   お問い合わせ（全ページ共通）
   説明 ／ フォーム ／ Instagram の3列。
   一番使ってほしいフォームを中央に置き、Instagramは補助として右端へ
   ───────────────────────────────────────── */
/* 3列を並べる都合上、左右の余白は他セクションより控えめにしている */
.cta-section {
  background: var(--surface-2);
  padding: 92px clamp(24px, 4vw, 56px) 80px;
  border-top: 1px solid var(--line);
}

/* Instagram列は固定幅の340px（補助的な要素なので小さく）。
   残りを比率で分け、主役の相談フォームに一番広く取る。
   ※埋め込み内の写真が左右で切れるのはInstagram側の描画によるもので、
     列幅を広げても解消しなかったため、幅を確保する意味はないと判断した */
.cta-inner {
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.35fr 340px;
  grid-template-areas: "text form social";
  gap: 40px;
  align-items: start;
}

.cta-content { grid-area: text; }
.cta-social  { grid-area: social; }
.cta-form    { grid-area: form; }

/* 「まずは、困りごとから。」が列幅に収まり、PCで2行になる大きさに抑えている */
.cta-lead {
  font-size: clamp(1.5rem, 2vw, 1.875rem);
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 18px;
}

.cta-lead em {
  font-style: normal;
  color: var(--accent);
}

.cta-desc {
  font-size: 1.125rem;
  line-height: 2;
  color: var(--text-sub);
  margin-bottom: 32px;
}

.cta-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cta-link {
  --link-color: var(--accent);
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 14px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--link-color);
  border-radius: 8px;
  color: var(--text);
  font-size: 1.125rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cta-link:hover {
  border-color: var(--link-color);
  box-shadow: var(--shadow);
}

.cta-link--works { --link-color: var(--blue); }
.cta-link--app   { --link-color: var(--live); }

.cta-link-en {
  font-family: var(--font-en);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--link-color);
  min-width: 74px;
}

.cta-link svg {
  width: 18px;
  height: 18px;
  margin-left: auto;
  color: var(--text-weak);
  flex-shrink: 0;
}

/* Instagram 埋め込み。
   カード側の余白は見出しとボタンだけに付け、iframe はカード幅いっぱいに使う。
   主役はフォームなので、こちらは影を落とさず一段控えめに見せる */
.cta-social {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.cta-social-title {
  font-size: 1.125rem;
  font-weight: 700;
  padding: 20px 22px 12px;
}

/* 高さは「列幅 + 埋め込みのヘッダー・フッター約190px」が目安 */
.cta-social iframe {
  width: 100%;
  height: 530px;
  border: 0;
  display: block;
  background: #fff;
}

.cta-social .cta-btn-secondary {
  margin: 16px 22px 20px;
}

.cta-btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 14px 24px;
  border: 2px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
  font-size: 1.0625rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  transition: background 0.2s, color 0.2s;
}

.cta-btn-secondary:hover {
  background: var(--accent);
  color: #fff;
}

/* ─────────────────────────────────────────
   フォーム
   ───────────────────────────────────────── */
.cta-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 32px 36px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 96px;
}

.cta-form h3 {
  font-size: 1.4375rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.cta-form-note {
  font-size: 1rem;
  color: var(--text-sub);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.form-required,
.form-optional {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 9px;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 700;
  vertical-align: 2px;
}

.form-required {
  background: var(--accent);
  color: #fff;
}

.form-optional {
  background: var(--surface-3);
  color: var(--text-sub);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-jp);
  font-size: 1.0625rem;
  line-height: 1.7;
  transition: border-color 0.2s;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-weak);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

.form-group textarea {
  resize: vertical;
  min-height: 130px;
}

.form-submit {
  width: 100%;
  min-height: 64px;
  padding: 18px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-jp);
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.form-submit:hover {
  background: var(--accent-hover);
}

/* ─────────────────────────────────────────
   フッター
   ───────────────────────────────────────── */
/* フッターは読ませる文章ではなく参照用の表記なので、PC・スマホとも11px。
   行間も本文用の1.95のままだと間延びするので詰めている */
footer {
  padding: 24px;
  text-align: center;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.footer-links {
  margin-bottom: 6px;
  font-size: 0.6875rem;
  line-height: 1.7;
  color: var(--text-sub);
}

.footer-links a {
  display: inline-block;
  padding: 5px 2px;
  color: var(--text-sub);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

footer p {
  font-family: var(--font-en);
  font-size: 0.6875rem;
  line-height: 1.6;
  color: var(--text-weak);
}

/* ─────────────────────────────────────────
   出現アニメーション（唯一の動き）
   ───────────────────────────────────────── */
.fade-in {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: none;
}

.pc-only { display: inline; }
.sp-only { display: none; }

/* ─────────────────────────────────────────
   タブレット
   ───────────────────────────────────────── */
/* 3列を保つには 説明369px + フォーム499px + Instagram340px + 余白 が要る。
   それを下回る幅では、フォームだけ右に残して説明とInstagramを左に積む */
@media (max-width: 1399px) {
  .cta-inner {
    grid-template-columns: 1fr 460px;
    grid-template-areas:
      "text form"
      "social form";
    gap: 32px 36px;
  }
}

/* ここからは1列。入力に一番近いフォームを先頭に持ってくる */
@media (max-width: 959px) {
  .cta-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "form"
      "text"
      "social";
    gap: 32px;
  }

  .cta-form {
    position: static;
  }
}

/* ─────────────────────────────────────────
   スマートフォン
   ───────────────────────────────────────── */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 76px;
  }

  .header-inner {
    padding: 12px 16px;
  }

  .logo {
    font-size: 1.3125rem;
    gap: 8px;
  }

  .logo small {
    font-size: 0.875rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  /* ハンバーガーで開閉する縦並びメニュー */
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 16px 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 16px 12px;
    font-size: 1.125rem;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  /* ヘッダーの相談ボタンはスマホでは畳んでメニュー内に出す */
  .nav-cta {
    display: none;
  }

  .nav-links .nav-cta-mobile {
    display: flex;
    justify-content: center;
    margin-top: 12px;
    padding: 16px;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    border-bottom: none;
  }

  .nav-links .nav-cta-mobile:hover {
    background: var(--accent-hover);
    color: #fff;
  }

  section {
    padding: 64px 18px;
  }

  .btn,
  .btn--lg {
    width: 100%;
    font-size: 1.0625rem;
    padding: 16px 20px;
  }

  .section-header {
    margin-bottom: 36px;
  }

  .section-sub {
    font-size: 1.0625rem;
  }

  .cta-section {
    padding: 64px 18px 68px;
  }

  .cta-form {
    padding: 26px 20px 28px;
  }

  /* 「刺繍台帳を使ってみる」が入りきらないので、英字ラベルの固定幅と
     左右の余白を詰める。狭い端末では英字ラベル自体を畳む */
  .cta-link {
    gap: 10px;
    padding: 14px 16px;
    font-size: 1.0625rem;
  }

  .cta-link-en {
    min-width: auto;
  }

  .cta-social iframe {
    height: 520px;
  }

  .pc-only { display: none; }
  .sp-only { display: inline; }
}

/* ─────────────────────────────────────────
   小さい端末（iPhone SE 等 375px 未満）
   ───────────────────────────────────────── */
@media (max-width: 380px) {
  /* ロゴ横のページ名を畳まないと、メニューボタンと衝突する */
  .logo small {
    display: none;
  }

  .cta-link-en {
    display: none;
  }

  .nav-links a {
    font-size: 1.0625rem;
  }
}

/* ─────────────────────────────────────────
   動きを減らす設定を尊重
   ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .fade-in {
    opacity: 1;
    transform: none;
  }
}

/* ─────────────────────────────────────────
   スマホの文字スケール
   大見出し（h1 / section-title / page-title）は据え置き。
   カード見出し以下を一段ずつ落とし、行間も詰めて情報密度を上げる。
     カード見出し 17px ／ 価格・小見出し 16px ／ 本文 13px ／ 注記 12px
   ※フォームの入力欄だけは 16px 未満にしない。iOS Safari は
     16px 未満の入力欄にフォーカスすると画面を自動で拡大してしまう
   ───────────────────────────────────────── */
@media (max-width: 768px) {
  body {
    font-size: 1rem;
    line-height: 1.8;
  }

  .section-sub {
    font-size: 0.8125rem;
  }

  .cta-desc {
    font-size: 0.875rem;
    line-height: 1.85;
  }

  .cta-link {
    font-size: 1rem;
  }

  .cta-form h3 {
    font-size: 1.125rem;
  }

  .cta-form-note {
    font-size: 0.8125rem;
  }

  .cta-social-title {
    font-size: 1rem;
  }

  .form-group label {
    font-size: 1rem;
  }

  /* 文字サイズ・行間は共通側で11pxに揃えてある。ここは余白だけ詰める */
  footer {
    padding: 18px;
  }

  .footer-links {
    margin-bottom: 4px;
  }

  .footer-links a {
    padding: 6px 0;
  }
}
