/* ==========================================================================
   Different Engineering — dual.css
   Section 003: one real object split by a border the visitor moves.
   Left of the border the factory (the piece as a green line drawing on a
   drafting grid, with callouts), right of it the atelier (the finished piece
   under the stage's orange spotlight). --x is the border, 0% to 100%.
   ========================================================================== */

.dv {
  --x: 50%;
  --eng: #6BFF6A;
  --show: #FE4E04;
  position: relative;
  height: clamp(560px, 82vh, 780px);
  border-radius: 28px;
  overflow: hidden;
  isolation: isolate;
  background: #0B0C0D;
  box-shadow: 0 40px 90px -30px rgba(21, 21, 23, .55);
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

/* the two worlds ------------------------------------------------------------- */
.dv-side { position: absolute; inset: 0; }

.dv-eng {
  background:
    linear-gradient(rgba(107,255,106,.09) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(90deg, rgba(107,255,106,.09) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(rgba(107,255,106,.04) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(107,255,106,.04) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(ellipse at 50% 45%, #0D1A0F, #070908 70%);
}
.dv-show {
  clip-path: inset(0 0 0 var(--x));
  background:
    radial-gradient(ellipse 38% 55% at 50% 8%, rgba(254,78,4,.42), transparent 70%),
    radial-gradient(ellipse 30% 7% at 50% 88%, rgba(254,78,4,.28), transparent 70%),
    radial-gradient(ellipse at 50% 40%, #1E120C, #0B0706 72%);
}
/* the spotlight cone */
.dv-show::before {
  content: ""; position: absolute; left: 50%; top: -10%; width: 70%; height: 110%;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255,214,186,.16), rgba(255,214,186,0) 80%);
  clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%);
  filter: blur(18px);
  pointer-events: none;
}

/* the object: one frame, the same in both worlds, so the halves meet exactly
   (scentsound-wireframe.webp is cropped so its outline matches cut-scentsound.png) */
.dv-obj {
  position: absolute; left: 50%; top: 50%;
  height: 84%; aspect-ratio: 720 / 1080;
  transform: translate(-50%, -48%);
}
.dv-obj img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.dv-show .dv-obj img { filter: drop-shadow(0 40px 40px rgba(0,0,0,.6)) saturate(1.08); }
/* the see-through assembly drawing (transparent webp, its ground removed) */
.dv-wire { filter: drop-shadow(0 0 6px rgba(107,255,106,.25)); }

/* callouts on the drawing ---------------------------------------------------- */
.dv-callouts { list-style: none; margin: 0; padding: 0; position: absolute; inset: 0; }
.dv-callouts li {
  position: absolute; left: var(--cx); top: var(--cy);
  width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border: 1.5px solid var(--eng); border-radius: 50%;
}
.dv-callouts li::before {
  /* leader line out to the label */
  content: ""; position: absolute; top: 3px; height: 1px;
  width: var(--len, 120px);
  background: var(--eng);
  opacity: .7;
}
.dv-callouts li[data-side="l"]::before { right: 9px; }
.dv-callouts li[data-side="r"]::before { left: 9px; }
.dv-callouts li span {
  position: absolute; top: -8px; white-space: nowrap;
  font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--eng);
  background: rgba(7,9,8,.85); padding: 5px 7px; border: 1px solid rgba(107,255,106,.35); border-radius: 4px;
}
.dv-callouts li[data-side="l"] span { right: calc(var(--len, 120px) + 12px); }
.dv-callouts li[data-side="r"] span { left: calc(var(--len, 120px) + 12px); }
.dv-callouts li span b { color: rgba(245,255,247,.55); font-weight: 500; margin-right: 6px; }

/* a slow scan line over the drawing */
.dv-eng::after {
  content: ""; position: absolute; left: 0; right: 0; height: 120px; top: -120px;
  background: linear-gradient(180deg, transparent, rgba(107,255,106,.10), transparent);
  animation: dvScan 6s linear infinite;
  pointer-events: none;
}
@keyframes dvScan { to { transform: translateY(calc(100vh + 240px)); } }

.dv-places {
  position: absolute; right: 28px; bottom: 24px; margin: 0; text-align: right;
  font: 400 11px/1.6 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: rgba(255,233,220,.7);
}
.dv-places span:first-child { display: block; color: var(--show); }

/* the words of each world ------------------------------------------------------ */
.dv-text {
  position: absolute; top: clamp(24px, 3.4vw, 44px); width: min(30%, 340px);
  color: var(--foam);
  transition: opacity 400ms var(--ease-expo);
}
/* dual.js clips each block at the border, so a world's words never cross into the other */
.dv-text--eng { left: clamp(24px, 3.4vw, 44px); }
.dv-text--show { right: clamp(24px, 3.4vw, 44px); text-align: left; }
.dv-text h3 { font-size: clamp(22px, 2.3vw, 30px); font-weight: 600; letter-spacing: -.03em; line-height: 1.08; margin: 16px 0 12px; }
.dv-text--show h3 { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: clamp(26px, 2.8vw, 36px); letter-spacing: -.01em; line-height: 1.02; }
.dv-text p { font-size: 14.5px; line-height: 1.65; color: rgba(245,255,247,.7); margin: 0 0 16px; }
.dv-text .dual-list { display: grid; gap: 8px; font: 400 11.5px/1.45 var(--mono); }
.dv-text--eng .dual-list { color: rgba(107,255,106,.85); }
.dv-text--show .dual-list { color: rgba(255,190,160,.9); }
/* a world's words fade as its side gets narrow */
.dv-text--eng { opacity: var(--o-eng, 1); }
.dv-text--show { opacity: var(--o-show, 1); }

/* the border ---------------------------------------------------------------- */
.dv-handle {
  position: absolute; top: 0; bottom: 0; left: var(--x); width: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.dv-handle::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px;
  background: linear-gradient(180deg, var(--eng), #fff 50%, var(--show));
  box-shadow: 0 0 18px rgba(255,255,255,.35);
}
.dv-knob {
  position: relative; flex: none;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: #F5FFF7; color: #0E0E10;
  box-shadow: 0 0 0 6px rgba(245,255,247,.14), 0 12px 30px rgba(0,0,0,.5);
  transition: transform var(--fast) var(--ease-spring);
}
.dv:hover .dv-knob, .dv.is-drag .dv-knob { transform: scale(1.08); }
.dv-label {
  position: absolute; top: calc(50% + 46px); white-space: nowrap;
  font: 700 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase;
  padding: 7px 10px; border-radius: 999px;
}
.dv-label--eng { right: 10px; color: #0E0E10; background: var(--eng); }
.dv-label--show { left: 10px; color: #FFF3EC; background: var(--show); }

/* keyboard and screen readers drive the border through a real range input */
.dv-range {
  position: absolute; inset: auto 0 0 0; width: 100%; height: 44px; margin: 0;
  opacity: 0; cursor: ew-resize; z-index: 4;
}
.dv-range:focus-visible + * , .dv:has(.dv-range:focus-visible) .dv-knob { outline: 3px solid var(--eng); outline-offset: 4px; }

/* small screens: the words leave the stage and stand under it ------------------ */
@media (max-width: 860px) {
  .dv { height: auto; display: grid; grid-template-rows: 70vh auto auto; border-radius: 22px; cursor: default; }
  .dv-side { grid-row: 1; position: relative; inset: auto; height: 70vh; grid-column: 1; }
  .dv-show { margin-top: 0; }
  .dv-handle { height: 70vh; bottom: auto; }
  .dv-range { inset: 0 0 auto 0; height: 70vh; opacity: 0; }
  .dv-text { position: relative; top: auto; left: auto !important; right: auto !important; width: auto; clip-path: none !important; opacity: 1 !important; padding: 26px 22px 6px; }
  .dv-text--eng { grid-row: 2; border-top: 1px solid rgba(107,255,106,.25); }
  .dv-text--show { grid-row: 3; padding-bottom: 28px; }
  /* a phone has no room for the labels: the drawing keeps only its points */
  .dv-callouts li span, .dv-callouts li::before { display: none; }
  .dv-places { bottom: 16px; right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .dv-eng::after { animation: none; display: none; }
  .dv-knob, .dv-text { transition: none; }
}
