/* Isolate labd.css from the landing page, then MacBook + contest phone. */

html {
  height: auto;
  background: var(--dl-bg, #07080d);
}

body.dems-landing {
  height: auto;
  min-height: 100%;
  overflow: visible;
  overscroll-behavior: auto;
  background: var(--dl-bg, #07080d);
  background-image: none;
  color: var(--dl-fg, #f3f5f8);
  font-family: var(--dl-font-body);
}

.dl-mac img,
.dl-phone img {
  max-width: none;
}

.dl-mac img.dl-mac__wallpaper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 42%;
  pointer-events: none;
}

/* Lid fills the story stage; thin white bezel, no camera */
.dl-mac {
  position: relative;
  z-index: 2;
  width: min(
    var(--dl-layout),
    100%,
    calc((100dvh - var(--dl-chrome-h) - 1.5rem) * 16 / 10.4)
  );
  height: auto;
  aspect-ratio: var(--dl-mac-ar);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  filter: drop-shadow(0 28px 56px rgba(0, 0, 0, 0.5));
}

.dl-mac__lid {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  padding: 6px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.dl-mac__screen {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: hidden;
  background: #09090b;
  border-radius: 8px;
  container-type: size;
  pointer-events: none;
}

.dl-mac__wallpaper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 42%;
  pointer-events: none;
}

/* macOS menu bar + Dock on the wallpaper */
.dl-os {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.dl-os__menubar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  padding: 0 12px;
  color: #f4f6fa;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  background: rgba(18, 18, 22, 0.28);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.dl-os__left,
.dl-os__right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.dl-os__left span,
.dl-os__right span {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.dl-os__apple {
  color: #fff;
}

.dl-os__app {
  font-weight: 700;
}

.dl-os__lang {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.dl-os__batt svg {
  display: block;
  color: #f4f6fa;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.4));
}

.dl-os__dock {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 7px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.38);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(28px) saturate(1.5);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
}

.dl-os__icon {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  flex: 0 0 auto;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.dl-os__icon img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.dl-os__icon.is-open {
  transform: translateX(2px) scale(1.06);
}

.dl-os__icon.is-open::after {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.35);
}

.dl-os__split {
  width: 28px;
  height: 1px;
  margin: 2px 0;
  align-self: center;
  background: rgba(255, 255, 255, 0.35);
}

.dl-os__icon--finder {
  background:
    radial-gradient(circle at 34% 40%, #1a1a1e 0 9%, transparent 10%),
    radial-gradient(circle at 66% 40%, #1a1a1e 0 9%, transparent 10%),
    radial-gradient(circle at 50% 72%, rgba(26, 26, 30, 0.35) 0 18%, transparent 19%),
    linear-gradient(180deg, #8ed0ff, #1a7bde);
}
.dl-os__icon--msg::before {
  content: "";
  position: absolute;
  inset: 22% 18% 28%;
  border-radius: 40% 40% 40% 8%;
  background: rgba(255, 255, 255, 0.92);
}
.dl-os__icon--music::before {
  content: "♪";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}
.dl-os__icon--set::before {
  content: "⚙";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: rgba(40, 40, 44, 0.85);
}
.dl-os__icon--safari {
  background:
    conic-gradient(from 0deg, #ff3b30, #fff 18%, #007aff 50%, #fff 82%, #ff3b30);
}
.dl-os__icon--msg {
  background: linear-gradient(180deg, #6dff7a, #1db954);
}
.dl-os__icon--music {
  background: linear-gradient(180deg, #ff6b8a, #fc3c44);
}
.dl-os__icon--photos {
  background: conic-gradient(#ffcc00, #ff3b30, #ff2d55, #af52de, #007aff, #34c759, #ffcc00);
}
.dl-os__icon--set {
  background: linear-gradient(180deg, #cfd1d6, #8e8e93);
}
.dl-os__icon--trash {
  background: linear-gradient(180deg, #f2f2f7, #c7c7cc);
}
.dl-os__icon--trash::before {
  content: "";
  position: absolute;
  left: 30%;
  right: 30%;
  top: 34%;
  bottom: 18%;
  border: 1.6px solid rgba(72, 72, 77, 0.75);
  border-top: 0;
  border-radius: 0 0 3px 3px;
}
.dl-os__icon--trash::after {
  content: "";
  position: absolute;
  left: 26%;
  right: 26%;
  top: 24%;
  height: 3px;
  border-radius: 1px;
  background: rgba(72, 72, 77, 0.75);
}

/* Desktop .wav aliases, scattered */
.dl-os__desk {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.dl-os__file {
  position: absolute;
  width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}

.dl-os__file--a {
  left: 18%;
  top: 26%;
}

.dl-os__file--b {
  left: 29%;
  top: 44%;
  width: 118px;
}

.dl-os__file--c {
  left: 79%;
  top: 58%;
}

.dl-os__wav {
  position: relative;
  width: 46px;
  height: 56px;
  border-radius: 3px 10px 3px 3px;
  background: linear-gradient(180deg, #fff 0%, #f3f3f7 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.dl-os__wav::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  border-style: solid;
  border-width: 0 12px 12px 0;
  border-color: #c5d4ea #c5d4ea #dce6f4 #dce6f4;
}

.dl-os__wav::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 12px;
  height: 18px;
  background:
    linear-gradient(#3b82f6, #3b82f6) 0 50% / 3px 7px no-repeat,
    linear-gradient(#2563eb, #2563eb) 7px 50% / 3px 14px no-repeat,
    linear-gradient(#3b82f6, #3b82f6) 14px 50% / 3px 10px no-repeat,
    linear-gradient(#1d4ed8, #1d4ed8) 21px 50% / 3px 16px no-repeat;
}

.dl-os__file-name {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  color: #fff;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
  max-width: 96px;
  word-break: break-word;
}

.dl-os__file--b .dl-os__file-name {
  max-width: 118px;
}

@media (max-width: 900px) {
  .dl-os__left span:nth-child(n + 4) {
    display: none;
  }
  .dl-os__icon {
    width: 30px;
    height: 30px;
  }
  .dl-os__file--b {
    left: 24%;
    top: 52%;
  }
}

@media (max-width: 640px) {
  .dl-os__left span:nth-child(n + 3) {
    display: none;
  }
}

/* dems banner notification — top-right of Mac desk (desktop story steps) */
.dl-os-toast {
  position: absolute;
  top: 42px;
  right: 14px;
  z-index: 6;
  width: min(320px, 38%);
  max-width: calc(100% - 28px);
  padding: 10px 12px 12px;
  border-radius: 14px;
  background: rgba(246, 246, 248, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 10px 28px -12px rgba(0, 0, 0, 0.45),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  backdrop-filter: blur(18px) saturate(1.35);
  color: #1a1b1f;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  opacity: 0;
  transform: translate3d(28px, -18px, 0) scale(0.92);
  transform-origin: top right;
  pointer-events: none;
  will-change: opacity, transform;
}

.dl-os-toast.is-in {
  animation: dl-os-toast-in 0.72s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes dl-os-toast-in {
  0% {
    opacity: 0;
    transform: translate3d(32px, -22px, 0) scale(0.9);
  }
  58% {
    opacity: 1;
    transform: translate3d(-3px, 3px, 0) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.dl-os-toast__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  min-width: 0;
}

.dl-os-toast__icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex: 0 0 auto;
  object-fit: cover;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dl-os-toast__app {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(26, 27, 31, 0.72);
  text-transform: lowercase;
}

.dl-os-toast__when {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 500;
  color: rgba(26, 27, 31, 0.45);
}

.dl-os-toast__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #12131a;
}

.dl-os-toast__body {
  margin: 3px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  color: rgba(26, 27, 31, 0.72);
}

html.dl-reduced .dl-os-toast,
html.dl-reduced .dl-os-toast.is-in {
  opacity: 1;
  transform: none;
  animation: none;
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  .dl-os-toast {
    transform: none;
    will-change: auto;
  }
  .dl-os-toast.is-in {
    animation: none;
    opacity: 1;
  }
}

/* Contest iPhone (tmp/stream_motion): 400×820, r42, 9px bezel, notch.
   Fit box = free desk (menubar + dock insets). zoom resizes layout pixels
   instead of bitmap-scaling a GPU layer (jagged gradient borders). */
.dl-phone-fit {
  position: absolute;
  z-index: 2;
  top: 40px;
  right: 5%;
  bottom: 5%;
  left: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  container-type: size;
  pointer-events: none;
}

.dl-phone-scale {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 400px;
  height: 820px;
  /* length/length → number. Unitless 400 is a length in calc and zoom drops it. */
  zoom: min(calc(100cqw / 400px), calc(100cqh / 820px));
  pointer-events: auto;
}

@supports not (zoom: 1) {
  .dl-phone-scale {
    position: absolute;
    left: 50%;
    top: 50%;
    zoom: unset;
    transform: translate(-50%, -50%) scale(0.62);
    transform-origin: center center;
  }

  .dl-phone-fit .dl-phone-scale {
    transform: translate(-50%, -50%)
      scale(min(calc(100cqw / 400), calc(100cqh / 820)));
  }
}

.dl-phone {
  position: relative;
  width: 400px;
  height: 820px;
  margin: 0;
  border-radius: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0b0c10;
  box-shadow:
    0 0 0 9px #15161c,
    0 36px 80px -28px rgba(0, 0, 0, 0.88),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.dl-phone__notch {
  position: absolute;
  top: 11px;
  left: 50%;
  z-index: 30;
  width: 110px;
  height: 26px;
  margin-left: -55px;
  border-radius: 999px;
  background: #050508;
  pointer-events: none;
}

.dl-phone__screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  font-family: var(--labd-font);
  color: var(--labd-fg);
  --labd-safe-top: 36px;
  --labd-safe-bottom: 8px;
}

.dl-phone__screen .labd-app {
  height: 100%;
  width: 100%;
}

.dl-phone__screen .labd-view {
  height: 100%;
}

.dl-phone__screen .labd-header,
.dl-phone__screen .labd-compose {
  position: absolute;
  left: 0;
  right: 0;
}

.dl-phone__screen .labd-header {
  top: 0;
}

.dl-phone__screen .labd-compose {
  bottom: 0;
  display: flex;
}

.dl-phone__screen .labd-feed {
  overflow: hidden;
  height: 100%;
}

.dl-phone__screen .labd-feed__cover-3d {
  width: 184px;
  height: 184px;
}

.dl-phone__screen.labd--compose-on .labd-feed__meta {
  bottom: calc(28px + var(--labd-compose-space));
}
.dl-phone__screen.labd--compose-on .labd-feed__actions {
  bottom: calc(96px + var(--labd-compose-space));
  pointer-events: none;
}
.dl-phone__screen.labd--compose-on .labd-feed__action--react,
.dl-phone__screen.labd--compose-on .labd-feed__action--share,
.dl-phone__screen.labd--compose-on .labd-feed__action--comments,
.dl-phone__screen.labd--compose-on .labd-feed__action--report {
  pointer-events: auto;
}
.dl-phone__screen.labd--compose-on .labd-feed__progress {
  bottom: var(--labd-compose-space);
  height: 22px;
  padding-bottom: 0;
}
.dl-phone__screen.labd--compose-on .labd-feed__progress::before,
.dl-phone__screen.labd--compose-on .labd-feed__progress-fill {
  bottom: 0;
}

.dl-phone__screen .labd-feed__viz {
  opacity: 1;
}

.dl-product {
  display: grid;
  place-items: center;
  top: var(--dl-chrome-h);
  right: 0;
  bottom: 1.5rem;
  left: 0;
  width: auto;
  margin: 0;
}

@media (max-width: 640px) {
  .dl-os__file-name {
    font-size: 9px;
  }
}
