/* ============================================================
   AGAMI MICROSITE
   ============================================================ */

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

:root {
  --color-primary:   #1a1a2e;
  --color-accent:    #e94560;
  --color-light:     #f4f4f4;
  --color-white:     #ffffff;
  --color-text:      #333333;
  --color-muted:     #777777;
  --nav-height:      64px;
  --font-base:       'Segoe UI', Arial, sans-serif;
  --max-width:       1200px;
  --radius:          8px;
  --transition:      0.3s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-base);
  color: var(--color-text);
  background: var(--color-white);
  line-height: 1.6;
  padding-top: var(--nav-height);
}

/* Viewer page: nav floats over the 360 canvas */
body.viewer-page { padding-top: 0; }

img { max-width: 100%; display: block; }
a   { text-decoration: none; color: inherit; }
ul  { list-style: none; }

/* ============================================================
   NAVBAR
   ============================================================ */

#header {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(10,10,20,0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  height: 52px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.35));
}

.nav-links { display: flex; gap: 36px; }

.nav-links a {
  color: rgba(255,255,255,0.75);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 4px;
  transition: color var(--transition);
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--color-accent);
  transition: width var(--transition);
}
.nav-links a:hover,
.nav-links a.active            { color: var(--color-white); }
.nav-links a:hover::after,
.nav-links a.active::after     { width: 100%; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-white);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

/* ============================================================
   SECTIONS — shared
   ============================================================ */

section { padding: 80px 20px; }
section:nth-child(even) { background: var(--color-light); }

.section-container { max-width: var(--max-width); margin: 0 auto; }

.section-header { text-align: center; margin-bottom: 48px; }
.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--color-primary);
  margin-bottom: 8px;
}
.section-subtitle { color: var(--color-muted); font-size: 1rem; }

/* ============================================================
   FULL-SCREEN VIDEO (walkthrough page)
   ============================================================ */

#video-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000;
}

#video-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Circular progress ring + mute button (walkthrough page) */
#video-controls {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 1100;
  width: 60px;
  height: 60px;
}

#progress-ring {
  position: absolute;
  inset: 0;
  width: 60px;
  height: 60px;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: rgba(255,255,255,0.2);
  stroke-width: 2.5;
}

.ring-fill {
  fill: none;
  stroke: url(#ring-grad);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 163.36;
  stroke-dashoffset: 163.36;
  transition: stroke-dashoffset 0.2s linear;
}

#mute-toggle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.45);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  backdrop-filter: blur(4px);
}
#mute-toggle:hover { background: rgba(0,0,0,0.7); }
#mute-toggle svg   { width: 18px; height: 18px; }

.dot-core {
  fill: #fff;
}
.dot-pulse {
  fill: rgba(233, 69, 96, 0.55);
  animation: ring-pulse 1s ease-out infinite;
}
@keyframes ring-pulse {
  0%   { r: 4px; opacity: 0.7; }
  100% { r: 9px; opacity: 0; }
}

/* ============================================================
   FULL-SCREEN GALLERY (gallery.html)
   ============================================================ */

#gallery-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000;
}

.gallery-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  z-index: 0;
  transition: opacity 1s ease;
}
.gallery-slide.active {
  opacity: 1;
  z-index: 1;
  animation: kenburns 9s ease-out forwards;
}
@keyframes kenburns {
  from { transform: scale(1.06); }
  to   { transform: scale(1); }
}

#gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to right,  rgba(0,0,0,0.42) 0%, transparent 22%, transparent 78%, rgba(0,0,0,0.42) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, transparent 18%, transparent 72%, rgba(0,0,0,0.65) 100%);
}

/* Slide counter — top right */
#gallery-counter {
  position: fixed;
  top: calc(var(--nav-height) + 18px);
  right: 28px;
  z-index: 1100;
  color: rgba(255,255,255,0.65);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  font-weight: 500;
}
#g-current {
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  vertical-align: middle;
}
.g-sep { margin: 0 5px; opacity: 0.4; }

/* Arrow controls */
.gallery-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1100;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.22);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  transition: background 0.3s ease, border-color 0.3s ease,
              transform 0.3s ease, box-shadow 0.3s ease;
}
.gallery-arrow svg { width: 22px; height: 22px; }
.gallery-arrow:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.75);
  transform: translateY(-50%) scale(1.14);
  box-shadow: 0 0 22px rgba(255,255,255,0.18);
}
.gallery-arrow:active { transform: translateY(-50%) scale(0.96); }
#gallery-prev { left: 28px; }
#gallery-next { right: 56px; }

/* Thumbnail strip — bottom right */
#thumbnail-panel {
  position: fixed;
  bottom: 28px;
  right: 56px;
  z-index: 1100;
  display: flex;
  gap: 8px;
  padding: 4px 0;
  max-width: min(500px, calc(100vw - 120px));
  overflow-x: auto;
  scrollbar-width: none;
}
#thumbnail-panel::-webkit-scrollbar { display: none; }

.thumb {
  width: 76px;
  height: 50px;
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  opacity: 0.5;
  transition: opacity 0.35s ease, transform 0.35s ease, border-color 0.35s ease;
}
.thumb:hover {
  opacity: 0.82;
  transform: scale(1.07) translateY(-2px);
}
.thumb.active {
  border-color: var(--color-accent);
  opacity: 1;
  transform: scale(1.12) translateY(-4px);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* ============================================================
   FOOTER
   ============================================================ */

#footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 24px 20px;
  font-size: 0.8rem;
}

/* ============================================================
   360 VIEWER — SCENE LIST (bottom-right pill)
   ============================================================ */

/* Hide the toggle button — list is always visible */
#sceneListToggle { display: none !important; }

/* Reset Marzipano's slide-in panel */
#sceneList {
  position: fixed !important;
  top: 50% !important;
  right: 0 !important;
  bottom: auto !important;
  left: auto !important;
  transform: translateY(-50%) !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  background: none !important;
  box-shadow: none !important;
  transition: none !important;
  z-index: 600 !important;
}
#sceneList.enabled { margin-left: 0 !important; }

#sceneList .scenes {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0 !important;
  padding: 8px 0 !important;
  background: rgba(10,10,20,0.45) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: none !important;
  border-left: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 8px 0 0 8px !important;
  width: auto !important;
  height: auto !important;
}

#sceneList .scene {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  width: auto !important;
  height: auto !important;
  padding: 10px 14px 10px 20px !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: none !important;
  border-left: 2px solid transparent !important;
  color: rgba(255,255,255,0.45) !important;
  cursor: pointer !important;
  text-decoration: none !important;
  transition: color 0.25s ease, border-color 0.25s ease,
              background 0.25s ease !important;
  position: relative !important;
}
#sceneList .scene:hover {
  background: rgba(255,255,255,0.07) !important;
  color: rgba(255,255,255,0.9) !important;
  border-left-color: rgba(255,255,255,0.3) !important;
  transform: none !important;
}
#sceneList .scene.current {
  color: #fff !important;
  border-left-color: var(--color-accent) !important;
  background: rgba(233,69,96,0.12) !important;
}

#sceneList .scene .text {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 2px !important;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  font-size: unset !important;
}
.scene-num {
  display: block !important;
  font-size: 0.65rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  line-height: 1 !important;
}
.scene-label {
  display: block !important;
  font-size: 0.52rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  line-height: 1 !important;
}

/* Accent dot on the right edge of each row */
#sceneList .scene::after {
  content: '' !important;
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,0.2) !important;
  flex-shrink: 0 !important;
  transition: background 0.25s ease !important;
}
#sceneList .scene:hover::after {
  background: rgba(255,255,255,0.5) !important;
}
#sceneList .scene.current::after {
  background: var(--color-accent) !important;
  box-shadow: 0 0 6px rgba(233,69,96,0.6) !important;
}

/* ============================================================
   360 VIEWER — CUSTOM VIEW CONTROLS
   ============================================================ */

#view-controls-group {
  position: fixed !important;
  bottom: 32px;
  left: 28px;
  z-index: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(10,10,20,0.38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 60px;
}

/* D-pad cross grid */
.vc-dpad {
  display: grid;
  grid-template-areas:
    ".    up    ."
    "left down  right";
  grid-template-columns: repeat(3, 36px);
  grid-template-rows: repeat(2, 36px);
  gap: 4px;
}
.vc-up    { grid-area: up; }
.vc-left  { grid-area: left; }
.vc-down  { grid-area: down; }
.vc-right { grid-area: right; }

/* Zoom group */
.vc-zoom {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Divider */
.vc-divider {
  width: 1px;
  height: 52px;
  background: rgba(255,255,255,0.15);
  margin: 0 2px;
}

/* Individual buttons — override Marzipano's absolute positioning */
.viewControlButton {
  position: static !important;
  width: 36px !important;
  height: 36px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  background: rgba(255,255,255,0.08) !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  color: #fff !important;
  cursor: pointer !important;
  transition: background 0.25s ease, transform 0.2s ease, border-color 0.25s ease !important;
  text-decoration: none !important;
}
.viewControlButton:hover {
  background: rgba(255,255,255,0.22) !important;
  border-color: rgba(255,255,255,0.5) !important;
  transform: scale(1.12) !important;
}
.viewControlButton:active,
.viewControlButton.vc-active {
  transform: scale(0.93) !important;
  background: rgba(255,255,255,0.3) !important;
  border-color: rgba(255,255,255,0.6) !important;
}
.viewControlButton svg {
  width: 15px !important;
  height: 15px !important;
  display: block !important;
  pointer-events: none !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; }
  .gallery-item:nth-child(1),
  .gallery-item:nth-child(6) { grid-column: span 1; grid-row: span 1; }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height); left: 0;
    width: 100%;
    background: var(--color-primary);
    padding: 20px 24px;
    gap: 18px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  }
  .nav-links.open { display: flex; }
  .nav-toggle      { display: block; }
  .gallery-grid    { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 130px; }
}