:root {
  --color-accent: #5eead4;
  --background-accent: rgba(45, 212, 191, 0.1);
  --color-highlight: #e2e8f0;
  --color-dark: #2a0000;
  --color-medium: #3a0000;
  --color-red-accent: #ff4646;
  --transition-default: 0.3s ease;
  /* New color variables for enhanced effects */
  --card-hover-border: rgba(94, 234, 212, 0.35);
  --card-hover-glow: rgba(45, 212, 191, 0.25);
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Softened background texture */
body {
  background: var(--color-medium);
  color: #94a3b8;
  padding: 4rem 2rem;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 6rem;
  background-image: linear-gradient(
    45deg,
    var(--color-medium) 25%,
    rgba(42, 0, 0, 0.85) 25%,
    rgba(42, 0, 0, 0.85) 50%,
    var(--color-medium) 50%,
    var(--color-medium) 75%,
    rgba(42, 0, 0, 0.85) 75%,
    rgba(42, 0, 0, 0.85) 100%
  );
  background-size: 20px 20px; /* Same as original */
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(42, 0, 0, 0.6) 0%,
    rgba(15, 23, 42, 0.7) 100%
  );
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
  z-index: -1;
  pointer-events: none;
}

p {
  line-height: 1.5rem;
}

p::selection,
h1::selection,
h2::selection,
h3::selection,
h4::selection,
h5::selection,
h6::selection {
  background: var(--color-accent);
  color: #0f172a;
}

.underlay {
  position: fixed;
  background: #172554;
  inset: 0;
  opacity: 0.15;
  z-index: -2;
}

header,
main,
footer {
  position: relative;
  z-index: 10;
  animation: fadeIn 0.8s ease-out forwards;
}

header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 300px;
}

header h1,
header h4,
.lightText {
  color: var(--color-highlight);
  transition: var(--transition-default);
}

header a {
  text-decoration: none;
  transition: var(--transition-default);
}

header h1 {
  font-weight: 600;
  position: relative;
}

header h1::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.4s ease;
}

header h1:hover::after {
  width: 100%;
}

header h4 {
  font-weight: 400;
}

nav {
  display: none;
}

nav a {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateX(0);
  transition: transform 0.3s ease, color 0.3s ease;
}

nav a:hover {
  transform: translateX(5px);
  color: var(--color-accent);
}

nav a:hover .nav-line {
  background: var(--color-accent);
  width: 28px;
}

.nav-line {
  height: 1px;
  width: 20px;
  background: var(--color-highlight);
  transition: all 0.3s ease;
}

.social-link-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.social-link {
  font-size: 1.4rem;
  color: inherit;
  text-decoration: none;
  transition: var(--transition-default);
}

.social-link:hover {
  color: var(--color-highlight);
  transform: translateY(-3px);
}

main {
  display: flex;
  flex-direction: column;
  gap: 6rem;
}

section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 0.8s ease-out forwards;
}

section:nth-child(2) {
  animation-delay: 0.1s;
}

section:nth-child(3) {
  animation-delay: 0.2s;
}

section:nth-child(4) {
  animation-delay: 0.3s;
}

section h2 {
  text-transform: uppercase;
  font-size: 1rem;
  font-weight: 500;
  position: relative;
  display: inline-block;
  padding-bottom: 5px;
}

section h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 2px;
  background: var(--color-accent);
  transition: width 0.4s ease;
}

section:hover h2::after {
  width: 100%;
}

.sticky-header {
  position: sticky;
  top: 0;
  padding: 1rem 0;
}

.sticky-header h2 {
  position: relative;
  z-index: 2;
}

.sticky-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(42, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.about-contents {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.about-contents p {
  font-size: 1.1rem;
  line-height: 1.6;
}

.anchor-text {
  color: var(--color-highlight);
  text-decoration: none;
  transition: var(--transition-default);
  position: relative;
}

.anchor-text::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 2px;
  bottom: 0;
  left: 0;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.3s ease;
}

.anchor-text:hover {
  color: var(--color-accent);
}

.anchor-text:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.experience-contents,
.project-contents {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

/* Enhanced card styling */
.experience-card,
.project-card {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  transition: all 0.4s ease;
  position: relative;
  border-radius: 0.5rem;
  background: rgba(42, 0, 0, 0.2);
}

.experience-card {
  gap: 0.5rem 1rem;
  padding: 1rem;
  border: 1px solid transparent;
}

.project-card {
  gap: 1rem 1rem;
  padding: 1rem;
  border: 1px solid transparent;
}

/* Improved hover effects */
.experience-card:hover,
.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3),
    0 0 15px rgba(45, 212, 191, 0.15);
  border: 1px solid var(--card-hover-border);
  background: rgba(58, 0, 0, 0.8);
}

.card-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-header-link {
  text-decoration: none;
}

.tenure {
  opacity: 0.7;
  text-transform: uppercase;
  font-size: 0.8rem;
}

/* Enhanced text contrast on hover */
.experience-card:hover .tenure {
  opacity: 1;
  color: var(--color-accent);
  text-shadow: 0 0 5px rgba(45, 212, 191, 0.3);
}

.experience-card:hover .card-header {
  color: var(--color-accent);
  text-shadow: 0 0 5px rgba(45, 212, 191, 0.3);
}

.project-card:hover .card-header {
  color: var(--color-accent);
  text-shadow: 0 0 5px rgba(45, 212, 191, 0.3);
}

.experience-card p {
  font-size: 0.9rem;
}

.card-header {
  font-weight: 400;
  font-size: 1rem;
  position: relative;
  display: inline-block;
}

.card-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 1px;
  background: var(--color-accent);
  transition: width 0.4s ease;
}

.card-header-link:hover .card-header::after {
  width: 100%;
}

.anchor-icon {
  padding-left: 0.5rem;
  transition: transform 0.3s ease;
}

.card-header-link:hover .anchor-icon {
  transform: translateX(3px);
}

.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--color-accent);
}

/* Enhanced tag styling */
.tag {
  border-radius: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: var(--background-accent);
  transition: var(--transition-default);
  box-shadow: 0 0 5px 1px rgba(45, 212, 191, 0.1);
}

.experience-card:hover .tag,
.project-card:hover .tag {
  background: rgba(45, 212, 191, 0.2);
  box-shadow: 0 0 8px 2px rgba(45, 212, 191, 0.25);
}

.tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 10px 3px rgba(45, 212, 191, 0.3);
  background: rgba(45, 212, 191, 0.3);
}

.tag p {
  font-size: 0.8rem;
}

.project-image-container {
  max-width: 200px;
  overflow: hidden;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  order: 2;
  border-radius: 0.25rem;
  transition: all 0.4s ease;
}

.project-card:hover .project-image-container {
  transform: scale(1.05);
  box-shadow: 0 10px 20px -5px rgba(45, 212, 191, 0.25);
  border: 1px solid rgba(45, 212, 191, 0.15);
}

.project-image-container img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  transition: all 0.5s ease;
}

.project-card:hover .project-image-container img {
  transform: scale(1.1);
}

.project-stat-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  transition: var(--transition-default);
}

.project-stat-link:hover {
  color: var(--color-accent);
  transform: translateX(3px);
}

.project-archive-link {
  position: relative;
  color: var(--color-highlight);
  text-decoration: none;
  transition: var(--transition-default);
  margin-right: auto;
}

.project-archive-link span {
  transition: var(--transition-default);
}

.project-archive-link:hover {
  color: var(--color-accent);
}

.project-archive-link:hover span {
  padding-left: 0.5rem;
}

.project-archive-link::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  bottom: 0;
  background: transparent;
  transition: var(--transition-default);
}

.project-archive-link:hover::after {
  background: var(--color-accent);
}

footer {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
  animation-delay: 0.5s;
}

footer p {
  font-size: 0.9rem;
}

.scroll-to-top {
  text-decoration: none;
  color: var(--color-accent);
  background: var(--background-accent);
  padding: 0 0.75rem;
  aspect-ratio: 1/1;
  display: grid;
  place-items: center;
  border-radius: 100%;
  overflow: hidden;
  transition: var(--transition-default);
  animation: pulse 2s infinite;
}

.scroll-to-top:hover {
  background: rgba(45, 212, 191, 0.2);
  transform: translateY(-5px);
  box-shadow: 0 5px 15px -3px rgba(0, 0, 0, 0.3);
  animation: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-dark);
}

::-webkit-scrollbar-thumb {
  background: #172554;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* MEDIUM SCREEN BREAKPOINT */
@media (min-width: 640px) {
  body {
    padding: 5rem 3rem;
  }

  .project-card,
  .experience-card {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .card-column {
    grid-column: span 3 / span 3;
  }

  .project-image-container {
    order: 0;
  }

  header {
    max-width: unset;
  }

  header h1 {
    font-size: 3rem;
  }

  header h4 {
    font-size: 1.4rem;
  }

  header p {
    max-width: 300px;
  }

  .social-link-container {
    gap: 1.5rem;
  }

  .social-link-container i {
    font-size: 2rem;
  }
}

/* LARGE SCREEN BREAKPOINT */
@media (min-width: 1024px) {
  body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    padding: 6rem;
    padding-top: 0;
  }

  header {
    position: sticky;
    top: 0;
    margin-left: auto;
    height: fit-content;
    padding-bottom: 6rem;
  }

  header h1 {
    font-size: 3rem;
  }

  header h4 {
    font-size: 1.4rem;
  }

  header p {
    max-width: 300px;
  }

  nav {
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
  }

  nav a {
    font-size: 1rem;
  }

  .social-link-container {
    gap: 1.5rem;
  }

  .social-link-container i {
    font-size: 2rem;
  }

  header,
  main {
    padding-top: 6rem;
    max-width: 700px;
    width: 100%;
  }

  main {
    margin-right: auto;
  }

  .sticky-header {
    display: none;
  }

  .project-card,
  .experience-card {
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    transition-duration: 200ms;
  }

  /* Enhanced desktop hover effect */
  .project-card:hover,
  .experience-card:hover {
    background: rgba(58, 0, 0, 0.8);
    border: 1px solid var(--card-hover-border);
    box-shadow: 0 0 20px 3px var(--card-hover-glow);
  }

  .project-archive-link,
  .resume-link {
    padding-left: 1rem;
  }

  footer {
    grid-column: span 2 / span 2;
    flex-direction: row;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
  }
}

/* Custom loading animation */
@keyframes fadeInPage {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

body.loading {
  animation: fadeInPage 1s ease-in forwards;
  /* Animation keyframes */
  @keyframes float {
    0% {
      transform: translateY(0px);
    }
    50% {
      transform: translateY(-10px);
    }
    100% {
      transform: translateY(0px);
    }
  }

  .animated-entrance {
    opacity: 0;
    animation: fullPageFadeIn 1s forwards;
  }

  @keyframes fullPageFadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  /* Navigation label expansion animation */
  @keyframes expandNavLabel {
    0% {
      font-weight: normal;
      letter-spacing: normal;
      transform: translateX(0);
    }
    100% {
      font-weight: bold;
      letter-spacing: 2px;
      transform: translateX(10px);
    }
  }

  .nav-label {
    position: relative;
    display: inline-block;
    transition: letter-spacing 0.5s ease, transform 0.5s ease,
      font-weight 0.5s ease;
  }

  .nav-label.active {
    animation: expandNavLabel 0.5s forwards;
    color: rgba(255, 100, 100, 0.9); /* Add a hint of red color */
  }

  .nav-label::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: rgba(255, 100, 100, 0.7);
    transition: width 0.5s ease;
  }

  .nav-label.active::after {
    width: 100%;
  }
  #ABOUT,
  #EXPERIENCE,
  #PROJECTS {
    text-decoration: none !important;
  }

  #ABOUT:hover,
  #EXPERIENCE:hover,
  #PROJECTS:hover {
    color: rgba(255, 100, 100, 0.9) !important;
    text-decoration: none !important;
  }
}
