:root {
    --home-bg: #f5f6f9;
    --home-surface: #ffffff;
    --home-text: #161821;
    --home-muted: #727987;
    --home-soft: #eef0f5;
    --home-border: #e1e4ea;
    --home-accent: #5f63e9;
    --home-accent-dark: #474bcf;
    --home-dark: #15171f;
}

.home-page {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 83% -10%, rgba(95, 99, 233, .13), transparent 34rem),
        linear-gradient(180deg, #fafbfc 0, var(--home-bg) 38rem);
    color: var(--home-text);
}

.home-page * {
    box-sizing: border-box;
}

.home-container {
    width: min(1400px, calc(100% - 40px));
    margin: 0 auto;
}

.home-header {
    position: relative;
    z-index: 10;
    border-bottom: 1px solid rgba(226, 229, 235, .86);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(16px);
}

.home-nav {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.home-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--home-dark);
    text-decoration: none;
    font-size: 1.32rem;
    font-weight: 900;
    letter-spacing: -.04em;
}

.home-brand-mark {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--home-dark);
    color: #fff;
    font-size: 1rem;
    box-shadow: 0 8px 22px rgba(22, 24, 32, .16);
}

.home-nav-note {
    color: #858b96;
    font-size: .88rem;
    font-weight: 700;
}

.home-hero {
    padding: 62px 0 46px;
}

.hero-layout {
    display: block;
}

.hero-copy {
    max-width: 940px;
}

.home-eyebrow {
    display: inline-flex;
    align-items: center;
    color: var(--home-accent);
    font-size: .75rem;
    line-height: 1;
    font-weight: 900;
    letter-spacing: .13em;
}

.hero-copy h1 {
    margin: 15px 0 20px;
    max-width: 920px;
    color: var(--home-dark);
    font-size: clamp(3rem, 6vw, 5.65rem);
    line-height: .94;
    letter-spacing: -.065em;
}

.hero-copy h1 span {
    color: var(--home-accent);
}

.hero-copy > p {
    max-width: 720px;
    margin: 0;
    color: var(--home-muted);
    font-size: 1.08rem;
    line-height: 1.7;
}

.hero-trust {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px 24px;
    margin-top: 26px;
    color: #626875;
    font-size: .86rem;
    font-weight: 750;
}

.hero-trust > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.trust-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #5acb83;
    box-shadow: 0 0 0 4px rgba(90, 203, 131, .12);
}

.campaign-browser {
    padding: 28px 0 82px;
}

.browser-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
}

.browser-heading h2 {
    margin: 8px 0 0;
    color: var(--home-dark);
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: -.05em;
}

.campaign-counter {
    color: #7a818e;
    font-size: .86rem;
    font-weight: 800;
}

.campaign-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.campaign-search {
    width: min(460px, 100%);
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 16px;
    border: 1px solid var(--home-border);
    border-radius: 15px;
    background: var(--home-surface);
    box-shadow: 0 10px 30px rgba(30, 38, 57, .045);
}

.campaign-search:focus-within {
    border-color: rgba(95, 99, 233, .58);
    box-shadow: 0 0 0 4px rgba(95, 99, 233, .09);
}

.campaign-search svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    color: #858c98;
}

.campaign-search input {
    width: 100%;
    min-width: 0;
    height: 50px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--home-text);
    font-size: .94rem;
}

.campaign-search input::placeholder {
    color: #a0a6b0;
}

.ranking-tabs {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px;
    overflow-x: auto;
    border: 1px solid var(--home-border);
    border-radius: 15px;
    background: #eceff4;
}

.ranking-tab {
    appearance: none;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 13px;
    white-space: nowrap;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #777e89;
    cursor: pointer;
    font: inherit;
    font-size: .82rem;
    font-weight: 800;
    transition:
        color .15s ease,
        background .15s ease,
        box-shadow .15s ease;
}

.ranking-tab:hover {
    color: #373b43;
}

.ranking-tab.is-active {
    background: #fff;
    color: var(--home-dark);
    box-shadow: 0 3px 12px rgba(27, 34, 49, .08);
}

.ranking-tab-icon {
    color: var(--home-accent);
    font-size: .9rem;
}

.home-candidate-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.home-candidate-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dde1e8;
    border-radius: 22px;
    background: var(--home-surface);
    box-shadow:
        0 14px 38px rgba(30, 38, 57, .055),
        0 2px 8px rgba(30, 38, 57, .025);
    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease;
}

.home-candidate-card:hover {
    transform: translateY(-5px);
    border-color: #d1d6df;
    box-shadow:
        0 26px 58px rgba(30, 38, 57, .11),
        0 4px 14px rgba(30, 38, 57, .04);
}

.home-candidate-card[hidden] {
    display: none;
}

.home-candidate-art {
    position: relative;
    padding: 10px;
    overflow: hidden;
    background:
        linear-gradient(145deg, #eceff4, #e6eaf0);
    border-bottom: 1px solid #e0e4e9;
}

.home-art-checker,
.home-art-placeholder {
    position: relative;
    z-index: 1;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid #d1d6de;
    border-radius: 15px;
    box-shadow: 0 8px 22px rgba(25, 30, 41, .07);
}

.home-art-checker {
    background-color: #fff;
    background-image:
        linear-gradient(45deg, #e5e8ec 25%, transparent 25%),
        linear-gradient(-45deg, #e5e8ec 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e5e8ec 75%),
        linear-gradient(-45deg, transparent 75%, #e5e8ec 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.home-art-checker img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.home-art-placeholder {
    display: grid;
    place-items: center;
    background: #f6f7f9;
    color: #999faa;
    font-size: .8rem;
    font-weight: 800;
}

.home-card-topbar {
    position: absolute;
    z-index: 3;
    top: 18px;
    left: 18px;
    right: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
}

.home-candidate-number,
.ranking-position {
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    box-shadow: 0 5px 16px rgba(20, 22, 29, .12);
}

.home-candidate-number {
    padding: 0 10px;
    background: rgba(21, 23, 31, .95);
    color: #fff;
    font-size: .82rem;
    font-weight: 900;
    letter-spacing: .03em;
    backdrop-filter: blur(8px);
}

.ranking-position {
    padding: 0 9px;
    background: rgba(255, 255, 255, .94);
    color: #4c5260;
    font-size: .75rem;
    font-weight: 900;
    backdrop-filter: blur(8px);
}

.home-art-bottom-glow {
    position: absolute;
    z-index: 2;
    left: 10px;
    right: 10px;
    bottom: 10px;
    height: 33%;
    border-radius: 0 0 15px 15px;
    background: linear-gradient(
        to top,
        rgba(19, 21, 28, .10),
        rgba(19, 21, 28, 0)
    );
    pointer-events: none;
}

.home-candidate-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px;
}

.home-candidate-office {
    margin-bottom: 6px;
    color: var(--home-accent);
    font-size: .7rem;
    line-height: 1.3;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.home-candidate-body h3 {
    margin: 0;
    color: var(--home-dark);
    font-size: 1.28rem;
    line-height: 1.08;
    letter-spacing: -.04em;
}

.home-candidate-description {
    display: -webkit-box;
    margin: 8px 0 0;
    overflow: hidden;
    color: #7c838f;
    font-size: .79rem;
    line-height: 1.46;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.home-candidate-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin: auto 0 14px;
    padding-top: 17px;
}

.home-stat-pill {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 8px;
    border: 1px solid #eceef2;
    border-radius: 11px;
    background: #f8f9fb;
}

.stat-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: rgba(95, 99, 233, .10);
    color: var(--home-accent);
    font-size: .72rem;
}

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

.home-candidate-stats strong,
.home-candidate-stats small {
    display: block;
}

.home-candidate-stats strong {
    overflow: hidden;
    color: #30343d;
    font-size: .78rem;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-candidate-stats small {
    margin-top: 2px;
    color: #949aa4;
    font-size: .59rem;
    line-height: 1.1;
}

.home-candidate-action {
    appearance: none;
    width: 100%;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 14px;
    border: 0;
    border-radius: 13px;
    background:
        linear-gradient(135deg, var(--home-dark), #252935);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
    font-size: .83rem;
    font-weight: 850;
    box-shadow: 0 8px 20px rgba(21, 23, 31, .12);
    transition:
        background .15s ease,
        transform .15s ease,
        box-shadow .15s ease;
}

.home-candidate-action > span:first-child {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.home-candidate-action small {
    color: rgba(255, 255, 255, .58);
    font-size: .53rem;
    font-weight: 900;
    letter-spacing: .09em;
}

.home-action-arrow {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 9px;
    background: rgba(255, 255, 255, .10);
    font-size: 1rem;
}

.home-candidate-action:hover {
    background:
        linear-gradient(135deg, var(--home-accent-dark), var(--home-accent));
    transform: translateY(-1px);
    box-shadow: 0 11px 26px rgba(71, 75, 207, .22);
}

.home-candidate-action.is-disabled {
    justify-content: center;
    background: #e6e9ee;
    color: #9299a4;
    cursor: not-allowed;
    box-shadow: none;
}

.home-empty-state,
.home-no-results {
    padding: 64px 24px;
    text-align: center;
    border: 1px dashed #cdd2da;
    border-radius: 22px;
    background: rgba(255, 255, 255, .6);
}

.home-no-results[hidden] {
    display: none;
}

.home-empty-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
    border-radius: 14px;
    background: var(--home-dark);
    color: #fff;
    font-weight: 900;
}

.home-empty-state h3,
.home-no-results h3 {
    margin: 0 0 7px;
    color: var(--home-dark);
    font-size: 1.2rem;
}

.home-empty-state p,
.home-no-results p {
    margin: 0;
    color: #7b828e;
    font-size: .9rem;
}

.home-footer {
    border-top: 1px solid var(--home-border);
    background: #fff;
}

.home-footer-inner {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: #838a95;
    font-size: .82rem;
}

.home-footer-inner > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-footer-inner strong {
    color: var(--home-dark);
    font-size: .96rem;
}

@media (max-width: 1220px) {
    .home-candidate-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1020px) {
    .home-candidate-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .campaign-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .campaign-search {
        width: 100%;
    }

    .ranking-tabs {
        align-self: flex-start;
        max-width: 100%;
    }
}

@media (max-width: 780px) {
    .home-container {
        width: min(100% - 28px, 1400px);
    }

    .home-nav-note {
        display: none;
    }

    .home-hero {
        padding-top: 45px;
    }

    .hero-copy h1 {
        font-size: clamp(2.8rem, 13vw, 4.5rem);
    }

    .home-candidate-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .browser-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .ranking-tabs {
        width: 100%;
    }

    .ranking-tab {
        flex: 1 0 auto;
    }

    .home-footer-inner {
        align-items: flex-start;
        flex-direction: column;
        justify-content: center;
        padding: 18px 0;
    }
}

@media (max-width: 520px) {
    .home-candidate-grid {
        grid-template-columns: 1fr;
    }

    .home-candidate-card {
        width: 100%;
        max-width: 350px;
    }

    .ranking-tabs {
        justify-content: flex-start;
    }

    .ranking-tab {
        flex: 0 0 auto;
    }

    .hero-trust {
        gap: 13px;
    }

    .home-footer-privacy {
        display: none;
    }
}
