:root {
  --clr-bg: #121212cb;
  --crl-bgprt: #121212;
  --clr-text: #f0f0f0;
  --clr-subtext: #cccccc;
  --clr-accent: #ff0000;
  --clr-accent-hover: #e60000;
  --clr-canvas-shape: rgba(255, 0, 0, 0.4);
  --font-main: 'Poppins', sans-serif;
  --fs-title: 1.6rem;
  --fs-subtext: 1.2rem;
  --br-radius: 10px;
  --transition-fast: 0.3s ease;
}
:root, body.light-mode {
  transition: background-color 0.3s ease, color 0.3s ease;
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

body.light-mode {
  --clr-bg: #ffffff;
  --crl-bgprt: #007fe6;
  --clr-text: #000000;
  --clr-subtext: #000000;
  --clr-accent: #0084ff;
  --clr-accent-hover: #007fe6;
  --clr-canvas-shape: rgba(0, 119, 255, 0.4);
  --font-main: 'Poppins', sans-serif;
  --fs-title: 1.6rem;
  --fs-subtext: 1.2rem;
  --br-radius: 10px;
  --transition-fast: 0.3s ease;
}

body {
  background-color: var(--clr-bg);
  color: var(--clr-text);
  font-family: var(--font-main);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

a {
  color: var(--clr-accent);
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--clr-accent-hover);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  height: 100%;
  font-family: var(--font-main);
  background-color: var(--clr-bg);
  color: var(--clr-text);
  overflow-x: hidden;
}

#theme-toggle {
  position: relative;
  z-index: 1000;
  border-radius: 50%;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

#theme-toggle:hover {
  color: var(--clr-bg);
  transform: rotate(20deg);
}

#theme-toggle .icon {
  transition: transform 0.3s ease;
  background-color: var(--clr-bg);
  border-radius: 50%;
}

body.dark-mode #theme-toggle .icon {
  transform: rotate(180deg);
}

/* --- Navbar --- */
.navbar {
  background: var(--clr-bg);
  padding: .5rem 1rem;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
}
@media (max-width: 768px){
.navbar {
  font-size: .7rem;
}
}

.nav-links {
  display: flex;
  gap: 1rem;
  list-style: none;
}

.nav-links a {
  color: var(--clr-subtext);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.nav-links a.active,
.nav-links a:hover {
  color: var(--clr-accent);
}

/* --- Carousel Sections --- */
#carousel-container {
  position: relative;
  width: 100%;
  height: auto; /* important */
}

.carousel-section {
  display: none;
  width: 100%;
  background-color: var(--clr-bg);
  color: var(--clr-text);
  overflow: hidden;
  margin-top: 70px;
}

.carousel-section.active {
  display: block;
  position: relative;
  opacity: 1;
  animation: fadeIn 0.3s ease;
}

/* Animații de tranziție direcțională */
.carousel-section.enter-from-right {
  animation: slideInRight 0.5s ease forwards;
}

.carousel-section.exit-to-left {
  animation: slideOutLeft 0.5s ease forwards;
}

.carousel-section.enter-from-left {
  animation: slideInLeft 0.5s ease forwards;
}

.carousel-section.exit-to-right {
  animation: slideOutRight 0.5s ease forwards;
}

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutLeft {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(-100%); opacity: 0; }
}

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(100%); opacity: 0; }
}

/* --- Hero Section --- */

.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  
}

.hero-content {
  display: flex;
  flex-wrap: wrap;
  justify-content:space-around;
  text-align: center;
  gap: 2rem;
  
}
.hero-main{
  display: flex;
  width: 100%;
  height: fit-content;
  justify-content: space-evenly;
  align-items: center;
  padding:2rem 2rem ;

}

.hero-image img {
  width: 400px;
  height: 400px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--clr-accent);
  box-shadow: 0 0 20px var(--clr-canvas-shape);

}

.hero-text {
  max-width: 100%;

}

.hero-text h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;

}

.hero-text h2 {
  font-size: 2.2rem;
  color: var(--clr-accent);
  margin-bottom: 1rem;

}

.hero-text p {
  font-size: 1.1rem;
  color: var(--clr-subtext);
  margin-bottom: 2rem;

}

/* --- Social Icons --- */
.social-icons {
  margin-top: 3rem;

}

.social-icons a {
  font-size: 1.8rem;
  margin-right: 1.2rem;
  color: var(--clr-subtext);
  transition: color var(--transition-fast), transform 0.2s ease;
}

.social-icons a:hover {
  color: var(--clr-accent);
  transform: scale(1.1);
}

/* --- Canvas --- */
#backgroundCanvas {
  position: absolute;
  max-width: 100%;
  height: fit-content;
  z-index: 0;
  pointer-events: none;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  background-color: var(--clr-accent);
  color: white;
  text-decoration: none;
  border-radius: var(--br-radius);
  font-weight: bold;
  transition: background var(--transition-fast);
}

.btn:hover {
  background-color: var(--clr-accent-hover);
}

.taskbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: var(--crl-bgprt);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  z-index: 1001;
  box-shadow: 0 -2px 5px rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
  font-family: var(--font-main);
}

.start-menu {
  position: relative;
}

#start-btn {
  background: transparent;
  border: none;
  color: white;
  font-weight: bold;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.start-panel {
  position: absolute;
  bottom: 35px;
  left: -1rem;
  background: var(--crl-bgprt);
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1002;
}

.start-panel a {
  color: white;
  text-decoration: none;
  transition: 0.2s;
}

.start-panel a:hover {
  color: var(--clr-accent);
}

.start-panel.hidden {
  display: none;
}

.task-icons a {
  color: white;
  font-size: 1.2rem;
  margin: 0 0.5rem;
  transition: transform 0.2s, color 0.2s;
}

.task-icons a:hover {
  transform: scale(1.2);
  color: var(--clr-accent);
}

.clock {
  color: #fff;
  font-size: 1rem;
  font-family: monospace;
}
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
  padding: 0 2rem 4rem;
}

.portfolio-item {
  background: var(--clr-bg);
  border-radius: var(--br-radius);
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.5);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.portfolio-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 5px 7px var(--clr-accent-hover);
}

.portfolio-item img {
  width: 100%;
  height: 200px;
  object-fit: contain;
  display: block;
 background-color: var(--crl-bgprt);
}
.portfolio-item video {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
} 

.portfolio-info {
  padding: 1.2rem;
  color: var(--clr-subtext);
}

.portfolio-info h3 {
  margin-bottom: 0.5rem;
  color: var(--clr-text);
  font-size: 1.2rem;
}

.portfolio-info p {
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}

.portfolio-info a {
  color: var(--clr-accent);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}

.portfolio-info a:hover {
  color: var(--clr-accent-hover);
}
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-top: 30px;
  justify-items: center;
}

.contact-card {
  background: linear-gradient(145deg, var(--clr-secondary), var(--clr-bg));
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  padding: 30px 20px;
  text-align: center;
  width: 100%;
  max-width: 280px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  animation: wowEntrance 0.9s ease-out forwards;
}

.contact-card i {
  font-size: 2rem;
  color: var(--clr-accent);
  margin-bottom: 10px;
}

.contact-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--clr-text);
}

.contact-card a {
  text-decoration: none;
  color: var(--clr-accent);
  font-weight: 500;
}

@keyframes wowEntrance {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(60px);
  }
  60% {
    opacity: 1;
    transform: scale(1.05) translateY(-10px);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

/* individual delays */
.contact-card:nth-child(1) { animation-delay: 0.1s; }
.contact-card:nth-child(2) { animation-delay: 0.2s; }
.contact-card:nth-child(3) { animation-delay: 0.3s; }
.contact-card:nth-child(4) { animation-delay: 0.4s; }
.contact-card:nth-child(5) { animation-delay: 0.5s; }



#random-portfolio-display {
  display: flex;
  justify-content: space-around;
  align-items: center;
  min-width: 98%;
  max-width: 98%;
  margin: 0 auto 50px; /* centrare orizontală + spațiu jos */
  padding: 40px;
  height: 600px;
  color: var(--clr-text);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: opacity 0.5s ease;
  opacity: 0;
  gap: 2rem; /* spațiu între itemi */
}


#random-portfolio-display img {
  width: 50%;
  height: 100%;
  display: block;
  margin: 10px auto;
  border-radius: 10px;
  object-fit: contain;
  background-color: var(--crl-bgprt);
}
#random-portfolio-display video {
  width: 50%;
  height: fit-content;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
  object-fit: contain;
}
#story-container {
    position: relative;
    height: 90vh; /* spațiu fix pentru cuvântul mare */
    margin-top: 30px;
  }

  .big-word {
    position: absolute;
    top: 90%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Oswald', sans-serif;
    font-size: 4rem;
    font-weight: 700;
    color: var(--clr-accent);
    opacity: 0;
    transition: all 0.6s ease;
    white-space: nowrap;
  }

  .big-word.active {
    opacity: 1;
  }

  .big-word.settled {
    font-size: 1.5rem;
    position: static;
    opacity: 1;
    transform: none;
    display: inline-block;
    margin-right: 8px;
    color: var(--clr-text);
    font-weight: 500;
  }

  #final-story {
    font-family: 'Poppins', sans-serif;
  }

  .main-portfolio-item{
    display: flex;
    width: 90%;
    height: 700px;
    margin-bottom: 50px;
    justify-content: center;
    align-items: center;
  }

/* Preloader */
#preloader {
  position: fixed;
  inset: 0;
  background-color: #121212;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #ddd;
  border-top-color: var(--clr-accent, #00bcd4);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#hero-phrase {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--clr-accent);
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.6s ease-in-out;
  min-height: 60px;
  margin-bottom: 3rem;
  text-align: center;

}

#hero-phrase.show {
  opacity: 1;
  transform: scale(1);

}

#story-list {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--clr-text);
  padding: 0 1rem;
  margin-bottom: 100px;

}

.story-line {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease-out;
  background: rgba(255, 255, 255, 0.03);
  border-left: 4px solid var(--clr-accent);
  padding: 0.8rem 1rem;
  border-radius: 0 8px 8px 0;
  backdrop-filter: blur(3px);
  box-shadow: 0 0 10px rgba(0,0,0,0.04);
  
}

.story-line.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 📸 Final image styling */
.final-image.top {
  margin-bottom: 2rem;
  text-align: center;
  opacity: 0;
  transition: opacity 1s ease;

}

.final-image.top img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--clr-accent);
  box-shadow: 0 0 20px var(--clr-canvas-shape);

}

.skills {
      display: grid;
      grid-template-columns: repeat(10, 1fr);
      gap: 20px;
      padding: 40px 20px;
      justify-items: center;
      margin-bottom: 100px;
    }

    .skill {
      display: flex;
      flex-direction: column;
      align-items: center;
      font-size: 40px;
      text-align: center;
      --delay: 0;
      animation: pulse 1s ease-in-out infinite;
      animation-delay: calc(var(--delay) * 2s);
    }

    .skill i,
    .skill img {
      width: 40px;
      height: 40px;
      animation: rotate 1.2s ease-in-out infinite;
      animation-delay: calc(var(--delay) * 2s);
    }

    .skill img {
      object-fit: contain;
      filter: drop-shadow(0 0 2px white);
    }

    .skill span {
      font-size: 14px;
      margin-top: 10px;
    }
@keyframes pulse {
      0%, 100% {
        transform: scale(1);
      }
      50% {
        transform: scale(1.02);
      }
    }
/* --- Responsive Design --- */
@media (max-width: 1024px) {
  .hero-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-main{
    display: flex;
    flex-direction: column;
  }

  .hero-text h1 {
   font-size: 1.8rem;
   margin-bottom: 0.5rem;
  }

  .hero-text h2 {
    font-size: 1.8rem;
  }
   
 .contact-cards {
  margin-bottom: 50px;
}

 #story-container {
    height: auto;
    margin-top: 20px;
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 50px;
  }

  /* Textul mare, afișat sus, fixat */
  .big-word {
    position: static; /* eliminăm poziționarea absolută */
    font-size: 1.5rem;
    opacity: 1;
    white-space: normal;
    margin-bottom: 40px; /* spațiu mare dedesubt */
    transform: none;
    text-align: start;
  }

  /* Când se „așează” cuvintele în linie */
  .big-word.settled {
    font-size: 1.2rem;
    margin-right: 5px;
    margin-bottom: 0;
    color: var(--clr-text);
    font-weight: 500;
  }

  #final-story {
    font-size: 1rem;
    text-align: center;
  }

.main-portfolio-item{
    display: flex;
    flex-direction: column;
    width: fit-content;
    height: fit-content;
    margin-bottom: 50px;
    justify-content: center;
    align-items: center;
  }
  .main-portfolio-item .portfolio-info{
    width: 60%;
  }
  .main-portfolio-item .slideshow-container img.slide {
  width: 60%;
  height: 300px;
  margin-left: 50%;
  transform: translate(-50%);
}
#random-portfolio-display {
  display: flex;
  flex-direction: column;
  justify-content: start;
  padding: 4rem 2rem;
}
#random-portfolio-display img {
  min-width: 100%;
  height: max-content;
  
}
#random-portfolio-display video {
  min-width: 100%;
  height:max-content;
}
.hero-image img {
  width: 200px;
  height: 200px;
}
.skills {
      grid-template-columns: repeat(4, 1fr);
    }

}

