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


/* General rules */
body {
    font-family: 'Open Sans', sans-serif;
    display: flex;
    flex-direction: column;
    max-width: 62.5rem;
    margin: 0 auto;
    padding: 0 12px;
    background-color:#F5F5F5;
}

/* body {
    margin: 0;
    padding: 48px 0;
    font-size: 1.2rem;
    line-height: 1.6rem;
    min-height: 100vh;
} */

section {
    margin: 1rem 0 2.5rem 0;
}

h2 {
    font-family: "Raleway", sans-serif;
    margin-bottom: 0.75rem;
}

#projects h2,
#skills h2,
#contact h2 {
    margin-bottom: 1rem;
}

.center {
    text-align: center;
}


/* Nav Section */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #040D12;
    height: 5rem;
    border-radius: 0 0 3px 3px;
}

header nav ul {
    display: flex;
}

nav li {
    margin: .5rem;
    list-style: none;
}

nav a {
    text-decoration: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: #F5F5F5;
}

nav a:hover {
    cursor: pointer;
}

#logo a {
    font-family: "Raleway", sans-serif;
    text-decoration: none;
    font-size: 2rem;
    color: #F5F5F5;
    margin-left: .5rem;
}

header .mobile-navigation {
    display: none;
}


/* The switch - the box around the slider */
.switch {
    /* Variables */
   --switch_width: 2em;
   --switch_height: 1em;
   --thumb_color: #e8e8e8;
   --track_color: #e8e8e8;
   --track_active_color: #888;
   --outline_color: #000;
   font-size: 17px;
   position: relative;
   display: inline-block;
   
   width: var(--switch_width);
   height: var(--switch_height);
}
  
  /* Hide default HTML checkbox */
.switch input {
   opacity: 0;
   width: 0;
   height: 0;
}
  
  /* The slider */
.slider {
   box-sizing: border-box;
   border: 2px solid var(--outline_color);
   position: absolute;
   cursor: pointer;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background-color: var(--track_color);
   transition: .15s;
   border-radius: var(--switch_height);
}
  
.slider:before {
   box-sizing: border-box;
   position: absolute;
   content: "";
   height: var(--switch_height);
   width: var(--switch_height);
   border: 2px solid var(--outline_color);
   border-radius: 100%;
   left: -2px;
   bottom: -2px;
   background-color: var(--thumb_color);
   transform: translateY(-0.2em);
   box-shadow: 0 0.2em 0 var(--outline_color);
   transition: .15s;
}
  
input:checked + .slider {
   background-color: var(--track_active_color);
}
  
input:focus-visible + .slider {
   box-shadow: 0 0 0 2px var(--track_active_color);
}
  
/* Raise thumb when hovered */
input:hover + .slider:before {
   transform: translateY(-0.3em);
   box-shadow: 0 0.3em 0 var(--outline_color);
}
  
input:checked + .slider:before {
   transform: translateX(calc(var(--switch_width) - var(--switch_height))) translateY(-0.2em);
}
  
/* Raise thumb when hovered & checked */
input:hover:checked + .slider:before {
   transform: translateX(calc(var(--switch_width) - var(--switch_height))) translateY(-0.3em);
   box-shadow: 0 0.3em 0 var(--outline_color);
}


/* Media query for Nav Section, 1 */
@media only screen and (max-width: 895px) {
    header .desktop-navigation {
        display: none;
    }

    header .mobile-navigation {
        display: block;
        width: 100%;
    }

    header {
        padding: .5rem;
    }

    #logo a {
        font-size: 1.5rem;
        margin-left: 0;
    }
    
    header .mobile-navigation ul {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }

    header .mobile-navigation li {
        padding: 0;
    }
}

/* Media query for Nav Section, 2 */
@media only screen and (max-width: 629px) {
    header h1 {
        line-height: 20px;
    }

    #logo a {
        text-decoration: none;
        font-size: 1.2rem;
        /* font-weight: bold;
        color: #F5F5F5; */
    }
}


/* About Me Section */
.about-me-container {
    display: flex;
}

.about-me-text {
    margin-right: 2rem;
}

.about-me-text p {
    margin: 1rem 0;
}

.portrait img {
    width: 18.75rem;
    flex-shrink: 0;
    margin-top: 3.125rem;
    border-radius: 6px;
}

/* Media query for About Me section, 1*/
@media only screen and (max-width: 610px) {
    .about-me-container {
      flex-direction: column;
    }

    .portrait {
        margin: 0 auto;
    }
}


/* Projects Section */
summary {
    cursor: pointer;
    display: inline;
    font-size: 1.3rem;
}

/* New Cards*/
.articles article {
    --img-scale: 1.001;
    --title-color: #040D12;
    --link-icon-translate: -20px;
    --link-icon-opacity: 0;
    position: relative;
    border-radius: 9px;
    box-shadow: none;
    /* background: #f0f0f0; */
    transform-origin: center;
    transition: all 0.4s ease-in-out;
    overflow: hidden;
    border: 1px solid #040D12;
}

.background_light {
    width: 100%;
    height: 100%;
    --color: #E1E1E1;
    background-color: #F3F3F3;
    background-image: linear-gradient(0deg, transparent 24%, var(--color) 25%, var(--color) 26%, transparent 27%,transparent 74%, var(--color) 75%, var(--color) 76%, transparent 77%,transparent),
        linear-gradient(90deg, transparent 24%, var(--color) 25%, var(--color) 26%, transparent 27%,transparent 74%, var(--color) 75%, var(--color) 76%, transparent 77%,transparent);
    background-size: 55px 55px;
}

.background_dark {
    width: 100%;
    height: 100%;
    --color: rgba(114, 114, 114, 0.3);
    background-color: #191a1a;
    background-image: linear-gradient(0deg, transparent 24%, var(--color) 25%, var(--color) 26%, transparent 27%,transparent 74%, var(--color) 75%, var(--color) 76%, transparent 77%,transparent),
        linear-gradient(90deg, transparent 24%, var(--color) 25%, var(--color) 26%, transparent 27%,transparent 74%, var(--color) 75%, var(--color) 76%, transparent 77%,transparent);
    background-size: 55px 55px;
}

.articles article a::after {
    position: absolute;
    inset-block: 0;
    inset-inline: 0;
    content: "";
}
  
/* basic article elements styling */
.articles article h2 {
    margin: 0 0 18px 0;
    font-size: 1.9rem;
    letter-spacing: 0.06em;
    color: var(--title-color);
    transition: color 0.3s ease-out;
}
  
.articles figure {
    margin: 0;
    padding: 0;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-bottom: 1px solid #040D12;
    border-radius: 0 0 3px 3px;
}
  
.articles article img {
    max-width: 100%;
    transform-origin: center;
    transform: scale(var(--img-scale));
    transition: transform 0.4s ease-in-out;
}
  
.articles .article-body {
    padding: 24px;
}
  
.articles article a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #040D12;
}
  
.articles article a:focus {
    outline: 1px dotted #040D12;
}
  
.articles article a .icon {
    min-width: 24px;
    width: 24px;
    height: 24px;
    margin-left: 5px;
    transform: translateX(var(--link-icon-translate));
    opacity: var(--link-icon-opacity);
    transition: all 0.3s;
}
  
/* using the has() relational pseudo selector to update our custom properties */
.articles article:has(:hover, :focus) {
    --img-scale: 1.1;
    --link-icon-translate: 0;
    --link-icon-opacity: 1;
    box-shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px, rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;
}

  
.articles {
    display: grid;
    max-width: 62.5rem; /* 1200px */
    margin-inline: auto;
    padding-inline: 2px; /* 24px */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.3rem;
}

  
.sr-only:not(:focus):not(:active) {
    clip: rect(0 0 0 0); 
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap; 
    width: 1px;
}


.article-body .categories {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    flex-direction: row;
    gap: 10px;
}
  
.article-body .categories span {
    color:#F5F5F5;
    background-color: #040D12;
    padding: 4px 8px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    border-radius: 50em;
}

@media screen and (max-width: 960px) {
    .articles article {
      container: card/inline-size;
    }
    /* .articles .article-body p {
      display: none;
    } */
}
  
@container card (min-width: 380px) {
    .articles .article-wrapper {
      display: grid;
      grid-template-columns: 100px 1fr;
      gap: 16px;
    }
    .article-body {
      padding-left: 0;
    }
    .articles figure {
      width: 100%;
      height: 100%;
      overflow: hidden;
    }
    .articles figure img {
      height: 100%;
      aspect-ratio: 1;
      object-fit: cover;
    }
}

/* Buttons */
.new_cards_buttons {
    margin-top: 1.25rem;
    padding-top: .625rem;
    border-top: 1px solid grey;
}

button {
    --button_radius: 0.75em;
    --button_color: #e8e8e8;
    --button_outline_color: #000000;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --highlight-color: rgba(255, 255, 255, 0.2);
    font-size: 17px;
    font-weight: bold;
    border: none;
    border-radius: var(--button_radius);
    background: linear-gradient(
      to bottom right,
      var(--highlight-color),
      var(--shadow-color)
    );
    box-shadow: 6px 6px 16px var(--shadow-color),
      -6px -6px 16px var(--highlight-color);
    cursor: pointer;
}
  
.button_top {
    display: block;
    box-sizing: border-box;
    border: 2px solid var(--button_outline_color);
    border-radius: var(--button_radius);
    padding: 0.70em 1.2em;
    background: var(--button_color);
    color: var(--button_outline_color);
    transform: translateY(-0.2em);
    transition: transform 0.1s ease;
}
  
button:hover .button_top {
    transform: translateY(-0.33em);
}
  
button:active .button_top {
    transform: translateY(0);
}

button .demo {
    --button_color: #e8e8e8;
    --button_outline_color: #000000;
}

button .github {
    background: #000000;
    color: #e8e8e8;
}


/* Skills Section */
#skills {
    padding-bottom: 5rem;
}

.skill-icons {
    /* display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    flex-direction: row;
    width: 100%;
    margin-top: .5rem; */

    display: grid;
    grid-template-columns: repeat(8, 1fr); /* 8 icons per row */
    gap: 1rem; /* Adjust spacing between icons */
    justify-items: center; /* Center icons horizontally */
    align-items: center; /* Center icons vertically */
}

.skill-icons i {
    /* margin-right: 1rem; */
    margin-bottom: 1rem;
}

.skill-icons-svg {
    width: 3rem;
}

.skill-icons i:hover {
    /* animation: fa-bounce 1s infinite; */
    animation: fa-shake 2s infinite;
}

/* Media query for medium screens (e.g., tablets) */
@media (max-width: 768px) {
    .skill-icons {
        grid-template-columns: repeat(4, 1fr); /* 4 icons per row on smaller screens */
    }
}

/* Media query for smaller screens (e.g., phones) */
@media (max-width: 480px) {
    .skill-icons {
        grid-template-columns: repeat(2, 1fr); /* 2 icons per row on very small screens */
    }
}


/* Contact Section */
#contact {
    margin-bottom: 1rem;
}

.contact-sites {
    margin-top: .5rem;
}

.contact-sites ul {
    display: flex;
    justify-content: center;
}

.contact-sites li {
    list-style: none;
    margin-right: 1.5rem;
    width: 2.3rem;
}

.contact-sites li:hover {
    animation: fa-shake 2s infinite;
}

.contact-sites img {
    max-width: 100%;
    height: auto;
    display: block;
}

.tooltip {
    margin-left: 10px;
    color: #040D12;
    font-size: 0.9rem;
    font-weight: bold;
}

/* Media query for Contact section, 1*/
@media only screen and (max-width: 610px) {
    .contact-sites {
        text-align: center;
        margin-top: 2rem;
    }
}


/* Footer Section */
footer {
    margin-top: auto;
    padding: 0.75rem 0;
    color: white;
    background-color: #040D12;
    border-radius: 3px 3px 0 0;
}