:root {
    --primary: #0F2A55;
    --secondary: #ca070c;
    --highlight: #EE050B;
    --text: #333;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Barlow Semi Condensed', sans-serif;
    color: var(--text);
    margin: 0;
    padding: 0;
    overflow-x: clip;
    background: #F4F6F8;
    opacity: 0;
    transition: opacity 0.3s ease-in;

    &.fonts-loaded {
        opacity: 1;
    }

    &.loaded {

        .hero-background::after,
        .hero-bg-text-1,
        .hero-bg-text-2 {
            transform: translateY(0);
            opacity: 1;
            transition: transform 0.6s, opacity 0.6s;
        }

        .red-block,
        .hero-disclaimer,
        .scroll-indicator {
            opacity: 1;
            transition: opacity 0.6s;
        }
    }

    &.animate-load {
        .hero-background::after {
            transition: transform 1s ease-out, opacity 1s ease-out;
        }

        .red-block {
            opacity: 0;
            transition: none;
        }

        .hero-bg-text-1 {
            transition: transform 1s ease-out 0.8s, opacity 1s ease-out 0.8s;
        }

        .hero-bg-text-2 {
            transition: transform 1s ease-out 1.4s, opacity 1s ease-out 1.4s;
        }

        .hero-disclaimer,
        .scroll-indicator {
            transition: opacity 1s ease-out 2.8s;
        }
    }

    &.scrolled {
        header {
            transform: translateY(0);
            opacity: 1;
        }

        .hero-bg-text-1 {
            transform: translateX(-50px);
            opacity: 0;
            transition: transform 0.6s ease-in, opacity 0.4s ease-in;
        }

        .hero-bg-text-2 {
            transform: translateX(50px);
            opacity: 0;
            transition: transform 0.6s ease-in, opacity 0.4s ease-in;
        }
    }

    &.header-text-visible {
        .header-logo-text {
            transform: translateX(0);
            opacity: 1;
        }

        .header-sub-text {
            transform: translateX(0);
            opacity: 1;
            transition-delay: 0.1s;
        }
    }
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
    text-wrap: pretty;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: inherit;
}

p {
    line-height: 1.75;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: var(--primary);
    color: white;
    padding: 1rem 3rem;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateY(-100%);
    opacity: 0;
    box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.4);
    transition: transform 0.6s ease-out, opacity 0.6s ease-out;

    .header-titles {
        display: flex;
        flex-direction: column;
        text-align: center;
    }

    .header-logo-text {
        font-size: 1.5rem;
        font-weight: 900;
        margin: 0;
        white-space: nowrap;
        transform: translateX(-50px);
        opacity: 0;
        transition: transform 0.6s ease-out, opacity 0.6s ease-out;
    }

    .header-sub-text {
        font-size: 0.9rem;
        font-weight: 600;
        margin: 0;
        color: rgba(255, 255, 255, 0.8);
        white-space: nowrap;
        transform: translateX(50px);
        opacity: 0;
        transition: transform 0.6s ease-out, opacity 0.6s ease-out;
    }

    nav {
        display: flex;
        align-items: center;

        .donate-wrapper {
            margin-left: 2rem;
        }

        a {
            color: white;
            text-decoration: none;
            margin-left: 2rem;
            font-weight: 600;
            transition: color 0.2s ease;

            &:hover,
            &:focus {
                color: rgba(255, 255, 255, 0.8);
            }

            &.donate {
                background: var(--secondary);
                padding: 0.5rem 1.5rem;
                border-radius: 4px;
                margin-left: 0;
                transition: background-color 0.2s ease;

                &:hover,
                &:focus {
                    background-color: var(--highlight);
                    color: white;
                }
            }
        }
    }
}

/* Hero */
.hero {
    position: relative;
    height: 100svh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;

    .hero-background {
        position: absolute;
        inset: 0;
        z-index: 0;

        &::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 50%;
            background-color: #fff;
        }

        &::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 50%;
            background-color: var(--secondary);
            transform: translateY(100%);
            opacity: 0;
        }

        svg {
            object-fit: contain;
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
        }
    }

    .hero-bg-text-1 {
        font-size: 21px;
        font-weight: 600;
        transform: translateY(20px);
        opacity: 0;
        fill: var(--secondary);
    }

    .hero-bg-text-2 {
        font-size: 13px;
        font-weight: 600;
        transform: translateY(-20px);
        opacity: 0;
    }

    .red-block {
        opacity: 0;
        fill: var(--secondary);
    }

    .scroll-indicator {
        position: absolute;
        bottom: 6rem;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        color: rgba(255, 255, 255, 0.85);
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 2px;
        font-size: 0.8rem;
        z-index: 10;
        opacity: 0;

        .bounce-arrow {
            display: block;
            margin: 0 auto;
            animation: bounce 1.5s infinite ease-in-out;
        }

        &.shown {
            opacity: 0 !important;
        }
    }

    .hero-disclaimer {
        position: absolute;
        bottom: 2rem;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        color: rgba(255, 255, 255, 0.85);
        font-size: 0.9rem;
        z-index: 10;
        opacity: 0;
        line-height: 1.4;
        width: 90%;
        font-weight: 400;
        max-width: 600px;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    20% {
        transform: translateY(5px);
    }

    35% {
        transform: translateY(2px);
    }

    55% {
        transform: translateY(8px);
    }
}

/* Sections */
.intro-section {
    background: var(--primary);
    color: white;
    padding: 6rem 10%;
    text-align: center;

    h1 {
        font-size: 3rem;
        margin-top: 0;
        margin-bottom: 1.5rem;
    }

    p {
        font-size: 1.25rem;
        max-width: 900px;
        margin: 0 auto;
        color: rgba(255, 255, 255, 0.9);
    }
}

.headshot-section {
    padding: 8rem 10%;
    background: #FFF;
    display: flex;
    gap: 4rem;
    align-items: center;
    justify-content: center;

    img {
        flex: 1;
        max-width: 450px;
        width: 100%;
        border-radius: 8px;
        box-shadow: -20px 20px 0 var(--primary);
        object-fit: cover;
    }

    .copy {
        flex: 1;
        max-width: 1086px;

        h2 {
            font-size: 3rem;
            color: var(--primary);
            margin-bottom: 1.5rem;
        }

        p {
            font-size: 1.25rem;
            color: #555;
            margin-bottom: 1.5rem;
        }
    }
}

.platform-section {
    padding: 8rem 10%;
    max-width: 1600px;
    margin: 0 auto;
    background: #F4F6F8;

    .platform-split {
        display: flex;
        gap: 4rem;
        align-items: center;
        margin-bottom: 8rem;

        .text-wrap {
            flex: 1;

            h2 {
                font-size: 3rem;
                color: var(--primary);
                margin-top: 0;
                margin-bottom: 1.5rem;
            }

            p {
                font-size: 1.2rem;
                color: #555;
                margin-bottom: 1.5rem;
            }
        }

        .img-wrap {
            flex: 1;
            position: relative;
            height: 500px;

            img {
                position: absolute;
                inset: 0;
                width: 100%;
                height: 100%;
                object-fit: cover;
                border: 4px solid white;
                box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
                border-radius: 8px;
                opacity: 0;
                transition: opacity 0.8s ease-in-out;

                &.active {
                    opacity: 1;
                    z-index: 2;
                }
            }

            .carousel-pagination {
                position: absolute;
                bottom: -40px;
                left: 50%;
                transform: translateX(-50%);
                display: flex;
                gap: 8px;
                z-index: 10;

                .dot {
                    width: 12px;
                    height: 12px;
                    padding: 0;
                    border-radius: 50%;
                    background: #CBD5E1;
                    cursor: pointer;
                    transition: 0.3s;
                    border: 2px solid white;
                    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);

                    &.active {
                        background: var(--secondary);
                    }

                    &:hover,
                    &:focus-visible {
                        background: #94a3b8;
                    }

                    &.active:hover,
                    &.active:focus-visible {
                        background: var(--highlight);
                    }
                }
            }
        }
    }
}

.features-section {
    text-align: center;
    padding: 8rem 10%;
    background: #FFF;

    .features-container {
        max-width: 1600px;
        margin: 0 auto;
    }

    .features-header {
        margin-bottom: 4rem;

        h2 {
            font-size: 2.5rem;
            color: var(--primary);
            margin-bottom: 1rem;
            margin-top: 0;
        }

        p {
            font-size: 1.2rem;
            color: #555;
            max-width: 1600px;
            margin: 0 auto;
        }
    }

    .features {
        display: flex;
        gap: 3rem;

        .feature-card {
            flex: 1;
            padding: 2.5rem 2rem;
            background: #F4F6F8;
            border-top: 4px solid var(--secondary);
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
            text-align: left;
            border-radius: 4px;

            h3 {
                margin-bottom: 1rem;
                margin-top: 0;
                color: var(--primary);
                font-size: 1.5rem;
            }

            p {
                color: #666;
                font-size: 1.1rem;
                margin-bottom: 0;
            }
        }
    }
}

.endorsements-section {
    padding: 8rem 10%;
    background: var(--primary);
    text-align: center;

    .endorsements-container {
        max-width: 1600px;
        margin: 0 auto;
    }

    .endorsements-header {
        margin-bottom: 4rem;

        h2 {
            font-size: 3rem;
            color: white;
            margin-bottom: 1rem;
            margin-top: 0;
        }

        p {
            font-size: 1.2rem;
            color: rgba(255, 255, 255, 0.8);
            max-width: 800px;
            margin: 0 auto;
        }
    }

    .endorsements-grid {
        display: flex;
        gap: 3rem;
        flex-wrap: wrap;
        justify-content: center;

        .endorsement-card {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-width: 300px;
            max-width: 450px;
            padding: 3.5rem 2.5rem 2.5rem;
            background: white;
            border-radius: 8px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
            text-align: left;
            position: relative;
            cursor: pointer;
            transition: transform 0.3s ease, box-shadow 0.3s ease;
            border-top: 5px solid var(--secondary);

            &:hover,
            &:focus-visible {
                transform: translateY(-10px);
                box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
            }

            &::before {
                content: '“';
                position: absolute;
                top: 5px;
                left: 20px;
                font-size: 6rem;
                color: var(--secondary);
                font-family: Georgia, serif;
                line-height: 1;
                opacity: 0.15;
            }

            .quote {
                font-size: 1.2rem;
                color: #444;
                margin-bottom: 1.5rem;
                font-style: italic;
                position: relative;
                z-index: 1;
                line-height: 1.6;
            }

            .author {
                font-size: 1.5rem;
                color: var(--primary);
                margin: auto 0 0;
                font-weight: 800;
            }

            .read-more {
                align-self: flex-start;
                display: inline-block;
                margin-top: 1rem;
                color: var(--secondary);
                font-weight: 600;
                text-transform: uppercase;
                font-size: 0.9rem;
                letter-spacing: 1px;
                position: relative;
                padding-bottom: 2px;

                &::after {
                    content: '';
                    position: absolute;
                    bottom: 0;
                    left: 0;
                    width: 0;
                    height: 2px;
                    background-color: var(--secondary);
                    transition: width 0.3s ease;
                }
            }

            &:hover .read-more::after,
            &:focus-visible .read-more::after {
                width: 100%;
            }
        }
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 42, 85, 0.85);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 1.5rem;
    box-sizing: border-box;

    &.active {
        opacity: 1;
        pointer-events: auto;
    }
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 850px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    border-top: 6px solid var(--secondary);
    overflow: hidden;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

#donate-modal {
    max-width: 500px;
    padding: 3rem;
    text-align: center;
    margin: 0 10px;

    h3 {
        color: var(--primary);
        font-size: 2rem;
        margin-top: 0;
        margin-bottom: 1.5rem;
    }

    p {
        color: #555;
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }
}

.endorsement-modal-content {
    padding: 3rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;

    @media (min-width: 768px) {
        &.has-photo {
            flex-direction: row;
            align-items: flex-start;
        }
    }
}

.endorsement-modal-photo {
    flex: 0 0 280px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: none;

    .has-photo & {
        display: block;
    }

    img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
    }
}

.endorsement-modal-text {
    flex: 1;

    h3 {
        color: var(--primary);
        font-size: 2.2rem;
        margin-top: 0;
        margin-bottom: 1.5rem;
    }

    p {
        color: #444;
        font-size: 1.1rem;
        margin-bottom: 1.25rem;
        line-height: 1.7;

        &:last-child {
            margin-bottom: 0;
        }
    }
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
    z-index: 10;

    &:hover,
    &:focus-visible {
        color: var(--secondary);
    }
}

#vote-reminder-modal {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: white;
    border-left: 4px solid var(--secondary);
    padding: 1.5rem 2rem 1.5rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 99;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.6s ease;
    max-width: 300px;

    body.scrolled:not(.at-bottom) &.active {
        transform: translateX(0);
        opacity: 1;
        transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.8s, opacity 0.6s ease 0.8s;
    }

    h4 {
        margin: 0 0 0.5rem 0;
        color: var(--primary);
        font-size: 1.2rem;
    }

    p {
        margin: 0;
        color: #555;
        font-size: 0.95rem;
        line-height: 1.4;
    }

    strong {
        color: var(--primary);
    }

    .dates {
        margin-top: 0.5rem;
        font-size: 1rem;
    }

    .modal-close-btn {
        position: absolute;
        top: 8px;
        right: 12px;
        background: none;
        border: none;
        font-size: 1.2rem;
        color: #999;
        cursor: pointer;
        line-height: 1;
        padding: 0;
        transition: color 0.2s;

        &:hover,
        &:focus-visible {
            color: var(--secondary);
        }
    }
}

.news-section {
    padding: 8rem 10%;
    background: #F4F6F8;
    text-align: center;

    .news-container {
        max-width: 1600px;
        margin: 0 auto;
    }

    .news-header {
        margin-bottom: 4rem;

        h2 {
            font-size: 2.5rem;
            color: var(--primary);
            margin-bottom: 1rem;
            margin-top: 0;
        }
    }

    .articles {
        display: flex;
        justify-content: center;
        gap: 3rem;
        flex-wrap: wrap;

        .article-card {
            display: flex;
            flex-direction: column;
            width: 100%;
            max-width: 450px;
            background: #FFF;
            border-radius: 8px;
            overflow: hidden;
            text-decoration: none;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            border-top: 4px solid var(--secondary);

            &:hover,
            &:focus-visible {
                transform: translateY(-5px);
                box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
            }

            .article-image {
                width: 100%;
                height: 250px;

                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                }
            }

            .article-content {
                padding: 2rem;
                text-align: left;

                h3 {
                    margin-bottom: 0.5rem;
                    margin-top: 0;
                    color: var(--primary);
                    font-size: 1.5rem;
                    line-height: 1.2;
                }

                p {
                    color: #666;
                    font-size: 1rem;
                    margin-bottom: 0;
                    font-weight: 600;
                }
            }
        }
    }
}

.cta-banner {
    background: var(--secondary);
    padding: 5rem 10%;
    text-align: center;
    color: white;

    h2 {
        color: white;
        font-size: 3rem;
        margin-top: 0;
        margin-bottom: 2rem;
    }

    .btn-primary {
        display: inline-block;
        background: white;
        color: var(--secondary);
        padding: 1rem 3rem;
        text-decoration: none;
        font-weight: bold;
        border-radius: 4px;
        font-size: 1.2rem;
        transition: background-color 0.2s, color 0.2s;

        &:hover,
        &:focus-visible {
            background: var(--highlight);
            color: white;
        }
    }
}

footer {
    background: var(--primary);
    padding: 4rem 10% 2rem;
    color: rgba(255, 255, 255, 0.9);

    .footer-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4rem;
        row-gap: 2rem;
        margin-bottom: 2rem;
        text-align: center;
        line-height: 1.6;
        font-size: 1.1rem;

        strong {
            color: white;
            font-size: 1.2rem;
        }

        .title {
            font-size: 0.9em;
            opacity: 0.8;
            font-style: italic;
            margin-left: 0.5rem;
        }

        a {
            color: rgba(255, 255, 255, 0.7);
            text-decoration: underline;
            font-weight: normal;
            transition: color 0.2s;

            &:hover,
            &:focus-visible {
                color: white;
            }

            &.social-link {
                display: inline-flex;
                align-items: center;
                gap: 0.4rem;

                svg {
                    width: 16px;
                    height: 16px;
                    fill: currentColor;
                    transform: translateY(-1px);
                }
            }
        }
    }

    .copyright {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 2rem;
        text-align: center;
    }
}

@media (max-width: 900px) {
    p {
        line-height: 1.625;
    }

    .hero-content {
        margin: 0 2rem;
    }

    .headshot-section {
        flex-direction: column;

        img {
            margin: 0 auto;
        }
    }

    .platform-section .platform-split {
        flex-direction: column;

        .img-wrap {
            width: 100%;
            height: 400px;
            min-height: 400px;
        }
    }

    .features-section .features {
        flex-direction: column;
    }

    .news-section .articles {
        flex-direction: column;
        align-items: center;
    }

    .endorsements-section .endorsements-grid .endorsement-card {
        min-width: 100%;
    }

    .endorsement-modal-content {
        padding: 2rem;
    }

    .endorsement-modal-photo {
        max-width: 200px;
        margin: 0 auto;
    }
}

@media (max-width: 624px) {
    p {
        line-height: 1.5;
    }

    header {
        padding: 1rem 1rem;

        nav {
            a:not(.donate) {
                display: none;
            }

            .donate-wrapper {
                margin-left: 0;
            }
        }
    }

    #vote-reminder-modal {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        padding: 0.75rem 1rem 0.75rem 1rem;
        max-width: none;

        p {
            font-size: 0.75rem;
        }

        h4 {
            font-size: 1rem;
        }

        .dates {
            margin-top: 0.375rem;
            font-size: 0.75rem;
        }
    }
}

@media (max-width: 400px) {
    .hero .hero-disclaimer {
        font-size: 0.75rem;
    }
}