.catalog-home-page {
    background: radial-gradient(ellipse at 30% 60px, #d8ebf4, transparent 66%), #f2f8fc;
}

.catalog-home-page .catalog-shell { width: min(1440px, calc(100% - clamp(28px, 5.1vw, 80px))); }
.catalog-home-page .catalog-header { background: #f5fafd; }
.catalog-home-page .catalog-header-inner { min-height: 62px; gap: clamp(14px, 2.8vw, 40px); }
.catalog-home-page .catalog-brand img { width: 126px; margin-inline-start: -14px; }
.catalog-home-page .catalog-nav-link.is-current { color: var(--teal); background: #d7edf2; }
.catalog-home-page .catalog-nav-link.is-current::after { bottom: -5px; }
.catalog-home-page .catalog-search { flex-basis: 298px; background: #e4eef6; }

.home-hero {
    --hero-focus: #9bf4ed;
    --hero-art: none;
    --hero-base: #184656;
    --hero-fade: #8ebdc8;
    --hero-mist: #80adb9c7;
    --hero-mobile-position: 88%;
    position: relative;
    margin-top: 16px;
    padding-bottom: 12px;
    border-radius: 22px;
    color: white;
    background:
        linear-gradient(90deg, #0b394bbf, #0b35458c 38%, transparent 70%),
        var(--hero-art) right center / cover no-repeat var(--hero-base);
}

.home-hero:has(#home-novel-5:not([hidden])) {
    --hero-art: url("../images/home-novel-hero.webp");
}

.home-hero:has(#home-novel-1:not([hidden])) {
    --hero-art: url("../images/home-hero-overgeared.webp");
    --hero-base: #26202a;
    --hero-fade: #a08478;
    --hero-mist: #82675cc7;
    --hero-mobile-position: 77%;
}

.home-hero:has(#home-novel-3:not([hidden])) {
    --hero-art: url("../images/home-hero-otherworld.webp");
    --hero-base: #173d36;
    --hero-fade: #85b3a3;
    --hero-mist: #649988c7;
    --hero-mobile-position: 90%;
}

.home-hero :focus-visible { outline-color: var(--hero-focus); }
.home-hero [hidden] { display: none; }
.home-hero-stage { position: relative; }

.home-feature {
    display: grid;
    grid-template-columns: clamp(128px, 15.6vw, 226px) minmax(0, 510px);
    align-items: start;
    gap: clamp(16px, 2.4vw, 35px);
    padding: 23px clamp(58px, 7.55vw, 110px) 14px;
}

.home-feature-with-picker { padding-bottom: 0; }

.home-feature-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 226 / 302;
    object-fit: cover;
    border: 1px solid #fffbd9d9;
    border-radius: 16px;
    background: #e5f1f7;
    box-shadow: 0 8px 20px #081f2b61;
}

.home-feature-cover[src="images/logo.png"], .home-feature-link img[src="images/logo.png"] {
    object-fit: contain;
    padding: 5px;
    background: #e5f1f7;
}

.home-feature-copy { min-width: 0; }

.home-feature-badge {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 6px;
    padding: 3px 12px;
    border: 1px solid #e7f8ffc4;
    border-radius: 99px;
    background: #123a4a99;
    font-size: .84rem;
    font-weight: 700;
}

.home-feature h1 {
    margin-top: 6px;
    font-size: clamp(2.2rem, 4vw, 3.6rem);
    line-height: 1.15;
    text-shadow: 0 2px 8px #0a253ba8;
}

.home-feature-description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    margin-top: 9px;
    color: #f0f7fa;
    font-size: 1.08rem;
    line-height: 1.46;
    text-shadow: 0 1px 5px #0a253b;
}

.home-feature-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 21px; }
.home-feature-actions .catalog-button { min-height: 46px; padding-inline: 20px; }
.home-feature-outline { color: white; border-color: #e3f5ff; background: #103b4e9c; }
.home-feature-outline:hover { background: #0c3445; }

.home-hero-controls { min-height: 22px; }

.home-hero-arrow {
    position: absolute;
    top: 50%;
    translate: 0 -50%;
    z-index: 1;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    padding: 0;
    border: 2px solid #edf9ffd6;
    border-radius: 50%;
    color: white;
    background: #173f4dbb;
    font-size: 1.45rem;
}

.home-hero-arrow:hover { background: #0a4351; }
.home-hero-previous { left: clamp(8px, 1.75vw, 25px); }
.home-hero-next { right: clamp(8px, 1.75vw, 25px); }

.home-hero-dots { display: flex; justify-content: center; margin-top: -10px; }

.home-hero-dots button {
    display: grid;
    width: 24px;
    height: 26px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: transparent;
}

.home-hero-dots button::before { content: ""; width: 9px; height: 9px; border-radius: 8px; background: #c1d8e3; }
.home-hero-dots button[aria-pressed="true"]::before { width: 17px; border: 1px solid white; background: #088b93; }

.home-feature-strip {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    margin: 6px clamp(12px, 2.25vw, 30px) 0;
    padding: 5px 10px 5px 25px;
    border: 1px solid #f1faffcf;
    border-radius: 18px;
    background: linear-gradient(110deg, #ebf9f9f5, #e3f3fbe8);
    color: var(--ink);
}

.home-feature-strip h2 {
    display: flex;
    flex: 0 0 clamp(140px, 12.8vw, 185px);
    align-items: center;
    align-self: stretch;
    gap: 10px;
    margin-block: 16px;
    padding-right: 12px;
    border-right: 1px solid #fff;
    font-size: clamp(1.1rem, 1.65vw, 1.45rem);
}

.home-feature-strip h2 .fa { color: #08747e; }

.home-feature-list {
    display: flex;
    flex: 1;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 6px 5px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    scrollbar-color: #83abb8 transparent;
    list-style: none;
}

.home-feature-list li { flex: 0 0 calc((100% - 32px) / 5); min-width: 154px; }

.home-feature-link {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 100%;
    border-radius: 10px;
    padding: 1px;
    color: var(--ink);
    font-weight: 700;
    line-height: 1.26;
    overflow-wrap: anywhere;
    text-decoration: none;
}

.home-feature-link img {
    flex: 0 0 auto;
    width: 76px;
    height: 102px;
    object-fit: cover;
    border: 1px solid #f8fbff;
    border-radius: 10px;
    box-shadow: 0 3px 8px #153a4a3d;
}

.home-feature-link:hover, .home-feature-link[aria-current="true"] { color: var(--teal-dark); }
.home-feature-link[aria-current="true"] img { outline: 2px solid #fff; box-shadow: 0 0 0 4px #1b9fa8, 0 0 13px 4px #46a7b7a1; }
.home-feature-link:focus-visible { outline-color: var(--teal-dark); outline-offset: 2px; }

.home-hero-empty {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px 24px;
    min-height: 185px;
    padding: 24px clamp(16px, 5vw, 72px);
}

.catalog-home { padding-top: 20px; }
.catalog-announcement { padding: 6px clamp(12px, 1.7vw, 24px); margin-bottom: 13px; }
.home-announcement-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px clamp(12px, 1.8vw, 26px); }
.catalog-announcement h2 { font-size: 1.38rem; }
.catalog-announcement h2 .fa { margin-right: 5px; color: var(--teal); }
.catalog-announcement-schedule { flex: 1 1 320px; min-width: 0; font-size: .94rem; font-weight: 600; }
.home-announcement-row .catalog-button { margin-inline-start: auto; min-height: 36px; padding: 6px 13px; font-size: .875rem; }
.catalog-announcement-content { display: flow-root; overflow: auto; margin-top: 6px; padding: 8px 0 6px; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.catalog-announcement-content img { height: auto; }
.catalog-announcement-content pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.catalog-home .catalog-resume { max-width: 725px; margin-bottom: 16px; }
.catalog-home .catalog-feed { padding-top: 0; }
.catalog-home .catalog-section-heading { gap: clamp(9px, 1.4vw, 20px); margin: 0 0 10px; }
.catalog-home .catalog-section-heading h2 { font-size: clamp(1.3rem, 2vw, 1.78rem); }
.catalog-home .catalog-section-icon { flex-basis: 51px; width: 51px; height: 48px; }
.catalog-home .catalog-grid { gap: 10px 12px; }
.catalog-home .catalog-chapter { padding-block: 8px; }
.catalog-home .catalog-chapter-meta { margin-top: 4px; }

@media (min-width: 861px) {
    .catalog-home .catalog-chapter { grid-template-columns: clamp(92px, 8.7vw, 126px) minmax(0, 1fr) auto; padding-block: 6px; }
    .catalog-home .catalog-chapter-novel { font-size: .94rem; margin-bottom: 0; }
    .catalog-home .catalog-chapter-meta { margin-top: 2px; }
    .catalog-home .catalog-read, .catalog-home .catalog-heading-action { min-height: 38px; }
    .catalog-home .catalog-resume .catalog-read { min-width: 120px; }
}

@media (min-width: 1200px) {
    .home-hero {
        background-image:
            linear-gradient(0deg, var(--hero-fade), var(--hero-mist) 11%, transparent 37%),
            linear-gradient(90deg, #0b394bbf, #0b35458c 38%, transparent 70%),
            var(--hero-art);
        background-position: center, center, center -28px;
        background-size: cover, cover, 100% auto;
        background-repeat: no-repeat;
    }
}

@media (max-width: 860px) {
    .catalog-home-page .catalog-header-inner {
        display: grid;
        grid-template-columns: clamp(68px, 22vw, 105px) minmax(0, 1fr) clamp(121px, 33vw, 170px);
        justify-content: normal;
        gap: 6px 8px;
        padding-block: 7px 8px;
    }
    .catalog-home-page .catalog-nav { display: contents; }
    .catalog-home-page .catalog-menu-toggle { display: none; }
    .catalog-home-page .catalog-brand img { width: 100px; margin-inline-start: -10px; }
    .catalog-home-page .catalog-nav-link { min-height: 38px; padding: 6px 9px; font-size: .92rem; }
    .catalog-home-page .catalog-nav > a { justify-self: start; }
    .catalog-home-page .catalog-nav .catalog-menu { justify-self: start; }
    .catalog-home-page .catalog-nav .catalog-account { justify-self: end; min-width: 0; max-width: 100%; }
    .catalog-home-page .catalog-account summary span:not(.fa) { min-width: 0; }
    .catalog-home-page .catalog-account summary .fa { flex-shrink: 0; }
    .catalog-home-page .catalog-search { grid-column: 1 / 3; min-height: 38px; margin: 0; }
    .catalog-home-page .catalog-search input { padding-block: 6px; }
    .catalog-home-page .catalog-dropdown {
        position: absolute;
        left: auto;
        right: 0;
        width: max-content;
        max-width: min(21rem, calc(100vw - 28px));
        margin: 0;
        box-shadow: var(--shadow);
    }

    .home-hero { margin-top: 12px; }
    .home-feature { grid-template-columns: clamp(108px, 22vw, 176px) minmax(0, 1fr); }
    .home-hero-dots { margin-top: 2px; }
    .home-feature-strip { padding-left: 12px; }
    .home-feature-strip h2 { flex-basis: 125px; }
    .catalog-home { padding-top: 14px; }
}

@media (max-width: 560px) {
    .catalog-home-page .catalog-brand img { width: 82px; }
    .catalog-home-page .catalog-nav-link { gap: 6px; white-space: nowrap; }
    .catalog-home-page .catalog-search input { font-size: 1rem; }
    .home-hero {
        border-radius: 17px;
        background-image:
            linear-gradient(90deg, #08192670, #08192638 65%, transparent),
            linear-gradient(180deg, #101f3954, color-mix(in srgb, var(--hero-base) 94%, transparent) 245px, var(--hero-base) 430px),
            var(--hero-art);
        background-position: center, center, var(--hero-mobile-position) top;
        background-size: cover, cover, auto 300px;
        background-repeat: no-repeat;
    }
    .home-feature {
        grid-template-columns: clamp(84px, 25vw, 108px) minmax(0, 1fr);
        align-items: start;
        gap: 8px 12px;
        padding: 16px 14px 2px;
    }
    .home-feature-cover { grid-row: span 2; border-radius: 10px; }
    .home-feature-copy { display: contents; }
    .home-feature-badge { align-self: end; font-size: .78rem; }
    .home-feature h1 { margin: 0; font-size: clamp(1.65rem, 7vw, 2.4rem); }
    .home-feature-description, .home-feature-actions { grid-column: 1 / -1; }
    .home-feature-description { -webkit-line-clamp: 4; margin-top: 2px; font-size: .94rem; }
    .home-feature-actions { gap: 7px; margin-top: 4px; }
    .home-feature-actions .catalog-button { min-height: 44px; padding-inline: 9px; gap: 6px; font-size: .88rem; }
    .home-hero-controls { display: flex; align-items: center; justify-content: space-between; padding: 4px 14px 0; }
    .home-hero-arrow { position: static; translate: none; }
    .home-hero-dots { margin-top: 0; }
    .home-hero-dots button { width: 25px; }
    .home-feature-strip { display: block; margin: 6px 8px 0; padding: 7px 4px 3px; border-radius: 13px; }
    .home-feature-strip h2 { margin: 0 0 2px; padding-left: 8px; border: 0; }
    .home-feature-list li { flex-basis: 130px; min-width: 0; }
    .home-feature-link { font-size: .86rem; gap: 6px; }
    .home-feature-link img { width: 51px; height: 69px; border-radius: 7px; }
    .catalog-announcement-schedule { order: 1; flex-basis: 100%; }
    .catalog-home .catalog-section-icon { flex-basis: 40px; width: 40px; height: 42px; font-size: 1.2rem; }
}

@media (max-width: 350px) {
    .catalog-home-page .catalog-header-inner { gap: 6px; }
    .catalog-home-page .catalog-brand img { width: 70px; }
    .catalog-home-page .catalog-nav-link { padding-inline: 8px; font-size: .875rem; }
    .catalog-home-page .catalog-search button { flex-basis: 34px; }
    .home-feature-list li { flex-basis: 115px; }
}
