/* =========================================================
   株式会社ハシゴロジ コーポレートサイト（リニューアル版）
   ロゴに合わせたモノトーン基調に、線・ボタンだけブランドカラーを差す
   ========================================================= */

:root {
  --ink: #1c1c1c;          /* 本文・見出し */
  --ink-2: #4a4a4a;        /* 補足テキスト */
  --ink-3: #8a8a8a;        /* 日付・ラベル */
  --line: #dcdcd8;         /* 区切り線 */
  --bg: #ffffff;
  --bg-2: #f3f3f1;         /* 交互セクションの背景 */
  --dark: #2b2b2b;

  /* ブランドカラー（ロゴのグラデーションから） */
  --navy: #0a2140;         /* 濃藍：ボタン・CTA・フッター */
  --navy-d: #071a33;
  --teal: #3f6b70;         /* 藍緑：線・番号・矢印 */
  --mint: #8fbea8;         /* 浅葱：濃い背景上の差し色 */
  --mint-l: #eaf3ee;       /* 浅葱の淡色：ホバー背景・タグ */
  --brand-grad: linear-gradient(135deg, #3f6b70 0%, #1e3f52 40%, #0a2140 100%);

  --font-ja: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --font-en: "Libre Baskerville", "Times New Roman", serif;

  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --hd-h: 84px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ja);
  font-size: 16px;
  line-height: 1.9;
  letter-spacing: .04em;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, figure { margin: 0; }

.wrap { max-width: calc(var(--wrap) + var(--gutter) * 2); margin: 0 auto; padding: 0 var(--gutter); }
.pc { display: inline; }
@media (max-width: 767px) { .pc { display: none; } }

/* 右向き矢印（線で描く） */
.arw {
  position: relative;
  display: inline-block;
  width: 18px; height: 1px;
  background: currentColor;
  transition: transform .3s var(--ease);
}
.arw::after {
  content: "";
  position: absolute; right: 0; top: -3px;
  width: 7px; height: 7px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: rotate(45deg);
}

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  height: 46px; padding: 0 22px;
  font-size: 14px; font-weight: 500; letter-spacing: .06em;
  border-radius: 4px;
  transition: background-color .3s, color .3s, border-color .3s;
}
.btn-ghost { border: 1px solid currentColor; }
.btn-solid { background: var(--teal); color: #fff; border: 1px solid var(--teal); }
.btn-solid:hover { background: var(--navy); border-color: var(--navy); }
.btn:hover .arw { transform: translateX(4px); }

/* =========================================================
   ヘッダー
   FV上では透明・白文字。スクロール後は白背景・黒文字
   ========================================================= */
.hd {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  /* ノッチや上部のステータスバーと重ならないよう、安全領域の分だけ下げる */
  height: calc(var(--hd-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  color: #fff;
  transition: background-color .35s, color .35s, box-shadow .35s;
}
.hd-in {
  height: 100%;
  display: flex; align-items: center; gap: 40px;
  padding: 0 var(--gutter);
}
.hd-logo { position: relative; flex-shrink: 0; width: 210px; }
.hd-logo img { width: 100%; height: auto; transition: opacity .35s; }
.hd-logo .logo-b { position: absolute; inset: 0; opacity: 0; }
.hd-nav { margin-left: auto; display: flex; gap: 36px; font-size: 14px; font-weight: 500; }
.hd-nav a { position: relative; padding: 6px 0; }
.hd-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 100%; height: 2px; background: var(--mint);
  transform: scaleX(0); transform-origin: right;
  transition: transform .35s var(--ease);
}
.hd-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.hd-cta { display: flex; gap: 12px; }
.hd .btn-ghost:hover { background: rgba(255, 255, 255, .12); }

.hd.is-solid {
  background: rgba(255, 255, 255, .96);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
  backdrop-filter: blur(8px);
}
.hd.is-solid .hd-nav a::after { background: var(--teal); }
.hd.is-solid .logo-w { opacity: 0; }
.hd.is-solid .logo-b { opacity: 1; }
.hd.is-solid .btn-ghost:hover { background: var(--mint-l); }
.hd.is-solid .btn-ghost { color: var(--navy); }
.hd.is-solid .btn-solid { background: var(--navy); border-color: var(--navy); }
.hd.is-solid .btn-solid:hover { background: var(--teal); border-color: var(--teal); }

/* スマホ用メニューボタン */
.hd-menu {
  display: none;
  margin-left: auto;
  width: 44px; height: 44px; padding: 0;
  background: none; border: 0; color: inherit; cursor: pointer;
  position: relative;
}
.hd-menu span {
  position: absolute; left: 10px; right: 10px; height: 1.5px;
  background: currentColor;
  transition: transform .3s var(--ease), top .3s var(--ease);
}
.hd-menu span:nth-child(1) { top: 17px; }
.hd-menu span:nth-child(2) { top: 26px; }
.hd-menu[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.hd-menu[aria-expanded="true"] span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

.drawer {
  position: fixed; inset: 0; z-index: 40;
  padding: calc(var(--hd-h) + env(safe-area-inset-top, 0px) + 24px) var(--gutter) 40px;
  background: var(--navy); color: #fff;
}
.drawer nav { display: flex; flex-direction: column; }
.drawer a {
  padding: 18px 0;
  font-size: 18px; font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, .15);
}
body.is-menu-open { overflow: hidden; }
body.is-menu-open .hd { background: transparent; color: #fff; box-shadow: none; }
body.is-menu-open .hd .logo-w { opacity: 1; }
body.is-menu-open .hd .logo-b { opacity: 0; }

@media (max-width: 1023px) {
  :root { --hd-h: 64px; }
  .hd-nav, .hd-cta { display: none; }
  .hd-menu { display: block; }
  .hd-logo { width: 160px; }
  /* スマホではFVの上でもヘッダーの帯が分かるよう、半透明の濃い背景を敷く */
  .hd:not(.is-solid) {
    background: rgba(28, 28, 28, .45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
}

/* =========================================================
   FV：画像スライドショー＋グレーの粒子感ある透過
   ========================================================= */
.fv {
  position: relative;
  height: 100vh; height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: #3a3a3a;
  color: #fff;
}
.fv-slides, .fv-slide, .fv-tint, .fv-grain { position: absolute; inset: 0; }
/* スライドの重なり順（z-index）をこの箱の中に閉じ込め、透過レイヤーとコピーより下に置く */
.fv-slides { z-index: 0; }
/* 切り替え：次の画像を前の画像の上に重ねてフェードインさせる。
   前の画像（.is-leaving）は不透明のまま下に残し、ズームも止めないので、途中で揺れたり暗くなったりしない */
.fv-slide {
  opacity: 0;
  z-index: 0;
}
.fv-slide.is-leaving { opacity: 1; z-index: 1; }
.fv-slide.is-active { opacity: 1; z-index: 2; transition: opacity 1.6s ease-in-out; }
.fv-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* 写真をグレートーンに寄せる */
  filter: grayscale(.85) contrast(.95) brightness(.9);
  transform: scale(1.08);
  will-change: transform;
  backface-visibility: hidden;
}
/* 表示中の1枚だけゆっくり寄る */
.fv-slide.is-active img, .fv-slide.is-leaving img { animation: fv-zoom 9s linear forwards; }
@keyframes fv-zoom { from { transform: scale(1.08); } to { transform: scale(1); } }

/* グレーの半透明レイヤー。上下を少し濃くしてヘッダーと文字を読みやすくする */
.fv-tint {
  background:
    linear-gradient(180deg, rgba(40, 40, 40, .45) 0%, rgba(40, 40, 40, 0) 22%),
    linear-gradient(0deg, rgba(40, 40, 40, .35) 0%, rgba(40, 40, 40, 0) 30%),
    rgba(60, 60, 60, .55);
}
/* 粒子（グレイン）。ノイズ画像をタイル状に重ねる */
.fv-grain {
  background: url("../assets/grain.png") repeat;
  background-size: 160px 160px;
  opacity: .22;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.fv-copy {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0 var(--gutter);
  font-size: clamp(30px, 5.4vw, 76px);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .06em;
  text-align: center;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .25);
  white-space: nowrap;
}
.fv-copy .q { letter-spacing: 0; }
/* スマホでは「社会を繋ぐ／”ハシゴ”をかける」の2行に分ける */
@media (max-width: 600px) {
  .fv-copy { flex-direction: column; font-size: clamp(30px, 9.6vw, 44px); line-height: 1.5; }
}

.fv-scroll {
  position: absolute; right: var(--gutter); bottom: 32px;
  font-family: var(--font-en); font-size: 11px; letter-spacing: .2em;
  writing-mode: vertical-rl;
  padding-bottom: 64px;
}
.fv-scroll::after {
  content: ""; position: absolute; left: 50%; bottom: 0;
  width: 1px; height: 52px; background: rgba(255, 255, 255, .5);
  animation: fv-scroll 2.2s var(--ease) infinite;
  transform-origin: top;
}
@keyframes fv-scroll {
  0% { transform: scaleY(0); }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

@media (prefers-reduced-motion: reduce) {
  .fv-slide.is-active { transition: none; }
  .fv-slide.is-active img, .fv-slide.is-leaving img, .fv-scroll::after { animation: none; transform: none; }
}

/* =========================================================
   セクション共通
   ========================================================= */
.sec { padding: clamp(88px, 12vw, 160px) 0; }
.sec-head { margin-bottom: clamp(40px, 6vw, 72px); }
.eyebrow {
  display: flex; align-items: center; gap: 22px;
  margin-bottom: 28px;
  font-family: var(--font-en);
  font-size: clamp(22px, 2.4vw, 30px); letter-spacing: .1em;
  color: var(--ink-2);
}
.eyebrow .no {
  font-size: clamp(18px, 1.8vw, 22px);
  color: var(--teal);
  padding-right: 22px;
  border-right: 1px solid var(--teal);
}
.h2 {
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700; line-height: 1.5; letter-spacing: .06em;
}
.h3 { font-size: 20px; font-weight: 700; letter-spacing: .06em; }

/* スクロールで表示 */
.rv { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.rv.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rv { opacity: 1; transform: none; transition: none; } }

/* ---------- ビジョン補足 ---------- */
.vision-body { max-width: 940px; }
.vision-lead {
  margin-bottom: 40px;
  font-size: clamp(26px, 3.6vw, 44px);
  font-weight: 700; line-height: 1.5; letter-spacing: .08em;
}
.vision-text {
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 2.2;
  color: var(--ink-2);
}
.vision-text + .vision-text { margin-top: 24px; }

/* ---------- サービス ---------- */
.service { background: var(--bg-2); }
.biz-list { display: flex; flex-direction: column; gap: clamp(48px, 6vw, 80px); }
.biz {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}
.biz-visual { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: #ccc; }
/* 写真は画面に入るとモノクロからカラーに変わる（.rv.is-in は main.js が付与） */
.biz-visual img, .msg-photo img {
  width: 100%; height: 100%; object-fit: cover;
  filter: grayscale(1);
  transition: filter 1.6s ease .5s, transform 1.2s var(--ease);
}
.biz.is-in .biz-visual img, .msg-photo.is-in img { filter: grayscale(0); }
.biz:hover .biz-visual img { transform: scale(1.03); }
.biz-no {
  position: absolute; left: 20px; bottom: 14px;
  font-family: var(--font-en); font-size: 40px; color: #fff; line-height: 1;
  text-shadow: 0 1px 12px rgba(0, 0, 0, .3);
}
.biz-en { font-family: var(--font-en); font-size: 13px; letter-spacing: .14em; color: var(--teal); }
.biz-title {
  margin: 6px 0 24px;
  font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; letter-spacing: .08em;
}
.svc-list { border-top: 2px solid var(--teal); }
.svc-list li { border-bottom: 1px solid var(--line); }
.svc {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 24px;
  padding: 26px 8px 26px 0;
  transition: background-color .3s, padding .3s var(--ease);
}
.svc-name { font-size: 18px; font-weight: 700; letter-spacing: .06em; transition: color .3s; }
.svc-desc { grid-column: 1; font-size: 14px; line-height: 1.9; color: var(--ink-2); }
.svc .arw { grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 28px; color: var(--teal); }
.svc:hover { background: #fff; padding-left: 16px; padding-right: 16px; box-shadow: inset 3px 0 0 var(--teal); }
.svc:hover .svc-name { color: var(--teal); }
.svc:hover .arw { transform: translateX(4px); }

@media (max-width: 767px) {
  .biz { grid-template-columns: 1fr; }
  .biz-visual { aspect-ratio: 16 / 9; }
}

/* ---------- 代表メッセージ ---------- */
.msg {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 7fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}
.msg-photo { aspect-ratio: 4 / 5; overflow: hidden; border-radius: 4px; background: var(--bg-2); }
.msg-lead {
  font-size: clamp(16px, 1.5vw, 18px);
  font-weight: 700; line-height: 2.1; letter-spacing: .06em;
}
.msg-name {
  margin-top: 32px;
  font-size: 18px; font-weight: 700; letter-spacing: .14em;
}
.msg-name .role {
  display: block;
  margin-bottom: 2px;
  font-size: 12px; font-weight: 500; letter-spacing: .1em; color: var(--teal);
}
.msg-career { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--teal); }
.msg-career-h { margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--ink-2); }
.msg-career p:not(.msg-career-h) { font-size: 13px; line-height: 2; color: var(--ink-2); }

@media (max-width: 767px) {
  .msg { grid-template-columns: 1fr; }
  .msg-photo { max-width: 320px; }
}

/* ---------- ニュース｜ブログ ---------- */
.posts { background: var(--bg-2); }
.posts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 88px);
}
.post-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--teal);
}
.more { display: inline-flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 500; color: var(--teal); }
.more:hover .arw { transform: translateX(4px); }
.post-list li { border-bottom: 1px solid var(--line); }
.post-list a {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  gap: 4px 16px;
  padding: 20px 0;
  transition: opacity .3s;
}
.post-list a:hover .ttl { color: var(--teal); text-decoration: underline; text-underline-offset: 4px; }
.post-list time { font-family: var(--font-en); font-size: 13px; color: var(--ink-3); letter-spacing: .06em; }
.post-list .tag {
  font-size: 11px; line-height: 1;
  padding: 5px 8px;
  border: 0; border-radius: 2px;
  color: var(--teal);
  background: var(--mint-l);
  white-space: nowrap;
}
.post-list .ttl {
  grid-column: 1 / -1;
  font-size: 15px; line-height: 1.7;
}

@media (max-width: 899px) { .posts-grid { grid-template-columns: 1fr; } }

/* ---------- 資料請求｜お問い合わせ ---------- */
.cta {
  position: relative;
  padding: clamp(72px, 9vw, 120px) 0;
  background: var(--brand-grad);
  color: #fff;
  overflow: hidden;
}
.cta-grain {
  position: absolute; inset: 0;
  background: url("../assets/grain.png") repeat;
  background-size: 160px 160px;
  opacity: .12; mix-blend-mode: overlay;
  pointer-events: none;
}
.cta-grid {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.cta-card {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 260px;
  padding: clamp(32px, 4vw, 52px);
  border: 1px solid rgba(143, 190, 168, .55);
  border-radius: 4px;
  background: rgba(255, 255, 255, .04);
  transition: background-color .4s, color .4s, border-color .4s;
}
.cta-en { font-family: var(--font-en); font-size: 13px; letter-spacing: .16em; color: var(--mint); }
.cta-ttl { margin-top: 10px; font-size: clamp(28px, 3.4vw, 40px); font-weight: 700; letter-spacing: .08em; }
.cta-desc { margin-top: auto; padding-top: 24px; padding-right: 72px; font-size: 14px; opacity: .8; }
.cta-arw {
  position: absolute; right: clamp(32px, 4vw, 52px); bottom: clamp(32px, 4vw, 52px);
  width: 56px; height: 56px;
  border: 1px solid var(--mint); border-radius: 50%;
  color: var(--mint);
  transition: transform .4s var(--ease), background-color .4s, color .4s;
}
.cta-arw::before, .cta-arw::after { content: ""; position: absolute; top: 50%; left: 50%; }
.cta-arw::before { width: 18px; height: 1px; background: currentColor; transform: translate(-50%, -50%); }
.cta-arw::after {
  width: 7px; height: 7px;
  border-top: 1px solid currentColor; border-right: 1px solid currentColor;
  transform: translate(1px, -50%) rotate(45deg);
}
.cta-card:hover { background: #fff; color: var(--navy); border-color: #fff; }
.cta-card:hover .cta-en { color: var(--teal); }
.cta-card:hover .cta-arw { background: var(--navy); border-color: var(--navy); color: #fff; }
.cta-card:hover .cta-arw { transform: translateX(6px); }

@media (max-width: 767px) {
  .cta-grid { grid-template-columns: 1fr; }
  .cta-card { min-height: 200px; }
}

/* =========================================================
   フッター
   ========================================================= */
.ft {
  padding: 72px 0 40px;
  background: var(--navy-d);
  color: rgba(255, 255, 255, .85);
  font-size: 14px;
}
.ft-top {
  display: flex; justify-content: space-between; gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.ft-logo { width: 200px; flex-shrink: 0; }
.ft-nav { display: flex; gap: clamp(32px, 6vw, 88px); }
.ft-col { display: flex; flex-direction: column; gap: 12px; }
.ft-col a { color: rgba(255, 255, 255, .65); transition: color .3s; }
.ft-col a.ft-h { color: #fff; font-weight: 500; }
.ft-col a.ft-h + a:not(.ft-h) { margin-top: 2px; }
.ft-col a:hover { color: #fff; }
.ft-copy { margin-top: 28px; font-family: var(--font-en); font-size: 12px; letter-spacing: .08em; color: rgba(255, 255, 255, .5); }

@media (max-width: 899px) {
  .ft-top { flex-direction: column; }
  .ft-nav { flex-wrap: wrap; gap: 32px 48px; }
}

/* ---------- ヘッダー：サービスのドロップダウン ---------- */
.nav-dd { position: relative; display: flex; align-items: center; }
.nav-dd-panel {
  position: absolute; top: 100%; left: 50%;
  padding-top: 18px; /* マウスがパネルへ移る間に閉じないよう、上に余白を取る */
  transform: translate(-50%, 8px);
  opacity: 0; visibility: hidden;
  transition: opacity .25s, transform .25s var(--ease), visibility .25s;
}
.nav-dd:hover .nav-dd-panel, .nav-dd:focus-within .nav-dd-panel {
  opacity: 1; visibility: visible; transform: translate(-50%, 0);
}
.nav-dd-in {
  display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: 8px 28px;
  padding: 26px 28px 20px;
  background: #fff; color: var(--ink);
  border-radius: 4px; border-top: 3px solid var(--teal);
  box-shadow: 0 16px 40px rgba(10, 33, 64, .18);
}
.nav-dd-h { margin-bottom: 8px; font-size: 13px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.nav-dd-h span { display: block; font-family: var(--font-en); font-size: 11px; font-weight: 400; letter-spacing: .14em; color: var(--teal); }
.hd-nav .nav-dd-panel a { padding: 0; }
.hd-nav .nav-dd-panel a::after { display: none; }
.nav-dd-col li a {
  display: block; padding: 7px 0 !important;
  font-size: 14px; font-weight: 500; white-space: nowrap;
  border-bottom: 1px solid var(--line);
  transition: color .2s, padding-left .2s;
}
.nav-dd-col li a:hover { color: var(--teal); padding-left: 4px !important; }
.nav-dd-all {
  grid-column: 1 / -1; justify-self: end;
  display: inline-flex !important; align-items: center; gap: 10px;
  margin-top: 8px; font-size: 13px; color: var(--teal);
}
.nav-dd-all:hover .arw { transform: translateX(4px); }

/* スマホメニュー：サービスの下の6サービス */
.drawer-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; padding: 4px 0 12px; border-bottom: 1px solid rgba(255, 255, 255, .15); }
.drawer .drawer-sub a { padding: 10px 0 10px 14px; font-size: 14px; font-weight: 400; border-bottom: 0; color: rgba(255, 255, 255, .8); position: relative; }
.drawer .drawer-sub a::before { content: ""; position: absolute; left: 0; top: 50%; width: 6px; height: 1px; background: var(--mint); }
.drawer nav > a:first-child { border-bottom: 0; }
.drawer { overflow-y: auto; }
