/* Mobile experiment overlay — paired with experiment-overlay.js.
   See that file for the interaction model + easing values. */

.exp-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  /* Above safe-area: the close button + grip + drag region all need
     to live in the iOS notch / dynamic-island space too. The sheet
     uses safe-area-inset-* via its own padding so content doesn't
     end up under the system UI. */
}
.exp-overlay[aria-hidden="false"] {
  pointer-events: auto;
}

.exp-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 24, 0.62);
  /* Soft blur of the page behind — only kicks in on browsers that
     support it; the dim alone is enough on browsers that don't. */
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 480ms cubic-bezier(0.18, 0.9, 0.25, 1);
}
.exp-overlay.open .exp-overlay-backdrop {
  opacity: 1;
}

.exp-overlay-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  /* 92% of the viewport — leaves a hint of the page behind at the top
     so the modal reads as a sheet, not a full takeover. iOS Safari's
     dynamic viewport unit keeps the sheet tall when the URL bar
     animates in/out instead of jumping. */
  height: 92svh;
  max-height: 92svh;
  background: #ffffff;
  border-radius: 22px 22px 0 0;
  box-shadow:
    0 -8px 40px rgba(0, 0, 0, 0.18),
    0 -1px 0 rgba(255, 255, 255, 0.6) inset;
  transform: translateY(100%);
  transition: transform 480ms cubic-bezier(0.18, 0.9, 0.25, 1);
  overflow: hidden;
  will-change: transform;
}
.exp-overlay.open .exp-overlay-sheet {
  transform: translateY(0);
}

/* Drag affordance — short pill at the top centre. Visually says "you
   can pull this down". Tappable region extends past the visual via
   the sheet's own touch handlers. */
.exp-overlay-grip {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: rgba(15, 15, 24, 0.20);
  z-index: 2;
  pointer-events: none;
}

.exp-overlay-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 15, 24, 0.06);
  color: #1a1a2e;
  cursor: pointer;
  transition: background 200ms ease;
  -webkit-tap-highlight-color: transparent;
}
.exp-overlay-close:hover,
.exp-overlay-close:focus-visible {
  background: rgba(15, 15, 24, 0.12);
  outline: none;
}

/* Scrollable content area — fills the sheet beneath the grip + close
   button. Native scroll handles inner content; the drag-dismiss
   logic in JS only kicks in when this scroll is already at the top
   and the user is swiping down.

   overscroll-behavior: none kills iOS Safari's elastic bounce at
   the top boundary — otherwise scrolling up past 0 reveals the
   sheet's white background above the hero image. The drag-dismiss
   JS handler is the canonical "what happens at the top edge"
   behaviour; native bounce was just stepping on it. */
.exp-overlay-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
  /* Pad the top a touch so the grip + close don't crowd the hero. */
  padding-top: 0;
}

.exp-overlay-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #1a1a2e;
  /* The hero corner radius matches the sheet, since it sits flush
     against the rounded top. */
  border-radius: 22px 22px 0 0;
}
.exp-overlay-img,
.exp-overlay-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  /* Don't grab pointer events — the sheet's drag-dismiss handler
     needs to see touches that start on the hero. */
  pointer-events: none;
}

.exp-overlay-body {
  /* Big editorial padding so the type feels confident — molly.studio
     uses generous left/right margins. Extra bottom padding so the
     CTA has air to breathe + room for iOS home-indicator. */
  padding: 28px 24px calc(80px + env(safe-area-inset-bottom));
}
.exp-overlay-eyebrow {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 13px;
  text-transform: lowercase;
  letter-spacing: 0.04em;
  color: rgba(26, 26, 46, 0.55);
  margin: 0 0 10px;
}
.exp-overlay-title {
  font-family: 'Edict Display', Georgia, serif;
  font-weight: 400;
  font-size: 38px;
  line-height: 1.08;
  letter-spacing: -0.018em;
  color: #1a1a2e;
  margin: 0 0 20px;
}
.exp-overlay-desc {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.5;
  letter-spacing: 0.005em;
  color: rgba(26, 26, 46, 0.78);
  margin: 0 0 32px;
  max-width: 60ch;
}

/* CTA — styled to match the "More experiments" text link at the end of
   the experiments carousel: serif-italic display type with an upright
   arrow, NOT a filled pill button. The label carries the underline; the
   arrow stays unmarked and nudges up-right on press. */
.exp-overlay-cta {
  display: inline-flex;
  align-items: baseline;
  gap: 14px;
  text-decoration: none;
  font-family: 'Edict Display', Georgia, serif;
  font-style: italic;
  font-weight: 300;
  font-size: 30px;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #1a1a2e;
  -webkit-tap-highlight-color: transparent;
}
.exp-overlay-cta-label {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.12em;
  text-decoration-color: currentColor;
  transition: text-decoration-color 220ms ease;
}
.exp-overlay-cta:active .exp-overlay-cta-label {
  text-decoration-color: transparent;
}
.exp-overlay-cta-arrow {
  display: inline-block;
  font-family: 'Edict Display', Georgia, serif;
  font-style: normal;
  font-size: 0.9em;
  line-height: 1;
  /* Explicit none — the arrow is NEVER underlined. */
  text-decoration: none;
  transition: transform 220ms cubic-bezier(.2, .7, .2, 1.0);
}
.exp-overlay-cta:active .exp-overlay-cta-arrow {
  transform: translate(6px, -6px);
}
