/* R0 — The original HTML panel stays below the laptop's cutout, then
   emerges into a reserved search position. No fixed overlay, no scroll lock. */
.landing-page .hero.has-hero-exit {
    overflow: visible;
    overflow-x: clip;
    z-index: 2;
}
.has-hero-exit .hero-scene { overflow: visible; }
.has-hero-exit .scene-background,
.has-hero-exit .hero-mobile-backdrop { opacity: var(--exit-backdrop-opacity, 1); }
/* Both copies of the desktop photograph receive the same subtle retreat.
   Filtering instead of fading keeps their pixels identical at the desk edge. */
@media (min-width: 981px) {
    .has-hero-exit .scene-background { opacity: 1; filter: saturate(var(--exit-backdrop-saturation, 1)); }
}
.scene-desk-occlusion {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}
.scene-desk-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
    filter: saturate(var(--exit-backdrop-saturation, 1));
}
.scene-desk-image.scene-day { clip-path: var(--desk-clip-day, polygon(0 90%, 100% 90%, 100% 100%, 0 100%)); }
.scene-desk-image.scene-night { clip-path: var(--desk-clip-night, polygon(0 90%, 100% 90%, 100% 100%, 0 100%)); }
.hero-enter .scene-desk-occlusion { animation: heroFade 1s both; }
@media (max-width: 980px) { .scene-desk-occlusion { display: none; } }
@media (prefers-reduced-motion: reduce) { .hero-enter .scene-desk-occlusion { animation: none; } }
.scene-mobile-desk-occlusion { display: none; }
@media (max-width: 980px) {
    .has-hero-exit .hero-mobile-backdrop {
        opacity: 1;
    }
    .scene-mobile-desk-occlusion {
        display: block;
        position: absolute;
        z-index: 2;
        left: var(--mobile-desk-left, 0px);
        top: var(--mobile-desk-top, 0px);
        width: var(--mobile-desk-width, 0px);
        height: var(--mobile-desk-height, 0px);
        pointer-events: none;
    }
    .scene-mobile-desk-image {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center bottom;
        clip-path: polygon(0 var(--mobile-desk-edge, 86%), 100% var(--mobile-desk-edge, 86%), 100% 100%, 0 100%);
    }
    .hero-enter .scene-mobile-desk-occlusion { animation: heroFade 1s both; }
}
@media (prefers-reduced-motion: reduce) { .hero-enter .scene-mobile-desk-occlusion { animation: none; } }
.has-hero-exit .shortcut-card { transform-origin: top left; }
.has-hero-exit .shortcut-card > div:last-of-type { margin-bottom: 0; }
@media (max-width: 360px) {
    .has-hero-exit .shortcut-card > div { grid-template-columns: 46% minmax(0, 1fr); }
    .has-hero-exit .shortcut-card > div span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
.has-hero-exit.is-exiting .shortcut-card {
    /* An almost opaque travelling surface does not need to resample the
       large photograph through a blur on every animation frame. */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.hero-exit-morph-icon {
    position: absolute;
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    opacity: 0;
    transform-origin: top left;
}

.hero-exit {
    position: relative;
    z-index: 1;
    padding: 80px 24px 76px;
    background: var(--bg-body);
    isolation: isolate;
}
.hero-exit::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 52% 0%, #efcae859, transparent 67%),
        radial-gradient(ellipse at 35% 0%, #d5cbf84a, transparent 58%);
}
.hero-exit-inner { max-width: 660px; margin-inline: auto; padding-top: 26px; }
.hero-exit-heading {
    margin: 0 0 26px;
    text-align: center;
    font-size: clamp(23px, 2.6vw, 36px);
    font-weight: 600;
    letter-spacing: -.04em;
    line-height: 1.2;
    text-wrap: balance;
}
.hero-exit-form { margin: 0; }
.hero-exit-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    height: 72px;
    padding-inline: 24px 18px;
    border: 1px solid #dfdce9;
    border-radius: 18px;
    background: #fffffff0;
    color: #173264;
    box-shadow: 0 12px 32px #42236512, 0 2px 5px #42236504;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.hero-exit-field:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft), 0 12px 32px #42236512;
}
.hero-exit-search-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    opacity: .72;
}
.hero-exit-field input {
    position: relative;
    z-index: 1;
    min-width: 0;
    flex: 1;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    outline: none;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 18px;
    text-overflow: ellipsis;
    caret-color: var(--accent);
}
.hero-exit-field input::placeholder { color: var(--text-secondary); opacity: 1; }
.hero-exit-example {
    display: none;
    position: absolute;
    left: 63px;
    right: 52px;
    overflow: hidden;
    white-space: nowrap;
    pointer-events: none;
    color: var(--text-secondary);
    font-size: 18px;
}
.hero-exit-example i {
    display: inline-block;
    width: 1.5px;
    height: 1.05em;
    margin-left: 3px;
    background: var(--accent);
    vertical-align: -.13em;
    animation: exitCaret 1s step-end 4;
}
@keyframes exitCaret { 50% { opacity: 0; } }
.hero-exit.is-example .hero-exit-example { display: block; }
.hero-exit.is-example-done .hero-exit-example i { opacity: 0; animation: none; }
.hero-exit.is-example input::placeholder { color: transparent; }
.hero-exit-enter {
    display: grid;
    place-items: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-tertiary);
    font-size: 17px;
}
.hero-exit-hint {
    margin: 15px 0 0;
    color: var(--text-secondary);
    text-align: center;
    font-size: 12px;
    line-height: 1.5;
}
/* Progressive enhancement: without JS the form stays in normal flow.
   Scroll progress remains the sole visual owner, even after input focus. */
.hero-exit.is-enhanced .hero-exit-heading {
    opacity: var(--exit-copy, 0);
    transform: translateY(calc((1 - var(--exit-copy, 0)) * 8px));
    transition: opacity 280ms ease, transform 280ms ease;
}
.hero-exit.is-enhanced .hero-exit-field { opacity: var(--exit-field, 0); }
.hero-exit.is-enhanced .hero-exit-hint { opacity: var(--exit-copy, 0); }
.hero-exit.is-enhanced:not(.is-ready) .hero-exit-field { pointer-events: none; }
.hero-exit.is-enhanced.is-focus-reveal:focus-within .hero-exit-heading,
.hero-exit.is-enhanced.is-focus-reveal:focus-within .hero-exit-field,
.hero-exit.is-enhanced.is-focus-reveal:focus-within .hero-exit-hint { opacity: 1; transform: none; }
.hero-exit.is-enhanced.is-focus-reveal:focus-within .hero-exit-field { pointer-events: auto; }

[data-theme="dark"] .hero-exit::before {
    background: radial-gradient(ellipse at 52% 0%, #7e376d22, transparent 65%), radial-gradient(ellipse at 35% 0%, #6a4c9f20, transparent 58%);
}
[data-theme="dark"] .hero-exit-field {
    background: #141c32ef;
    border-color: #b798e647;
    color: #e3eaff;
    box-shadow: 0 14px 35px #05091655, 0 0 24px #ce5dbb0d;
}
[data-theme="dark"] .hero-exit-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
@media (max-width: 980px) {
    .hero-exit { padding: 56px 24px 60px; }
    .hero-exit-heading { font-size: clamp(23px, 3.8vw, 30px); margin-bottom: 24px; }
    .hero-exit-field { height: 64px; padding-inline: 18px 14px; gap: 12px; border-radius: 16px; }
    .hero-exit-field input, .hero-exit-example { font-size: 16px; }
    .hero-exit-example { left: 53px; right: 24px; }
    .hero-exit-enter { display: none; }
}
@media (max-width: 360px) {
    .hero-exit { padding-inline: 18px; }
    .hero-exit-field { padding-inline: 14px; gap: 10px; }
    .hero-exit-example { left: 47px; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-exit.is-enhanced .hero-exit-heading, .hero-exit-field { transition: none; transform: none !important; }
    .hero-exit-example i { animation: none; }
}
