:root {
  --bg: #05070C;
  --bg2: #0A1220;
  --building-1: #0F141C;
  --building-2: #131820;
  --building-3: #172030;
  --building-4: #1A2230;
  --cyan: #00E5FF;
  --fg: #E8ECF1;
  --muted: #9CA8B6; /* 旧 #5A6470 は 3.27:1 で WCAG AA 不合格。8.1:1(AAA) に是正 */
  --fog: #070A12;
  /* 琉球パレット(五四の灯)。使用比率: 構造=シアン/藍 70% / 強調=金 25% / 動き=珊瑚朱 5% */
  --kin: #E9B72A;        /* 首里の黄(紅型・王族色)。CTA・強調。on #05070C ≈ 10:1 */
  --kin-bright: #F5C93F;
  --sango: #FF7A5C;      /* 珊瑚朱。ホバー・動きのみ */
  --ai-blue: #2B5B8C;    /* 琉球藍。補助構造 */
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, Noto Sans JP, sans-serif;
  overflow: hidden;
  height: 100vh;
  line-height: 1.6;
}
body.page-subpage { overflow-y: auto; height: auto; }

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,229,255,0.02) 2px, rgba(0,229,255,0.02) 4px);
  pointer-events: none;
  z-index: 6;
}
/* フィルムグレイン（全面・物理的な質感。pointer-events 無効を厳守） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.9'/%3E%3C/svg%3E");
  opacity: 0.06;
  pointer-events: none;
  z-index: 7;
}

/* セクション到達時の見出しマスクリビール（overlay-active 連動・reduced-motion では即表示）。
   事前隠しは html.fx(main.js 実行時のみ付与)に限定 = JS/CDN 不達でも見出しが永久に隠れない */
html.fx section[data-overlay] h2, html.fx section[data-overlay] h1 { clip-path: inset(0 0 110% 0); transform: translateY(0.35em); }
html.fx section[data-overlay] .overlay-eyebrow { opacity: 0; transform: translateX(-14px); }
section[data-overlay].overlay-active h2, section[data-overlay].overlay-active h1 {
  clip-path: inset(-20% 0 -8% 0); transform: none;
  transition: clip-path 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.12s, transform 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.12s;
}
section[data-overlay].overlay-active .overlay-eyebrow {
  opacity: 1; transform: none;
  transition: opacity 0.5s ease 0.05s, transform 0.5s ease 0.05s;
}
/* 3D 初期化が極端に遅い・途中失敗した環境でも、ヒーロー見出しだけは必ず出す保険 */
@keyframes v12b-force-title { to { clip-path: inset(-20% 0 -8% 0); transform: none; } }
@keyframes v12b-force-eyebrow { to { opacity: 1; transform: none; } }
html.fx section[data-overlay="hero"] h1 { animation: v12b-force-title 0.8s cubic-bezier(0.16, 1, 0.3, 1) 5s forwards; }
html.fx section[data-overlay="hero"] .overlay-eyebrow { animation: v12b-force-eyebrow 0.5s ease 5s forwards; }
@media (prefers-reduced-motion: reduce) {
  html.fx section[data-overlay] h2, html.fx section[data-overlay] h1 { clip-path: none; transform: none; animation: none; }
  html.fx section[data-overlay] .overlay-eyebrow { opacity: 1; transform: none; animation: none; }
}

/* CTA背後の巨大ワードマーク（最終セクションを見せ場に） */
.mega-mark {
  position: absolute; right: -0.06em; bottom: -0.18em; z-index: 0;
  font-family: Inter, "Noto Sans JP", sans-serif; font-weight: 700;
  font-size: clamp(180px, 30vw, 460px); line-height: 1; letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(0, 229, 255, 0.14);
  pointer-events: none; user-select: none;
}
section[data-overlay=cta] { overflow: hidden; }
section[data-overlay=cta] > .overlay-card { position: relative; z-index: 1; }

#webgl-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; display: block; }

/* Section navigation dots */
#section-nav { position: fixed; right: 32px; top: 50%; transform: translateY(-50%); z-index: 50; display: flex; flex-direction: column; gap: 14px; }
.section-dot { width: 10px; height: 10px; padding: 0; border: 1px solid rgba(0,229,255,0.4); background: transparent; border-radius: 50%; cursor: pointer; transition: all 0.3s; }
.section-dot:hover { border-color: var(--cyan); transform: scale(1.2); }
.section-dot.active { background: var(--kin); border-color: var(--kin); box-shadow: 0 0 8px var(--kin); }

/* Scroll hint */
#scroll-hint { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-family: "JetBrains Mono", "Noto Sans JP", monospace; font-size: 0.7rem; letter-spacing: 0.2em; transition: opacity 0.5s; pointer-events: none; }
.hint-arrow { animation: hint-bob 1.8s ease-in-out infinite; color: var(--cyan); }
@keyframes hint-bob { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(6px); opacity: 1; } }
#scroll-hint.hidden { opacity: 0; }

section[data-overlay] {
  position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
  z-index: 10; display: flex; align-items: center;
  padding: 4.1rem 5vw 2.1rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.05s linear;
}
section[data-overlay=hero] { opacity: 1; }
section[data-card-pos="center"] { justify-content: center; }
section[data-card-pos="left"]   { justify-content: flex-start; }
section[data-card-pos="right"]  { justify-content: flex-end; padding-right: calc(5vw + 60px); }

/* ---- Overlay Card ---- */
.overlay-card {
  pointer-events: none;
  overscroll-behavior: contain;
  position: relative;
  max-width: min(560px, 92vw);
  padding: clamp(1.75rem, 3vw, 2.6rem) clamp(1.75rem, 3vw, 2.8rem);
  background: rgba(5, 7, 12, 0.62);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid rgba(0, 229, 255, 0.18);
  border-left: 3px solid var(--cyan);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
section[data-overlay].overlay-active .overlay-card { pointer-events: auto; }
.overlay-card[data-size="wide"] { max-width: min(880px, 94vw); }
.overlay-card::before {
  content: ""; position: absolute; top: 10px; right: 10px;
  width: 22px; height: 22px;
  border-top: 1px solid rgba(0, 229, 255, 0.35);
  border-right: 1px solid rgba(0, 229, 255, 0.35);
  pointer-events: none;
}
.overlay-card::after {
  content: ""; position: absolute; bottom: 10px; left: 10px;
  width: 22px; height: 22px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.18);
  border-left: 1px solid rgba(0, 229, 255, 0.18);
  pointer-events: none;
}
.overlay-card p { color: var(--fg); opacity: 0.85; line-height: 1.6; font-size: 0.95rem; max-width: 100%; }
.overlay-card .overlay-sub { color: var(--muted); font-family: "JetBrains Mono", "Noto Sans JP", monospace; font-size: 0.85rem; letter-spacing: 0.15em; margin-top: 0.55rem !important; }
.overlay-card .hud-counter { margin-top: 1rem; }
.overlay-card footer { margin-top: 0.9rem; padding-top: 0.7rem; border-top: 1px solid rgba(255,255,255,0.08); color: var(--muted); font-size: 0.72rem; font-family: "JetBrains Mono", "Noto Sans JP", monospace; line-height: 1.55; }
.overlay-card footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid rgba(0,229,255,0.25); }
.overlay-card footer a:hover { color: var(--cyan); }

h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-family: Inter, "Noto Sans JP", sans-serif; color: var(--fg); letter-spacing: -0.02em; line-height: 1.15; font-weight: 700; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); font-family: Inter, "Noto Sans JP", sans-serif; color: var(--fg); font-weight: 700; margin-bottom: 0.6rem; line-height: 1.2; }
h3 { font-size: 1.05rem; font-weight: 600; color: var(--fg); margin-bottom: 0.4rem; }
p { color: var(--fg); line-height: 1.6; max-width: 600px; margin-top: 0.5rem; font-size: 0.92rem; opacity: 0.85; }

.hud-counter { font-family: "JetBrains Mono", "Noto Sans JP", monospace; font-size: 0.75rem; color: var(--cyan); margin-top: 1rem; letter-spacing: 0.15em; }

#site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 1.5rem 8vw; display: flex; justify-content: space-between; align-items: center;
  background: rgba(5,7,12,0.8); backdrop-filter: blur(8px);
}

.logo { font-family: "JetBrains Mono", "Noto Sans JP", monospace; color: var(--cyan); font-size: 1rem; letter-spacing: 0.2em; text-decoration: none; }
nav { display: flex; gap: 2rem; }
nav a { color: var(--muted); text-decoration: none; font-size: 0.8rem; letter-spacing: 0.1em; transition: color 0.2s; }
nav a:hover { color: var(--fg); }

.corner-bracket { position: fixed; z-index: 110; width: 44px; height: 44px; pointer-events: none; }
.corner-bracket[data-pos=tl] { top: 18px; left: 18px; border-top: 1.5px solid rgba(0,229,255,0.7); border-left: 1.5px solid rgba(0,229,255,0.7); }
.corner-bracket[data-pos=tr] { top: 18px; right: 18px; border-top: 1.5px solid rgba(0,229,255,0.7); border-right: 1.5px solid rgba(0,229,255,0.7); }
.corner-bracket[data-pos=bl] { bottom: 18px; left: 18px; border-bottom: 1.5px solid rgba(0,229,255,0.7); border-left: 1.5px solid rgba(0,229,255,0.7); }
.corner-bracket[data-pos=br] { bottom: 18px; right: 18px; border-bottom: 1.5px solid rgba(0,229,255,0.7); border-right: 1.5px solid rgba(0,229,255,0.7); }

.cta-button {
  display: inline-block; background: transparent;
  border: 1px solid var(--kin); color: var(--kin);
  padding: 1rem 2.5rem; font-family: "JetBrains Mono", "Noto Sans JP", monospace;
  font-size: 0.85rem; letter-spacing: 0.1em; text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  margin-top: 1.1rem; cursor: pointer;
}
.cta-button:hover {
  background: var(--kin); color: var(--bg);
  border-color: var(--sango); box-shadow: 0 0 18px rgba(255, 122, 92, 0.25);
}

.service-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.1rem; margin-top: 1rem; max-width: 900px; }
.service-card { border: 1px solid rgba(0,229,255,0.2); padding: 1rem 1.05rem; background: rgba(0,229,255,0.03); }
.service-card h3 { color: var(--cyan); font-family: "JetBrains Mono", "Noto Sans JP", monospace; font-size: 0.85rem; letter-spacing: 0.1em; margin-bottom: 0.5rem; font-weight: 400; }
.service-card p { color: var(--muted); font-size: 0.85rem; margin-top: 0; max-width: none; }

.step-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem 1.6rem; margin-top: 0.8rem; max-width: 100%; }
section[data-overlay=process] > .overlay-card { max-width: min(700px, 94vw); }
.step { display: flex; gap: 1.1rem; align-items: flex-start; }
.step-num { font-family: "JetBrains Mono", "Noto Sans JP", monospace; color: var(--cyan); font-size: 0.75rem; min-width: 2rem; padding-top: 0.2rem; }
.step h3 { color: var(--fg); font-size: 1rem; margin-bottom: 0.2rem; font-weight: 400; }
.step p { color: var(--muted); font-size: 0.85rem; margin-top: 0; max-width: none; }

footer { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.05); color: var(--muted); font-size: 0.75rem; font-family: "JetBrains Mono", "Noto Sans JP", monospace; line-height: 2; }

/* ---- Overlay common ---- */
.overlay-eyebrow { font-family: "JetBrains Mono", "Noto Sans JP", monospace; font-size: 0.7rem; color: var(--cyan); letter-spacing: 0.25em; margin-bottom: 1rem; }
.overlay-more { display: inline-block; margin-top: 1.1rem; font-family: "JetBrains Mono", "Noto Sans JP", monospace; font-size: 0.75rem; color: var(--cyan); letter-spacing: 0.15em; text-decoration: none; border-bottom: 1px solid rgba(0,229,255,0.4); padding-bottom: 0.25rem; pointer-events: auto; }
.overlay-more:hover { color: var(--fg); border-bottom-color: var(--fg); }

/* ---- Why Us ---- */
.why-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.1rem; margin-top: 1.1rem; max-width: 960px; }
.why-card { border: 1px solid rgba(0,229,255,0.18); padding: 1.05rem 1.1rem; background: rgba(0,229,255,0.025); }
.why-num { font-family: "JetBrains Mono", "Noto Sans JP", monospace; color: var(--cyan); font-size: 1.25rem; letter-spacing: 0.15em; }
.why-card h3 { color: var(--fg); font-family: Inter, "Noto Sans JP", sans-serif; font-size: 1.05rem; margin: 0.35rem 0 0.4rem; font-weight: 700; }
.why-card p { color: var(--muted); font-size: 0.85rem; margin-top: 0; max-width: none; }

/* ---- Team preview ---- */
.team-preview { display: flex; gap: 1.5rem; margin-top: 1.1rem; max-width: 720px; }
.team-card { border: 1px solid rgba(0,229,255,0.2); padding: 1.2rem 1.5rem; background: rgba(0,229,255,0.03); flex: 1; }
.team-role { font-family: "JetBrains Mono", "Noto Sans JP", monospace; color: var(--cyan); font-size: 0.75rem; letter-spacing: 0.2em; display: block; margin-bottom: 0.5rem; }
.team-card h3 { color: var(--fg); font-family: Inter, "Noto Sans JP", sans-serif; font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem; }

/* ---- FAQ preview ---- */
.faq-list { display: flex; flex-direction: column; gap: 1rem; margin-top: 2rem; max-width: 720px; }
.faq-item { border-left: 2px solid var(--cyan); padding: 0.75rem 1.25rem; background: rgba(0,229,255,0.02); }
.faq-item dt { font-family: Inter, "Noto Sans JP", sans-serif; color: var(--fg); font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
.faq-item dd { color: var(--muted); font-size: 0.85rem; }

/* ---- Hero metrics ---- */
.hero-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem;
  margin-top: 1.1rem; padding: 0;
}
.metric {
  border: 1px solid rgba(0,229,255,0.22);
  border-left: 2px solid var(--cyan);
  background: rgba(0,229,255,0.04);
  padding: 0.6rem 0.8rem; display: flex; flex-direction: column; gap: 0.2rem;
}
.metric-label {
  font-family: "JetBrains Mono", "Noto Sans JP", monospace; color: var(--muted);
  font-size: 0.62rem; letter-spacing: 0.22em;
}
.metric-value {
  font-family: "JetBrains Mono", "Noto Sans JP", monospace; color: var(--fg);
  font-size: 1.6rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.metric-unit { color: var(--cyan); font-size: 0.7em; margin-left: 0.1em; font-weight: 400; }

/* ---- Service tags ---- */
.service-tags {
  list-style: none; padding: 0; margin: 0.7rem 0 0;
  display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.service-tags li {
  font-family: "JetBrains Mono", "Noto Sans JP", monospace; font-size: 0.62rem;
  letter-spacing: 0.12em; color: var(--cyan);
  border: 1px solid rgba(0,229,255,0.3);
  padding: 0.2rem 0.5rem;
}

/* ---- Process step meta ---- */
.step-meta {
  display: block; margin-top: 0.25rem;
  font-family: "JetBrains Mono", "Noto Sans JP", monospace; color: var(--cyan);
  font-size: 0.68rem; letter-spacing: 0.1em;
  opacity: 0.75;
}

/* ---- Team skills ---- */
.team-skills {
  list-style: none; padding: 0; margin: 0.6rem 0 0;
  display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.team-skills li {
  font-family: "JetBrains Mono", "Noto Sans JP", monospace; font-size: 0.62rem;
  letter-spacing: 0.12em; color: var(--cyan);
  border: 1px solid rgba(0,229,255,0.3);
  padding: 0.2rem 0.55rem;
}

/* ---- Service card effect / cost lines ---- */
.service-card .service-effect {
  color: var(--fg); font-size: 0.78rem; line-height: 1.5;
  margin: 0.5rem 0 0; max-width: none;
  opacity: 0.9;
}
.service-card .service-effect b { color: var(--cyan); font-weight: 700; }
.service-card .service-cost {
  font-family: "JetBrains Mono", "Noto Sans JP", monospace; color: var(--cyan);
  font-size: 0.7rem; letter-spacing: 0.08em;
  margin: 0.4rem 0 0; max-width: none; opacity: 0.85;
}
.service-foot .link-cyan { white-space: nowrap; }
.service-foot {
  margin-top: 0.9rem !important; font-size: 0.78rem;
  color: var(--muted); font-family: "JetBrains Mono", "Noto Sans JP", monospace; letter-spacing: 0.05em;
}

/* ---- Pricing strip (CTA) ---- */
.price-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem;
  margin: 0.9rem 0 0;
}
.price-item {
  border: 1px solid rgba(0,229,255,0.22);
  border-left: 2px solid var(--cyan);
  padding: 0.55rem 0.7rem;
  background: rgba(0,229,255,0.04);
  display: flex; flex-direction: column; gap: 0.25rem;
}
.price-label {
  font-family: "JetBrains Mono", "Noto Sans JP", monospace; color: var(--muted);
  font-size: 0.6rem; letter-spacing: 0.2em;
}
.price-value {
  font-family: "JetBrains Mono", "Noto Sans JP", monospace; color: var(--fg);
  font-size: 0.9rem; font-weight: 700; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.price-value small {
  font-weight: 400; color: var(--muted); font-size: 0.72em; margin-left: 0.3em;
}

/* ---- Pilot Partner strip ---- */
.pilot-strip {
  margin: 0.6rem 0 0; padding: 0.5rem 0.75rem;
  background: rgba(0,229,255,0.06);
  border: 1px solid rgba(0,229,255,0.3);
  display: flex; align-items: center; gap: 0.7rem;
  font-size: 0.76rem; line-height: 1.45;
  color: var(--fg); opacity: 0.95;
}
.pilot-badge {
  font-family: "JetBrains Mono", "Noto Sans JP", monospace; color: var(--bg);
  background: var(--kin); font-size: 0.62rem;
  letter-spacing: 0.2em; padding: 0.2rem 0.55rem;
  flex-shrink: 0;
}
.pilot-text b { color: var(--cyan); }

.cta-sub {
  margin-top: 0.7rem !important; font-size: 0.78rem; color: var(--muted);
}
.link-cyan {
  color: var(--cyan); text-decoration: none;
  border-bottom: 1px solid rgba(0,229,255,0.4);
}
.link-cyan:hover { color: var(--fg); border-bottom-color: var(--fg); }

/* カードが画面に収まらない時の内部スクロール許可（極端に低い画面向けの保険）。max-height は親 padding (6.8rem) と揃える */
.overlay-card { max-height: calc(100vh - 6.2rem); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(0,229,255,0.55) transparent; }

/* CTA は情報密度が高いので見出しをやや小さめに固定し、確実に1画面へ収める */
section[data-overlay=cta] h2 { font-size: clamp(1.4rem, 2.1vw, 1.75rem); margin-bottom: 0.5rem; }
section[data-overlay=cta] > .overlay-card > p { margin-top: 0.4rem; }
.overlay-card::-webkit-scrollbar { width: 8px; }
.overlay-card::-webkit-scrollbar-thumb { background: rgba(0,229,255,0.55); border-radius: 4px; }
.overlay-card::-webkit-scrollbar-track { background: rgba(0,229,255,0.06); }

/* ---- Subpage (no 3D, scrollable) ---- */
body.page-subpage { background: var(--bg); overflow-x: hidden; }
body.page-subpage::after { content: ""; position: fixed; inset: 0; background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,229,255,0.02) 2px, rgba(0,229,255,0.02) 4px); pointer-events: none; z-index: 6; }
.subpage-content { max-width: 960px; margin: 0 auto; padding: 8rem 8vw 6rem; position: relative; z-index: 2; }
.page-header { margin-bottom: 4rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(0,229,255,0.15); }
.page-eyebrow { font-family: "JetBrains Mono", "Noto Sans JP", monospace; color: var(--cyan); font-size: 0.75rem; letter-spacing: 0.25em; margin-bottom: 1rem; }
.page-header h1 { font-family: Inter, "Noto Sans JP", sans-serif; color: var(--fg); font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 700; letter-spacing: -0.01em; }
.subpage-section { margin-bottom: 4rem; }
.subpage-section h2 { font-family: Inter, "Noto Sans JP", sans-serif; font-size: clamp(1.2rem, 2vw, 1.6rem); color: var(--cyan); font-family: "JetBrains Mono", "Noto Sans JP", monospace; letter-spacing: 0.15em; margin-bottom: 1.25rem; padding-bottom: 0.6rem; border-bottom: 1px solid rgba(0,229,255,0.15); font-weight: 400; }
.subpage-section h3 { font-family: Inter, "Noto Sans JP", sans-serif; font-size: 1.1rem; color: var(--fg); font-weight: 700; margin: 1.5rem 0 0.5rem; }
.subpage-section p { color: var(--muted); font-size: 0.95rem; line-height: 1.85; margin: 0.6rem 0; max-width: none; }
.subpage-section ul { color: var(--muted); padding-left: 1.5rem; font-size: 0.95rem; line-height: 1.85; }
.subpage-section dl { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 1rem; }
.subpage-section dt { font-family: Inter, "Noto Sans JP", sans-serif; color: var(--fg); font-weight: 700; font-size: 1rem; margin-bottom: 0.5rem; }
.subpage-section dd { color: var(--muted); font-size: 0.9rem; line-height: 1.85; padding-left: 1rem; border-left: 2px solid rgba(0,229,255,0.2); }
.subpage-section table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.subpage-section th, .subpage-section td { padding: 0.85rem 1rem; text-align: left; font-size: 0.9rem; border-bottom: 1px solid rgba(255,255,255,0.06); }
.subpage-section th { font-family: "JetBrains Mono", "Noto Sans JP", monospace; color: var(--cyan); font-weight: 400; letter-spacing: 0.1em; font-size: 0.8rem; width: 28%; vertical-align: top; }
.subpage-section td { color: var(--fg); }
.subpage-footer { max-width: 960px; margin: 0 auto; padding: 2rem 8vw 4rem; border-top: 1px solid rgba(255,255,255,0.06); color: var(--muted); font-family: "JetBrains Mono", "Noto Sans JP", monospace; font-size: 0.75rem; line-height: 2; position: relative; z-index: 2; }
.subpage-footer a { color: var(--muted); text-decoration: none; border-bottom: 1px solid rgba(0,229,255,0.2); }
.subpage-footer a:hover { color: var(--cyan); }

@media (max-width: 720px) {
  /* 3枚カードは縦積みせず横スワイプ(次カードの端を見せて誘導) */
  .why-grid, .service-grid {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; scrollbar-width: thin;
    scrollbar-color: rgba(0,229,255,0.45) transparent;
    padding-bottom: 0.35rem;
  }
  .why-card, .service-card { flex: 0 0 76%; scroll-snap-align: start; min-width: 0; }
  .team-preview { flex-direction: column; }

  /* --- モバイル圧縮: カード内スクロールを出さない --- */
  section[data-overlay] { padding: 3.4rem 4vw 1rem; }
  .overlay-card { max-height: calc(100vh - 4.4rem); padding: 1rem 1.1rem; max-width: 94vw; }
  h1 { font-size: clamp(1.7rem, 8vw, 2.2rem); }
  h2 { font-size: 1.3rem; margin-bottom: 0.4rem; }
  .overlay-card p, p { font-size: 0.85rem; line-height: 1.55; margin-top: 0.4rem; }
  .why-grid, .service-grid { gap: 0.6rem; margin-top: 0.7rem; }
  .why-card, .service-card { padding: 0.7rem 0.8rem; }
  .why-card p, .service-card p { font-size: 0.78rem; }
  .why-num { font-size: 1.05rem; }
  .why-card h3 { font-size: 0.95rem; margin: 0.25rem 0 0.3rem; }
  .step-list { grid-template-columns: 1fr; gap: 0.5rem; }
  section[data-overlay=process] > .overlay-card { max-width: 94vw; }
  .step p { font-size: 0.78rem; }
  .service-foot { font-size: 0.7rem; }
  .cta-button { margin-top: 0.8rem; padding: 0.75rem 1.5rem; }
  .overlay-card footer { margin-top: 0.6rem; padding-top: 0.5rem; font-size: 0.64rem; line-height: 1.5; }
  .overlay-more { margin-top: 0.8rem; }
  .hud-counter { margin-top: 0.6rem; font-size: 0.62rem; }
  .metric-note { font-size: 0.62rem; }

  /* ヒーロー指標: 3列→縦積みの行型(ラベル左・値右)で横あふれ解消 */
  .hero-metrics { grid-template-columns: 1fr; gap: 0.45rem; margin-top: 0.8rem; }
  .metric { flex-direction: row; align-items: baseline; justify-content: space-between; padding: 0.5rem 0.8rem; }
  .metric-value { font-size: 1.2rem; }

  /* ヘッダー: リンクは隠して ロゴ + Contact のみ(見切れ防止) */
  #site-header { padding: 0.9rem 4vw; }
  nav { gap: 0.8rem; }
  nav a:not(.nav-cta) { display: none; }

  /* セクションドットは非表示(カードと重なるため。スワイプ/キーで送り可能) */
  #section-nav { display: none; }
  .price-strip { gap: 0.4rem; }
  .price-item { padding: 0.45rem 0.55rem; }
  .pilot-strip { font-size: 0.7rem; line-height: 1.45; padding: 0.5rem 0.7rem; }
}


@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ===== Hero metric note ===== */
.metric-note { font-family: "JetBrains Mono", "Noto Sans JP", monospace; font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em; margin-top: 0.65rem !important; opacity: 0.85; }

/* ===== Inline CTA inside service overlay ===== */
.cta-button.cta-inline { margin-top: 0.9rem; padding: 0.65rem 1.6rem; font-size: 0.78rem; }

/* ===== Nav: Contact as CTA ===== */
nav a.nav-cta { color: var(--kin); border: 1px solid rgba(233,183,42,0.5); padding: 0.4rem 0.9rem; letter-spacing: 0.18em; transition: background 0.2s, color 0.2s; }
nav a.nav-cta:hover { background: var(--kin); color: var(--bg); }

/* ===== ローディング画面: クリティカル CSS は index.html にインライン化 ===== */

/* ===== Subpage HUD enhancements (v12b 2026-05-24) ===== */

.hud-file-tag {
  position: fixed;
  top: 4.6rem;
  left: 8vw;
  z-index: 105;
  color: var(--cyan);
  background: rgba(5,7,12,0.7);
  padding: 0.3rem 0.7rem;
  border-left: 2px solid var(--cyan);
  font-family: "JetBrains Mono", "Noto Sans JP", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  pointer-events: none;
  opacity: 0.85;
}

.subpage-section h2 .sec-no {
  font-family: "JetBrains Mono", "Noto Sans JP", monospace;
  color: var(--cyan);
  opacity: 0.5;
  margin-right: 0.8em;
  font-size: 0.85em;
}

.eof-marker {
  color: var(--cyan);
  font-family: "JetBrains Mono", "Noto Sans JP", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  opacity: 0.7;
  margin-bottom: 1rem;
}

.subpage-cta {
  max-width: 960px;
  margin: 4rem auto 0;
  padding: 3rem 8vw;
  border-top: 1px solid rgba(0,229,255,0.25);
  border-bottom: 1px solid rgba(0,229,255,0.25);
  background: rgba(0,229,255,0.03);
  position: relative;
  z-index: 2;
}

.subpage-cta .cta-eyebrow {
  color: var(--cyan);
  font-family: "JetBrains Mono", "Noto Sans JP", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  margin-bottom: 1rem;
}

.subpage-cta h2 {
  color: var(--fg);
  font-family: Inter, "Noto Sans JP", sans-serif;
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.subpage-cta .cta-sub {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 1.2rem !important;
}

.link-cyan {
  color: var(--cyan) !important;
  border-bottom: 1px solid rgba(0,229,255,0.3);
}

/* ===== 画面高が低い環境(ノートPCのブラウザ実寸内高など)でもカード内スクロールを出さない圧縮 ===== */
@media (max-height: 760px) {
  section[data-overlay] { padding: 3.6rem 5vw 1.4rem; }
  .overlay-card { max-height: calc(100vh - 5rem); padding: clamp(1.1rem, 2vw, 1.6rem) clamp(1.2rem, 2.2vw, 1.8rem); }
  h1 { font-size: clamp(1.9rem, 4.2vw, 3.2rem); }
  h2 { font-size: clamp(1.35rem, 2.2vw, 1.8rem); margin-bottom: 0.45rem; }
  .overlay-card p, p { font-size: 0.88rem; line-height: 1.5; margin-top: 0.4rem; }
  .why-grid, .service-grid { gap: 0.8rem; margin-top: 0.8rem; }
  .why-card, .service-card { padding: 0.8rem 0.9rem; }
  .why-card p, .service-card p, .step p { font-size: 0.8rem; }
  .step-list { gap: 0.5rem 1.4rem; }
  .hero-metrics { margin-top: 0.8rem; }
  .metric { padding: 0.45rem 0.7rem; }
  .metric-value { font-size: 1.35rem; }
  .price-strip { margin-top: 0.7rem; }
  .pilot-strip { margin-top: 0.5rem; font-size: 0.72rem; line-height: 1.4; }
  .cta-button { margin-top: 0.8rem; padding: 0.7rem 1.8rem; }
  .cta-sub { margin-top: 0.5rem !important; }
  .overlay-card footer { margin-top: 0.6rem; padding-top: 0.5rem; font-size: 0.66rem; line-height: 1.45; }
  .overlay-card .hud-counter { margin-top: 0.6rem; }
  .team-card { padding: 0.9rem 1.1rem; }
  .overlay-more { margin-top: 0.8rem; }
  section[data-overlay=cta] h2 { font-size: clamp(1.25rem, 1.9vw, 1.5rem); }
}

/* ===== 日本語の改行制御（Chrome/Edge 119+: 文節=BudouX単位で折り返し、禁則厳守） ===== */
/* 本文・カード内テキストは文節境界で折り返し、単語の途中で割らない */
.overlay-card,
.subpage-content { word-break: auto-phrase; line-break: strict; overflow-wrap: normal; }
/* 見出しは行長を均等化して2行目の孤立文字（例:「る。」）を防ぐ */
.overlay-card h1, .overlay-card h2, .overlay-card h3,
.page-header h1, .subpage-section h2, .subpage-section h3 { text-wrap: balance; }
/* 段落は最終行が1〜2文字だけ残らないように（ぶら下がり防止） */
.overlay-card p, .subpage-section p { text-wrap: pretty; }
/* 数値+単位・範囲・記号ペアは分割しない（例:「−60〜80%」「6〜8 週」「3 社限定」） */
.service-effect b, .pilot-text b, .price-value, .metric-value,
.step-meta, .service-cost .nw, .nw { white-space: nowrap; }
/* 価格ボックスの補足は値の下段へ独立させ、単位を割らない */
.price-value small { display: block; white-space: nowrap; margin-left: 0; margin-top: 0.12rem; }

/* 情報密度の高い Services / CTA はカード幅を広げ折り返し負荷を下げる（高さも縮む） */
section[data-overlay=services] > .overlay-card { max-width: min(620px, 94vw); }
section[data-overlay=cta] > .overlay-card { max-width: min(600px, 94vw); }

/* 小型スマホ(幅720px以下 かつ 高さ780px以下)はさらに圧縮 */
@media (max-width: 720px) and (max-height: 780px) {
  section[data-overlay] { padding: 3rem 4vw 0.7rem; }
  .overlay-card { max-height: calc(100vh - 3.8rem); padding: 0.8rem 0.9rem; }
  h2 { font-size: 1.15rem; }
  .overlay-card p, p { font-size: 0.78rem; line-height: 1.45; margin-top: 0.3rem; }
  .overlay-eyebrow { margin-bottom: 0.5rem; }
  .why-card, .service-card { padding: 0.55rem 0.65rem; }
  .why-card p, .service-card p, .step p { font-size: 0.72rem; }
  .why-card h3 { font-size: 0.88rem; }
  .service-card h3 { font-size: 0.78rem; margin-bottom: 0.3rem; }
  .service-card .service-effect { font-size: 0.7rem; }
  .service-card .service-cost { font-size: 0.64rem; }
  .step h3 { font-size: 0.85rem; margin-bottom: 0.1rem; }
  .step p { line-height: 1.35; }
  .step-meta { font-size: 0.6rem; margin-top: 0.15rem; }
  .step-list { gap: 0.3rem; }
  .step { gap: 0.8rem; }
  /* CTA(最終)も1画面に収める */
  .price-strip { gap: 0.3rem; margin-top: 0.5rem; }
  .price-item { padding: 0.35rem 0.5rem; }
  .price-value { font-size: 0.78rem; }
  .price-label { font-size: 0.55rem; }
  .pilot-strip { font-size: 0.66rem; line-height: 1.35; padding: 0.4rem 0.6rem; margin-top: 0.4rem; }
  .cta-button { margin-top: 0.6rem; padding: 0.6rem 1.3rem; font-size: 0.78rem; }
  .cta-sub { margin-top: 0.4rem !important; font-size: 0.7rem; }
  .overlay-card footer { font-size: 0.6rem; line-height: 1.4; margin-top: 0.5rem; padding-top: 0.4rem; }
  section[data-overlay=cta] h2 { font-size: 1.1rem; }
}

/* ===== ビル・ホバーのデータツールチップ(デスクトップ専用・JSが生成) ===== */
#bld-tip {
  position: fixed; top: 0; left: 0; z-index: 60; pointer-events: none;
  font-family: "JetBrains Mono", "Noto Sans JP", monospace; font-size: 11px; letter-spacing: 0.08em;
  color: #BFF6FF; background: rgba(5, 10, 18, 0.88); border: 1px solid rgba(0, 229, 255, 0.45);
  padding: 5px 9px; opacity: 0; transition: opacity 0.18s ease; white-space: nowrap;
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.12);
}
#bld-tip.on { opacity: 1; }

/* ===== 環境音トグル(デフォルトOFF・オプトイン) ===== */
#sound-toggle {
  position: fixed; left: 18px; bottom: 16px; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  background: rgba(5, 10, 18, 0.6); border: 1px solid rgba(0, 229, 255, 0.3);
  color: var(--muted); font-family: "JetBrains Mono", "Noto Sans JP", monospace;
  font-size: 10px; letter-spacing: 0.14em;
  padding: 7px 12px; cursor: pointer; opacity: 0;
  transition: opacity 0.6s ease, border-color 0.2s ease, color 0.2s ease;
}
body.app-ready #sound-toggle { opacity: 1; }
#sound-toggle:hover, #sound-toggle:focus-visible { border-color: rgba(0, 229, 255, 0.7); color: var(--fg, #E8ECF1); }
#sound-toggle .st-wave { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
#sound-toggle .st-wave i { width: 2px; height: 4px; background: currentColor; }
#sound-toggle.on { color: #00E5FF; border-color: rgba(0, 229, 255, 0.65); }
#sound-toggle.on .st-wave i { animation: st-eq 0.9s ease-in-out infinite; }
#sound-toggle.on .st-wave i:nth-child(2) { animation-delay: 0.15s; }
#sound-toggle.on .st-wave i:nth-child(3) { animation-delay: 0.3s; }
@keyframes st-eq { 0%, 100% { height: 4px; } 50% { height: 10px; } }
@media (prefers-reduced-motion: reduce) { #sound-toggle.on .st-wave i { animation: none; } }

/* ===================== Phase 2: 参加化 UI ===================== */

/* 小型ボタン(ゲーム起動・住民ID等) */
.card-actions { display: flex; align-items: center; gap: 0.9rem; flex-wrap: wrap; }
.mini-btn {
  display: inline-block; background: transparent; cursor: pointer;
  border: 1px solid rgba(0, 229, 255, 0.45); color: var(--cyan);
  font-family: "JetBrains Mono", "Noto Sans JP", monospace;
  font-size: 0.72rem; letter-spacing: 0.08em; padding: 0.55rem 1rem;
  margin-top: 1.1rem; text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.mini-btn:hover { background: rgba(0, 229, 255, 0.12); }
.mini-btn.gold { border-color: rgba(233, 183, 42, 0.6); color: var(--kin); }
.mini-btn.gold:hover { background: var(--kin); color: var(--bg); }
.card-actions .mini-btn { margin-top: 1.1rem; }

/* 長押しヒント */
#hold-hint {
  position: fixed; bottom: 44px; left: 50%; transform: translateX(-50%);
  z-index: 50; pointer-events: none;
  font-family: "JetBrains Mono", "Noto Sans JP", monospace;
  font-size: 0.72rem; letter-spacing: 0.18em; color: var(--kin);
  background: rgba(5, 10, 18, 0.6); border: 1px solid rgba(233, 183, 42, 0.4);
  padding: 0.5rem 1.1rem; opacity: 0; transition: opacity 0.5s ease;
}
#hold-hint.on { opacity: 1; animation: hh-pulse 2.2s ease-in-out infinite; }
@keyframes hh-pulse { 0%, 100% { border-color: rgba(233,183,42,0.4); } 50% { border-color: rgba(233,183,42,0.9); } }

/* AIの目: 注釈チップ(3D投影で JS が transform を更新) */
.ai-anno {
  position: fixed; top: 0; left: 0; z-index: 55; pointer-events: none;
  font-family: "JetBrains Mono", "Noto Sans JP", monospace; font-size: 0.72rem;
  letter-spacing: 0.06em; color: #0B0D12; background: var(--kin);
  padding: 0.3rem 0.65rem; white-space: nowrap;
  opacity: 0; translate: 0 6px; transition: opacity 0.35s ease, translate 0.35s ease;
  box-shadow: 0 0 18px rgba(233, 183, 42, 0.35);
}
.ai-anno.warn { background: var(--sango); }
.ai-anno.on { opacity: 1; translate: 0 0; }

/* AIの目: 発動中の金ビネット */
body.ai-eye::after {
  background:
    radial-gradient(ellipse 72% 62% at 50% 50%, transparent 55%, rgba(233, 183, 42, 0.10) 100%),
    repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(233,183,42,0.03) 2px, rgba(233,183,42,0.03) 4px);
}

/* 解析後CTAチップ */
#ai-cta {
  position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%) translateY(8px);
  z-index: 60; opacity: 0; pointer-events: none; transition: opacity 0.45s ease, transform 0.45s ease;
}
#ai-cta.on { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
#ai-cta a {
  display: inline-block; text-decoration: none;
  font-family: "JetBrains Mono", "Noto Sans JP", monospace; font-size: 0.78rem; letter-spacing: 0.06em;
  color: var(--bg); background: var(--kin); padding: 0.75rem 1.4rem;
  box-shadow: 0 8px 30px rgba(233, 183, 42, 0.3);
}
#ai-cta a:hover { background: var(--kin-bright); }

/* vs AI ゲームパネル */
#vs-game {
  position: fixed; z-index: 200; left: 50%; bottom: 5vh; transform: translateX(-50%);
  width: min(720px, 94vw); max-height: 88vh; overflow-y: auto;
  background: rgba(6, 10, 18, 0.96); border: 1px solid rgba(233, 183, 42, 0.45);
  border-top: 3px solid var(--kin);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  padding: 1.1rem 1.3rem 1.2rem;
}
.vsg-head { display: flex; align-items: baseline; gap: 1rem; }
.vsg-title { font-family: "JetBrains Mono", monospace; color: var(--kin); font-size: 0.8rem; letter-spacing: 0.16em; }
.vsg-q { color: var(--fg); font-size: 0.95rem; font-weight: 700; }
.vsg-x {
  margin-left: auto; background: none; border: none; color: var(--muted);
  font-size: 1.3rem; cursor: pointer; line-height: 1; padding: 0.2rem 0.4rem;
}
.vsg-x:hover { color: var(--fg); }
.vsg-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; margin-top: 0.9rem; }
.vsg-opt {
  text-align: left; background: rgba(0, 229, 255, 0.04); cursor: pointer;
  border: 1px solid rgba(0, 229, 255, 0.25); padding: 0.7rem 0.8rem; color: var(--fg);
  display: flex; flex-direction: column; gap: 0.25rem;
  transition: border-color 0.15s, background 0.15s;
}
.vsg-opt:hover { border-color: var(--kin); background: rgba(233, 183, 42, 0.08); }
.vsg-opt b { color: var(--kin); font-family: "JetBrains Mono", monospace; }
.vsg-name { font-size: 0.83rem; font-weight: 700; }
.vsg-data { font-size: 0.78rem; color: var(--fg); opacity: 0.9; }
.vsg-note { font-size: 0.72rem; color: var(--muted); }
.vsg-timer { margin-top: 0.9rem; height: 4px; background: rgba(255, 255, 255, 0.08); }
.vsg-fill {
  display: block; height: 100%; width: 100%;
  background: repeating-linear-gradient(90deg, var(--kin) 0 10px, transparent 10px 12px, var(--kin) 12px 20px, transparent 20px 22px);
}
.vsg-hint { margin-top: 0.5rem; font-size: 0.72rem; color: var(--muted); font-family: "JetBrains Mono", "Noto Sans JP", monospace; }
.vsg-verdict { font-size: 1rem; font-weight: 700; margin-top: 0.8rem; }
.vsg-verdict.win { color: var(--kin); }
.vsg-verdict.lose { color: var(--sango); }
.vsg-yields { list-style: none; display: flex; gap: 1.2rem; margin-top: 0.7rem; font-family: "JetBrains Mono", "Noto Sans JP", monospace; font-size: 0.82rem; color: var(--fg); flex-wrap: wrap; }
.vsg-yields b { color: var(--muted); margin-right: 0.3em; }
.vsg-yields .ans { color: var(--kin); }
.vsg-reason { margin-top: 0.7rem; font-size: 0.82rem; color: var(--muted); line-height: 1.7; max-width: none; }
.vsg-cta {
  display: inline-block; margin-top: 1rem; text-decoration: none;
  color: var(--bg); background: var(--kin); padding: 0.8rem 1.5rem;
  font-family: "JetBrains Mono", "Noto Sans JP", monospace; font-size: 0.8rem; letter-spacing: 0.05em;
}
.vsg-cta:hover { background: var(--kin-bright); }

/* 住民IDモーダル */
#res-modal {
  position: fixed; inset: 0; z-index: 210; background: rgba(3, 5, 9, 0.82);
  display: flex; align-items: center; justify-content: center; padding: 4vh 4vw;
}
#res-modal[hidden] { display: none; }
.resm-box { max-width: 640px; width: 100%; text-align: center; }
.resm-img { width: 100%; height: auto; border: 1px solid rgba(233, 183, 42, 0.5); box-shadow: 0 30px 90px rgba(0, 0, 0, 0.8); }
.resm-note { margin: 0.9rem auto 0; font-size: 0.85rem; color: var(--fg); opacity: 0.9; }
.resm-actions { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; margin-top: 0.4rem; }

/* エンドロール */
#credits { position: fixed; inset: 0; z-index: 220; background: rgba(4, 6, 11, 0.96); overflow: hidden; }
#credits[hidden] { display: none; }
.cr-crawl { position: absolute; inset: 0; display: flex; justify-content: center; }
.cr-inner {
  align-self: flex-end; text-align: center;
  animation: cr-up 26s linear forwards;
  font-family: "JetBrains Mono", "Noto Sans JP", monospace;
}
.cr-inner p { color: var(--muted); font-size: 0.9rem; letter-spacing: 0.2em; margin: 1.4rem 0; max-width: none; }
.cr-inner .cr-t { color: var(--kin); font-size: 1.1rem; letter-spacing: 0.3em; }
.cr-inner .cr-end { color: var(--fg); font-size: 1.3rem; letter-spacing: 0.4em; margin-top: 4rem; }
@keyframes cr-up { from { transform: translateY(100%); } to { transform: translateY(-160%); } }
.cr-x { position: absolute; top: 18px; right: 22px; font-size: 1.6rem; }
@media (prefers-reduced-motion: reduce) {
  .cr-inner { animation: none; align-self: center; }
  #hold-hint.on { animation: none; }
}

/* モバイル調整 */
@media (max-width: 760px) {
  .vsg-opts { grid-template-columns: 1fr; }
  #vs-game { bottom: 2vh; padding: 0.9rem 0.9rem 1rem; }
  .ai-anno { font-size: 0.64rem; padding: 0.24rem 0.5rem; }
  .vsg-yields { gap: 0.7rem; }
}
