/* TODO: Make all css variables which include the following:
  *- Fronts
  *- Spacings (According to rem or em, since px is fixed)
  *- Border radius and other settings
  *- Colors
  - Dark and Light mode - ✅
  - Make it work on mobile - ✅*/
:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif; /* Sets default font for the site */
  
  /* Default Values */
  --text-color: rgba(20, 20, 20, 0.87);
  --accent-color: #147052;/*#9359d5;*/
  --background-color: #d6d2dd;
  --background-color-dark: color-mix(in oklab, var(--background-color) 85%, black);
  --background-color-dark-frosted: color-mix(in oklab, var(--background-color-dark) 20%, transparent);;
  --background-color-light: color-mix(in oklab, var(--background-color) 85%, white);

  --default-margin-left: 90px;
  --default-margin-right: 90px;

  --main-h1-font-size: clamp(1rem, calc(1.25vw + 1rem), 2.5rem);
  --h1-font-size: clamp(0.75rem, calc(1vw + 1rem), 2rem);
  --h2-font-size: clamp(0.5rem, calc(1vw + 0.25rem), 2rem);
  --h3-font-size: clamp(0.25rem, calc(0.85vw + 0.1rem), 1.25rem);
  --p-font-size: clamp(0.2rem, 1rem, 1rem);
  
  /* --h1-font-size-mobile: 1.1rem;
  --h2-font-size-mobile: 1rem;
  --h3-font-size-mobile: 0.9rem;
  --p-font-size-mobile: clamp(0.2rem, 1rem, 1rem); */

  color-scheme: light dark;                                     /* Enables automatic dark/light mode support */
  color: var(--text-color);                             /* Sets default text color */
  background-color: var(--background-color);                                    /* Sets default background color */


  font-synthesis: none;                                         /* Prevents browser from faking bold/italic */
  text-rendering: optimizeLegibility;                           /* Improves text rendering for legibility */
  -webkit-font-smoothing: antialiased;                          /* Smoother font on WebKit browsers */
  -moz-osx-font-smoothing: grayscale;                           /* Smoother font on Firefox/macOS */
}

/* Darkmode Class (just changing colors for now) */
.darkmode {
  --text-color: rgba(255, 255, 255, 0.87);
  --accent-color: #59d5ac;
  --background-color: #1d1d1d;
}

.mobile {
  --default-margin-left: 25px;
  --default-margin-right: 25px;

  --h1-font-size: 1.1rem;
  --h2-font-size: 1rem;
  --h3-font-size: 0.9rem;
  --p-font-size: clamp(0.2rem, 1rem, 1rem);
}

#bg {
  /* Fixed position allows it to stay in place, like a backgorund,
  while z-index actually puts it behind the other elements */
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
}

body {
  margin: 0;
}

head {
  color: var(--accent-color);
}

#app {
  margin-left: var(--default-margin-left);
  margin-right: var(--default-margin-right);
  /* scroll-snap-type: y mandatory; */
}header {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding-bottom: 15px;
    background-color: var(--background-color);
    /* *This is going to be the sides for now, and blurring has been removed so that palcement and styling is simpler */
    box-shadow: 100px 0 0 0 var(--background-color), -100px 0 0 0 var(--background-color);
    /* Making this box shadow cover the sides of the header since the actual header is too small to hide everything */
    /* First shadow is for the blur shadow effect */
    /* box-shadow: 0 0 20px 10px var(--background-color), 100px 0 20px 20px var(--background-color), -100px 0 20px 20px var(--background-color); */
}

#home-button {
    flex: 1;                      /* Flexing according to header */
    display: flex;
    align-items: center;             /* *Should be center if image is available */
    gap: 10px;
    margin-top: 30px;
    overflow: hidden;
}

/* Home Button Text */
#home-button h2 {
    font-weight: 400;
    font-size:  var(--h3-font-size);
    /* margin: 0; */
}

/* Home Button Image */
#home-button img {
    position: relative;
    /* Fix the positioning of the top when changing to mobile */
    top: 54px;
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
}

/* navbar containing the list */
nav {
    flex: 3;                      /* Flexes according to header */
}

/* List item in nav bar */
nav ol {
    display: flex;                /* Makes the list horizontal */
    justify-content: flex-end;    /* Aligns list to the right */
    list-style-type: decimal;     /* Ensures numbers are shown */
    padding: 0;
    margin: 0;
    padding-right: 50px;         /* Giving some space between navbar and page edge */
    padding-top: 40px;
}

/* Each item in nav bar */
nav ol li {
    cursor: pointer;
    margin-right: 35px; /* Fixed space between items */
    padding-left: 10px;
    font-size: var(--h3-font-size);
}

nav ol li:hover {
    color: var(--accent-color);
}

/* This is where the vertical line is made */
nav ol li::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 2em;
    background: #888;                 /* Color of Line */
    margin-left: 17px;                  /* space between text and line */
    vertical-align: middle;
}

nav ol li:last-child {
    margin-right: 0; /* More margin at last item */
}

/* The last child's line in ol */
nav ol li:last-child::after {
    visibility: hidden;
}

/* Number before item in nav bar */
nav ol li::marker {
    color: var(--accent-color);
    font-weight: bold;
}

#theme-switch {
    height: 50px;
    width: 50px;
    padding: 8px;
    margin-top: 25px;
    border-width: 0;
    border-radius: 50%;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

#theme-switch:hover {
    background-color: var(--background-color-dark);
    cursor: pointer;
}

#theme-switch svg {
    width: 24px;
    height: 24px;
    fill: var(--accent-color);
    stroke: var(--accent-color);
    stroke-width: 0.5px;
}

/* Making the sun turned off if it's light mode */
#theme-switch svg:last-child {
    display: none;
}

/* Making the moon turned off if it's dark mode */
.darkmode #theme-switch svg:first-child {
    display: none;
}

/* Making the sun turn on if it's dark mode */
.darkmode #theme-switch svg:last-child {
    display: block;
}

#nav-menu-button {
    height: 50px;
    width: 50px;
    padding: 8px;
    margin-top: 25px;
    border-width: 0;
    border-radius: 20%;
    background-color: var(--background-color);
    color: var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

#nav-menu-button:hover {
    background-color: var(--background-color-dark);
    cursor: pointer;
}

#nav-menu-button svg {
    width: 24px;
    height: 24px;
    fill: var(--accent-color);
}

#nav-menu-close-button {
    position: absolute;
    top: 25px;
    right: 25px;
    height: 50px;
    width: 50px;
    padding: 8px;
    border-width: 0;
    border-radius: 20%;
    background-color: var(--background-color);
    color: var(--accent-color);
    display: flex;
    justify-content: center;
    align-items: center;
}

#nav-menu-close-button:hover {
    background-color: var(--background-color-dark);
    cursor: pointer;
}

#nav-menu-close-button svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
    stroke: none;
}

#dropdown {
    display: none;
}

#dropdown nav {
    position: fixed;
    background-color: var(--background-color);
    display: none;
    align-items: flex-start;
    justify-content: flex-start;
    top: 0;
    left: 0;
    /* ! Make sure that the height and width make no more scrolling amount */
    width: 100%;
    height: 100%;
}

#dropdown nav ol {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3.5rem;
    padding: 0;
    margin: 0;

    padding-left: 50px;         /* Giving some space between navbar and page edge */
    padding-top: 5rem;
}

#dropdown nav ol li {
    font-size: xx-large;
    cursor: pointer;
    margin-top: 5px;
}

#dropdown nav ol li::after {
    display: none;
}
#hero-section {
    display: flex;
    height: 100dvh;
}

/* Making it's children: h1, h2, p tags take up 1 out of 2.5 of hero-section with a flex of 1 */
#hero-section span {
    margin: 0;
    margin-top: 15%;
    flex: 1
}

/* This is the where my name is styled */
#hero-section h1 {
    margin: 0;
    font-size: clamp(1.5rem, calc(3vw + 1rem), 5rem);
    display: inline-block;
    color: var(--accent-color);
    /* The glow is coming from the typescript in effects.ts and is being called in main.ts */
}

.mobile #hero-section h1 {
    font-size: calc(var(--main-h1-font-size) + 2rem);
}

/* This is where the occupancy is stlyed */
#hero-section h2 {
    margin: 0;
    margin-top: 20px;
    font-size: var(--h1-font-size);
}

/* This is where my small about me is styled */
#hero-section p {
    margin: 0;
    margin-top: 5px;
    font-size: var(--h2-font-size);
    line-height: 30px;
}

/* Spacer for hero-section taking up the other 1.5 out of 2 of the screen with flex of 1.5 */
#hero-section div {
    flex: 1.5;
    margin: 0;
    width: 80px;
    /* background-color: rgba(255, 186, 186, 0.89);      /* To be used to see what space div is taking up */
}

/* Removing the spacer for mobile since there is no planets on mobile */
.mobile #hero-section div {
    display: none;
}#experience-section {
    --experience-breakpoint-top-space: 28px;
    --experience-breakpoint-bottom-space: 36px;
    --experience-title-height: 0px;
    --experience-title-gap: 12px;
    min-height: 130vh;
    position: relative;
}

#experience-section > h1 {
    position: sticky;
    top: var(--experience-sticky-top, 95px);
    z-index: 10;
    font-size: var(--main-h1-font-size);
    
    /* Shadow effect */
    background-color: var(--background-color);
    box-shadow: 0 10px 0 20px var(--background-color);
}

#timeline-experiences-container {
    display: contents;
}

/* Parent element to timeline hollow and all the experience breakpoints */
#timeline {
    position: sticky;
    top: calc(var(--experience-sticky-top, 95px) + var(--experience-title-height) + var(--experience-title-gap));
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
    padding-top: var(--experience-breakpoint-top-space);
    padding-bottom: var(--experience-breakpoint-bottom-space);
    min-height: calc(var(--experience-breakpoint-top-space) + 10px + var(--experience-breakpoint-bottom-space));

    /* Shadow effect */
    background-color: var(--background-color);
    box-shadow: 0 0 20px 20px var(--background-color);
}

/* Timeline outline */
#timeline-hollow {
    background-color: var(--background-color-dark);
    width: 100%;
    /* Original height on the left, and offset on the right */
    height: calc(10px - 3px);
}

/* Timeline filling */
#timeline-fill {
    background-color: var(--accent-color);
    /* Width is changed in using scroll logic in typescript */
    width: 100%;
}

.experience-breakpoint {
    position: absolute;
    padding: 0;
    margin: 0;
    left: 0;
}


/* Normal experience breakpoint a tag styling */
.experience-breakpoint a {
    position: relative;
    display: inline-block;
    left: 3px;
    /* Original height on the left, and offset on the right */
    top: calc(-15px - -2px);
    padding: 10px;
    border: 0;
    border-radius: 50%;
    background-color: var(--accent-color);
}

/* Normal Experience instance span tag styling */
.experience-breakpoint span {
    position: relative;
    top: 5px;
    left: -30px;
}

/* Left will be calculated in typescript, this is just for visual reference */
.experience-breakpoint#e0{
    left: 10%;
}

.experience-breakpoint#experience-beginning a{
    left: 0;
}

.experience-breakpoint#experience-end {
    left: calc(100% - 20px);
}

/* Last a tag that shows the end of the timeline */
/* .experience-breakpoint#experience-end a {
    top: -25px;
    padding: 20px;
    background-color: var(--background-color-dark);
} */

/* Last span tag that says  the end year of the timeline */
/* TODO: Find out why I need to do this to make only the end span work */
.experience-breakpoint#experience-end span {
    top: -15px;
    left: -15px;
}

.experience {
    display: flex;
    position: sticky;
    top: var(--experience-top-offset);
    padding-top: 100px;
    /* align-items: center; */
    /* Shadow effect */
    background-color: var(--background-color);
    box-shadow: 0 0 20px 20px var(--background-color);
}

.experience-description {
    margin-left: 5%;
    margin-right: 8%;
    display: flex;
    flex: 1;
    height: auto;
    flex-direction: column;
    color: var(--text-color);
}

.experience-description h1{
    padding: 0;
    margin: 0;
    font-size: var(--h1-font-size);
}

.experience-description h2 {
    padding: 0;
    font-size: var(--h2-font-size);
}

.experience-description p {
    padding: 0;
    margin: 0;
    line-height: 2rem;
    font-size: var(--p-font-size);
}

.experience-description h3 {
    padding: 0;
    font-size: var(--h3-font-size);
}

/* Parent of tag elements */
.experience-description > div {
    margin-top: auto;
    gap: 2rem;
}

.tag {
    margin-left: 10px;
    white-space: nowrap;
    line-height: 2.5rem;
    padding: 10px;
    color: var(--accent-color);
    background-color: var(--background-color-dark);
    border-radius: 0.5rem;
}

/* Making the first child margin of 0, so that it's inline with the rest of the section */
.tag:first-child {
    margin-left: 0;
}

.experience-image {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: end;
}

.image-wrapper {
    display: inline-block;
    left: 10px;
    top: -10px;
    height: var(--experience-image-height);
    border: 1px solid white;
    border-radius: 3rem;
    color: var(--background-color-dark);
}

.experience-image img {
    /* TODO: Get better measurement for height */
    height: var(--experience-image-height);
    border: 1px solid white;
    border-radius: 3rem;
    color: var(--background-color-dark);

    /* box-shadow: 5px -5px 0 0, 5.5px -5.5px 0 white, 10px -10px 0 0, 10.5px -10.5px 0 white; */
}

.experience-spacer {
    width: auto;
}
.mobile #experience-section {
    /* --experience-breakpoint-top-space: 0px;
    --experience-breakpoint-bottom-space: 0px; */
    display: block;
}

/* Experience description section */
.mobile #experience-section section {
    flex: 1;
}

.mobile #timeline-experiences-container {
    display: flex;
}

/* Aside element */
.mobile #timeline {
    flex: 0 0 auto;
    width: fit-content;
    margin-left: 2%;
    margin-right: 6%;
    height: calc(90dvh - var(--experience-top-offset));
    padding: 0;
    box-shadow: 0 0 0 0;
}

.mobile #timeline-hollow {
    display: flex;
    justify-content: center;
    /* margin-left: 10%; */
    width: 5px;
    height: 100%;
}

.mobile #timeline-fill {
    width: 100%;
    height: 30%;
}

.mobile .experience-breakpoint {
    display: flex;
    top: 0;
    left: -10px;
}

/* Normal experience breakpoint a tag styling */
.mobile .experience-breakpoint a {
    top: 0;
    /* left: 7px; */
    padding: 10px;
    border: 0;
    border-radius: 50%;
    background-color: var(--accent-color);
}

/* Normal Experience instance span tag styling */
.mobile .experience-breakpoint span {
    display: inline;
    position: relative;
    top: 0;
    left: 5px;
}

/* Just retyping these since in nomral mode, they are set differently */
.mobile .experience-breakpoint#experience-beginning a{
    left: 3px;
}

/* Just retyping these since in nomral mode, they are set differently */
.mobile .experience-breakpoint#experience-end {
    left: -10px;
    top: calc(100% - 20px);
}

/* Just retyping these since in nomral mode, they are set differently */
.mobile .experience-breakpoint#experience-end span {
    top: 0;
    left: 5px;
}

@media (max-width: 700px) {
    .mobile .experience-breakpoint span {
        display: none;
    }
}

/* Left will be calculated in typescript, this is just for visual reference */
.mobile .experience-breakpoint#e0{
    left: -10px;
    top: 50%;
}

/* Actual experience detail that is being put in with typescript */
.mobile .experience {
    margin-top: 0;
    height: 80dvh;
    padding-top: 30px;
}

/* Parent of tag elements */
.mobile .experience-description > div {
    margin-top: 1rem;
    gap: 2rem;
}

.mobile .experience-image {
    display: none;
}#projects-section > h1 {
    position: sticky;
    top: var(--experience-sticky-top, 95px);
    z-index: 10;
    justify-self: flex-start; /* Change to center when it's made into a carousel*/
    font-size: var(--main-h1-font-size);
    
    /* Shadow effect */
    background-color: var(--background-color);
    box-shadow: 0 0 20px 20px var(--background-color);
}

#project-carousel {
    width: 100%;
}

.project-card {
    margin-top: 5%;
    justify-self: center;
    width: 70%;
    /* height: 60%; */
    background-color: var(--background-color-dark-frosted);
    backdrop-filter: blur(8px);

    border-radius: 3rem;
    /* Giving a margin effect to the children */
    padding: 2rem;
    
    /* Shadow effect */
    box-shadow: 0 0 20px 20px var(--background-color);
}

.project-card > p {
    margin: 0;
    padding: 0;
    margin-top: 2%;
    line-height: 2rem;
    font-size: var(--p-font-size);
}

.project-card-top {
    display: flex;
}

.project-card-top > img {
    /* margin-top: 2rem;
    margin-left: 2rem; */
    object-fit: fill; /* Should be using cover, but for some reason, image looks weird, so figure that out and change to cover */
    width: 20rem;
    height: 20rem;
    border-radius: 1rem;
}

.project-card-aside {
    margin-left: 3rem;
    width: 100%;
}

.project-card-aside > h2 {
    margin: 0;
    font-size: var(--h1-font-size);
}

/* .project-card-aside > div {
    margin-top: 4rem;
} */

.project-links {
    margin-left: auto;
    display: inline-block;
}

.project-links > a {
    margin-top: 1rem;
    height: 3rem;
    width: 3rem;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
}

.project-links > a:first-child {
    margin-top: 0;
}

.project-links > a:hover {
    border-color: var(--accent-color);
}

.project-links > a:hover > svg {
    fill: var(--accent-color);
    color: var(--accent-color);
}

.project-links > a > svg {
    width: 3rem;
    height: 3rem;
    fill: var(--text-color);
    color: var(--text-color);
}

/* .project-card-main-details {
    
} */
.project-card-main-details-links {
    margin: 0;
    display: flex;
    padding-bottom: 2rem;
}#contact-section {
    padding-top: 20dvh;
    height: 90dvh;
}

#contact-section > h1 {
    position: sticky;
    top: var(--experience-sticky-top, 95px);
    z-index: 10;
    justify-self: flex-start; /* Change to center when it's made into a carousel*/
    font-size: 3rem;
    
    /* Shadow effect */
    background-color: var(--background-color);
    box-shadow: 0 0 20px 20px var(--background-color);
}

/* #contact-section > h2 {
    justify-self: flex-start;
    font-size: 2rem; */

    /* Shadow effect */
    /* background-color: var(--background-color);
    box-shadow: 0 0 20px 20px var(--background-color);
} */

#contact-section > div {
    margin-top: 10%;
    display: flex;
    justify-content: center;
    
    gap: 4rem;
}

#contact-section > p {
    margin-top: 5%;
    text-align: center;
    line-height: 2rem;
    font-size: 1.5rem;

    /* Shadow effect */
    background-color: var(--background-color);
    box-shadow: 0 0 20px 20px var(--background-color);
}

.contact-link {
    height: 7rem;
    width: 7rem;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    border: 0.1rem solid var(--text-color);
    border-radius: 2rem;
    
    /* Shadow effect */
    background-color: var(--background-color-dark-frosted);
    backdrop-filter: blur(3px);
    box-shadow: 0 0 20px 20px var(--background-color);
}

.contact-link:hover {
    border-color: var(--accent-color);
}

.contact-link:hover > svg {
    fill: var(--accent-color);
    color: var(--accent-color);
}

.contact-link > svg {
    width: 4rem;
    height: 4rem;
    fill: var(--text-color);
    color: var(--text-color);
}