/* =====================================================
   Team ER — common stylesheet
   responsive-base.css を取り込んで構築
   ===================================================== */

/* ===== reset ===== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
img { max-width: 100%; height: auto; display: block; object-fit: cover; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ===== テキスト改行（日本語対応）===== */
html { scroll-behavior: smooth; }
body {
  line-break: strict;
  overflow-wrap: break-word;
  word-break: auto-phrase;
}
h1, h2, h3, h4, h5, h6 { text-wrap: balance; line-height: 1.4; }
p { text-wrap: pretty; }

/* ===== CSS変数 ===== */
:root {
  /* breakpoints */
  --bp-sm:  480px;
  --bp-md:  768px;
  --bp-lg: 1024px;
  --bp-xl: 1280px;

  /* palette : qando風 白基調ミニマル + 緊急アクセント */
  --bg:        #ffffff;
  --bg-soft:   #f5f4f1;
  --ink:       #1a1a1a;
  --ink-soft:  #5a5a5a;
  --line:      #e5e3df;
  --accent:    #e8521f;   /* 緊急CTA・オレンジ赤 */
  --accent-dk: #c63f12;
  --green:     #2f8f6f;   /* 既存ブランドの名残 / サブ */

  --header-h:  72px;
  --radius:    10px;
  --shadow:    0 8px 30px rgba(0,0,0,.08);

  --font: "Noto Sans JP","Hiragino Kaku Gothic ProN","Yu Gothic",sans-serif;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: clamp(15px, 1.1vw, 17px);
  line-height: 1.9;
  letter-spacing: .02em;
  -webkit-font-smoothing: antialiased;
}

/* ===== layout ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 64px);
}
.section { padding: clamp(56px, 8vw, 120px) 0; }
.section--soft { background: var(--bg-soft); }
.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px,100%), 1fr));
  gap: clamp(16px, 2.5vw, 32px);
}

/* ===== section heading ===== */
.sec-head { text-align: center; margin-bottom: clamp(32px, 5vw, 56px); }
.sec-head__en {
  display: block;
  font-size: clamp(11px, 1.4vw, 13px);
  letter-spacing: .35em;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}
.sec-head__ja {
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: .04em;
}
.sec-head__lead {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: clamp(14px, 1.4vw, 16px);
}

/* ===== buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 32px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: .04em;
  transition: transform .2s, box-shadow .2s, background .2s;
  min-height: 52px;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--tel { background: var(--accent); color: #fff; box-shadow: 0 8px 24px rgba(232,82,31,.35); }
.btn--tel:hover { background: var(--accent-dk); transform: translateY(-2px); }
.btn--line { background: #06c755; color: #fff; }
.btn--line:hover { transform: translateY(-2px); }
.btn--form { background: var(--ink); color: #fff; }
.btn--form:hover { transform: translateY(-2px); }
.btn--ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }

/* ===== header ===== */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
}
.header__inner {
  width: 100%; max-width: 1280px; margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px);
  display: flex; align-items: center; justify-content: space-between;
}
.logo { font-weight: 800; font-size: clamp(20px,2.2vw,24px); letter-spacing: .06em; }
.logo span { color: var(--accent); }
.gnav ul { display: flex; align-items: center; gap: clamp(16px, 2vw, 30px); }
.gnav a { font-size: 14px; font-weight: 600; position: relative; }
.gnav a::after {
  content:""; position:absolute; left:0; bottom:-6px; width:0; height:2px;
  background: var(--accent); transition: width .25s;
}
.gnav a:hover::after { width: 100%; }
.gnav .gnav__cta {
  background: var(--accent); color:#fff; padding: 10px 20px; border-radius: 999px;
}
.gnav .gnav__cta::after { display:none; }
.gnav .gnav__cta:hover { background: var(--accent-dk); }
.hamburger { display:none; width:44px; height:44px; border:0; background:none; cursor:pointer; }
.hamburger span { display:block; width:26px; height:2px; background:var(--ink); margin:6px auto; transition:.3s; }

/* ===== hero (qando風 : フルスクリーン + 中央大テキスト) ===== */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; color:#fff; overflow:hidden;
  padding: var(--header-h) 16px 0;
}
.hero__bg {
  position:absolute; inset:0; z-index:-2;
  background:
    linear-gradient(120deg,#1a2a2a 0%, #14302a 50%, #0f2420 100%);
}
.hero__bg::after {
  content:""; position:absolute; inset:0;
  background: radial-gradient(circle at 70% 30%, rgba(232,82,31,.18), transparent 55%);
}
.hero__title {
  font-size: clamp(52px, 13vw, 150px);
  font-weight: 800; letter-spacing: .04em; line-height: 1;
}
.hero__title span { color: var(--accent); }
.hero__sub {
  margin-top: 24px; font-size: clamp(15px, 2.4vw, 24px); font-weight: 600;
  letter-spacing: .12em;
}
.hero__lead { margin-top: 14px; font-size: clamp(13px,1.6vw,16px); opacity:.85; }
.hero__scroll {
  position:absolute; bottom: 24px; left:50%; transform:translateX(-50%);
  font-size:11px; letter-spacing:.2em; opacity:.7;
}

/* ===== hero WebGL canvas ===== */
.hero__canvas {
  position:absolute; inset:0; width:100%; height:100%; z-index:-1;
  opacity:0; transition: opacity 1.4s ease;
}
.hero.ready .hero__canvas { opacity:1; }

/* hero テキストはsplash中は伏せ、起動後にふわっと表示 */
.hero__title, .hero__sub, .hero__lead, .hero__scroll {
  opacity:0; transform: translateY(18px);
  transition: opacity 1s ease, transform 1s ease;
}
.hero.ready .hero__title { opacity:1; transform:none; transition-delay:.15s; }
.hero.ready .hero__sub   { opacity:1; transform:none; transition-delay:.4s; }
.hero.ready .hero__lead  { opacity:1; transform:none; transition-delay:.6s; }
.hero.ready .hero__scroll{ opacity:.7; transform:translateX(-50%); transition-delay:.9s; }

/* ===== splash ===== */
.splash {
  position:fixed; inset:0; z-index:300;
  background: radial-gradient(circle at 50% 45%, #173029, #0c1c18 70%);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:28px;
  transition: opacity .9s ease, visibility .9s ease;
}
.splash.hide { opacity:0; visibility:hidden; pointer-events:none; }
.splash__logo {
  color:#fff; font-weight:800; letter-spacing:.06em;
  font-size: clamp(40px, 9vw, 96px); line-height:1;
  opacity:0; transform: scale(.94);
  animation: splashLogo 1.1s cubic-bezier(.2,.7,.2,1) forwards;
}
.splash__logo span { color: var(--accent); }
.splash__bar {
  width: clamp(160px, 30vw, 260px); height:3px; border-radius:999px;
  background: rgba(255,255,255,.15); overflow:hidden;
}
.splash__bar i {
  display:block; height:100%; width:0; border-radius:999px; background: var(--accent);
  animation: splashBar 2s ease forwards;
}
@keyframes splashLogo { to { opacity:1; transform:scale(1); } }
@keyframes splashBar  { to { width:100%; } }

/* =====================================================
   hero (MER風 / 白背景・大型タイポ)
   ===================================================== */
/* ファーストビュー：hero＋緊急CTA帯を1画面(100svh)に収める */
.firstview { display: flex; flex-direction: column; }
@media screen and (min-width: 769px) {
  .firstview { height: 100svh; padding-top: var(--header-h); }
  .firstview .hero-mer { margin-top: 0; min-height: 0; flex: 1 1 auto; }
  .firstview .hero-mer__inner { height: 100%; }
  .firstview .cta-bar { flex: 0 0 auto; }
}

.hero-mer {
  position: relative;
  margin-top: var(--header-h);
  min-height: calc(100svh - var(--header-h));
  background: #ffffff;
  overflow: hidden;
}
.hero-mer__inner {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  min-height: inherit;
  padding: 0 clamp(16px, 4vw, 48px);
}
/* WebGL背景キャンバス（流れるスピードライン） */
.hero-mer__canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; opacity: 0; transition: opacity 1.2s ease; pointer-events: none;
}
.hero-mer__canvas.on { opacity: 1; }
/* WebGL起動後は静的動線を消して一本化 */
.hero-mer.webgl-on .hero-mer__streak { animation: none; opacity: 0; transition: opacity .8s ease; }

/* テキスト直下の白マスク（フル幅・放射状で境界を出さない） */
.hero-mer::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(135% 100% at 0% 100%, rgba(255,255,255,.92) 0%, rgba(255,255,255,.5) 26%, rgba(255,255,255,0) 52%);
}

/* 背景の光（白統一のため非表示） */
.hero-mer__glow { display: none; }

/* スピード動線 */
.hero-mer__streak {
  position: absolute; height: 3px; border-radius: 999px;
  filter: blur(.6px); transform: rotate(-3deg); transform-origin: right center;
  animation: merStreak 1s ease both;
}
.hero-mer__streak.s1 { right: 4%; top: 30%; width: 62%; background: linear-gradient(90deg, transparent, rgba(232,82,31,.78)); }
.hero-mer__streak.s2 { right: 8%; top: 35%; width: 48%; height: 2px; background: linear-gradient(90deg, transparent, rgba(20,38,63,.5)); animation-delay: .08s; }
.hero-mer__streak.s3 { right: 6%; top: 40%; width: 54%; height: 2px; background: linear-gradient(90deg, transparent, rgba(47,143,111,.5)); animation-delay: .16s; }

/* 走るドクター（モーション残像つき） */
.hero-mer__runner {
  position: absolute; right: 24%; bottom: 15%;
  width: clamp(112px, 17vw, 210px);
  z-index: 3;
  animation: merRun 1.1s cubic-bezier(.2,.7,.2,1) both;
}
.hero-mer__runner .rn { width: 100%; height: auto; display: block; }
.hero-mer__runner .rn-main { position: relative; color: #16181c; filter: drop-shadow(0 12px 16px rgba(0,0,0,.25)); }
.hero-mer__runner .rn-ghost { position: absolute; inset: 0; }
.hero-mer__runner .g1 { opacity: .26; transform: translateX(-16%); color: var(--accent); }
.hero-mer__runner .g2 { opacity: .13; transform: translateX(-34%); color: #14263f; }
/* 足元の影 */
.hero-mer__runner::after {
  content: ""; position: absolute; left: 50%; bottom: -7%;
  width: 86%; height: 16px; transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0,0,0,.3), transparent 70%);
  filter: blur(3px);
}

/* 救急車（作り込みシルエット） */
.hero-mer__truck {
  position: absolute; right: clamp(-50px, -4vw, -16px); bottom: 11%;
  width: clamp(220px, 36vw, 470px);
  z-index: 2;
  animation: merTruck 1.2s cubic-bezier(.2,.7,.2,1) both;
}
.hero-mer__truck svg { width: 100%; height: auto; filter: drop-shadow(0 16px 20px rgba(20,38,63,.28)); }
.hero-mer__truck::after {
  content: ""; position: absolute; left: 8%; right: 6%; bottom: -1%; height: 18px;
  background: radial-gradient(ellipse, rgba(0,0,0,.25), transparent 72%);
  filter: blur(4px);
}

/* 大型ロゴタイポ（左下） */
.hero-mer__logo {
  position: absolute;
  left: clamp(16px, 4vw, 48px);
  bottom: clamp(28px, 6vw, 64px);
  z-index: 4;
  animation: merLogo 1s ease .25s both;
}
.hero-mer__title {
  display: flex; align-items: baseline; gap: .1em;
  line-height: .8; font-weight: 800; letter-spacing: -.015em;
}
.hero-mer__title .mer-team {
  font-size: clamp(46px, 10.5vw, 142px);
  color: var(--ink);
}
.hero-mer__title .mer-er {
  font-size: clamp(64px, 15vw, 205px);
  font-style: italic;
  display: inline-block;
  line-height: 1;
  padding: 0.06em 0.14em 0.2em 0;   /* グラデ描画領域を文字全体に確保（R右脚の欠け防止）*/
  background: linear-gradient(180deg, #ff6a36, #d8410f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 16px rgba(232,82,31,.28));
}
.hero-mer__cap {
  margin-top: clamp(10px, 1.6vw, 18px);
  font-weight: 800;
  font-size: clamp(16px, 2.8vw, 32px);
  color: var(--ink);
  letter-spacing: .02em;
}
.hero-mer__cap::before {
  content: ""; display: inline-block; vertical-align: middle;
  width: clamp(28px, 4vw, 52px); height: 4px; border-radius: 2px;
  background: var(--accent); margin-right: 12px;
}
.hero-mer__en {
  margin-top: 10px;
  font-weight: 700;
  font-size: clamp(11px, 1.4vw, 15px);
  letter-spacing: .06em;
  color: var(--accent);
}
.hero-mer__scroll {
  position: absolute; right: clamp(16px,4vw,48px); bottom: 22px;
  font-size: 11px; letter-spacing: .2em; color: var(--ink-soft);
}

@keyframes merRun    { from { opacity:0; transform: translateX(70px); } to { opacity:1; transform:none; } }
@keyframes merTruck  { from { opacity:0; transform: translateX(90px); } to { opacity:1; transform:none; } }
@keyframes merLogo   { from { opacity:0; transform: translateY(26px); } to { opacity:1; transform:none; } }
@keyframes merStreak { from { opacity:0; transform: translateX(40px) rotate(-3deg); } to { opacity:1; transform: rotate(-3deg); } }

/* レスポンシブ */
@media screen and (max-width: 768px) {
  .hero-mer { min-height: 80svh; }
  .hero-mer__runner { right: 46%; bottom: 28%; width: clamp(76px, 19vw, 120px); z-index: 4; }
  .hero-mer__truck  { right: -28px; bottom: 25%; width: clamp(160px, 50vw, 280px); }
  .hero-mer__streak.s1 { top: 24%; } .hero-mer__streak.s2 { top: 28%; } .hero-mer__streak.s3 { top: 32%; }
  .hero-mer__scroll { display: none; }
}

/* ===== hero下CTA帯 ===== */
.cta-bar {
  background: var(--ink); color:#fff;
}
.cta-bar__inner {
  display:flex; flex-wrap:wrap; align-items:center; justify-content:center;
  gap: clamp(16px,2.4vw,32px); padding: clamp(26px,4vw,48px) 0; text-align:center;
}
.cta-bar__txt { font-weight:800; font-size:clamp(18px,2.2vw,26px); }
.cta-bar__txt small { display:block; font-weight:400; font-size:clamp(12px,1.2vw,14px); opacity:.75; letter-spacing:.1em; margin-top:4px; }
.cta-bar__btns { display:flex; flex-wrap:wrap; gap:clamp(12px,1.4vw,18px); justify-content:center; }
/* CTA帯のボタンは大きめに */
.cta-bar .btn { min-height:66px; padding:18px clamp(28px,3vw,44px); font-size:clamp(16px,1.6vw,21px); border-radius:999px; }
.cta-bar .btn svg { width:24px; height:24px; }
/* メールボタンは黒帯で映えるよう白に */
.cta-bar .btn--form { background:#fff; color:var(--ink); }
.cta-bar .btn--form:hover { background:#f0efec; }

/* ===== service cards ===== */
.svc-card {
  background:#fff; border:1px solid var(--line); border-radius: var(--radius);
  overflow:hidden; transition: transform .25s, box-shadow .25s;
}
.svc-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); }
.svc-card__img { aspect-ratio: 4/3; background: var(--bg-soft); display:flex; align-items:center; justify-content:center; }
.svc-card__img svg { width: 64px; height:64px; color: var(--green); }
.svc-card__body { padding: 22px 22px 26px; }
.svc-card__no { font-size:12px; color:var(--accent); font-weight:700; letter-spacing:.1em; }
.svc-card__ttl { font-size: clamp(18px,2vw,21px); font-weight:700; margin:6px 0 10px; }
.svc-card__txt { font-size:14px; color:var(--ink-soft); }

/* ===== strengths ===== */
.strength { display:flex; gap:20px; align-items:flex-start; }
.strength__num {
  font-size: clamp(36px,5vw,56px); font-weight:800; color:var(--accent); line-height:1;
  font-style: italic; flex:none;
}
.strength__ttl { font-size: clamp(18px,2.2vw,22px); font-weight:700; margin-bottom:8px; }
.strength__txt { font-size:14px; color:var(--ink-soft); }

/* ===== works ===== */
.work-card { border-radius:var(--radius); overflow:hidden; background:#fff; border:1px solid var(--line); }
.work-card__img { aspect-ratio: 4/3; background:var(--bg-soft); }
.work-card__body { padding:16px 18px 20px; }
.work-card__cat { font-size:11px; color:#fff; background:var(--green); padding:3px 10px; border-radius:999px; display:inline-block; }
.work-card__ttl { font-size:16px; font-weight:700; margin-top:10px; }
.work-card__meta { font-size:13px; color:var(--ink-soft); margin-top:4px; }

/* ===== stat ===== */
.stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:24px; text-align:center; }
.stat__num { font-size:clamp(34px,5vw,56px); font-weight:800; color:var(--accent); line-height:1; }
.stat__num small { font-size:.45em; margin-left:4px; color:var(--ink); }
.stat__label { font-size:13px; color:var(--ink-soft); margin-top:8px; letter-spacing:.08em; }

/* ===== faq ===== */
.faq-item { border-bottom:1px solid var(--line); }
.faq-q {
  width:100%; text-align:left; background:none; border:0; cursor:pointer;
  padding: 22px 44px 22px 8px; font-size: clamp(15px,1.7vw,17px); font-weight:700;
  position:relative; color:var(--ink); font-family:inherit;
}
.faq-q::after {
  content:"+"; position:absolute; right:10px; top:50%; transform:translateY(-50%);
  font-size:24px; color:var(--accent); transition:transform .25s;
}
.faq-item.open .faq-q::after { content:"−"; }
.faq-a { max-height:0; overflow:hidden; transition:max-height .3s ease; }
.faq-a p { padding: 0 8px 22px; color:var(--ink-soft); font-size:14px; }

/* ===== contact form ===== */
.form { max-width:720px; margin:0 auto; }
.form__row { margin-bottom:22px; }
.form__row label { display:block; font-weight:700; font-size:14px; margin-bottom:8px; }
.form__row .req { color:var(--accent); font-size:12px; margin-left:6px; }
.form input, .form textarea, .form select {
  width:100%; font-size:16px; font-family:inherit; color:var(--ink);
  padding:14px 16px; border:1px solid var(--line); border-radius:8px; background:#fff;
}
.form input:focus, .form textarea:focus, .form select:focus { outline:2px solid var(--green); border-color:transparent; }
.form textarea { min-height:160px; resize:vertical; }
.form__submit { text-align:center; margin-top:32px; }
.form__note { font-size:12px; color:var(--ink-soft); text-align:center; margin-top:16px; }

/* ===== page hero (下層共通) ===== */
.page-hero {
  margin-top: var(--header-h);
  background: linear-gradient(120deg,#1a2a2a,#0f2420);
  color:#fff; text-align:center; padding: clamp(48px,7vw,90px) 16px;
}
.page-hero__en { display:block; color:var(--accent); font-size:12px; letter-spacing:.35em; font-weight:700; margin-bottom:10px; }
.page-hero__ja { font-size: clamp(26px,4.5vw,44px); font-weight:800; }

/* ===== breadcrumb ===== */
.crumb { font-size:12px; color:var(--ink-soft); padding:16px 0; }
.crumb a:hover { color:var(--accent); }

/* ===== floating CTA (追従) ===== */
.float-cta {
  position:fixed; right:16px; bottom:16px; z-index:90;
  display:flex; flex-direction:column; gap:10px;
}
.float-cta a {
  width:60px; height:60px; border-radius:50%; display:flex; align-items:center; justify-content:center;
  color:#fff; box-shadow:0 6px 20px rgba(0,0,0,.25); transition:transform .2s;
}
.float-cta a:hover { transform:scale(1.08); }
.float-cta .fc-tel { background:var(--accent); }
.float-cta .fc-line { background:#06c755; }
.float-cta .fc-form { background:var(--ink); }
.float-cta svg { width:26px; height:26px; }
.float-cta__label { font-size:9px; display:block; }

/* ===== footer ===== */
.footer { background:var(--ink); color:#cfcfcf; padding: clamp(48px,6vw,72px) 0 28px; }
.footer__grid { display:grid; grid-template-columns: 1.5fr 1fr 1fr; gap:40px; }
.footer__logo { color:#fff; font-size:24px; font-weight:800; letter-spacing:.06em; margin-bottom:14px; }
.footer__logo span { color:var(--accent); }
.footer__info { font-size:13px; line-height:2; }
.footer h4 { color:#fff; font-size:14px; margin-bottom:14px; letter-spacing:.06em; }
.footer__nav li { margin-bottom:10px; font-size:13px; }
.footer__nav a:hover { color:#fff; }
.footer__bottom { border-top:1px solid rgba(255,255,255,.12); margin-top:40px; padding-top:20px; text-align:center; font-size:12px; color:#888; }

/* ===== fade-in ===== */
[data-fade] { opacity:0; transform:translateY(24px); transition:opacity .7s ease, transform .7s ease; }
[data-fade].in { opacity:1; transform:none; }

/* =====================================================
   レスポンシブ
   ===================================================== */
@media screen and (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media screen and (max-width: 768px) {
  .hamburger { display:block; }
  .gnav {
    position:fixed; inset:var(--header-h) 0 auto 0;
    background:#fff; border-bottom:1px solid var(--line);
    transform:translateY(-120%); transition:transform .3s; padding:8px 0 16px;
  }
  .gnav.open { transform:translateY(0); }
  .gnav ul { flex-direction:column; gap:0; }
  .gnav li { width:100%; border-top:1px solid var(--line); }
  .gnav a { display:block; padding:16px 24px; }
  .gnav a::after { display:none; }
  .gnav .gnav__cta { margin:14px 24px; text-align:center; }
  .footer__grid { grid-template-columns: 1fr; gap:28px; }
  .btn { width:100%; }
  .cta-bar__btns { width:100%; }
}
@media screen and (max-width: 480px) {
  .float-cta a { width:54px; height:54px; }
}
