/* ============================================
   Welcome Popup — site-wide (260525-o8r)
   Standalone, self-contained — no external token dependencies.
   Loaded on every page of upwiseposture.com.
   ============================================ */

/* Body scroll lock helper while popup is open */
body.welcome-popup-open {
    overflow: hidden;
}

/* Backdrop: radial dim so the dialog feels spotlit */
.welcome-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: radial-gradient(ellipse at center,
        rgba(15, 12, 9, 0.55) 0%,
        rgba(15, 12, 9, 0.86) 100%);
    -webkit-backdrop-filter: blur(4px) saturate(1.1);
    backdrop-filter: blur(4px) saturate(1.1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease-out;
}

.welcome-popup-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Dialog card */
.welcome-popup {
    background:
        radial-gradient(ellipse at top, rgba(217, 178, 153, 0.06) 0%, transparent 60%),
        linear-gradient(180deg, #1d1612 0%, #15110d 100%);
    color: rgb(242, 230, 217);
    border: 1px solid rgba(217, 178, 153, 0.22);
    border-radius: 20px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.55),
        0 1px 0 rgba(217, 178, 153, 0.08) inset;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    padding: 32px 24px 24px;
    font-family: 'Circular Std', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: relative;
    transform: translateY(10px) scale(0.97);
    opacity: 0;
    transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1),
                opacity 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Top accent: thin gold gradient stripe across the dialog top edge */
.welcome-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(217, 178, 153, 0.55) 30%,
        rgba(217, 178, 153, 0.55) 70%,
        transparent 100%);
    pointer-events: none;
}

.welcome-popup-backdrop.is-open .welcome-popup {
    transform: none;
    opacity: 1;
}

/* Close button (top-right X) */
.welcome-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 0;
    border-radius: 10px;
    color: rgb(242, 230, 217);
    opacity: 0.5;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: opacity 160ms ease, background 160ms ease;
    z-index: 2;
}

.welcome-popup-close:hover,
.welcome-popup-close:focus-visible {
    opacity: 1;
    background: rgba(217, 178, 153, 0.1);
}

.welcome-popup-close:focus-visible {
    outline: 2px solid rgb(217, 178, 153);
    outline-offset: 2px;
}

/* Brand pill: stones logo + UPWISE wordmark anchors the dialog */
.welcome-popup-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 5px 12px 5px 6px;
    border: 1px solid rgba(217, 178, 153, 0.2);
    border-radius: 999px;
    background: rgba(217, 178, 153, 0.05);
}

.welcome-popup-brand img {
    width: 22px;
    height: 22px;
    display: block;
    border-radius: 50%;
}

.welcome-popup-brand span {
    font-family: 'Circular Std', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgb(217, 178, 153);
}

/* Hero block: rotating value-prop + static "all with UpWise" tagline */
.welcome-popup-hero {
    margin: 0 0 18px;
}

/* Rotator viewport — fixed height clips to one line */
.welcome-popup-rotator {
    overflow: hidden;
    height: 1.18em;
    font-family: 'Instrument Serif', 'Georgia', serif;
    font-size: 32px;
    font-weight: 500;
    line-height: 1.18;
    letter-spacing: -0.012em;
    color: rgb(242, 230, 217);
    margin: 0;
}

.welcome-popup-rotator-track {
    will-change: transform;
}

.welcome-popup-rotator-word {
    line-height: 1.18;
    height: 1.18em;
}

/* Static tagline below rotator — same metrics, gold accent */
.welcome-popup-tagline {
    font-family: 'Instrument Serif', 'Georgia', serif;
    font-size: 32px;
    font-weight: 500;
    line-height: 1.18;
    letter-spacing: -0.012em;
    color: rgb(217, 178, 153);
    margin: 2px 0 0;
}

/* Stones logo sits inline immediately before the UpWise word */
.welcome-popup-tagline-logo {
    display: inline-block;
    width: 0.95em;
    height: 0.95em;
    vertical-align: -0.16em;
    border-radius: 50%;
    margin-right: 0.12em;
}

/* Feature list: 3 checks under the hero */
.welcome-popup-features {
    list-style: none;
    padding: 0;
    margin: 0 0 22px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.welcome-popup-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Circular Std', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: rgba(242, 230, 217, 0.85);
}

.welcome-popup-feature svg {
    flex-shrink: 0;
    color: rgb(217, 178, 153);
}

/* Soft divider above the question */
.welcome-popup-divider {
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(217, 178, 153, 0.18) 50%,
        transparent 100%);
    margin: 0 0 18px;
    border: 0;
}

/* Question label */
.welcome-popup-question {
    font-family: 'Circular Std', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 600;
    font-size: 12px;
    color: rgb(217, 178, 153);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.welcome-popup-question::before {
    content: '';
    width: 18px;
    height: 1px;
    background: rgba(217, 178, 153, 0.55);
    display: inline-block;
}

/* Chip list */
.welcome-popup-chips {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 22px;
    padding: 0;
    list-style: none;
}

/* Chip button — left stripe animates in on hover */
.welcome-popup-chip {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    background: rgba(217, 178, 153, 0.035);
    border: 1px solid rgba(217, 178, 153, 0.13);
    border-radius: 12px;
    padding: 14px 16px 14px 18px;
    font-family: 'Circular Std', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: rgb(242, 230, 217);
    cursor: pointer;
    overflow: hidden;
    transition: background 180ms ease,
                border-color 180ms ease,
                transform 120ms ease,
                padding-left 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.welcome-popup-chip::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: rgb(217, 178, 153);
    border-radius: 0 3px 3px 0;
    transition: height 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.welcome-popup-chip:hover {
    background: rgba(217, 178, 153, 0.09);
    border-color: rgba(217, 178, 153, 0.32);
    padding-left: 24px;
}

.welcome-popup-chip:hover::before {
    height: 60%;
}

.welcome-popup-chip:active {
    transform: translateY(1px);
}

.welcome-popup-chip:focus-visible {
    outline: 2px solid rgb(217, 178, 153);
    outline-offset: 2px;
}

/* Trailing arrow on each chip (fades up on hover) */
.welcome-popup-chip::after {
    content: '\2192';
    margin-left: auto;
    padding-left: 12px;
    color: rgb(217, 178, 153);
    font-size: 16px;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.welcome-popup-chip:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* Pitch + CTA block — tinted footer panel */
.welcome-popup-pitch {
    background: linear-gradient(180deg,
        rgba(217, 178, 153, 0.06) 0%,
        rgba(217, 178, 153, 0.02) 100%);
    border: 1px solid rgba(217, 178, 153, 0.16);
    border-radius: 14px;
    padding: 16px;
    text-align: center;
}

.welcome-popup-pitch p {
    font-size: 14px;
    line-height: 1.55;
    color: rgba(242, 230, 217, 0.82);
    margin: 0 0 14px;
}

.welcome-popup-cta {
    text-align: center;
}

.welcome-popup-cta a {
    display: inline-block;
    border-radius: 8px;
    transition: transform 140ms ease;
}

.welcome-popup-cta a:hover {
    transform: translateY(-1px);
}

.welcome-popup-cta a:focus-visible {
    outline: 2px solid rgb(217, 178, 153);
    outline-offset: 3px;
}

.welcome-popup-cta img {
    height: 46px;
    width: auto;
    display: inline-block;
}

/* Mobile tweaks */
@media (max-width: 420px) {
    .welcome-popup {
        padding: 26px 16px 16px;
        border-radius: 18px;
    }
    .welcome-popup-brand {
        margin-bottom: 14px;
    }
    .welcome-popup-rotator,
    .welcome-popup-tagline {
        font-size: 26px;
    }
    .welcome-popup-hero {
        margin-bottom: 14px;
    }
    .welcome-popup-features {
        margin-bottom: 18px;
        gap: 8px;
    }
    .welcome-popup-feature {
        font-size: 13.5px;
    }
    .welcome-popup-divider {
        margin-bottom: 14px;
    }
    .welcome-popup-chip {
        padding: 13px 14px 13px 16px;
        font-size: 14.5px;
    }
    .welcome-popup-chip:hover {
        padding-left: 20px;
    }
    .welcome-popup-pitch {
        padding: 14px;
    }
    .welcome-popup-pitch p {
        font-size: 13.5px;
    }
}

/* Reduced motion: drop transitions entirely and freeze the rotator */
@media (prefers-reduced-motion: reduce) {
    .welcome-popup-backdrop,
    .welcome-popup,
    .welcome-popup-chip,
    .welcome-popup-chip::before,
    .welcome-popup-chip::after,
    .welcome-popup-cta a,
    .welcome-popup-rotator-track {
        transition: none !important;
    }
    .welcome-popup {
        transform: none;
    }
    .welcome-popup-rotator-track {
        transform: none !important;
    }
}
