/* Homepage carousel: full-bleed media, quiet controls and optional captions. */
.hero {
    --hero-edge: clamp(18px, 2vw, 40px);
    --hero-bottom: max(22px, 4.5svh, env(safe-area-inset-bottom));
    min-height: 0;
    isolation: isolate;
}
.hero .hero-slide,
.hero .hero-slide.active {
    transform: none;
    transition: opacity .9s ease;
}
.hero .hero-slide:not(.active) { pointer-events: none; }
.hero .hero-slide::after {
    pointer-events: none;
    background: linear-gradient(180deg, rgba(15, 28, 39, .24), transparent 24%, transparent 72%, rgba(15, 28, 39, .16));
}
.hero .hero-slide.has-caption::after {
    background: linear-gradient(90deg, rgba(15, 28, 39, .28), rgba(15, 28, 39, .08) 48%, transparent 78%),
                linear-gradient(180deg, rgba(15, 28, 39, .24), transparent 24%, transparent 72%, rgba(15, 28, 39, .16));
}
.hero .hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity .35s ease;
}
.hero .video-ready .hero-video { opacity: 1; }
.hero [hidden] { display: none !important; }

.hero .hero-content {
    --caption-inset: max(8.333vw, calc(var(--hero-edge) + 68px));
    left: var(--caption-inset);
    right: var(--caption-inset);
    top: calc(var(--header-h) + 32px);
    bottom: calc(var(--hero-bottom) + 64px);
    max-width: 820px;
    padding: 0;
    transform: none;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    overflow-wrap: anywhere;
}
.hero .hero-content > * { flex-shrink: 0; max-width: 100%; }
/* Alignment follows the banner order, not whichever slide is currently active. */
.hero .hero-slide-centered .hero-content {
    max-width: none;
    align-items: center;
    text-align: center;
}
.hero .hero-slide-centered .hero-content > * { max-width: min(100%, 820px); }
.hero .hero-slide-centered.has-caption::after {
    background: radial-gradient(ellipse at center, rgba(15, 28, 39, .2), transparent 75%),
                linear-gradient(180deg, rgba(15, 28, 39, .24), transparent 24%, transparent 72%, rgba(15, 28, 39, .16));
}
.hero .hero-eyebrow { display: none; }
.hero .hero-content h1 {
    font-family: var(--font-body);
    font-size: clamp(30px, min(3.4vw, 7svh), 56px);
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: .015em;
    color: #fff;
    text-shadow: 0 1px 10px rgba(15, 28, 39, .16);
    text-wrap: balance;
}
.hero .hero-sub {
    max-width: 34em;
    margin-top: clamp(10px, 1.6svh, 16px);
    font-size: clamp(14px, 1.05vw, 17px);
    line-height: 1.55;
    letter-spacing: .025em;
    color: rgba(255, 255, 255, .8);
    text-shadow: 0 1px 8px rgba(15, 28, 39, .16);
    white-space: pre-line;
}
.hero .hero-content .hero-cta {
    gap: 20px;
    min-height: 48px;
    margin-top: clamp(20px, 3svh, 30px);
    padding: 5px 6px 5px 22px;
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: 999px;
    background: linear-gradient(135deg, #fff, #eef0ff);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: #303447;
    box-shadow: inset 0 1px 0 #fff, 0 4px 16px rgba(15, 28, 39, .1);
    font-size: 13px;
    line-height: 1.5;
    letter-spacing: .04em;
    text-indent: 0;
    white-space: normal;
    transition: background .25s, border-color .25s;
}
.hero .hero-cta > span:first-child { min-width: 0; }
.hero .hero-cta-icon {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #607bed, #4563dc);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, .35);
}
.hero .hero-cta-icon svg { width: 18px; height: 18px; }
.hero .hero-content .hero-cta:hover {
    background: #fff;
    border-color: #fff;
    transform: none;
}
.hero svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

.hero .hero-arrow {
    width: 44px;
    height: 60px;
    border: 1px solid rgba(255, 255, 255, .7);
    border-radius: 999px;
    background: linear-gradient(145deg, rgba(255, 255, 255, .7), rgba(231, 239, 249, .3));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--c-primary-deep);
    opacity: .75;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 4px 20px rgba(15, 28, 39, .06);
    transition: opacity .3s, background .3s, transform .3s;
}
.hero .hero-arrow.prev { left: var(--hero-edge); }
.hero .hero-arrow.next { right: var(--hero-edge); }
.hero .hero-arrow svg { width: 21px; height: 21px; }
.hero .hero-arrow:hover { background: rgba(255, 255, 255, .9); opacity: 1; transform: translateY(-50%); }

.hero .hero-dots {
    left: 50%;
    bottom: var(--hero-bottom);
    transform: translateX(-50%);
    max-width: calc(100% - 160px);
    flex-wrap: wrap;
    justify-content: center;
    gap: 0;
}
.hero .hero-dots button,
.hero .hero-dots button.active {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
}
.hero .hero-dots button::before {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .48);
    box-shadow: 0 1px 5px rgba(15, 28, 39, .12);
    transition: width .3s ease, background .3s ease;
}
.hero .hero-dots button.active::before { width: 24px; background: #fff; }
.hero .hero-dots button:hover::before { background: #fff; }
.hero .hero-playback {
    position: absolute;
    z-index: 5;
    right: var(--hero-edge);
    bottom: var(--hero-bottom);
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, .48);
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    font-size: 0;
    cursor: pointer;
    transition: background .25s;
}
.hero .hero-playback::before {
    content: "";
    width: 10px;
    height: 12px;
    border-inline: 3px solid currentColor;
}
.hero .hero-playback[aria-label="播放轮播"]::before {
    width: 0;
    height: 0;
    margin-left: 3px;
    border: 6px solid transparent;
    border-right: 0;
    border-left: 9px solid currentColor;
}
.hero .hero-playback:hover { background: rgba(255, 255, 255, .26); }
.hero button:focus-visible,
.hero a:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

/* Keep edge controls quiet until the carousel is hovered or keyboard focused. */
@media (hover: hover) and (pointer: fine) {
    .hero .hero-arrow { opacity: 0; }
    .hero:hover .hero-arrow,
    .hero:focus-within .hero-arrow { opacity: 1; }
}
@media (max-width: 900px) {
    .hero { --hero-edge: 24px; }
    .hero .hero-content { --caption-inset: 6vw; max-width: none; }
    .hero .hero-content h1 { font-size: clamp(30px, min(4.8vw, 6.5svh), 44px); }
    .hero .hero-sub { font-size: clamp(14px, 1.8vw, 16px); }
}
@media (max-width: 600px) {
    .hero .hero-content { --caption-inset: 24px; }
    .hero .hero-content h1 { font-size: clamp(28px, 8vw, 36px); line-height: 1.3; }
    .hero .hero-content .hero-cta { margin-top: 24px; }
}
@media (max-height: 500px) {
    .hero { --hero-bottom: max(12px, env(safe-area-inset-bottom)); }
    .hero .hero-content { top: calc(var(--header-h) + 14px); bottom: 70px; }
    .hero .hero-content h1 { font-size: clamp(26px, 7svh, 34px); }
    .hero .hero-sub { font-size: 14px; line-height: 1.4; margin-top: 10px; }
    .hero .hero-content .hero-cta { min-height: 44px; margin-top: 16px; padding-block: 3px; }
}
@media (prefers-reduced-motion: reduce) {
    .hero .hero-slide, .hero .hero-slide.active, .hero .hero-video, .hero .hero-arrow,
    .hero .hero-content .hero-cta, .hero .hero-cta svg,
    .hero .hero-dots button::before { transition: none; }
}
