:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #030303;
  color: #f7f7f7;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  overflow: hidden;
  background: #030303;
}

button,
a {
  font: inherit;
}

.player {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  border: 0;
  outline: 0;
  background: #030303;
}

.player:focus,
.video:focus {
  outline: none;
}

.launch-screen {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  background: #000;
  opacity: 1;
  visibility: visible;
  transition: opacity 780ms cubic-bezier(0.22, 1, 0.36, 1), visibility 780ms;
}

.launch-screen.is-leaving {
  opacity: 0;
  visibility: hidden;
}

.launch-content {
  width: min(900px, calc(100% - 48px));
  text-align: center;
}

.launch-note {
  margin: 0 0 20px;
  color: #fff;
  font-size: clamp(11px, 1.15vw, 15px);
  font-weight: 400;
  letter-spacing: 0.04em;
}

.launch-brand {
  margin: 0;
  color: #1626ff;
  font-family: "Brush Script MT", "Segoe Script", "Snell Roundhand", cursive;
  font-size: clamp(78px, 15vw, 190px);
  font-style: italic;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 0.92;
  text-shadow:
    0 0 2px #3040ff,
    0 0 8px rgba(32, 48, 255, 0.95),
    0 0 22px rgba(20, 38, 255, 0.75),
    0 0 46px rgba(13, 26, 210, 0.38);
  transform: rotate(-1deg);
}

.launch-rule {
  position: relative;
  width: min(460px, 46%);
  height: 5px;
  margin: 52px auto 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.launch-rule span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: #1626ff;
  box-shadow: 0 0 14px rgba(36, 54, 255, 0.95);
  transition: width 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

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

.ambient {
  position: absolute;
  z-index: -3;
  inset: -8%;
  width: 116%;
  height: 116%;
  opacity: 0.46;
  filter: blur(46px) saturate(1.18);
  transform: translateZ(0) scale(1.06);
  contain: strict;
  will-change: transform;
}

.ambient-shade {
  position: absolute;
  z-index: -2;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.22) 34%, rgba(0, 0, 0, 0.22) 66%, rgba(0, 0, 0, 0.74)),
    rgba(0, 0, 0, 0.38);
}

.video {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: 0;
  outline: 0;
  background: transparent;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.video-fade {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: #020202;
  opacity: 1;
  pointer-events: none;
  transition: opacity 820ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}

.video-fade.is-open {
  opacity: 0;
}

.edge {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  width: 1px;
  opacity: 0;
  box-shadow: 0 0 42px 20px rgba(255, 255, 255, 0.06);
  transition: opacity 500ms ease;
}

.has-video .edge {
  opacity: 1;
}

.edge-left {
  left: calc(50% - (50vh * var(--video-ratio, 0.5625)));
}

.edge-right {
  right: calc(50% - (50vh * var(--video-ratio, 0.5625)));
}

.toast {
  position: absolute;
  z-index: 5;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 32px);
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(8, 8, 8, 0.7);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(18px);
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 550;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transform: translate(-50%, -14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease, transform 260ms ease;
}

.toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.toast-top {
  top: max(18px, env(safe-area-inset-top));
}

.toast-bottom {
  bottom: max(18px, env(safe-area-inset-bottom));
  color: rgba(255, 255, 255, 0.86);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  transform: translate(-50%, 14px);
}

.toast-bottom.is-visible {
  transform: translate(-50%, 0);
}

.toast-divider {
  width: 1px;
  height: 13px;
  background: rgba(255, 255, 255, 0.2);
}

kbd {
  color: #fff;
  font-family: inherit;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.library {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(410px, 100%);
  height: 100%;
  padding: max(86px, calc(env(safe-area-inset-top) + 72px)) 22px max(74px, calc(env(safe-area-inset-bottom) + 62px));
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(13, 13, 13, 0.82), rgba(3, 3, 3, 0.95));
  box-shadow: -28px 0 80px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(28px) saturate(1.15);
  transform: translateX(102%);
  visibility: hidden;
  transition: transform 330ms cubic-bezier(0.22, 1, 0.36, 1), visibility 330ms;
}

.is-paused .library {
  transform: translateX(0);
  visibility: visible;
}

.library-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 0 4px 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.library h1,
.empty-state h1 {
  margin: 0;
  font-size: clamp(25px, 4vw, 34px);
  font-weight: 650;
  letter-spacing: -0.04em;
}

.clip-count {
  padding-bottom: 4px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 11px;
}

.library-summary {
  padding: 13px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.52);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.clip-list {
  min-height: 0;
  margin: 10px -8px 0;
  padding: 0 8px 40px;
  overflow-y: auto;
  list-style: none;
  scrollbar-color: rgba(255, 255, 255, 0.17) transparent;
  scrollbar-width: thin;
}

.clip-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 56px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.clip-index {
  color: rgba(255, 255, 255, 0.24);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
}

.clip-meta {
  min-width: 0;
}

.clip-name {
  display: block;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.86);
  font-size: 12px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clip-status {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.34);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.clip-item.is-current .clip-status {
  color: #a9ffcb;
}

.download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.64);
  text-decoration: none;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.download:hover,
.download:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.download::before {
  content: "↓";
  font-size: 15px;
  transform: translateY(-1px);
}

.empty-state {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: min(520px, calc(100% - 44px));
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background: rgba(14, 14, 14, 0.72);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(22px);
  text-align: center;
  transform: translate(-50%, -50%);
}

.empty-state p:last-child {
  margin: 15px auto 0;
  max-width: 390px;
  color: rgba(255, 255, 255, 0.48);
  font-size: 13px;
  line-height: 1.6;
}

code {
  color: #b8ffd2;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.82em;
}

@media (max-width: 620px) {
  .toast {
    gap: 8px;
    padding: 9px 12px;
    font-size: 10px;
  }

  .library {
    padding-right: 16px;
    padding-left: 16px;
  }
}

.download::before {
  content: "\2193";
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

}
