/* /ai-visibility hero: one question, three assistants, each answer checked
   for the business. Markup in templates/_aeo_hero_demo.html, playback in
   static/aeo-hero.js. Without scripts or with reduced motion the first
   answer stays on screen, already checked. */

.r-aeo-hero__shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(1.75rem, 4vw, 3.5rem);
    align-items: center;
}

body.v2 .r-aeo-hero .r-aeo-hero__shell {
    display: grid;
}

.r-aeo-hero__copy {
    min-width: 0;
}

@media (min-width: 980px) {
    .r-aeo-hero__shell {
        grid-template-columns: minmax(0, 1fr) minmax(0, 28.5rem);
    }
}

/* ---- The answer panel -------------------------------------------------- */

.r-aeo-demo {
    --aeo-line: rgba(201, 184, 240, 0.16);
    --aeo-soft: #a89fbc;
    --aeo-violet: #8b5cf6;
    --aeo-violet-soft: #c9b8f0;
    --aeo-good: #86efac;
    --aeo-warn: #fcd34d;
    position: relative;
    width: 100%;
    max-width: 28.5rem;
    margin: 0;
    justify-self: end;
    isolation: isolate;
}

.r-aeo-demo::before {
    content: "";
    position: absolute;
    inset: -18% -22% -14%;
    z-index: -2;
    background:
        radial-gradient(48% 42% at 62% 34%, rgba(139, 92, 246, 0.34), transparent 70%),
        radial-gradient(40% 36% at 24% 78%, rgba(88, 28, 173, 0.3), transparent 72%);
    filter: blur(8px);
    pointer-events: none;
}

/* More answers behind the one in front: the same question is asked again. */
.r-aeo-demo__frame {
    position: relative;
}

.r-aeo-demo__ghost {
    position: absolute;
    inset: 0;
    z-index: -1;
    border: 1px solid var(--aeo-line);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(42, 33, 61, 0.7), rgba(25, 19, 35, 0.5));
    transform-origin: 50% 100%;
}

.r-aeo-demo__ghost--near {
    transform: translate(10px, -11px) rotate(1.6deg);
    opacity: 0.7;
}

.r-aeo-demo__ghost--far {
    transform: translate(21px, -21px) rotate(3.4deg);
    opacity: 0.38;
}

.r-aeo-demo__panel {
    position: relative;
    border: 1px solid rgba(201, 184, 240, 0.24);
    border-radius: 18px;
    background: linear-gradient(180deg, #241c33 0%, #18121f 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.06) inset,
        0 34px 70px -34px rgba(0, 0, 0, 0.9),
        0 0 60px -18px rgba(139, 92, 246, 0.5);
    overflow: hidden;
}

/* While an assistant is working, light travels around the panel's edge. */
@property --aeo-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

.r-aeo-demo__edge {
    position: absolute;
    inset: -1px;
    z-index: 2;
    padding: 1.5px;
    border-radius: 19px;
    background: conic-gradient(from var(--aeo-angle), transparent 0 58%, #8b5cf6 72%, #f1eaff 82%, #8b5cf6 90%, transparent 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.r-aeo-demo.is-working .r-aeo-demo__edge {
    opacity: 1;
    animation: aeo-edge 2.4s linear infinite;
}

.r-aeo-demo__tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: 1px solid var(--aeo-line);
}

.r-aeo-demo__tab {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.7rem 0.5rem;
    font: 500 0.72rem/1 var(--v2-mono);
    letter-spacing: 0.06em;
    color: var(--aeo-soft);
    transition: color 0.3s ease, background-color 0.3s ease;
}

.r-aeo-demo__tab + .r-aeo-demo__tab {
    border-left: 1px solid var(--aeo-line);
}

.r-aeo-demo__tab::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(201, 184, 240, 0.28);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.r-aeo-demo__tab::after {
    content: "";
    position: absolute;
    inset: auto 0 -1px;
    height: 2px;
    background: linear-gradient(90deg, var(--aeo-violet), var(--aeo-violet-soft));
    transform: scaleX(0);
    transform-origin: 0 50%;
}

.r-aeo-demo__tab.is-active {
    background: rgba(139, 92, 246, 0.1);
    color: #f0edf5;
}

.r-aeo-demo__tab.is-active::before {
    background: var(--aeo-violet-soft);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.28), 0 0 12px rgba(139, 92, 246, 0.9);
}

.r-aeo-demo__tab.is-active::after {
    transform: scaleX(var(--aeo-progress, 0));
    transition: transform 0.7s ease;
}

.r-aeo-demo__tab.is-done::after {
    transform: scaleX(1);
}

.r-aeo-demo__thread {
    display: grid;
    gap: 0.8rem;
    padding: 0.95rem 1rem 1rem;
}

.r-aeo-demo__ask {
    justify-self: end;
    max-width: 88%;
    min-height: 2.35rem;
    margin: 0;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(139, 92, 246, 0.42);
    border-radius: 14px 14px 4px 14px;
    background: rgba(139, 92, 246, 0.2);
    font-size: 0.9rem;
    line-height: 1.4;
    color: #f4f0fb;
}

/* The whole question is always in the bubble, so it never changes size:
   typing moves the split between the written part and the unwritten part. */
.r-aeo-demo__rest {
    visibility: hidden;
}

.r-aeo-demo__ask.is-typing .r-aeo-demo__typed {
    box-shadow: 2px 0 0 var(--aeo-violet-soft);
    animation: aeo-caret 0.8s steps(1) infinite;
}

.r-aeo-demo__ask.is-sent {
    animation: aeo-sent 0.5s ease;
}

.r-aeo-demo__reply {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
}

.r-aeo-demo__spark {
    margin-top: 0.1rem;
    transform-origin: 50% 50%;
}

.r-aeo-demo__reply.is-thinking .r-aeo-demo__spark {
    animation: aeo-spark 1.1s cubic-bezier(0.5, 0, 0.3, 1) infinite;
}

/* The body keeps one height across answers, so the page below never moves:
   a longer answer uses the slack above the verdict. The script raises the
   minimum to the tallest answer it will show. */
.r-aeo-demo__body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
    min-height: 14.4rem;
}

.r-aeo-demo__list {
    position: relative;
}

/* Thinking: three lines of shimmer where the answer is about to land. */
.r-aeo-demo__thinking {
    position: absolute;
    inset: 0.2rem 0 auto;
    display: grid;
    gap: 0.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.r-aeo-demo__thinking i {
    height: 0.6rem;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(201, 184, 240, 0.1) 20%, rgba(201, 184, 240, 0.38) 50%, rgba(201, 184, 240, 0.1) 80%);
    background-size: 220% 100%;
    animation: aeo-shimmer 1.2s linear infinite;
}

.r-aeo-demo__thinking i:nth-child(2) { width: 82%; animation-delay: 0.12s; }
.r-aeo-demo__thinking i:nth-child(3) { width: 58%; animation-delay: 0.24s; }

.r-aeo-demo__reply.is-thinking .r-aeo-demo__thinking {
    opacity: 1;
}

.r-aeo-demo__intro {
    min-height: 1.4em;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #e9e4f3;
}

.r-aeo-demo__intro span {
    opacity: 0;
    transition: opacity 0.22s ease;
}

.r-aeo-demo__intro span.is-in {
    opacity: 1;
}

.r-aeo-demo__picks {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.r-aeo-demo__pick {
    display: grid;
    grid-template-columns: 1.35rem minmax(0, auto) minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
    min-height: 2.25rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--aeo-line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    font-size: 0.86rem;
    line-height: 1.25;
    color: #f0edf5;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease;
}

.r-aeo-demo__pick.is-in {
    opacity: 1;
    transform: none;
}

.r-aeo-demo__pick strong {
    font-weight: 600;
    white-space: nowrap;
}

.r-aeo-demo__rank {
    font: 500 0.7rem/1 var(--v2-mono);
    color: var(--aeo-soft);
}

.r-aeo-demo__detail {
    overflow: hidden;
    justify-self: end;
    max-width: 100%;
    font-size: 0.78rem;
    color: var(--aeo-soft);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* After the check: other businesses step back, the one we follow lights up. */
.r-aeo-demo__reply.is-checked .r-aeo-demo__pick.is-other,
.r-aeo-demo__pick.is-other.is-seen {
    opacity: 0.58;
}

.r-aeo-demo__reply.is-checked .r-aeo-demo__pick.is-you,
.r-aeo-demo__pick.is-you.is-seen {
    border-color: var(--aeo-violet);
    background: rgba(139, 92, 246, 0.2);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16), 0 0 26px -4px rgba(139, 92, 246, 0.75);
}

.r-aeo-demo__beam {
    position: absolute;
    inset: 0 -0.25rem auto;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, #e3d9ff 18%, #fff 50%, #e3d9ff 82%, transparent);
    box-shadow: 0 0 14px 2px rgba(201, 184, 240, 0.7);
    opacity: 0;
    pointer-events: none;
}

.r-aeo-demo__beam::after {
    content: "";
    position: absolute;
    inset: auto 0 100%;
    height: 2.4rem;
    background: linear-gradient(0deg, rgba(139, 92, 246, 0.26), transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}

.r-aeo-demo__beam.is-sweeping {
    animation: aeo-beam var(--aeo-sweep, 1s) cubic-bezier(0.45, 0, 0.3, 1) forwards;
}

.r-aeo-demo__sources {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 0.4rem;
    min-height: 1.45rem;
    margin: 0;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.r-aeo-demo__reply.is-answered .r-aeo-demo__sources {
    opacity: 1;
}

.r-aeo-demo__sources::before {
    content: "Sources";
    align-self: center;
    font: 500 0.64rem/1 var(--v2-mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--aeo-soft);
}

.r-aeo-demo__sources span {
    padding: 0.2rem 0.45rem;
    border: 1px solid var(--aeo-line);
    border-radius: 999px;
    font: 500 0.66rem/1.2 var(--v2-mono);
    color: #cfc6df;
}

.r-aeo-demo__verdict {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.55rem;
    min-height: 2.5rem;
    margin: auto 0 0;
    padding: 0.45rem 0.65rem;
    border: 1px dashed rgba(201, 184, 240, 0.3);
    border-radius: 10px;
    font-size: 0.86rem;
    line-height: 1.25;
    color: #f0edf5;
    opacity: 0;
    transform: translateY(6px) scale(0.985);
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2), border-color 0.3s ease, background-color 0.3s ease;
}

.r-aeo-demo__reply.is-checked .r-aeo-demo__verdict {
    opacity: 1;
    transform: none;
}

.r-aeo-demo__you {
    padding: 0.22rem 0.45rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.26);
    font: 500 0.62rem/1 var(--v2-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #e3d9ff;
}

.r-aeo-demo__verdict strong {
    font-weight: 600;
}

.r-aeo-demo__result {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    font-weight: 600;
}

.r-aeo-demo__result::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
}

.r-aeo-demo__verdict.is-miss {
    border-color: rgba(252, 211, 77, 0.5);
    background: rgba(252, 211, 77, 0.06);
}

.r-aeo-demo__verdict.is-miss .r-aeo-demo__result {
    color: var(--aeo-warn);
}

.r-aeo-demo__verdict.is-hit {
    border-style: solid;
    border-color: rgba(134, 239, 172, 0.5);
    background: rgba(134, 239, 172, 0.07);
}

.r-aeo-demo__verdict.is-hit .r-aeo-demo__result {
    color: var(--aeo-good);
}

.r-aeo-demo__tally {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1rem;
    border-top: 1px solid var(--aeo-line);
    background: rgba(12, 9, 19, 0.5);
    font: 500 0.72rem/1.3 var(--v2-mono);
    letter-spacing: 0.03em;
    color: #d9d1e8;
}

.r-aeo-demo__pips {
    display: inline-flex;
    gap: 0.35rem;
}

.r-aeo-demo__pips i {
    width: 10px;
    height: 10px;
    border: 1.5px solid rgba(201, 184, 240, 0.3);
    border-radius: 50%;
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.6);
}

.r-aeo-demo__pips i.is-hit {
    border-color: var(--aeo-good);
    background: var(--aeo-good);
    box-shadow: 0 0 10px rgba(134, 239, 172, 0.7);
}

.r-aeo-demo__pips i.is-miss {
    border-color: var(--aeo-warn);
}

.r-aeo-demo__pips i.is-pop {
    transform: scale(1.35);
}

.r-aeo-demo__caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 1.9rem;
    padding: 0.55rem 0.2rem 0;
    font: 500 0.66rem/1.3 var(--v2-mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a91ad;
}

.r-aeo-demo__pause {
    flex: 0 0 auto;
}

.r-aeo-demo__pause {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--aeo-line);
    border-radius: 999px;
    background: transparent;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    color: #cfc6df;
    cursor: pointer;
}

/* Keeps its place before the script shows it, so the caption never reflows. */
.r-aeo-demo__pause[hidden] {
    display: inline-block;
    visibility: hidden;
}

.r-aeo-demo__pause:hover {
    border-color: rgba(201, 184, 240, 0.5);
    color: #fff;
}

.r-aeo-demo__pause:focus-visible {
    outline: 2px solid var(--aeo-violet-soft);
    outline-offset: 2px;
}

/* ---- Motion ------------------------------------------------------------ */

@keyframes aeo-caret {
    50% { box-shadow: 2px 0 0 transparent; }
}

@keyframes aeo-sent {
    0% { transform: translateY(5px) scale(0.98); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.55); }
    100% { transform: none; box-shadow: 0 0 0 10px rgba(139, 92, 246, 0); }
}

@keyframes aeo-spark {
    0% { transform: rotate(0) scale(0.82); opacity: 0.7; }
    50% { transform: rotate(90deg) scale(1.12); opacity: 1; }
    100% { transform: rotate(180deg) scale(0.82); opacity: 0.7; }
}

@keyframes aeo-shimmer {
    from { background-position: 120% 0; }
    to { background-position: -100% 0; }
}

@keyframes aeo-beam {
    0% { transform: translateY(0); opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { transform: translateY(var(--aeo-travel, 7rem)); opacity: 0; }
}

@keyframes aeo-edge {
    to { --aeo-angle: 360deg; }
}

@keyframes aeo-float {
    from { translate: 0 0; }
    to { translate: 0 -7px; }
}

@media (prefers-reduced-motion: no-preference) {
    .r-aeo-demo {
        opacity: 0;
        transform: translateY(18px);
        animation: r-rise 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) 0.28s forwards;
    }

    .r-aeo-demo__ghost--near { animation: aeo-float 6s ease-in-out infinite alternate; }
    .r-aeo-demo__ghost--far { animation: aeo-float 8s ease-in-out -2s infinite alternate; }
}

.r-aeo-demo.is-paused *,
.r-aeo-demo.is-paused *::before {
    animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
    .r-aeo-demo *,
    .r-aeo-demo *::before,
    .r-aeo-demo *::after {
        animation: none !important;
        transition: none !important;
    }
}

/* ---- Small screens ----------------------------------------------------- */

@media (max-width: 979px) {
    .r-aeo-demo {
        justify-self: start;
        max-width: 30rem;
    }

    .r-aeo-demo::before {
        inset: -8% -6% -6%;
    }

    .r-aeo-demo__ghost {
        display: none;
    }
}

@media (max-width: 480px) {
    .r-aeo-demo__thread {
        padding: 0.8rem 0.8rem 0.85rem;
    }

    .r-aeo-demo__tab {
        font-size: 0.66rem;
        letter-spacing: 0.03em;
    }

    .r-aeo-demo__detail,
    .r-aeo-demo__sources {
        display: none;
    }

    .r-aeo-demo__body {
        min-height: 13.2rem;
    }

    .r-aeo-demo__pick {
        grid-template-columns: 1.35rem minmax(0, 1fr);
    }

    .r-aeo-demo__tally {
        padding-inline: 0.8rem;
        font-size: 0.68rem;
    }
}
