/* Apresentação dos cartões de métricas e da demonstração por etapas. */
#climaar-demonstracao {
    padding: 8px 16px 28px;
    background: #fff;
}

#climaar-demonstracao [hidden],
#climaar-demonstracao[hidden] {
    display: none;
}

.mokella-demo {
    --mokella-ink: #fff4ed;
    --mokella-accent: #efacba;
    padding: clamp(16px, 5vw, 32px);
    border: 1px solid #764753;
    border-radius: 28px;
    background: radial-gradient(ellipse at 14% 0, #6b3948, transparent 58%),
        linear-gradient(155deg, #442831, #2e1b22);
    box-shadow: 0 14px 40px #49232c28;
    color: var(--mokella-ink);
}

#climaar-demonstracao:has(.mokella-demo) { scroll-margin-top: 112px; }

@media (min-height: 610px) and (prefers-reduced-motion: no-preference) {
    html:has(.mokella-demo),
    body:has(.mokella-demo) { overflow-x: clip; }

    #climaar-demonstracao:has(.mokella-demo)::after {
        display: block;
        height: clamp(320px, 57svh, 520px);
        content: '';
    }

    .mokella-demo {
        position: sticky;
        top: 112px;
    }
}

.mokella-demo .climaar-demo__title {
    margin-bottom: 8px;
    font: 600 clamp(28px, 6vw, 43px)/1.05 Georgia, serif;
    color: inherit;
}

.climaar-demo__serve-instruction {
    margin: 0 0 15px;
    font-size: 14px;
    color: #f6cfd9;
}

.climaar-demo__serve-stage {
    position: relative;
    isolation: isolate;
    aspect-ratio: 5 / 4;
    width: min(100%, 520px, max(218px, calc(125svh - 440px)));
    margin: 0 auto 16px;
    overflow: hidden;
    border: 1px solid #f6ded1bb;
    border-radius: 17px;
    box-shadow: 0 7px 20px #160a1360;
    background:
        radial-gradient(ellipse at 20% 6%, #fff8ea, transparent 70%),
        linear-gradient(140deg, #f6e1d7 14%, #d8a8b8 90%);
}

.climaar-demo__serve-stage::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    box-shadow: inset 0 0 34px #562c3f26, inset 0 1px #fff8ee90;
    border-radius: inherit;
    content: '';
}

.climaar-demo__serve-scene {
    position: absolute;
    inset: 0;
    isolation: isolate;
    background: #f7ddce url('img/mokella-bancada.webp') center / 100% 100% no-repeat;
    transform: translate(var(--serve-pan-x, 0%), var(--serve-pan-y, 0%)) scale(var(--serve-camera, 1));
    transform-origin: 24% 30%;
}

.climaar-demo__serve-scene::before {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 23% 67%, #fff2dd30, transparent 65%);
    opacity: var(--serve-focus, 0);
    content: '';
}

.climaar-demo__serve-contact-shadow {
    position: absolute;
    left: 52%;
    bottom: 7%;
    width: 43%;
    height: 7%;
    border-radius: 50%;
    transform: translateX(calc(var(--serve-focus, 0) * -8%)) scaleX(calc(1 + var(--serve-lift, 0) * .09));
    background: radial-gradient(ellipse, #69394175 0%, transparent 72%);
}

.climaar-demo__serve-base,
.climaar-demo__serve-pot {
    position: absolute;
    left: 42%;
    bottom: 10%;
    width: 63%;
    height: auto;
    aspect-ratio: 1;
    mix-blend-mode: multiply;
}

.climaar-demo__serve-base {
    clip-path: polygon(21% 86%, 22.5% 81.5%, 32% 84%, 46% 85%, 60% 83.5%, 63.5% 81.5%, 69% 87%, 70% 100%, 20% 100%);
}

.climaar-demo__serve-pot {
    transform: translate(var(--pot-x, 0%), var(--pot-y, 0%)) rotate(var(--pot-tilt, 0deg));
    transform-origin: 46% 32%;
    user-select: none;
}

.climaar-demo__serve-body {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    clip-path: polygon(
        18% 16.5%, 19.5% 13.5%, 31% 9.4%, 38% 7%, 40% 7%,
        38.8% 4%, 38.6% 0, 46.2% 0, 46% 4%, 44.4% 7%,
        53% 7.5%, 60% 10.6%, 65% 11.8%, 69% 10.2%, 74% 9.6%,
        79% 11.3%, 81.7% 14.5%, 82% 19.5%, 80% 24.5%, 76% 30%,
        72% 36.5%, 70.2% 41.4%, 67.8% 42.4%, 65.5% 40.5%, 65.8% 37%,
        68.2% 33%, 69.5% 28.3%, 73.6% 24.5%, 74.7% 20.1%, 73.5% 17.3%,
        70% 15.8%, 67% 17%, 63.5% 20.1%, 59.5% 20.6%, 56% 41.5%,
        55% 45.3%, 57% 47.8%, 59% 57%, 59.5% 68%, 61.3% 72%,
        62.5% 77%, 62.2% 80.6%, 60% 82.5%, 54.5% 84.2%, 46% 85%,
        35% 84.5%, 27% 83.5%, 24% 81.5%, 24% 77%, 25.5% 71%,
        26.8% 68%, 27.3% 57%, 29% 48.5%, 30% 45.5%, 28.7% 43.5%,
        27% 36%, 26% 28.5%, 24% 24%, 22% 20%, 20% 16.5%
    );
}

.climaar-demo__serve-cord {
    position: absolute;
    left: 78%;
    bottom: 13%;
    width: 26%;
    height: 13%;
    border: solid #806773;
    border-width: 0 0 2px;
    border-radius: 0 0 50% 42%;
    transform: rotate(-9deg);
}

.climaar-demo__serve-cup {
    position: absolute;
    left: 23.1%;
    top: 67.15%;
    width: 15.8%;
    height: 2.8%;
    transform: translate(-50%, -50%);
}

.climaar-demo__serve-coffee {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 50%;
}

.climaar-demo__serve-coffee::after {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 31% 28%, #b7794f, #6c3620 60%, #432015);
    opacity: var(--serve-fill, 0);
    transform: translateY(calc((1 - var(--serve-fill, 0)) * 82%));
    content: '';
}

.climaar-demo__serve-stream {
    position: absolute;
    top: var(--serve-spout-y);
    left: var(--serve-spout-x);
    height: calc(67.5% - var(--serve-spout-y));
    width: clamp(3px, 1.2vw, 6px);
    transform-origin: top;
    transform: translate(-50%, calc(var(--serve-drain, 0) * 100%)) scaleY(var(--serve-flow, 0));
    opacity: min(1, calc(var(--serve-flow, 0) * 4));
    border-radius: 35% 90% 45% 60%;
    background: linear-gradient(90deg, #683821, #c58b5d 45%, #743b22 85%);
}

.climaar-demo__serve-ripple {
    position: absolute;
    inset: 22% 31% auto;
    height: 56%;
    border: 1px solid #f4c796;
    border-radius: 50%;
    box-shadow: 0 0 3px #f4c79691;
    transform: scale(var(--serve-ripple-scale, .5));
    opacity: var(--serve-ripple, 0);
}

.climaar-demo__serve-splash {
    position: absolute;
    left: 23.1%;
    bottom: 33%;
    width: 16%;
    height: 9%;
    transform: translate(-50%, calc((1 - var(--serve-splash, 0)) * 60%));
    opacity: var(--serve-splash, 0);
}

.climaar-demo__serve-splash i {
    position: absolute;
    left: 23%;
    bottom: 20%;
    width: 4%;
    height: 20%;
    border-radius: 80%;
    background: #ae693e;
    transform: rotate(-43deg);
}

.climaar-demo__serve-splash i:nth-child(2) { left: 46%; bottom: 58%; transform: rotate(10deg); }
.climaar-demo__serve-splash i:nth-child(3) { left: 70%; bottom: 31%; transform: rotate(42deg); }

.climaar-demo__serve-steam {
    position: absolute;
    left: 23.1%;
    bottom: 33%;
    display: flex;
    align-items: end;
    justify-content: space-around;
    width: 12%;
    height: 18%;
    opacity: calc(var(--serve-steam, 0) * .72);
    transform: translate(-50%, var(--serve-steam-rise, 0));
    pointer-events: none;
}

.climaar-demo__serve-steam i {
    width: 20%;
    height: 75%;
    border-radius: 80%;
    background: linear-gradient(15deg, #fff0, #fffdf9 40%, #fff0);
    filter: blur(2px);
    transform: rotate(15deg);
}

.climaar-demo__serve-steam i:nth-child(2) { height: 98%; transform: rotate(-11deg); }
.climaar-demo__serve-steam i:nth-child(3) { height: 57%; transform: rotate(20deg); }

@media (prefers-reduced-motion: reduce) {
    .climaar-demo__serve-scene { transform: none; }
}

.climaar-demo__serve-progress {
    height: 3px;
    max-width: 110px;
    margin: 0 auto 12px;
    overflow: hidden;
    border-radius: 99px;
    background: #f9c5d449;
}

.climaar-demo__serve-progress::before {
    display: block;
    height: 100%;
    background: var(--mokella-accent);
    transform: scaleX(var(--serve-progress, 0));
    transform-origin: left;
    content: '';
}

.climaar-demo__serve-summary {
    display: grid;
    gap: 3px;
    min-height: 61px;
    font-size: 14px;
    line-height: 1.4;
}

.climaar-demo__serve-summary strong { font-size: 16px; }

.climaar-demo__inner {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.climaar-demo__title {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: #000;
    letter-spacing: -0.01em;
}

.climaar-demo__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.climaar-demo__card {
    --demo-color: #1f7ae0;
    --demo-soft: #eaf3fd;
    background: var(--demo-soft);
    border-radius: 16px;
    padding: 16px 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.climaar-demo__card--laranja {
    --demo-color: #e8590c;
    --demo-soft: #fff1e8;
}

.climaar-demo__card--neutro {
    --demo-color: #36565f;
    --demo-soft: #eef4f5;
}

.climaar-demo__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    color: var(--demo-color);
    display: grid;
    place-items: center;
}

.climaar-demo__icon[data-icone='neutro']::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid currentColor;
    box-shadow: inset 0 0 0 3px #fff;
    background: currentColor;
}

#climaar-demonstracao.is-animating .climaar-demo__icon[data-icone='frio'] svg {
    animation: climaar-demo-spin 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

#climaar-demonstracao.is-animating .climaar-demo__icon[data-icone='quente'] svg {
    animation: climaar-demo-flicker 0.8s ease-in-out 2;
    transform-origin: 50% 90%;
}

#climaar-demonstracao.is-done .climaar-demo__icon {
    animation: climaar-demo-pop 0.35s ease-out;
}

.climaar-demo__label {
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #5c6375;
    overflow-wrap: anywhere;
}

.climaar-demo__value {
    margin: 4px 0 0;
    min-width: 0;
    max-width: 100%;
    font-size: clamp(30px, 8.6vw, 38px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: var(--demo-color);
    overflow-wrap: anywhere;
}

.climaar-demo__num {
    font-variant-numeric: tabular-nums;
    display: inline-block;
    max-width: 100%;
    min-width: 2ch;
    text-align: right;
}

.climaar-demo__unit {
    font-size: 0.6em;
    vertical-align: 0.55em;
    margin-left: 1px;
}

.climaar-demo__bar {
    width: 100%;
    max-width: 120px;
    height: 6px;
    margin-top: 12px;
    border-radius: 999px;
    background: #fff;
    overflow: hidden;
}

.climaar-demo__bar-fill {
    display: block;
    height: 100%;
    width: var(--demo-fill, 100%);
    border-radius: inherit;
    background: var(--demo-color);
}

#climaar-demonstracao.is-animating .climaar-demo__bar-fill {
    animation: climaar-demo-fill 1.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.climaar-demo__detail {
    margin: 10px 0 0;
    color: #5c6375;
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.climaar-demo__sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.climaar-demo__inner--steps {
    max-width: 480px;
    --steps-accent: var(--theme-accent-dark, #174f88);
}

.climaar-demo__inner--steps .climaar-demo__title {
    margin-bottom: 16px;
    color: #182334;
    font-size: clamp(18px, 4.8vw, 23px);
    line-height: 1.25;
    letter-spacing: -0.025em;
    text-wrap: balance;
}

.climaar-demo__tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    margin-bottom: 14px;
    padding: 4px;
    border: 1px solid #e8ecf1;
    border-radius: 14px;
    background: #f3f5f8;
}

.climaar-demo__tab {
    min-height: 44px;
    flex: 1 1 94px;
    padding: 7px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: #4b596b;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.climaar-demo__tab[aria-selected='true'] {
    border-color: #e6ebf2;
    background: #fff;
    color: var(--steps-accent);
    box-shadow: 0 1px 3px rgb(24 35 52 / 10%);
}

.climaar-demo__tab:focus-visible,
.climaar-demo__panel:focus-visible {
    outline: 2px solid var(--steps-accent);
    outline-offset: 2px;
}

.climaar-demo__panel {
    overflow: hidden;
    border: 1px solid #e8ecf1;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgb(24 35 52 / 6%);
    color: #182334;
    text-align: left;
    overflow-wrap: anywhere;
}

.climaar-demo__panel:not([hidden]) {
    animation: climaar-demo-arrive 180ms ease-out;
}

.climaar-demo__panel-copy {
    padding: 15px clamp(14px, 4vw, 22px) 17px;
}

.climaar-demo__panel h3 {
    margin: 0;
    font-size: clamp(16px, 4vw, 19px);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.climaar-demo__panel .climaar-demo__detail {
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.5;
}

.climaar-demo__panel img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #f3f5f8;
}

.climaar-demo__inner--cutouts .climaar-demo__tabs {
    background: #f5f7fa;
}

.climaar-demo__inner--cutouts .climaar-demo__tab {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
    padding: 4px 8px;
}

.climaar-demo__tab img {
    width: 36px;
    height: 38px;
    flex: none;
    object-fit: contain;
}

.climaar-demo__inner--cutouts .climaar-demo__panel img {
    aspect-ratio: 1.12;
    box-sizing: border-box;
    padding: 10px 12px 38px;
    background: transparent;
}

.climaar-demo__stage {
    position: relative;
    inline-size: 100%;
    min-inline-size: 0;
    background: radial-gradient(ellipse at 50% 40%, #fff 24%, #f4f7fa 77%, #eef2f7 100%);
    touch-action: pan-y pinch-zoom;
    user-select: none;
    cursor: grab;
}

.climaar-demo__stage:active { cursor: grabbing; }

.climaar-demo__swipe-cue {
    position: absolute;
    inset: auto 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #4b596b;
    font-size: 11px;
    font-weight: 600;
    pointer-events: none;
}

.climaar-demo__swipe-cue::before { content: '↔'; font-size: 15px; }

.climaar-demo__panel:not([hidden]) .climaar-demo__stage img {
    transform: translateX(var(--step-drag, 0));
    animation: climaar-demo-swipe-in 280ms cubic-bezier(.22, .73, .35, 1);
}

.climaar-demo__panel:not([hidden]) .climaar-demo__stage:active img { animation: none; }

@keyframes climaar-demo-swipe-in {
    from { opacity: .25; transform: translateX(var(--step-entry, 0)); }
    to { opacity: 1; transform: translateX(0); }
}

.climaar-demo__inner--cutouts .climaar-demo__panel-copy {
    border-top: 1px solid #ebeff4;
}

@keyframes climaar-demo-spin {
    from { transform: rotate(-180deg) scale(0.6); }
    to { transform: rotate(0) scale(1); }
}

@keyframes climaar-demo-flicker {
    0%, 100% { transform: scale(1) rotate(0); }
    30% { transform: scale(1.15, 0.92) rotate(-6deg); }
    60% { transform: scale(0.94, 1.12) rotate(5deg); }
}

@keyframes climaar-demo-pop {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes climaar-demo-fill {
    from { width: 0; }
}

@keyframes climaar-demo-arrive {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    #climaar-demonstracao .climaar-demo__stage img { transform: none; }

    #climaar-demonstracao .climaar-demo__icon,
    #climaar-demonstracao .climaar-demo__icon svg,
    #climaar-demonstracao .climaar-demo__bar-fill,
    #climaar-demonstracao .climaar-demo__panel,
    #climaar-demonstracao .climaar-demo__stage img {
        animation: none !important;
    }
}
