/* =========================================================================
   Apotto! Japan Connect LP（海外企業向け・多言語）
   配色は白地＋青の濃淡のみ。RTL（アラビア語）でも崩れないよう論理プロパティで書く
   ========================================================================= */
:root {
  --blue: #1e5fbf;
  --blue-dark: #123d7a;
  --blue-soft: #eaf1fb;
  --ink: #142033;
  --sub: #4a5568;
  --line: #d6e0ee;
  --bg: #ffffff;
  --tint: #f5f8fc;
  --error: #b42318;
  --radius: 8px;
  /* 英字は Inter（本文）と Plus Jakarta Sans（見出し・数字）。fonts.css で自社サイトから読み込む。
     英字フォントに無い文字（漢字・ハングル・タイ文字・アラビア文字）は、後ろに並べた書体で表示される */
  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-head: "Plus Jakarta Sans", var(--font);
}
:lang(zh-CN) { --font: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
:lang(zh-TW), :lang(zh-HK) { --font: "Inter", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif; }
:lang(ja) { --font: "Inter", "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", sans-serif; }
:lang(ko) { --font: "Inter", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }
:lang(th) { --font: "Inter", "Leelawadee UI", "Thonburi", "Noto Sans Thai", sans-serif; }
:lang(ar) { --font: "Inter", "Segoe UI", "Geeza Pro", "Noto Sans Arabic", Tahoma, sans-serif; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--blue); }
h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.25; margin: 0 0 .6em;
  text-wrap: balance;               /* 行の長さを揃えて、最後の行に1語だけ残るのを防ぐ */
}
h1 { font-size: clamp(32px, 5.2vw, 54px); font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; letter-spacing: -.02em; }
h3 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.section-lead, .lead { text-wrap: pretty; }
/* 見出しは {br} で区切った「かたまり」単位で折り返す（build.py の title_chunks） */
.nb { display: inline-block; }
/* 日本語は文節で折り返し、見出しは字間を詰めて引き締める */
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3 { letter-spacing: .01em; font-feature-settings: "palt"; }
:lang(ja) h1, :lang(ja) h2, :lang(ja) h3, :lang(ja) .section-lead, :lang(ja) .lead, :lang(ja) .stats span { word-break: auto-phrase; }
.stats span { display: block; text-wrap: balance; }
/* 数字・料金・番号は見出しと同じ書体で */
.brand, .stats b, .price b, .num, .plan-no, .eyebrow { font-family: var(--font-head); }
.stats b, .price b { letter-spacing: -.02em; font-weight: 800; }
p { margin: 0 0 1em; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 780px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- ヘッダー ---- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .96);
  border-block-end: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { font-weight: 700; font-size: 19px; color: var(--blue-dark); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--blue); font-weight: 600; }
.nav { display: flex; gap: 20px; margin-inline-start: auto; }
.nav a { color: var(--ink); text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--blue); }
.switcher select {
  font: inherit; font-size: 14px; padding: 6px 8px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink);
  max-width: 220px;
}

/* ---- ボタン ---- */
.btn {
  display: inline-block; padding: 14px 26px; border-radius: var(--radius);
  background: var(--blue); color: #fff; font-weight: 600; text-decoration: none;
  border: 1px solid var(--blue); font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--blue); }
.btn-ghost:hover { background: var(--blue-soft); color: var(--blue-dark); }
.btn-small { padding: 8px 16px; font-size: 15px; white-space: nowrap; }

/* ---- ヒーロー ---- */
.hero { padding: 72px 0 56px; }
.eyebrow { color: var(--blue); font-weight: 700; font-size: 15px; letter-spacing: .02em; margin-bottom: 12px; }
.hero h1 { max-width: 18em; color: var(--blue-dark); }
.lead { font-size: 19px; max-width: 40em; color: var(--sub); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 40px; }
.stats {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.stats li { background: #fff; padding: 18px 20px; }
.stats b { display: block; font-size: 30px; color: var(--blue-dark); line-height: 1.2; }
.stats span { font-size: 14.5px; color: var(--sub); }
.note { font-size: 14px; color: var(--sub); margin-top: 12px; }

/* ヒーローの背景：サービスの場面を描いた絵カード100枚（tools/make_hero_cards.py で生成）と格子が、
   遠近をつけて奥へ流れる（旧Semantic UIサイトの演出を参考に、外部画像を使わずLPの配色で描く） */
.hero {
  position: relative; overflow: hidden;
  background-color: var(--blue-soft);
  background-image: radial-gradient(farthest-corner, #ffffff, var(--blue-soft));
  perspective: 1000px;
}
/* 遠近をつけた板（.hero-bg）の上を、カードを敷いた帯（.hero-bg-track）が滑る。
   背景の位置ではなく帯そのものを動かすので、毎コマの描き直しが起きず軽い */
.hero-bg {
  position: absolute; z-index: 0; overflow: hidden; pointer-events: none;
  width: 135%; height: 135%; top: 18%; inset-inline-start: 0;
  opacity: .85;
  transform-origin: 50% 50%;
  transform: rotateX(50deg) translateY(-14%) translateX(-14%) translateZ(370px);
}
.hero-bg-track {
  position: absolute; top: 0; left: 0; width: 100%; height: calc(100% + 1000px);
  background-image:
    var(--hero-cards),
    linear-gradient(rgba(30, 95, 191, .35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 95, 191, .35) 1px, transparent 1px);
  background-size: 2000px 1000px, 100px 100px, 100px 100px;
  animation: hero-grid 32s linear infinite;
  will-change: transform;
}
/* 背景のカードもページの言語で出す（hero-cards-*.svg は tools/make_hero_cards.py で作る） */
.cards-en { --hero-cards: url("hero-cards-en.svg"); }
.cards-ja { --hero-cards: url("hero-cards-ja.svg"); }
.cards-de { --hero-cards: url("hero-cards-de.svg"); }
.cards-fr { --hero-cards: url("hero-cards-fr.svg"); }
.cards-es { --hero-cards: url("hero-cards-es.svg"); }
.cards-it { --hero-cards: url("hero-cards-it.svg"); }
.cards-zh-CN { --hero-cards: url("hero-cards-zh-CN.svg"); }
.cards-zh-TW { --hero-cards: url("hero-cards-zh-TW.svg"); }
.cards-ko { --hero-cards: url("hero-cards-ko.svg"); }
.cards-vi { --hero-cards: url("hero-cards-vi.svg"); }
.cards-th { --hero-cards: url("hero-cards-th.svg"); }
.cards-id { --hero-cards: url("hero-cards-id.svg"); }
.cards-ar { --hero-cards: url("hero-cards-ar.svg"); }
/* 1000px＝カード10段分（格子10マス分）。ちょうど1周して継ぎ目なく繰り返す */
@keyframes hero-grid {
  from { transform: translateY(0); }
  to { transform: translateY(-1000px); }
}
/* 動きを減らす設定の人には、流れを止めて表示する */
@media (prefers-reduced-motion: reduce) {
  .hero-bg-track { animation: none; }
}
/* 文字のある左側だけカードを薄くして、見出しと説明文を読みやすくする */
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to right, rgba(234, 241, 251, .9) 0%, rgba(234, 241, 251, .84) 52%, rgba(234, 241, 251, .05) 74%);
}
[dir="rtl"] .hero::before {
  background: linear-gradient(to left, rgba(234, 241, 251, .9) 0%, rgba(234, 241, 251, .84) 52%, rgba(234, 241, 251, .05) 74%);
}
@media (max-width: 760px) {
  .hero::before { background: rgba(234, 241, 251, .76); }
}
.hero .wrap { position: relative; z-index: 2; }

/* ---- セクション ---- */
.section { padding: 72px 0; }
.section-tint { background: var(--tint); }
.section-lead { color: var(--sub); max-width: 46em; margin-bottom: 28px; }
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card, .plan {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.card p { color: var(--sub); margin: 0; font-size: 16px; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.steps li { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.steps p { color: var(--sub); font-size: 16px; margin: 0; }
.num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue); color: #fff; font-weight: 700; margin-bottom: 12px;
}

.industries { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.industries li {
  border: 1px solid var(--line); border-inline-start: 4px solid var(--blue);
  border-radius: 6px; padding: 14px 18px; font-weight: 600; background: #fff;
}
.industries li.muted { border-inline-start-color: var(--line); color: var(--sub); font-weight: 400; }

.plan h3 { color: var(--blue-dark); margin-bottom: .3em; }
.plan-no { color: var(--blue); font-weight: 700; font-size: 14px; margin: 0 0 4px; }
.plan-desc { color: var(--sub); font-size: 15.5px; min-height: 5em; }
.inc { margin: 0; padding-inline-start: 20px; color: var(--sub); display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; }
.price { margin-bottom: 2px; }
.price-jpy { color: var(--sub); font-size: 14px; margin-bottom: 16px; min-height: 1.4em; }
.price b { font-size: 34px; color: var(--blue-dark); }
.price span { color: var(--sub); font-size: 15px; }
.plan ul { padding-inline-start: 20px; margin: 0; }
.plan li { margin-bottom: 6px; font-size: 16px; }
.callout {
  margin-top: 28px; background: #fff; border: 1px solid var(--line);
  border-inline-start: 4px solid var(--blue); border-radius: var(--radius); padding: 20px 24px;
}
.callout p { margin: 0; color: var(--sub); }

details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; }
summary { cursor: pointer; padding: 16px 20px; font-weight: 600; }
details p { padding: 0 20px 16px; margin: 0; color: var(--sub); }

/* ---- フォーム ---- */
form { display: grid; gap: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; font-weight: 600; font-size: 15.5px; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 16.5px; padding: 10px 12px;
  border: 1px solid #b9c6d8; border-radius: 6px; background: #fff; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue); }
.field.has-error input, .field.has-error select { border-color: var(--error); }
.req { font-size: 12.5px; color: #fff; background: var(--blue); border-radius: 4px; padding: 1px 6px; font-weight: 600; margin-inline-start: 4px; }
.consent label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
.consent input { width: auto; margin-top: 6px; }
.field-error { color: var(--error); font-size: 14px; margin: 6px 0 0; }
.hp { position: absolute; inset-inline-start: -9999px; }
.form-status { margin: 0; font-size: 15px; }
.form-status.is-error { color: var(--error); }
.done { border: 1px solid var(--line); border-inline-start: 4px solid var(--blue); border-radius: var(--radius); padding: 24px; background: var(--blue-soft); }

/* ---- プライバシーポリシー ---- */
.legal-lang { margin-inline-start: auto; font-size: 15px; }
.legal-head { background: var(--blue-soft); padding: 56px 0 40px; }
.legal-head h1 { margin-bottom: 12px; }
.legal-head p { color: var(--sub); }
.legal-head .note { font-size: 14px; margin: 0; }
.legal-body { padding-block: 40px 72px; }
.legal-table { width: 100%; border-collapse: collapse; background: #fff; margin-bottom: 32px; font-size: 16px; }
.legal-table th, .legal-table td { border: 1px solid var(--line); padding: 12px 16px; text-align: start; vertical-align: top; overflow-wrap: anywhere; }
.legal-table th { width: 30%; background: var(--tint); color: var(--blue-dark); font-weight: 600; }
.legal-toc { background: var(--tint); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 40px; }
.legal-toc ol { margin: 0; padding-inline-start: 22px; }
.legal-toc li { margin: 4px 0; }
.legal section { scroll-margin-top: 90px; padding-block: 8px 24px; border-top: 1px solid var(--line); }
.legal h2 { font-size: 22px; margin: 20px 0 12px; }
.legal section p, .legal section li { font-size: 16px; line-height: 1.8; }
.legal-back { margin-top: 24px; }
@media (max-width: 760px) {
  .legal-table th, .legal-table td { display: block; width: 100%; border-top: 0; }
  .legal-table tr:first-child th { border-top: 1px solid var(--line); }
}

/* ---- フッター ---- */
.site-footer { background: var(--blue-dark); color: #dbe6f5; padding: 36px 0; font-size: 15px; }
.site-footer a { color: #fff; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---- 狭い画面 ---- */
@media (max-width: 980px) {
  .nav { display: none; }
  .switcher { margin-inline-start: auto; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .hero { padding: 48px 0 40px; }
  .section { padding: 52px 0; }
  .grid-3, .grid-2, .steps, .industries, .row, .inc { grid-template-columns: 1fr; }
  .plan-desc { min-height: 0; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .brand span { display: none; }
  .switcher select { max-width: 150px; }
  .btn-small { display: none; }
}

/* =========================================================================
   動き：カーソル・タッチした所を少し大きく／トップ以外の背景をゆっくり動かす／
   スクロールで要素がふわっと現れる。動きを減らす設定の人には出さない
   ========================================================================= */

/* ---- カーソル・タッチした所を少し大きく ---- */
.btn, .card, .plan, .steps li, .industries li, details, .callout, .nav a, .switcher select {
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}
.nav a { display: inline-block; }
@media (hover: hover) {
  .btn:hover { transform: scale(1.05); box-shadow: 0 8px 20px rgba(18, 61, 122, .18); }
  .nav a:hover { transform: scale(1.1); }
  .card:hover, .plan:hover, .steps li:hover, .industries li:hover, details:hover, .callout:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 14px 32px rgba(18, 61, 122, .12);
  }
}
/* スマホは指で触れている間だけ大きく（app.js で :active を効かせている） */
@media (hover: none) {
  .btn:active { transform: scale(1.05); }
  .card:active, .plan:active, .steps li:active, .industries li:active, details:active, .callout:active {
    transform: scale(1.03);
    box-shadow: 0 10px 24px rgba(18, 61, 122, .12);
  }
}
.btn:focus-visible, .nav a:focus-visible, summary:focus-visible, .switcher select:focus-visible {
  outline: 3px solid var(--blue); outline-offset: 3px;
}

/* ---- トップ以外のセクション（背景の動きは下の「ネットワーク」1つだけにしている） ---- */
.section { position: relative; overflow: hidden; }
.section > .wrap { position: relative; z-index: 1; }

/* 進め方の番号：輪がゆっくり広がる */
.num { position: relative; }
.num::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--blue); opacity: 0;
  animation: num-ring 2.8s ease-out infinite;
}
.steps li:nth-child(2) .num::after { animation-delay: .7s; }
.steps li:nth-child(3) .num::after { animation-delay: 1.4s; }
.steps li:nth-child(4) .num::after { animation-delay: 2.1s; }
@keyframes num-ring {
  0% { transform: scale(1); opacity: .6; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* ---- スクロールで現れる（app.js が .reveal と .is-visible を付ける。JSが動かなければ最初から表示） ---- */
.reveal { transition: opacity .7s ease, translate .7s ease, transform .2s ease, box-shadow .2s ease; }
.js .reveal:not(.is-visible) { opacity: 0; translate: 0 28px; }

@media (prefers-reduced-motion: reduce) {
  .num::after { animation: none; }
  .btn, .card, .plan, .steps li, .industries li, details, .callout, .nav a, .reveal { transition: none; }
  .js .reveal:not(.is-visible) { opacity: 1; translate: none; }
}

/* ---- トップ以外の背景：企業同士がつながるネットワーク（tools/make_section_bg.py で模様を生成） ---- */
/* 「日本企業とつなぐ」サービスを表す模様だけにした。点の流れ・光の玉・波・光のすじは重ねすぎのため外した */
.sec-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
/* 斜めにゆっくり流れる（480×320px＝模様1枚分で継ぎ目なく繰り返す） */
.sec-net {
  position: absolute; display: block; will-change: transform;
  top: -320px; left: -480px; width: calc(100% + 960px); height: calc(100% + 640px);
  background: url("net.svg") 0 0 / 480px 320px repeat;
  opacity: .45;
  animation: net-drift 60s linear infinite;
}
.section-tint .sec-net { opacity: .3; }
@keyframes net-drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(480px, 320px, 0); }
}
/* カード類は背景の上で白く浮かせて、文字を読みやすく保つ */
.card, .plan, .steps li, .industries li, details, .callout, .done { position: relative; z-index: 1; }

/* ---- ヒーローの実績：言葉で書く4つ目は少し小さく ---- */
.stats li:last-child b { font-size: 24px; overflow-wrap: break-word; hyphens: auto; }
@media (max-width: 760px) { .stats li:last-child b { font-size: 20px; } }

/* ---- 会社概要 ---- */
.company { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); position: relative; z-index: 1; }
.company div { display: grid; grid-template-columns: 11em 1fr; gap: 16px; padding: 16px 24px; border-block-end: 1px solid var(--line); }
.company div:last-child { border-block-end: none; }
.company dt { font-weight: 600; color: var(--blue-dark); }
.company dd { margin: 0; color: var(--ink); }
@media (max-width: 760px) {
  .company div { grid-template-columns: 1fr; gap: 2px; padding: 14px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .sec-net { animation: none; }
}
