/* The earring card: a warm ivory page, one product card with layered soft shadows and a 1px edge that catches the
   light, a photo well where a pair of pearl drops hangs from a brass rod, the metal picker and the bag button. The
   card is moved only by the script (translate, rotate, scale); its children carry the CSS states. */
:root {
  --page: #efebe4;          /* the page */
  --card: #fbfaf7;          /* the card */
  --well-a: #efe8dd;        /* the photo well, top */
  --well-b: #e2d8c9;        /* the photo well, bottom */
  --ink: #1d1a17;           /* the words */
  --muted: #8b8279;         /* the small words */
  --accent: #b08a4a;        /* the brass accent: the thumb's edge, the bag count */
  --button: #1d1a17;        /* the bag button */
  --button-ink: #f8f5ef;    /* the words on it */
}

* { box-sizing: border-box; }

html { touch-action: manipulation; }

html,
body {
  margin: 0;
  overflow-x: clip;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Mona Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.stage {
  position: relative;
  min-height: 100svh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2.4vh, 22px);
  padding: 14px;
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.7), transparent 60%),
    var(--page);
}

.card {
  position: relative;
  width: min(78vw, 300px, 62vh);
  padding: clamp(8px, 1.6vh, 12px);
  border-radius: 24px;
  background: var(--card);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.9),
    0 0 0 1px rgba(60, 45, 25, 0.07),
    0 1px 2px rgba(60, 45, 25, 0.06),
    0 8px 18px -8px rgba(60, 45, 25, 0.16),
    0 30px 60px -28px rgba(60, 45, 25, 0.32);
  transform-origin: 50% 50%;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  opacity: 0;
  transition: box-shadow 0.35s ease;
}

.card.is-held {
  cursor: grabbing;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.9),
    0 0 0 1px rgba(60, 45, 25, 0.08),
    0 2px 4px rgba(60, 45, 25, 0.06),
    0 16px 28px -10px rgba(60, 45, 25, 0.2),
    0 46px 80px -30px rgba(60, 45, 25, 0.38);
}

/* the photo well: a soft backdrop like a studio sweep, with a light that follows the pointer */
.well {
  position: relative;
  height: clamp(118px, 33vh, 206px);
  border-radius: 17px;
  overflow: hidden;
  background:
    radial-gradient(90% 70% at 50% 18%, rgba(255, 255, 255, 0.65), transparent 70%),
    linear-gradient(180deg, var(--well-a), var(--well-b));
  box-shadow: inset 0 0 0 1px rgba(60, 45, 25, 0.06), inset 0 -18px 30px -24px rgba(60, 45, 25, 0.25);
}

.well__light {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(160px 120px at var(--lx, 50%) var(--ly, 30%), rgba(255, 252, 244, 0.55), transparent 70%);
  opacity: var(--lo, 0);
  transition: opacity 0.4s ease;
}

.jewel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.rod__glint { fill: rgba(255, 250, 235, 0.85); }

.wire,
.hoop {
  fill: none;
  stroke: url(#metal);
  stroke-linecap: round;
}

.hoop__glint {
  fill: none;
  stroke: rgba(255, 253, 245, 0.85);
  stroke-linecap: round;
}

.cap { fill: url(#metal); }

.pearl__body { fill: url(#pearl); }
.pearl__sheen { fill: url(#sheen); }
.pearl__glint { fill: rgba(255, 255, 255, 0.92); }

/* the small bag count in the corner of the well */
.bag {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8), 0 4px 10px -4px rgba(60, 45, 25, 0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.bag svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.bag__n {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 650;
  line-height: 15px;
  text-align: center;
  transform: scale(0);
}

.tag {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.85);
  font-size: 10px;
  font-weight: 520;
  font-stretch: 105%;
  color: #5d554c;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.info {
  padding: clamp(8px, 1.6vh, 12px) 4px 2px;
  display: grid;
  gap: clamp(8px, 1.5vh, 12px);
}

.info__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  margin: 0 0 2px;
  font-size: 10.5px;
  font-weight: 520;
  font-stretch: 112%;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.name {
  margin: 0;
  font-size: clamp(15px, 2.6vh, 17px);
  font-weight: 640;
  font-stretch: 96%;
  letter-spacing: -0.01em;
}

.price {
  margin: 0;
  font-size: clamp(15px, 2.6vh, 17px);
  font-weight: 560;
}

.price__win {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding: 0 1px;
}

.price__n { display: inline-block; }

/* the metal picker: three words on a groove, a raised thumb that slides on a spring */
.metal {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 3px;
  border-radius: 12px;
  background: #f1ede6;
  box-shadow: inset 0 1px 2px rgba(60, 45, 25, 0.1), inset 0 0 0 1px rgba(60, 45, 25, 0.05);
}

.metal__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  bottom: 3px;
  width: calc((100% - 6px) / 3);
  pointer-events: none;
}

.metal__thumb-face {
  position: absolute;
  inset: 0;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(60, 45, 25, 0.07), 0 2px 6px -2px rgba(60, 45, 25, 0.25), inset 0 -1px 0 rgba(176, 138, 74, 0.35);
}

.metal__opt {
  position: relative;
  z-index: 1;
  appearance: none;
  border: 0;
  background: none;
  padding: clamp(5px, 1vh, 7px) 0;
  font: inherit;
  font-size: 12px;
  font-weight: 480;
  font-stretch: 100%;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.25s ease, font-weight 0.25s ease;
}

.metal__opt.is-on {
  color: var(--ink);
  font-weight: 620;
}

.metal__opt:focus-visible,
.add:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 9px;
}

/* the bag button: the element for GSAP is .add__face, the button keeps the CSS press */
.add {
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  border-radius: 14px;
  transition: transform 0.18s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.add:active { transform: scale(0.975); }

.add__face {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: clamp(38px, 6.4vh, 44px);
  border-radius: 14px;
  background: linear-gradient(180deg, #2d2925, var(--button));
  color: var(--button-ink);
  font-size: 13px;
  font-weight: 560;
  font-stretch: 104%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.4), 0 8px 16px -8px rgba(30, 20, 10, 0.6);
}

.add__words { display: inline-block; }

.add__icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.add__check {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

@media (hover: hover) {
  .metal__opt:hover:not(.is-on) { color: #4a433c; }
  .add:hover .add__face { background: linear-gradient(180deg, #38332e, #221f1b); }
}

.hint {
  margin: 0;
  font-size: 11.5px;
  font-weight: 460;
  font-stretch: 108%;
  color: var(--muted);
  opacity: 0;
}

@media (max-height: 480px) {
  .hint { display: none; }
}

.ghost {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  opacity: 0;
  z-index: 5;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}

.ghost path {
  fill: var(--ink);
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
}
