/*=============== PROJECTS PAGE TIMELINE STYLES ===============*/

:root {
  --header-height: 3.5rem;

  /*========== Colors ==========*/
  /*Color mode HSL(hue, saturation, lightness)*/
  --first-color: hsl(14, 98%, 50%);
  --black-color: hsl(0, 0%, 0%);
  --black-color-light: hsl(0, 0%, 40%);
  --white-color: hsl(0, 0%, 95%);
  --title-color: hsl(0, 0%, 0%);
  --text-color: hsl(0, 0%, 35%);
  --text-color-light: hsl(0, 0%, 64%);
  --body-color: hsl(0, 0%, 87%);
  --container-color: hsl(0, 0%, 83%);

  /*========== Font and typography ==========*/
  /*.5rem = 8px | 1rem = 16px ...*/
  --body-font: "Bai Jamjuree", sans-serif;
  --biggest-font-size: 2.5rem;
  --h1-font-size: 1.75rem;
  --h2-font-size: 1.25rem;
  --h3-font-size: 1.125rem;
  --normal-font-size: .938rem;
  --small-font-size: .813rem;
  --smaller-font-size: .75rem;

  /*========== Font weight ==========*/
  --font-regular: 400;
  --font-medium: 500;
  --font-semi-bold: 600;
  --font-bold: 700;

  /*========== z index ==========*/
  --z-tooltip: 10;
  --z-fixed: 100;
}
/*=============== MOUSE ===============*/
/* Only apply these styles when not on a touch device */
@media (min-width: 768px) {
  @media (hover: hover) {
    .cursor {
      width: 50px;
      height: 50px;
      border-radius: 100%;
      border: 1px solid var(--black-color-light);
      transition: all 200ms ease-out;
      position: fixed;
      pointer-events: none;
      left: 0;
      top: 0;
      transform: translate(calc(-50% + 15px), -50%);
      z-index: 9999;
    }

    .cursor2 {
      width: 20px;
      height: 20px;
      border-radius: 100%;
      background-color: var(--first-color);
      opacity: .3;
      position: fixed;
      transform: translate(-50%, -50%);
      pointer-events: none;
      transition: width .3s, height .3s, opacity .3s;
      z-index: 999;
    }

    .hover {
      background-color: var(--first-color);
      opacity: 0.5;
    }

    .cursorinnerhover {
      width: 50px;
      height: 50px;
      opacity: .5;
    }
  }
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.animate-icon {
  display: inline-block;
  animation: rotate 3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  /* Adjusted duration and easing function */
}


/* Page Layout */
.projects-page {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

/* Back to Home Link */
.back-to-home {
    position: fixed;
    top: 2rem;
    left: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--container-color);
    color: var(--title-color);
    font-weight: var(--font-medium);
    text-decoration: none;
    z-index: var(--z-fixed);
    transition: all 0.3s ease;
}

.back-to-home:hover {
    color: var(--first-color);
}

.back-to-home i {
    font-size: 1.25rem;
}

/* Hero Section */
.projects-hero {
    text-align: center;
    padding: 4rem 0 3rem;
    margin-bottom: 3rem;
}

.projects-hero__title {
    font-size: clamp(2rem, 6vw, 3.5rem);
    margin-bottom: 1rem;
    font-weight: var(--font-bold);
}

.gradient-text {
    background-color: var(--first-color);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.projects-hero__subtitle {
    color: var(--text-color);
    font-size: var(--h3-font-size);
    max-width: 600px;
    margin: 0 auto;
}

/* Timeline Section */
.timeline-section {
    margin-bottom: 5rem;
    position: relative;
}

.timeline-year {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 3rem;
}

.year-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: var(--first-color);
    color: var(--white-color);
    font-weight: var(--font-bold);
    font-size: var(--h2-font-size);
}

.year-separator {
    font-weight: var(--font-regular);
}

.year-title {
    font-size: var(--h2-font-size);
    color: var(--title-color);
    font-weight: var(--font-semi-bold);
}

/* Timeline Projects */
.timeline-projects {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    padding: 0;
    position: relative;
    align-items: center;
}

.timeline-projects::before {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0.5rem;
    bottom: 0.5rem;
    width: 4px;
    background: linear-gradient(
        180deg,
        hsla(14, 98%, 50%, 0.1),
        hsla(14, 98%, 50%, 0.75),
        hsla(14, 98%, 50%, 0.1)
    );
    border-radius: 999px;
}

.timeline-projects--grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    border-left: none;
    padding-left: 0;
    position: relative;
    align-items: stretch;
    justify-items: stretch;
    padding: 0;
}

.timeline-projects--grid::before {
    display: none;
}

/* Timeline Card */
.timeline-card {
    position: relative;
    display: flex;
    width: 100%;
}

.timeline-card:nth-child(odd) {
    justify-content: flex-start;
}

.timeline-card:nth-child(even) {
    justify-content: flex-end;
}

.timeline-card__marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 2rem;
    width: 20px;
    height: 20px;
    background: var(--first-color);
    border: 4px solid var(--body-color);
    z-index: 2;
    box-shadow: 0 0 0 6px hsla(14, 98%, 50%, 0.15);
}

.timeline-projects--grid .timeline-card__marker {
    display: none;
}

.timeline-projects--grid .timeline-card {
    display: block;
    justify-content: flex-start;
}

.timeline-projects--grid .timeline-card__content {
    width: 100%;
    margin: 0;
    max-width: none;
}

.timeline-projects--grid .timeline-card__content::before {
    display: none;
}

.timeline-card__content {
    position: relative;
    background: var(--container-color);
    overflow: hidden;
    transition: all 0.4s ease;
    width: min(640px, calc(50% - 2.5rem));
    margin: 0;
}

.timeline-card:nth-child(odd) .timeline-card__content {
    margin-right: 2.5rem;
}

/* .timeline-card:nth-child(even) .timeline-card__content {
    margin-left: 2.5rem;
} */

.timeline-card__content::before {
    content: "";
    position: absolute;
    top: 3rem;
    width: 2.5rem;
    height: 2px;
    background: hsla(14, 98%, 50%, 0.7);
}

.timeline-card:nth-child(odd) .timeline-card__content::before {
    right: -2.5rem;
}

.timeline-card:nth-child(even) .timeline-card__content::before {
    left: -2.5rem;
}


.timeline-card--compact .timeline-card__content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Card Image */
.timeline-card__image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: var(--body-color);
}

.timeline-card--compact .timeline-card__image {
    height: 200px;
}

.timeline-card__image--fallback {
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.08), transparent 35%),
        radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.06), transparent 25%),
        linear-gradient(135deg, rgb(0, 0, 0), rgb(0, 0, 0)),
        linear-gradient(135deg, hsl(14, 98%, 52%), hsl(14, 98%, 46%));
    color: var(--white-color);
    display: grid;
    place-items: center;
    text-align: center;
}

.timeline-card__image--fallback img {
    opacity: 0;
    visibility: hidden;
}

.timeline-card__image--fallback::after {
    content: "Preview unavailable";
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: var(--font-semi-bold);
    font-size: var(--small-font-size);
    padding: 0 1.5rem;
}

.timeline-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: hsla(14, 98%, 50%, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--white-color);
    font-weight: var(--font-semi-bold);
    opacity: 0;
    transition: opacity 0.3s ease;
    text-decoration: none;
}

.timeline-card__content:hover .card-overlay {
    opacity: 1;
}

.card-overlay i {
    font-size: 2rem;
}

/* Card Info */
.timeline-card__info {
    padding: 2rem;
}

.timeline-card--compact .timeline-card__info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: center;
}

.card-date {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color-light);
    font-size: var(--small-font-size);
}

.card-date i {
    color: var(--first-color);
}

.card-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-size: var(--smaller-font-size);
    font-weight: var(--font-medium);
}

.card-status--active {
    background: hsla(120, 60%, 50%, 0.1);
    color: hsl(120, 60%, 40%);
}

.card-status--completed {
    background: hsla(200, 60%, 50%, 0.1);
    color: hsl(200, 60%, 40%);
}

.card-status i {
    font-size: 1rem;
}

.card-title {
    font-size: var(--h2-font-size);
    color: var(--title-color);
    margin-bottom: 0.75rem;
    font-weight: var(--font-bold);
}

.timeline-card--compact .card-title {
    font-size: var(--h3-font-size);
}

.card-description {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.timeline-card--compact .card-description {
    font-size: var(--small-font-size);
    margin-bottom: 1rem;
    flex: 1;
}

/* Tech Badges */
.card-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--body-color);
    color: var(--text-color);
    font-size: var(--smaller-font-size);
    font-weight: var(--font-medium);
}

/* Card Links */
.card-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.timeline-card--compact .card-links {
    margin-top: auto;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-weight: var(--font-medium);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid var(--black-color-light);
    color: var(--title-color);
}

.card-link--primary {
    background: var(--first-color);
    color: var(--white-color);
    border-color: var(--first-color);
}

.card-link--primary:hover {
    background: hsl(14, 98%, 40%);
    border-color: hsl(14, 98%, 40%);
}

.card-link i {
    font-size: 1.1rem;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .back-to-home {
        top: 1rem;
        left: 1rem;
        padding: 0.5rem 1rem;
        font-size: var(--small-font-size);
    }

    .projects-hero {
        padding: 3rem 0 2rem;
    }

    .timeline-year {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .year-badge {
        font-size: var(--h3-font-size);
        padding: 0.75rem 1.5rem;
    }

    .timeline-projects {
        padding-left: 1.25rem;
        gap: 2rem;
        align-items: stretch;
    }

    .timeline-projects::before {
        left: 0.4rem;
        transform: none;
        width: 2px;
    }

    .timeline-card {
        justify-content: flex-start;
    }

    .timeline-card__marker {
        left: 0.4rem;
        transform: translateX(-50%);
        width: 16px;
        height: 16px;
    }

    .timeline-projects--grid {
        padding-left: 0;
    }

    .timeline-card__content {
        width: 100%;
        margin: 0;
    }

    .timeline-card__content::before {
        display: none;
    }

    .timeline-card__image {
        height: 200px;
    }

    .timeline-card__info {
        padding: 1.5rem;
    }

    .card-links {
        flex-direction: column;
    }

    .card-link {
        justify-content: center;
    }

    .timeline-projects--grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 480px) {
    .projects-page {
        padding-top: 6rem;
    }

    .back-to-home span {
        display: none;
    }

    .back-to-home {
        width: 40px;
        height: 40px;
        padding: 0;
        justify-content: center;
    }
}

/* Dark Theme Adjustments */
body.dark-theme .timeline-card__content {
    box-shadow: 0 4px 12px hsla(0, 0%, 0%, 0.3);
}

body.dark-theme .timeline-card__content:hover {
    box-shadow: 0 12px 24px hsla(0, 0%, 0%, 0.5);
}

body.dark-theme .back-to-home {
    box-shadow: 0 4px 12px hsla(0, 0%, 0%, 0.3);
}
