/* Vacu-Man Interactive Duct Walkthrough */
/* Brand: red #C8102E, navy #1B2F56, cream/white neutrals */

:root {
  --vm-red: #C8102E;
  --vm-navy: #1B2F56;
  --vm-cream: #F4F0E8;
  --vm-grey: #E7E9EC;
  --font-stack: "Helvetica Rounded", "Nunito", "Arial Rounded MT Bold", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-stack);
  font-weight: 700;
  background: var(--vm-navy);
  color: var(--vm-navy);
}

/* ---------- Loader ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--vm-navy);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  transition: opacity 0.6s ease;
}
#loader.done { opacity: 0; pointer-events: none; }
.loader-logo { width: 220px; height: auto; border-radius: 8px; }
.loader-path path {
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: drawpath 1.6s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(200, 16, 46, 0.8));
}
@keyframes drawpath {
  0% { stroke-dashoffset: 260; }
  55% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -260; }
}
.loader-text { color: var(--vm-cream); font-size: 14px; letter-spacing: 0.08em; }

/* ---------- Header ---------- */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  pointer-events: none;
}
.header-logo { height: 44px; width: auto; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,0.35); }
.header-phone {
  pointer-events: auto;
  background: var(--vm-red);
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}
.header-phone:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ---------- Canvas ---------- */
#scene-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  display: block;
}

/* ---------- Progress rail ---------- */
#progress-rail {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 46vh;
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
  z-index: 40;
  overflow: hidden;
}
#progress-fill {
  width: 100%;
  height: 0%;
  background: var(--vm-red);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(200,16,46,0.9);
}

/* ---------- Scroll hint ---------- */
#scroll-hint {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  color: #fff;
  text-align: center;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  transition: opacity 0.4s ease;
}
#scroll-hint .chevron {
  width: 14px; height: 14px;
  margin: 8px auto 0;
  border-right: 3px solid var(--vm-red);
  border-bottom: 3px solid var(--vm-red);
  transform: rotate(45deg);
  animation: bob 1.4s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: rotate(45deg) translate(0,0); } 50% { transform: rotate(45deg) translate(4px,4px); } }

/* ---------- Journey overlays ---------- */
#overlays { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.overlay {
  position: absolute;
  left: 50%;
  bottom: 14vh;
  transform: translateX(-50%);
  width: min(720px, 88vw);
  text-align: center;
  opacity: 0;
  color: #fff;
}
.overlay h1, .overlay h2 {
  font-weight: 900;
  font-size: clamp(26px, 4.4vw, 46px);
  line-height: 1.15;
  text-shadow: 0 2px 18px rgba(0,0,0,0.75);
}
.overlay p {
  margin-top: 12px;
  font-size: clamp(15px, 2vw, 19px);
  text-shadow: 0 1px 10px rgba(0,0,0,0.8);
}
.overlay-hero { top: 16vh; bottom: auto; }

/* ---------- Scroll runway ---------- */
#journey { height: 760vh; position: relative; z-index: 0; }

/* ---------- Page sections (reveal, CTA, gallery) ---------- */
.page-section {
  position: relative;
  z-index: 10;
  background: var(--vm-cream);
  padding: 72px 20px;
  text-align: center;
}
.page-section h2 {
  font-weight: 900;
  font-size: clamp(24px, 3.6vw, 38px);
  color: var(--vm-navy);
  margin-bottom: 32px;
}
#reveal { border-top: 6px solid var(--vm-red); }

.ba-panel {
  display: flex;
  gap: 18px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 900px;
  margin: 0 auto;
}
.ba-frame {
  width: min(400px, 90vw);
  aspect-ratio: 1 / 1;
  background: var(--vm-grey);
  border: 3px dashed var(--vm-navy);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.ba-frame img { width: 100%; height: 100%; object-fit: cover; }
.ph-label {
  color: var(--vm-navy);
  font-weight: 900;
  font-size: 20px;
  text-align: center;
}
.ph-label small { font-weight: 700; font-size: 13px; color: var(--vm-red); }
.ba-frame figcaption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(27,47,86,0.85);
  color: #fff;
  font-size: 13px;
  padding: 8px;
}

/* ---------- CTA ---------- */
#cta { background: #fff; }
.cta-logo { width: min(360px, 80vw); height: auto; border-radius: 10px; }
.cta-heading { margin-top: 18px; margin-bottom: 10px; }
.cta-phone {
  display: inline-block;
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 900;
  color: var(--vm-red);
  text-decoration: none;
  margin: 6px 0 2px;
}
.cta-phone:focus-visible { outline: 3px solid var(--vm-navy); outline-offset: 4px; }
.cta-site { color: var(--vm-navy); font-size: 18px; margin-bottom: 28px; }
.cta-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.btn {
  display: inline-block;
  padding: 16px 30px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 17px;
  text-decoration: none;
  min-width: 180px;
}
.btn:focus-visible { outline: 3px solid var(--vm-navy); outline-offset: 3px; }
.btn-primary { background: var(--vm-red); color: #fff; box-shadow: 0 4px 16px rgba(200,16,46,0.35); }
.btn-secondary { background: var(--vm-navy); color: #fff; }
.btn-tertiary { background: transparent; color: var(--vm-navy); border: 3px solid var(--vm-navy); }
.cta-area { color: var(--vm-navy); font-size: 15px; }

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
}
.gallery-grid .ba-frame { width: 100%; }

/* ---------- Footer ---------- */
#site-footer {
  position: relative;
  z-index: 10;
  background: var(--vm-navy);
  color: var(--vm-cream);
  text-align: center;
  padding: 36px 20px 96px;
  font-size: 15px;
}

/* ---------- Mobile call bar ---------- */
#call-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 60;
  background: var(--vm-red);
  color: #fff;
  text-align: center;
  padding: 16px;
  font-weight: 900;
  font-size: 17px;
  text-decoration: none;
}

/* ---------- Static story (reduced motion) ---------- */
#static-story { background: var(--vm-cream); position: relative; z-index: 10; }
.story-block {
  max-width: 760px;
  margin: 0 auto;
  padding: 80px 20px;
  text-align: center;
}
.story-block h1, .story-block h2 {
  font-weight: 900;
  color: var(--vm-navy);
  font-size: clamp(26px, 4vw, 42px);
  margin-bottom: 16px;
}
.story-block p { font-size: 17px; line-height: 1.6; color: var(--vm-navy); }
.story-block .ba-panel { margin-top: 28px; }

/* Reduced-motion mode: hide the 3D journey entirely */
body.reduced-motion #scene-canvas,
body.reduced-motion #journey,
body.reduced-motion #overlays,
body.reduced-motion #progress-rail,
body.reduced-motion #scroll-hint { display: none; }
body.reduced-motion #static-story { display: block; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .loader-path path, #scroll-hint .chevron { animation: none; }
}

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  #journey { height: 480vh; }
  #call-bar { display: block; }
  .header-logo { height: 36px; }
  .overlay { bottom: 18vh; }
  #progress-rail { right: 8px; height: 36vh; }
  .btn { width: 100%; }
}
