:root {
  color-scheme: dark;
  --bg: #090c17;
  --surface: #141827;
  --ink: #fffaf1;
  --muted: #aeb2c0;
  --orange: #ff5c21;
  --amber: #ffb12e;
  --green: #48d78c;
}

* { box-sizing: border-box; }

html, body, #app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: -30%;
  background:
    radial-gradient(circle at 78% 12%, rgba(255, 92, 33, .15), transparent 30%),
    radial-gradient(circle at 18% 90%, rgba(73, 58, 180, .23), transparent 30%);
  pointer-events: none;
}

.pairing {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6vh 6vw;
  text-align: center;
  transition: opacity .35s ease, transform .35s ease;
}

.pairing.is-hidden {
  opacity: 0;
  transform: scale(.97);
  pointer-events: none;
}

.brand {
  position: absolute;
  top: 7vh;
  left: 7vw;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: clamp(1.4rem, 2.2vw, 2.5rem);
  font-weight: 850;
  letter-spacing: -.04em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.4em;
  aspect-ratio: 1;
  border-radius: .62em;
  background: linear-gradient(135deg, var(--orange), var(--amber));
}

.brand-mark::before,
.brand-mark span::before,
.brand-mark span::after {
  content: "";
  display: block;
  width: .72em;
  height: .72em;
  border-style: solid;
  border-color: var(--bg);
}

.brand-mark::before { border-width: .15em 0 0 .15em; }
.brand-mark span::before { border-width: 0 .15em .15em 0; transform: translate(.4em, .08em); }
.brand-mark span::after { display: none; }

.eyebrow {
  margin: 0 0 1rem;
  color: var(--amber);
  font-size: clamp(1rem, 1.55vw, 1.8rem);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(5rem, 13vw, 13rem);
  line-height: .92;
  font-variant-numeric: tabular-nums;
  letter-spacing: .06em;
  background: linear-gradient(110deg, var(--ink) 20%, #ffd897 82%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1.2rem 3rem rgba(255, 92, 33, .12));
}

.instruction {
  margin: 2.3rem 0 2rem;
  color: var(--muted);
  font-size: clamp(1.2rem, 2.1vw, 2.3rem);
  line-height: 1.45;
}

.instruction strong { color: var(--ink); }

.waiting {
  display: flex;
  align-items: center;
  gap: .8rem;
  color: var(--muted);
  font-size: clamp(.9rem, 1.2vw, 1.25rem);
}

.waiting i {
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 1.1rem var(--green);
  animation: pulse 1.5s infinite;
}

@keyframes pulse { 50% { opacity: .35; transform: scale(.72); } }

.stage {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  background: #000;
}

.stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.stage audio { display: none; }

.activate {
  position: fixed;
  z-index: 5;
  right: 3vw;
  bottom: 4vh;
  padding: .8em 1.2em;
  border: 0;
  border-radius: 999px;
  color: var(--bg);
  background: linear-gradient(110deg, var(--orange), var(--amber));
  font: inherit;
  font-size: clamp(1rem, 1.4vw, 1.5rem);
  font-weight: 800;
  box-shadow: 0 .8rem 2rem rgba(0, 0, 0, .35);
}

.activate:focus { outline: .25rem solid white; outline-offset: .25rem; }

.approval {
  position: fixed;
  z-index: 10;
  inset: 50% auto auto 50%;
  width: min(86vw, 48rem);
  transform: translate(-50%, -50%);
  padding: clamp(2rem, 5vw, 4.5rem);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 2rem;
  background: rgba(20, 24, 39, .98);
  text-align: center;
  box-shadow: 0 2rem 8rem rgba(0,0,0,.65);
}

.approval h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.8rem);
  line-height: 1.08;
  letter-spacing: -.035em;
}

.approval > p:not(.eyebrow) {
  color: var(--muted);
  font-size: clamp(1rem, 1.8vw, 1.7rem);
}

.approval-actions {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 2rem;
}

.approval-actions button {
  min-width: 10rem;
  padding: .85em 1.5em;
  border: 2px solid rgba(255,255,255,.2);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-size: clamp(1.1rem, 1.8vw, 1.7rem);
  font-weight: 800;
}

.approval-actions .allow {
  border-color: transparent;
  color: var(--bg);
  background: linear-gradient(110deg, var(--orange), var(--amber));
}

.approval-actions button:focus {
  outline: .3rem solid white;
  outline-offset: .3rem;
}

.notice {
  position: fixed;
  z-index: 8;
  left: 50%;
  bottom: 5vh;
  max-width: min(80vw, 50rem);
  transform: translateX(-50%);
  padding: 1em 1.4em;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 1rem;
  background: rgba(20, 24, 39, .95);
  color: var(--ink);
  font-size: clamp(1rem, 1.35vw, 1.45rem);
  text-align: center;
}

.receiver-links {
  position: fixed;
  z-index: 7;
  right: 4vw;
  top: 6vh;
  display: flex;
  gap: 1.3rem;
}

.receiver-links a {
  color: var(--muted);
  font-size: clamp(.8rem, 1vw, 1.1rem);
  font-weight: 700;
  text-decoration: none;
}

.receiver-links a:hover,
.receiver-links a:focus { color: var(--ink); }

.receiver-links .other-apps {
  margin-top: -.55rem;
  padding: .55rem .9rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(20, 24, 39, .72);
}

.brand { color: inherit; text-decoration: none; }

@media (max-width: 44rem) {
  .brand {
    top: 4vh;
    left: 5vw;
    font-size: 1.25rem;
  }

  .receiver-links {
    top: auto;
    right: 50%;
    bottom: 3vh;
    width: max-content;
    transform: translateX(50%);
    align-items: center;
  }

  .notice { bottom: 12vh; }
  .instruction br { display: none; }
}
