@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  border: none;
  outline: none;
  font-family: "Poppins", "sans-serif";
}

:root {
  --bg-color: #081b29;
  --main-color: #00abf0;
  --main-color-rgb: 0, 171, 240;
  --accent-warm: #ff9800;
  --accent-warm-rgb: 255, 152, 0;
  --text-color: #333;
  --second-text-color: #555;
  --white-color: #fff;
  /* Premium Dynamic Gradient */
  --cover-color: linear-gradient(135deg, #081b29, #00abf0, #006e9a, #081b29);
  --pages-color: linear-gradient(90deg, #fff, #f0f0f0);
  --border: 0.125rem solid var(--main-color);
  --box-shadow: 0 0 0.6rem rgba(0, 0, 0, 0.2);
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--bg-color);
  color: var(--text-color);
  overflow: hidden;
}

.wrapper {
  position: relative;
  width: 66rem;
  height: 45rem;
  padding: 2rem;
  perspective: 250rem;
  animation: show-animate 2s forwards;
}

@keyframes show-animate {

  0%,
  30% {
    opacity: 0;
    transform: rotate(-80deg);
  }

  100% {
    opacity: 1;
    transform: rotate(0deg);
  }
}

.cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: var(--cover-color);
  background-size: 300% 300%;
  animation: cover-wave 10s ease infinite;
  box-shadow: var(--box-shadow);
  border-top-left-radius: 0.6rem;
  border-bottom-left-radius: 0.6rem;
  transform-origin: right;
}

@keyframes cover-wave {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.cover.cover-left {
  z-index: -1;
}

.cover.cover-right {
  z-index: 100;
  transition: transform 1s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.cover.cover-right.turn {
  transform: rotateY(180deg);
}

.book {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  perspective: 250rem;
}

.book .book-page {
  position: absolute;
  width: 50%;
  height: 100%;
  background: var(--pages-color);
  box-shadow: 0 0 0.6rem rgba(0, 0, 0, 0.1);
  display: flex;
  padding: 2rem;
}

.book-page.page-left {
  box-shadow: -.6rem 6rem .6rem rgba(0, 0, 0, 0.1);
}

.profile-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.profile-page img {
  max-width: 180px;
  border-radius: 50%;
  border: 0.25rem solid var(--main-color);
  margin-bottom: 0.8rem;
}

.profile-page h1 {
  font-size: 2.7rem;
  line-height: 1;
}

.profile-page h3 {
  font-size: 1.5rem;
  color: var(--main-color);
}

.profile-page .social-media {
  margin: 0.6rem 0 0.8rem;
}

.profile-page .social-media a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  border: var(--border);
  border-radius: 50%;
  font-size: 1.3rem;
  color: var(--main-color);
  margin: 0 0.2rem;
  transition: 0.5s;
}

.profile-page .social-media a:hover {
  background: var(--main-color);
  color: var(--white-color);
}

.profile-page p {
  text-align: justify;
}

.profile-page .btn-box {
  margin-top: 1.2rem;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 9.5rem;
  height: 3rem;
  background: var(--main-color);
  border: var(--border);
  border-radius: 0.3rem;
  font-size: 1rem;
  color: var(--white-color);
  font-weight: 500;
  margin: 0 1rem;
  transition: 0.5s;
}

.btn:hover {
  background: transparent;
  color: var(--main-color);
}

.btn-box .btn:nth-child(2) {
  background: transparent;
  color: var(--main-color);
}

.btn-box .btn:nth-child(2):hover {
  background: var(--main-color);
  color: var(--white-color);
}

.book-page.page-right {
  position: absolute;
  right: 0;
  transform-style: preserve-3d;
  transform-origin: left;
  transition: transform 1s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.book-page.page-right.turn {
  transform: rotateY(-180deg);
}

.book-page .page-front,
.book-page .page-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--pages-color);
  padding: 1.5rem 2rem;
}

.book-page .page-front {
  transform: rotateY(0deg) translateZ(1px);
}

.book-page .page-back {
  transform: rotateY(180deg) translateZ(1px);
}

.title {
  text-align: center;
  margin-bottom: 1rem;
}

.workeduc-box {
  border-left: var(--border);
}

.workeduc-box .workeduc-content {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 1.2rem;
}

.workeduc-box .workeduc-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: -0.65rem;
  width: 1.2rem;
  height: 1.2rem;
  background: var(--main-color);
  border-radius: 50%;
}

.workeduc-content .year {
  color: var(--main-color);
}

.workeduc-content h4 {
  font-size: .8rem;
  font-weight: 400;
}


.workeduc-content .year i {
  margin-right: .4rem;
}

.number-page {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
}

.nextprev-btn {
  position: absolute;
  bottom: .9rem;
  right: 1.5rem;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  font-size: 2rem;
  color: var(--text-color);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: .5s;
}

.nextprev-btn:hover {
  color: var(--main-color);
}

.nextprev-btn.back {
  left: 1.5rem;
}

.services-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.services-box .services-content {
  flex: 1 1 10rem;
  border: var(--border);
  border-radius: .5rem;
  padding: .8rem .5rem 1.1rem;
  text-align: center;
  transition: .3s ease;
}

.services-box .services-content:hover {
  box-shadow: var(--box-shadow);
}

.services-content i {
  font-size: 2.5rem;
  color: var(--main-color);
}

.services-content h3 {
  font-size: 1.1rem;
}

.services-content p {
  margin: .2rem 0 .8rem;
}

.services-content .btn {
  width: 8rem;
  height: 2.5rem;
}

.skills-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;

}

.skills-box .skills-content {
  flex: 1 1 20rem;
}

.skills-content h3 {
  font-size: 1.3rem;
  line-height: 1;
  margin-bottom: .6rem;
}

.skills-content .content {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
}

.skills-content .content span {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 6rem;
  height: 5rem;
  border: var(--border);
  border-radius: .3rem;
  font-weight: 600;
  transition: .3s ease;
}

.skills-content .content span:hover {
  box-shadow: var(--box-shadow);
}

.skills-content .content span i {
  font-size: 3rem;
  color: var(--main-color);
}

.portfolio-box .img-box {
  display: flex;
  width: 100%;
  height: 15rem;
  border: var(--border);
  border-radius: .5rem;
  overflow: hidden;
}

.portfolio-box .img-box img {
  width: 100%;
  object-fit: cover;
  transition: .5s ease;
}

.portfolio-box .img-box:hover img {
  transform: scale(1.1);
}

.portfolio-box .info-box {
  margin: 1rem 0 1.5rem;
}

.portfolio-box .info-box .info-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.portfolio-box .info-box .info-title h3 {
  font-size: 1.3rem;
}

.portfolio-box .info-box .info-title a {
  display: flex;
  align-items: center;
  color: var(--main-color);
}

.portfolio-box .info-box .info-title a i {
  margin-left: .3rem;
}

.portfolio-box .info-box p:nth-of-type(1) {
  font-weight: 600;
}

.portfolio-box .btn-box {
  display: flex;
  justify-content: center;
}

.portfolio-box .btn-box .btn {
  margin: 0 1.15rem;
}

.contact-box {
  text-align: center;
}

.contact-box .field {
  width: 100%;
  background: transparent;
  border: var(--border);
  border-radius: .3rem;
  padding: .8rem;
  font-size: 1rem;
  color: var(--text-color);
  margin-bottom: 1.5rem;
}

.contact-box .field::placeholder {
  color: var(--text-color);
}

.contact-box textarea {
  resize: none;
  height: 15rem;
}

.contact-box .btn {
  cursor: pointer;
}

.back-profile {
  position: absolute;
  bottom: 1.2rem;
  right: 2rem;
  width: 2rem;
  height: 2rem;
  background: transparent;
  border: var(--border);
  border-radius: .3rem;
  font-size: 1.1rem;
  color: var(--main-color);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: .5s;
}

.back-profile:hover {
  background: var(--main-color);
  color: var(--white-color);
}

.back-profile p {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scale(.5);
  font-size: 1rem;
  color: var(--main-color);
  opacity: 0;
  transition: .5s;
}

.back-profile:hover p {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  top: -1.8rem;
}

.mobile-only-btn {
  display: none !important;
}

.mobile-view {
  display: none;
}

/* ========================================================================= */
/* Responsive "Handbook" Mobile Styles */
/* ========================================================================= */

@media (max-width: 1200px) {
  html {
    font-size: 85%;
  }
}

@media (max-width: 991px) {
  html {
    font-size: 70%;
  }
}

@media (max-width: 768px) {
  html {
    font-size: 95%;
  }

  /* Hide Desktop Book */
  .desktop-view {
    display: none !important;
  }

  /* Show Mobile View */
  .mobile-view {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    background: #fdfdfd; /* Clean white background */
    overflow: hidden;
  }

  .mobile-card {
    position: relative;
    width: 90vw;
    height: 85vh;
    background: #ffffff;
    border: 2px solid rgba(var(--main-color-rgb), 0.5);
    border-radius: 2rem;
    box-shadow: 0 20px 40px rgba(var(--main-color-rgb), 0.15), 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .mobile-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 2.5rem 1.5rem 7rem; /* Increased padding */
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translateY(20px); /* Start slightly lower for slide animation */
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
  }

  .mobile-page.active {
    opacity: 1;
    transform: translateY(0); /* Slide up to normal position */
    pointer-events: auto;
    z-index: 10;
  }

  .mobile-badge {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: #fff;
    color: var(--main-color);
    border: 2px solid var(--main-color);
    padding: 0.3rem 1rem;
    border-radius: 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  }

  .mobile-title {
    color: var(--main-color);
    font-size: 2.2rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
    text-align: center;
  }

  .mobile-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: auto 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  .mobile-content.profile-page img {
    width: 12rem;
    height: 12rem;
    border: 3px dashed var(--main-color);
    padding: 0.5rem;
    background-color: #d1dbdb;
    margin-bottom: 1.5rem;
    margin-top: 1rem;
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(var(--main-color-rgb), 0.3);
  }

  .mobile-content.profile-page h1 { font-size: 2rem; color: var(--text-color); margin-bottom: 0.2rem; }
  .mobile-content.profile-page h3 { font-size: 1.3rem; color: var(--main-color); margin-bottom: 1.5rem; font-weight: bold; }
  .mobile-content.profile-page p { font-size: 0.95rem; line-height: 1.6; color: var(--second-text-color); text-align: justify; text-align-last: center; margin-bottom: 1.5rem; }
  
  .social-media a { border: 1px solid var(--main-color); color: var(--main-color); background: transparent; margin: 0 0.5rem 1.5rem; border-radius: 50%; width: 2.5rem; height: 2.5rem; display: inline-flex; align-items: center; justify-content: center; transition: 0.3s; }
  .social-media a:hover { background: var(--main-color); color: var(--white-color); }
  .btn-box { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
  .btn-box .btn { background: var(--main-color); border-color: var(--main-color); color: var(--white-color); margin: 0; }
  .btn-box .btn:hover { color: var(--main-color); background: transparent; }
  .btn-box .btn.contact-me { background: transparent; color: var(--main-color); }
  .btn-box .btn.contact-me:hover { background: var(--main-color); color: var(--white-color); }
  
  .workeduc-box { border-left: var(--border); width: 100%; display: flex; flex-direction: column; align-items: flex-start; padding-left: 0.5rem; margin-left: 1rem; }
  .workeduc-content { padding: 0 0 0 1.6rem; width: 100%; margin-bottom: 2rem; display: flex; flex-direction: column; align-items: flex-start; text-align: left; position: relative; }
  .workeduc-content::before { display: block; content: ''; position: absolute; top: 0; left: -1.15rem; width: 1.2rem; height: 1.2rem; background: var(--main-color); border-radius: 50%; }
  .workeduc-content h3 { font-size: 1.3rem; margin-bottom: 0.3rem; color: var(--text-color); }
  .workeduc-content p { font-size: 0.9rem; color: var(--second-text-color); text-align: left; }
  .workeduc-content .year { color: var(--main-color); display: inline-block; margin-bottom: 0.8rem; font-weight: bold; }
  
  .services-box, .skills-box { display: flex; flex-direction: column; width: 100%; gap: 1.5rem; align-items: center; }
  .services-content { width: 100%; border-color: var(--main-color); text-align: center; }
  .services-content i { color: var(--main-color); }
  
  .skills-content { width: 100%; border: none; padding: 0; text-align: center; }
  .skills-content h3 { font-size: 1.2rem; color: var(--text-color); margin-bottom: 1rem; border: none; }
  .skills-content .content { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; }
  .skills-content .content span { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 5.5rem; height: 5.5rem; border: 1px solid var(--main-color); border-radius: 0.2rem; color: var(--text-color); background: transparent; font-size: 0.8rem; font-weight: bold; padding: 0; transition: 0.3s; }
  .skills-content .content span:hover { box-shadow: var(--box-shadow); }
  .skills-content .content span i { font-size: 2rem; color: var(--main-color); margin-bottom: 0.4rem; }
  
  .portfolio-box { width: 100%; display: flex; flex-direction: column; align-items: center; margin-bottom: 2rem; }
  .portfolio-box .img-box { border: 1px solid var(--main-color); padding: 1rem; border-radius: 0.3rem; margin-bottom: 1.5rem; background: #fff; display: flex; align-items: center; justify-content: center; }
  .portfolio-box .img-box img { max-width: 100%; border-radius: 0; }
  .portfolio-box .info-box { text-align: center; width: 100%; }
  .portfolio-box .info-box h3 { color: var(--text-color); font-size: 1.2rem; margin-bottom: 1rem; }
  .portfolio-box .info-box p { font-size: 0.85rem; color: var(--second-text-color); }
  .portfolio-box .info-box .info-title a { color: var(--main-color); font-size: 1rem; }
  
  .mobile-contact { width: 100%; padding: 0 0.5rem; }
  .mobile-contact .field { border: 1px solid var(--main-color); border-radius: 0.3rem; background: #fff; margin-bottom: 1.2rem; width: 100%; padding: 1rem; color: var(--text-color); }
  .mobile-contact .btn { background: var(--main-color); border-color: var(--main-color); color: var(--white-color); width: 100%; margin: 0; border-radius: 0.3rem; padding: 1rem; }
  .mobile-contact .btn:hover { background: transparent; color: var(--main-color); }

  .mobile-nav-pill {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    background: rgba(255, 255, 255, 0.85); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(var(--main-color-rgb), 0.3);
    border-radius: 2.5rem;
    overflow: hidden;
    z-index: 20;
    box-shadow: 0 8px 25px rgba(var(--main-color-rgb), 0.25);
  }

  .pill-btn {
    background: transparent;
    border: none;
    padding: 0.6rem 1.5rem; 
    font-size: 1.8rem;
    color: var(--main-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .pill-prev { border-right: 1px solid rgba(var(--main-color-rgb), 0.2); }
  .pill-contact { border-right: 1px solid rgba(var(--main-color-rgb), 0.2); }
  .pill-next { color: #ccc; } 
  
  .pill-btn:hover {
    background: rgba(var(--main-color-rgb), 0.1);
  }
  
  .pill-btn:active {
    transform: scale(0.85);
    background: rgba(var(--main-color-rgb), 0.2);
  }
}

@media (max-width: 768px) and (max-height: 500px) and (orientation: landscape) {
  .mobile-card {
    height: calc(100vh - 2rem);
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
  .mobile-page {
    padding: 1.5rem 1.5rem 5rem;
  }
  .mobile-content.profile-page img {
    width: 6rem;
    height: 6rem;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
  }
  .mobile-title {
    font-size: 1.5rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
  }
  .mobile-nav-pill {
    bottom: 0.5rem;
  }
  .pill-btn {
    padding: 0.3rem 1rem;
    font-size: 1.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-page {
    transition: opacity 0.1s ease !important;
    transform: none !important;
  }
  .mobile-page.active {
    transform: none !important;
  }
  .cover.cover-right {
    transition: opacity 0.1s ease !important;
    transform: none !important;
  }
  .book-page.page-right {
    transition: opacity 0.1s ease !important;
    transform: none !important;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 60%;
  }
}