:root {
    /* Colors */
    --background-color: #000000;
    --background: #0b0b0b;
    --color: #f3ebeb;
    --border-color: rgb(255, 255, 255);
    --color-text-muted: #bdbdbd;
    --color-accent: rgba(255, 255, 255, 0.18);
    --color-accent-mid: rgba(170, 170, 176, 0.07);
    --color-footer-muted: #afafaf;
    --theme-background-color: black;

    /* Typography */
    --font-family: 'Inter', Arial, sans-serif;
    --font-light: 200;
    --font-bold: 700;
    --font-size-h1: 2.5rem;
    --font-size-subtitle: 0.9rem;
    --font-size-nav: 1rem;
    --font-size-bio: 0.93rem;
    --font-size-footer: 0.85rem;
    --font-size-footer-small: 0.7em;

    /* Layout & Spacing */
    --container-radius: 20px;
    --container-padding: 2vw;
    --nav-gap: 40px;
    --nav-padding: clamp(24px, 2vw, 32px) clamp(12px, 1.5vw, 24px) clamp(15px, 1vw, 16px) clamp(12px, 1.5vw, 24px);
    --nav-gap-between: 32px;
    --bio-width: 175px;
    --gap-small: 8px;
    --gap-medium: 32px;

    /* Effects */
    --box-shadow-elevated: 0 6px 24px #0007;
    --blur-background: 0.5px;
    --brightness-background: 0.55;
    --contrast-background: 1.65;
    --glow: white;

    overflow-y: auto;
    height: auto;
    width: 100vw;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    background: var(--background-color);
    color: var(--color);
    font-family: var(--font-family);
    font-weight: var(--font-light);
    height: 100vh;
    width: 100vw;
    overflow: auto;
}

body.light-mode {
    --background-color: #fafafa;
    --background: #ffffff;
    --color: #1a1a1a;
    --border-color: #1f1e1e;
    --color-text-muted: #6e6e6e;
    --color-accent: rgba(0, 0, 0, 0.936);
    --color-accent-mid: rgba(44, 42, 42, 0.922);
    --color-footer-muted: #7a7a7a;
    --theme-background-color: white;
    --glow: black;
}

#links {
    text-decoration: none;
    color: inherit;
    position: absolute;
    z-index: 2;
    left: 3vw;
    top: 5px;
    font-size: 2rem;
}

a,
a:visited {
    color: inherit;
}

nav {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: var(--nav-gap);
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    font-weight: clamp(4px, 1vw, 8px);
    color: var(--color);
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: var(--nav-padding);
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: var(--nav-gap-between);
}

nav a{
    color: var(--color);
    cursor: pointer;
    position: relative;
    padding: 4px 0;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--color-text-muted);
}

#clock {
  position: absolute;
  top: 5px;
  right: 3vw;
  font-size: 1.2rem;
  font-family: var(--font-family);
  color: white;
  background: rgba(0,0,0,0.5);
  padding: 6px 12px;
  border-radius: 8px;
  z-index: 2;
}

.themePosition {
    border-radius: 50%;
    position: absolute; 
    top: 4.5rem;
    right: 3vw;
    width: 45px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background-color: var(--theme-background-color);
}

.themePosition img {
    position: absolute;
    width: 32px;
    height: 32px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 0;
}

body.light-mode .themePosition .sun { display: block;}
body.light-mode .themePosition .moon { display: none; }

body.dark-mode .themePosition .sun { display: none; }
body.dark-mode .themePosition .moon { display: block; }

.container {
    position: sticky;
    top: 0px;
    border: 1px solid var(--border-color);
    border-radius: var(--container-radius);
    height: 99vh;
    width: 96vw;
    margin: auto;
    overflow: auto;
    box-shadow: 0 6px 24px rgba(68, 67, 67, 0.467);
    background: var(--background-color);
    z-index: 1;
}


header {
    position: absolute;
    top: 44px;
    left: 2vw;
    z-index: 2;
}

h1 {
    margin-top: 1.25rem;
    margin-right: 3.75rem;
    font-size: var(--font-size-h1);
    font-weight: var(--font-light);
    letter-spacing: 0.03em;
}

.subtitle {
    position: relative;
    font-size: var(--font-size-subtitle);
    color: var(--color-text-muted);
    margin-top: -1.25rem;
}

.bio {
    position: absolute;
    bottom: 25px;
    right: 2vw;
    width: var(--bio-width);
    text-align: left;
    font-size: var(--font-size-bio);
    line-height: 1.55;
    color: var(--color);
    z-index: 2;
}

footer {
    position: absolute;
    bottom: 35px;
    left: 0;
    width: calc(100% - 36px);
    z-index: 5;
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-footer);
    color: var(--color-text-muted);
}

footer .copyright {
    position: absolute;
    left: 3vw;
    bottom: -1rem;
    font-size: var(--font-size-footer-small);
    color: var(--color-footer-muted);
}

footer .quote {
    position: absolute;
    right: 1vw;
    bottom: -1rem;
    font-size: var(--font-size-footer-small);
    color: var(--color-footer-muted);
}

.background {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 180px 16px, var(--color-accent) 0%, var(--color-accent-mid) 20%, transparent 8%),
                radial-gradient(circle at right bottom, var(--color-accent) 0%, var(--color-accent-mid) 20%, transparent 8%),
                radial-gradient(circle at 70px calc(100%), var(--color-accent) 0%, var(--color-accent-mid) 7%, transparent 8%);
    z-index: 1;
    filter: blur(var(--blur-background)) brightness(var(--brightness-background)) contrast(var(--contrast-background));
    mix-blend-mode: lighten;
    pointer-events: none;
}

.bold {
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    font-size: 1.1em;
    font-weight: var(--font-bold) !important;
    text-shadow: 0px 0px 20px var(--glow);
}

.title {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
}

.scroll {
    z-index: 2;
    position: sticky;
    height: auto;
    width: 94vw;
    margin: 1vh auto;
    background-color: var(--background-color); 
    color: var(--color); 
    text-align: center;
    border-radius: 2rem;
}

.projects,
.about-me,
.contact {
    border-top: 0.3vh solid var(--border-color);
    border-radius: 2rem;
    margin-bottom: 2vh;
    padding-bottom: 2vh;
}

.cards {
    display: flex;
    flex-wrap: wrap;
    margin: none;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    justify-content: center;
    gap: clamp(10px, 1vh, 100px) 1vw;
    align-items: stretch;
}

.projectsCard {
    background: var(--background-color);
    width: 35vw;
    height: auto;
    margin: 10px;
    border: 1px solid var(--border-color);
    border-radius: 0.9rem;
    color: var(--color);
    text-decoration: none !important;
}

.card-image {
    background-color: #000000;
    width: 35vw;
    height: 19.8vw;
    background-size: cover;
    border-radius: 0.9rem 0.9rem 0 0;
    flex-grow: 0;
}

.projects .cards .projectsCard .tech {
    display: flex;
    gap: 10px;

}
.projects .cards .projectsCard .tech p {
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 10px;
    margin-left: auto;
    margin-right: auto;
}

.projects .cards .projectsCard .card-content .description {
    margin-top: -5px;
}

.card-1 {
    background-image: url(images/portfolio.png);
}

.card-2 {
    background-image: url(images/mario-working.gif);
}

.card-3 {
    background-image: url(images/mario-working.gif);
}

.card-4 {
    background-image: url(images/mario-working.gif);
}

a {
    text-decoration-line: none;
}

.cards .projectsCard a span {
    border: 1px solid rgb(87, 84, 84);
    padding: 5px;
    border-radius: 8px;
    color: var(--color);
    align-items: center;
    margin-left: auto;
}

.projectsCard:hover,
.projectsCard span:hover{
    box-shadow: 0 0 1.5rem var(--color);
}


.about-me-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.about-me-container > div:last-child {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    margin-left: .5rem;
    margin-right: 1.5rem;
}

.frame {
    position: relative;
    width: 18vw;
    height: 18vw;
    flex-shrink: 0;
}

.image-background {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: brown;
    top: 0;
    left: 0;
    z-index: 0;
}

.my-img {
    position: absolute;
    width: 90%;
    height: 90%;
    left: 10vw;
    top: 40%;
    transform: translate(-50%, -50%);
    z-index: 1;
}

#contact {
    text-align: center;
}

#contact h2 {
    margin-bottom: 40px;
}

#contact .intro {
    margin-bottom: 20px;
    color: var(--color);
}

.contact-container {
    max-width: 600px;
    margin: auto;
    text-align: left;
}

.contact-info {
    margin-bottom: 30px;
}

.contact-info a {
    color: #007BFF;
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-form textarea,
.contact-form button {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.contact-form textarea {
    min-height: 120px;
    resize: vertical;
}

.contact-form button {
    border: none;
    background: #007BFF;
    color: white;
    cursor: pointer;
    transition: background 0.3s;
}

.contact-form button:hover {
    background: #0056b3;
}


@media (max-width: 724px) {
    .projectsCard {
        width: 85vw;
        height: auto;
    }

    .card-image {
        width: 85vw;
        height: 45vw;
    }

    .about-me-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .about-me-container > div:last-child {
        margin-right: 1rem;
        margin-bottom: 1.5rem;
        flex: none;
    }

    .frame {
        width: 40vw;
        height: 40vw;
        margin-top: 1rem;
    }

    .my-img {
        width: 90%;
        height: 90%;
        left: 50%;
    }

    .contact-form input,
    .contact-form textarea,
    .contact-form button {
        width: 90vw;
    }
}

@media (max-width: 600px) {
    #links {
        font-size: 5vw;
    }

    #clock {
        font-size: 1rem;
    }
}

@media (max-width: 550px) {
    #links {
        font-size: 4vw;
        top: 12px;
    }

    #clock {
        font-size: .8rem;
    }
}

@media (max-width: 500px) {
    #links {
        font-size: 1rem;
        top: 15px;
    }
}