/* ==========================================================================
   Airople Flagship Brand Site — First-Screen Product Anatomy Carousel
   Opens directly into a full-width studio showcase carousel for DBP-62D0L
   and DBP-8298B with oversized product imagery, pulsing hardware pins,
   dynamic SVG elbow connectors (`anatomy.js`), and outward-emerging callouts.
   ========================================================================== */

/* ---------- Exact Full-Viewport First-Screen Carousel Section ---------- */
.anatomy-hero {
  min-height: calc(100vh - 53px);
  min-height: calc(100svh - 53px);
  display: flex; flex-direction: column; justify-content: center;
  padding-block: clamp(14px, 2.2vh, 28px) clamp(18px, 2.6vh, 32px);
  background: transparent;
}
.anatomy-hero > .container {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
}
.anatomy-carousel {
  position: relative; width: 100%; flex: 1;
  display: flex; flex-direction: column; justify-content: space-between;
  max-height: 920px; margin-block: auto;
}

/* ---------- Segmented Model Switcher (Top Tabs) ---------- */
.model-jump-wrap { display: flex; justify-content: center; margin-block-end: clamp(8px, 1.4vh, 18px); }
.model-jump-nav {
  display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 4px;
  border-radius: var(--radius-pill); background: rgba(242, 244, 242, 0.88);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--stroke); box-shadow: var(--shadow-sm);
}
.model-jump-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 18px;
  border: 0; background: transparent; border-radius: var(--radius-pill);
  font-size: 0.88rem; font-weight: 500; color: var(--muted); cursor: pointer;
  transition: background-color 0.24s var(--ease-apple), color 0.24s var(--ease-apple), box-shadow 0.24s var(--ease-apple);
}
.model-jump-pill strong { font-family: var(--font-display); font-weight: 600; color: var(--ink-soft); }
.model-jump-pill:hover { color: var(--ink); }
.model-jump-pill.is-active { background: #ffffff; color: var(--ink); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); }
.model-jump-pill.is-active strong { color: var(--brand); }

/* ---------- Carousel Deck & Side Arrows ---------- */
.anatomy-deck { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.anatomy-slides { position: relative; width: 100%; }
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 6;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  color: var(--ink); box-shadow: var(--shadow-sm); display: grid; place-items: center; cursor: pointer;
  transition: transform 0.22s var(--ease-apple), background-color 0.22s var(--ease-apple), border-color 0.22s var(--ease-apple), color 0.22s var(--ease-apple);
}
.carousel-arrow svg { width: 20px; height: 20px; }
.carousel-arrow--prev { left: -22px; }
.carousel-arrow--next { right: -22px; }
.carousel-arrow:hover {
  transform: translateY(-50%) scale(1.06);
  background: #ffffff; border-color: var(--stroke-brand); color: var(--brand);
}
html[dir="rtl"] .carousel-arrow--prev { left: auto; right: -22px; }
html[dir="rtl"] .carousel-arrow--next { right: auto; left: -22px; }
html[dir="rtl"] .carousel-arrow svg,
html[dir="rtl"] .carousel-mini-btn svg { transform: scaleX(-1); }

/* ---------- Frameless Open-Air Studio Stage ---------- */
.anatomy-card {
  position: relative; overflow: visible; scroll-margin-top: 76px;
  background: transparent; border: 0; border-radius: 0; box-shadow: none;
  padding: clamp(6px, 1vh, 14px) clamp(8px, 2vw, 24px) clamp(8px, 1.2vh, 16px);
}
.anatomy-card[hidden] { display: none; }

.anatomy-head { position: relative; z-index: 2; text-align: center; max-width: 720px; margin-inline: auto; }
.anatomy-head__meta {
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px 10px; font-size: 0.84rem; color: var(--subtle);
}
.anatomy-head__sep { opacity: 0.45; }
.anatomy-head__title {
  margin-block-start: 6px; font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2.35rem); font-weight: 600;
  line-height: 1.12; letter-spacing: -0.03em; color: var(--ink);
}

/* Spatial stage stays LTR so left/right pins always pair cleanly with their facing column */
.anatomy-stage {
  position: relative; z-index: 2; direction: ltr; display: grid;
  grid-template-columns: minmax(220px, 290px) minmax(290px, 1fr) minmax(220px, 290px);
  align-items: center; gap: clamp(16px, 2.8vw, 44px);
  margin-block: clamp(12px, 2.2vh, 32px) clamp(12px, 2vh, 28px);
}

/* Dynamic SVG connector overlay computed by anatomy.js */
.anatomy-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 2; }
.anatomy-path {
  stroke: rgba(29, 29, 31, 0.28); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: var(--line-len, 320); stroke-dashoffset: var(--line-len, 320);
  transition:
    stroke-dashoffset 0.42s var(--ease-out) calc(0.08s + var(--stagger, 0) * 0.045s),
    stroke 0.24s var(--ease-apple), stroke-width 0.24s var(--ease-apple), opacity 0.24s var(--ease-apple);
}
.anatomy-anchor {
  fill: var(--brand); stroke: #ffffff; stroke-width: 1.5; opacity: 0;
  transition: opacity 0.24s var(--ease-out) calc(0.24s + var(--stagger, 0) * 0.045s), fill 0.24s var(--ease-apple);
}
.anatomy-card.is-visible .anatomy-path, .shot .anatomy-path { stroke-dashoffset: 0; }
.anatomy-card.is-visible .anatomy-anchor, .shot .anatomy-anchor { opacity: 1; }

/* Center giant product visual + pinned hotspots (height-coupled to fill one viewport cleanly) */
.anatomy-visual { position: relative; z-index: 3; display: grid; place-items: center; padding-block: 4px; }
.anatomy-device {
  position: relative; direction: ltr; width: min(100%, clamp(300px, 44vh, 460px)); aspect-ratio: 1200 / 1106;
  opacity: 0; transform: scale(0.95);
  transition: opacity 0.4s var(--ease-out), transform 0.48s var(--ease-out);
}
.anatomy-device--wrist { width: min(100%, clamp(275px, 41vh, 415px)); aspect-ratio: 1170 / 1200; }
.anatomy-card.is-visible .anatomy-device, .shot .anatomy-device { opacity: 1; transform: scale(1); }
.anatomy-img {
  width: 100%; height: 100%; object-fit: contain; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 26px 38px rgba(18, 28, 20, 0.15));
}

/* Pulsing emerald target dots pinned onto physical product features */
.anatomy-dot {
  --dot-size: 16px; position: absolute; left: var(--px); top: var(--py);
  width: var(--dot-size); height: var(--dot-size);
  margin-left: calc(var(--dot-size) / -2); margin-top: calc(var(--dot-size) / -2);
  border-radius: 50%; border: 2.5px solid #ffffff; background: var(--brand);
  box-shadow: 0 3px 12px rgba(64, 118, 48, 0.45), 0 0 0 1px rgba(64, 118, 48, 0.18);
  cursor: pointer; z-index: 4; display: grid; place-items: center; padding: 0;
  opacity: 0; transform: scale(0.2);
  transition:
    opacity 0.26s var(--ease-out) calc(0.06s + var(--stagger, 0) * 0.04s),
    transform 0.28s var(--ease-apple) calc(0.06s + var(--stagger, 0) * 0.04s),
    background-color 0.22s var(--ease-apple), box-shadow 0.22s var(--ease-apple);
}
.anatomy-card.is-visible .anatomy-dot, .shot .anatomy-dot { opacity: 1; transform: scale(1); }
.anatomy-dot::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1.5px solid rgba(64, 118, 48, 0.48);
  animation: anatomyPulse 2.8s var(--ease-out) infinite;
  animation-delay: calc(var(--stagger, 0) * 0.45s); pointer-events: none;
}
.anatomy-dot::after { content: ""; position: absolute; inset: -12px; border-radius: 50%; }
.anatomy-dot__num { display: none; font-size: 0.72rem; font-weight: 700; line-height: 1; color: #ffffff; }
.anatomy-dot:hover, .anatomy-dot.is-active {
  transform: scale(1.26); background: var(--brand-hover);
  box-shadow: 0 0 0 6px rgba(64, 118, 48, 0.2), 0 4px 16px rgba(64, 118, 48, 0.45);
  transition-delay: 0s;
}
@keyframes anatomyPulse {
  0% { transform: scale(0.85); opacity: 0.65; }
  75%, 100% { transform: scale(2.15); opacity: 0; }
}

/* Surrounding callout columns */
.anatomy-col {
  display: flex; flex-direction: column; justify-content: space-between;
  gap: clamp(18px, 3.2vh, 44px); min-height: clamp(275px, 40vh, 420px); position: relative; z-index: 3;
}
.anatomy-callout {
  position: relative; background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 20px; padding: 16px 18px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.055); cursor: pointer; outline: none; opacity: 0;
  transition:
    opacity 0.36s var(--ease-out) calc(0.12s + var(--stagger, 0) * 0.045s),
    transform 0.4s var(--ease-out) calc(0.12s + var(--stagger, 0) * 0.045s),
    border-color 0.24s var(--ease-apple), box-shadow 0.24s var(--ease-apple), background-color 0.24s var(--ease-apple);
}
.anatomy-col--left .anatomy-callout { transform: translateX(22px); }
.anatomy-col--right .anatomy-callout { transform: translateX(-22px); }
.anatomy-card.is-visible .anatomy-callout, .shot .anatomy-callout { opacity: 1; transform: translateX(0); }
html[dir="rtl"] .anatomy-callout { direction: rtl; text-align: right; }

.anatomy-callout__head { display: flex; align-items: center; gap: 9px; }
.anatomy-callout__badge {
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex-shrink: 0;
  display: inline-grid; place-items: center; font-size: 0; color: transparent;
}
.anatomy-callout__title {
  font-family: var(--font-display); font-size: 0.95rem; font-weight: 600;
  line-height: 1.26; letter-spacing: -0.015em; color: var(--ink);
}
.anatomy-callout__body { margin-block-start: 6px; font-size: 0.87rem; line-height: 1.48; color: var(--muted); }

/* Synchronized active state across dot + SVG leader line + callout card */
.anatomy-stage.has-active .anatomy-callout:not(.is-active) { opacity: 0.56; transition-delay: 0s; }
.anatomy-stage.has-active .anatomy-line-group:not(.is-active) .anatomy-path,
.anatomy-stage.has-active .anatomy-line-group:not(.is-active) .anatomy-anchor { opacity: 0.24; transition-delay: 0s; }
.anatomy-stage.has-active .anatomy-dot:not(.is-active) { opacity: 0.52; transition-delay: 0s; }
.anatomy-callout.is-active, .anatomy-callout:hover {
  opacity: 1; transform: translateY(-2px); background: #ffffff;
  border-color: rgba(64, 118, 48, 0.42); box-shadow: 0 14px 32px rgba(64, 118, 48, 0.13);
  transition-delay: 0s;
}
.anatomy-line-group.is-active .anatomy-path { stroke: var(--brand); stroke-width: 2.25; opacity: 1; transition-delay: 0s; }
.anatomy-line-group.is-active .anatomy-anchor { fill: var(--brand-hover); opacity: 1; transition-delay: 0s; }

/* Once initial reveal finishes, drop staggered delays for instant hover feedback */
.anatomy-card.is-settled .anatomy-callout,
.anatomy-card.is-settled .anatomy-dot,
.anatomy-card.is-settled .anatomy-path,
.anatomy-card.is-settled .anatomy-anchor { transition-delay: 0s; transition-duration: 0.24s; }

.anatomy-foot {
  position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: center; gap: 10px 14px; padding-block-start: 10px;
}
.anatomy-primary--mobile { display: none; }
.anatomy-compare-link {
  font-size: 0.9rem; font-weight: 500; color: var(--brand); padding: 6px 10px;
  border-radius: var(--radius-pill); transition: background-color 0.2s var(--ease-apple);
}
.anatomy-compare-link:hover { background: var(--brand-wash); }

/* ---------- Bottom Carousel Pagination & Auto-Play Pill ---------- */
.carousel-controls { margin-block-start: clamp(8px, 1.4vh, 18px); display: flex; align-items: center; justify-content: center; gap: 10px; }
.carousel-dots {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px;
  border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--stroke); box-shadow: var(--shadow-sm);
}
.carousel-dot {
  position: relative; width: 9px; height: 9px; border: 0; border-radius: var(--radius-pill);
  background: rgba(29, 29, 31, 0.2); padding: 0; cursor: pointer; overflow: hidden;
  transition: width 0.32s var(--ease-apple), background-color 0.24s var(--ease-apple);
}
.carousel-dot.is-active { width: 36px; background: rgba(64, 118, 48, 0.22); }
.carousel-dot__fill {
  position: absolute; inset: 0; border-radius: inherit; background: var(--brand);
  transform-origin: left center; transform: scaleX(0);
}
html[dir="rtl"] .carousel-dot__fill { transform-origin: right center; }
.carousel-dot.is-active .carousel-dot__fill { animation: carouselProgress var(--carousel-duration, 7000ms) linear forwards; }
.anatomy-carousel.is-paused .carousel-dot.is-active .carousel-dot__fill { animation-play-state: paused; }
.anatomy-carousel.is-manual-paused .carousel-dot.is-active .carousel-dot__fill,
.shot .carousel-dot.is-active .carousel-dot__fill { animation: none; transform: scaleX(1); }
@keyframes carouselProgress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.carousel-mini-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: var(--ink-soft); box-shadow: var(--shadow-sm); display: grid; place-items: center; cursor: pointer;
  transition: background-color 0.2s var(--ease-apple), color 0.2s var(--ease-apple), border-color 0.2s var(--ease-apple);
}
.carousel-mini-btn svg { width: 16px; height: 16px; }
.carousel-mini-btn:hover { background: #ffffff; color: var(--brand); border-color: var(--stroke-brand); }
.carousel-play-btn .icon-play { display: none; }
.carousel-play-btn[aria-pressed="true"] .icon-pause { display: none; }
.carousel-play-btn[aria-pressed="true"] .icon-play { display: block; }

@media (min-width: 1180px) {
  .carousel-controls [data-carousel-prev],
  .carousel-controls [data-carousel-next] { display: none; }
}
@media (max-width: 1179px) { .carousel-arrow { display: none; } }

/* ---------- Responsive: Tablet & Mobile Stacked Anatomy ---------- */
@media (max-width: 960px) {
  .anatomy-hero { min-height: auto; padding-block: 16px 36px; }
  .anatomy-carousel { max-height: none; justify-content: flex-start; }
  .anatomy-stage { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-block: 18px 20px; }
  .anatomy-lines { display: none; }
  .anatomy-visual { order: -1; grid-column: 1 / -1; padding-block: 4px 12px; }
  .anatomy-callout[data-part="c1"] { order: 1; }
  .anatomy-callout[data-part="c2"] { order: 2; }
  .anatomy-callout[data-part="c3"] { order: 3; }
  .anatomy-callout[data-part="c4"] { order: 4; }
  .anatomy-device { width: min(100%, 330px); }
  .anatomy-device--wrist { width: min(100%, 296px); }
  .anatomy-col { display: contents; }
  .anatomy-dot { --dot-size: 24px; }
  .anatomy-dot__num { display: block; }
  .anatomy-callout__badge { width: 22px; height: 22px; font-size: 0.75rem; font-weight: 700; color: #ffffff; }
  .anatomy-col--left .anatomy-callout, .anatomy-col--right .anatomy-callout { transform: translateY(14px); }
  .anatomy-card.is-visible .anatomy-callout, .shot .anatomy-callout { transform: translateY(0); }
}

@media (max-width: 600px) {
  .anatomy-card { padding: 10px 0 12px; }
  .anatomy-stage { grid-template-columns: 1fr; }
  .anatomy-visual { row-gap: 8px; padding-block-end: 0; }

  /* Put the selected callout directly after the visual and its primary action. */
  .anatomy-callout.is-featured { order: 0; scroll-margin-block: 64px 12px; }

  /* Keep one primary link visible and focusable at each breakpoint. */
  .anatomy-primary--wide { display: none; }
  .anatomy-primary--mobile {
    display: inline-flex; min-height: 48px; max-width: 100%;
    white-space: normal; text-align: center;
  }

  /* Leave room for the primary action on short phones while retaining the image aspect ratio. */
  .anatomy-device { width: min(100%, 330px, 42svh); }
  .anatomy-device--wrist { width: min(100%, 296px, 39svh); }
}

@media (prefers-reduced-motion: reduce) {
  .anatomy-device, .anatomy-dot, .anatomy-callout { opacity: 1 !important; transform: none !important; }
  .anatomy-path { stroke-dashoffset: 0 !important; }
  .anatomy-anchor { opacity: 1 !important; }
  .anatomy-dot::before { animation: none !important; display: none; }
  .carousel-dot.is-active .carousel-dot__fill { animation: none !important; transform: scaleX(1) !important; }
}
