:root {
  color-scheme: light;
  font-family: Inter, ui-rounded, "Arial Rounded MT Bold", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fff9e9;
  color: #23150a;
  --orange: #a64f13;
  --orange-dark: #78340b;
  --green: #ffc337;
  --cream: #fff9e9;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 5%, rgba(255, 255, 255, .16), transparent 26rem),
    linear-gradient(180deg, #ffc337 0 18rem, #fff9e9 18rem 100%);
}

button { font: inherit; }

.app-shell {
  width: min(100%, 34rem);
  margin: 0 auto;
  padding: max(1.5rem, env(safe-area-inset-top)) 1rem max(2rem, env(safe-area-inset-bottom));
}

.intro { color: #5e2a08; text-align: center; margin: 0 auto 1.25rem; }
.eyebrow { margin: 0 0 .35rem; font-size: .74rem; font-weight: 900; letter-spacing: .16em; }
.intro h1 { margin: 0; font-size: clamp(2rem, 9vw, 3.4rem); line-height: .95; letter-spacing: -.055em; text-wrap: balance; }
.intro > p:last-child { max-width: 27rem; margin: .75rem auto 0; line-height: 1.4; font-weight: 650; }

.camera-card {
  padding: .72rem;
  border-radius: 2rem;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 1.6rem 4rem rgba(126, 74, 13, .2);
}

.stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1080 / 1920;
  border-radius: 1.35rem;
  background: #f0f0f0;
  isolation: isolate;
}

.stage .frame,
.stage .result {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.stage video {
  position: absolute;
  top: 22.24%;
  left: 8.24%;
  width: 83.98%;
  height: 77.76%;
  object-fit: cover;
  transform: scaleX(-1);
  border-radius: 11% 11% 0 0;
}
.uploaded-window {
  position: absolute;
  top: 22.24%;
  left: 8.24%;
  width: 83.98%;
  height: 77.76%;
  overflow: hidden;
  border-radius: 11% 11% 0 0;
  touch-action: none;
  cursor: grab;
}
.uploaded-window:active { cursor: grabbing; }
.uploaded-window img { width: 100%; height: 100%; object-fit: cover; user-select: none; pointer-events: none; }
.stage .frame { z-index: 2; object-fit: fill; pointer-events: none; }
.stage .result { z-index: 3; object-fit: fill; }

.camera-gate {
  position: absolute;
  z-index: 4;
  inset: 22% 13% 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: .8rem;
  text-align: center;
  color: white;
}

.camera-gate[hidden] { display: none; }
.gate-icon { width: 3.6rem; aspect-ratio: 1; display: grid; place-items: center; border: 3px solid currentColor; border-radius: 50%; font-size: 1.6rem; }
.camera-gate p { margin: 0; max-width: 17rem; font-weight: 800; text-shadow: 0 2px 10px #000; }
.status { min-height: 1.25rem; margin: .75rem .5rem 0; text-align: center; color: #6d5544; font-size: .82rem; }

.actions { display: grid; place-items: center; gap: .35rem; padding: .6rem .5rem .35rem; }
.actions > p { margin: 0; color: #7a5d48; font-size: .8rem; font-weight: 700; }
.upload-button { display: inline-grid; place-items: center; margin-top: .5rem; cursor: pointer; }
.upload-actions label { color: #6d5544; font-size: .9rem; font-weight: 700; }
.upload-actions input[type="range"] { width: min(100%, 18rem); accent-color: var(--orange); }
.upload-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; width: 100%; }
.camera-link { padding: .35rem; border: 0; background: transparent; color: var(--orange-dark); font-weight: 800; text-decoration: underline; cursor: pointer; }

.shutter {
  width: 4.25rem;
  aspect-ratio: 1;
  padding: .3rem;
  border: 3px solid var(--orange);
  border-radius: 50%;
  background: white;
  cursor: pointer;
}

.shutter span { display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--orange); transition: transform .16s ease; }
.shutter:active span { transform: scale(.88); }
.shutter:disabled { filter: grayscale(1); opacity: .45; cursor: wait; }

.result-actions { grid-template-columns: 1fr 1.15fr; gap: .55rem; }
.result-actions .button:last-child { grid-column: 1 / -1; }
.button { min-height: 3rem; padding: .7rem 1rem; border-radius: 999px; border: 0; font-weight: 900; cursor: pointer; }
.button-primary { color: white; background: var(--orange); box-shadow: 0 .45rem 1rem rgba(166, 79, 19, .24); }
.button-secondary { color: var(--orange-dark); background: #fff1d0; }
.mode-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; padding: .1rem .1rem .8rem; }
.mode-actions .button { display: grid; place-items: center; text-align: center; font-size: .94rem; }
.mode-actions label { cursor: pointer; }
.button-light { color: #7d3300; background: white; }
.button:focus-visible, .shutter:focus-visible { outline: 4px solid var(--green); outline-offset: 3px; }

.privacy, .social { text-align: center; color: #6c5140; font-size: .78rem; line-height: 1.4; }
.privacy { margin: 1.1rem auto .35rem; }
.social { margin: 0 auto; }
.social strong { color: #3f7024; }

[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (min-width: 42rem) {
  .app-shell { width: min(100%, 37rem); }
  .camera-card { padding: .9rem; }
}

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