:root {
  --bg: #f6f3ea;
  --ink: #1a1a1a;
  --muted: #565656;
  --card: #fffdfa;
  --line: #d8d2c4;
  --accent: #0f5f4a;
  --accent-soft: #d8efe5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 5%, #e3dfd3 0, transparent 35%),
    radial-gradient(circle at 90% 95%, #d6e3dc 0, transparent 30%),
    var(--bg);
}

.page {
  width: 100%;
  margin: 0 auto;
  padding: 1.2rem 1rem 1.5rem;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
}

.hero {
  width: min(1320px, 100%);
  margin: 0 auto;
}

.eyebrow {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}

.subtitle {
  margin-top: 0.5rem;
  color: var(--muted);
  max-width: 100%;
}

.controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1rem auto 1.2rem;
  width: min(1320px, 100%);
  padding: 0.9rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.zoom-field {
  position: relative;
}

.zoom-help {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 20;
  width: max-content;
  max-width: min(280px, 85vw);
  padding: 0.42rem 0.55rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: none;
}

.zoom-field[data-disabled="true"]:hover .zoom-help {
  opacity: 1;
  transform: translateY(0);
}

select,
.toggle-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0.6rem 0.65rem;
  font: inherit;
  font-size: 0.95rem;
}

.toggle-btn {
  align-self: end;
  cursor: pointer;
  background: var(--accent-soft);
  color: #07382b;
  font-weight: 700;
}

.width-toggle-field {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 0.6rem;
  align-self: end;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 0.64rem 0.7rem;
}

.width-toggle-field span {
  font-size: 0.9rem;
  font-weight: 600;
}

.width-toggle-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.viewer {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.85rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.before-after-boxed {
  width: min(1320px, 100%);
  margin: 0 auto;
}

.before-after-full {
  width: 100%;
  margin: 0;
}

.image-stage {
  --stage-ratio: 3 / 2;
  position: relative;
  width: 100%;
  aspect-ratio: var(--stage-ratio);
  height: auto;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
}

.image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.compare-mask {
  position: absolute;
  inset: 0;
  width: 100%;
  overflow: hidden;
  clip-path: inset(0 0 0 50%);
}

.compare-mask .compare {
  width: 100%;
  max-width: 100%;
}

.handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
  transform: translateX(-50%);
  pointer-events: none;
}

.handle span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid rgba(0, 0, 0, 0.35);
}

.split-range {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
}

.badge {
  position: absolute;
  z-index: 5;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
}

.badge.top {
  top: 0.8rem;
}

.badge:not(.top) {
  bottom: 0.8rem;
}

.badge.left {
  left: 0.8rem;
}

.badge.right {
  right: 0.8rem;
}

.side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem;
  background: #fff;
}

.panel h2 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.side-image-stage {
  position: relative;
  background: #111;
  border-radius: 8px;
  overflow: hidden;
}

.panel img {
  display: block;
  width: 100%;
  height: min(62vh, 660px);
  object-fit: contain;
}

.side-magnifier {
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
  background-repeat: no-repeat;
  background-color: rgba(17, 17, 17, 0.9);
  pointer-events: none;
  z-index: 4;
}

.hidden {
  display: none;
}

.disclaimer {
  width: min(1320px, 100%);
  margin: 0 auto 1.4rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 253, 250, 0.72);
}

.disclaimer p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--muted);
}

@media (max-width: 980px) {
  .controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 740px) {
  .controls {
    grid-template-columns: 1fr;
  }

  .side-by-side {
    grid-template-columns: 1fr;
  }

  .panel img {
    height: min(48vh, 460px);
  }
}
