:root {
    --purple: #5230ae;
    --purple-dark: #22075a;
    --purple-soft: #eeebf7;
    --orange: #d8963a;
    --ink: #292334;
    --muted: #7b738c;
    --error: #b42318;
    --white: #fff
}

* {
    box-sizing: border-box
}

html,body {
    margin: 0;
    min-height: 100%;
    font-family: Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    color: var(--ink);
    background: #faf9fc
}

body {
    min-height: 100svh
}

[hidden] {
    display: none!important
}

.onboarding {
    min-height: 100svh;
    padding: max(16px,env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));
    overflow-x: hidden
}

.brand {
    max-width: 1180px;
    margin: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 58px;
    font-weight: 800;
    color: var(--purple-dark)
}

.brand img {
    width: 44px;
    height: 44px;
    object-fit: contain
}

.welcome {
    max-width: 1180px;
    min-height: min(680px,calc(100svh - 100px));
    margin: auto;
    display: grid;
    grid-template-columns: minmax(300px,.85fr) minmax(440px,1.15fr);
    gap: clamp(32px,6vw,88px);
    align-items: center;
    animation: welcome-in .4s ease-out both
}

.welcome-copy {
    max-width: 530px
}

.welcome-copy h1 {
    font-size: clamp(42px,5.5vw,68px)
}

.welcome-copy>p:not(.eyebrow) {
    max-width: 500px;
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 19px;
    line-height: 1.55
}

.welcome-copy .primary {
    width: auto;
    min-width: 190px
}

.welcome-visual {
    position: relative;
    padding: clamp(18px,3vw,38px);
    border-radius: 38px;
    background: linear-gradient(145deg,#eeebf7,#fff 58%,#fff3e2);
    overflow: hidden
}

.welcome-visual::before,.welcome-visual::after {
    content: '';
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    opacity: .45
}

.welcome-visual::before {
    top: -55px;
    right: -35px;
    background: var(--orange)
}

.welcome-visual::after {
    bottom: -70px;
    left: -45px;
    background: var(--purple)
}

.welcome-visual {
    height: clamp(390px,52vw,560px)
}

.member-piece {
    position: absolute;
    z-index: 1;
    width: 23%;
    height: 43%;
    border: 3px solid white;
    border-radius: 18px;
    overflow: hidden;
    background: #d9d2e9;
    box-shadow: 0 12px 28px rgba(34,7,90,.2);
    animation: member-assemble .45s cubic-bezier(.2,.7,.25,1) both
}

.member-piece span {display:block;width:100%;height:100%;background-position:center;background-size:cover}
.member-piece-1 {left:4%;top:8%;transform:rotate(-4deg);animation-delay:.05s}
.member-piece-2 {left:28%;top:3%;transform:rotate(2deg);animation-delay:.12s}
.member-piece-3 {left:51%;top:7%;transform:rotate(-2deg);animation-delay:.19s}
.member-piece-4 {left:74%;top:4%;transform:rotate(4deg);animation-delay:.26s}
.member-piece-5 {left:4%;top:51%;transform:rotate(3deg);animation-delay:.33s}
.member-piece-6 {left:27%;top:55%;transform:rotate(-2deg);animation-delay:.40s}
.member-piece-7 {left:51%;top:50%;transform:rotate(3deg);animation-delay:.47s}
.member-piece-8 {left:74%;top:54%;transform:rotate(-3deg);animation-delay:.54s}
}

.flow-enter {
    animation: flow-in .35s ease-out both
}

.layout {
    max-width: 1180px;
    margin: clamp(12px,4vh,48px) auto 0;
    display: grid;
    grid-template-columns: minmax(0,620px) minmax(260px,1fr);
    gap: clamp(35px,7vw,100px);
    align-items: center
}

.panel {
    min-width: 0
}

.progress {
    height: 7px;
    border-radius: 10px;
    background: #e6e1ef;
    overflow: hidden;
    margin-bottom: 18px
}

.progress div {
    height: 100%;
    width: 0;
    background: var(--orange);
    transition: width .3s
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--purple);
    font-weight: 800;
    font-size: 13px;
    margin: 0 0 10px
}

h1 {
    font-size: clamp(34px,5vw,58px);
    line-height: 1.05;
    color: var(--purple-dark);
    margin: 0 0 8px
}

.prompt {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.5;
    margin: 0 0 14px
}

.error {
    min-height: 22px;
    color: var(--error);
    font-weight: 650;
    margin: 0 0 10px
}

#control {
    display: grid;
    gap: 10px;
    margin-bottom: 12px
}

input[type=text],input[type=email],input[type=password],input[type=date],input[type=number],input[type=file] {
    width: 100%;
    min-height: 58px;
    border: 2px solid #dcd6e5;
    border-radius: 14px;
    background: white;
    padding: 13px 16px;
    font: inherit;
    font-size: 17px
}

input:focus {
    outline: 3px solid rgba(82,48,174,.18);
    border-color: var(--purple)
}

input[type=file] {
    padding: 13px
}

.visually-hidden-file {
    position: absolute!important;
    width: 1px!important;
    height: 1px!important;
    min-height: 0!important;
    padding: 0!important;
    margin: -1px!important;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0!important
}

.photo-picker {
    min-height: 58px;
    border: 2px solid var(--purple);
    border-radius: 16px;
    background: white;
    color: var(--purple);
    font-weight: 800;
    cursor: pointer
}

.photo-picker:focus-visible,input[type=range]:focus-visible,.email-help:focus-visible {
    outline: 3px solid rgba(82,48,174,.3);
    outline-offset: 3px
}

.photo-preview-holder {
    position: relative;
    width: min(100%,340px);
    aspect-ratio: 2/3;
    margin: 0 auto 8px;
}

.photo-preview {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 22px;
    object-fit: cover;
    box-shadow: 0 15px 38px rgba(34,7,90,.18)
}

.photo-preview-holder .change-photo {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: auto;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid rgba(255,255,255,.8);
    border-radius: 999px;
    background: rgba(34,7,90,.82);
    color: white;
    box-shadow: 0 4px 14px rgba(34,7,90,.28);
    font-size: 14px;
    backdrop-filter: blur(4px)
}

.height-value {display:block;text-align:center;color:var(--purple-dark);font-size:clamp(26px,5vw,36px);font-weight:800;margin:6px 0 15px}
input[type=range]{width:100%;height:38px;appearance:none;background:transparent;cursor:pointer}
input[type=range]::-webkit-slider-runnable-track{height:10px;border-radius:10px;background:linear-gradient(90deg,var(--purple-soft),#d2c5ed)}
input[type=range]::-webkit-slider-thumb{appearance:none;width:30px;height:30px;margin-top:-10px;border:4px solid white;border-radius:50%;background:var(--purple);box-shadow:0 3px 10px rgba(34,7,90,.3)}
input[type=range]::-moz-range-track{height:10px;border-radius:10px;background:#d2c5ed}
input[type=range]::-moz-range-thumb{width:24px;height:24px;border:4px solid white;border-radius:50%;background:var(--purple);box-shadow:0 3px 10px rgba(34,7,90,.3)}

.confirmation-email{overflow-wrap:anywhere;color:var(--purple-dark)}
.confirmation-note{color:var(--muted);line-height:1.5}
.email-help{padding:4px 0;border:0;background:none;color:var(--purple);font-weight:750;text-decoration:underline;cursor:pointer}
.email-correction{margin-top:22px;padding:20px;border-radius:18px;background:var(--purple-soft)}
.email-correction p{line-height:1.45}.email-correction label{display:block;font-weight:750;margin-bottom:7px}.email-correction input{margin-bottom:12px}.confirmation-status{min-height:22px;margin:12px 0 0}.confirmation-status.success{color:#176b3a;font-weight:700}

.choice {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 12px 15px;
    border: 2px solid #ded8e8;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    font-weight: 700
}

.choice:hover {
    border-color: #955edb
}

.choice:has(input:checked) {
    border-color: var(--purple);
    background: var(--purple-soft);
    color: var(--purple-dark)
}

.choice input {
    width: 21px;
    height: 21px;
    margin: 0 13px 0 0;
    accent-color: var(--purple)
}

button {
    font: inherit
}

.primary,.secondary,.lucky-buttons button {
    min-height: 56px;
    border-radius: 16px;
    padding: 12px 24px;
    font-weight: 800;
    cursor: pointer
}

.primary {
    width: 100%;
    border: 0;
    background: var(--purple);
    color: white;
    box-shadow: 0 8px 20px rgba(82,48,174,.2)
}

.primary:hover {
    background: #411c91
}

.primary:disabled,button:disabled {
    opacity: .55;
    cursor: wait
}

.secondary {
    width: 100%;
    margin-top: 10px;
    background: white;
    color: var(--purple);
    border: 2px solid var(--purple)
}

aside {
    background: linear-gradient(145deg,#eeebf7,#fff);
    border-radius: 32px;
    padding: clamp(25px,4vw,50px);
    min-height: 420px;
    display: flex;
    align-items: center
}

.puzzle img {
    display: block;
    width: 100%;
    max-height: 300px;
    object-fit: contain
}

.puzzle div {
    color: var(--purple-dark);
    font-size: 19px;
    line-height: 1.45
}

.profile-card {
    position: relative;
    max-width: 420px;
    margin: auto;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 16px 50px rgba(34,7,90,.17);
    transition: transform .28s,opacity .28s
}

.profile-card>img {
    display: block;
    width: 100%;
    height: min(62svh,600px);
    object-fit: cover;
    background: var(--purple-soft)
}

.profile-scrim {
    position: absolute;
    inset: 42% 0 0;
    background: linear-gradient(to bottom,transparent,rgba(20,8,38,.9));
    pointer-events: none
}

.profile-card .profile-details {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 90px;
    display: flex;
    flex-direction: column;
    color: white;
    text-shadow: 0 2px 8px rgba(0,0,0,.65)
}

.profile-card .profile-details strong {
    color: white;
    font-size: 24px
}

.profile-card .profile-details span {
    color: rgba(255,255,255,.9);
    margin-top: 2px
}

.exit-like {
    transform: translateX(45px) rotate(3deg);
    opacity: 0
}

.exit-pass {
    transform: translateX(-45px) rotate(-3deg);
    opacity: 0
}

.lucky-buttons {
    position: absolute;
    z-index: 2;
    left: 16px;
    right: 16px;
    bottom: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 0
}

.lucky-buttons button {
    border: 2px solid var(--purple);
    background: white;
    color: var(--purple)
}

.lucky-buttons .like {
    background: var(--orange);
    border-color: var(--orange);
    color: #231807
}

.history {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    max-width: 620px;
    margin: 20px auto 0
}

.get-lucky-layout {
    display: block;
    max-width: 620px;
    margin-top: 4px
}

.get-lucky-layout aside,.get-lucky-layout .progress,.get-lucky-layout h1,.get-lucky-layout .prompt {
    display: none
}

.get-lucky-layout .eyebrow {
    margin-bottom: 8px;
    text-align: center
}

.shortcut-layout {
    display: block;
    max-width: 520px;
    margin-top: clamp(10px,3vh,34px);
    text-align: center
}

.shortcut-layout aside,.shortcut-layout .progress {
    display: none
}

.shortcut-profiles {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 10px;
    margin: 12px 0 18px
}

.shortcut-profiles figure {margin:0;text-align:center;font-weight:750;color:var(--purple-dark)}
.shortcut-profiles img {display:block;width:100%;aspect-ratio:3/4;object-fit:cover;border-radius:16px;margin-bottom:6px;box-shadow:0 8px 20px rgba(34,7,90,.16)}
.shortcut-prompt {text-align:center;color:var(--muted);font-size:17px;margin:0 0 14px}

.history-item {
    position: relative;
    flex: 0 0 52px;
    height: 52px
}

.history-item img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover
}

.history-item b {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: white;
    font-size: 11px
}

.history-item .yes {
    background: var(--orange)
}

.history-item .no {
    background: var(--purple-dark)
}

@media (max-width: 760px) {
    .brand span {
        font-size: 15px
    }

    .layout {
        display: block;
        margin-top: 10px
    }

    .welcome {
        min-height: 0;
        margin-top: 18px;
        display: flex;
        flex-direction: column;
        gap: 18px;
        align-items: stretch
    }

    .welcome-copy h1 {
        font-size: clamp(34px,10vw,44px);
        margin-bottom: 12px
    }

    .welcome-copy>p:not(.eyebrow) {
        margin-bottom: 18px;
        font-size: 16px
    }

    .welcome-copy .primary {
        width: 100%
    }

    .welcome-visual {
        width: 100%;
        max-height: 31svh;
        padding: 12px 18px;
        border-radius: 24px
    }

    .welcome-visual {
        height: min(34svh,300px);
        max-height: none
    }

    .member-piece {
        border-width: 2px;
        border-radius: 11px
    }

    .layout aside {
        display: none
    }

    h1 {
        font-size: 34px
    }

    .prompt {
        font-size: 16px
    }

    .progress {
        margin-bottom: 14px
    }

    .profile-card>img {
        height: clamp(330px,calc(100svh - 245px),520px)
    }

    .history {
        margin-top: 9px
    }

    .get-lucky-layout {margin-top:0}

    .get-lucky-layout .profile-card {max-width:min(100%,390px)}

    .get-lucky-layout+.history {margin-top:9px}

    .onboarding {
        padding-bottom: max(20px,env(safe-area-inset-bottom))
    }

}

@keyframes welcome-in {
    from {opacity: 0;transform: translateY(8px)}
    to {opacity: 1;transform: translateY(0)}
}

@keyframes members-in {
    from {opacity: 0;transform: translateY(10px) scale(.98)}
    to {opacity: 1;transform: translateY(0) scale(1)}
}

@keyframes member-assemble {
    from {opacity:0;translate:var(--entry-x,0) -22px;scale:.91}
    to {opacity:1;translate:0 0;scale:1}
}

@keyframes flow-in {
    from {opacity: 0;transform: translateY(8px)}
    to {opacity: 1;transform: translateY(0)}
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none!important;
        scroll-behavior: auto!important;
        transition: none!important
    }

}
