:root {
    --echo-ink: #151515;
    --echo-muted: #777772;
    --echo-paper: #f5f5f1;
    --echo-hairline: rgba(21, 21, 21, 0.12);
    --echo-ease: cubic-bezier(0.65, 0, 0.35, 1);
}

body.echo-open {
    overflow: hidden;
}

#echo-experience {
    position: fixed;
    inset: 0;
    z-index: 1100;
    overflow: hidden;
    background: var(--echo-paper);
    color: var(--echo-ink);
    opacity: 0;
    visibility: hidden;
    transform: scale(1.018);
    transition:
        opacity 500ms var(--echo-ease),
        transform 500ms var(--echo-ease),
        visibility 0s linear 500ms;
    isolation: isolate;
}

#echo-experience.is-open {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition:
        opacity 500ms var(--echo-ease),
        transform 500ms var(--echo-ease),
        visibility 0s;
}

#echo-experience.is-closing {
    opacity: 0;
    transform: scale(0.985);
}

.echo-shell,
.echo-scroll {
    width: 100%;
    height: 100%;
}

.echo-scroll {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.echo-scroll::-webkit-scrollbar {
    display: none;
}

.echo-story {
    position: relative;
    height: 270vh;
    height: 270svh;
}

.echo-stage {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
    background: var(--echo-paper);
}

#echo-particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transition: opacity 800ms var(--echo-ease);
}

.echo-topbar {
    position: absolute;
    z-index: 40;
    inset: 0 0 auto;
    height: 76px;
    padding: 0 clamp(22px, 4vw, 58px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    pointer-events: none;
}

.echo-wordmark {
    font-family: "Quicksand", "Inter", sans-serif;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.echo-close {
    position: relative;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--echo-hairline);
    border-radius: 50%;
    background: rgba(245, 245, 241, 0.82);
    color: var(--echo-ink);
    cursor: pointer;
    pointer-events: auto;
    transition:
        opacity 300ms ease,
        transform 300ms var(--echo-ease),
        background-color 300ms ease;
}

.echo-close:hover {
    background: #fff;
    transform: scale(1.04);
}

.echo-close::before,
.echo-close::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 14px;
    height: 1px;
    background: currentColor;
}

.echo-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.echo-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.echo-close:focus-visible,
.echo-upload-zone:focus-visible,
.echo-wake:focus-visible,
.echo-sheet button:focus-visible {
    outline: 2px solid rgba(21, 21, 21, 0.55);
    outline-offset: 3px;
}

.echo-poster {
    position: absolute;
    z-index: 6;
    inset: 0;
    padding: 90px clamp(22px, 5vw, 72px) 74px;
    display: grid;
    place-items: center;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transform: translateY(22px) scale(0.99);
    transition:
        opacity 600ms var(--echo-ease),
        transform 600ms var(--echo-ease),
        filter 600ms var(--echo-ease);
}

.echo-poster.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.echo-intro {
    z-index: 5;
}

.echo-intro {
    overflow: hidden;
}

.echo-particle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.echo-bubbles {
    position: absolute;
    z-index: 7;
    inset: 92px clamp(18px, 4vw, 64px) 66px;
    pointer-events: none;
}

.echo-bubble {
    position: absolute;
    max-width: min(300px, 26vw);
    margin: 0;
    padding: 10px 16px 11px;
    border: 1px solid rgba(21, 21, 21, 0.2);
    border-radius: 999px;
    background: rgba(250, 250, 247, 0.98);
    color: rgba(21, 21, 21, 0.86);
    font-size: clamp(11px, 1vw, 14px);
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: 0.015em;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    transition:
        opacity 620ms var(--echo-ease),
        transform 1400ms var(--echo-ease);
    will-change: opacity, transform;
}

.echo-bubble.is-entered {
    opacity: var(--alpha, 1);
    transform: translateY(var(--travel, -8px)) scale(1);
}

.echo-bubble.is-leaving {
    opacity: 0;
    transform: translateY(calc(var(--travel, -8px) - 12px)) scale(0.975);
}

.echo-bubble:nth-child(3n + 2) {
    color: rgba(21, 21, 21, 0.74);
}

.echo-bubble:nth-child(4n) {
    border-color: rgba(21, 21, 21, 0.14);
}

.echo-create-title,
.echo-home-brand {
    margin: 0;
    font-family: "Quicksand", "Inter", sans-serif;
    font-weight: 500;
    letter-spacing: -0.065em;
}

.echo-puppy-wrap {
    position: relative;
    width: min(430px, 39vw);
    aspect-ratio: 1;
    justify-self: center;
    opacity: 0;
    transform: translateY(18px) scale(0.96);
    transition:
        opacity 900ms var(--echo-ease),
        transform 1200ms var(--echo-ease);
}

.echo-home.is-active .echo-puppy-wrap {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.echo-puppy {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
    animation: echoBreathe 5.6s ease-in-out infinite;
}

.echo-eye {
    position: absolute;
    width: 4.2%;
    height: 1.7%;
    top: 31.2%;
    border-radius: 50%;
    background: rgba(226, 218, 208, 0.92);
    transform: scaleY(0);
    transform-origin: center;
    animation: echoBlink 7.2s ease-in-out infinite;
    pointer-events: none;
}

.echo-eye-left {
    left: 43.8%;
    transform: rotate(4deg) scaleY(0);
}

.echo-eye-right {
    left: 54.5%;
    top: 32.4%;
    transform: rotate(-5deg) scaleY(0);
}

.echo-create {
    z-index: 12;
    pointer-events: none;
}

.echo-create.is-visible {
    pointer-events: auto;
}

.echo-create-inner {
    width: min(720px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.echo-create-head {
    transition:
        opacity 600ms var(--echo-ease),
        transform 600ms var(--echo-ease);
}

.echo-create.is-processing .echo-create-head,
.echo-create.is-ready .echo-create-head {
    opacity: 0;
    transform: translateY(-18px) scale(0.98);
}

.echo-create-title {
    font-size: clamp(44px, 7vw, 88px);
    line-height: 0.95;
}

.echo-create-subtitle {
    margin: 20px 0 0;
    color: var(--echo-muted);
    font-size: clamp(15px, 1.5vw, 21px);
    letter-spacing: 0.06em;
}

.echo-upload-card {
    width: min(470px, 92vw);
    margin-top: clamp(42px, 7vh, 76px);
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 500ms var(--echo-ease),
        transform 500ms var(--echo-ease);
}

.echo-create.is-processing .echo-upload-card,
.echo-create.is-ready .echo-upload-card {
    opacity: 0;
    transform: translateY(18px);
    pointer-events: none;
}

.echo-step-index {
    display: block;
    margin-bottom: 12px;
    color: var(--echo-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.19em;
    text-transform: uppercase;
}

.echo-step-title {
    margin: 0;
    font-size: clamp(25px, 3vw, 36px);
    font-weight: 500;
    letter-spacing: -0.045em;
}

.echo-step-copy {
    margin: 10px 0 24px;
    color: var(--echo-muted);
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 0.04em;
}

.echo-upload-zone {
    width: 100%;
    min-height: 152px;
    padding: 26px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 13px;
    border: 1px solid var(--echo-hairline);
    border-radius: 2px;
    background: transparent;
    color: var(--echo-ink);
    cursor: pointer;
    transition:
        border-color 250ms ease,
        background-color 250ms ease,
        transform 250ms var(--echo-ease);
}

.echo-upload-zone:hover {
    border-color: rgba(21, 21, 21, 0.28);
    background: rgba(255, 255, 255, 0.26);
    transform: translateY(-2px);
}

.echo-upload-plus {
    position: relative;
    width: 28px;
    height: 28px;
}

.echo-upload-plus::before,
.echo-upload-plus::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 22px;
    height: 1px;
    background: currentColor;
}

.echo-upload-plus::before {
    transform: translate(-50%, -50%);
}

.echo-upload-plus::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.echo-upload-zone span:last-child {
    color: var(--echo-muted);
    font-size: 11px;
    letter-spacing: 0.08em;
}

.echo-upload-complete {
    min-height: 22px;
    margin: 18px 0 0;
    color: #667861;
    font-size: 12px;
    letter-spacing: 0.08em;
    opacity: 0;
    transform: translateY(6px);
    transition:
        opacity 300ms ease,
        transform 300ms var(--echo-ease);
}

.echo-upload-complete.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.echo-analysis,
.echo-ready,
.echo-connection {
    position: absolute;
    z-index: 18;
    inset: 0;
    padding: 80px 22px 54px;
    display: grid;
    place-items: center;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(0.99);
    transition:
        opacity 600ms var(--echo-ease),
        transform 600ms var(--echo-ease),
        visibility 0s linear 600ms;
    pointer-events: none;
}

.echo-analysis.is-visible,
.echo-ready.is-visible,
.echo-connection.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition:
        opacity 600ms var(--echo-ease),
        transform 600ms var(--echo-ease),
        visibility 0s;
}

.echo-process-copy {
    min-width: min(360px, 90vw);
}

.echo-process-copy p {
    margin: 22px 0 0;
    font-size: clamp(17px, 2vw, 24px);
    font-weight: 400;
    letter-spacing: -0.025em;
}

.echo-process-copy p + p {
    color: var(--echo-muted);
    font-size: clamp(13px, 1.3vw, 17px);
    opacity: 0;
    transform: translateY(8px);
    transition:
        opacity 400ms var(--echo-ease),
        transform 400ms var(--echo-ease);
}

.echo-analysis.is-second .echo-process-copy p + p {
    opacity: 1;
    transform: translateY(0);
}

.echo-process-particles {
    position: relative;
    width: 76px;
    height: 76px;
    margin: 0 auto;
}

.echo-process-particles i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--echo-ink);
    opacity: 0.45;
    animation: echoGather 1.5s var(--echo-ease) infinite;
}

.echo-process-particles i:nth-child(1) { --x: -31px; --y: -25px; animation-delay: 0ms; }
.echo-process-particles i:nth-child(2) { --x: 27px; --y: -28px; animation-delay: 100ms; }
.echo-process-particles i:nth-child(3) { --x: -35px; --y: 14px; animation-delay: 210ms; }
.echo-process-particles i:nth-child(4) { --x: 34px; --y: 18px; animation-delay: 320ms; }
.echo-process-particles i:nth-child(5) { --x: -9px; --y: 35px; animation-delay: 430ms; }
.echo-process-particles i:nth-child(6) { --x: 8px; --y: -37px; animation-delay: 540ms; }

.echo-ready-content h2 {
    margin: 0;
    font-family: "Quicksand", "Inter", sans-serif;
    font-size: clamp(43px, 7vw, 82px);
    font-weight: 500;
    line-height: 0.95;
    letter-spacing: -0.065em;
}

.echo-ready-content p {
    margin: 22px 0 0;
    color: var(--echo-muted);
    font-size: clamp(14px, 1.5vw, 19px);
    letter-spacing: 0.08em;
}

.echo-wake {
    margin-top: clamp(74px, 12vh, 118px);
    border: 0;
    background: transparent;
    color: var(--echo-ink);
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.08em;
    cursor: pointer;
    opacity: 0;
    transform: translateY(10px);
    transition:
        color 200ms ease,
        opacity 600ms var(--echo-ease),
        transform 600ms var(--echo-ease);
}

.echo-ready.show-action .echo-wake {
    opacity: 0.72;
    transform: translateY(0);
    pointer-events: auto;
}

.echo-wake:hover {
    color: #62625e;
    opacity: 1;
    transform: translateY(-2px);
}

.echo-connection {
    background: var(--echo-paper);
    z-index: 30;
}

.echo-connection-lines {
    display: grid;
    gap: 20px;
}

.echo-connection-line {
    margin: 0;
    font-size: clamp(18px, 2.2vw, 28px);
    font-weight: 400;
    letter-spacing: -0.03em;
    opacity: 0;
    transform: translateY(9px);
    transition:
        opacity 400ms var(--echo-ease),
        transform 400ms var(--echo-ease);
}

.echo-connection-line.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.echo-home {
    position: absolute;
    z-index: 35;
    inset: 0;
    padding: 72px clamp(22px, 5vw, 70px) 38px;
    display: grid;
    place-items: center;
    background: var(--echo-paper);
    opacity: 0;
    visibility: hidden;
    transform: scale(1.015);
    transition:
        opacity 700ms var(--echo-ease),
        transform 700ms var(--echo-ease),
        visibility 0s linear 700ms;
    pointer-events: none;
}

.echo-home.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition:
        opacity 700ms var(--echo-ease),
        transform 700ms var(--echo-ease),
        visibility 0s;
    pointer-events: auto;
}

.echo-home-inner {
    width: min(1050px, 100%);
    height: min(690px, calc(100vh - 108px));
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.1fr);
    gap: clamp(36px, 7vw, 100px);
    align-items: center;
}

.echo-home-pet {
    display: grid;
    place-items: center;
}

.echo-home .echo-puppy-wrap {
    width: min(460px, 43vw);
}

.echo-home-copy {
    text-align: left;
}

.echo-home-brand {
    color: var(--echo-muted);
    font-size: 17px;
}

.echo-welcome {
    margin: 32px 0 0;
    font-size: clamp(34px, 5vw, 64px);
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -0.06em;
}

.echo-welcome span {
    display: block;
    margin-top: 9px;
    color: var(--echo-muted);
    font-size: clamp(17px, 2vw, 25px);
    font-weight: 400;
    letter-spacing: -0.03em;
}

.echo-home-sections {
    margin-top: clamp(42px, 7vh, 72px);
}

.echo-home-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 28px;
    align-items: baseline;
    padding: 14px 0;
    border-top: 1px solid var(--echo-hairline);
    opacity: 0;
    transform: translateY(14px);
    transition:
        opacity 650ms var(--echo-ease),
        transform 650ms var(--echo-ease);
}

.echo-home-row:last-child {
    border-bottom: 1px solid var(--echo-hairline);
}

.echo-home.expanded .echo-home-row {
    opacity: 1;
    transform: translateY(0);
}

.echo-home.expanded .echo-home-row:nth-child(2) { transition-delay: 150ms; }
.echo-home.expanded .echo-home-row:nth-child(3) { transition-delay: 300ms; }
.echo-home.expanded .echo-home-row:nth-child(4) { transition-delay: 450ms; }

.echo-home-row strong {
    font-size: 14px;
    font-weight: 500;
}

.echo-home-row span {
    color: var(--echo-muted);
    font-size: 12px;
}

.echo-sheet-backdrop {
    position: absolute;
    z-index: 45;
    inset: 0;
    background: rgba(21, 21, 21, 0.16);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 280ms ease,
        visibility 0s linear 280ms;
}

.echo-sheet-backdrop.is-open {
    opacity: 1;
    visibility: visible;
    transition:
        opacity 280ms ease,
        visibility 0s;
}

.echo-sheet {
    position: absolute;
    z-index: 46;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    width: min(430px, calc(100% - 28px));
    display: grid;
    gap: 8px;
    transform: translate(-50%, calc(100% + 30px));
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 340ms ease,
        transform 440ms var(--echo-ease),
        visibility 0s linear 440ms;
}

.echo-sheet.is-open {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
    transition:
        opacity 340ms ease,
        transform 440ms var(--echo-ease),
        visibility 0s;
}

.echo-sheet-group {
    overflow: hidden;
    border-radius: 14px;
    background: rgba(250, 250, 248, 0.98);
}

.echo-sheet button {
    width: 100%;
    height: 56px;
    border: 0;
    border-bottom: 1px solid var(--echo-hairline);
    background: transparent;
    color: var(--echo-ink);
    font: inherit;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 180ms ease;
}

.echo-sheet button:last-child {
    border-bottom: 0;
}

.echo-sheet button:hover {
    background: rgba(21, 21, 21, 0.045);
}

.echo-sheet .echo-sheet-cancel {
    border-radius: 14px;
    background: rgba(250, 250, 248, 0.98);
    font-weight: 500;
}

.echo-progress {
    position: absolute;
    z-index: 22;
    right: clamp(18px, 2.5vw, 34px);
    top: 50%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transform: translateY(-50%);
    pointer-events: none;
    transition: opacity 400ms ease;
}

.echo-progress i {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--echo-ink);
    opacity: 0.2;
    transition:
        opacity 400ms ease,
        transform 400ms var(--echo-ease);
}

.echo-progress i.is-current {
    opacity: 0.9;
    transform: scale(1.8);
}

.echo-scroll-cue {
    position: absolute;
    z-index: 22;
    left: 50%;
    bottom: 27px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #8d8d88;
    font-size: 9px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transform: translateX(-50%);
    opacity: 0.7;
    transition: opacity 400ms ease;
    pointer-events: none;
}

.echo-scroll-cue::before {
    content: "";
    width: 26px;
    height: 1px;
    background: currentColor;
    transform-origin: left;
    animation: echoCue 2.4s ease-in-out infinite;
}

.echo-scroll-cue.is-hidden,
.echo-stage.flow-active .echo-progress {
    opacity: 0;
}

@keyframes echoBreathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-2px) scale(1.006); }
}

@keyframes echoBlink {
    0%, 43%, 45%, 74%, 76%, 100% { opacity: 0; transform: scaleY(0); }
    44%, 75% { opacity: 1; transform: scaleY(1); }
}

@keyframes echoPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 0.85; transform: scale(1); }
}

@keyframes echoGather {
    0% { transform: translate(var(--x), var(--y)) scale(0.7); opacity: 0.08; }
    58%, 100% { transform: translate(0, 0) scale(1); opacity: 0.58; }
}

@keyframes echoCue {
    0%, 100% { transform: scaleX(0.25); opacity: 0.3; }
    50% { transform: scaleX(1); opacity: 0.8; }
}

@media (max-width: 760px) {
    .echo-topbar {
        height: 64px;
        padding: 0 18px;
    }

    .echo-wordmark {
        font-size: 16px;
    }

    .echo-close {
        width: 38px;
        height: 38px;
    }

    .echo-poster {
        padding: 74px 20px 64px;
    }

    .echo-bubbles {
        inset: 68px 12px 54px;
    }

    .echo-bubble {
        max-width: 46vw;
        padding: 8px 11px 9px;
        font-size: 10px;
    }

    .echo-puppy-wrap,
    .echo-home .echo-puppy-wrap {
        width: min(310px, 72vw);
        max-height: 36vh;
    }

    .echo-create {
        padding-top: 70px;
    }

    .echo-create-title {
        font-size: clamp(43px, 13vw, 65px);
    }

    .echo-create-subtitle {
        margin-top: 15px;
        font-size: 14px;
    }

    .echo-upload-card {
        margin-top: 36px;
    }

    .echo-upload-zone {
        min-height: 124px;
    }

    .echo-home {
        padding: 68px 20px 22px;
    }

    .echo-home-inner {
        height: calc(100vh - 92px);
        grid-template-columns: 1fr;
        grid-template-rows: minmax(200px, 0.95fr) auto;
        gap: 8px;
    }

    .echo-home-copy {
        text-align: center;
    }

    .echo-welcome {
        margin-top: 12px;
        font-size: clamp(31px, 10vw, 46px);
    }

    .echo-home-sections {
        margin-top: 28px;
        text-align: left;
    }

    .echo-home-row {
        padding: 10px 0;
    }

    .echo-progress {
        right: 11px;
    }

    .echo-scroll-cue {
        bottom: 18px;
    }
}

@media (max-height: 650px) and (min-width: 761px) {
    .echo-home-inner {
        transform: scale(0.88);
    }

    .echo-upload-card {
        margin-top: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #echo-experience,
    #echo-experience.is-open,
    #echo-experience.is-closing,
    #echo-particles,
    .echo-poster,
    .echo-puppy-wrap,
    .echo-create-head,
    .echo-upload-card,
    .echo-analysis,
    .echo-ready,
    .echo-connection,
    .echo-home,
    .echo-home-row,
    .echo-wake,
    .echo-sheet,
    .echo-sheet-backdrop {
        transition-duration: 1ms !important;
    }

    .echo-puppy,
    .echo-eye,
    .echo-process-particles i,
    .echo-scroll-cue::before {
        animation: none !important;
    }
}
