/* ==========================================================================
   Syntro Health — Apple-Style 3D Scrollytelling & Interactive Plate Showcase
   Architectural Standard: 3d-website-builder & ui-ux-pro-max
   ========================================================================== */

/* ── 1. Quadrant Navigation Bar (Top Pill Bar) ── */
.scrolly-nav-bar {
  max-width: 580px;
  width: 100%;
  margin: 0 auto 12px auto;
  z-index: 10;
  position: relative;
}

.scrolly-nav-pill {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  color: #94a3b8;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 6px 14px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.scrolly-nav-pill:hover {
  background: rgba(30, 41, 59, 0.95);
  color: #ffffff;
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.scrolly-nav-pill.active {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.22);
}

.scrolly-nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.scrolly-nav-dot.bg-emerald {
  background-color: #10b981;
}

/* ── 2. Hero 3D Stage & Canvas Container ── */
.scrolly-3d-stage {
  position: relative;
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  background: radial-gradient(circle at 50% 45%, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.98) 75%, #07090e 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 45px -10px rgba(16, 185, 129, 0.15);
  overflow: hidden;
  user-select: none;
  touch-action: pan-y;
  cursor: grab;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.scrolly-3d-stage:active {
  cursor: grabbing;
}

.scrolly-3d-stage:hover {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.9), 0 0 55px -10px rgba(16, 185, 129, 0.22);
}

/* Retina Canvas */
.scrolly-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  object-fit: contain;
}

/* ── 3. Loading State & Progress Bar ── */
.scrolly-loader {
  position: absolute;
  inset: 0;
  background: #07090e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 25;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.scrolly-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.scrolly-loader-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #10b981;
  border-radius: 50%;
  animation: scrollySpin 0.9s linear infinite;
  margin-bottom: 16px;
}

@keyframes scrollySpin {
  to { transform: rotate(360deg); }
}

.scrolly-loader-bar {
  width: 140px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 10px;
}

.scrolly-loader-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.15s ease-out;
}

.scrolly-loader-text {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
}

/* ── 4. Technical Callout Pin System (Zero Ghosting) ── */
.scrolly-pin {
  position: absolute;
  z-index: 10;
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
}

/* Absolute zero ghosting when hidden */
.scrolly-pin.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translate(-50%, -50%) scale(0.65);
}

.scrolly-pin-pulse {
  position: relative;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scrolly-pin-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 12px #10b981;
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.scrolly-pin:hover .scrolly-pin-dot,
.scrolly-pin.is-active .scrolly-pin-dot {
  transform: scale(1.4);
  background: #34d399;
  box-shadow: 0 0 18px #34d399;
}

.scrolly-pin-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(16, 185, 129, 0.8);
  animation: scrollyPulseRing 2.4s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes scrollyPulseRing {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  65%, 100% {
    transform: scale(2.0);
    opacity: 0;
  }
}

/* Floating Technical Tag */
.scrolly-pin-tag {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%) scale(0.92);
  background: rgba(11, 15, 25, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 6px 14px;
  white-space: nowrap;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75), 0 0 20px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.scrolly-pin:hover .scrolly-pin-tag,
.scrolly-pin.is-active .scrolly-pin-tag {
  border-color: rgba(16, 185, 129, 0.65);
  background: rgba(11, 15, 25, 0.98);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85), 0 0 20px rgba(16, 185, 129, 0.3);
  transform: translateY(-50%) translateX(4px) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.scrolly-pin-ratio {
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  font-weight: 700;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.scrolly-pin-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.25;
}

.scrolly-pin-sub {
  font-size: 0.7rem;
  color: #94a3b8;
  display: block;
}

/* ── 5. Scrubbing Controls & HUD Bar ── */
.scrolly-hud {
  position: absolute;
  bottom: 14px;
  left: 14px;
  right: 14px;
  background: rgba(11, 15, 25, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 15;
}

.scrolly-hud-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scrolly-hud-btn {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  border-radius: 8px;
  padding: 3px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.scrolly-hud-btn:hover {
  background: rgba(16, 185, 129, 0.3);
  color: #ffffff;
  border-color: #10b981;
}

.scrolly-hud-badge {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-family: var(--font-mono, monospace);
}

.scrolly-hud-scrubber {
  flex: 1;
  max-width: 160px;
  height: 6px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: height 0.15s ease;
}

.scrolly-hud-scrubber:hover {
  height: 8px;
  background: rgba(255, 255, 255, 0.22);
}

.scrolly-hud-scrubber-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1.6%;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.06s linear;
}

.scrolly-hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scrolly-hud-frame {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: #94a3b8;
}

.scrolly-hud-hint {
  font-size: 0.68rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* ── 6. Nutritional Callout Drawer / Card Popover ── */
.scrolly-detail-card {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  background: rgba(11, 15, 25, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 18px;
  padding: 14px 18px;
  z-index: 20;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  transform: translateY(-8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.scrolly-detail-card.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.scrolly-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.scrolly-detail-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 8px;
}

.scrolly-detail-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.scrolly-detail-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.scrolly-detail-desc {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.45;
  margin-bottom: 10px;
}

.scrolly-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.scrolly-detail-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
}

.scrolly-detail-chip strong {
  color: #34d399;
}

/* ── 7. Mobile & Reduced Motion Media Queries ── */
@media (max-width: 575.98px) {
  .scrolly-3d-stage {
    border-radius: 20px;
  }
  .scrolly-nav-pill {
    font-size: 0.7rem;
    padding: 4px 10px;
  }
  .scrolly-pin-tag {
    display: none; /* Keep clean on small mobile, show details on pin tap */
  }
  .scrolly-pin.is-active .scrolly-pin-tag {
    display: block;
    left: auto;
    right: 28px;
  }
  .scrolly-hud {
    padding: 6px 10px;
  }
  .scrolly-hud-hint {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scrolly-pin-ring {
    animation: none;
  }
  .scrolly-loader-spinner {
    animation: none;
  }
  .scrolly-3d-stage {
    transition: none;
  }
}
