/* ==========================================================================
   Scale Slider — premium light + 3D liquid glass pin
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Premium light palette — ivory, pearl, soft champagne */
  --bg-base: #f4f1ec;
  --bg-soft: #faf8f5;
  --bg-mid: #ebe6de;
  --bg-warm: #f0e8dc;
  --bg-glow: rgba(212, 180, 140, 0.22);
  --bg-glow-cool: rgba(160, 180, 200, 0.18);
  --bg-glow-rose: rgba(220, 190, 190, 0.14);
  --ink: #1c1916;
  --ink-muted: rgba(28, 25, 22, 0.38);
  --accent: #b8956a;
  --focus: #a67c52;

  --font: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(100% 80% at 15% 0%, var(--bg-glow) 0%, transparent 50%),
    radial-gradient(80% 60% at 90% 90%, var(--bg-glow-cool) 0%, transparent 48%),
    radial-gradient(60% 50% at 50% 50%, var(--bg-glow-rose) 0%, transparent 55%),
    linear-gradient(165deg, var(--bg-soft) 0%, var(--bg-base) 42%, var(--bg-mid) 100%);
  background-color: var(--bg-base);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Scroll cover
   -------------------------------------------------------------------------- */

.scroll-cover {
  position: relative;
  min-height: 100vh;
}

.scroll-cover__hint {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}

.scroll-cover__text {
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.scroll-cover__line {
  width: 1px;
  height: 2rem;
  background: rgba(28, 25, 22, 0.12);
  position: relative;
  overflow: hidden;
}

.scroll-cover__line::after {
  content: "";
  position: absolute;
  top: -100%;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent,
    var(--accent),
    transparent
  );
  animation: scrollHint 1.6s ease-in-out infinite;
}

@keyframes scrollHint {
  0% {
    top: -100%;
  }
  100% {
    top: 100%;
  }
}

/* --------------------------------------------------------------------------
   Stage
   -------------------------------------------------------------------------- */

.stage {
  min-height: 100vh;
  width: 100%;
  padding: 0;
}

/* --------------------------------------------------------------------------
   Scale Slider
   -------------------------------------------------------------------------- */

.scale-slider {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  touch-action: pan-y;
  outline: none;
  cursor: grab;
  /* Light premium field */
  background:
    radial-gradient(
      100% 80% at 50% 0%,
      rgba(255, 255, 255, 0.7) 0%,
      transparent 55%
    ),
    radial-gradient(
      90% 70% at 20% 100%,
      rgba(212, 180, 140, 0.16) 0%,
      transparent 50%
    ),
    radial-gradient(
      70% 55% at 85% 30%,
      rgba(170, 190, 210, 0.14) 0%,
      transparent 48%
    ),
    linear-gradient(180deg, #faf8f5 0%, #f2ede6 45%, #e8e2d8 100%);
}

.scale-slider:active {
  cursor: grabbing;
}

.scale-slider:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.scale-slider__scene {
  position: absolute;
  inset: 0;
}

.scale-slider__card {
  position: absolute;
  left: 0;
  bottom: 0;
  display: none;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  transform-origin: 0 100%;
  will-change: transform;
  backface-visibility: hidden;
  box-shadow:
    0 18px 48px rgba(40, 30, 20, 0.16),
    0 6px 16px rgba(40, 30, 20, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.35);
}

.scale-slider__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  transform: scale(1);
  transform-origin: center;
  will-change: transform;
  backface-visibility: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   3D Liquid glass pin (controls)
   -------------------------------------------------------------------------- */

/* Wrapper holds outer shadow so the pill can safely clip its glass layers */
.glass-pin-wrap {
  position: absolute;
  left: 50%;
  bottom: 40px;
  z-index: 20;
  transform: translateX(-50%);
  /* Soft outer drop + contact shadow (never clipped by the pill) */
  filter: drop-shadow(0 14px 28px rgba(50, 40, 30, 0.14))
    drop-shadow(0 4px 10px rgba(50, 40, 30, 0.1));
}

.glass-pin {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px;
  border-radius: 999px;
  isolation: isolate;
  /* Clip shine / refraction so nothing spills past the pill */
  overflow: hidden;
  /* Helps Safari clip backdrop + children to radius */
  -webkit-mask-image: -webkit-radial-gradient(white, black);
  mask-image: radial-gradient(white, black);

  /* Frosted glass body */
  background:
    linear-gradient(
      155deg,
      rgba(255, 255, 255, 0.72) 0%,
      rgba(255, 255, 255, 0.38) 38%,
      rgba(255, 255, 255, 0.18) 72%,
      rgba(245, 240, 232, 0.28) 100%
    );
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.35),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.95),
    inset 0 -2px 4px rgba(120, 100, 80, 0.1),
    inset 0 0 20px rgba(255, 255, 255, 0.35);

  -webkit-backdrop-filter: blur(28px) saturate(1.85) brightness(1.12);
  backdrop-filter: blur(28px) saturate(1.85) brightness(1.12);
}

/* Specular highlight band — liquid sheen (clipped by overflow) */
.glass-pin::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    112deg,
    rgba(255, 255, 255, 0.75) 0%,
    rgba(255, 255, 255, 0.28) 18%,
    rgba(255, 255, 255, 0.04) 36%,
    transparent 52%,
    rgba(200, 175, 145, 0.08) 100%
  );
  z-index: 0;
}

/* Bottom refraction + caustic tint (clipped) */
.glass-pin::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  border-radius: 0 0 999px 999px;
  pointer-events: none;
  background:
    radial-gradient(
      80% 100% at 50% 100%,
      rgba(201, 168, 124, 0.2) 0%,
      transparent 70%
    ),
    linear-gradient(
      180deg,
      transparent 0%,
      rgba(160, 180, 200, 0.08) 100%
    );
  z-index: 0;
}

/* Specular blob — stays inside the pill */
.glass-pin__shine {
  position: absolute;
  top: -30%;
  left: -8%;
  width: 55%;
  height: 90%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 40% 40%,
    rgba(255, 255, 255, 0.7) 0%,
    rgba(255, 255, 255, 0.18) 38%,
    transparent 68%
  );
  filter: blur(2px);
  z-index: 0;
  mix-blend-mode: soft-light;
  animation: glassShimmer 5.5s ease-in-out infinite;
}

@keyframes glassShimmer {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.65;
  }
  50% {
    transform: translate(10%, 6%) scale(1.06);
    opacity: 1;
  }
}

/* 3D glass buttons */
.glass-pin__btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background:
    linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.85) 0%,
      rgba(255, 255, 255, 0.35) 42%,
      rgba(255, 255, 255, 0.15) 100%
    );
  color: rgba(40, 32, 24, 0.78);
  cursor: pointer;
  box-shadow:
    0 6px 14px rgba(50, 40, 30, 0.1),
    0 2px 4px rgba(50, 40, 30, 0.06),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.95),
    inset 0 -2px 3px rgba(120, 100, 80, 0.12),
    inset 0 0 12px rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.25s ease;
}

/* Button top facet highlight — clipped by button overflow */
.glass-pin__btn::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 18%;
  right: 18%;
  height: 38%;
  border-radius: 999px;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.15) 100%
  );
  opacity: 0.85;
}

.glass-pin__btn:hover {
  background:
    linear-gradient(
      165deg,
      rgba(255, 255, 255, 0.95) 0%,
      rgba(255, 255, 255, 0.5) 45%,
      rgba(255, 248, 240, 0.28) 100%
    );
  border-color: rgba(255, 255, 255, 0.95);
  color: rgba(28, 22, 16, 0.9);
  box-shadow:
    0 8px 18px rgba(50, 40, 30, 0.12),
    0 3px 6px rgba(50, 40, 30, 0.08),
    0 0 0 1px rgba(184, 149, 106, 0.18),
    inset 0 1.5px 0 rgba(255, 255, 255, 1),
    inset 0 -2px 3px rgba(120, 100, 80, 0.1),
    inset 0 0 16px rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

.glass-pin__btn:active {
  transform: scale(0.96);
  box-shadow:
    0 2px 6px rgba(50, 40, 30, 0.1),
    inset 0 2px 4px rgba(80, 60, 40, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.glass-pin__btn:focus-visible {
  outline: 2px solid rgba(166, 124, 82, 0.85);
  outline-offset: 2px;
}

.glass-pin__icon {
  position: relative;
  z-index: 1;
  display: block;
  width: 16px;
  height: 16px;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.5));
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
  .scale-slider {
    height: 100svh;
  }

  .glass-pin-wrap {
    bottom: 24px;
  }

  .glass-pin {
    padding: 7px;
    gap: 8px;
  }

  .glass-pin__btn {
    width: 40px;
    height: 40px;
  }
}

/* Reduced motion: still usable, calmer glass */
@media (prefers-reduced-motion: reduce) {
  .scroll-cover__line::after,
  .glass-pin__shine {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}
