body {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: Monospace;
  color: #f9f9f9;
  background: linear-gradient(90deg, #353839 0%, #888888 100%);
  background-color: #353839;
}

@font-face {
  font-family: "Adoria";
  src: url("./fonts/Adoriademo.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Ankh';
  src: url("./fonts/AnkhSanctuary-PVK0B.ttf") format("truetype"); 
  font-weight: normal;
  font-style: normal;
}

html {
  scroll-behavior: smooth;
}

#intro {
  scroll-margin-top: 15vh;
}

/* ----------------------------------------------------------------------------------------------------------- */

.header {
  display: flex;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 1000;
  height: 10vh;
  width: 100%;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #353839 0%, #888888 100%);
  background-color: rgba(255, 255, 255, 0);
  opacity: 0;
  transform: scale(0.8);
  transition: transform 0.6s ease, opacity 0.6s ease;
}

.header.in-view {
  opacity: 1;
  transform: scale(1);
}

.header::after {
  content: '';
  position: absolute;
  bottom: 1vh;
  left: 50%;
  height: 3px;
  width: 50vh;  
  background: #f9f9f9;
  transform: translateX(-50%);
  pointer-events: none;
}

.nav {
  display: flex;
  position: relative;
  gap: 2rem;
}

.nav::before,
.nav::after {
  content: '';
  height: 3px;
  width: 10vh;
  align-self: center;
  background-color: #f9f9f9;
}

.nav::before {
  margin-right: 2rem;
}

.nav::after {
  margin-left: 2rem;
}

.nav-icon {
  font-size: 3vh;
  color: #f9f9f9;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.nav-icon:hover {
  color: #888888;
}

/* ----------------------------------------------------------------------------------------------------------- */

.name-space {
  display: flex;
  position: relative;
  height: 100vh;
  margin-top: -10vh;
  padding: 4vh 2vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transform: translateX(-100px);
  transition: all 1s ease;
}

.name-space.in-view {
  opacity: 1;
  transform: translateX(0);
}

.name-node {
  position: relative;
  z-index: 2;
  text-align: center;
}

.name-node h1 {
  position: relative;
  margin: 0;
  font-family: "Adoria";
  font-size: 5rem;
}

.occupation {
  position: relative;
  height: 3rem;
  overflow: hidden;
}

.occupation p {
  display: flex;
  height: 3rem;
  margin: 0;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transform: translateY(0);
  transition: transform 0.5s ease-in-out;
}

.socials {
  display: flex;
  margin-top: 1rem;
  justify-content: center;
  gap: 2rem;
  font-size: 2rem;
  cursor: pointer;
}

.socials i {
  color: #f0f0f0;
}

.socials a :hover {
  transform: translateY(-5px) scale(1.05);
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
}

/* ----------------------------------------------------------------------------------------------------------- */

.intro {
  padding: 10vh 2vh;
}

.personal {
  display: flex;
  position: relative;
  height: 50vh;
  width: 60vw;
  margin: 0 auto;
  overflow: visible;
  align-items: stretch;
  justify-content: center;
  border-radius: 1rem;
  background-color: #888888;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  transition: transform 0.6s ease, filter 0.6s ease;
  will-change: transform;
}

.personal.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.personal:hover {
  transform: translateY(-10px) scale(1.05);
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
}

.side-left {
  max-width: 25ch;
  padding: 2rem;
  flex: 1;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
}

.typing-text {
  display: inline-block;
  overflow: hidden;
  font-family: monospace;
  white-space: normal;
}

@keyframes blink {
  50% { border-color: transparent; }
}

.picture-container {
  display: flex;
  position: relative;
  height: 100%;
  flex: 2;
  align-items: flex-end;
  justify-content: center;
}

.picture {
  position: relative;
  bottom: 0;
  height: 150%;
  transition: transform 0.4s ease, filter 0.4s ease;
  will-change: transform;
}

.picture:hover {
  transform: translateY(-10px) scale(1.05);
  filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
}

.picture img {
  display: block;
  position: absolute;
  bottom: 0;
  left: 50%;
  height: 100%;
  width: auto;
  transform: translateX(-50%);
}

.side-right {
  padding: 2rem;
  flex: 1;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
}

.side-right i {
  text-align: left;
  transition: transform 0.3s ease, color 0.3s ease;
}

.side-right p:hover i {
  transform: scale(1.2);
}

.side-right p {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.5s ease;
  word-break: break-all;
}

.side-right p:nth-child(2) { transition-delay: 0.5s; }
.side-right p:nth-child(3) { transition-delay: 0.4s; }
.side-right p:nth-child(4) { transition-delay: 0.3s; }
.side-right p:nth-child(5) { transition-delay: 0.2s; }
.side-right p:nth-child(6) { transition-delay: 0.1s; }

.personal:hover .side-right p {
  opacity: 1;
  transform: translateY(0);
}

.personal:hover .side-right p:nth-child(2) { transition-delay: 0.1s; }
.personal:hover .side-right p:nth-child(3) { transition-delay: 0.2s; }
.personal:hover .side-right p:nth-child(4) { transition-delay: 0.3s; }
.personal:hover .side-right p:nth-child(5) { transition-delay: 0.4s; }
.personal:hover .side-right p:nth-child(6) { transition-delay: 0.5s; }

/* ----------------------------------------------------------------------------------------------------------- */

.brand-carousel {
  display: flex;
  padding: 30px 0;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  transition: transform 0.6s ease, filter 0.6s ease;
}

.brand-carousel.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.carousel-wrapper {
  position: relative;
  width: 40vw;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 85%, transparent 100%);
}

.carousel {
  display: flex;
  width: max-content;
  animation: slideLeft 20s linear infinite;
}

.carousel img {
  height: 80px;
  width: 80px;
  margin: 0 10px;
  object-fit: contain;
  flex-shrink: 0;
  transition: opacity 0.5s ease-in-out;
}

@keyframes slideLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ----------------------------------------------------------------------------------------------------------- */

.xp {
  display: flex;
  padding: 4vh 2vh;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: space-around;
}

.xp > div {
  opacity: 0;
  transform: translateX(-100px);
  transition: 1s ease;
}

.xp > div.in-view {
  opacity: 1;
  transform: translateX(0);
}
.xp > div:nth-child(1) {
  transition-delay: 0.2s;
}
.xp > div:nth-child(2) {
  transition-delay: 0.4s;
}
.xp > div:nth-child(3) {
  transition-delay: 0.6s;
}

.experience,
.education,
.certs {
  height: 70vh;
  width: 25vw;
  margin: 0 auto;
  padding: 1rem;
  text-align: center;
  border-radius: 1rem;
  background-color: #888888;
}

.job-list p {
  padding: 0.5rem;
  text-align: center;
  border: 2px solid #fff;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.3s;
}

.job-list p:hover {
  background: #555;
}

.job-details {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
}

.back-button {
  padding: 0.3rem 0.8rem;
  align-self: flex-start;
  border: 2px solid #fff;
  border-radius: 0.3rem;
  color: white;
  background: #888888;
  cursor: pointer;
  transition: background 0.3s;
}

.back-button:hover {
  background: #555;
}

.study {
  display: grid;
  margin-bottom: 1rem;
  padding: 0.5rem;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 1rem 2rem;
  border: 2px solid #fff;
  border-radius: 0.5rem;
  background: #888888;
}

.degree {
  grid-column: 1;
  grid-row: 1;
}

.institution {
  grid-column: 1;
  grid-row: 2;
}

.study-time {
  grid-column: 2;
  grid-row: 1;
}

.results {
  grid-column: 2;
  grid-row: 2;
}

.certs i {
  /* color: #f7b500; (gold) */
  font-size: 1.2rem;
}

/* ----------------------------------------------------------------------------------------------------------- */

.knowledge {
  display: flex;
  padding: 4vh 2vh;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: space-around;
}

.knowledge > div {
  opacity: 0;
  transform: translateX(100px);
  transition: all 1s ease;
}

.knowledge > div.in-view {
  opacity: 1;
  transform: translateX(0);
}
.knowledge > div:nth-child(1) {
  transition-delay: 0.6s;
}
.knowledge > div:nth-child(2) {
  transition-delay: 0.4s;
}
.knowledge > div:nth-child(3) {
  transition-delay: 0.2s;
}

.skills,
.languages,
.interests {
  height: 70vh;
  width: 25vw;
  margin: 0 auto;
  padding: 1rem;
  overflow: auto;
  text-align: center;
  border-radius: 1rem;
  background-color: #888888;
}

.skills-tabs {
  display: flex;
  box-sizing: border-box;
  width: 100%;
  margin: 1rem auto;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.skills-tabs button {
  min-width: 4rem;
  max-width: 6rem;
  padding: 0.6rem 1.2rem;
  flex: 1 1 25vw;
  text-align: center;
  border: 2px solid #fff;
  border-radius: 0.5rem;
  font-weight: bold;
  color: #fff;
  background: #888888;
  cursor: pointer;
  transition: background 0.3s ease;
}

.skills-tabs button.active {
  color: white;
  background: #333;
}

.skills-tabs button:hover {
  background-color: #555;
}

.skill-group {
  display: none;
  animation: fadeIn 0.4s ease;
}

.skill-group.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.skills-content {
  display: flex;
  margin-top: 1rem;
  padding: 0;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.6rem;
}

.skills-content ul {
  display: flex;
  margin: 0.4rem 0 1.2rem;
  padding: 0;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
}

.skills-content li {
  display: inline-flex;
  padding: 0.5rem 1.1rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  background-color: rgba(255, 255, 255, 0.07);
  animation: float 3s ease-in-out infinite;
  transition: all 0.3s ease;
  backdrop-filter: blur(6px);
  white-space: nowrap;
  letter-spacing: 0.01rem;
  list-style: none;
}

.skills-content li:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-0.4rem); }
  100% { transform: translateY(0); }
}

.languages-cards {
  display: flex;
  margin-top: 1rem;
  flex-direction: column;
  align-items: center;
}

.languages-cards .card {
  display: flex;
  height: 5rem;
  width: 70%;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  background-size: cover;
  background-position: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 0.4rem 1rem rgba(0, 0, 0, 0.4);
  text-shadow: 0 0 5px rgba(0,0,0,0.6);
}

.languages-cards .card:hover {
  transform: scale(1.04);
  box-shadow: 0 0.6rem 1.2rem rgba(0, 0, 0, 0.5);
}

.card.english {
  background-image: url('https://flagcdn.com/w640/gb.png');
}
.card.arabic {
  background-image: url('https://flagcdn.com/w640/sa.png');
}

/* ----------------------------------------------------------------------------------------------------------- */

.cv {
  display: flex;
  margin: 2rem auto;
  padding: 2rem;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.cv-button {
  display: flex;
  padding: 0.75rem 1.5rem;
  align-items: center;
  gap: 0.75rem;
  border: 2px solid #fff;
  border-radius: 2rem;
  font-weight: 500;
  color: #fff;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  transition: background 0.3s;
  transition: transform 0.6s ease, filter 0.6s ease;
  text-decoration: none;
}

.cv-button.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.cv-button:hover {
  background: #555;
}

.cv-icon {
  display: flex;
  height: 2rem;
  width: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.2rem;
}

.cv-text {
  flex: 1;
}

/* ----------------------------------------------------------------------------------------------------------- */

.projects{
  padding: 4vh 2vh;
}

.projects-intro {
  margin-bottom: 4rem;
  align-items: center;
  text-align: center;
}

.projects-intro h1 {
  font-size: 2rem;
}

.projects-intro p {
  width: 20vw;
  margin: 0 auto;
}

.projects-wheel {
  display: flex;
  width: 70%;           /* Set fixed width, avoid fit-content */
  max-width: 100%;      /* Prevent overflow on smaller screens */
  margin: 0 auto;
  overflow: hidden;
  flex-wrap: wrap;      /* Keep wrapping */
  align-items: stretch;
  justify-content: center; /* Align items to start for consistent rows */
  gap: 1.5rem;          /* Smaller gap for tighter spacing */
  background: rgba(0, 0, 255, 0.1);
}

.prj {
  height: 70vh;
  margin: 0;            /* Remove margin to avoid extra gaps */
  padding: 1rem;
  overflow: auto;
  flex: 0 0 15vw;       /* Fix width and prevent shrinking */
  text-align: center;
  border-radius: 1rem;
  color: #333;
  background-color: #f0f0f0;
}

.prj img {
  height: 30vh;
  width: 90%;
  margin-top: 1rem;
  border-radius: 1rem;
}

.prj button {
  border-radius: 1rem;
}