/*
  TOP page styles

  This entrypoint imports only TOP content styles.
  Common styles are supplied by shared Astro layout/components.
*/

/* =========================================================
   N-1 / SOFT CARD section heading
   ========================================================= */

.sec-head:has(.h-section) {
  display: block;
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: clamp(28px, 3.4vw, 40px);
  gap: 0;
}

.h-section {
  position: relative;
  display: block;
  width: 100%;
  padding: 18px 24px 18px 28px;
  background: #fff;
  border-radius: 10px;
  border: 1px solid #eef0f2;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.02),
    0 12px 28px -16px rgba(15, 23, 42, 0.18),
    0 2px 6px -2px rgba(15, 23, 42, 0.06);
  box-sizing: border-box;
}

.h-section::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent) 0%, #8a0014 100%);
  border-radius: 10px 0 0 10px;
}

.h-section h2 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: var(--text);
  padding-left: 0;
  border-left: none;
}

.sec-head .h-section + .sec-lead,
.h-section + .sec-lead {
  color: var(--text-sub);
  font-size: 15px;
  line-height: 1.95;
  margin: 16px 0 0;
  max-width: 720px;
}

/* TOP — セクション見出し（白カード + 左赤バー + ソフトシャドウ）
   下層ページと比べ padding を大きめにし、meta ラベルを表示する。
   common/h-section.css の後にこのファイルを読み込んで上書きする。 */

.h-section {
  padding: 22px 28px 22px 32px;
}

.h-section .meta {
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-sub);
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 600;
}

/* TOP — ページ全体のセクション枠とセクション導入ラッパー */

:root{ --fs-body: 16px; }

.docs section{ padding: clamp(64px, 8vw, 96px) 0; }

.docs .section-sub{ background: var(--bg-sub); }

.section-intro{ margin: 0 0 40px; }

.section-intro .sec-lead{
  color: var(--text-sub);
  font-size: 16px;
  line-height: 1.95;
  margin: 24px 0 0;
  max-width: 720px;
}

/* TOP — FV（紺デュオトーン背景） */

.hero{
  position: relative;
  padding: clamp(88px, 12vw, 140px) 0 clamp(88px, 12vw, 140px);
  overflow: hidden;
  isolation: isolate;
  background: #111827;
  color: #fff;
}

.hero .container{ position: relative; z-index: 2; }

.hero-bg{
  position: absolute; inset: 0;
  background-image: var(--hero-bg-image);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  z-index: 0;
}

.hero-overlay{
  position: absolute; inset: 0;
  background: rgba(17,24,39,0.40);
  z-index: 1;
}

.hero h1{
  font-size: clamp(36px, 5.6vw, 64px);
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin: 0 0 24px;
  text-wrap: balance;
  color: #fff;
  max-width: 760px;
}

.hero h1 em{
  font-style: normal;
  background: linear-gradient(transparent 65%, rgba(230,0,35,0.55) 65%);
  padding: 0 2px;
}

.hero .hero-sub{
  max-width: 580px;
  color: #C5CFE0;
  font-size: 17px;
  line-height: 1.95;
  margin: 0 0 32px;
}

.hero .hero-actions{
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero .hero-actions .btn{
  min-width: 240px;
  justify-content: center;
}

.hero-cta-sp{ display: none; }

.hero-actions-sp{
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.hero-actions-sp .btn{
  width: 100%;
  justify-content: center;
}

.hero .btn.btn-ghost{
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.20);
}

.hero .btn.btn-ghost:hover{
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.4);
}

/* ============================================
   metrics.css — TOP 別案 (index_2) 専用
   数値メトリクス帯（3指標）— ヒーロー直下に配置
   ※数値はクライアント情報差し替え予定（案④）
   ※ 旧4枠目「RESPONSE 24h以内ご連絡」は方針変更により削除し、
      3カラム構成へ変更（v4）。差し替え候補確定時は4カラムへ戻す。
   v4 — 縦積みレイアウト / 3カラム
   ============================================ */

#metrics{
  padding: 0 0 40px;
  background: #fff;
}

.metrics-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.metric{
  padding: 36px 32px 36px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.metric:last-child{
  border-right: none;
}

.metric-label{
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 16px;
}

.metric-value{
  display: block;
  margin: 0;
}

.metric-value strong{
  display: block;
  font-family: "JetBrains Mono", monospace;
  font-size: 48px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
}

.metric-value span{
  display: block;
  margin-top: 10px;
  font-size: 14px;
  color: var(--text-sub);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ===== レスポンシブ（≤ 767px） — metrics 3カラム維持 + 高さ圧縮 ===== */

@media (max-width: 767px){
  .metrics-grid{
    grid-template-columns: repeat(3, 1fr);
    padding-bottom: 0;
  }
  .metric{
    padding: 18px 8px;
    border-right: 1px solid var(--line);
    border-bottom: none;
    min-width: 0;
    text-align: center;
  }
  .metric:last-child{ border-right: none; }
  .metric-label{ display: none; }
  .metric-value strong{
    font-size: 20px;
    white-space: nowrap;
  }
  .metric-value span{
    margin-top: 4px;
    font-size: 10.5px;
    letter-spacing: 0;
    line-height: 1.25;
    white-space: normal;
    text-wrap: balance;
  }
  #metrics{ padding: 0 0 16px; }
}

/* TOP — 3つの強み（左右2分割スティッキーレイアウト） */

.strengths-grid{
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: clamp(40px, 6vw, 80px);
  align-items: start;
}

.strengths-aside{ position: sticky; top: 32px; }

.strengths-eyebrow{
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin: 0 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.strengths-eyebrow::before{ content:""; width:24px; height:1px; background: var(--accent); }

/* .hero-sub を .strengths-aside で流用（黒背景用カラーを上書き） */

.strengths-aside .hero-sub{ margin: 0; color: var(--text-sub); }

.strengths-aside .strengths-aside-note{
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-mute, var(--text-sub));
}

.strengths-list{ display: flex; flex-direction: column; }

.strength-item{
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 28px;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
}

.strength-item:first-child{ padding-top: 0; }

.strength-item:last-child{ border-bottom: none; padding-bottom: 0; }

.strength-num{
  font-family: "JetBrains Mono", monospace;
  font-size: 60px;
  font-weight: 500;
  line-height: 1;
  color: var(--text);
  letter-spacing: -0.02em;
}

.strength-num::after{
  content: ""; display: block;
  width: 24px; height: 2px;
  background: var(--accent);
  margin-top: 14px;
}

.strength-body .strength-kicker{
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin: 0 0 10px;
}

.strength-body h3{
  font-size: 23px;
  font-weight: 700;
  margin: 0 0 14px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}

.strength-body p{
  color: var(--text-sub);
  font-size: 15.5px;
  line-height: 1.9;
  margin: 0;
}

/* =========================================================
   TOP — サービス（エディトリアル縦タイムライン）
   - 左右交互の Z 字レイアウト
   - 中央レール（縦線）+ 大きな番号
   - 各STEP：ビジュアル / メタ / lede / 説明 / リスト / 成果物
   ========================================================= */

/* ---------- フロー全体 ---------- */

.services-flow{
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

/* 中央の縦レール（フェーズを縦に貫く） */

.services-flow::before{
  content: "";
  position: absolute;
  left: 50%;
  top: 24px;
  bottom: 24px;
  width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    var(--line-strong) 0 6px,
    transparent 6px 12px
  );
  transform: translateX(-0.5px);
}

/* ---------- 各STEP（左右交互） ---------- */

.flow-step{
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  align-items: center;
  gap: 0;
  padding: 56px 0;
  position: relative;
}

.flow-step + .flow-step{
  border-top: 0;
}

.flow-step[data-step="01"]{ padding-top: 0; }

.flow-step[data-step="03"]{ padding-bottom: 0; }

/* 奇数 STEP（01, 03）: ビジュアル左 / 本文右 */

.flow-step[data-step="01"] .flow-step-visual,
.flow-step[data-step="03"] .flow-step-visual{ grid-column: 1; grid-row: 1; padding-right: 40px; }

.flow-step[data-step="01"] .flow-step-body,
.flow-step[data-step="03"] .flow-step-body{ grid-column: 3; grid-row: 1; padding-left: 40px; text-align: left; }

/* 偶数 STEP（02）: 本文左 / ビジュアル右 */

.flow-step[data-step="02"] .flow-step-visual{ grid-column: 3; grid-row: 1; padding-left: 40px; }

.flow-step[data-step="02"] .flow-step-body{ grid-column: 1; grid-row: 1; padding-right: 40px; text-align: right; }

.flow-step[data-step="02"] .flow-step-meta{ justify-content: flex-end; }

.flow-step[data-step="02"] .flow-step-list{ text-align: left; }

.flow-step[data-step="02"] .flow-step-deliverable{ text-align: left; }

/* レール（中央） */

.flow-step-rail{
  grid-column: 2;
  grid-row: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  z-index: 2;
}

.flow-step-rail-dot{
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px #fff, 0 0 0 7px rgba(230,0,35,0.25);
  margin-bottom: 12px;
}

.flow-step-num{
  font-size: 64px;
  line-height: 1;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.04em;
  font-family: "JetBrains Mono", monospace;
  background: #fff;
  padding: 4px 8px;
}

/* ---------- ビジュアル ---------- */

.flow-step-visual{
  display: flex;
  align-items: center;
}

.flow-step-visual-frame{
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #fff;
  aspect-ratio: 3 / 2;
}

.flow-step-illust{
  width: 100%;
  height: 100%;
  display: block;
}

.flow-step-tag{
  position: absolute;
  left: 14px;
  bottom: 14px;
  background: #fff;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 2px;
}

/* ---------- 本文 ---------- */

.flow-step-body{
  display: flex;
  flex-direction: column;
  gap: 0;
}

.flow-step-meta{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.flow-step-icon{
  width: 36px;
  height: 36px;
  display: block;
}

.flow-step-label{
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 700;
}

.flow-step-title{
  font-size: clamp(28px, 2.8vw, 34px);
  letter-spacing: 0.04em;
  margin: 0 0 14px;
  font-weight: 700;
  line-height: 1.4;
}

.flow-step-lede{
  font-size: 17px;
  line-height: 1.8;
  margin: 0 0 12px;
  font-weight: 500;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 14px;
}

.flow-step[data-step="02"] .flow-step-lede{
  border-left: 0;
  border-right: 3px solid var(--accent);
  padding-left: 0;
  padding-right: 14px;
}

.flow-step-desc{
  color: var(--text-sub);
  font-size: 15.5px;
  line-height: 2;
  margin: 0 0 24px;
}

/* リスト（dl 形式） */

.flow-step-list{
  margin: 0 0 24px;
  padding: 20px 0 4px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flow-step-list > div{
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) 1.2fr;
  gap: 16px;
  align-items: baseline;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}

.flow-step-list > div:last-child{ border-bottom: none; padding-bottom: 0; }

.flow-step-list dt{
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  position: relative;
  padding-left: 14px;
}

.flow-step-list dt::before{
  content: "";
  position: absolute;
  left: 0; top: 8px;
  width: 6px; height: 6px;
  background: var(--accent);
}

.flow-step-list dd{
  margin: 0;
  font-size: 14px;
  color: var(--text-sub);
  line-height: 1.7;
}

/* 成果物バッジ */

.flow-step-deliverable{
  background: var(--bg-sub);
  border-radius: var(--r);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-left: 3px solid var(--accent);
  flex-wrap: wrap;
}

.flow-step[data-step="02"] .flow-step-deliverable{
  border-left: 0;
  border-right: 3px solid var(--accent);
}

.flow-step-deliverable-label{
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

.flow-step-deliverable-val{
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.02em;
}

/* ---------- セクション下部の注記 ---------- */

.flow-step-note{
  margin: 72px auto 0;
  max-width: 720px;
  padding: 22px 26px;
  background: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--r);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
}

.flow-step-note-mark{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
  border-radius: 2px;
  flex-shrink: 0;
  margin-top: 2px;
}

.flow-step-note p{
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
  color: var(--text);
}

.flow-step-note strong{
  color: var(--accent);
  font-weight: 700;
}

/* ===== レスポンシブ（≤ 767px） =====
   画像を右上へ固定配置し、見出し周辺だけその幅を避けることで表示幅を安定させる。 */

@media (max-width: 767px){
  .services-flow::before{ display: none; }
  .flow-step,
  .flow-step[data-step="01"],
  .flow-step[data-step="02"],
  .flow-step[data-step="03"]{
    display: block;
    position: relative;
    padding: 28px 0;
  }
  .flow-step[data-step="01"]{ padding-top: 0; }
  .flow-step[data-step="03"]{ padding-bottom: 0; }
  .flow-step-rail{ display: none; }
  .flow-step-visual,
  .flow-step[data-step="01"] .flow-step-visual,
  .flow-step[data-step="02"] .flow-step-visual,
  .flow-step[data-step="03"] .flow-step-visual{
    position: absolute;
    top: 28px;
    right: 0;
    width: 96px;
    margin: 0;
    padding: 0;
  }
  .flow-step[data-step="01"] .flow-step-visual{ top: 0; }
  .flow-step-visual-frame{ aspect-ratio: 4 / 3; }
  .flow-step-tag{ display: none; }
  .flow-step-body,
  .flow-step[data-step="01"] .flow-step-body,
  .flow-step[data-step="02"] .flow-step-body,
  .flow-step[data-step="03"] .flow-step-body{
    display: block;
    padding: 0;
    text-align: left;
  }
  .flow-step-meta,
  .flow-step[data-step="02"] .flow-step-meta{
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    margin: 0 108px 6px 0;
  }
  .flow-step-icon{ flex: 0 0 36px; }
  .flow-step-label{
    display: flex;
    align-items: center;
    min-height: 36px;
    flex: 1 1 auto;
  }
  .flow-step-title{
    margin: 0 108px 8px 0;
    min-height: 44px;
  }
  .flow-step[data-step="02"] .flow-step-lede{
    border-left: 3px solid var(--accent);
    border-right: 0;
    padding-left: 14px;
    padding-right: 0;
  }
  .flow-step[data-step="02"] .flow-step-deliverable{
    border-left: 3px solid var(--accent);
    border-right: 0;
  }
  .flow-step-list > div{ grid-template-columns: 1fr; gap: 4px; }
}

/* TOP — 開発実例（黒ボーダー + ハードオフセット影） */

.works-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.works-grid .work-card{
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid #111;
  border-radius: 4px;
  box-shadow: 6px 6px 0 0 #111;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s, box-shadow .15s;
}

.works-grid .work-card-thumb{
  aspect-ratio: 16/9;
  background: #ECECEE;
  border-bottom: 1px solid #111;
  overflow: hidden;
}

.works-grid .work-card-thumb img{ width:100%; height:100%; object-fit:contain; display:block; }

.works-grid .work-card-body{
  padding: 22px 22px 0;
  display: flex; flex-direction: column; flex: 1;
}

.works-grid .work-card-tags{
  display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap;
}

.works-grid .work-card-tag{
  display: inline-block;
  background: #fff;
  color: #111;
  border: 1px solid #111;
  padding: 2px 9px;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.works-grid .work-card-tag.red{ background: var(--accent); color: #fff; border-color: var(--accent); }

.works-grid .work-card-body h3{
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 12px;
  line-height: 1.5;
}

.works-grid .work-card-body p{
  color: var(--text-sub);
  font-size: 14.5px;
  line-height: 1.8;
  margin: 0 0 20px;
  flex: 1;
}

.works-grid .work-card-link{
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  margin-top: auto;
  padding: 16px 22px;
  border-top: 1px solid #111;
}

.works-grid .work-card-link .arrow{ display: inline-block; transition: transform .15s; }

.works-grid .work-card:hover{
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 0 #111;
}

.works-grid .work-card:hover .work-card-link .arrow{ transform: translateX(3px); }

/* TOP — レスポンシブ（≤ 767px） */

@media (max-width: 767px){
  .docs section{ padding: clamp(40px, 9vw, 56px) 0; }
  .section-intro{ margin: 0 0 26px; }
  .section-intro .sec-lead{ margin: 18px 0 0; }
  .strengths-grid{
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .strengths-aside{ position: static; }
  .strengths-eyebrow,
  .strengths-aside-note,
  .strength-body .strength-kicker{ display: none; }
  .strengths-aside .hero-sub{ margin: 0; }
  .strength-item{
    gap: 18px;
    padding: 24px 0;
  }
  .strength-body h3{ margin: 0 0 10px; }
  .strength-num{ font-size: 44px; }
  .strength-num::after{ margin-top: 10px; }
  .works-grid{ grid-template-columns: 1fr; }
  .hero h1{
    font-size: clamp(24px, 6vw, 30px);
    line-height: 1.5;
    margin: 0 0 14px;
  }
  .hero .hero-sub{
    font-size: 14px;
    line-height: 1.8;
    margin: 0;
  }
  .hero .hero-actions{ display: none; }
  .docs section.hero-cta-sp{
    display: block;
    padding: 0;
    border-bottom: none;
  }
  .hero-actions-sp{ padding: 16px 0; }
  .hero-actions-sp .btn{
    min-height: 46px;
    padding: 11px 20px;
    font-size: 14px;
  }
  .hero-actions-sp .btn-ghost{
    color: rgba(17, 24, 39, 0.72);
    border-color: rgba(17, 24, 39, 0.14);
    background: rgba(17, 24, 39, 0.02);
    font-weight: 600;
  }
  /* Hero：縦長paddingを圧縮（背景画像は維持） */
  .hero{ padding: clamp(56px, 14vw, 72px) 0 28px; }
  /* スマホでは作業者の姿が見える左寄りを表示（中央のみだと手元しか映らないため） */
  .hero-bg{ background-position: 50% center; }
}
