@import url("https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@300;400;700&display=swap");

:root {
  --bg-color: #0f0f0f;
  --text-color: #ffffff;
  --accent-color: #facc15;
  --spacing: 15rem;
}

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

body {
  font-family: "Roboto Mono", monospace;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  margin-left: var(--spacing);
  margin-right: var(--spacing);
  margin-top: 0 !important;
  margin-bottom: 3rem;
}

nav a {
  color: inherit;
  text-decoration: none;
}

a {
  color: inherit;
}

.small-p {
  font-size: 0.7rem;
}

.post {
  margin-bottom: 1rem;
}

.post a {
  font-size: 1.1rem;
}

.post p {
  font-size: 0.85rem;
}

header {
  margin-bottom: 2rem;
}

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

.site-title {
  font-weight: 700;
  font-size: 1.5rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 1rem;
}

.nav-links li a {
  transition: color 0.3s ease;
}

.nav-links li a:hover {
  color: var(--accent-color);
}

/* About Section */
#who {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  justify-content: flex-start; /* This ensures items stay left-aligned */
}

.img-div {
  flex: 1 1 250px;
}

.profile-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.my-info {
  flex: 2 1 400px;
}

.my-info h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.main_name {
  color: var(--accent-color);
}

.my-info p {
  margin: 0.3rem 0;
}
/* 
.tech-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.dev-icon {
  font-size: 2.5rem;
} */

/* Carousell Start */

.carousel-container {
  padding-top: 1rem;
  position: relative;
  overflow: hidden;
  width: 35rem;
  mask-image: linear-gradient(
    to right,
    transparent,
    black 10%,
    black 90%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 10%,
    black 90%,
    transparent
  );
}

.carousel-track {
  display: flex;
  width: max-content;
  animation: scroll 25s linear infinite;
}

.tech-icons {
  display: flex;
  gap: 2rem;
  align-items: center;
  padding-right: 2rem; /* <-- adds space between the end of one set and start of next */
}

.dev-icon {
  font-size: 3rem;
  opacity: 0.9;
  transition: opacity 0.3s;
}

.dev-icon:hover {
  opacity: 1;
}

/* Continuous scroll without jump */
@keyframes scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

.carousel-track:hover {
  animation-play-state: paused;
}

/* Carousell End */

.my-description {
  margin-top: 1rem !important;
}

section {
  margin-bottom: 2rem;
}
.post {
  display: flex;
  flex-wrap: nowrap; /* prevent wrapping */
  gap: 2rem;
  justify-content: flex-start;
  align-items: flex-start;
}

.post-img {
  flex: 0 0 auto;
}

.post-img img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.post-info {
  flex: 1 1 0; /* grow and shrink with available space */
  min-width: 0; /* prevent text overflow */
}

.blog-latest-head {
  margin-bottom: 1rem;
}

.blog-page-title {
  margin-bottom: 1rem;
}

mark {
  background-color: #141414;
  color: var(--accent-color);
  padding: 0.1em 0.3em;
}

code {
  padding: 0.1em 0.3em;
  background-color: #141414;
  font-size: 0.9rem;
}

.blog-md {
  line-height: 1.7;
}

.pop-txt {
  color: #facc15;
}

.blog-md hr {
  margin-top: 1rem;
  margin-bottom: 1rem;
}
.blog-md h1,
.blog-md h2,
.blog-md h3,
.blog-md h4,
.blog-md h5,
.blog-md h6 {
  margin-top: 1rem;
  margin-bottom: 0.7rem;
}

.blog-md ul,
.blog-md ol {
  margin-left: 2.5rem;
}

.blog-md table {
  text-align: center;
  width: 100%;
  border-collapse: collapse;
  background: #181818;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.blog-md th,
.blog-md td {
  border: 1px solid #333;
  padding: 0.4rem 0.7rem;
}

.blog-md th {
  background: #141414;
}

.blog-md blockquote {
  border-left: 4px solid #333;
  padding-left: 1.2rem;
  margin-bottom: 0.7rem;
  margin-top: 0.7rem;
  background: #181818;
  color: #facc15;
  font-style: italic;
  clear: both;
}

.blog-md .toc {
  float: left;
  margin: 0 1.5rem 1rem 0;
  width: 320px;
  max-width: 50%;
  box-sizing: border-box;
  background: #181818;
  padding: 0.5rem;
  font-size: 0.95em;
  line-height: 1.5;
}

.blog-md img {
  width: 100%;
}

.post-head img {
  width: 50%;
  margin-top: 1rem;
}

.post-head h1 {
  margin: 0;
  padding: 0;
}

.post-head hr {
  margin-top: 1rem;
}

.post-head {
  margin-bottom: 1rem;
}

.back-to-posts {
  margin-bottom: 0.7rem;
  display: block;
}

.contact-btn {
  margin-top: 1rem;
  padding-left: 2rem;
  padding-right: 2rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
  font-weight: bold;
  background-color: var(--accent-color);
  border-style: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

/* .cv-btn {
  margin-left: 1rem;
  margin-top: 1rem;
  padding-left: 2rem;
  padding-right: 2rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
  font-weight: bold;
  background-color: var(--accent-color);
  border-style: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
} */

/* Different style for CV button */
.cv-btn {
  margin-left: 0.9rem;
  margin-top: 1rem;
  padding: 0.7rem 2rem;
  font-weight: bold;
  background-color: transparent;
  color: var(--accent-color);
  border: 2px solid var(--accent-color);
  cursor: pointer;
  transition: all 0.3s ease;
}

.cv-btn:hover {
  background-color: var(--accent-color);
  color: var(--bg-color);
} 

.contact-btn:hover {
  background-color: #c4a011;
}

/* .cv-btn:hover {
  background-color: #c4a011;
} */

a {
  color: var(--accent-color);
}
#edu ul {
  margin-left: 2rem;
}

.header-btn-wrapper {
  text-decoration: none;
  color: var(--accent-color);
}

@media (max-width: 800px) {
  .post-head img {
    width: 100%;
  }
}

@media (max-width: 1065px) {
  .blog-md .toc {
    float: none;
    margin: 0 0 1rem 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: #181818;
    padding: 0.5rem;
    font-size: 0.95em;
    line-height: 1.5;
  }
}

/* Responsive */
@media (max-width: 1481px) {
  .nav-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .nav-links {
    font-size: 0.85rem;
  }

  .img-div img {
    width: 26rem;
  }

  /* #who {
    flex-direction: column;
    align-items: flex-start; 
  } */

  .my-info h1 {
    font-size: 2rem;
  }

  .dev-icon {
    font-size: 2.5rem;
  }

  .carousel-container {
    width: 25rem;
  }

  :root {
    --spacing: 8rem;
  }
}

@media (max-width: 1155px) {
  :root {
    --spacing: 2rem;
  }
}

@media (max-width: 927px) {
  #who {
    flex-direction: column;
    align-items: flex-start;
  }
  .img-div img {
    width: 13rem;
  }
  .carousel-container {
    width: 90vw;
  }
}

@media (max-width: 600px) {
  :root {
    --spcacing: 1rem;
  }
}

@media (max-width: 750px) {
  .post {
    flex-direction: column;
    flex-wrap: nowrap;
    margin-bottom: 3rem;
  }

  .post-img,
  .post-info {
    width: 100%;
  }

  .post-img img {
    margin: 0;
  }
}

.error {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  text-align: center;
}

.error h1 {
  font-size: 5rem;
  color: var(--accent-color);
  margin-bottom: -1.7rem;
}

.error h2 {
  font-size: 1.2rem;
}

.error a {
  font-size: 1.3rem;
}

@media (min-width: 991px) {
  .hexa {
    border: 0px;
    float: left;
    text-align: center;
    height: 35px;
    width: 60px;
    font-size: 22px;
    background: var(--bg-color);
    color: var(--text-color);
    position: relative;
    margin-top: 15px;
  }

  .hexa:before {
    content: "";
    position: absolute;
    left: 0;
    width: 0;
    height: 0;
    border-bottom: 15px solid var(--bg-color);
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    top: -15px;
  }

  .hexa:after {
    content: "";
    position: absolute;
    left: 0;
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-top: 15px solid var(--bg-color);
    bottom: -15px;
  }

  .timeline {
    position: relative;
    padding: 0;
    width: 100%;
    margin-top: 20px;
    list-style-type: none;
  }

  .timeline:before {
    position: absolute;
    left: 50%;
    top: 0;
    content: " ";
    display: block;
    width: 2px;
    height: 100%;
    margin-left: -1px;
    background: linear-gradient(
      to bottom,
      rgba(250, 204, 21, 0) 0%,
      var(--accent-color) 8%,
      var(--accent-color) 92%,
      rgba(250, 204, 21, 0) 100%
    );
    z-index: 5;
  }

  .timeline li {
    padding: 0em 0;
  }

  .timeline .hexa {
    width: 16px;
    height: 10px;
    position: absolute;
    background: var(--accent-color);
    z-index: 5;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    top: -30px;
    margin-top: 0;
  }

  .timeline .hexa:before {
    border-bottom: 4px solid var(--accent-color);
    border-left-width: 8px;
    border-right-width: 8px;
    top: -4px;
  }

  .timeline .hexa:after {
    border-left-width: 8px;
    border-right-width: 8px;
    border-top: 4px solid var(--accent-color);
    bottom: -4px;
  }

  .direction-l,
  .direction-r {
    float: none;
    width: 100%;
    text-align: center;
  }

  .flag-wrapper {
    text-align: center;
    position: relative;
  }

  .flag {
    position: relative;
    display: inline;
    background: #141414;
    color: var(--text-color);
    font-weight: 600;
    z-index: 15;
    padding: 6px 10px;
    text-align: left;
    border-radius: 5px;
  }

  .direction-l .flag:after,
  .direction-r .flag:after {
    content: "";
    position: absolute;
    left: 50%;
    top: -15px;
    height: 0;
    width: 0;
    margin-left: -8px;
    border: solid transparent;
    border-bottom-color: #141414;
    border-width: 8px;
    pointer-events: none;
  }
  /* 
.direction-l .flag {
  box-shadow: -1px 1px 1px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.15);
} */
  /* 
.direction-r .flag {
  box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.15), 0 0 1px rgba(0, 0, 0, 0.15);
} */

  .time-wrapper {
    display: block;
    position: relative;
    margin: 4px 0 0 0;
    z-index: 14;
    line-height: 1em;
    vertical-align: middle;
    color: var(--text-color);
  }

  .direction-l .time-wrapper {
    float: none;
  }

  .direction-r .time-wrapper {
    float: none;
  }

  .time {
    background: #141414;
    display: inline-block;
    padding: 8px;
  }

  .desc {
    position: relative;
    margin: 1em 0 0 0;
    padding: 1em;
    background: var(--bg-color); /* Dark background */
    color: #fff; /* White text for contrast */
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.2);
    z-index: 15;
  }

  .direction-l .desc,
  .direction-r .desc {
    position: relative;
    margin: 1em 1em 0 1em;
    padding: 1em;
    z-index: 15;
  }

  @media (min-width: 768px) {
    .timeline {
      width: 660px;
      margin: 0 auto;
      margin-top: 20px;
    }

    .timeline li:after {
      content: "";
      display: block;
      height: 0;
      clear: both;
      visibility: hidden;
    }

    .timeline .hexa {
      left: -28px;
      right: auto;
      top: 8px;
    }

    .timeline .direction-l .hexa {
      left: auto;
      right: -28px;
    }

    .direction-l {
      position: relative;
      width: 310px;
      float: left;
      text-align: right;
    }

    .direction-r {
      position: relative;
      width: 310px;
      float: right;
      text-align: left;
    }

    .flag-wrapper {
      display: inline-block;
    }

    .flag {
      font-size: 18px;
    }

    .direction-l .flag:after {
      left: auto;
      right: -16px;
      top: 50%;
      margin-top: -8px;
      border: solid transparent;
      border-left-color: var(--bg-color);
      border-width: 8px;
    }

    .direction-r .flag:after {
      top: 50%;
      margin-top: -8px;
      border: solid transparent;
      border-right-color: var(--bg-color);
      border-width: 8px;
      left: -8px;
    }

    .time-wrapper {
      display: inline;
      vertical-align: middle;
      margin: 0;
    }

    .direction-l .time-wrapper {
      float: left;
    }

    .direction-r .time-wrapper {
      float: right;
    }

    .time {
      padding: 5px 10px;
    }

    .direction-r .desc {
      margin: 1em 0 0 0.75em;
    }
  }
}

@media (min-width: 992px) {
  .timeline {
    width: 800px;
    margin: 0 auto;
    margin-top: 20px;
  }

  .direction-l {
    position: relative;
    width: 380px;
    float: left;
    text-align: right;
  }

  .direction-r {
    position: relative;
    width: 380px;
    float: right;
    text-align: left;
  }
}

@media (max-width: 992px) {
  /* Mobile-first timeline */
  .timeline {
    position: relative;
    width: 100%;
    padding: 2em 0;
    margin: 0 auto;
    list-style: none;
  }

  /* Central vertical line */
  .timeline:before {
    content: "";
    position: absolute;
    left: 20px;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(
      to bottom,
      rgba(250, 204, 21, 0.2) 0%,
      var(--accent-color) 20%,
      var(--accent-color) 80%,
      rgba(250, 204, 21, 0.2) 100%
    );
    border-radius: 2px;
    z-index: 1;
  }

  /* Timeline items */
  .timeline li {
    position: relative;
    margin: 2em 0;
    padding-left: 50px;
  }

  /* Hexa marker */
  .timeline .hexa {
    position: absolute;
    left: 8px;
    top: 0;
    width: 24px;
    height: 24px;
    background: var(--accent-color);
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
    z-index: 2;
  }

  /* Flags */
  .flag-wrapper {
    position: relative;
    display: inline-block;
  }

  .flag {
    display: block;
    background: #141414;
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    position: relative;
    margin-bottom: 0.5em;
    z-index: 3;
  }

  /* Arrow pointing to marker */
  .flag:after {
    content: "";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent #141414 transparent transparent;
    z-index: 3;
  }

  /* Time */
  .time-wrapper {
    display: block;
    margin-bottom: 0.5em;
    color: var(--text-color);
    font-size: 0.85em;
  }

  .time {
    background: #222;
    color: var(--text-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
    display: inline-block;
  }

  /* Description */
  .desc {
    background: var(--bg-color);
    color: var(--text-color);
    padding: 1em;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    font-size: 0.95em;
    line-height: 1.4;
    z-index: 3;
    position: relative;
  }

  /* Optional: direction alternate for visual style */
  .direction-l .desc,
  .direction-l .flag-wrapper,
  .direction-l .time-wrapper {
    margin-left: 0;
  }

  .direction-r .desc,
  .direction-r .flag-wrapper,
  .direction-r .time-wrapper {
    margin-left: 0;
  }

  /* Responsive tweaks for small devices */
  @media (max-width: 480px) {
    .timeline li {
      padding-left: 50px;
    }

    .flag {
      font-size: 16px;
    }

    .time {
      font-size: 0.8em;
    }

    .desc {
      font-size: 0.9em;
      padding: 0.9em;
    }
  }
}

.desc li {
  position: static !important;
  padding: 0 !important;
  margin: 0 !important;
  margin-top: 1rem !important;
  margin-bottom: 1rem !important;
}

.desc ul,
.desc ol {
  padding-left: 1.5rem !important; /* or 2rem for more indentation */
}

.desc li {
  padding: 0.2rem 0 !important; /* optional vertical spacing */
}
