/* Interactive cutaways for case-study hero imagery only. */

.case-cutaway-sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.mealmap-demo-panel[hidden],
.rideshare-demo-panel[hidden],
.rewire-stack-state[hidden] {
  display: none !important;
}

/* MealMap: product screens rise above the logo once a journey tab is selected. */
.mealmap-demo {
  isolation: isolate;
}

.mealmap-demo-logo {
  position: relative;
  z-index: 2;
  display: block;
  height: auto;
}

.mealmap-demo .hero-badge {
  z-index: 4;
}

.mealmap-demo-stage {
  position: absolute;
  z-index: 1;
  top: -44px;
  left: 210px;
  width: 174px;
  aspect-ratio: 1300 / 2642;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-38px) rotate(2deg) scale(.94);
  transform-origin: left center;
  transition: opacity .28s ease, transform .38s cubic-bezier(.2, .75, .2, 1), visibility .28s;
}

.mealmap-demo.is-open .mealmap-demo-stage {
  z-index: 6;
  opacity: 1;
  visibility: visible;
  transform: translateX(0) rotate(2deg) scale(1);
}

.mealmap-demo-overview,
.mealmap-demo-panel {
  position: absolute;
  inset: 0;
}

.mealmap-demo-panel {
  margin: 0;
  animation: cutawayFadeIn .24s ease both;
}

.mealmap-demo-screen {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 24px 26px rgba(14, 11, 18, .24));
  user-select: none;
  -webkit-user-drag: none;
}

.mealmap-demo-panel figcaption {
  position: absolute;
  right: -12px;
  bottom: 18px;
  padding: .42rem .58rem;
  border: 1px solid rgba(14, 11, 18, .09);
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 7px 20px rgba(14, 11, 18, .13);
  color: #176b46;
  font: 600 .56rem/1.25 var(--sans, 'DM Sans', sans-serif);
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.mealmap-demo-tabs {
  position: absolute;
  z-index: 7;
  top: calc(100% + 16px);
  left: 50%;
  display: flex;
  width: max-content;
  padding: 4px;
  border: 1px solid rgba(14, 11, 18, .08);
  border-radius: 100px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 9px 26px rgba(14, 11, 18, .12);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.mealmap-demo-tab {
  min-height: 32px;
  padding: .36rem .58rem;
  border: 0;
  border-radius: 100px;
  outline: 0;
  background: transparent;
  color: #6b6372;
  font: 600 .59rem/1 var(--sans, 'DM Sans', sans-serif);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.mealmap-demo-tab:hover {
  color: #176b46;
}

.mealmap-demo-tab.active {
  background: #e3f3e9;
  color: #176b46;
}

.mealmap-demo-tab:active {
  transform: translateY(1px);
}

.mealmap-demo-tab:focus-visible {
  box-shadow: 0 0 0 3px rgba(23, 107, 70, .3);
}

/* Autonomous rideshare — prototype states are projected into the photographed display. */
.rideshare-demo {
  isolation: isolate;
}

.rideshare-demo > .hero-main-img {
  height: auto;
}

.rideshare-demo-panel {
  position: absolute;
  z-index: 2;
  inset: 0;
  margin: 0;
  pointer-events: none;
  animation: cutawayFadeIn .2s ease both;
}

.rideshare-demo-screen {
  position: absolute;
  left: 21.5%;
  top: 43.4%;
  width: 39.9%;
  height: 32.6%;
  overflow: hidden;
  background: #170f0c;
  clip-path: polygon(0 0, 93.7% 0, 100% 80.4%, 6.5% 100%);
}

.rideshare-demo-crop {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.rideshare-demo-crop img {
  position: absolute;
  display: block;
  width: 286%;
  max-width: none;
  height: auto;
  filter: saturate(.9) contrast(1.05);
  user-select: none;
  -webkit-user-drag: none;
}

.rideshare-demo-crop--top-left img {
  top: -33%;
  left: -10%;
}

.rideshare-demo-crop--bottom-right img {
  right: -11%;
  bottom: -34%;
}

.rideshare-demo-voice {
  position: absolute;
  left: 23%;
  top: 77.5%;
  max-width: 52%;
  padding: .35rem .5rem;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 7px;
  background: rgba(7, 10, 15, .82);
  box-shadow: 0 7px 18px rgba(0, 0, 0, .22);
  color: rgba(255, 255, 255, .78);
  font: 500 .52rem/1.25 var(--sans, 'DM Sans', sans-serif);
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.rideshare-demo-voice strong {
  margin-right: .25rem;
  color: #f4b300;
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .48rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.rideshare-demo-tabs {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 3.5%;
  display: flex;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 100px;
  background: rgba(7, 10, 15, .76);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .24);
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}

.rideshare-demo-tab {
  min-height: 29px;
  padding: .32rem .58rem;
  border: 0;
  border-radius: 100px;
  outline: 0;
  background: transparent;
  color: rgba(255, 255, 255, .58);
  font: 600 .54rem/1 var(--sans, 'DM Sans', sans-serif);
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.rideshare-demo-tab:hover,
.rideshare-demo-tab.active {
  color: #fff;
}

.rideshare-demo-tab.active {
  background: rgba(244, 179, 0, .24);
  box-shadow: inset 0 0 0 1px rgba(244, 179, 0, .22);
}

.rideshare-demo-tab:focus-visible {
  box-shadow: 0 0 0 3px rgba(244, 179, 0, .58);
}

.rideshare-demo-cue {
  position: absolute;
  z-index: 3;
  top: 4%;
  right: 4%;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .34rem .48rem;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 100px;
  background: rgba(7, 10, 15, .68);
  color: rgba(255, 255, 255, .72);
  font: 500 .48rem/1 var(--mono, 'DM Mono', monospace);
  letter-spacing: .04em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.rideshare-demo-cue i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #f4b300;
  box-shadow: 0 0 9px rgba(244, 179, 0, .8);
}

/* Dearborn — each original hero phone is its own before/after cutaway. */
.dearborn-cutaway-viewport {
  position: relative;
  isolation: isolate;
}

.phone-trio .phone-img {
  height: auto;
}

.dearborn-cutaway-current {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  border-radius: 24px;
  clip-path: inset(0 calc(100% - var(--case-cutaway-reveal)) 0 0);
}

.dearborn-cutaway-current .phone-img {
  box-shadow: none;
}

.dearborn-cutaway--complete .dearborn-cutaway-current .phone-img {
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.case-cutaway-range {
  position: absolute;
  z-index: 5;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  appearance: none;
  opacity: .001;
  background: transparent;
  cursor: ew-resize;
}

.case-cutaway-range::-webkit-slider-runnable-track {
  width: 100%;
  height: 100%;
  background: transparent;
}

.case-cutaway-range::-webkit-slider-thumb {
  width: 44px;
  height: 100%;
  appearance: none;
  background: transparent;
}

.case-cutaway-range::-moz-range-track {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.case-cutaway-range::-moz-range-thumb {
  width: 44px;
  height: 100%;
  border: 0;
  background: transparent;
}

.case-cutaway-divider {
  position: absolute;
  z-index: 4;
  top: 4%;
  bottom: 4%;
  left: var(--case-cutaway-reveal);
  width: 2px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 0 0 1px rgba(0, 35, 88, .18), 0 0 12px rgba(0, 35, 88, .24);
  transform: translateX(-1px);
  pointer-events: none;
}

.case-cutaway-divider i {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 34px;
  height: 34px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #0052cc;
  box-shadow: 0 6px 16px rgba(0, 35, 88, .28);
  color: #fff;
  font: 700 .85rem/1 var(--sans, 'DM Sans', sans-serif);
  font-style: normal;
  place-items: center;
  transform: translate(-50%, -50%);
}

.case-cutaway-range:focus-visible + .case-cutaway-divider i {
  outline: 3px solid rgba(0, 82, 204, .48);
  outline-offset: 4px;
}

.dearborn-cutaway-hint {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: -31px;
  padding: .36rem .54rem;
  border: 1px solid rgba(0, 82, 204, .14);
  border-radius: 100px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 6px 18px rgba(14, 11, 18, .1);
  color: #0052cc;
  font: 600 .5rem/1 var(--mono, 'DM Mono', monospace);
  letter-spacing: .03em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translateX(-50%);
}

.dearborn-cutaway--complete .dearborn-cutaway-hint {
  bottom: -40px;
}

/* Rewire — the original three-phone composition advances as a storyboard. */
.rewire-demo {
  isolation: isolate;
}

.rewire-stack-state {
  position: absolute;
  z-index: 1;
  inset: 0;
}

.rewire-stack-state.active {
  animation: rewireStackIn .24s ease both;
}

.rewire-demo-tabs {
  position: absolute;
  z-index: 10;
  left: 12px;
  bottom: 10px;
  display: flex;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 100px;
  background: rgba(10, 7, 14, .78);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .32);
  backdrop-filter: blur(10px);
}

.rewire-demo-tab {
  min-height: 34px;
  padding: .38rem .58rem;
  border: 0;
  border-radius: 100px;
  outline: 0;
  background: transparent;
  color: rgba(255, 255, 255, .56);
  font: 600 .57rem/1 var(--sans, 'DM Sans', sans-serif);
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}

.rewire-demo-tab span {
  margin-right: .26rem;
  color: #d635ef;
  font-family: var(--mono, 'DM Mono', monospace);
  font-size: .48rem;
}

.rewire-demo-tab:hover,
.rewire-demo-tab.active {
  color: #fff;
}

.rewire-demo-tab.active {
  background: rgba(177, 4, 200, .24);
  box-shadow: inset 0 0 0 1px rgba(214, 53, 239, .2);
}

.rewire-demo-tab:focus-visible {
  box-shadow: 0 0 0 3px rgba(214, 53, 239, .55);
}

@keyframes cutawayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes rewireStackIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1200px) and (min-width: 961px) {
  .mealmap-demo-stage {
    left: 194px;
    width: 158px;
  }

  .rewire-demo-tabs {
    bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mealmap-demo-stage,
  .mealmap-demo-tab,
  .rideshare-demo-tab,
  .rewire-demo-tab {
    transition: none;
  }

  .mealmap-demo-panel,
  .rideshare-demo-panel,
  .rewire-stack-state.active {
    animation: none;
  }
}
