:root {
  color-scheme: dark;
  --mint: #75bfaa;
  --midnight: #0c2a38;
  --onyx: #010101;
  --panel: #2b2b2b;
  --text-strong: #f7f8f9;
  --text-muted: rgba(247, 248, 249, 0.7);
  --danger: #ff5b6a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}

@font-face {
  font-family: "PP Mori";
  src: url("./fonts/PPMori-Extralight.otf") format("opentype");
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PP Mori";
  src: url("./fonts/PPMori-Regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PP Mori";
  src: url("./fonts/PPMori-SemiBold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  font-family: "PP Mori", sans-serif;
  line-height: auto;
}

body {
  min-height: 100dvh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: stretch;
  background: linear-gradient(360deg, var(--onyx) 0%, var(--midnight) 50%, var(--mint) 100%);
  font-weight: 400;
  color: var(--text-strong);
  overflow: hidden;
}

.app {
  width: min(420px, 100vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.device,
.gate {
  width: 100%;
  flex: 1 1 auto;
  padding: .75rem .75rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  min-height: 0;
}

.device.hidden {
  display: none;
}

.viewbox {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  background: #000;
  aspect-ratio: var(--camera-aspect, 3 / 4);
  max-height: none;
  flex: 1 1 auto;
  min-height: 0;
}

.viewbox video {
  position: absolute;
  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center;
}

.viewbox video.mirrored {
  transform: scaleX(-1);
}

.viewbox::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8rem;
  background: linear-gradient(180deg, rgba(20, 63, 62, 0) 0%, #143F3E 116.53%);
}

#export-page .viewbox::after,
#export-page #live-watermark {
  display: none;
}

#live-watermark {
  position: absolute;
  bottom: 24px;
  left: 24px;
  width: 5.9375rem;
  height: auto;
  pointer-events: none;
  z-index: 1;
}

.control-row {
  width: 100%;
  max-width: 315px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
}

.control {
  border: none;
  border-radius: 24px;
  background: #fff;
  color: #181818;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: .9375rem;
  line-height: auto;
  font-weight: 400;
  padding: 14px 20px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.3);
}

.control:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.control:active {
  transform: scale(0.97);
}

.icon-img {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-block;
}

#capture {
  width: 129px;
}

#record {
  width: 122px;
  color: #09244b;
}

.circle {
  width: 48px;
  height: 48px;
  padding: 14px;
}

#export-retake {
  background: #ffe6ea;
}

.icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
}

.icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.control.recording,
.control.recording svg {
  color: #e70421;
}

.control.recording {
  background: #ffe6ea;
}

.control.recording .label {
  color: #ff4242;
}

.error {
  width: 100%;
  text-align: center;
  margin: 0;
  font-weight: 400;
  color: var(--danger);
}

.gate {
  text-align: center;
  gap: 12px;
  justify-content: center;
}

.gate.hidden {
  display: none;
}

.gate-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.8rem;
  color: var(--mint);
  margin: 0;
}

.gate h1 {
  margin: 0;
  font-size: 1.45rem;
}

.gate p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 320px;
}

.hidden {
  display: none !important;
}

.offscreen {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.export-preview {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.export-preview img,
.export-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.export-preview .video-preview {
  position: relative;
  width: 100%;
  height: 100%;
}

.export-preview .video-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.export-actions {
  width: auto;
  align-self: center;
  justify-content: center;
  gap: 12px;
}

.export-actions .control {
  flex: 0;
  min-width: auto;
  padding-inline: 18px;
}

.export-actions .label {
  white-space: nowrap;
}