:root {
  color-scheme: dark;
  --bg: #0f1115;
  --text: #f7f1e8;
  --muted: rgba(247, 241, 232, 0.62);
  --panel: rgba(15, 17, 21, 0.46);
  --panel-strong: rgba(15, 17, 21, 0.72);
  --line: rgba(247, 241, 232, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
select {
  font: inherit;
}

button {
  color: inherit;
}

.camera-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
  touch-action: manipulation;
}

#camera-stream {
  display: none;
}

#preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #090a0d;
  touch-action: none;
}

.controls,
.camera-error {
  position: absolute;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 0.2rem;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 2rem);
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: 0;
  text-shadow: 0 0.12rem 1.2rem rgba(0, 0, 0, 0.7);
}

.controls {
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  padding: 0 0 max(1.1rem, env(safe-area-inset-bottom));
  pointer-events: none;
}

.shutter {
  display: grid;
  width: 4.7rem;
  height: 4.7rem;
  place-items: center;
  border: 1px solid rgba(247, 241, 232, 0.78);
  border-radius: 999px;
  background: rgba(15, 17, 21, 0.16);
  box-shadow: 0 1rem 2.4rem rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
  cursor: pointer;
  pointer-events: auto;
}

.shutter span {
  display: block;
  width: 3.42rem;
  height: 3.42rem;
  border: 1px solid rgba(15, 17, 21, 0.18);
  border-radius: inherit;
  background: rgba(247, 241, 232, 0.92);
  transition:
    opacity 120ms ease,
    transform 120ms ease;
}

.shutter:active span,
.shutter.is-shooting span {
  opacity: 0.82;
  transform: scale(0.86);
}

.camera-error {
  inset: 0;
  display: grid;
  place-content: center;
  gap: 1.1rem;
  padding: 2rem;
  background:
    linear-gradient(rgba(15, 17, 21, 0.2), rgba(15, 17, 21, 0.74)),
    var(--bg);
  text-align: center;
}

.camera-error[hidden] {
  display: none;
}

#status {
  max-width: 18rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.flash {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: var(--text);
  opacity: 0;
  pointer-events: none;
}

.flash.is-visible {
  animation: flash 360ms ease;
}

@keyframes flash {
  0% {
    opacity: 0;
  }
  12% {
    opacity: 0.74;
  }
  100% {
    opacity: 0;
  }
}

@media (min-width: 820px) {
  .controls {
    padding: 0 1.5rem 1.5rem;
  }
}

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