:root {
  --background: #f7f8f4;
  --surface: #ffffff;
  --ink: #17211d;
  --muted: #65716b;
  --line: #d9ded8;
  --accent: #176b55;
  --accent-strong: #0f5140;
  --highlight: #dff36b;
}

* { box-sizing: border-box; }

html { background: var(--background); }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--background);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: max(14px, env(safe-area-inset-top)) 18px 10px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 9px; font-weight: 760; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: white;
  background: var(--accent);
}

.icon-button, .back-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  cursor: pointer;
}

.icon-button { width: 38px; height: 38px; font-size: 24px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.license-status { padding: 6px 9px; border-radius: 999px; color: var(--muted); background: #e6eae4; font-size: 12px; font-weight: 800; }
.license-status.unlocked { color: #17211d; background: var(--highlight); }
.back-button { width: 42px; height: 42px; font-size: 21px; flex: 0 0 auto; }
.hidden { display: none !important; }

main { width: min(100%, 520px); margin: 0 auto; padding: 24px 18px calc(32px + env(safe-area-inset-bottom)); }
.view { display: none; }
.view.active { display: block; }

.intro { margin: 18px 0 24px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12px; font-weight: 800; }
h1, h2 { margin: 0; line-height: 1.05; }
h1 { max-width: 430px; font-size: 48px; }
h2 { font-size: 30px; }
.subtitle { margin: 16px 0 0; max-width: 430px; color: var(--muted); font-size: 17px; }

.demo-frame, .photo-stage, .compare-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e6eae4;
}

.demo-frame { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
.demo-half { display: flex; align-items: flex-end; padding: 16px; background-position: center; background-size: cover; }
.demo-half::before {
  content: "";
  position: absolute;
  width: 106px;
  height: 220px;
  top: 22%;
  border-radius: 54px 54px 20px 20px;
  background: var(--accent);
}
.demo-half.before::before { left: calc(25% - 53px); opacity: .72; transform: rotate(-4deg); }
.demo-half.after::before { left: calc(75% - 53px); background: var(--accent-strong); }
.demo-half span, .label {
  position: relative;
  z-index: 2;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--ink);
  background: var(--highlight);
  font-size: 11px;
  font-weight: 850;
}
.center-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: white; }

.primary-button, .secondary-button, .link-button {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  border-radius: 8px;
  text-align: center;
  font-weight: 760;
  cursor: pointer;
}
.primary-button { border: 1px solid var(--accent); color: white; background: var(--accent); }
.primary-button:hover { background: var(--accent-strong); }
.secondary-button { margin-top: 10px; border: 1px solid var(--line); color: var(--ink); background: var(--surface); }
.secondary-button:disabled { opacity: .45; cursor: default; }
.link-button { text-decoration: none; }
.privacy-note { margin: 10px 0 0; text-align: center; color: var(--muted); font-size: 13px; }

.section-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.photo-stage, .compare-stage { margin-bottom: 18px; touch-action: none; }
.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.overlay-photo { opacity: .55; }
.guide { position: absolute; z-index: 3; pointer-events: none; background: rgba(255,255,255,.7); }
.guide.vertical { top: 0; bottom: 0; left: 50%; width: 1px; }
.guide.horizontal { left: 0; right: 0; top: 50%; height: 1px; }

.control-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px; margin: 4px 0 18px; color: var(--muted); font-size: 14px; }
.control-row input { width: 100%; accent-color: var(--accent); }

.compare-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.after-clip { position: absolute; inset: 0; width: 50%; overflow: hidden; }
.after-clip .compare-photo { width: calc(100vw - 36px); max-width: 484px; }
.slider-line { position: absolute; z-index: 3; top: 0; bottom: 0; left: 50%; width: 2px; background: white; transform: translateX(-1px); pointer-events: none; }
.slider-line span { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--ink); background: white; transform: translate(-50%, -50%); }
.compare-slider { position: absolute; z-index: 4; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; }
.label { position: absolute; z-index: 2; top: 14px; }
.label-before { left: 14px; }
.label-after { right: 14px; }

dialog {
  width: min(calc(100% - 32px), 430px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
}
dialog::backdrop { background: rgba(15, 26, 21, .62); }
dialog p { color: var(--muted); }
dialog ul { padding-left: 20px; line-height: 1.9; }
dialog small { display: block; margin-top: 12px; color: var(--muted); text-align: center; }
.dialog-close { float: right; border: 0; background: transparent; font-size: 28px; cursor: pointer; }
.test-button { display: block; width: 100%; margin-top: 10px; border: 0; color: var(--accent); background: transparent; cursor: pointer; }
.payment-status { margin: 14px 0 4px; color: var(--ink); font-weight: 700; text-align: center; }

@media (max-width: 380px) {
  h1 { font-size: 40px; }
  main { padding-inline: 14px; }
}
