*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Custom Properties, update these for your own design */

:root {
    --ff-primary: 'Source Sans Pro', sans-serif;
    --ff-secondary: 'Source Code Pro', monospace;
    
    --fw-reg: 300;
    --fw-bold: 900;
    
    --clr-one: #181938;
    --clr-two: #e6e6e6;
    --clr-accent: #b4ade7;
    
    --fs-h1: 3rem;
    --fs-h2: 2.25rem;
    --fs-h3: 1.25rem;
    --fs-body: 1rem;
    
    --bs: 0.25em 0.25em 0.75em rgba(0,0,0,.25),
          0.125em 0.125em 0.25em rgba(0,0,0,.15);
}

@media (min-width: 800px) {
    :root {
        --fs-h1: 4.5rem;
        --fs-h2: 3.75rem;
        --fs-h3: 1.5rem;
        --fs-body: 1.125rem;
    }


}

@media (max-width: 800px) {
    body {
        justify-content: center;
        text-align: center;
    }
}

/* General styles */

html {
    scroll-behavior: smooth;
}

body {
    background: var(--clr-one);
    color: var(--clr-two);
    margin: 0;
    font-family: var(--ff-primary);
    font-size: var(--fs-body);
    line-height: 1.6;
}

section {
    padding: 5em 2em;
}

img {
    display: block;
    max-width: 100%;
}

strong { font-weight: var(--fw-bold) }

:focus {
    outline: 3px solid var(--clr-accent);
    outline-offset: 3px;
}

/* Buttons */

.btn {
    display: inline-block;
    padding: .5em 2.5em;
    background: var(--clr-accent);
    color: var(--clr-one);
    text-decoration: none;
    cursor: pointer;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: var(--fw-bold);
    transition: transform 200ms ease-in-out;
    align-self: center;
    margin: .5rem;
    outline: 1px solid var(--clr-accent);
}

.btn:hover {
    transition: .3s ease;
    background-color: transparent;
    color: var(--clr-accent);
}

.btn-alt {
    display: inline-block;
    padding: .5em 2.5em;
    background: transparent;
    color: var(--clr-accent);
    text-decoration: none;
    cursor: pointer;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: var(--fw-bold);
    transition: transform 200ms ease-in-out;
    align-self: center;
    margin: .5rem;
    outline: 1px solid var(--clr-accent);
}

.btn-alt:hover {
    transition: .3s ease;
    background-color: var(--clr-accent);
    color: var(--clr-one);
}

/* Typography */

h1,
h2,
h3 {
    line-height: 1;
    margin: 0;
}

h1 { font-size: var(--fs-h1) }
h2 { font-size: var(--fs-h2) }
h3 { font-size: var(--fs-h3) }


.section__title {
    margin-bottom: .25em;
    font-weight: var(--fw-reg);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section__title--intro {
    font-weight: var(--fw-reg);
}

.section__title--intro strong {
    display: block;
}

.section__subtitle {
    margin: 0;
    font-size: var(--fs-h3);
}
/* header */
.logo {
    color: var(--clr-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: var(--fw-bold);
    margin:0 3rem;
}

.nav {
    top: -50px;
    background: var(--clr-one);
    display: flex;
    width: 100%;
    color: var(--clr-one);
    position: fixed;
    z-index: 3;
    border: none;
    transition: ease .3s;
    align-items: center;
    padding: 0;
    box-shadow: var(--bs);
}

.nav__link {
    text-decoration: none;
}

a:focus {
    outline: none;
}

.hover-underline-animation {
    position: relative;
    color: var(--clr-accent);
}
  
.hover-underline-animation::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--clr-accent);
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}
  
.hover-underline-animation:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/*  Intro section  */

.intro {
    display: grid;
    grid-template-columns: 2fr 3fr; /* Allocate more space for the text column */
    align-items: center; /* Center items vertically */
    justify-content: center; /* Center the entire grid horizontally */
    gap: 4em; /* Space between columns */
}

.intro-content {
    order: 2; /* Ensure content comes first in the HTML flow (for accessibility) */
}

.intro__img {
    order: 1; /* Image will be placed second */
    max-width: 60%;
    height: auto;
    justify-self: end; /* Align image to the end of the grid column */
    border-radius: 50%; /* Rounded image */
    filter: contrast(1.25);
    box-shadow: var(--bs);
}

.intro-name {
    font-size: var(--fs-h1);
    color: var(--clr-accent);
}

.intro-links {
    margin: 0px;
    margin-right: 1rem;
}

@media (max-width: 800px) { /* Adjust breakpoint as needed */
    .intro {
        grid-template-columns: 1fr; /* Stack items on top of each other on smaller screens */
        text-align: center !important; /* Center the text for smaller screens */
    }

    .intro-content,
    .intro__img {
        order: 0; /* Reset the order for stacking */
    }

    .intro__img {
        justify-self: center; /* Center the image on smaller screens */
        width: 80%; /* Adjust the width to fit the screen */
        margin: 0 auto; /* Additional centering for the image */
    }
}

/*  Body section  */

.body {
    display: grid;
    grid-template-columns: 1fr 3fr;
    justify-content: center; /* Center the entire grid horizontally */
    align-items: start; /* Align the grid items to the top */
    padding: 2rem;
    margin: auto; /* Additional centering */
}

.body-tabs {
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: var(--fw-bold);
    justify-self: end;
    border-right: 1px solid #cccccc;
}

.tab-list {
    list-style: none;
    display: flex;
    flex-direction: column;
}

.tab {
    cursor: pointer;
    padding: 0.5rem 0.5rem;
    padding-right: 4rem;
    margin-bottom: 0.5rem;
}

.tab.active {
    color: var(--clr-two);
}

.body-content {
    padding-left: 2rem;
}

.content-item {
    display: none;
}

.content-item.active {
    display: block;
}

@media (max-width: 800px) {
    .body {
        display: block;
        justify-content: center; /* Center the entire grid horizontally */
        align-items: start; /* Align the grid items to the top */
        padding: 2rem;
        margin: auto; /* Additional centering */
    }

    .tab-list {
        flex-direction: row; /* Make tabs horizontal */
        justify-content: center; /* Center tabs if needed */
        flex-wrap: wrap; /* Wrap tabs to new line if they don't fit */
    }

    .tab {
        margin-right: 0.5em; /* Add space between tabs, adjust as needed */
        margin-bottom: 0; /* Remove bottom margin if set in default */
        padding: 1rem;
    }

}

/* Education */

.body-list {
    list-style-type: none; /* Removes default list styling */
    padding-left: 0; /* Removes default padding */
}

.body-item {
    margin-bottom: 1rem; /* Space between education entries */
    padding-bottom: 1rem;
    border-bottom: 1px solid #cccccc;
}

.sub-heading {
    font-weight: var(--fw-reg);
}

.heading {
    display: block; /* Puts the degree on a new line */
    font-weight: var(--fw-reg);
    color: var(--clr-accent);
    padding-bottom: 0.5rem;
}

.dates,
.location {
    display: block; /* Puts dates and location on new lines */
    font-style: italic;
    font-size: .9rem;
}

.detail-title {
    padding-top: 1rem;
    font-size: .9rem;
    margin: 0;
}

.detail {
    list-style-type: circle; /* Adds bullet points */
    padding-left: 3rem; /* Indentation for the coursework list */
    font-size: .9rem;
}

@media (max-width: 800px) {
    .dates,
    .location {
        display: inline; /* Puts dates and location on new lines */
        font-style: italic;
        font-size: .8rem;
    }

    .detail {
        list-style-type: none;
        padding: 0;
        font-size: .9rem;
    }
}

/* Project Modal */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black background with opacity */
}

.modal-content {
    background-color: var(--clr-two);
    margin: 5% auto; /* Adjusted for better visibility */
    padding: 2rem;
    gap: 2rem;
    width: 80%; /* Adjust width as needed */
    display: flex; /* Make this a flex container */
    align-items: flex-start; /* Align items to the start of the flex container */
    position: relative; /* For absolute positioning of the close button */
    border-radius: 20px;
}

.close-button {
    color: var(--clr-accent);
    position: absolute; /* Absolute positioning to place it on the top right corner */
    top: 10px; /* Adjust as needed */
    right: 15px; /* Adjust as needed */
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: var(--clr-one);
    text-decoration: none;
}

.modal-img {
    max-width: 30%; /* Increase the width of the image */
    height: auto;
    margin-right: 20px; /* Add some space between the image and the text */
    box-shadow: var(--bs);
    object-fit: cover; /* Ensure the image covers the area without distorting */
    flex: 1; 
}

/* Style adjustments for the text content to take remaining space */
.text-content {
    width: 50%;
    color: var(--clr-one)
    /* Allow the text content to fill the remaining space */
}

/* Ensure modal content does not overflow the viewport */
@media (max-width: 768px) {
    .modal-content {
        flex-direction: column; /* Stack image and text vertically on smaller screens */
    }
    .modal-img {
        max-width: 100%;
        margin-bottom: 20px; /* Add space between the image and text */
    }
    .text-content {
        max-width: 100%;
    }
}


.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-section-heading {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: var(--fw-bold);
}

.modal-content {
    order: 2;
}

.modal-title {
    font-size: 2rem;
}

.modal-subtitle {
    margin: 0;
    font-size: var(--fs-h3);
    padding-bottom: 1rem;
    line-height: 1.75rem;
}

.modal-link {
    font-style: italic;
    color: var(--clr-one);
    text-decoration: none;
    border-bottom: 1px dashed var(--clr-one);
}

.modal-link:hover {
    color: var(--clr-accent);
    border-bottom: 1px solid var(--clr-accent);
    transition: ease .3s;
}

.portfolio {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.portfolio__item {
    background: var(--clr-accent);
    overflow: hidden;
    margin: 1rem;
    position: relative;
    height: 175px; /* Adjust as needed */
    align-self: center;
    transition: filter 250ms linear;
    border-radius: 20px;
}

.portfolio__img {
    width: 100%;
    height: auto;
    object-fit:fill;
    filter: brightness(.3);
    transition: transform 750ms cubic-bezier(.5, 0, .5, 1), opacity 250ms linear;
}

.portfolio__item:focus {
    position: relative;
    z-index: 2;
}

.portfolio__img:hover,
.portfolio__item:focus .portfolio__img {
    transform: scale(1.2);
    opacity: .5;
}

.portfolio__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--clr-two);
    font-size: 1.5rem;
    text-align: center;
    pointer-events: none;
}

/* Skills */

.skills-container {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.skills-column {
    gap: 1rem;
}

.skills-category-title {
    font-weight: var(--fw-reg);
    color: var(--clr-accent);
    margin-bottom: 0.5rem;
}

.skills-list {
    font-size: 1rem;
    list-style-type: none; /* Remove default list styling */
    padding-left: 0; /* Remove default padding */
    columns: 2; /* Create two columns for each list */
    -webkit-columns: 2; /* For Safari and older browsers */
    -moz-columns: 2; /* For Firefox */
}

.skills-list-single {
    font-size: 1rem;
    list-style-type: none; /* Remove default list styling */
    padding-left: 0; /* Remove default padding */
}

.skills-list li {
    margin-bottom: 0.25rem; /* Space between list items */
    break-inside: avoid-column; /* Prevent breaking items across columns */
}

@media (max-width: 768px) {
    .skills-container {
        flex-direction: column;
    }

    .skills-column {
        width: 100%; /* Each column takes full width on smaller screens */
    }

    .skills-list {
        columns: 1; /* Fall back to one column on smaller screens */
        -webkit-columns: 1;
        -moz-columns: 1;
    }
}


/* Social */

.social-list__link:hover {
    opacity: .7;
}

.social-list {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 2em 0 0;
    padding: 0;
}

.social-list__item {
    margin: 0 .5em;
    color: var(--clr-accent);
}

.social-list__link {
    background: transparent;
    color: var(--clr-accent);
    text-align: center;
    font-size: var(--fs-h3);
    padding: 0 .5em;
}
