/*==========================================
=               Whole HTML                 =
==========================================*/

:root {
  --primary-color: white;
  /* Blue */
  --secondary-color: #ee3e36;

  --background-color: #121212;

  --background-color2: #212121;

  --font-family: Helvetica, Arial, sans-serif;

  --fill-bar: #d3d3d3;

  --icon-colour: black;

  --skill-text: black;
}
* {
  box-sizing: border-box;
}
body,
html {
  margin: 0;
  padding: 0;
  /* Ensure the parent container is scrollable */
  font-family: var(--font-family);
  font-weight: bold;
}

body {
  margin: 0;
  padding: 0;
  text-align: center;
  /* This centers inline content, not the block itself hello */
  background-color: var(--background-color);
}

/*==========================================
=               Landing Page               =
==========================================*/
section.landing-page {
  height: 100vh;
  /* Set a width less than 100% */
  margin: 0 auto;
  /* Centers the section horizontally */
}

section.landing-page .intro {
  width: 80%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Fixed container limited to 80% width and centered */
.fixed-email-container {
  position: fixed;
  top: 0;
  left: 0; /* anchor to the left edge of the viewport */
  transform: none; /* no centering transform */
  width: auto; /* only as wide as its contents */
  display: flex;
  justify-content: flex-start; /* keep the button at the left */
  align-items: center;
  z-index: 1000;
  /* account for iOS safe area when present and add a tiny nudge to avoid border clipping */
  padding-left: calc(env(safe-area-inset-left, 0) + 2px);
  /* Make container not block pointer events while keeping content clickable */
  pointer-events: none;

  /* Child elements should still receive pointer events */
  & > * {
    pointer-events: auto;
  }
}

@media (max-width: 768px) {
  .fixed-email-container {
    /* keep flush-left with a small inset for the button border */
    padding-left: calc(env(safe-area-inset-left, 0));
  }
}

/* Email button styling */
.fixed-email-container .email-button {
  font-size: clamp(1.5rem, 1.5vw, 2rem);
  background-color: var(--secondary-color);
  color: var(--primary-color);
  padding: 6px 10px;
  border: 2px solid var(--primary-color);
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  padding-top: 20px;
  z-index: 10000;
}

.fixed-email-container .email-button:hover {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  transform: translateY(-10px);
  border: 2px solid var(--secondary-color);
}

section.landing-page .intro {
  z-index: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

section.landing-page .intro .page-name-container .pp {
  width: clamp(200px, 18vw, 500px);
  border-radius: 20%;
  z-index: 0;
  position: relative;
  clip-path: inset(0 0 25% 0);
  /* top: 10vh; */
}

section.landing-page .intro .intro-statement {
  font-family: var(--font-family);
  font-size: clamp(2.5rem, 6vw, 8rem);
  font-weight: bold;
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--primary-color);
  top: -25%;
}

section.landing-page .intro-tag-line {
  font-family: var(--font-family);
  font-size: clamp(1rem, 2vw, 3rem);
  /* font-size: 70px; */
  font-weight: bold;
  color: var(--primary-color);
  position: relative;
  z-index: 1;
  margin: 0;
  /* top: -5%; */
}

@keyframes blink {
  50% {
    border-right-color: transparent;
  }
}

.typing span {
  border-right: 2px solid var(--secondary-color);
  /* Cursor follows text */
  animation: blink 0.5s step-end infinite;
}
@keyframes mouseAnimation {
  /* Start at original position, fully visible */
  0% {
    transform: translateY(0px);
    opacity: 1;
  }

  /* Move up slightly while still visible */
  25% {
    transform: translateY(-30px);
    opacity: 1;
  }

  /* Fade out at the raised position */
  50% {
    transform: translateY(-30px);
    opacity: 0;
  }

  /* Return to original position while invisible */
  80% {
    transform: translateY(0);
    opacity: 0;
  }

  /* Fade back in */
  100% {
    transform: translateY(0px);
    opacity: 1;
  }
}

section.landing-page .intro .bi-mouse {
  padding-top: 100px;
  font-size: clamp(4rem, 5vw, 6rem);
  color: var(--secondary-color);
  opacity: 1;
  position: relative;
  display: inline-block;
  will-change: transform;
  animation: mouseAnimation 2s infinite;
}

/*==========================================
=              Skill section               =
==========================================*/

section.skillset {
  display: flex;
  flex-direction: row;
  width: 80%;
  margin: 0 auto;
  justify-content: space-between;
  gap: 5px;
  padding-top: 50px;
  padding-bottom: 50px;
}

@media screen and (max-width: 768px) {
  section.skillset {
    flex-direction: column;
    width: 100%;
  }
}

section.skillset .skillset-container-main {
  width: 46%;
}

@media screen and (max-width: 768px) {
  section.skillset .skillset-container-main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
}

section.skillset .skillset-heading {
  font-family: var(--font-family);
  font-size: clamp(1rem, 2vw, 2rem);
  /* font-size: 70px; */
  font-weight: bold;
  color: var(--primary-color);
}

section.skillset .skillset-container {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(133px, 1fr));
  gap: 24px;
  background-color: var(--background-color2);
  margin-bottom: 50px;
  justify-content: center;
}

section.skillset .skill {
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--primary-color);
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  width: 100%;
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden; /* prevent any child overflow */
}

section.skillset .skill-header {
  display: flex;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  margin-bottom: 5px;
  width: 100%;
  position: relative;
  gap: 5px;
}

section.skillset .skill-icon {
  width: 30px;
  height: 30px;
  background-color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* Prevents the icon from shrinking */
}

section.skillset .skill-icon img {
  width: 100%;
  /* Ensures the image fills the container */
  height: 100%;
  /* Maintains consistent size */
  object-fit: cover;
  /* Ensures the image scales proportionally and fills the container */
  /* Ensures the image matches the circular container */
}

section.skillset .skill-icon svg g {
  fill: var(--icon-colour) !important;
}

section.skillset .skill-name {
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--skill-text);
  flex: 0 1 auto; /* don't force overflow */
  text-align: center; /* Centers the text */
  padding: 0 3px; /* Adds some padding on the sides */
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: normal;
  line-height: 1.2;
  min-height: 2.4rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  hyphens: auto;
}

section.skillset .skill-bar {
  width: 100%;
  height: 7px;
  background-color: #ddd;
  overflow: hidden;
  background-color: var(--fill-bar);
}

section.skillset .skill-bar-fill {
  height: 100%;
  width: 0%;
  /* Default to start from 0 */

  transition: width 1s ease-in-out, background-color 0.3s ease;
  /* Smooth animation if needed */
}

@media (max-width: 810px) {
  section.skillset .skillset-container {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    width: 90vw;
  }
}

@media (max-width: 768px) {
  section.skillset .skillset-container {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    padding: 10px;
    gap: 16px;
    width: 90vw;
  }

  section.skillset .skill {
    padding: 8px;
    min-height: auto; /* allow height to shrink to content */
  }

  section.skillset .skill-name {
    font-size: 0.78rem; /* improved readability */
    padding: 0 3px;
    line-height: 1.2;
    min-height: 0; /* remove extra reserved height that created the gap */
  }

  section.skillset .skill-icon {
    width: 44px;
    height: 44px;
    margin-bottom: 4px; /* slightly tighter */
  }

  section.skillset .skill-header {
    margin-bottom: 2px; /* tighten spacing below header */
  }

  section.skillset .skill-bar {
    height: 6px;
    margin-top: 2px; /* reduce gap above the bar */
  }
}

@media (max-width: 480px) {
  section.skillset .skillset-container {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 14px;
    padding: 8px;
  }

  section.skillset .skill {
    padding: 6px;
    min-height: auto; /* allow auto height to remove bottom whitespace */
    flex-direction: column;
    align-items: center;
  }

  section.skillset .skill-name {
    font-size: 0.75rem;
    padding: 0 2px;
    line-height: 1.2;
    text-align: center;
    min-height: 0; /* remove reserved height on small screens */
  }

  section.skillset .skill-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 3px;
  }

  section.skillset .skill-header {
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin-bottom: 2px; /* tighter below header */
  }

  section.skillset .skill-bar {
    height: 5px;
    width: 100%;
    margin-top: 2px; /* minimal gap above bar */
  }
}

/*==========================================
=               Timeline section           =
==========================================*/

/* TIMELINE HEADER */
section.timeline .timeline-heading {
  font-family: var(--font-family);
  font-size: clamp(1rem, 2vw, 2rem);
  font-weight: bold;
  color: var(--primary-color);
  /* text-align: center;
    margin-bottom: 20px; */
}
section.timeline > div.timeline-container {
  width: calc(80% - (48px * 2));
  /* or 100% if you prefer */
  min-width: 920px;
  /* your desired min-width */
  margin: 0 auto;
  /* center it */
}

section.timeline .timeline-container {
  /* height: 95vh; */
  background-color: var(--background-color2);
  margin-bottom: 50px;
  border-left: 5px solid var(--secondary-color);
}

/* PROJECT GRID CONTAINER */
section.timeline .project:not(.overlay-container) {
  display: grid;
  height: 90vh;
  width: 100%;
  grid-template-rows: 4% 3% 51% 20% 22%;
  gap: 10px;
  padding-top: 20px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--primary-color);
}

section.timeline .project {
  position: relative;
  min-height: 810px;
}

section.timeline .project.project--with-skills:not(.overlay-container) {
  grid-template-rows: 4% 3% 51% 20% 22%;
}

section.timeline
  .project
  :not(
    .date_container,
    .title_container,
    .icons_container,
    .skill-header,
    .overlay-container
  ) {
  overflow: hidden;
  display: flex;
  /* Ensure flex children respect width */
  /* flex-direction: column; */
  align-items: center;
  /* Ensures alignment inside */
  /* Adds spacing between sections */
}

/* DATE CONTAINER */
section.timeline .date_container {
  grid-row: 1;
  width: 100%;
  /* Make full width */
  /* display: flex;
    align-items: center;
    justify-content: flex-end; */
  display: flex;
  /* align-items: center; */
  position: relative;
  z-index: 100;
}

section.timeline .overlay-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(18, 18, 18, 0.98);
  transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 3rem;
}

section.timeline .last-overlay {
  position: absolute !important;
  height: 100% !important;
  top: 0 !important;
  transform: none !important;
  display: none !important;
}

section.timeline .last-overlay.active {
  display: flex !important;
  transform: none !important;
}

section.timeline .overlay-container.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

section.timeline .overlay-container ul {
  list-style: none;
  margin: 0;
  padding: 2.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  background-color: var(--background-color2);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  /* Position relative to title container */
  margin-top: calc(4% + 60px); /* 72px is your nav height */
}

section.timeline .overlay-container li {
  display: flex;
  align-items: flex-start;
  gap: 1.2rem;
  color: var(--primary-color);
  font-size: 0.9rem;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(20px);
  transition: none;
  padding-left: 0.5rem;
  text-align: left;
  font-weight: normal;
  letter-spacing: 0.02em;
}

section.timeline .overlay-container.active li {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.5s ease;
}

section.timeline .overlay-container li::before {
  content: "";
  min-width: 6px;
  height: 6px;
  background-color: var(--secondary-color);
  border-radius: 50%;
  margin-top: 0.7em;
  box-shadow: 0 0 4px var(--secondary-color);
}

section.timeline .overlay-container li:nth-child(1) {
  transition-delay: 0.3s;
}
section.timeline .overlay-container li:nth-child(2) {
  transition-delay: 0.4s;
}
section.timeline .overlay-container li:nth-child(3) {
  transition-delay: 0.5s;
}
section.timeline .overlay-container li:nth-child(4) {
  transition-delay: 0.6s;
}
section.timeline .overlay-container li:nth-child(5) {
  transition-delay: 0.7s;
}
section.timeline .overlay-container li:nth-child(6) {
  transition-delay: 0.8s;
}
section.timeline .overlay-container li:nth-child(7) {
  transition-delay: 0.9s;
}
section.timeline .overlay-container li:nth-child(8) {
  transition-delay: 1s;
}

/* Container for text and icon */
section.timeline .date_container .text_icon_container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 45%;
  height: 100%;
  border-bottom: 2px dashed var(--primary-color);
}

/* Info circle positioned to the far right */
section.timeline .date_container #info_button {
  position: absolute;
  right: 1.5vw;
  font-size: 1.5rem;
  color: var(--primary-color);
  cursor: pointer;
  transition: transform 0.2s;
  z-index: 100;
}

@media (max-width: 768px) {
  section.timeline .date_container #info_button {
    right: 3.5vw;
    top: 0.1vh;
  }
}

section.timeline .date_container #info_button:hover {
  color: var(--secondary-color);
  transform: scale(1.1);
}

section.timeline .date_container .bi-x-square {
  display: none;
}

section.timeline .date_container h3 {
  color: var(--primary-color);
}

section.timeline .project h3 {
  font-size: clamp(0.9rem, 0.9vw, 1.2rem);
}

section.timeline .date_container svg {
  position: absolute;
  width: 65px;
  /* Adjust size as needed */
  height: 65px;
  /* Adjust size as needed */
  color: var(--primary-color);
  background-color: var(--secondary-color);
  border-radius: 50%;
  object-fit: cover;
  /* Ensures the image covers the area without distortion */
  bottom: 0;
  left: 0;
  /* Shift the image so that its center aligns with the bottom right corner */
  transform: translate(-50%, 50%);
  padding: 5px;
  border: 2px solid var(--primary-color);
}

section.timeline .date_container svg g {
  fill: var(--primary-color) !important;
}

/* TITLE CONTAINER */
section.timeline .title_container {
  grid-row: 2;
  width: 45%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  z-index: 100;
}

/* MAIN IMAGE CONTAINER */
section.timeline .main_image_container {
  grid-row: 3;
  width: 100%;
  padding-top: 20px;
  display: flex;
  justify-content: center;
}

section.timeline .main_image_container img {
  height: 100%;
  /* width: 100%; */
  max-width: 90%;
  border-radius: 20px;
  /* Ensures image fills space without stretching */
}

/* STATEMENT CONTAINER */
section.timeline .statement_container {
  grid-row: 4;
  width: 100%;
  box-sizing: border-box;
  padding-left: 10%;
  padding-right: 10%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

section.timeline .statement_container h2 {
  font-family: var(--font-family);
  font-size: clamp(2rem, 2vw, 3rem);
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 15px;
}

/* DOWNLOAD SECTION */
.download_section {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  width: 100%;
}

.download_section i {
  font-size: 2rem;
  color: var(--secondary-color);
}

.download_section a {
  font-size: 1rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
}

.download_section a:hover {
  text-decoration: underline;
}

/* TIMELINE HEADING */
section.timeline h3 {
  margin: 0;
  text-align: right;
  color: var(--secondary-color);
}

@media (max-width: 1071px) {
  section.timeline > div.timeline-container {
    min-width: 0;
    width: 90vw;
  }
}

@media (max-width: 768px) {
  /* section.timeline .project:not(.project.project--with-skills){
            grid-template-rows: 4% 3% 40% 53%;
            height: 70vh;
        } */
  section.timeline .project.project--with-skills:not(.overlay-container) {
    grid-template-rows: 4% 3% 26% 24% 43%;
    min-height: 780px;
  }
  section.timeline > div.timeline-container {
    min-width: 0;
    width: 90vw;
  }
  section.timeline .date_container .text_icon_container {
    width: 70%;
  }

  section.timeline .date_container .bi-info-circle {
    right: 4%;
    font-size: 1.2rem;
  }

  section.timeline .title_container {
    width: 70%;
  }

  section.timeline .date_container svg {
    width: 45px;
    height: 45px;
  }

  section.timeline .main_image_container {
    padding-top: 10px;
  }

  section.timeline .main_image_container img {
    height: auto;
    width: 85%;
  }

  section.timeline .statement_container {
    padding-right: 5%;
    padding-left: 5%;
  }

  section.timeline .text_icon_container h3 {
    font-size: 0.8rem;
  }

  section.timeline .title_container h3 {
    font-size: 0.8rem;
  }

  section.timeline .statement_container h2 {
    font-size: 1.5rem;
  }

  section.timeline .project {
    padding-bottom: 40px;
    min-width: none;
  }

  section.timeline .overlay-container {
    padding: 0.7rem;
  }

  section.timeline .overlay-container ul {
    padding: 1.4rem 0.3rem;
    gap: 1rem;
    margin-top: calc(8% + 60px); /* Adjusted for mobile */
    border-radius: 8px;
  }

  section.timeline .overlay-container li {
    font-size: 0.8rem;
    gap: 1rem;
    line-height: 1.5;
    padding-left: 0.3rem;
  }

  section.timeline .overlay-container li::before {
    min-width: 5px;
    height: 5px;
    margin-top: 0.6em;
  }
}

/*-------------------------------
  Timeline Icons Container Grid
--------------------------------*/
section.timeline .icons_container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  margin-bottom: 20px;
  box-sizing: border-box;
  background-color: var(--secondary-color);
  overflow-y: auto;
  max-height: 100%;
  width: 100%;
}

section.timeline .icons_container .skill {
  display: flex;
  /* Horizontal layout */
  align-items: flex-start;
  /* Top-align if the skill name is taller */
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 0.3rem;
  min-width: 50px;
  /* Ensures each skill has a decent width */
  background-color: var(--primary-color);
  flex: 0 0 auto;
  /* Prevents shrinking too small */
  opacity: 0;
  /* For your fade-in effect */
  transition: opacity 0.5s ease-in-out;
}

/* Logo area: place a square image on the left */
section.timeline .icons_container .skill .skill-logo {
  flex: 0 0 auto;
  width: 35px;
  /* Adjust to suit your design */
  height: 35px;
  /* Adjust to suit your design */
  margin-right: 1rem;
  overflow: hidden;
  /* In case the image is bigger than the container */
  display: flex;
  align-items: center;
  justify-content: center;
}

section.timeline .icons_container .skill .skill-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* or cover, depending on preference */
}

section.timeline .icons_container .skill .skill-logo svg g {
  fill: var(--icon-colour) !important;
}

/* Info area: skill name + bar stacked vertically */
section.timeline .icons_container .skill .skill-info {
  flex: 1;
  /* Take remaining space */
  display: flex;
  flex-direction: column;
  /* Stack skill-name over skill-bar */
  justify-content: center;
  /* Or flex-start, if you want them at the top */
}

/* Skill name rectangle */
section.timeline .icons_container .skill .skill-name {
  font-weight: bold;
  margin-bottom: 0.3rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  color: var(--skill-text);
  font-size: 0.8rem;
}

/* Bar container */
section.timeline .icons_container .skill .skill-bar {
  background-color: #ddd;
  height: 7px;
  position: relative;
  overflow: hidden;
  width: 100%;
  z-index: 0;
}

/* Bar fill */
section.timeline .icons_container .skill .skill-bar-fill {
  background-color: #ff0000;
  /* or var(--fill-bar), etc. */
  height: 100%;
  width: 0%;
  transition: width 1s ease;
  z-index: 0;
  /* animate fill if you like */
}

@media (max-width: 768px) {
  section.timeline .icons_container .skill .skill-name {
    font-size: 0.6rem;
    margin-bottom: 0.2rem;
  }

  section.timeline .icons_container .skill .skill-logo {
    width: 25px;
    height: 25px;
    margin: auto 0;
    margin-right: 7px;
  }

  section.timeline .icons_container .skill .skill-bar {
    height: 6px;
  }
}
