:root {
  --ink: #10100f;
  --paper: #f1eee7;
  --acid: #dfff00;
  --muted: #77766f;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "Satoshi", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.demo-page {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(rgba(16, 16, 15, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 16, 15, 0.06) 1px, transparent 1px),
    var(--paper);
  background-size: 7.5vw 7.5vw;
}

.demo-nav {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  min-height: 84px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 72px);
  border-bottom: 1px solid rgba(16, 16, 15, 0.24);
}

.demo-brand {
  display: inline-flex;
  flex-direction: column;
  font-size: 0.83rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.82;
}

.demo-back {
  font-size: 0.78rem;
  font-weight: 700;
}

.demo-copy {
  position: absolute;
  z-index: 4;
  top: 23%;
  left: clamp(24px, 4vw, 72px);
  width: min(39vw, 650px);
}

.demo-copy__eyebrow {
  margin: 0 0 32px;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-copy h1 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(4.5rem, 7.1vw, 8rem);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.82;
  text-wrap: balance;
}

.demo-copy > p:last-child {
  max-width: 440px;
  margin: 42px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.25vw, 1.18rem);
  line-height: 1.48;
}

.demo-canvas {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: max(100vw, 177.78dvh);
  aspect-ratio: 1672 / 941;
  transform: translate(-50%, -50%);
}

.demo-handset {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.demo-screen {
  position: absolute;
  z-index: 1;
  top: 11.9%;
  left: 51.98%;
  width: 17.52%;
  height: 69.62%;
  overflow: hidden;
  border-radius: 10.5% / 4.6%;
  background: #f6f3ed;
  overscroll-behavior: contain;
  touch-action: none;
}

.demo-screen[data-demo-scrollable="true"] { cursor: grab; }
.demo-screen[data-demo-scrollable="true"]:active { cursor: grabbing; }

.demo-screen__image {
  position: absolute;
  top: -5.8%;
  left: -21.4%;
  width: 144.4%;
  height: 112.55%;
  max-width: none;
  object-fit: fill;
  opacity: 1;
  transform: translate3d(0, var(--demo-scroll-y, 0px), 0);
  transition: opacity 150ms ease, transform 320ms var(--ease);
}

.demo-screen[data-demo-scrollable="true"] .demo-screen__image {
  top: -5%;
  left: -22%;
  width: 150%;
  height: 120%;
  transition: opacity 150ms ease;
}

.demo-screen__image.is-changing {
  opacity: 0;
  transform: translate3d(4%, var(--demo-scroll-y, 0px), 0);
}

.demo-scroll-cue {
  position: absolute;
  z-index: 5;
  right: 50%;
  bottom: 3.5%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  background: rgba(16, 16, 15, 0.86);
  color: #fff;
  font-size: 0.52rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: translateX(50%);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.demo-scroll-cue i { font-size: 0.75rem; font-style: normal; }
.demo-scroll-cue.is-used { opacity: 0; transform: translate(50%, 5px); }
.demo-scroll-cue[hidden] { display: none; }

.demo-loading {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 13px;
  padding: 24px;
  background: rgba(246, 243, 237, 0.94);
  opacity: 0;
  text-align: center;
  transition: opacity 180ms ease;
}

.demo-loading.is-visible { opacity: 1; }
.demo-loading[hidden] { display: none; }

.demo-loading > span {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(16, 16, 15, 0.14);
  border-top-color: #1248d8;
  border-radius: 50%;
  animation: demo-spin 720ms linear infinite;
}

.demo-loading p {
  max-width: 170px;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.25;
}

@keyframes demo-spin {
  to { transform: rotate(360deg); }
}

.demo-hotspot {
  position: absolute;
  z-index: 4;
  top: var(--top, 79.5%);
  left: var(--left, 8.2%);
  width: var(--width, 84.5%);
  height: var(--height, 6.4%);
  padding: 0;
  border: 3px solid rgba(255, 255, 255, 0.98);
  border-radius: 8px;
  background: rgba(29, 106, 255, 0.12);
  box-shadow:
    0 0 0 3px rgba(29, 106, 255, 0.96),
    0 0 0 7px rgba(255, 255, 255, 0.76),
    0 0 22px 9px rgba(29, 106, 255, 0.52);
  cursor: pointer;
  transform: translateY(var(--demo-scroll-y, 0px));
  animation: pulse 1.15s cubic-bezier(0.22, 0.75, 0.28, 1) infinite;
  will-change: box-shadow, border-color, background-color;
}

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

.demo-back-hotspot {
  position: absolute;
  z-index: 5;
  top: 6.2%;
  left: 2.8%;
  width: 12%;
  height: 7%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.demo-back-hotspot[hidden] { display: none; }

.demo-back-hotspot:focus-visible {
  outline: 2px solid #1d6aff;
  outline-offset: -2px;
}

@keyframes pulse {
  0%, 100% {
    border-color: rgba(255, 255, 255, 0.98);
    background: rgba(29, 106, 255, 0.12);
    box-shadow:
      0 0 0 3px rgba(29, 106, 255, 0.96),
      0 0 0 7px rgba(255, 255, 255, 0.76),
      0 0 22px 9px rgba(29, 106, 255, 0.52);
  }
  55% {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.18);
    box-shadow:
      0 0 0 3px rgba(29, 106, 255, 0.96),
      0 0 0 15px rgba(29, 106, 255, 0),
      0 0 34px 16px rgba(29, 106, 255, 0.22);
  }
}

.demo-guide {
  position: absolute;
  z-index: 5;
  bottom: clamp(28px, 5vh, 60px);
  left: clamp(24px, 4vw, 72px);
  display: grid;
  width: min(39vw, 520px);
  grid-template-columns: minmax(110px, 0.5fr) minmax(0, 1fr);
  align-items: end;
  gap: 28px;
}

.demo-guide__progress span {
  display: block;
  margin-bottom: 10px;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.demo-guide__progress > div {
  height: 3px;
  overflow: hidden;
  background: rgba(16, 16, 15, 0.16);
}

.demo-guide__progress i {
  display: block;
  width: 20%;
  height: 100%;
  background: var(--ink);
  transition: width 320ms var(--ease);
}

.demo-guide > p {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 750;
  line-height: 1.25;
  text-align: right;
}

.demo-guide > button {
  grid-column: 2;
  justify-self: end;
  padding: 12px 18px;
  border: 0;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
}

.demo-guide > button[hidden] { display: none; }

.demo-hotspot:focus-visible,
.demo-back-hotspot:focus-visible,
.demo-guide button:focus-visible,
.demo-back:focus-visible {
  outline: 3px solid var(--acid);
  outline-offset: 4px;
}

@media (max-width: 700px) {
  .demo-page { min-height: 100svh; }

  .demo-nav {
    min-height: 68px;
    padding-inline: 18px;
  }

  .demo-back { font-size: 0.7rem; }

  .demo-copy {
    top: 92px;
    left: 18px;
    width: calc(100% - 36px);
  }

  .demo-copy__eyebrow { margin-bottom: 14px; }

  .demo-copy h1 {
    font-size: clamp(3.2rem, 15vw, 4.5rem);
    line-height: 0.86;
  }

  .demo-copy > p:last-child {
    max-width: 340px;
    margin-top: 18px;
    font-size: 0.9rem;
  }

  .demo-canvas {
    top: 57%;
    left: -156%;
    width: 340vw;
    transform: translateY(-50%);
  }

  .demo-guide {
    right: 18px;
    bottom: 22px;
    left: 18px;
    width: auto;
    padding: 14px;
    background: rgba(241, 238, 231, 0.92);
    backdrop-filter: blur(10px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
