:root {
  --tiffany: #0abab5;
  --ink: #063936;
  --ink-soft: #ffffff;
  --muted: rgba(6, 57, 54, 0.7);
  --accent: #ff6eb4;
  --pad: rgba(255, 255, 255, 0.28);
  --line: rgba(6, 57, 54, 0.14);
  --glow: rgba(255, 110, 180, 0.35);
  --font: Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 60% at 12% 8%, #b8f0ea 0%, transparent 55%),
    radial-gradient(ellipse 70% 55% at 92% 88%, #ffc1e0 0%, transparent 48%),
    radial-gradient(ellipse 50% 40% at 70% 20%, rgba(255, 255, 255, 0.35) 0%, transparent 60%),
    linear-gradient(165deg, #7fd9d2 0%, #0abab5 42%, #0a8f8a 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 1;
}

.stage {
  position: relative;
  z-index: 2;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "brand socials"
    "side side"
    "camera camera";
  align-items: start;
}

.brand {
  grid-area: brand;
  text-align: left;
  min-width: 0;
}

.side {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.camera-wrap {
  grid-area: camera;
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: #045955;
  box-shadow: 0 16px 40px rgba(4, 70, 66, 0.22);
}

.socials {
  grid-area: socials;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  padding-top: 0.35rem;
  flex-shrink: 0;
}

.social {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  color: #ff3d9a;
  opacity: 0.95;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.social:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.social svg {
  width: 1.55rem;
  height: 1.55rem;
  display: block;
}

.brand__title {
  position: relative;
  display: inline-block;
  margin: 0;
  font-family: var(--font);
  font-size: clamp(2.2rem, 9vw, 4rem);
  font-weight: 400;
  line-height: 1.15;
  color: #000000;
  text-shadow: none;
}

.sparkle {
  position: absolute;
  color: #fff6b8;
  text-shadow:
    0 0 6px rgba(255, 246, 184, 0.95),
    0 0 14px rgba(255, 110, 180, 0.55);
  font-style: normal;
  pointer-events: none;
  line-height: 1;
}

.sparkle--1 {
  top: -0.15em;
  left: -0.35em;
  font-size: 0.28em;
}

.sparkle--2 {
  top: 0.05em;
  right: -0.4em;
  font-size: 0.22em;
  color: #ffd0e8;
}

.sparkle--3 {
  bottom: 0.1em;
  left: 0.55em;
  font-size: 0.18em;
}

.sparkle--4 {
  top: -0.28em;
  right: 0.35em;
  font-size: 0.2em;
  color: #ffffff;
}

.brand__by {
  margin: 0.15rem 0 0;
  font-family: var(--font);
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  font-style: italic;
  color: #000000;
}

#webcam,
#overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

#overlay {
  pointer-events: none;
}

.status {
  position: absolute;
  left: 0.85rem;
  right: 0.85rem;
  bottom: 0.85rem;
  padding: 0;
  background: transparent;
  border: none;
  font-family: var(--font);
  font-size: clamp(0.95rem, 3.5vw, 1.3rem);
  font-style: italic;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(4, 70, 66, 0.55);
}

.pads {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.pad {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.75rem;
  row-gap: 0.45rem;
  align-items: center;
  padding: 0.85rem 0.9rem;
  background: var(--pad);
  border: 1px solid var(--line);
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    box-shadow 0.35s ease;
}

.pad.active {
  border-color: rgba(255, 110, 180, 0.75);
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 8px 28px var(--glow);
}

.pad__gesture {
  grid-row: 1;
  font-size: 1.7rem;
  line-height: 1;
}

.pad__text {
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.pad__name {
  font-family: var(--font);
  font-size: 1.25rem;
  font-style: italic;
}

.pad__label {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pad__meter {
  grid-column: 1 / -1;
  height: 3px;
  background: rgba(6, 57, 54, 0.12);
  overflow: hidden;
}

.pad__meter i {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ffffff);
  transition: width 0.12s linear;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

#startBtn {
  appearance: none;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: linear-gradient(135deg, #ff6eb4, #ff3d9a);
  color: #fff;
  font-family: var(--font);
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.95rem 1.2rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#startBtn:hover:not(:disabled) {
  filter: brightness(1.05);
}

#startBtn:disabled {
  opacity: 0.55;
  cursor: default;
}

@media (min-width: 781px) {
  .stage {
    padding: 1.75rem 1.25rem 2.5rem;
    gap: 1.25rem 1rem;
    grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.7fr);
    grid-template-areas:
      "brand socials"
      "camera side";
    align-items: stretch;
  }

  .socials {
    justify-content: flex-end;
    align-self: start;
    padding-top: 0.45rem;
  }

  .camera-wrap {
    aspect-ratio: 4 / 3;
    min-height: 420px;
  }

  .side {
    min-height: 100%;
    align-self: stretch;
  }

  .pads {
    flex: 1;
  }

  .controls {
    margin-top: auto;
  }

  .social {
    width: 2.35rem;
    height: 2.35rem;
  }

  .social svg {
    width: 1.45rem;
    height: 1.45rem;
  }
}
