* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --font-color: rgb(34, 34, 34);
    --muted-color: rgba(34, 34, 34, 0.75);
    --bg-color: rgb(253, 253, 253);
    --font-style: 'Funnel Display', sans-serif;
    --button-text-color: #ffffff;
    --accent-color: #8b3dbd;
}

body {
    background: white;
    background-image:
        linear-gradient(to right, rgba(71, 85, 105, 0.15) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(71, 85, 105, 0.15) 1px, transparent 1px),
        radial-gradient(circle at 50% 60%, rgba(236, 72, 153, 0.15) 0%, rgba(168, 85, 247, 0.05) 40%, transparent 70%);
    background-size: 40px 40px, 40px 40px, 100% 100%;
    background-repeat: repeat, repeat, no-repeat;
    min-height: 100vh;
    font-family: var(--font-style);
    padding: 2vw;
}

/* Smooth transitions for theme changes */
html,
body,
.card,
.button,
.footer-section,
.top-nav .nav-inner,
.contrib-count,
.nav-logo {
    transition: background-color 300ms ease, color 300ms ease, box-shadow 300ms ease, border-color 300ms ease;
}

/* Top navigation */
.top-nav {
    width: 100%;
    position: sticky;
    top: 1rem;
    display: flex;
    justify-content: center;
    z-index: 40;
    pointer-events: auto;
}

.top-nav .nav-inner {
    width: min(1100px, 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    backdrop-filter: blur(8px);
    border: 3px solid rgb(31, 31, 31);
    border-radius: 15px;
}

.nav-logo {
    font-size: 25px;
    font-weight: 800;
    color: var(--font-color);
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
}


.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
}

.contrib-label {
    font-size: 1.2rem;
    color: var(--muted-color);
    font-weight: 700;
}

.contrib-count {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--accent-color);
    padding: 0.2rem 0.6rem;
    background: linear-gradient(90deg, #f2d9f8, #e6c9f0);
    border: 3px solid rgb(31, 31, 31);
    border-radius: 8px;
    box-shadow: -3px 3px 0 rgba(14, 14, 14, 0.874);
}

@media (max-width: 700px) {
    .nav-inner {
        padding: 0.4rem;
    }

    .nav-logo {
        font-size: 18px;
    }

    .contrib-label {
        display: none;
    }
}

.hero-section {
    background-color: transparent;
    width: 100%;
    height: auto;
    padding: 3vw;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--font-color);
}

.content {
    margin: 5vh 20vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2vh;
}

.cta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.6rem;
}

.cta-row .button {
    margin: 0;
}

.cta-row .button.small {
    margin-left: 0.6rem;
    box-shadow: -4px 4px 0 rgba(0, 0, 0);
}

@media (max-width: 700px) {
    .cta-row {
        flex-direction: column;
        gap: 0.6rem;
    }
}

#heading {
    font-family: var(--font-style);
    font-size: 42px;
    text-align: center;
    line-height: 1.05;
    max-width: 1000px;
}

/* corrected selector to match markup */
#sub-heading {
    font-size: 25px;
    font-style: var(--font-style);
    text-align: center;
    line-height: 1.15;
    max-width: 900px;
}

p {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
}

.cards-section {
    background-color: transparent;
    width: 100%;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3vw;
    padding: 0vw 3vw;
    margin-bottom: 5vh;
}

.card {
    box-sizing: border-box;
    width: 400px;
    height: 200px;
    background-color: transparent;
    backdrop-filter: blur(6px);
    border: 3px solid rgb(33, 33, 33);
    box-shadow: 12px 17px 51px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(6px);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.5s;
    user-select: none;
    display: flex;
}

.card:hover {
    border: 3px solid rgb(33, 33, 33);
    transform: scale(1.05);
}

.card:active {
    transform: scale(0.95) rotateZ(1.7deg);
}

.card-content {
    padding: 1vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.2vh;
    font-size: 18px;
    color: var(--font-color);
    min-width: 0;
    /* allow children to shrink so ellipsis can appear */
}

.name {
    font-size: 22px;
    font-weight: bolder;
}

.resource {
    font-weight: bolder;
    margin-left: 20px;
}

.socials {
    display: flex;
    justify-content: center;
    align-items: center;
}

a {
    text-decoration: none;
    color: var(--font-color);
}

.links a {
    color: var(--font-color);
    transition: ease-in-out 0.3s;
    text-decoration: none;
}

.links a:hover {
    transform: scale(1.3);
    color: #703895;
}

.button {
    margin-top: 2vh;
    margin: 1vw;
    font-size: 1rem;
    font-family: var(--font-style);
    padding: 0.8em 1em;
    background: linear-gradient(90deg, #a18cd1 0%, #fbc2eb 100%);
    border: 3px solid rgb(31, 31, 31);
    border-radius: 1em;
    color: var(--button-text-color);
    font-weight: bolder;
    transition: cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.4s;
    box-shadow: -5px 5px 0px 0px rgb(30, 30, 30);
}

.button:hover {
    transform: translate(5px, -5px);
}

.footer-section {
    background-color: transparent;
    backdrop-filter: blur(6px);
    height: auto;
    padding: 2.2rem 2.6rem;
    display: flex;
    color: var(--font-color);
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    border: 3px solid rgb(31, 31, 31);
    box-shadow: 12px 17px 51px rgba(0, 0, 0, 0.22);
    margin: 0px 60px;
    border-radius: 20px;
}

#logo {
    color: var(--font-color);
    color: var(--font-color);
    font-size: 44px;
    font-weight: 900;
    line-height: 1;
}

.logo {
    display: flex;
}

.ri-arrow-right-up-line {
    font-size: 50px;
    transition: ease-in-out 0.3s;
}

.ri-arrow-right-up-line:hover {
    transform: scale(1.2) rotateZ(45deg);
}

.right-sec {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    font-size: 18px;
    align-items: flex-end;
}

.links {
    display: flex;
    gap: 0.8rem;
    justify-content: flex-end;
}

i {
    font-size: 28px;
}

/* Footer column sizing for desktop */
.footer-section .left-sec {
    flex: 1 1 60%;
}

.footer-section .right-sec {
    flex: 0 0 36%;
}

/* Style social icons within footer to match rounded UI */
.footer-section .links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(90deg, #ffffff, #f4e8f8);
    color: var(--font-color);
    border: 2px solid rgba(31, 31, 31, 0.696);
}

/* Slightly larger icon for visual weight */
.footer-section .links i {
    font-size: 20px;
}

@media (max-width: 900px) {
    .footer-section {
        padding: 1.6rem 1.4rem;
    }

    #logo {
        font-size: 36px;
    }
}

@media (max-width: 480px) {
    .footer-section {
        padding: 1rem;
        margin: 0 10px;
        border-radius: 14px;
    }

    #logo {
        font-size: 30px;
    }

    .footer-section .links a {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
}

/* Theme toggle small variant */
.button.small {
    padding: 0.6em 0.8em;
    font-size: 0.95rem;
}

/* Dark theme variables and overrides */
:root[data-theme='dark'] {
    --font-color: #e9e7ef;
    --muted-color: rgba(233, 231, 239, 0.75);
    --bg-color: #15141a;
    --button-text-color: #111118;
    --accent-color: #cda7ff;
}

body[data-theme='dark'] {
    /* Magenta orb grid background (matches provided JSX snippet) */
    background: #020617;
    background-image:
        linear-gradient(to right, rgba(71, 85, 105, 0.15) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(71, 85, 105, 0.15) 1px, transparent 1px),
        radial-gradient(circle at 50% 60%, rgba(236, 72, 153, 0.15) 0%, rgba(168, 85, 247, 0.05) 40%, transparent 70%);
    background-size: 40px 40px, 40px 40px, 100% 100%;
    background-repeat: repeat, repeat, no-repeat;
    color: var(--font-color);
}

body[data-theme='dark'] .top-nav .nav-inner {
    border-color: rgba(255, 255, 255, 0.06);
}

body[data-theme='dark'] .card {
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 6px 6px 20px rgba(0, 0, 0, 0.6);
}

body[data-theme='dark'] .button {
    box-shadow: -3px 3px 0 rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.06);
}

/* small theme icon styling */
.theme-icon {
    display: inline-block;
    transform-origin: center;
    transition: transform 220ms ease;
}

.theme-icon {
    font-size: 1.5rem;
    /* or try 24px, 32px, etc. */
    color: #111 !important;
}

body[data-theme='dark'] .theme-icon {
    color: #111 !important;
}

body[data-theme='dark'] .theme-icon {
    transform: rotate(-20deg) scale(1.05);
}

/* Light-tinted shadows for dark theme so elements keep depth */
body[data-theme='dark'] .card {
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.04), 0 2px 6px rgba(255, 255, 255, 0.02) inset;
}

body[data-theme='dark'] .button {
    box-shadow: -4px 4px 0 rgba(255, 255, 255, 0.972);
}

body[data-theme='dark'] .footer-section,
body[data-theme='dark'] .top-nav .nav-inner {
    box-shadow: 0 8px 28px rgba(255, 255, 255, 0.03);
}

body[data-theme='dark'] .contrib-count {
    box-shadow: 0 4px 10px rgba(255, 255, 255, 0.04), -3px 3px 0 rgba(255, 255, 255, 0.756);
}

/* Make borders visible in dark mode with a subtle white tint */
body[data-theme='dark'] .card {
    border-color: rgba(255, 255, 255, 0.802);
}

body[data-theme='dark'] .button {
    border-color: rgb(11, 11, 11);
}

body[data-theme='dark'] .footer-section {
    border-color: rgba(255, 255, 255, 0.802);
}

body[data-theme='dark'] .links a {
    color: black;
}

body[data-theme='dark'] .top-nav .nav-inner {
    border-color: rgba(255, 255, 255, 0.802);
}

body[data-theme='dark'] .contrib-count {
    border-color: rgb(17, 17, 17);
}

/* Responsive improvements: tablet and mobile */
@media (max-width: 900px) {
    .content {
        margin: 6vh 6vw;
    }

    #heading {
        font-size: 36px;
    }

    #sub-heading {
        font-size: 18px;
    }

    p {
        font-size: 16px;
    }

    .card {
        width: calc(50% - 2rem);
        flex-basis: calc(50% - 2rem);
        height: auto;
    }

    .cards-section {
        gap: 2.2vw;
        padding: 0 4vw;
    }

    .footer-section {
        margin: 0 30px;
        padding: 1.6vw;
    }

    .cta-row {
        gap: 0.8rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 1.2vw;
    }

    .content {
        margin: 3.2vh 4vw;
        gap: 1.2vh;
    }

    #heading {
        font-size: 28px;
        line-height: 1.06;
        max-width: 92%;
    }

    #sub-heading {
        font-size: 16px;
        line-height: 1.25;
        max-width: 92%;
    }

    p {
        font-size: 15px;
        line-height: 1.6;
        max-width: 44ch;
        margin-top: 0.6rem;
    }

    /* CTA and hero */
    .cta-row {
        width: 100%;
        flex-direction: column;
        align-items: center;
    }

    .cta-row .button {
        width: min(90%, 340px);
        font-size: 0.95rem;
        padding: 0.7em 0.9em;
    }

    .cta-row .button.small {
        width: 56px;
        height: 56px;
        border-radius: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* cards stack full width */
    .cards-section {
        gap: 1rem;
        padding: 0 3vw;
    }

    .card {
        width: 100%;
        flex-basis: 100%;
        margin-bottom: 1rem;
        border-radius: 18px;
        height: auto;
    }

    .card-content {
        padding: 1rem;
        font-size: 15px;
        gap: 0.8rem;
    }

    /* navbar */
    .top-nav {
        top: 0.6rem;
    }

    .top-nav .nav-inner {
        padding: 0.5rem;
        width: calc(100% - 2rem);
    }

    .nav-logo {
        font-size: 18px;
    }

    .contrib-count {
        font-size: 1.1rem;
        padding: 0.2rem 0.5rem;
    }

    /* footer becomes vertical */
    .footer-section {
        flex-direction: column;
        gap: 0.6rem;
        align-items: stretch;
        margin: 0 10px;
        padding: 1rem;
    }

    .footer-section .left-sec,
    .footer-section .right-sec {
        width: 100%;
    }

    .links {
        justify-content: flex-start;
    }

    /* reduce heavy shadows on mobile for performance */
    .card,
    .footer-section,
    .top-nav .nav-inner {
        box-shadow: 6px 8px 20px rgba(0, 0, 0, 0.12);
    }
}