:root {
  --tellus-demo-gold: #f0c56a;
  --tellus-demo-ink: #07111f;
  --tellus-demo-cream: #fff8ea;
  --tellus-demo-controls-height: 174px;
}

html.tellus-demo-active {
  scroll-padding-top: 92px;
  scroll-padding-bottom: calc(var(--tellus-demo-controls-height) + 28px);
}

body.tellus-demo-active {
  overscroll-behavior: none;
}

.demo-launch-button {
  border-color: rgba(240, 197, 106, 0.48);
}

.tellus-demo-top-layer {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: var(--tellus-demo-cream);
  border: 0;
  background: transparent;
  pointer-events: none;
}

.tellus-demo-top-layer::backdrop {
  background: transparent;
  pointer-events: auto;
}

.tellus-demo-spotlight {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tellus-demo-dimmer {
  fill: rgba(1, 6, 12, 0.78);
}

.tellus-demo-outline {
  fill: none;
  stroke: var(--tellus-demo-gold);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 8px rgba(240, 197, 106, 0.58));
}

.tellus-demo-banner {
  position: absolute;
  z-index: 3;
  top: max(8px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  max-width: calc(100vw - 24px);
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  color: var(--tellus-demo-cream);
  border: 1px solid rgba(240, 197, 106, 0.46);
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.96);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.32);
  font-size: 0.78rem;
  transform: translateX(-50%);
  white-space: nowrap;
  pointer-events: none;
}

.tellus-demo-banner strong {
  color: var(--tellus-demo-gold);
  letter-spacing: 0.08em;
}

.tellus-demo-caption {
  position: absolute;
  z-index: 4;
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(var(--tellus-demo-controls-height) + 20px);
  left: max(12px, env(safe-area-inset-left));
  max-width: 920px;
  margin-inline: auto;
  padding: 15px 18px;
  color: var(--tellus-demo-cream);
  border: 1px solid rgba(240, 197, 106, 0.48);
  border-radius: 16px;
  background: rgba(7, 17, 31, 0.97);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  font-size: clamp(0.9rem, 2.2vw, 1.05rem);
  line-height: 1.55;
  pointer-events: none;
}

.tellus-demo-caption.is-top {
  top: max(62px, calc(env(safe-area-inset-top) + 54px));
  bottom: auto;
}

.tellus-demo-caption[hidden] {
  display: none;
}

.tellus-demo-cursor {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  width: 23px;
  height: 29px;
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.7));
  transform: translate(-100px, -100px);
  transition: transform 340ms cubic-bezier(0.2, 0.78, 0.3, 1), opacity 140ms ease;
  pointer-events: none;
}

.tellus-demo-cursor::before {
  display: block;
  width: 100%;
  height: 100%;
  content: "";
  background: var(--tellus-demo-cream);
  clip-path: polygon(0 0, 0 82%, 23% 63%, 39% 100%, 57% 91%, 41% 57%, 70% 56%);
}

.tellus-demo-cursor.is-visible {
  opacity: 1;
}

.tellus-demo-cursor.is-clicking {
  animation: tellus-demo-click 360ms ease;
}

@keyframes tellus-demo-click {
  50% { transform: var(--tellus-demo-cursor-position) scale(0.82); }
}

.tellus-demo-controls {
  position: absolute;
  z-index: 6;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(10px, env(safe-area-inset-left));
  display: grid;
  max-width: 980px;
  min-height: 0;
  margin-inline: auto;
  gap: 9px;
  padding: 12px;
  color: var(--tellus-demo-cream);
  border: 1px solid rgba(240, 197, 106, 0.4);
  border-radius: 18px;
  background: rgba(7, 17, 31, 0.98);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}

.tellus-demo-control-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.tellus-demo-control {
  display: inline-grid;
  min-width: 42px;
  min-height: 42px;
  place-items: center;
  padding: 7px 10px;
  color: var(--tellus-demo-cream);
  border: 1px solid rgba(217, 225, 233, 0.24);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.tellus-demo-control:hover,
.tellus-demo-control:focus-visible {
  border-color: var(--tellus-demo-gold);
  background: rgba(240, 197, 106, 0.12);
}

.tellus-demo-control[data-control="next"] {
  color: var(--tellus-demo-ink);
  border-color: var(--tellus-demo-gold);
  background: var(--tellus-demo-gold);
}

.tellus-demo-control[data-control="stop"] {
  min-width: 76px;
}

.tellus-demo-control[aria-pressed="true"] {
  color: var(--tellus-demo-ink);
  background: var(--tellus-demo-gold);
}

.tellus-demo-progress-wrap {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(80px, 1fr);
  align-items: center;
  gap: 10px;
}

.tellus-demo-progress-label,
.tellus-demo-status,
.tellus-demo-rate {
  color: #d9e1e9;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tellus-demo-progress {
  width: 100%;
  min-width: 80px;
  height: 22px;
  margin: 0;
  accent-color: var(--tellus-demo-gold);
  cursor: ew-resize;
}

.tellus-demo-voice {
  min-height: 42px;
  max-width: 124px;
  padding: 7px 9px;
  color: var(--tellus-demo-cream);
  border: 1px solid rgba(217, 225, 233, 0.24);
  border-radius: 11px;
  background: #0d1c2d;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 750;
}

.tellus-demo-debug {
  position: absolute;
  z-index: 8;
  top: 58px;
  right: 10px;
  max-width: min(440px, calc(100vw - 20px));
  max-height: 42vh;
  overflow: auto;
  padding: 10px 12px;
  color: #dcfce7;
  border: 1px solid #22c55e;
  border-radius: 10px;
  background: rgba(2, 20, 12, 0.96);
  font: 11px/1.45 Consolas, monospace;
  white-space: pre-wrap;
  pointer-events: auto;
}

.tellus-demo-modal {
  width: min(calc(100% - 24px), 650px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 24px;
  color: var(--tellus-demo-cream);
  border: 1px solid rgba(240, 197, 106, 0.44);
  border-radius: 22px;
  background: #0a1727;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.56);
}

.tellus-demo-modal::backdrop {
  background: rgba(1, 6, 12, 0.82);
  backdrop-filter: blur(6px);
}

.tellus-demo-modal h2 {
  margin: 0;
  color: var(--tellus-demo-cream);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  font-weight: 400;
  line-height: 1.1;
}

.tellus-demo-modal p {
  margin: 14px 0 0;
  color: #bdc9d5;
}

.tellus-demo-intro-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 22px;
  padding: 15px;
  border: 1px solid rgba(217, 225, 233, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.tellus-demo-intro-settings label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #d9e1e9;
  font-weight: 700;
}

.tellus-demo-intro-settings select {
  min-height: 44px;
  padding: 8px 11px;
  color: var(--tellus-demo-cream);
  border: 1px solid rgba(240, 197, 106, 0.42);
  border-radius: 10px;
  background: #07111f;
  font: inherit;
}

.tellus-demo-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.tellus-demo-modal-actions .button {
  width: auto;
}

.tellus-demo-error {
  margin-top: 14px !important;
  color: #f6a7a1 !important;
}

@media (max-width: 600px) {
  :root {
    --tellus-demo-controls-height: 220px;
  }

  .tellus-demo-banner {
    font-size: 0.66rem;
  }

  .tellus-demo-banner span {
    overflow: hidden;
    max-width: 45vw;
    text-overflow: ellipsis;
  }

  .tellus-demo-caption {
    padding: 12px 14px;
    font-size: 0.86rem;
  }

  .tellus-demo-controls {
    gap: 7px;
    padding: 9px;
  }

  .tellus-demo-control-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  .tellus-demo-progress-wrap {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .tellus-demo-progress-label {
    text-align: center;
  }

  .tellus-demo-control {
    min-width: 40px;
    min-height: 40px;
    padding: 5px 8px;
  }

  .tellus-demo-control[data-control="stop"] {
    min-width: 68px;
    font-size: 0.7rem;
  }

  .tellus-demo-cursor {
    width: 18px;
    height: 23px;
  }

  .tellus-demo-modal {
    padding: 20px;
  }

  .tellus-demo-modal-actions {
    display: grid;
  }

  .tellus-demo-modal-actions .button {
    width: 100%;
  }
}

@media (max-height: 720px) {
  :root {
    --tellus-demo-controls-height: 158px;
  }

  .tellus-demo-controls {
    transform: scale(0.9);
    transform-origin: bottom center;
  }

  .tellus-demo-caption {
    max-height: 25vh;
    overflow: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tellus-demo-cursor {
    transition: none;
  }

  .tellus-demo-cursor.is-clicking {
    animation: none;
  }
}

@media print {
  .tellus-demo-top-layer,
  .tellus-demo-modal {
    display: none !important;
  }
}
