/* ==========================================================================
   合同会社ミャポロン コーポレートサイト
   配色: 藍 #1B2A4A / 濃紺 #101B36 / 夜 #040C20 / 生成り #F4EDDF
         金 #C6A15B / 臙脂 #8E2437 / 墨 #262A33 / 鼠 #5A5E66
   ========================================================================== */

:root {
  --paper: #F4EDDF;
  --ink: #262A33;
  --gray: #5A5E66;
  --navy: #1B2A4A;
  --navy-deep: #101B36;
  --night: #040C20;
  --gold: #C6A15B;
  --red: #8E2437;
  --grad-gold: linear-gradient(135deg, #E2C588 0%, #C6A15B 45%, #96742F 100%);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: 'Shippori Mincho', 'Hiragino Mincho ProN', serif;
  --sans: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', sans-serif;
  --en: 'Cormorant Garamond', Georgia, serif;
}

/* 最外枠(body)はスクロールさせず、内側の .site-wrapper だけをスクロールさせる。
   これで iOS Safari の URL バーが「不透明な固定バー」に変わり、
   スクロールした本文がバーの裏に回り込んで透ける現象を根本から防ぐ。 */
html, body { height: 100%; }
html { background: #F4EDDF; }

body {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.site-wrapper {
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* 和紙ノイズ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2147480000;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 下部セーフエリア（Safariの下URLバー裏）の目隠し。
   本文テキストが回り込んで透けないよう、不透明レイヤーを最下部に固定して塞ぐ。
   色はページに合わせて JS が --safe-fill を更新する（既定は生成り色）。 */
body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: env(safe-area-inset-bottom, 0px);
  background: var(--safe-fill, #F4EDDF);
  z-index: 2147479999;
  pointer-events: none;
}

::selection { background: #1B2A4A; color: #F4EDDF; }
:focus-visible { outline: 1px solid #C6A15B; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html, .site-wrapper { scroll-behavior: auto; }
}

@keyframes mypFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
@keyframes mypScrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  48% { transform: scaleY(1); transform-origin: top; }
  52% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* --------------------------------------------------------------------------
   共通パーツ
   -------------------------------------------------------------------------- */

/* 金の下線アニメーション付きテキストリンク */
.tlink { position: relative; text-decoration: none; }
.tlink::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.tlink:hover::after,
a:hover > .tlink::after,
.newsrow:hover .tlink::after { transform: scaleX(1); }

/* 金枠ボタン（暗地用・明地用） */
.btn-gold {
  display: inline-block;
  border: 1px solid var(--gold);
  text-decoration: none;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
.btn-gold:hover { background: var(--gold); color: #101B36; }

/* --------------------------------------------------------------------------
   ヘッダー
   -------------------------------------------------------------------------- */

.site-header {
  --hf: #F4EDDF;
  --hfs: rgba(244, 237, 223, 0.66);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: transparent;
  /* 上部セーフエリア（ノッチ/上URLバー）分をヘッダー背景で塞ぐ */
  padding-top: env(safe-area-inset-top, 0px);
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.site-header[data-solid="true"] {
  --hf: #262A33;
  --hfs: #5A5E66;
  /* すりガラス: 背景がしっかり透ける半透明＋ぼかし（ヒーロー上は透明のまま） */
  background: rgba(244, 237, 223, 0.6);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(38, 42, 51, 0.07);
}
.site-header__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-header__brand { text-decoration: none; display: flex; flex-direction: column; gap: 3px; }
.site-header__logo-en {
  font-family: var(--en);
  font-weight: 600;
  font-size: 21px;
  letter-spacing: 0.24em;
  line-height: 1;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.site-header__logo-ja { font-family: var(--sans); font-size: 9.5px; letter-spacing: 0.3em; color: var(--hfs); }

.site-header__nav { display: flex; align-items: center; gap: 38px; }
.nav-link {
  position: relative;
  text-decoration: none;
  color: var(--hf);
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.12em;
  transition: color 0.4s var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  height: 1px;
  width: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav-link:hover::after { transform: scaleX(1); }
.nav-cta {
  text-decoration: none;
  color: var(--hf);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.18em;
  border: 1px solid var(--gold);
  padding: 12px 28px;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
.nav-cta:hover { background: var(--gold); color: #101B36; }

.site-header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: 6px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px 8px;
}
.site-header__burger span { display: block; height: 1px; background: var(--hf); transition: transform 0.4s var(--ease); }
.site-header__burger[data-open="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.site-header__burger[data-open="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }

@media (max-width: 880px) {
  .site-header__nav { display: none; }
  .site-header__burger { display: flex; }
}

/* 全画面メニュー */
.site-menu {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: #101B36;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s var(--ease), visibility 0.4s var(--ease);
}
.site-menu[data-open="true"] { opacity: 1; visibility: visible; pointer-events: auto; }
.site-menu nav { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.site-menu nav a {
  text-decoration: none;
  color: #F4EDDF;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 21px;
  letter-spacing: 0.16em;
  padding: 13px 32px;
}
.site-menu__cta { border: 1px solid var(--gold); padding: 14px 44px !important; margin-top: 22px; transition: background 0.4s var(--ease), color 0.4s var(--ease); }
.site-menu__cta:hover { background: var(--gold); color: #101B36; }
.site-menu__rule { width: 36px; height: 1px; background: rgba(198, 161, 91, 0.5); margin: 30px 0 14px; }
.site-menu__brand { font-family: var(--en); font-weight: 500; font-size: 11px; letter-spacing: 0.32em; color: var(--gold); }

/* --------------------------------------------------------------------------
   下層ページタイトル帯
   -------------------------------------------------------------------------- */

.page-title {
  position: relative;
  overflow: hidden;
  background: var(--paper);
  padding: clamp(130px, 17vh, 176px) 24px clamp(40px, 5vw, 56px);
  border-bottom: 1px solid rgba(90, 94, 102, 0.14);
}
.page-title__deco { display: none; }
.page-title__inner { position: relative; max-width: 1160px; margin: 0 auto; }
.page-title__crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--gray);
}
.page-title__crumb a { color: var(--gray); text-decoration: none; transition: color 0.4s var(--ease); }
.page-title__crumb a:hover { color: var(--red); }
.page-title__crumb .sep { color: rgba(90, 94, 102, 0.5); }
.page-title__heading {
  display: flex;
  align-items: baseline;
  column-gap: 22px;
  row-gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.page-title__heading h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: 0.12em;
  color: var(--ink);
}
.page-title__heading .en {
  font-family: var(--en);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.26em;
  color: var(--gold);
  text-transform: uppercase;
}
.page-title__rule { width: 56px; height: 1px; background: var(--gold); margin-top: 24px; }

.page-title--navy {
  background: linear-gradient(180deg, #1B2A4A 0%, #101B36 100%);
  border-bottom-color: rgba(198, 161, 91, 0.25);
}
.page-title--navy .page-title__heading h1 { color: #F4EDDF; }
.page-title--navy .page-title__crumb,
.page-title--navy .page-title__crumb a,
.page-title--navy .page-title__crumb .sep { color: rgba(244, 237, 223, 0.7); }
.page-title--navy .page-title__crumb a:hover { color: var(--gold); }
.page-title--navy .page-title__deco {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(560px, 52%);
  background-image: url('../assets/seigaiha-line.svg');
  background-size: 80px 40px;
  background-position: right bottom;
  opacity: 0.15;
  -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 60%);
  mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 60%);
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   フッター
   -------------------------------------------------------------------------- */

.site-footer { position: relative; z-index: 10; background: #101B36; }
/* フッター直下のセーフエリアも塞ぐCSS単体のフォールバック（フッターと同じ濃紺） */
.site-footer::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: env(safe-area-inset-bottom, 0px);
  background: #101B36;
}
.site-footer__wave {
  height: 40px;
  background-image: url('../assets/seigaiha-line.svg');
  background-size: 80px 40px;
  background-repeat: repeat-x;
  background-position: center bottom;
  opacity: 0.1;
}
.site-footer__brand-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 52px 24px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.site-footer__brand { text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.site-footer__brand img { width: 80px; height: 80px; }
.site-footer__brand span {
  display: block;
  text-indent: 0.32em;
  font-family: var(--en);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.32em;
  line-height: 1;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.site-footer__bottom { border-top: 1px solid rgba(198, 161, 91, 0.16); }
.site-footer__bottom-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.site-footer__nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 30px; }
.site-footer__nav a {
  text-decoration: none;
  font-size: 12.5px;
  letter-spacing: 0.1em;
  color: rgba(244, 237, 223, 0.72);
  transition: color 0.4s var(--ease);
}
.site-footer__nav a:hover { color: var(--gold); }
.site-footer__copy {
  font-family: var(--en);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: rgba(244, 237, 223, 0.45);
}

/* --------------------------------------------------------------------------
   トップページ
   -------------------------------------------------------------------------- */

/* 事業カード: hover で枠と番号が金に */
.svc-card { transition: border-color 0.4s var(--ease); }
.svc-card:hover { border-color: var(--gold) !important; }
.svc-card .svc-num { transition: color 0.4s var(--ease); }
.svc-card:hover .svc-num {
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
}

/* インラインスタイルを上書きするため !important 指定 */
@media (max-width: 880px) {
  [data-hero] { flex-direction: column !important; min-height: 100svh !important; }
  [data-hero-img] { order: 1 !important; padding: 104px 20px 0 !important; }
  [data-hero-img] img { max-height: 52vh !important; }
  [data-hero-copy] { order: 2 !important; padding: 16px 24px 116px !important; }
  [data-hero-catch] {
    writing-mode: horizontal-tb !important;
    font-size: 30px !important;
    line-height: 1.9 !important;
    letter-spacing: 0.1em !important;
    text-align: center !important;
  }
}

/* --------------------------------------------------------------------------
   お問い合わせフォーム
   -------------------------------------------------------------------------- */

.contact-step { color: var(--gray); border-bottom: 1px solid transparent; }
.contact-step[data-cur="true"] { color: var(--ink); border-bottom: 1px solid var(--gold); }

.form-field {
  width: 100%;
  box-sizing: border-box;
  background: var(--paper);
  border: 1px solid rgba(90, 94, 102, 0.4);
  padding: 14px 15px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  border-radius: 0;
  transition: border-color 0.3s;
}
.form-field:focus { border-color: var(--gold); outline: none; }
.form-field[data-err="true"] { border-color: var(--red) !important; }
textarea.form-field { line-height: 1.8; resize: vertical; }
select.form-field {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2210%22 height=%226%22%3E%3Cpath d=%22M1 1l4 4 4-4%22 stroke=%22%23C6A15B%22 fill=%22none%22 stroke-width=%221.5%22/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 15px center;
}
.form-err { margin: 0; font-size: 13px; letter-spacing: 0.03em; color: var(--red); }

.form-btn {
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 14.5px;
  letter-spacing: 0.22em;
  padding: 18px 56px;
  cursor: pointer;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
  border-radius: 2px;
}
.form-btn:hover { background: var(--gold); color: #101B36; }
.form-btn--sub {
  border: 1px solid rgba(90, 94, 102, 0.45);
  background: transparent;
  color: var(--gray);
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.18em;
  padding: 17px 44px;
  cursor: pointer;
  transition: border-color 0.4s var(--ease), color 0.4s var(--ease);
  border-radius: 2px;
}
.form-btn--sub:hover { border-color: var(--gray); color: var(--ink); }

/* 「織る」演出付き確認ボタン */
#btn-confirm { position: relative; overflow: hidden; }
#btn-confirm::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, transparent 0 7px, #C6A15B 7px 8px);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}
#btn-confirm[data-weave="true"]::before { animation: mypWeaveThreads 0.55s var(--ease) forwards; }
#btn-confirm::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-gold);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}
#btn-confirm[data-weave="true"]::after { animation: mypWeaveFill 0.5s var(--ease) 0.3s forwards; }
#btn-confirm span { position: relative; z-index: 1; transition: color 0.25s var(--ease) 0.4s; }
#btn-confirm[data-weave="true"] span { color: #101B36; }
#btn-confirm[data-shake="true"] { animation: mypSnap 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97); border-color: var(--red) !important; }

@keyframes mypWeaveThreads { to { transform: scaleX(1); } }
@keyframes mypWeaveFill { to { transform: scaleX(1); } }
@keyframes mypSnap {
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}
