@import url('/page-css/experiments.css');

/* Light Show — experiment 06.
   A full-page light stage. Ten fingertip lights rise from hand tracking while
   the page's own track plays through an on-device analyser; the camera sits in
   a compact card in the bottom-right corner with the skeleton overlay on top. */

.site-root[data-ka-page='experiments/light-show'] {
  --light-blue: #1767ff;
  --light-sky: #7dd3fc;
  --light-warm: #ffcf5c;
}

.site-root[data-ka-page='experiments/light-show'] .ka-light-page {
  margin: 0;
  padding: 0;
  background: #04050c;
  color: #fff;
  overflow: hidden;
}

/* 130px = the site's 44px contact strip plus the 86px header. */
.ka-light-stage {
  position: relative;
  height: calc(100svh - 130px);
  min-height: 600px;
  overflow: hidden;
  background: #04050c;
}

.ka-light {
  position: absolute;
  inset: 0;
}

.ka-light__stage {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.ka-light-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(4, 5, 12, 0.72) 0%, rgba(4, 5, 12, 0.2) 34%, transparent 58%),
    linear-gradient(90deg, rgba(4, 5, 12, 0.5) 0%, transparent 48%);
}

/* ---------- Editorial overlay ---------- */

.ka-light-overlay {
  position: absolute;
  z-index: 3;
  top: clamp(30px, 5vh, 62px);
  left: max(24px, calc((100vw - 1180px) / 2));
  width: min(680px, calc(100vw - 48px));
  pointer-events: none;
}

.ka-light-launch {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  min-height: 48px;
  margin-top: 26px;
  padding: 13px 22px;
  border: 0;
  border-radius: 4px;
  background: #1558e9;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 16px 38px rgba(3, 8, 26, 0.5);
  transition: background 0.2s ease, transform 0.2s ease;
}

.ka-light-launch span {
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}

.ka-light-launch:hover:not(:disabled) {
  background: #0947c8;
  transform: translateY(-1px);
}

.ka-light-launch:disabled {
  opacity: 0.7;
  cursor: progress;
}

.ka-light-notice {
  margin: 14px 0 0;
  color: #ffd9a8;
  font-size: 12px;
  line-height: 1.5;
}

.ka-light-kicker {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0 0 22px;
  color: #78b7ff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.21em;
}

.ka-light-kicker:before {
  content: '';
  width: 30px;
  height: 2px;
  background: var(--light-blue);
}

.ka-light-overlay h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(54px, 7.2vw, 110px);
  font-weight: 760;
  line-height: 0.9;
  letter-spacing: -0.075em;
  text-shadow: 0 3px 34px rgba(0, 0, 0, 0.55);
}

.ka-light-overlay p {
  max-width: 520px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(15px, 1.4vw, 19px);
  line-height: 1.55;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}

/* ---------- Transport ---------- */

.ka-light-transport {
  position: absolute;
  z-index: 4;
  left: max(20px, calc((100vw - 1180px) / 2));
  bottom: clamp(16px, 2.6vh, 24px);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(620px, calc(100vw - 300px));
  padding: 10px 16px 10px 12px;
  border: 1px solid rgba(125, 211, 252, 0.24);
  border-radius: 999px;
  background: rgba(5, 9, 20, 0.78);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
}

.ka-light-transport__button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: #1558e9;
  color: #fff;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.ka-light-transport__button:hover {
  background: #0947c8;
  transform: translateY(-1px);
}

.ka-light-transport__button--ghost {
  width: 30px;
  height: 30px;
  background: transparent;
  color: #9fc0e6;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.ka-light-transport__button--ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Strobe control: warms up while its burst is running. */
.ka-light-transport__strobe[aria-pressed='true'] {
  border-color: rgba(255, 215, 106, 0.75);
  background: rgba(255, 207, 92, 0.22);
  color: #ffd76a;
}

.ka-light-track {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 5px;
  min-width: 0;
  flex: 1 1 auto;
}

.ka-light-track__title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.ka-light-track__title em {
  color: #7f93ae;
  font-size: 9.5px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.ka-light-track__scrub {
  position: relative;
  display: flex;
  align-items: center;
  grid-column: 1;
  height: 14px;
}

.ka-light-track__meter {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  pointer-events: none;
}

.ka-light-track__meter i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--light-blue), var(--light-sky));
}

.ka-light-track__range {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 14px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.ka-light-track__range::-webkit-slider-runnable-track {
  height: 14px;
  background: transparent;
}

.ka-light-track__range::-webkit-slider-thumb {
  width: 11px;
  height: 11px;
  margin-top: 0;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px rgba(125, 211, 252, 0.9);
  -webkit-appearance: none;
  appearance: none;
}

.ka-light-track__range::-moz-range-track {
  height: 14px;
  background: transparent;
}

.ka-light-track__range::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 50%;
  background: #fff;
}

.ka-light-track__range:focus-visible {
  outline: 2px solid var(--light-sky);
  outline-offset: 3px;
}

.ka-light-track__time {
  grid-column: 2;
  grid-row: 2;
  color: #8698b3;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}

.ka-light-transport__bands {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 26px;
  flex: none;
}

.ka-light-transport__bands span {
  display: flex;
  align-items: flex-end;
  width: 4px;
  height: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.ka-light-transport__bands i {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd76a, #ff7acb 46%, #6ad3ff);
  transition: height 120ms linear;
}

/* ---------- Corner camera preview ---------- */

.ka-light-preview {
  position: absolute;
  z-index: 5;
  right: 20px;
  bottom: clamp(16px, 2.6vh, 24px);
  width: 216px;
  overflow: hidden;
  border: 1px solid rgba(130, 197, 255, 0.32);
  border-radius: 12px;
  background: rgba(4, 9, 20, 0.8);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
}

.ka-light-preview__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 46%, rgba(122, 31, 255, 0.2), transparent 66%),
    #05070f;
}

.ka-light-preview__video,
.ka-light-preview__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ka-light-preview__video {
  transform: scaleX(-1);
  filter: saturate(0.95) contrast(1.05) brightness(0.94);
  transition: opacity 0.2s ease;
}

/* The camera image can be switched off while the skeleton keeps tracking. */
.ka-light-preview__media[data-camera-image='off'] .ka-light-preview__video {
  opacity: 0;
}

.ka-light-preview__media[data-camera-image='off'] {
  background:
    radial-gradient(circle at 50% 46%, rgba(122, 31, 255, 0.28), transparent 68%),
    #05070f;
}

.ka-light-preview__canvas {
  pointer-events: none;
}

.ka-light-preview__cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 7px;
  padding: 14px;
  text-align: center;
}

.ka-light-preview__cover strong {
  max-width: 26ch;
  color: #eaf2ff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.ka-light-preview__cover small {
  color: #8ea4bf;
  font-size: 9.5px;
  line-height: 1.5;
}

.ka-light-preview__icon,
.ka-light-preview__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(125, 211, 252, 0.4);
  border-radius: 50%;
  color: #9fd4ff;
}

.ka-light-preview__mark {
  border-color: rgba(255, 190, 160, 0.5);
  color: #ffc9a8;
  font-size: 15px;
  font-weight: 700;
}

.ka-light-preview__spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(148, 178, 224, 0.25);
  border-top-color: var(--light-sky);
  border-radius: 50%;
  animation: ka-light-spin 0.9s linear infinite;
}

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

.ka-light-preview__start {
  min-height: 30px;
  margin-top: 2px;
  padding: 6px 15px;
  border: 0;
  border-radius: 4px;
  background: #1558e9;
  color: #fff;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ka-light-preview__start:hover {
  background: #0947c8;
}

.ka-light-preview__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-top: 1px solid rgba(122, 166, 255, 0.2);
  color: #cfe0f5;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ka-light-preview__state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #93a9c4;
}

.ka-light-preview__state[data-live='true'] {
  color: var(--light-sky);
}

.ka-light-preview__state i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.ka-light-preview__state[data-live='true'] i {
  box-shadow: 0 0 8px rgba(125, 211, 252, 0.9);
}

.ka-light-preview__hands {
  margin-left: auto;
  color: #f2f8ff;
}

.ka-light-preview__lights {
  color: #ffd9a8;
  text-transform: none;
  letter-spacing: 0.02em;
}

.ka-light-preview__fps {
  color: #93a9c4;
  font-weight: 600;
  white-space: nowrap;
}

.ka-light-preview__tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-top: 1px solid rgba(122, 166, 255, 0.16);
}

.ka-light-preview__toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 0;
  border: 0;
  background: none;
  color: #cfe0f5;
  font: inherit;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
}

.ka-light-preview__toggle span {
  position: relative;
  width: 24px;
  height: 13px;
  flex: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  transition: background 0.18s ease;
}

.ka-light-preview__toggle span:after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}

.ka-light-preview__toggle[aria-pressed='true'] span {
  background: var(--light-blue);
}

.ka-light-preview__toggle[aria-pressed='true'] span:after {
  transform: translateX(11px);
}

.ka-light-preview__toggle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ka-light-preview__stop {
  min-height: 24px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: transparent;
  color: #dfeaf8;
  font: inherit;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.ka-light-preview__stop:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.12);
}

/* ---------- Privacy note ---------- */

/* Sits on a chip so it stays readable over a beam of any colour. */
.ka-light-privacy {
  position: absolute;
  z-index: 3;
  left: max(24px, calc((100vw - 1180px) / 2));
  bottom: clamp(86px, 12vh, 106px);
  max-width: 420px;
  margin: 0;
  padding: 6px 12px;
  border: 1px solid rgba(125, 211, 252, 0.16);
  border-radius: 999px;
  background: rgba(5, 9, 20, 0.62);
  color: rgba(226, 238, 255, 0.82);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.02em;
  backdrop-filter: blur(10px);
}

/* ---------- Responsive ---------- */

@media (max-width: 1180px) {
  .ka-light-overlay {
    width: min(560px, calc(100vw - 280px));
  }

  .ka-light-overlay h1 {
    font-size: clamp(50px, 8.2vw, 92px);
  }

  .ka-light-transport {
    max-width: min(520px, calc(100vw - 268px));
  }
}

@media (max-width: 900px) {
  .ka-light-transport__bands {
    display: none;
  }
}

@media (max-width: 760px) {
  /* 110px = the site's 40px contact strip plus the 70px header. */
  .ka-light-stage {
    height: calc(100svh - 110px);
    min-height: 520px;
  }

  .ka-light-overlay {
    top: 24px;
    left: 18px;
    width: calc(100vw - 36px);
  }

  .ka-light-kicker {
    margin-bottom: 15px;
    font-size: 10px;
  }

  .ka-light-overlay h1 {
    font-size: clamp(44px, 12.8vw, 64px);
  }

  .ka-light-overlay p {
    max-width: 400px;
    margin-top: 14px;
    font-size: 13.5px;
    line-height: 1.5;
  }

  .ka-light-launch {
    min-height: 42px;
    margin-top: 18px;
    padding: 11px 18px;
    gap: 16px;
    font-size: 10.5px;
  }

  .ka-light-privacy {
    display: none;
  }

  .ka-light-transport {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
    padding: 8px 12px 8px 10px;
    gap: 9px;
  }

  .ka-light-transport__button {
    width: 34px;
    height: 34px;
  }

  .ka-light-transport__button--ghost {
    width: 28px;
    height: 28px;
  }

  .ka-light-track__title {
    font-size: 11.5px;
  }

  .ka-light-track__title em {
    display: none;
  }

  .ka-light-track__time {
    font-size: 9.5px;
  }

  .ka-light-preview {
    right: 12px;
    bottom: 88px;
    width: 148px;
  }

  .ka-light-preview__cover {
    gap: 5px;
    padding: 8px;
  }

  .ka-light-preview__cover strong {
    font-size: 10px;
  }

  .ka-light-preview__cover small {
    display: none;
  }

  .ka-light-preview__icon,
  .ka-light-preview__mark {
    width: 24px;
    height: 24px;
  }

  .ka-light-preview__icon svg {
    width: 16px;
    height: 16px;
  }

  .ka-light-preview__start {
    min-height: 26px;
    padding: 5px 11px;
    font-size: 9px;
  }

  .ka-light-preview__bar {
    gap: 5px;
    padding: 6px 8px;
    font-size: 7.5px;
  }

  .ka-light-preview__lights {
    display: none;
  }

  .ka-light-preview__fps {
    display: none;
  }

  .ka-light-preview__tools {
    padding: 6px 8px;
  }
}

@media (max-width: 420px) {
  .ka-light-overlay p {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ka-light-preview__spinner {
    animation: none;
  }

  .ka-light-launch:hover:not(:disabled),
  .ka-light-transport__button:hover {
    transform: none;
  }

  .ka-light-transport__bands i {
    transition: none;
  }
}
