/* ============================================================
   ヒーロー：斜めの切り口＋紙色パネル＋写真（寸法線を重ねる）
   構造： .hero__photo の中に 写真・色かぶり・SVG を重ねる（SVGは写真と同じ枠に敷く）
   ============================================================ */
.hero { position: relative; width: 100%; height: 92vh; min-height: 620px; max-height: 820px; overflow: hidden; background: var(--paper); }

.hero__photo { position: absolute; inset: 0; z-index: 0; }
.hero__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 65% center; display: block; }

/* ごく薄い全体の色かぶり。写真の明るさ・銀色の質感は残す */
.hero__wash { position: absolute; inset: 0; z-index: 1; background: rgba(13,56,104,.10); mix-blend-mode: multiply; }
/* 濃さの主役は切り口の近くだけ。パネルへなめらかに繋ぎ、奥は自然な明るさに戻す */
.hero__seam-blend { position: absolute; inset: 0; z-index: 1; background: linear-gradient(100deg, rgba(8,35,71,.75) 0%, rgba(8,35,71,.35) 12%, rgba(8,35,71,0) 26%); }

/* 斜めの切り口（外側＝赤い細線、内側＝紙色パネル） */
.hero__edge { position: absolute; inset: 0; z-index: 1; background: var(--correction); clip-path: polygon(0 0, calc(47% + 3px) 0, calc(39% + 3px) 100%, 0 100%); }
.hero__panel {
  position: absolute; inset: 0; z-index: 2;
  background:
    linear-gradient(0deg, rgba(13,56,104,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13,56,104,.05) 1px, transparent 1px),
    var(--paper);
  background-size: 26px 26px, 26px 26px, 100% 100%;
  clip-path: polygon(0 0, 47% 0, 39% 100%, 0 100%);
}

.hero__content {
  position: relative; z-index: 3; height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 0 0 6vw; max-width: 34vw;
  color: var(--ink);
}
.hero__eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 13px; letter-spacing: .08em; color: var(--steel); font-weight: 700; }
.hero__eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--correction); display: block; }
.hero__title { margin: 0 0 24px; font-family: var(--serif); font-weight: 700; font-size: clamp(26px, 2.5vw, 36px); line-height: 1.5; color: var(--ink); }
.hero__lead { margin: 0 0 34px; color: var(--steel); font-size: 15px; line-height: 1.9; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero .button--ghost { color: var(--ink); border-color: rgba(20,35,58,.35); }
.hero .button--ghost:hover { border-color: var(--blueprint); color: var(--blueprint); }

/* 寸法線・認識マークのSVG（写真と同じ枠に、同じ切り取り方で敷く） */
.hero__overlay { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero__overlay svg, .hero__overlay img { width: 100%; height: 100%; display: block; }
/* 外部SVG(img)は写真用の object-fit/position を受けない（.hero__photo img の指定を打ち消す） */
.hero__overlay img { position: static; inset: auto; object-fit: fill; object-position: 0 0; }
.mesh-group { filter: url(#haloFilter); }
.mesh-line { fill: none; stroke: var(--cyan); stroke-width: 1.3; stroke-dasharray: 900; stroke-dashoffset: 900; animation: drawMesh 1.3s ease-out .3s forwards; }
.mesh-outline { fill: none; stroke: var(--cyan); stroke-width: 2; opacity: .95; stroke-dasharray: 900; stroke-dashoffset: 900; animation: drawMesh 1s ease-out .2s forwards; }
.mesh-node { fill: var(--cyan); }
@keyframes drawMesh { to { stroke-dashoffset: 0; } }
@keyframes pulseNode { 0%,100% { opacity: .45; r: 3; } 50% { opacity: 1; r: 5; } }
.pulse { animation: pulseNode 2.4s ease-in-out infinite; }

/* 読み込み時だけの、照合→確定の一度きりの動き（ループしない） */
.ref-line { fill: none; stroke: var(--cyan); stroke-width: 1; stroke-dasharray: 3 4; opacity: .8; animation: refFade .9s ease-in .5s forwards; }
@keyframes refFade { to { opacity: 0; } }
.check-pop { opacity: 0; transform-origin: 905px 283px; animation: checkPop .35s ease-out 1.15s forwards; }
@keyframes checkPop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .mesh-line, .mesh-outline, .pulse { animation: none !important; stroke-dashoffset: 0 !important; }
  .ref-line { animation: none !important; opacity: 0 !important; }
  .check-pop { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* 1023px以下：斜めカットをやめ、写真→文章の順に積む（寸法線は写真の枠の中に残る） */
@media screen and (max-width: 1023px) {
  .hero { display: flex; flex-direction: column; height: auto; min-height: 0; max-height: none; }
  .hero__photo { position: relative; inset: auto; order: -1; aspect-ratio: 16 / 10; }
  .hero__photo img { object-position: center; }
  .hero__seam-blend, .hero__edge, .hero__panel, .hero__br { display: none; }
  .hero__content { max-width: none; height: auto; padding: 36px 20px 44px; background: var(--paper); }
}

/* タブレット・スマホ：写真が縮むため、ヒーロー上の寸法線を太くして見やすくする（座標系は写真基準なので、縮小率の逆数ぶん太く） */
@media screen and (min-width: 461px) and (max-width: 1023px) {
  .hero__overlay .mesh-line { stroke-width: 3.4; }
  .hero__overlay .ref-line { stroke-width: 2.6; stroke-dasharray: 8 9; }
  .hero__overlay .check-pop path { stroke-width: 4; }
  .hero__overlay .mesh-outline { stroke-width: 3.4; }
  .hero__overlay .dim-label { transform-origin: 736px 257px; transform: scale(1.35); }
}
@media screen and (max-width: 460px) {
  .hero__overlay .mesh-line { stroke-width: 5.6; }
  .hero__overlay .ref-line { stroke-width: 4.2; stroke-dasharray: 12 14; }
  .hero__overlay .check-pop path { stroke-width: 6; }
  .hero__overlay .mesh-outline { stroke-width: 5.6; }
  .hero__overlay .dim-label { transform-origin: 736px 257px; transform: scale(2.5); }
}

/* ============================================================
   実績ストリップ＋証拠ディテール
   ============================================================ */
.proof { background: var(--paper); border-bottom: 1px solid var(--paper-line); }
.proof__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding-block: 28px;
}
.proof__item { padding-top: 12px; border-top: 1px solid var(--paper-line); }
.proof__value { margin: 0 0 4px; font-weight: 700; font-size: 17px; }
.proof__label { margin: 0; color: var(--steel); font-size: 14px; line-height: 1.7; }

.proof__detail {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--paper-line);
}
.proof__detail-eyebrow { margin: 0 0 8px; color: var(--steel); font-size: 13px; font-weight: 700; }
.proof__detail-text p { margin: 0; max-width: 42em; font-size: 15px; line-height: 1.8; }
.proof__detail .mini-chart { width: 320px; max-width: 100%; margin: 0; flex-shrink: 0; }

/* ============================================================
   主力サービス
   ============================================================ */
.offer { padding: 56px 0; }
.offer__intro { padding-bottom: 8px; }
.offer__intro h2 {
  margin: 10px 0 18px;
  font-family: var(--serif);
  font-size: clamp(22px, 4.8vw, 28px);
  line-height: 1.6;
}
.offer__intro p:last-child { max-width: 42em; }

.offer__row { display: flex; flex-direction: column; gap: 28px; padding-block: 32px; }
.offer__row { border-top: 1px solid var(--paper-line); margin-top: 24px; }
.offer__media img { width: 100%; height: auto; border-radius: 4px; }
.offer__eyebrow { margin: 0 0 8px; color: var(--steel); font-size: 14px; font-weight: 700; }
.offer__text h2 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(21px, 4.4vw, 26px);
  line-height: 1.6;
}
.offer__text p { margin: 0 0 20px; max-width: 34em; }

.offer__custom {
  margin-top: 20px;
  padding-top: 24px;
  border-top: 1px solid var(--paper-line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.offer__custom p { margin: 0; color: var(--steel); }

/* 技術概念図（共通パーツ） */
.mini-chart { max-width: 300px; margin: 0 0 20px; }
.mini-chart svg, .mini-chart img { width: 100%; height: auto; }
.mini-chart__distorted { stroke: var(--steel); stroke-width: 1.5; stroke-dasharray: 5 4; }
.mini-chart__existing { stroke: var(--ink); stroke-width: 2.5; }
.mini-chart__mold { fill: var(--paper-line); stroke: none; }
.mini-chart__title { fill: var(--ink); font-size: 11px; font-weight: 700; font-family: var(--sans); }
.mini-chart__mold-label { fill: var(--steel); font-size: 10px; font-family: var(--sans); }
.mini-chart__corrected { stroke: var(--blueprint); stroke-width: 2.5; }
.mini-chart__mark { stroke: var(--correction); stroke-width: 2; }
.mini-chart__dot { fill: var(--correction); }
.mini-chart__legend {
  margin: 15px 0 0; /* 旧インラインSVGの下端の隙間(約7px)を含めた余白。imgはblockなので明示 */
  font-size: 12px;
  color: var(--steel);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.mini-chart__swatch { display: inline-block; width: 14px; height: 3px; background: var(--steel); margin-right: 2px; }
.mini-chart__swatch--corrected { background: var(--blueprint); }
.mini-chart__swatch--existing { background: var(--ink); }
.mini-chart__swatch--distorted { background: repeating-linear-gradient(90deg, var(--steel) 0 4px, transparent 4px 7px); }
.mini-chart__ring { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--correction); border-radius: 50%; margin-right: 2px; box-sizing: border-box; }

/* ============================================================
   向き・不向き
   ============================================================ */
.fit { background: var(--paper); border-top: 1px solid var(--paper-line); padding: 56px 0; }
.fit h2 { margin: 0 0 28px; font-family: var(--serif); font-size: clamp(20px, 4vw, 25px); line-height: 1.6; }
.fit__cols { display: grid; grid-template-columns: 1fr; gap: 32px; }
.fit__col h3 { margin: 0 0 12px; font-size: 15px; }
.fit__col ul { margin: 0; padding-left: 1.2em; }
.fit__col li { margin-bottom: 8px; }

/* ============================================================
   研究開発ライン／CTA
   ============================================================ */
.research { padding: 24px 0; text-align: center; color: var(--steel); font-size: 14px; }
.cta { text-align: center; padding: 56px 0; background: var(--blueprint-deep); color: #fff; }
.cta h2 { font-family: var(--serif); font-size: clamp(20px, 4.4vw, 26px); margin: 0 0 12px; line-height: 1.6; }
.cta p { margin: 0 0 26px; color: #cfe0f2; font-size: 14px; }

/* ============================================================
   タブレット（461px〜1023px）
   ============================================================ */
@media screen and (min-width: 461px) and (max-width: 1023px) {
  .proof__inner { grid-template-columns: repeat(3, 1fr); gap: 0; }
  .proof__item { border-top: none; border-left: 1px solid var(--paper-line); padding: 0 24px; }
  .proof__item:first-child { border-left: none; padding-left: 0; }
  .proof__detail { flex-direction: row; align-items: flex-start; gap: 40px; }

  .offer__row { flex-direction: row; align-items: center; gap: 40px; }
  .offer__media, .offer__text { flex: 1 1 0; min-width: 0; }
  .offer__custom { flex-direction: row; align-items: center; justify-content: space-between; }

  .fit__cols { grid-template-columns: 1fr 1fr; gap: 40px; }
}

/* ============================================================
   PC（1024px〜）
   ============================================================ */
@media screen and (min-width: 1024px) {

  .proof__inner { grid-template-columns: repeat(3, 1fr); gap: 0; padding-block: 32px; }
  .proof__item { border-top: none; border-left: 1px solid var(--paper-line); padding: 4px 32px; }
  .proof__item:first-child { border-left: none; padding-left: 0; }
  .proof__detail { flex-direction: row; align-items: flex-start; gap: 56px; padding-block: 32px 44px; }

  .offer { padding: 80px 0; }
  .offer__intro { max-width: 760px; }
  .offer__row { flex-direction: row; align-items: center; gap: 56px; padding-block: 40px; }
  .offer__media, .offer__text { flex: 1 1 0; min-width: 0; }
  .offer__custom { flex-direction: row; align-items: center; justify-content: space-between; }

  .fit { padding: 72px 0; }
  .fit__cols { grid-template-columns: 1fr 1fr; gap: 56px; }

  .cta { padding: 80px 0; }
}


/* ============================================================
   PrivateAI の写真の上のオーバーレイ（サービス一覧・PrivateAIページと同じSVG）
   写真と同じ枠に敷く。写真は縮んで表示されるので、線を --m 倍に太くする
   ============================================================ */
.offer__media { position: relative; --m: 2.4; }
.offer__media img { display: block; }
.offer__overlay { position: absolute; inset: 0; pointer-events: none; }
.offer__overlay svg { width: 100%; height: 100%; display: block; overflow: hidden; }
.offer__media .pa-line { stroke-width: calc(1.6px * var(--m)); }
.offer__media .pa-line--sub { stroke-width: calc(1px * var(--m)); }

/* 画面に入ってから動かす（読み込み時に一度だけ。JSが無ければ最初から動く） */
.offer-anim .offer__media:not(.is-in) svg * { animation-play-state: paused; }

@media screen and (max-width: 460px) { .offer__media { --m: 2.9; } }
@media screen and (min-width: 461px) and (max-width: 1023px) { .offer__media { --m: 2.6; } }
