:root {
  --accent-color: #e0245e;
  --bg: #030712;
  --fg: #f5f5f7;
  --muted: #a1a1aa;
  --cover: none; /* set by app.js to the creator photo — used only on desktop */
}

* {
  box-sizing: border-box;
}

/* Elements toggled via the `hidden` attribute (city pill, CTA, online badge,
   manual fallback) also carry a `display:flex/inline-flex` rule that would
   otherwise override `hidden` (same specificity, later rule wins) and render
   them as empty boxes before JS reveals them. Force `hidden` to win. */
[hidden] {
  display: none !important;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

/* Blurred cover backdrop — hidden on mobile, revealed behind the floating
   phone-card on desktop (see the min-width:820px block). */
.backdrop {
  display: none;
}

.page {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
}

/* COVER — framed crop, exactly like the reference (slt.bio) funnel: a fixed
   21/19 window with object-fit:cover, NOT the raw full-height photo. The fade
   to the page background is done here in CSS (the ::after gradient), so the
   source photo should be a clean selfie with NO black baked into it — the
   gradient produces the fade. object-position keeps the face/top in frame and
   pushes the lower body (or any leftover dark area) down into the faded zone. */
.media-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 19;
  max-height: 60dvh;
  overflow: hidden;
  line-height: 0;
  background: #17171b;
}

.media-frame img,
.media-frame video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--cover-pos, center top);
  /* Hidden until real media actually loads (see app.js) — a missing/broken
     photo must never render as a broken-image icon; the frame's own dark
     background shows through instead until then. */
  opacity: 0;
  transition: opacity 0.3s ease;
}

.media-frame img.is-ready,
.media-frame video.is-ready {
  opacity: 1;
}

/* The name overlaps the bottom of the cover, sitting inside this fade. Start
   the fade a little past halfway so the top of the photo stays crisp. */
.media-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(3, 7, 18, 0) 55%, var(--bg) 100%);
}

.content {
  position: relative;
  z-index: 2;
  /* Pull the content block up over the cover so the name overlaps the photo. */
  margin-top: -32px;
  width: 100%;
  max-width: 384px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 24px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.creator-name {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.6);
}

/* "Available now" and the city on the SAME row — keeps the block compact so
   the CTA sits higher up. */
.badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 13px;
  border-radius: 999px;
  color: #fff;
}

.badge-online {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-online .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgb(34, 197, 94);
  box-shadow: 0 0 0 rgba(34, 197, 94, 0.6);
  animation: pulse 1.6s infinite;
}

.badge-city {
  background: rgba(255, 255, 255, 0.08);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.cta-button {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  /* OnlyFans brand blue — text + icon (currentColor) go white on top. */
  background: #00aff0;
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  padding: 14px 20px;
  border-radius: 12px;
  text-decoration: none;
}

.cta-button:active {
  transform: scale(0.99);
}

.cta-icon {
  flex-shrink: 0;
}

.manual-fallback-link[hidden] {
  display: none;
}

.manual-fallback-link {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
}

/* DESKTOP — the page becomes a 420px "phone card" floating on a heavily
   blurred, scaled-up version of the cover, matching the reference funnel's
   desktop presentation. Mobile keeps the full-bleed layout above. */
@media (min-width: 820px) {
  body {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .backdrop {
    display: block;
    position: fixed;
    inset: -80px;
    z-index: 0;
    background-image: var(--cover);
    background-size: cover;
    background-position: center;
    filter: blur(90px) saturate(1.4);
    transform: scale(1.15);
  }

  .backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.6) 100%);
  }

  .page {
    width: 420px;
    max-width: 420px;
    /* Fixed card height (their exact 420×631 proportion, cover = 60%): the
       button lands around 73% down and there's a deliberate block of black
       BELOW it. That empty black is what makes the white button pop — never
       let the card shrink to the button and bottom-anchor it. */
    min-height: 632px;
    margin: 32px auto;
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
    z-index: 1;
  }
}
