/* IVRESS FRONTIER — Recruit Portal
   Background: hero poster image (assets/poster.png).
   Hotspots overlay each company's object on the poster.
*/

:root {
  /* アクセントカラー — 昼: アンティークゴールド ／ 夜: パープル
     ([data-theme="night"] で下記6変数を上書きして全UIが切り替わる) */
  --accent: #c8a45d;
  --accent-light: #f0d895;
  --accent-deep: #9a722e;
  --accent-rgb: 200, 164, 93;
  --accent-light-rgb: 240, 216, 149;
  --accent-deep-rgb: 154, 114, 46;

  --ivress-gold: var(--accent);
  --ivress-gold-light: var(--accent-light);
  --ivress-gold-soft: rgba(var(--accent-rgb), 0.18);
  --ivress-gold-border: rgba(var(--accent-light-rgb), 0.55);
  --ivress-gold-deep: var(--accent-deep);

  --ink: #ffffff;
  --ink-soft: #b9b9c0;
  --paper: #1a1208;
  --paper-2: #261b0e;
  --ember: var(--accent-deep);
  --amber: var(--accent);
  --gold: var(--accent-light);
  --line: rgba(255, 255, 255, 0.6);
  --line-soft: rgba(255, 255, 255, 0.18);
  --bg: #0a0703;
  --noise-op: 0.05;
  --night-overlay-op: 0;
  --night-tint-op: 0;
}

[data-theme="night"] {
  --night-overlay-op: 0.15;
  --night-tint-op: 0.18;

  /* 夜モードはパープルアクセント */
  --accent: #8577ff;
  --accent-light: #cfc4ff;
  --accent-deep: #5e46ff;
  --accent-rgb: 134, 119, 255;
  --accent-light-rgb: 151, 138, 255;
  --accent-deep-rgb: 94, 70, 255;
}

/* Hour tweak — overrides theme, sets full color grade */
[data-hour="dawn"] {
  --grade-op: 0.4;
  --grade-color: 255, 200, 160;
  --grade-cool: 60, 40, 80;
  --grade-cool-op: 0.15;
}
[data-hour="day"] {
  --grade-op: 0.0;
  --grade-color: 255, 235, 200;
  --grade-cool: 100, 130, 200;
  --grade-cool-op: 0;
}
[data-hour="dusk"] {
  --grade-op: 0.55;
  --grade-color: 255, 130, 70;
  --grade-cool: 80, 30, 90;
  --grade-cool-op: 0.25;
}
[data-hour="night"] {
  --grade-op: 0.7;
  --grade-color: 30, 40, 90;
  --grade-cool: 20, 30, 70;
  --grade-cool-op: 0.55;
}

/* Atmosphere — fog/dust intensity */
[data-atmos="clear"] { --fog-op: 0; --dust-op: 0; }
[data-atmos="haze"]  { --fog-op: 0.35; --dust-op: 0.2; }
[data-atmos="storm"] { --fog-op: 0.7; --dust-op: 0.55; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter Tight', 'Helvetica Neue', Helvetica, 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  cursor: default;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.mono {
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  letter-spacing: 0.02em;
}

/* ============================================================
   GLOBAL POSTER STAGE — fills viewport, used both for opening + scene
   ============================================================ */
.poster-stage {
  position: fixed;
  inset: 0;
  overflow-x: auto;
  overflow-y: hidden;
  background: #000;
  overscroll-behavior: none; /* 端でのゴム引きで黒地が見えるのを防ぐ */
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb),0.5) rgba(0,0,0,0.3);
}
.poster-stage::-webkit-scrollbar { height: 8px; }
.poster-stage::-webkit-scrollbar-track { background: rgba(0,0,0,0.4); }
.poster-stage::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb),0.5); border-radius: 4px; }
.poster-stage::-webkit-scrollbar-thumb:hover { background: rgba(var(--accent-rgb),0.8); }

.poster-img {
  position: relative;
  /* dvh: モバイルのアドレスバー伸縮に追従し、常に見えている画面の
     高さいっぱいに動画を敷く(非対応ブラウザはvhにフォールバック) */
  height: 100vh;
  height: 100dvh;
  /* Width auto-grows to fit video aspect ratio at full viewport height */
  width: max(100vw, calc(100vh * 16 / 9));
  width: max(100vw, calc(100dvh * 16 / 9));
  background: #000;
  transition: filter 1.6s ease;
  will-change: filter;
}

.poster-img video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  transition: opacity 1.4s ease;
}
.poster-img .bg-video.is-hidden { opacity: 0; }
.poster-img .bg-video--night { z-index: 1; }
.poster-img .bg-video--day { z-index: 2; }
.poster-img .bg-video--day.is-hidden { z-index: 0; }

/* Overlay layers must span the full scrollable width */
.poster-stage > :not(.poster-img) {
  position: absolute;
  top: 0;
  left: 0;
  width: max(100vw, calc(100vh * 16 / 9));
  width: max(100vw, calc(100dvh * 16 / 9));
  height: 100vh;
  height: 100dvh;
  pointer-events: none;
}
.poster-stage > .hotspot-layer { pointer-events: none; }
.poster-stage > .hotspot-layer .hotspot { pointer-events: auto; }

/* Night overlay — bluish tint + darken */
.poster-night-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 25%, rgba(180,200,255,0.15) 0%, transparent 55%),
    linear-gradient(180deg, rgba(20,30,70,0.7) 0%, rgba(10,15,40,0.5) 60%, rgba(20,15,30,0.6) 100%);
  opacity: var(--night-overlay-op);
  pointer-events: none;
  transition: opacity 1.4s ease;
  mix-blend-mode: multiply;
}

/* Night accent overlay — adds cool glow */
.poster-night-tint {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 90% 22%, rgba(220,230,255,0.5) 0%, transparent 8%),
    radial-gradient(ellipse at 50% 0%, rgba(80,100,200,0.3) 0%, transparent 50%);
  opacity: var(--night-tint-op);
  pointer-events: none;
  mix-blend-mode: screen;
  transition: opacity 1.4s ease;
}

/* Hour grade overlay */
.poster-grade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: rgb(var(--grade-color));
  opacity: var(--grade-op, 0);
  mix-blend-mode: multiply;
  transition: opacity 1.4s ease, background 1.4s ease;
}
.poster-grade-cool {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 70% 25%, rgba(180,200,255,0.4) 0%, transparent 55%),
    linear-gradient(180deg, rgb(var(--grade-cool)) 0%, transparent 100%);
  opacity: var(--grade-cool-op, 0);
  mix-blend-mode: screen;
  transition: opacity 1.4s ease;
}

/* Atmosphere — fog & dust */
.poster-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.55) 100%);
}

.atmos-fog {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(220,200,170,0.55) 0%, rgba(180,150,110,0.2) 50%, rgba(120,90,60,0.4) 100%);
  opacity: var(--fog-op, 0);
  transition: opacity 1.6s ease;
  mix-blend-mode: screen;
}
.atmos-dust {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: var(--dust-op, 0);
  transition: opacity 1.6s ease;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.02' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/></svg>");
  mix-blend-mode: overlay;
  animation: dust-drift 30s linear infinite;
}
@keyframes dust-drift {
  0%   { background-position: 0 0; }
  100% { background-position: 800px -200px; }
}

/* Drifting clouds layer (CSS-only) — clip wrapper prevents drift transforms
   from extending the .poster-stage horizontal scroll width. */
.cloud-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.cloud {
  position: absolute;
  width: 220px;
  height: 60px;
  background: radial-gradient(ellipse, rgba(255,200,160,0.4) 0%, rgba(255,200,160,0) 70%);
  filter: blur(14px);
  pointer-events: none;
  animation: cloud-drift 80s linear infinite;
  opacity: 0.7;
}
.cloud--a { top: 8%; left: -10%; animation-duration: 95s; }
.cloud--b { top: 16%; left: -30%; width: 320px; animation-duration: 130s; animation-delay: -40s; opacity: 0.5; }
.cloud--c { top: 4%; left: -50%; width: 180px; animation-duration: 70s; animation-delay: -20s; opacity: 0.6; }

@keyframes cloud-drift {
  0% { transform: translateX(0); }
  100% { transform: translateX(160vw); }
}

[data-theme="night"] .cloud { opacity: 0.2; filter: blur(20px); }

/* Film grain */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: var(--noise-op);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* ============================================================
   OPENING STORY (overlays poster)
   ============================================================ */
.opening {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: opacity 0.9s ease;
}

.opening.hidden {
  opacity: 0;
  pointer-events: none;
}

.opening__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8,5,2,0.6) 0%, rgba(8,5,2,0.3) 30%, rgba(8,5,2,0.7) 100%);
  pointer-events: none;
}

.opening__topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 36px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.opening__topbar .brand {
  display: flex; align-items: center; gap: 14px; color: var(--ink);
}
.opening__topbar .brand__logo {
  height: 38px;
  width: auto;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.55));
  opacity: 0.95;
}
.opening__topbar .brand__sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.3em;
  opacity: 0.7;
  padding-left: 12px;
  border-left: 1px solid var(--line-soft);
}

.opening__skip {
  letter-spacing: 0.2em;
  cursor: pointer;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  transition: background 0.2s, color 0.2s;
}
.opening__skip:hover { background: var(--ink); color: var(--paper); }

.opening__stage {
  flex: 1;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8vw;
  overflow: hidden;
}

.opening__lines {
  position: relative;
  width: min(760px, calc(100vw - 48px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 2vw, 24px);
  padding: clamp(30px, 5vw, 56px);
  height: min(620px, calc(100vh - 148px));
  text-align: center;
  background:
    linear-gradient(180deg, rgba(14, 9, 4, 0.8) 0%, rgba(14, 9, 4, 0.56) 100%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow:
    0 0 0 1px rgba(var(--accent-rgb), 0.08) inset,
    0 24px 80px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
}

.opening__lines::before {
  content: "";
  position: absolute;
  pointer-events: none;
}

.opening__lines::before {
  inset: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.15);
}

/* Logo lock-up at top of the story */
.story-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: 4px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.4s ease, transform 1.4s cubic-bezier(.2,.7,.2,1);
  text-align: center;
  position: relative;
  z-index: 1;
}
.story-mark.is-in {
  opacity: 1;
  transform: translateY(0);
}
.story-mark img {
  height: 56px;
  width: auto;
  filter: drop-shadow(0 1px 8px rgba(0,0,0,0.6));
}
.story-mark__sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--amber);
  text-transform: uppercase;
  padding: 0 18px;
  background: rgba(10, 7, 3, 0.42);
}

.story-line {
  font-size: clamp(16px, 1.55vw, 21px);
  line-height: 1.95;
  font-weight: 350;
  color: var(--ink);
  text-wrap: pretty;
  /* Always rendered — opacity drives the entrance, no layout reflow */
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1.6s cubic-bezier(.4,0,.2,1), transform 1.6s cubic-bezier(.2,.7,.2,1);
  margin-bottom: 0;
  letter-spacing: 0.05em;
  text-shadow: 0 1px 12px rgba(0,0,0,0.6);
  /* prevent fonts from shifting around once visible */
  will-change: opacity, transform;
  position: relative;
  z-index: 1;
  max-width: 31em;
}
.story-line.is-in {
  opacity: 1;
  transform: translateY(0);
}
.story-line.is-title {
  font-size: clamp(16px, 1.55vw, 21px);
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1.45;
  margin-top: 8px;
  font-family: 'Cormorant Garamond', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  max-width: 18em;
}
.story-line .accent { color: var(--ember); }
.story-line .small {
  display: block;
  font-size: 11px;
  letter-spacing: 0.36em;
  color: var(--amber);
  text-transform: uppercase;
  margin-bottom: 18px;
  font-family: 'JetBrains Mono', monospace;
}

.opening__page {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: opening-page-in 0.75s cubic-bezier(.2,.7,.2,1) both;
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.opening__page.is-out {
  opacity: 0;
  transform: translateY(-8px);
  animation: none;
}

.opening__story-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(18px, 2vw, 26px);
}

.opening__page-line {
  max-width: 28em;
}

@keyframes opening-page-in {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.opening__actions {
  position: relative;
  z-index: 1;
  width: min(100%, 460px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.opening__audio-note {
  width: 100%;
  padding: 4px 8px 10px;
  border: none;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.opening__audio-note p {
  font-size: 12px;
  line-height: 1.8;
  color: var(--amber);
}

.opening__go {
  position: relative;
  z-index: 1;
  min-width: 132px;
  padding: 14px 26px;
  border: 1px solid var(--line);
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.opening__go:hover {
  background: var(--amber);
  color: var(--paper);
  border-color: var(--amber);
  transform: translateY(-2px);
}

.opening__go.is-disabled,
.opening__go:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.opening__go.is-disabled:hover,
.opening__go:disabled:hover {
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--ink);
  border-color: var(--line);
  transform: none;
}

.opening__progress {
  position: absolute;
  bottom: 30px;
  left: 36px;
  right: 36px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}
.opening__progress .bar {
  flex: 1;
  height: 1px;
  margin: 0 24px;
  background: var(--line-soft);
  overflow: hidden;
}
.opening__progress .bar-fill {
  display: block;
  height: 100%;
  background: var(--amber);
  width: 0%;
  transition: width 0.4s ease;
}

/* BGM choice */
.bgm-prompt {
  position: relative;
  z-index: 2;
  max-width: 520px;
  width: 100%;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s ease, transform 0.9s ease;
  pointer-events: none;
}
.bgm-prompt.is-in { opacity: 1; transform: translateY(0); pointer-events: auto; }
.bgm-prompt__label {
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 16px;
  font-family: 'JetBrains Mono', monospace;
}
.bgm-prompt__title {
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 500;
  letter-spacing: -0.005em;
  margin-bottom: 24px;
  font-family: 'Cormorant Garamond', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  text-shadow: 0 2px 14px rgba(0,0,0,0.6);
}
.bgm-prompt__subtitle {
  font-size: 14px;
  color: var(--ink);
  line-height: 1.8;
  margin-bottom: 36px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}

.bgm-choice {
  display: flex;
  gap: 16px;
  justify-content: center;
  width: 100%;
}

.choice-btn {
  position: relative;
  flex: 1;
  min-width: 0;
  padding: 18px 20px;
  border: none;
  background: rgba(10, 7, 3, 0.56);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  text-align: left;
}
.choice-btn:hover {
  background: var(--amber);
  color: var(--paper);
  transform: translateY(-2px);
}
.choice-btn.is-active {
  background: var(--amber);
  color: var(--paper);
  transform: translateY(-2px);
}

.choice-btn__icon {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--accent-rgb), 0.08);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.04);
  flex: none;
}

.choice-btn__icon svg {
  width: 24px;
  height: 24px;
}

.choice-btn__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.choice-btn__eyebrow {
  font-size: 9px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  opacity: 0.72;
}

.choice-btn__label {
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.choice-btn.is-active .choice-btn__icon,
.choice-btn:hover .choice-btn__icon {
  background: rgba(26, 18, 8, 0.14);
  border-color: rgba(26, 18, 8, 0.18);
}

.choice-btn--mute .choice-btn__icon {
  background: rgba(255, 255, 255, 0.06);
}

/* ============================================================
   HOTSPOTS — the click targets overlaid on poster objects
   Coordinates are in % (data.hotspot.x, .y, .w, .h).
   The hotspot container scales with poster's intrinsic ratio.
   ============================================================ */
.hotspot-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* keep aspect ratio of the poster (1055/1491 ≈ 0.7075) */
}

.hotspot-frame {
  position: absolute;
  /* center the poster aspect-fit content rectangle within viewport */
  pointer-events: none;
}

.hotspot {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.hotspot::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(var(--accent-rgb),0);
  transition: border-color 0.3s ease;
}
.hotspot:hover::before { border-color: rgba(var(--accent-rgb),0.55); }

/* The pulsing pin sits above the object */
.hotspot__pin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(255,255,255,0.95);
  box-shadow: 0 0 0 0 rgba(var(--accent-rgb),0.55), 0 6px 18px rgba(0,0,0,0.45), 0 0 22px rgba(var(--accent-light-rgb),0.55);
  animation: pin-pulse 2.4s ease-out infinite;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 14px;
  color: #1a0f04;
  letter-spacing: 0;
  text-shadow: none;
}
.hotspot__pin::after { display: none; }
.hotspot__num {
  position: relative;
  line-height: 1;
  pointer-events: none;
}

@keyframes pin-pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb),0.55), 0 6px 18px rgba(0,0,0,0.45), 0 0 22px rgba(var(--accent-light-rgb),0.55); }
  100% { box-shadow: 0 0 0 22px rgba(var(--accent-rgb),0), 0 6px 18px rgba(0,0,0,0.45), 0 0 22px rgba(var(--accent-light-rgb),0.55); }
}

.hotspot:hover .hotspot__pin {
  transform: translate(-50%, -50%) scale(1.12);
  background: var(--accent-light);
  transition: transform 0.2s, background 0.2s;
}

/* Pin styles */
[data-pin="constellation"] .hotspot__pin {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.95);
  border: 1.5px solid rgba(0,0,0,0.4);
  box-shadow: 0 0 14px rgba(255,255,255,0.95), 0 0 30px rgba(180,200,255,0.6);
  color: #1a0f04;
  animation: star-twinkle 2.4s ease-in-out infinite;
}
[data-pin="constellation"] .hotspot__pin::after { display: none; }
@keyframes star-twinkle {
  0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.85); }
}

[data-pin="flare"] .hotspot__pin {
  width: 36px; height: 36px;
  background: radial-gradient(circle, var(--accent-light) 0%, var(--accent) 35%, var(--accent-deep) 70%, rgba(var(--accent-deep-rgb),0) 100%);
  border: 2px solid rgba(255,255,255,0.85);
  box-shadow: 0 0 30px rgba(var(--accent-light-rgb),0.9), 0 0 60px rgba(var(--accent-deep-rgb),0.6);
  color: #2a1404;
  animation: flare-flicker 0.6s ease-in-out infinite;
}
[data-pin="flare"] .hotspot__pin::after { display: none; }
@keyframes flare-flicker {
  0%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  30% { opacity: 0.85; transform: translate(-50%, -50%) scale(0.96); }
  60% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

/* default "beacon" — keep current style as is */

.hotspot__label {
  position: absolute;
  bottom: calc(100% + 24px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(10, 7, 3, 0.85);
  border: 1px solid var(--line);
  padding: 6px 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  backdrop-filter: blur(4px);
}
.hotspot__label::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 14px;
  background: var(--line);
  transform: translateX(-50%);
}
.hotspot:hover .hotspot__label {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Faint glow ring on hover, reinforcing object */
.hotspot__glow {
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb),0.25) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  mix-blend-mode: screen;
}
.hotspot:hover .hotspot__glow { opacity: 1; }

/* When focused (popup open), dim everything except a target ring */
.poster-stage.zoomed-in .hotspot:not(.is-focused) {
  opacity: 0.4;
}

/* ============================================================
   UI CHROME
   ============================================================ */
.ui-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 20;
}
.ui-layer > * { pointer-events: auto; }

.ui-btn {
  background: rgba(10, 7, 3, 0.7);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 10px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s, color 0.2s, transform 0.2s, border-color 0.2s;
  backdrop-filter: blur(6px);
  text-decoration: none;
}
.ui-btn:hover {
  background: var(--amber);
  color: var(--paper);
  border-color: var(--amber);
  transform: translateY(-2px);
}
.ui-btn .ico { width: 14px; height: 14px; flex: none; }
.ui-btn .ico svg { width: 100%; height: 100%; display: block; stroke: currentColor; fill: none; stroke-width: 1.4; }

.brand-stamp {
  position: fixed;
  top: 22px;
  left: 26px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  pointer-events: none;
  text-shadow: 0 1px 10px rgba(0,0,0,0.7);
}
.brand-stamp__logo {
  height: 50px;
  width: auto;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.55));
  opacity: 0.95;
}
.brand-stamp__meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.28em;
  opacity: 0.75;
  align-self: end;
  padding-bottom: 6px;
  border-left: 1px solid var(--line-soft);
  padding-left: 12px;
}

.coords {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--ink);
  text-transform: uppercase;
  pointer-events: none;
  display: flex;
  gap: 24px;
  align-items: center;
  text-shadow: 0 1px 10px rgba(0,0,0,0.7);
}
.coords .tick {
  display: inline-block;
  width: 1px; height: 12px;
  background: var(--line-soft);
}

/* Day/night toggle */
.toggle-day-night {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  background: rgba(10, 7, 3, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}
.toggle-day-night button {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  transition: background 0.25s, color 0.25s;
}
.toggle-day-night button.is-active {
  background: var(--amber);
  color: var(--paper);
}
.toggle-day-night svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.4; }

.btn-about { position: fixed; top: 22px; right: 24px; z-index: 30; }
.btn-faq { position: fixed; top: 68px; right: 24px; z-index: 30; }
.btn-bgm { position: fixed; bottom: 22px; left: 24px; z-index: 30; }
.btn-companies { position: fixed; bottom: 22px; right: 24px; z-index: 30; }

.btn-bgm .bars {
  display: inline-flex;
  align-items: end;
  gap: 2px;
  height: 14px;
}
.btn-bgm .bars span {
  display: block;
  width: 2px;
  background: currentColor;
  height: 30%;
  animation: barWave 1s ease-in-out infinite;
}
.btn-bgm .bars span:nth-child(2) { animation-delay: 0.15s; height: 70%; }
.btn-bgm .bars span:nth-child(3) { animation-delay: 0.3s; height: 50%; }
.btn-bgm .bars span:nth-child(4) { animation-delay: 0.45s; height: 90%; }
.btn-bgm.is-muted .bars span { animation-play-state: paused; opacity: 0.3; }
@keyframes barWave {
  0%, 100% { height: 30%; }
  50% { height: 100%; }
}

/* ============================================================
   COMPANY IMMERSIVE BG — fades in over the world poster on click,
   plays a building-specific video for the focused company.
   ============================================================ */
.company-immersive {
  position: fixed;
  inset: 0;
  z-index: 35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease;
  overflow: hidden;
  background: #050301;
}
.company-immersive.is-on {
  opacity: 1;
  /* Wait for the underlying poster to zoom-in first, THEN crossfade video in */
  transition: opacity 1.4s ease 0.7s;
}
.company-immersive__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.12);
  transition: transform 6s ease-out, filter 1.2s ease;
  filter: brightness(0.92) saturate(1.05);
}
.company-immersive.is-on .company-immersive__video {
  /* slow drift-in zoom while the popup reads. Starts a beat after the poster zoom. */
  animation: immersive-zoom-in 11s ease-out 0.7s forwards;
}
@keyframes immersive-zoom-in {
  0%   { transform: scale(1.28); }
  100% { transform: scale(1.06); }
}
.company-immersive__grade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 28% 50%, rgba(0,0,0,0) 0%, rgba(0,0,0,0.35) 70%, rgba(0,0,0,0.55) 100%),
    linear-gradient(90deg, rgba(0,0,0,0.0) 35%, rgba(5,3,1,0.55) 70%, rgba(5,3,1,0.85) 100%);
  mix-blend-mode: multiply;
}
.company-immersive__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 220px 40px rgba(0,0,0,0.7);
}

/* underlying poster zooms aggressively toward the focused building BEFORE
   the immersive video crossfades in. Origin is set per-company via
   --zoom-x / --zoom-y on .poster-stage (inline style). */
.poster-stage.zoomed-in .poster-img,
.poster-stage.zoomed-in .poster-grade,
.poster-stage.zoomed-in .poster-grade-cool,
.poster-stage.zoomed-in .atmos-fog,
.poster-stage.zoomed-in .atmos-dust,
.poster-stage.zoomed-in .cloud-clip,
.poster-stage.zoomed-in .poster-vignette {
  transform: scale(1.55);
  transform-origin: var(--zoom-x, 50%) var(--zoom-y, 50%);
  transition: transform 1.6s cubic-bezier(0.45, 0, 0.25, 1), opacity 1s ease;
}
/* Slightly amplify the bg video itself for extra punch */
.poster-stage.zoomed-in .poster-img video.bg-video {
  filter: brightness(0.85) saturate(0.9) blur(1px);
  transition: filter 1.6s ease;
}

/* ============================================================
   COMPANY POPUP
   ============================================================ */
.popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 3, 1, 0.75);
  backdrop-filter: blur(3px);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.popup-backdrop.is-open { opacity: 1; pointer-events: auto; }

.popup {
  position: fixed;
  z-index: 50;
  top: 50%;
  left: 50%;
  width: min(720px, 92vw);
  max-height: 86vh;
  background: rgba(15, 10, 4, 0.96);
  border: 1px solid var(--line);
  color: var(--ink);
  transform: translate(-50%, -48%) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.6s cubic-bezier(.2,.8,.2,1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.popup.is-open {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

/* ----- Immersive variant: popup floats on the right over the company video ----- */
.popup-backdrop--immersive {
  background: transparent;
  backdrop-filter: none;
}
.popup--immersive {
  top: 50%;
  left: auto;
  right: 4vw;
  transform: translate(40px, -46%) scale(0.97);
  width: min(640px, 50vw);
  max-height: 82vh;
  background: rgba(12, 8, 4, 0.82);
  border: 1px solid rgba(var(--accent-rgb), 0.18);
  box-shadow:
    0 30px 80px -20px rgba(0,0,0,0.6),
    0 0 0 1px rgba(0,0,0,0.4);
  backdrop-filter: blur(14px) saturate(1.1);
  /* Wait for the map zoom + video crossfade to land first */
  transition: opacity 0.6s ease 1s, transform 0.7s cubic-bezier(.2,.8,.2,1) 1s;
}
.popup--immersive.is-open {
  transform: translate(0, -50%) scale(1);
}
.popup-backdrop--immersive {
  /* Delay the dim-veil too so the zoom is visible through the underlying poster */
  transition: opacity 0.8s ease 0.4s;
}
@media (max-width: 880px) {
  .popup--immersive {
    right: 50%;
    transform: translate(50%, -46%) scale(0.97);
    width: min(560px, 92vw);
  }
  .popup--immersive.is-open {
    transform: translate(50%, -50%) scale(1);
  }
}

.popup__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px 28px 18px 28px;
  border-bottom: 1px solid var(--line-soft);
}
.popup__id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
}
.popup__name {
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
  font-family: 'Cormorant Garamond', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
}
.popup__close {
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--ink);
  transition: background 0.2s, color 0.2s;
}
.popup__close:hover { background: var(--amber); color: var(--paper); border-color: var(--amber); }

.popup__body {
  padding: 24px 28px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 28px;
}

.popup__visual {
  aspect-ratio: 4 / 5;
  background:
    repeating-linear-gradient(135deg, rgba(var(--accent-rgb),0.04) 0 8px, transparent 8px 18px),
    var(--paper-2);
  border: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.popup__visual .visual-tag {
  position: absolute;
  top: 14px; left: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.popup__visual .glyph {
  font-size: 90px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--amber);
  font-family: 'Cormorant Garamond', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
}
.popup__logo {
  width: 78%;
  max-width: 240px;
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

/* ロゴ設定時はロゴ単体表示 — 枠線・斜めストライプ・背景・タグを外す */
.popup__visual--bare {
  background: transparent;
  border: none;
}
.popup__visual--bare .popup__logo {
  width: 88%;
  max-width: 280px;
}

.popup__field { margin-bottom: 16px; }
.popup__field-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 6px;
}
.popup__field-value {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink);
  text-wrap: pretty;
  white-space: pre-line; /* データ内の改行(\n)をそのまま表示(MOTHERSHIP等) */
}
.popup__tagline {
  font-size: 18px;
  line-height: 1.5;
  font-weight: 450;
  margin-bottom: 18px;
  text-wrap: pretty;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
}

.popup__footer {
  padding: 18px 28px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.popup__footer .ui-btn { background: transparent; }
.popup__footer .ui-btn--primary {
  background: var(--amber);
  color: var(--paper);
  border-color: var(--amber);
}
.popup__footer .ui-btn--primary:hover {
  background: var(--ember);
  border-color: var(--ember);
  color: var(--ink);
}

/* ============================================================
   PANELS (About / Index)
   ============================================================ */
.panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 3, 1, 0.75);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.panel.is-open { opacity: 1; pointer-events: auto; }
.panel__inner {
  position: relative;
  background: rgba(15, 10, 4, 0.96);
  border: 1px solid var(--line);
  width: min(820px, 92vw);
  max-height: 86vh;
  overflow: auto;
  padding: 44px 48px;
  transform: translateY(20px);
  transition: transform 0.6s cubic-bezier(.2,.8,.2,1);
  backdrop-filter: blur(8px);
}
.panel.is-open .panel__inner { transform: translateY(0); }

.panel__close {
  position: absolute;
  top: 24px; right: 28px;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  display: flex; align-items: center; justify-content: center;
}

.panel__id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 12px;
}
.panel__title {
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 24px;
  font-family: 'Cormorant Garamond', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
}
.panel__story {
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink);
  text-wrap: pretty;
  max-width: 64ch;
  margin-bottom: 14px;
}
.panel__story.lead { font-size: 17px; font-weight: 450; margin-bottom: 22px; }
.panel__story em { color: var(--amber); font-style: normal; font-weight: 500; }

.index-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  margin-top: 16px;
}
.index-row {
  background: rgba(15, 10, 4, 0.7);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.2s, color 0.2s;
  text-align: left;
}
.index-row:hover { background: var(--amber); color: var(--paper); }
.index-row .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  opacity: 0.7;
  margin-right: 14px;
}
.index-row .nm {
  font-size: 16px;
  font-weight: 450;
  flex: 1;
  font-family: 'Cormorant Garamond', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
}
.index-row .arrow {
  font-family: 'JetBrains Mono', monospace;
  opacity: 0.5;
}
.index-row:hover .arrow { opacity: 1; }

/* HUD tip */
.hud-tip {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink);
  pointer-events: none;
  display: flex; align-items: center; gap: 12px;
  opacity: 0;
  transition: opacity 0.6s ease;
  text-shadow: 0 1px 8px rgba(0,0,0,0.7);
}
.hud-tip.is-on { opacity: 0.85; }
.hud-tip .tic { width: 24px; height: 1px; background: var(--line-soft); }

/* Announcement banner */
.announce {
  position: fixed;
  top: 78px;
  left: 50%;
  transform: translate(-50%, -16px);
  z-index: 35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(.2,.8,.2,1);
  max-width: min(560px, 92vw);
}
.announce.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.announce__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(15, 10, 4, 0.88);
  border: 1px solid var(--amber);
  color: var(--ink);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(var(--accent-rgb),0.15);
}
.announce__icon {
  flex: none;
  color: var(--amber);
}
.announce__text {
  flex: 1;
  font-size: 13px;
  line-height: 1.55;
}
.announce__text strong {
  display: block;
  font-weight: 500;
  color: var(--amber);
  font-family: 'Cormorant Garamond', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  font-size: 16px;
  margin-bottom: 2px;
  letter-spacing: 0.01em;
}
.announce__close {
  flex: none;
  width: 28px; height: 28px;
  border: 1px solid var(--line-soft);
  color: var(--ink);
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.announce__close:hover {
  background: var(--amber);
  color: var(--paper);
  border-color: var(--amber);
}

/* Scroll arrows (left/right) */
.scroll-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  width: 44px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 10, 4, 0.7);
  border: 1px solid var(--line);
  color: var(--ink);
  backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, background 0.2s, color 0.2s, transform 0.3s;
}
.scroll-arrow.is-on { opacity: 1; pointer-events: auto; }
.scroll-arrow:hover {
  background: var(--amber);
  color: var(--paper);
  border-color: var(--amber);
}
.scroll-arrow--left {
  left: 18px;
}
.scroll-arrow--right {
  right: 18px;
}
.scroll-arrow.is-on::after {
  content: "";
  position: absolute;
  inset: -3px;
  border: 1px solid rgba(var(--accent-rgb),0.4);
  animation: scroll-arrow-pulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes scroll-arrow-pulse {
  0% { opacity: 0.7; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.4); }
}

/* ============================================================
   MAP HOTSPOTS — small click points over the map video.
   Same parent as the video (.map-video-wrap), % coordinates,
   so day/night toggle and page switches never drift.
   ============================================================ */
.map-hotspot-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.map-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: transparent;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  padding: 0;
  z-index: 8;
  --hotspot-color: #ffffff;
  transition: transform 0.15s ease;
}

/* 中央の白いリング — 鼓動(トン→余韻→小さくトン→間) */
.map-hotspot__core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 2px solid var(--hotspot-color);
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 0 8px rgba(255, 255, 255, 0.55),
    0 0 18px rgba(255, 255, 255, 0.28);
  animation: hotspotHeartbeat 2.4s ease-in-out infinite;
  transition: background 0.25s ease, box-shadow 0.25s ease;
  pointer-events: none;
}

/* 外側の白い波紋 — 一瞬ふわっと広がり、後半は間を置く */
.map-hotspot__ripple {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%) scale(0.45);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.4);
  opacity: 0;
  animation: hotspotRippleHeartbeat 2.4s cubic-bezier(0.18, 0.85, 0.25, 1) infinite;
  pointer-events: none;
}

@keyframes hotspotHeartbeat {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.9;
  }
  8% {
    transform: translate(-50%, -50%) scale(1.22);
    opacity: 1;
  }
  16% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.9;
  }
  28% {
    transform: translate(-50%, -50%) scale(1.12);
    opacity: 1;
  }
  38% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.88;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.88;
  }
}

@keyframes hotspotRippleHeartbeat {
  0% {
    transform: translate(-50%, -50%) scale(0.35);
    opacity: 0;
  }
  8% {
    opacity: 0.58;
  }
  32% {
    transform: translate(-50%, -50%) scale(1.65);
    opacity: 0.14;
  }
  46% {
    transform: translate(-50%, -50%) scale(2.05);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.05);
    opacity: 0;
  }
}

/* hover: 白の発光を少し強める(色味は白のまま) */
.map-hotspot:hover .map-hotspot__core {
  background: rgba(255, 255, 255, 0.2);
  box-shadow:
    0 0 12px rgba(255, 255, 255, 0.75),
    0 0 26px rgba(255, 255, 255, 0.4);
}

/* click / tap: 軽い押下フィードバック */
.map-hotspot:active {
  transform: translate(-50%, -50%) scale(0.92);
}

/* Title label on hover */
.map-hotspot__label {
  position: absolute;
  bottom: calc(100% - 4px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(10, 7, 3, 0.85);
  border: 1px solid var(--line);
  padding: 5px 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  backdrop-filter: blur(4px);
}
.map-hotspot:hover .map-hotspot__label {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* Dim other points while a popup is open */
.poster-stage.zoomed-in .map-hotspot:not(.is-focused) {
  opacity: 0.4;
}

/* Debug helper — add className "is-debug" temporarily to see numbers.
   Never ship with this class applied. */
.map-hotspot.is-debug {
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid rgba(0, 0, 0, 0.6);
}
.map-hotspot.is-debug::before {
  content: attr(data-id);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #111;
  font-weight: 700;
}

/* Simple (single-column) popup body for the map hotspot popup */
.popup__body--simple {
  grid-template-columns: 1fr;
}

@media (max-width: 768px) {
  /* タップ領域は44px以上を維持 */
  .map-hotspot { width: 46px; height: 46px; }
  .map-hotspot__core { width: 15px; height: 15px; }
  .map-hotspot__label { font-size: 8px; padding: 4px 8px; }
}

/* Map page arrows — switch between map page 1 / 2.
   Floating game-UI look: semi-transparent black, white hairline,
   faint neon glow. Offset below the scroll arrows so both stay usable. */
.map-video-wrap {
  position: relative;
  overflow: hidden;
}

.map-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.map-arrow {
  position: fixed;
  top: calc(50% + 78px);
  transform: translateY(-50%);
  z-index: 30;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 8px rgba(var(--accent-rgb), 0.18);
  transition: all 0.25s ease;
}

.map-arrow-next {
  right: 24px;
}

.map-arrow-prev {
  left: 24px;
}

.map-arrow:hover {
  background: rgba(var(--accent-deep-rgb), 0.55);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.6);
  transform: translateY(-50%) scale(1.05);
}

@media (max-width: 768px) {
  .map-arrow {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .map-arrow-next {
    right: 12px;
  }

  .map-arrow-prev {
    left: 12px;
  }
}

@media (max-width: 720px) {
  .scroll-arrow { width: 36px; height: 52px; }
  .scroll-arrow--left { left: 8px; }
  .scroll-arrow--right { right: 8px; }
  .announce { top: 64px; max-width: 92vw; }
  .announce__text { font-size: 12px; }
}

/* ============================================================
   SUB PAGES — 下層ページ(FRONTIERとは / ギャラリー / 福利厚生 /
   FAQ / 募集一覧)。マップの上に全画面で重なるスクロール面。
   ============================================================ */
.subpage {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  /* 半透明黒 — 背面に固定表示されたままのTOPマップ動画がうっすら透ける。
     backdrop-filterで背景側の明度を落とし＋軽くblurして可読性を確保。 */
  background:
    radial-gradient(ellipse at 50% -10%, rgba(var(--accent-rgb), 0.08) 0%, transparent 55%),
    rgba(5, 4, 3, 0.72);
  -webkit-backdrop-filter: blur(1.5px) brightness(0.55) saturate(0.9);
  backdrop-filter: blur(1.5px) brightness(0.55) saturate(0.9);
  color: var(--ink);
  animation: subpage-in 0.5s ease both;
}
@keyframes subpage-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 背景動画ありのページ: backdrop-filterがあると fixed の基準が
   .subpage になり動画がコンテンツと一緒にスクロールしてしまうため無効化。
   (暗さは動画自体のfilterとスクリムで確保する) */
.subpage--video {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* 下層ページの全画面背景動画(ギャラリー/福利厚生) */
.subpage__bgvideo {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  filter: brightness(0.5) saturate(0.95);
}
.subpage__bgscrim {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(5, 4, 3, 0.3) 0%, transparent 60%),
    rgba(5, 4, 3, 0.62);
}
.subpage__body,
.subpage__foot {
  position: relative;
  z-index: 1;
}

.subpage__head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px clamp(20px, 4vw, 44px);
  background: rgba(10, 7, 3, 0.85);
  border-bottom: 1px solid var(--line-soft);
  backdrop-filter: blur(10px);
}
.subpage__brand {
  padding: 0;
  display: flex;
  align-items: center;
}
.subpage__brand img {
  height: 36px;
  width: auto;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
}
.subpage__nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.subpage__nav button {
  font-size: 10px;
  letter-spacing: 0.18em;
  padding: 8px 12px;
  color: var(--ink-soft);
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.subpage__nav button:hover { color: var(--ink); border-color: var(--line-soft); }
.subpage__nav button.is-active {
  color: var(--ivress-gold-light);
  border-color: rgba(var(--accent-light-rgb), 0.65);
  background: rgba(var(--accent-rgb), 0.12);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.16);
}
.subpage__back { margin-left: auto; flex: none; }

.subpage__body {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 44px);
}

.subpage__hero {
  padding: clamp(48px, 8vh, 96px) 0 clamp(32px, 5vh, 56px);
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
}
.subpage__eyebrow {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--amber);
  margin-bottom: 16px;
}
.subpage__title {
  font-size: clamp(30px, 4.4vw, 54px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.2;
  font-family: 'Cormorant Garamond', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
}
.subpage__lead {
  max-width: 640px;
  margin: 20px auto 0;
  font-size: 14px;
  line-height: 1.95;
  color: var(--ink);
  opacity: 0.9;
  text-wrap: pretty;
}

/* 半透明背景でも文字が沈まないよう、地の文に薄い影を敷く */
.subpage__title,
.subpage__secttl {
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.65);
}
.subpage__lead,
.subpage__text,
.subpage__eyebrow {
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.subpage__sec {
  padding: clamp(36px, 6vh, 64px) 0;
  border-bottom: 1px solid var(--line-soft);
}
.subpage__secttl {
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 500;
  line-height: 1.4;
  margin-bottom: 16px;
  font-family: 'Cormorant Garamond', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
}
.subpage__secttl .mono {
  display: block;
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--amber);
  margin-bottom: 8px;
}
.subpage__text {
  max-width: 68ch;
  font-size: 14px;
  line-height: 1.95;
  margin-bottom: 12px;
  text-wrap: pretty;
}
.subpage__text em { color: var(--amber); font-style: normal; font-weight: 500; }

.subpage__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}
.subpage__card {
  border: 1px solid var(--line-soft);
  background: rgba(15, 10, 4, 0.72);
  padding: 22px;
}
.subpage__card h5 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
  font-family: 'Cormorant Garamond', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
}
.subpage__card p { font-size: 13px; line-height: 1.85; color: var(--ink); opacity: 0.85; }
.subpage__card--feature {
  border-color: rgba(var(--accent-rgb), 0.3);
  background: rgba(var(--accent-rgb), 0.07);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}
.subpage__card-mark {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--amber);
  margin-bottom: 10px;
}

.subpage__band {
  margin: clamp(36px, 6vh, 64px) 0;
  padding: clamp(32px, 5vh, 48px) 28px;
  text-align: center;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(var(--accent-rgb), 0.16) 0%, transparent 65%),
    rgba(15, 10, 4, 0.8);
}
.subpage__band-title {
  font-size: clamp(20px, 2.6vw, 30px);
  font-weight: 500;
  font-family: 'Cormorant Garamond', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
}
.subpage__band-lead { font-size: 13px; opacity: 0.8; margin: 10px 0 20px; }
.subpage__band-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.subpage__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 1060px;
  margin: 0 auto;
  padding: 22px clamp(20px, 4vw, 44px) 40px;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
  font-family: 'JetBrains Mono', monospace;
}

/* ---------- gallery ---------- */
.gallery-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.gallery-tab {
  font-size: 10px;
  letter-spacing: 0.16em;
  padding: 6px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(15, 10, 4, 0.6);
  transition: all 0.2s;
}
.gallery-tab:hover { color: var(--ink); border-color: var(--line); }
.gallery-tab.is-active {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--paper);
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}
.gallery-cell {
  display: block;
  padding: 0;
  text-align: left;
  border: 1px solid var(--line-soft);
  background: rgba(15, 10, 4, 0.72);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.gallery-cell:hover { border-color: rgba(var(--accent-rgb), 0.5); transform: translateY(-2px); }
.gallery-cell__img {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background:
    repeating-linear-gradient(135deg, rgba(var(--accent-rgb), 0.06) 0 10px, transparent 10px 22px),
    var(--paper-2);
  color: var(--ink-soft);
  font-size: 9px;
  letter-spacing: 0.24em;
}
.gallery-cell__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-cell__cap {
  display: block;
  padding: 9px 12px;
  font-size: 11px;
  color: var(--ink);
  border-top: 1px solid var(--line-soft);
}
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 3, 1, 0.82);
  backdrop-filter: blur(4px);
  animation: subpage-in 0.25s ease both;
}
.gallery-lightbox__box {
  width: min(640px, 100%);
  background: rgba(15, 10, 4, 0.96);
  border: 1px solid var(--line);
}
.gallery-lightbox__img {
  aspect-ratio: 16 / 10;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.2em;
  background:
    repeating-linear-gradient(135deg, rgba(var(--accent-rgb), 0.06) 0 14px, transparent 14px 30px),
    var(--paper-2);
}
.gallery-lightbox__img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery-lightbox__cap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
}
.gallery-lightbox__cap button {
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
}
.gallery-lightbox__cap button:hover { background: var(--amber); color: var(--paper); border-color: var(--amber); }

/* ---------- benefits ---------- */
.benefit-list { display: grid; gap: 16px; margin-top: 20px; }
.benefit-item {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) 1.35fr;
  gap: 28px;
  align-items: start;
  border: 1px solid var(--line-soft);
  background: rgba(15, 10, 4, 0.72);
  padding: 28px;
}
.benefit-item__eyebrow {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--amber);
  margin-bottom: 10px;
}
.benefit-item h3 {
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 500;
  line-height: 1.4;
  font-family: 'Cormorant Garamond', 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic', sans-serif;
}
.benefit-item__copy { margin-top: 10px; font-size: 13px; line-height: 1.9; opacity: 0.85; }
.benefit-item__points { display: grid; gap: 10px; }
.benefit-point {
  border-left: 3px solid var(--amber);
  background: rgba(var(--accent-rgb), 0.07);
  padding: 13px 15px;
}
.benefit-point b { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.benefit-point span { display: block; font-size: 12.5px; line-height: 1.8; opacity: 0.85; }
.benefit-note {
  margin-top: 20px;
  padding: 20px 22px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.1);
}
.benefit-note b { display: block; font-size: 15px; margin-bottom: 6px; color: var(--ink); }
.benefit-note span { font-size: 13px; line-height: 1.85; opacity: 0.85; }

/* ---------- FAQ ---------- */
.faq-group { margin-bottom: 26px; }
.faq-group__cat {
  font-size: 10px;
  letter-spacing: 0.26em;
  color: var(--amber);
  margin: 0 0 10px;
}
.faq-item {
  border: 1px solid var(--line-soft);
  background: rgba(15, 10, 4, 0.72);
  margin-bottom: 8px;
}
.faq-item__q {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  padding: 14px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.2s;
}
.faq-item__q:hover { background: rgba(var(--accent-rgb), 0.07); }
.faq-item__mk { color: var(--amber); flex: none; }
.faq-item__pm { margin-left: auto; color: var(--ink-soft); flex: none; }
.faq-item__a {
  max-height: 0;
  overflow: hidden;
  padding: 0 16px 0 38px;
  font-size: 13px;
  line-height: 1.9;
  opacity: 0.85;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.faq-item.is-open .faq-item__a { max-height: 300px; padding: 2px 16px 16px 38px; }

/* ---------- jobs ---------- */
.job-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  border: 1px solid var(--line-soft);
  background: rgba(15, 10, 4, 0.72);
  padding: 18px 20px;
  margin-bottom: 10px;
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.job-row:hover {
  border-color: rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.07);
  transform: translateY(-1px);
}
.job-row__main { flex: 1; min-width: 0; }
.job-row__main b { font-size: 15px; margin-right: 8px; }
.job-row__meta { display: block; font-size: 12px; opacity: 0.7; margin-top: 4px; }
.job-row__go { flex: none; font-size: 10px; letter-spacing: 0.18em; color: var(--amber); }
.job-tag {
  display: inline-block;
  font-size: 10px;
  color: var(--ink-soft);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 2px 10px;
  margin: 2px 4px 0 0;
}
.job-detail__crumb { font-size: 10px; letter-spacing: 0.14em; color: var(--ink-soft); margin-bottom: 10px; }
.job-detail__crumb button {
  color: var(--amber);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: inherit;
}
.job-detail__title { text-align: left; font-size: clamp(24px, 3vw, 38px); }
.job-detail__title span { font-size: 0.55em; opacity: 0.7; }
.job-detail__tags { margin: 10px 0 4px; }
.job-spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 16px 0 8px;
}
.job-spec th, .job-spec td {
  border: 1px solid var(--line-soft);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.job-spec th {
  background: rgba(var(--accent-rgb), 0.08);
  width: 130px;
  white-space: nowrap;
  font-weight: 600;
  color: var(--ink);
}
.job-detail__h {
  font-size: 14px;
  font-weight: 600;
  margin: 24px 0 6px;
  padding-left: 10px;
  border-left: 3px solid var(--amber);
}
.job-detail__list { margin: 6px 0; padding-left: 20px; font-size: 13.5px; line-height: 1.9; }
.job-detail__list li { margin: 4px 0; }
.job-flow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.job-flow__step {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 11.5px;
  background: rgba(15, 10, 4, 0.72);
}
.job-flow__ar { color: var(--ink-soft); font-size: 11px; }
.job-detail__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

@media (max-width: 820px) {
  .subpage__head { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .subpage__nav { order: 3; width: 100%; }
  .subpage__cards { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .benefit-item { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
  .job-spec th { width: 96px; }
  .subpage__foot { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 720px) {
  .opening__stage { padding: 0 12px; }
  .opening__topbar { padding: 18px 20px; }
  .opening__lines {
    width: min(100%, calc(100vw - 24px));
    padding: 24px 16px 28px;
    height: auto;
    gap: 14px;
  }
  .opening__lines::before { inset: 10px; }
  .story-mark { margin-bottom: 2px; }
  .opening__actions {
    width: 100%;
    gap: 12px;
  }
  .opening__page {
    flex: none;
    min-height: 0;
  }
  .opening__audio-note {
    padding: 2px 6px 8px;
  }
  .opening__audio-note p {
    font-size: 11px;
  }
  .opening__go {
    width: 100%;
  }
  .story-line { font-size: 16px; }
  .story-line.is-title { font-size: 16px; }
  .bgm-choice { flex-direction: column; align-items: stretch; }
  .choice-btn {
    padding: 16px 18px;
  }
  .choice-btn__icon {
    width: 48px;
    height: 48px;
  }
  .ui-btn { padding: 8px 12px; font-size: 10px; }
  .brand-stamp { top: 14px; left: 14px; gap: 10px; }
  .brand-stamp__logo { height: 36px; }
  .brand-stamp__meta { display: none; }
  .toggle-day-night { top: 14px; }
  .btn-about { top: 60px; right: 14px; }
  .btn-faq { top: 100px; right: 14px; }
  .btn-bgm { bottom: 14px; left: 14px; }
  .btn-companies { bottom: 14px; right: 14px; }
  .popup__body { grid-template-columns: 1fr; }
  .index-list { grid-template-columns: 1fr; }
  .panel__inner { padding: 32px 22px; }
  .hotspot__label { font-size: 8px; padding: 4px 8px; }
}
