/* =====================================================================
   株式会社 碓井測研 コーポレートサイト
   スタイルシート（デザインシステム）
   ---------------------------------------------------------------------
   設計方針：深緑 × 生成り × 金茶 一点
   ・見出しは明朝（Noto Serif JP）、本文はゴシック（Noto Sans JP）
   ・余白広め、角丸控えめ、演出はフェードイン程度
   ===================================================================== */

/* ---------- 1. デザイントークン ---------- */
:root {
  /* 配色：深緑 × 生成り × 金茶（大地・自然・老舗・柔らかさ） */
  --navy:        #2c4a37;   /* メイン：深緑（少し明るめで柔らかく）※変数名は互換のため踏襲 */
  --navy-deep:   #1e3728;   /* さらに濃い深緑（ヒーロー・フッター等） */
  --brown:       #4d3d31;   /* こげ茶（サブ・見出し文字。黒を使わない温かみ） */
  --paper:       #f6f3ea;   /* ベース：生成り（やや明るく） */
  --paper-2:     #ece5d6;   /* 一段濃い生成り（帯・カード地） */
  --white:       #ffffff;
  --terracotta:  #c47f3d;   /* アクセント：金茶（明るく温かい橙茶）※変数名は互換のため踏襲 */
  --terracotta-d:#a96a2e;   /* ホバー等の濃い金茶 */
  --ink:         #3a352e;   /* 本文（こげ茶寄りの墨色。真っ黒を避け柔らかく） */
  --ink-soft:    #6b6459;   /* 補助テキスト */
  --line:        #ded5c2;   /* 罫線 */

  /* タイポグラフィ */
  --serif: "Shippori Mincho B1", "Noto Serif JP", "Yu Mincho", "游明朝", serif;
  --sans:  "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;

  /* レイアウト（角丸を大きめにして親しみ・柔らかさを出す） */
  --maxw: 1080px;
  --gap: clamp(1rem, 2vw, 1.75rem);
  --section-y: clamp(64px, 9vw, 120px);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 6px rgba(30,55,40,.05), 0 14px 40px rgba(30,55,40,.07);
}

/* ---------- 2. リセット & ベース ---------- */
*,*::before,*::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.9;
  font-size: 16px;
  letter-spacing: .02em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1,h2,h3,h4 { font-family: var(--serif); font-weight: 600; line-height: 1.55; margin: 0; letter-spacing: .06em; }

/* スキップリンク（アクセシビリティ） */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--navy); color: #fff; padding: .6em 1em;
}
.skip-link:focus { left: 0; }

/* ---------- 3. 共通レイアウト ---------- */
.container { width: min(92%, var(--maxw)); margin-inline: auto; }
.section { padding-block: var(--section-y); }
.section--paper2 { background: var(--paper-2); }
.section--navy { background: var(--navy); color: var(--paper); }

.section-head { margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head__en {
  display: block; font-family: var(--sans); font-weight: 700;
  letter-spacing: .28em; font-size: .72rem; text-transform: uppercase;
  color: var(--terracotta);
}
.section-head__ja {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-top: .4rem;
  position: relative; display: inline-block; padding-bottom: .5rem;
}
.section-head__ja::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 48px; height: 3px; background: var(--terracotta);
}
.section--navy .section-head__ja::after { background: var(--terracotta); }

/* ---------- 4. ボタン & 電話CTA ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-weight: 700; padding: .85em 1.6em; border-radius: var(--radius);
  border: 1.5px solid transparent; transition: .2s ease;
}
.btn--primary { background: var(--terracotta); color: #fff; }
.btn--primary:hover { background: var(--terracotta-d); }
.btn--ghost { border-color: var(--paper); color: var(--paper); }
.btn--ghost:hover { background: var(--paper); color: var(--navy); }
.btn--outline { border-color: var(--navy); color: var(--navy); }
.btn--outline:hover { background: var(--navy); color: #fff; }

/* 電話番号ブロック */
.tel-block { text-align: center; }
.tel-block__label { font-size: .85rem; color: var(--ink-soft); letter-spacing: .1em; }
.tel-block__num {
  font-family: var(--sans); font-weight: 800;
  font-size: clamp(2rem, 6vw, 3rem); letter-spacing: .02em;
  color: var(--navy); line-height: 1.2; display: inline-flex; align-items: center; gap: .3em;
}
.section--navy .tel-block__num { color: #fff; }
.tel-block__num svg { width: .8em; height: .8em; }
.tel-block__hours { font-size: .9rem; color: var(--ink-soft); }
.section--navy .tel-block__label,
.section--navy .tel-block__hours { color: #d7dcce; }

/* ---------- 5. ヘッダー ---------- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244,241,232,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .6rem; }
.brand__mark { width: 38px; height: 38px; border-radius: 8px; }
.brand__name { line-height: 1.1; }
.brand__name b { font-family: var(--serif); font-size: 1.05rem; color: var(--navy); display: block; white-space: nowrap; }
.brand__name small { font-size: .6rem; letter-spacing: .18em; color: var(--ink-soft); }

.gnav ul { display: flex; gap: clamp(.8rem, 1.8vw, 1.6rem); align-items: center; }
.gnav a { font-size: .92rem; font-weight: 500; padding: .3em 0; position: relative; }
.gnav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 0; height: 2px;
  background: var(--terracotta); transition: width .25s ease;
}
.gnav a:hover::after { width: 100%; }

.header__tel {
  display: inline-flex; align-items: center; gap: .4em;
  font-weight: 800; color: var(--navy); font-size: 1.05rem;
  border: 1.5px solid var(--navy); border-radius: var(--radius); padding: .4em .9em;
  transition: .2s;
}
.header__tel:hover { background: var(--navy); color: #fff; }
.header__tel svg { width: 1em; height: 1em; }

.nav-toggle { display: none; }

/* ---------- 6. ヒーロー ---------- */
.hero {
  position: relative; color: var(--paper);
  background: var(--navy-deep);
  overflow: hidden;
}
.hero__media {
  position: absolute; inset: 0; z-index: 0;
}
/* 背景写真は桜と古墳が見えるようやや下寄りに配置。文字可読性はグラデーションで確保 */
.hero__media img {
  width: 100%; height: 100%; object-fit: cover;
  object-position: center 62%; opacity: .92;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg,
    rgba(26,49,35,.50) 0%,
    rgba(26,49,35,.72) 45%,
    rgba(26,49,35,.88) 100%);
}
.hero__inner {
  position: relative; z-index: 2;
  padding-block: clamp(90px, 14vw, 180px);
}
.hero__badge {
  display: inline-block; font-size: .78rem; letter-spacing: .18em;
  border: 1px solid rgba(244,241,232,.55); border-radius: 999px;
  padding: .35em 1.1em; margin-bottom: 1.6rem; color: var(--paper);
}
.hero__copy {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.2rem, 7vw, 4.2rem); line-height: 1.5;
  letter-spacing: .08em; margin-bottom: 1.4rem;
}
.hero__copy .accent { color: var(--terracotta); }
.hero__lead { font-size: clamp(.95rem, 2vw, 1.1rem); color: #eef0e6; max-width: 34em; }
.hero__lead b { color: #fff; font-weight: 700; }
.hero__cta {
  margin-top: 2.4rem; display: flex; flex-wrap: wrap; gap: 1rem 1.6rem; align-items: center;
}
.hero__telnum {
  font-family: var(--sans); font-weight: 800; font-size: clamp(1.6rem, 4.5vw, 2.4rem);
  color: #fff; display: inline-flex; align-items: center; gap: .3em;
}
.hero__telnum svg { width: .8em; height: .8em; }
.hero__hours { font-size: .85rem; color: #d7dcce; }

/* ---------- 7. 代表挨拶 ---------- */
.greeting__grid {
  display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}
.greeting__portrait { position: relative; }
.greeting__portrait img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.greeting__body p { margin: 0 0 1.3em; }
.greeting__sign { margin-top: 1.8rem; display: flex; align-items: baseline; gap: .8rem; }
.greeting__sign small { color: var(--ink-soft); font-size: .85rem; }
.greeting__sign b { font-family: var(--serif); font-size: 1.4rem; color: var(--navy); }

/* ---------- 8. 事業内容カード ---------- */
.services__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap);
}
.service-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.4rem, 3vw, 2rem); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 1rem;
}
.service-card__no {
  font-family: var(--sans); font-weight: 800; font-size: 1rem; color: var(--terracotta);
  letter-spacing: .1em;
}
.service-card__icon { width: 40px; height: 40px; color: var(--navy); }
.service-card h3 { font-size: 1.25rem; color: var(--navy); }
.service-card__desc { font-size: .92rem; color: var(--ink-soft); margin: 0; }
.service-card__list { border-top: 1px solid var(--line); padding-top: 1rem; }
.service-card__list li {
  font-size: .88rem; padding: .28em 0 .28em 1.1em; position: relative;
}
.service-card__list li::before {
  content: ""; position: absolute; left: 0; top: .95em;
  width: 6px; height: 6px; background: var(--terracotta); border-radius: 1px;
}

/* ---------- 9. ご依頼の流れ ---------- */
.flow { counter-reset: step; display: grid; gap: 1rem; }
.flow__item {
  display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: start;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
}
.flow__num {
  counter-increment: step; font-family: var(--sans); font-weight: 800;
  width: 46px; height: 46px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-size: .95rem;
}
.flow__num::before { content: "STEP\A" counter(step); white-space: pre; text-align: center; font-size: .5rem; line-height: 1; letter-spacing: .05em; }
.flow__body h3 { font-size: 1.05rem; color: var(--navy); margin-bottom: .2rem; }
.flow__body p { margin: 0; font-size: .9rem; color: var(--ink-soft); }
.flow__note {
  margin-top: 1rem; font-size: .85rem; color: var(--terracotta-d); font-weight: 600;
}

/* ---------- 10. 実績ハイライト ---------- */
.works-highlight__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap);
}
.work-card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; display: flex; flex-direction: column; gap: .7rem;
  box-shadow: var(--shadow);
}
.work-card__tags { display: flex; gap: .5rem; flex-wrap: wrap; }
.tag {
  font-size: .72rem; font-weight: 700; letter-spacing: .04em;
  padding: .25em .8em; border-radius: 999px;
}
.tag--type { background: var(--navy); color: #fff; }
.tag--area { background: var(--paper-2); color: var(--navy); border: 1px solid var(--line); }
.work-card__title { font-family: var(--serif); font-size: 1.05rem; color: var(--navy); }
.work-card__summary { font-size: .86rem; color: var(--ink-soft); margin: 0; }
.work-card__year { font-size: .78rem; color: var(--ink-soft); margin-top: auto; }

.works-meta {
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: center;
  margin: 2.5rem 0 1.2rem; text-align: center;
}
.works-meta__item b { font-family: var(--sans); font-weight: 800; font-size: 1.8rem; color: var(--navy); }
.works-meta__item span { display: block; font-size: .82rem; color: var(--ink-soft); }
.works-note { text-align: center; font-size: .8rem; color: var(--ink-soft); }
.works-highlight__more { text-align: center; margin-top: 2rem; }

/* ---------- 11. FAQ ---------- */
.faq { max-width: 800px; margin-inline: auto; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__q {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  font-family: var(--sans); font-size: 1rem; font-weight: 600; color: var(--navy);
  padding: 1.2rem 2.4rem 1.2rem 2rem; position: relative; line-height: 1.6;
}
.faq__q::before {
  content: "Q"; position: absolute; left: 0; top: 1.2rem;
  font-family: var(--serif); font-weight: 700; color: var(--terracotta);
}
.faq__q::after {
  content: ""; position: absolute; right: .5rem; top: 1.55rem;
  width: 10px; height: 10px; border-right: 2px solid var(--navy); border-bottom: 2px solid var(--navy);
  transform: rotate(45deg); transition: transform .25s;
}
.faq__item[open] .faq__q::after { transform: rotate(-135deg); }
.faq__a {
  padding: 0 2rem 1.4rem 2rem; font-size: .92rem; color: var(--ink-soft); line-height: 1.9;
}
.faq__item summary { list-style: none; }
.faq__item summary::-webkit-details-marker { display: none; }

/* ---------- 12. 会社概要 & アクセス ---------- */
.profile__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
.profile-table { width: 100%; border-collapse: collapse; }
.profile-table th, .profile-table td {
  text-align: left; padding: .95rem .5rem; border-bottom: 1px solid var(--line);
  font-size: .92rem; vertical-align: top;
}
.profile-table th { width: 34%; color: var(--navy); font-weight: 700; white-space: nowrap; }
.profile-table td { color: var(--ink); }

.access__map {
  width: 100%; aspect-ratio: 4/3; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--paper-2);
}
.access__map iframe { width: 100%; height: 100%; border: 0; }
.access__info { margin-top: 1.2rem; font-size: .9rem; }
.access__info dt { font-weight: 700; color: var(--navy); margin-top: .8rem; }
.access__info dd { margin: .2rem 0 0; color: var(--ink-soft); }

/* ---------- 13. 最終CTA ---------- */
.final-cta { text-align: center; }
.final-cta h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); margin-bottom: 1rem; }
.final-cta p { color: #d7dcce; margin: 0 0 2rem; }
.final-cta .tel-block__num { margin-bottom: .4rem; }

/* ---------- 14. フッター ---------- */
.footer { background: var(--navy-deep); color: #cdd2c2; }
.footer__inner {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem;
  padding-block: clamp(2.5rem, 6vw, 4rem);
}
.footer__brand b { font-family: var(--serif); color: #fff; font-size: 1.15rem; display: block; margin-bottom: .5rem; }
.footer__brand p { margin: .2rem 0; font-size: .86rem; }
.footer h4 { color: #fff; font-family: var(--sans); font-size: .82rem; letter-spacing: .16em; margin-bottom: 1rem; }
.footer__menu li { margin-bottom: .55rem; }
.footer__menu a { font-size: .88rem; }
.footer__menu a:hover { color: var(--terracotta); }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.12); padding-block: 1.2rem;
  text-align: center; font-size: .78rem; color: #96a08a;
}

/* ---------- 15. 写真プレースホルダ ---------- */
.ph {
  position: relative; background:
    repeating-linear-gradient(45deg, #e6ddca 0 12px, #ede5d3 12px 24px);
  border: 1px dashed #bcae90; border-radius: var(--radius);
  display: grid; place-items: center; text-align: center; color: #8a7c5c;
  min-height: 240px; padding: 1.5rem;
}
.ph__label { font-size: .82rem; line-height: 1.7; max-width: 30em; }
.ph__label b { display: block; color: #6b5f42; font-family: var(--serif); font-size: .95rem; margin-bottom: .4rem; }
.ph__tag {
  position: absolute; top: .6rem; left: .6rem; background: var(--terracotta); color: #fff;
  font-size: .66rem; font-weight: 700; letter-spacing: .08em; padding: .25em .7em; border-radius: 999px;
}
.greeting__portrait .ph { aspect-ratio: 3/4; min-height: 0; }
.hero__media .ph { min-height: 100%; border-radius: 0; border: 0; }

/* ---------- 16. パンくず（下層） ---------- */
.breadcrumb { font-size: .8rem; color: var(--ink-soft); padding-block: 1.2rem 0; }
.breadcrumb a:hover { color: var(--terracotta); }
.breadcrumb span { margin: 0 .4em; }

/* 下層ページのページタイトル */
.page-hero { background: var(--navy); color: var(--paper); padding-block: clamp(2.5rem, 6vw, 4rem); }
.page-hero__en { display: block; letter-spacing: .28em; font-size: .72rem; color: var(--terracotta); font-weight: 700; }
.page-hero h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); margin-top: .4rem; }
.page-hero p { color: #d7dcce; margin: 1rem 0 0; font-size: .92rem; max-width: 40em; }

/* ---------- 17. 実績フィルタ（works） ---------- */
.filter { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2.5rem; }
.filter__row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.filter__label { font-size: .82rem; font-weight: 700; color: var(--navy); min-width: 4.5em; }
.chip {
  font-size: .84rem; font-weight: 600; padding: .4em 1em; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--white); color: var(--ink-soft);
  cursor: pointer; transition: .18s;
}
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.works-count { font-size: .85rem; color: var(--ink-soft); margin-bottom: 1.2rem; }
.works-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.works-empty { text-align: center; color: var(--ink-soft); padding: 3rem 0; grid-column: 1/-1; }

/* ---------- 18. フェードイン演出 ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 19. レスポンシブ ---------- */
@media (max-width: 860px) {
  .services__grid,
  .works-highlight__grid,
  .works-grid { grid-template-columns: 1fr 1fr; }
  .profile__grid { grid-template-columns: 1fr; }
  .greeting__grid { grid-template-columns: 1fr; }
  .greeting__portrait { max-width: 320px; margin-inline: auto; }
  .footer__inner { grid-template-columns: 1fr 1fr; }
}
/* ナビ項目が7つあり、960px以下では横並びが窮屈になるためハンバーガーへ切替 */
@media (max-width: 960px) {
  .gnav { display: none; }
  .nav-toggle {
    display: inline-grid; place-items: center; width: 44px; height: 44px;
    background: none; border: 0; cursor: pointer;
  }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    content: ""; display: block; width: 24px; height: 2px; background: var(--navy); position: relative;
  }
  .nav-toggle span::before { position: absolute; top: -7px; }
  .nav-toggle span::after { position: absolute; top: 7px; }
  /* モバイルナビ（開時） */
  .gnav.is-open {
    display: block; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 1rem 0;
  }
  .gnav.is-open ul { flex-direction: column; align-items: stretch; gap: 0; }
  /* display:block で区切り線を全幅に揃える（インラインだと文字幅で不揃いになる） */
  .gnav.is-open a { display: block; padding: .9em 6%; border-bottom: 1px solid var(--line); }
  .gnav.is-open li:last-child a { border-bottom: 0; }
  .gnav.is-open a::after { display: none; }
}
@media (max-width: 640px) {
  .header__tel { display: none; }
  .services__grid,
  .works-highlight__grid,
  .works-grid { grid-template-columns: 1fr; }
  .footer__inner { grid-template-columns: 1fr; }
  .hero__cta { flex-direction: column; align-items: flex-start; }
}
