/* Hero homepage animation: shared stage, controls and lab chrome.
 * Variant styles live in v-<id>.css and are scoped under .ha-v-<id>. */

.ha {
    --ha-teal: #4CB5AE;
    --ha-teal-dark: #3A9A94;
    --ha-teal-light: #E8F6F5;
    --ha-ink: #1B8980;
    --ha-ink-dark: #127C74;
    --ha-paper: #FDFEFD;
    --ha-navy: #1A2B3C;
    --ha-coral: #F2A09A;
    --ha-coral-light: #FDF5F4;
    --ha-red: #E85D4C;
    --ha-serif: 'DM Serif Display', Georgia, serif;
    --ha-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    position: relative;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1900 / 1688;
    isolation: isolate;
}

@media (min-width: 768px) {
    .ha {
        max-width: 560px;
    }
}

.ha .ha-base {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
}

/* The overlay layers are the size containers (1cqw = 1% of the box width,
 * 1cqh = 1% of its height). Containment stays off .ha itself so the box keeps
 * the illustration's intrinsic width inside shrink-to-fit parents (the stacked
 * mobile hero centers .hero-illustration in a column flexbox). */
.ha-back,
.ha-stage {
    position: absolute;
    inset: 0;
    container-type: size;
    pointer-events: none;
    visibility: hidden;
}

.ha-back {
    z-index: 0;
}

.ha-stage {
    z-index: 2;
    font-family: var(--ha-sans);
    color: var(--ha-ink);
    -webkit-font-smoothing: antialiased;
}

.ha--playing .ha-stage,
.ha--paused .ha-stage,
.ha--playing .ha-back,
.ha--paused .ha-back {
    visibility: visible;
}

.ha .ha-stage img,
.ha .ha-back img {
    max-width: none;
    filter: none;
}

/* Shared helpers for variants */
.ha-fill {
    position: absolute;
    inset: 0;
}

.ha-abs {
    position: absolute;
}

.ha-icon {
    display: block;
    width: 1em;
    height: 1em;
    overflow: visible;
}

.ha-draw path,
.ha-draw [pathLength] {
    stroke-dasharray: 1 2;
    stroke-dashoffset: 1.02;
}

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

/* Pause / play / replay control */
.ha-ui {
    position: absolute;
    right: 3%;
    bottom: 3.4%;
    z-index: 6;
}

.ha-ctl {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px 0 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 6px 18px rgba(18, 60, 58, 0.12);
    color: #fff;
    font: 600 12px/1 var(--ha-sans);
    letter-spacing: 0.02em;
    cursor: pointer;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.35s ease, transform 0.35s ease, background 0.2s ease;
}

.ha-ctl svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ha--playing .ha-ctl svg path,
.ha--done .ha-ctl svg path {
    fill: none;
}

.ha--ready .ha-ctl svg path,
.ha--paused .ha-ctl svg path {
    fill: currentColor;
}

.ha--playing .ha-ctl,
.ha--paused .ha-ctl,
.ha--done .ha-ctl,
.ha--ready .ha-ctl {
    opacity: 0.72;
    transform: none;
}

.ha:hover .ha-ctl,
.ha-ctl:focus-visible {
    opacity: 1;
}

.ha-ctl:hover {
    background: rgba(255, 255, 255, 0.28);
}

.ha-ctl:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.ha--idle .ha-ui {
    display: none;
}

/* Lab bar (preview only: shown with ?hero=<id>) */
.ha-lab {
    position: fixed;
    left: 50%;
    bottom: 14px;
    z-index: 10001;
    width: min(980px, calc(100vw - 24px));
    transform: translateX(-50%);
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(18, 32, 44, 0.86);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    color: #fff;
    font: 500 12px/1.2 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.ha-lab--hidden {
    display: none;
}

.ha-lab-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.ha-lab-row + .ha-lab-row {
    margin-top: 8px;
}

.ha-lab-title {
    margin-right: 4px;
    color: #9fe3dd;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 10.5px;
}

.ha-lab-variants {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.ha-lab-chip,
.ha-lab-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.ha-lab-chip:hover,
.ha-lab-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.ha-lab-chip.is-active {
    background: #4CB5AE;
    color: #fff;
}

.ha-lab-num {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    font-size: 10px;
    font-weight: 700;
}

.ha-lab-link {
    color: #9fe3dd;
    font-weight: 600;
    text-decoration: none;
}

.ha-lab-link:hover {
    text-decoration: underline;
}

.ha-lab-scrub {
    flex: 1;
    min-width: 160px;
    accent-color: #4CB5AE;
}

.ha-lab-time {
    min-width: 92px;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.75);
}

.ha-lab-scene {
    min-width: 150px;
    color: #9fe3dd;
    font-weight: 600;
}

@media (max-width: 640px) {
    .ha-lab-name {
        display: none;
    }

    .ha-lab-scene {
        min-width: 0;
    }
}
