/* =========================================================
   株式会社 明誠 — 共通スタイル
   配色の考え方：
   ・ベースは「図面用紙」の白と「墨」の濃紺
   ・アクセントは出来形ヒートマップの「±0（合格）」を表す緑
   ・3D点群（トップ/実績）だけを暗い背景で見せ、他は明るく読みやすく
   ========================================================= */

:root {
    --ink: #0f1c24;          /* 濃紺（見出し・ダーク面） */
    --ink-2: #1a2c36;        /* ダーク面の一段明るい色 */
    --paper: #f4f6f5;        /* 図面用紙のような薄いグレー */
    --white: #ffffff;
    --line: #d8dfdd;         /* 罫線 */
    --text: #1d2a31;         /* 本文 */
    --muted: #5d6d74;        /* 補足テキスト */
    --accent: #16805f;       /* ヒートマップ「合格」の緑 */
    --accent-dark: #0e6248;
    --accent-light: #6fd4ad; /* 暗い背景上で使う緑 */

    --font: "Barlow", "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;

    --wrap: 1180px;
    --gutter: clamp(20px, 5vw, 48px);
    --header-h: 76px;
    --radius: 3px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.9;
    letter-spacing: 0.03em;
    color: var(--text);
    background: var(--white);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "palt" 0;
}

img { max-width: 100%; display: block; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

h1, h2, h3, h4 { color: var(--ink); line-height: 1.45; letter-spacing: 0.04em; margin: 0; font-weight: 700; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.num { font-family: "Barlow", sans-serif; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 300;
    background: var(--ink); color: #fff; padding: 8px 16px; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }

/* ---------------- ヘッダー ---------------- */
.site-header {
    position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 200;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    transition: background 0.3s, border-color 0.3s;
}
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; max-width: 1360px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { height: 36px; width: auto; }
.brand-name { font-size: 1.05rem; font-weight: 700; letter-spacing: 0.12em; line-height: 1.2; }
.brand-name small { display: block; font-size: 0.68rem; font-weight: 500; letter-spacing: 0.06em; color: var(--muted); }

.global-nav ul { display: flex; align-items: center; gap: 36px; list-style: none; margin: 0; padding: 0; }
.global-nav a {
    color: var(--ink); text-decoration: none; font-size: 0.92rem; font-weight: 500;
    padding: 6px 0; border-bottom: 2px solid transparent; transition: border-color 0.2s, color 0.2s;
}
.global-nav a:hover, .global-nav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--ink); }
.global-nav .nav-cta {
    background: var(--accent); color: #fff; padding: 10px 22px; border-radius: var(--radius); border: 0;
}
.global-nav .nav-cta:hover { background: var(--accent-dark); color: #fff; }

/* トップページのヒーロー上ではヘッダーを透明に */
body.has-hero .site-header:not(.is-solid) { background: transparent; border-bottom-color: rgba(255,255,255,0.12); }
body.has-hero .site-header:not(.is-solid) .brand,
body.has-hero .site-header:not(.is-solid) .global-nav a:not(.nav-cta) { color: #fff; }
body.has-hero .site-header:not(.is-solid) .brand-name small { color: rgba(255,255,255,0.65); }

.nav-toggle {
    display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer; padding: 10px;
    color: inherit;
}
.nav-toggle span { display: block; height: 2px; background: currentColor; margin: 6px 0; transition: transform 0.25s, opacity 0.25s; }
body.has-hero .site-header:not(.is-solid) .nav-toggle { color: #fff; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 900px) {
    :root { --header-h: 64px; }
    .brand img { height: 30px; }
    .nav-toggle { display: block; color: var(--ink); }
    .global-nav {
        position: fixed; inset: var(--header-h) 0 auto 0; background: var(--white);
        border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 24px;
        display: none;
    }
    .global-nav.is-open { display: block; }
    .global-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
    .global-nav li { border-bottom: 1px solid var(--line); }
    .global-nav li:last-child { border-bottom: 0; padding-top: 16px; }
    .global-nav a { display: block; padding: 16px 0; border-bottom: 0; font-size: 1rem; }
    .global-nav .nav-cta { text-align: center; }
    body.has-hero .site-header:not(.is-solid) .global-nav a:not(.nav-cta) { color: var(--ink); }
    body.nav-open .site-header { background: var(--white) !important; }
    body.nav-open .site-header .brand { color: var(--ink) !important; }
    body.nav-open .site-header .nav-toggle { color: var(--ink) !important; }
}

/* ---------------- ボタン ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 52px; padding: 0 30px; border-radius: var(--radius);
    font: inherit; font-weight: 700; font-size: 0.95rem; letter-spacing: 0.06em;
    text-decoration: none; cursor: pointer; border: 1px solid transparent;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); color: #fff; }
.btn-ghost { border-color: currentColor; color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.on-dark .btn-ghost { color: #fff; }
.on-dark .btn-ghost:hover { background: #fff; color: var(--ink); border-color: #fff; }

/* ---------------- セクション共通 ---------------- */
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section--paper { background: var(--paper); }
.section--dark { background: var(--ink); color: rgba(255,255,255,0.86); }
.section--dark h2, .section--dark h3 { color: #fff; }

.section-head { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px 64px; align-items: end; margin-bottom: clamp(40px, 6vw, 64px); }
.section-head h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); }
.section-head .en { display: block; font-size: 0.85rem; font-weight: 600; color: var(--accent); letter-spacing: 0.08em; margin-bottom: 10px; }
.section--dark .section-head .en { color: var(--accent-light); }
.section-head p { margin: 0; color: var(--muted); max-width: 38em; }
.section--dark .section-head p { color: rgba(255,255,255,0.7); }
@media (max-width: 800px) { .section-head { grid-template-columns: 1fr; } }

.text-link { font-weight: 700; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 2px; }

/* ---------------- 下層ページの見出し ---------------- */
.page-head {
    padding: calc(var(--header-h) + clamp(56px, 8vw, 96px)) 0 clamp(40px, 6vw, 64px);
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 32px 32px;
    background-position: -1px -1px;
    position: relative;
}
.page-head::after { /* 方眼をうっすら消す */
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(244,246,245,1) 35%, rgba(244,246,245,0.75) 100%);
}
.page-head .wrap { position: relative; z-index: 1; }
.page-head .en { display: block; font-size: 0.9rem; font-weight: 600; color: var(--accent); letter-spacing: 0.08em; margin-bottom: 8px; }
.page-head h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); }
.page-head p { margin: 16px 0 0; color: var(--muted); max-width: 40em; }

.breadcrumb { font-size: 0.8rem; color: var(--muted); margin-bottom: 28px; }
.breadcrumb a { color: var(--muted); }

/* ---------------- お問い合わせ帯 ---------------- */
.contact-band { background: var(--ink); color: rgba(255,255,255,0.85); padding: clamp(64px, 9vw, 104px) 0; }
.contact-band .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.contact-band h2 { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 16px; }
.contact-band p { margin: 0; color: rgba(255,255,255,0.7); }
.contact-ways { display: grid; gap: 0; border-top: 1px solid rgba(255,255,255,0.15); }
.contact-ways a, .contact-ways div {
    display: grid; grid-template-columns: 6.5em 1fr; align-items: baseline; gap: 16px;
    padding: 20px 0; border-bottom: 1px solid rgba(255,255,255,0.15);
    color: #fff; text-decoration: none;
}
.contact-ways a:hover .val { color: var(--accent-light); }
.contact-ways .key { font-size: 0.85rem; color: rgba(255,255,255,0.6); }
.contact-ways .val { font-size: clamp(1.25rem, 2.4vw, 1.75rem); font-weight: 600; transition: color 0.2s; }
.contact-ways .val.small { font-size: 1rem; font-weight: 500; }
@media (max-width: 800px) { .contact-band .wrap { grid-template-columns: 1fr; } }

/* ---------------- フッター ---------------- */
.site-footer { background: #0a141a; color: rgba(255,255,255,0.65); font-size: 0.85rem; padding: 56px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 40px; }
.site-footer .brand { color: #fff; margin-bottom: 16px; }
.site-footer .brand-name small { color: rgba(255,255,255,0.55); }
.site-footer address { font-style: normal; line-height: 1.9; }
.site-footer h3 { color: #fff; font-size: 0.85rem; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: rgba(255,255,255,0.75); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 0.78rem; color: rgba(255,255,255,0.45); }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }

/* ---------------- モーダル（実績・業務共通） ---------------- */
.modal {
    position: fixed; inset: 0; z-index: 500; display: none;
    background: rgba(10, 20, 26, 0.72); padding: 24px; overflow-y: auto;
}
.modal.is-open { display: flex; align-items: flex-start; justify-content: center; }
.modal-panel {
    background: var(--white); width: 100%; max-width: 980px; margin: auto; position: relative;
    padding: clamp(24px, 4vw, 48px); border-radius: var(--radius);
    animation: modalIn 0.3s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.modal-close {
    position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; background: var(--paper);
    border-radius: 50%; cursor: pointer; font-size: 1.4rem; line-height: 1; color: var(--ink);
}
.modal-close:hover { background: var(--line); }
body.modal-open { overflow: hidden; }

/* ---------------- 表示アニメーション（控えめ） ---------------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.8s ease, transform 0.8s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .reveal { opacity: 1; transform: none; } }

/* =========================================================
   遊び心パーツ（標尺スクロールメーター・測点ラベル・踏破メッセージ）
   ========================================================= */
:root {
    --stake: #d6402c;        /* ピンポール・測量杭の赤 */
    --head: "Barlow", "Zen Maru Gothic", "Zen Kaku Gothic New", sans-serif;
}
h1, h2, h3, .brand-name { font-family: var(--head); }

/* 測点ラベル：ページ上端からの距離を路線測量の表記で表示 */
.station {
    display: inline-flex !important; align-items: center; gap: 8px;
    font-family: "Barlow", sans-serif; font-weight: 600; letter-spacing: 0.04em !important;
    font-size: 0.85rem; color: var(--stake) !important; cursor: help;
}
.station::before { /* 小さなピンポール */
    content: ""; width: 4px; height: 16px; border-radius: 2px;
    background: repeating-linear-gradient(180deg, var(--stake) 0 4px, #fff 4px 8px);
    box-shadow: 0 0 0 1px rgba(214,64,44,0.35);
}
.section--dark .station, .contact-band .station { color: #ff8a73 !important; }

/* 標尺（PC：画面右端） */
.staff {
    position: fixed; right: 16px; top: calc(var(--header-h) + 28px); bottom: 28px; width: 10px; z-index: 150;
    border-radius: 2px; box-shadow: 0 0 0 1px rgba(15,28,36,0.15);
    background: repeating-linear-gradient(180deg, var(--stake) 0 var(--seg, 12px), #fff var(--seg, 12px) calc(var(--seg, 12px) * 2));
    opacity: 0.9; pointer-events: none;
}
.staff-marker {
    position: absolute; right: 16px; top: 0; transform: translateY(-50%);
    display: flex; align-items: center; gap: 6px; white-space: nowrap;
    font-family: "Barlow", sans-serif; font-size: 0.78rem; font-weight: 600; color: #fff;
    background: var(--ink); padding: 3px 10px; border-radius: 100px;
    transition: top 0.15s linear;
}
.staff-marker::after { /* 標尺を指す三角 */
    content: ""; position: absolute; right: -6px; top: 50%; transform: translateY(-50%);
    border: 5px solid transparent; border-left-color: var(--ink); border-right: 0;
}
.staff-total { position: absolute; right: 16px; bottom: -6px; font-family: "Barlow", sans-serif; font-size: 0.7rem; color: var(--muted); white-space: nowrap; background: rgba(255,255,255,0.85); padding: 0 6px; border-radius: 4px; }
@media (max-width: 999px) {
    .staff { top: auto; bottom: 14px; left: 14px; right: auto; width: auto; height: auto; background: none; box-shadow: none; opacity: 1; }
    .staff-marker { position: static; transform: none; box-shadow: 0 4px 14px rgba(0,0,0,0.18); }
    .staff-marker::after, .staff-total { display: none; }
    body.nav-open .staff { display: none; }
}

/* 全線踏破メッセージ */
.finish {
    position: fixed; left: 50%; bottom: 24px; z-index: 400; transform: translate(-50%, 140%);
    width: min(92vw, 520px); display: grid; grid-template-columns: 52px 1fr 36px; gap: 14px; align-items: center;
    background: var(--white); color: var(--text); border-radius: 10px; padding: 16px 16px 16px 18px;
    box-shadow: 0 18px 50px rgba(10,20,26,0.28); border-top: 4px solid var(--accent);
    transition: transform 0.5s cubic-bezier(.2,.8,.2,1.2);
}
.finish.is-show { transform: translate(-50%, 0); }
.finish-badge {
    width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.95rem;
    font-family: var(--head);
}
.finish strong { display: block; color: var(--ink); font-family: var(--head); font-size: 1.02rem; line-height: 1.5; }
.finish p { margin: 2px 0 0; font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.finish button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--paper); cursor: pointer; font-size: 1.1rem; color: var(--ink); }
@media (max-width: 999px) { .finish { bottom: 64px; } }

/* お問い合わせ帯のねぎらい */
.contact-thanks { display: block; font-size: 0.9rem; color: rgba(255,255,255,0.7); margin-bottom: 14px; }
.contact-thanks .num { color: #ff8a73; font-weight: 600; font-size: 1.05rem; }

/* 「ひとことで言うと」 */
.oneliner { display: inline-block; font-family: var(--head); font-weight: 700; font-size: 0.85rem; color: var(--stake); margin-bottom: 6px; }

/* 野帳風のひとこと */
.fieldnote {
    position: relative; background: #fffbe8; border: 1px solid #ece3b8; border-radius: 4px;
    padding: 16px 20px 16px 22px; font-size: 0.9rem; color: #5a5233; line-height: 1.8;
    background-image: repeating-linear-gradient(180deg, transparent 0 27px, rgba(150,130,60,0.12) 27px 28px);
}
.fieldnote::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--stake); border-radius: 4px 0 0 4px; }
.station { margin-bottom: 10px; }
.contact-band .station { margin-bottom: 6px; }
.station { display: flex !important; width: fit-content; }
.staff.at-end .staff-total { opacity: 0; }
.footer-note { margin: 0 0 12px; max-width: 60em; line-height: 1.8; }
.footer-note a { color: rgba(255,255,255,0.6); text-decoration: underline; }
