/* 持続可能な明日への旅 360°VR — 紹介ページ共通スタイル */
:root {
  --bg: #12171b;
  --surface: #1b2226;
  --surface-2: #232c31;
  --line: rgba(255, 255, 255, 0.12);
  --text: #e9eef0;
  --muted: #a8b4ba;
  --accent: #4cc38a;
  --accent-2: #e44c65;
  --gray: #8a949a;
  --sky: #4aa8d8;
  --radius: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  -webkit-text-size-adjust: 100%;
}

body[lang="en"], html[lang="en"] body { line-height: 1.7; }

a { color: var(--accent); }
a:hover { color: #7fe0b0; }

img { max-width: 100%; height: auto; }

/* ---------- header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-left));
  background: rgba(18, 23, 27, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); text-decoration: none; font-weight: 700; font-size: 0.95rem; }
.topnav a { white-space: nowrap; }
.brand:hover { color: var(--text); }
.topnav { display: flex; gap: 6px 14px; flex-wrap: wrap; justify-content: flex-end; font-size: 0.88rem; }
.topnav a { color: var(--muted); text-decoration: none; }
.topnav a:hover { color: var(--text); }
.topnav .lang-link {
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
}

/* ---------- layout ---------- */
main { max-width: 1040px; margin: 0 auto; padding: 0 16px 64px; }

.hero { padding: 40px 0 8px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em; }
h1 { margin: 0 0 12px; font-size: clamp(1.7rem, 5vw, 2.6rem); line-height: 1.3; }
h1 .badge {
  display: inline-block;
  margin-left: 0.3em;
  padding: 0 0.45em;
  font-size: 0.55em;
  vertical-align: 0.35em;
  border: 2px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
}
.lead { margin: 0 0 20px; color: var(--muted); max-width: 46em; }

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
.player iframe, .player #player { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.player-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.btn {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #0b1a12;
  font-weight: 700;
  text-decoration: none;
}
.btn:hover { background: #7fe0b0; color: #0b1a12; }

.block { padding: 48px 0 0; }
.block > h2 {
  margin: 0 0 18px;
  font-size: clamp(1.3rem, 3.5vw, 1.7rem);
  line-height: 1.4;
  padding-left: 14px;
  border-left: 5px solid var(--accent);
}
.block > p { max-width: 50em; }

h3 { margin: 0 0 8px; font-size: 1.08rem; line-height: 1.5; }

/* ---------- cards ---------- */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.card h3 { display: flex; align-items: center; gap: 10px; }
.card h3 .icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(76, 195, 138, 0.15);
  color: var(--accent);
}
.card ul { margin: 0; padding-left: 1.2em; }
.card li + li { margin-top: 4px; }
.card p { margin: 0 0 8px; }
.card .note { color: var(--muted); font-size: 0.88rem; margin-top: 10px; }

kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 0 0.4em;
  font: 700 0.82em/1.6 ui-monospace, SFMono-Regular, Consolas, monospace;
  text-align: center;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 6px;
}

.tip {
  margin: 16px 0 0;
  padding: 14px 18px;
  background: rgba(74, 168, 216, 0.1);
  border: 1px solid rgba(74, 168, 216, 0.35);
  border-radius: var(--radius);
  font-size: 0.93rem;
}
.tip strong { color: var(--sky); }

/* ---------- how it works ---------- */
.figure {
  margin: 0 0 20px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.figure svg { display: block; width: 100%; height: auto; }
.figure figcaption { margin-top: 8px; color: var(--muted); font-size: 0.85rem; }

.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 14px 16px 14px 58px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #0b1a12;
  font-weight: 700;
  font-size: 0.9rem;
}
.steps h3 { margin-bottom: 2px; }
.steps p { margin: 0; color: var(--muted); }

/* ---------- 図解（仕組み） ---------- */
.lesson { margin: 0 0 22px; padding: 22px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.lesson-head { display: flex; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.lesson-no {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #0b1a12;
  font-weight: 800;
  transform: translateY(6px);
}
.lesson h3 { font-size: 1.15rem; margin: 0; }
.lesson > p { margin: 0 0 14px; color: var(--muted); }
.lesson > p strong { color: var(--text); }
.point {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(76, 195, 138, 0.1);
  font-size: 0.93rem;
}
.point::before { content: "ポイント"; margin-right: 0.6em; font-weight: 800; color: var(--accent); }
html[lang="en"] .point::before { content: "Key idea"; }

.dg { display: block; width: 100%; height: auto; overflow: hidden; }
.dg text { fill: var(--text); font-family: inherit; }
.dg .muted { fill: var(--muted); }
.dg .lbl { paint-order: stroke; stroke: rgba(0, 0, 0, 0.6); stroke-width: 4px; stroke-linejoin: round; }

.dg-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dg-flow { display: grid; grid-template-columns: 1fr auto 1.5fr; gap: 10px; align-items: center; }
.dg-arrow { color: var(--accent); font-weight: 800; text-align: center; font-size: 0.9rem; line-height: 1.3; }
.dg-arrow span { display: block; font-size: 1.8rem; line-height: 1; }
.dg-box { margin: 0; background: var(--surface-2); border-radius: 12px; padding: 10px; }
.dg-box figcaption { text-align: center; font-weight: 700; font-size: 0.92rem; margin-bottom: 4px; }

.crop-demo { display: grid; gap: 10px; justify-items: center; }
.crop-demo .dg-box { width: 100%; }
.phone {
  width: min(360px, 100%);
  padding: 10px;
  border-radius: 22px;
  background: #050708;
  border: 2px solid #3a464d;
}
.phone { overflow: hidden; }
.eqmap, .persp, .viewer canvas { display: block; width: 100%; height: auto; border-radius: 8px; background: #000; }
.persp { border-radius: 12px; }
.demo-readout { margin: 0; text-align: center; color: var(--muted); font-size: 0.85rem; }
.demo-readout b { color: #ffd75e; font-variant-numeric: tabular-nums; }
.phone svg { overflow: hidden; display: block; width: 100%; height: auto; border-radius: 12px; }

/* 体験デモ */
.try { display: grid; gap: 12px; }
.viewer {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  outline: none;
  background: #000;
}
.viewer:active { cursor: grabbing; }
.viewer:focus-visible { box-shadow: 0 0 0 3px var(--sky); }
.viewer svg { display: block; width: 100%; height: auto; }
.viewer .hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 0.85rem;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.4s;
}
.viewer.used .hint { opacity: 0; }
.try-ctrl { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.try-ctrl button {
  min-width: 48px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.try-ctrl button:hover { border-color: var(--accent); }
.minimap { position: relative; }
.minimap figcaption { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: 4px; }
/* 横長画面：見ている画面と展開画像の枠を左右に並べ、同時に見比べられるようにする */
@media (min-width: 820px) {
  /* ステップ4：展開画像（左）→ 画面（右） */
  .crop-demo { grid-template-columns: minmax(0, 1.2fr) auto minmax(0, 1fr); column-gap: 14px; align-items: center; }
  .crop-demo > .dg-box { grid-column: 1; }
  .crop-demo > .dg-arrow { grid-column: 2; max-width: 6.5em; }
  .crop-demo > .dg-arrow span { transform: rotate(-90deg); }
  .crop-demo > .phone { grid-column: 3; width: 100%; }
  .crop-demo > .demo-readout { grid-column: 1 / -1; }
  /* ステップ5：見回す画面（左）・展開画像（右） */
  .try { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; align-items: start; }
  .try > .viewer, .try > .try-ctrl, .try > .demo-readout { grid-column: 1; }
  .try > .minimap { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
}

/* 制作の流れ */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.flow li {
  position: relative;
  padding: 16px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 2px solid transparent;
  text-align: center;
  animation: flow-glow 8s infinite;
}
.flow li:nth-child(2) { animation-delay: 2s; }
.flow li:nth-child(3) { animation-delay: 4s; }
.flow li:nth-child(4) { animation-delay: 6s; }
.flow li:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-weight: 800;
}
.flow svg { width: 56px; height: 56px; display: block; margin: 0 auto 6px; }
.flow b { display: block; font-size: 0.95rem; line-height: 1.5; }
.flow small { display: block; color: var(--muted); font-size: 0.82rem; line-height: 1.6; margin-top: 4px; }
@keyframes flow-glow {
  0%, 30%, 100% { border-color: transparent; transform: none; }
  6%, 22% { border-color: var(--accent); transform: translateY(-4px); }
}

@media (max-width: 760px) {
  .flow { grid-template-columns: 1fr 1fr; }
  .flow li:nth-child(2)::after { content: none; }
}
@media (max-width: 640px) {
  .dg-pair, .dg-flow { grid-template-columns: 1fr; }
  .dg-flow .dg-arrow span { transform: rotate(90deg); }
  .lesson { padding: 18px 14px; }
  .flow { grid-template-columns: 1fr; gap: 24px; }
  .flow li::after { content: "↓" !important; right: auto !important; left: 50%; top: auto !important; bottom: -24px; transform: translateX(-50%) !important; }
  .flow li:last-child::after { content: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .flow li { animation: none; }
  .chapter .shot img { transition: none; }
}

/* ---------- chapters ---------- */
.chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.chapter {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  align-content: start;
  gap: 6px 20px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 6px solid var(--c, var(--accent));
  border-radius: var(--radius);
}
.chapter.now { --c: var(--sky); }
.chapter.bad { --c: var(--gray); }
.chapter.good { --c: var(--accent); }
.chapter.msg { --c: #e8b84a; }
.chapter .shot {
  grid-column: 1;
  grid-row: 1 / span 3;
  align-self: start;
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
}
.chapter .shot img { display: block; width: 100%; height: auto; transition: transform 0.3s; }
.chapter .shot:hover img, .chapter .shot:focus-visible img { transform: scale(1.04); }
.chapter .time, .chapter h3, .chapter p { grid-column: 2; }
.chapter .time {
  justify-self: start;
  align-self: start;
  min-width: 5.2em;
  padding: 4px 10px;
  border: 1px solid var(--c, var(--accent));
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: 700 0.85rem/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.chapter .time:hover, .chapter .time:focus-visible { background: var(--c, var(--accent)); color: #0b1a12; }
.chapter h3 { margin: 0; }
.chapter p { margin: 0; color: var(--muted); }

/* ---------- about / credits ---------- */
.about { display: grid; gap: 24px; grid-template-columns: 1fr auto; align-items: start; }
.credits { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; }
.credits dt { color: var(--muted); font-size: 0.9rem; }
.credits dd { margin: 0; }
.qr { margin: 0; text-align: center; font-size: 0.82rem; color: var(--muted); }
.qr img {
  display: block;
  width: 150px;
  height: 150px;
  object-fit: cover;
  background: #fff;
  border-radius: 10px;
  padding: 6px;
  margin: 0 auto 6px;
}

footer {
  margin-top: 64px;
  padding: 24px 16px 40px;
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
}
footer a { color: var(--muted); }

@media (max-width: 640px) {
  .hero { padding-top: 28px; }
  .player { border-radius: 10px; margin: 0 -4px; }
  .about { grid-template-columns: 1fr; }
  .credits { grid-template-columns: 1fr; gap: 0; }
  .credits dd { margin-bottom: 8px; }
  .chapter { grid-template-columns: 1fr; padding: 16px; }
  .chapter .shot, .chapter .time, .chapter h3, .chapter p { grid-column: 1; grid-row: auto; }
  .chapter .shot { margin-bottom: 8px; }
  .chapter .time { margin-bottom: 4px; }
  .topnav .hide-sm { display: none; }
}
