@import url("https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap");

* {
  margin: 0;
  padding: 0;
  text-decoration: none;
  box-sizing: border-box;
  border: none;
  outline: none;
}

:root {
  --bg-color: #151f28;
  --main-color: #00abf0;
  --text-color: #333;
  --second-text-color: #555;
  --white-color: #fff;
  --cover-color: linear-gradient(45deg, #00abf0, #006e9a);
  --pages-color: linear-gradient(90deg, #fff, #ddd);
  --border: 0.125rem solid #00abf0;
  --box-shadow: 0 0 0.8rem rgba(0, 0, 0, 0.2);
  --book-light: 0 0 0.8rem rgba(0, 171, 240, 0.35);
  --book-inner-light: inset 0 0 2rem rgba(0, 171, 240, 0.15);
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow: hidden;
  font-family: "Nunito", sans-serif;
  cursor: url("../images/cursor.png"), auto;
}

.wrapper {
  position: relative;
  width: 66rem;
  height: 45rem;
  padding: 2rem;
  perspective: 250rem;
  animation: show-animate 2s forwards;
  box-shadow: var(--book-light);
  transition: transform 0.4s ease, box-shadow 0.8s ease;
}

@keyframes show-animate {
  0%, 30% {
    opacity: 0;
    transform: rotate(-20deg);
  }
  100% {
    opacity: 1;
    transform: rotate(0deg);
  }
}

.cover {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  background: var(--cover-color);
  box-shadow: var(--box-shadow);
  border-top-left-radius: 0.6rem;
  border-bottom-left-radius: 0.6rem;
  transform-origin: right;
}

.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;
  box-shadow: var(--book-inner-light);
  transition: box-shadow 0.8s ease, background 0.8s ease;
}

.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;
  box-shadow: var(--book-inner-light);
  transition: box-shadow 0.8s ease, background 0.8s ease;
}

.book-page.page-left {
  box-shadow: -0.6rem 0.6rem 0.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 {
  color: var(--main-color);
  font-size: 1.5rem;
}

.profile-page .social-media {
  margin: 0.6rem 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-color: var(--main-color);
  color: var(--white-color);
}

.profile-page p {
  text-align: justify;
  font-size: 1.1rem;
}

.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-box .btn:nth-child(2) {
  background: transparent;
  color: var(--main-color);
}

.btn-box .btn:nth-child(1):hover {
  background: transparent;
  color: var(--main-color);
}

.btn-box .btn:nth-child(2):hover {
  background: var(--main-color);
  color: var(--white-color);
}

/* right page */
.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;
}

.workeduc-box {
  border-left: var(--border);
  margin-top: 2rem;
}

.workeduc-box .workeduc-content {
  position: relative;
  padding-left: 1.6rem;
  padding-bottom: 1.2rem;
}

.workeduc-box .workeduc-content::before {
  content: "";
  position: absolute;
  top: 0;
  left: -0.65rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background: var(--main-color);
}

.workeduc-content .year {
  color: var(--main-color);
  font-size: 1.2rem;
}

.workeduc-content h3 {
  font-size: 1.4rem;
  margin: 0.3rem 0;
}

.workeduc-content p {
  font-size: 1.15rem;
  text-align: justify;
}

.workeduc-content .year i {
  margin-right: 0.4rem;
  font-size: 1.2rem;
}

.number-page {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-weight: 600;
}

/* next button */
.nextprev-btn {
  position: absolute;
  bottom: 0.9rem;
  right: 1.5rem;
  width: 2rem;
  height: 2rem;
  cursor: pointer;
  font-size: 2rem;
  color: var(--second-text-color);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: 0.5s;
}

.nextprev-btn:hover {
  color: var(--main-color);
}

.nextprev-btn.back {
  left: 1.5rem;
}

/* my services */
.services-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
}

.services-box .services-content {
  flex: 1 1 10rem;
  border: var(--border);
  border-radius: 0.5rem;
  padding: 0.8rem 0.5rem 1.1rem;
  text-align: center;
  transition: 0.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: 0.2rem 0 0.8rem;
}

.services-content .btn {
  width: 8rem;
  height: 2.5rem;
}

.services-content .btn:hover {
  background-color: transparent;
  color: var(--main-color);
}

/* skills box */
.skills-box {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 2rem;
}

.skills-box .skills-content {
  flex: 1 1 20rem;
}

.skills-content h3 {
  font-size: 1.3rem;
  line-height: 1;
  margin-bottom: 0.6rem;
}

.skills-content .content {
  display: flex;
  flex-wrap: wrap;
  gap: 0.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: 0.3rem;
  font-weight: 600;
  transition: 0.3 ease;
}

.skills-content .content span:hover {
  box-shadow: var(--box-shadow);
}

.skills-content .content span i {
  color: var(--main-color);
  font-size: 3rem;
}

/* portfolio */
.portfolio-box {
  margin-top: 2rem;
}

.portfolio-box .img-box {
  display: flex;
  width: 100%;
  height: 15rem;
  border-radius: 0.5rem;
  border: var(--border);
  overflow: hidden;
}

.portfolio-box .img-box img {
  width: 100%;
  object-fit: cover;
  transition: 0.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: 0.3rem;
}

.portfolio-box .info-box p:nth-of-type(1) {
  font-weight: 600;
}

.portfolio-box .info-box p {
  text-align: justify;
}

.portfolio-box .btn-box {
  display: flex;
  justify-content: center;
}

.portfolio-box .btn-box .btn {
  margin: 0 1 0.15rem;
}

/* Contact Me! */
.contact-box {
  margin-top: 2rem;
  text-align: center;
}

.contact-box .field {
  width: 100%;
  background-color: transparent;
  border: var(--border);
  border-radius: 0.3rem;
  padding: 0.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;
}

.contact-box .btn:hover {
  background-color: transparent;
  color: var(--main-color);
}

.back-profile {
  position: absolute;
  bottom: 1.2rem;
  right: 2rem;
  width: 2rem;
  height: 2rem;
  background-color: transparent;
  border: var(--border);
  border-radius: 0.3rem;
  font-size: 1.1rem;
  color: var(--main-color);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  transition: 0.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(0.5);
  font-size: 1rem;
  opacity: 0;
  transition: 0.5s;
  color: var(--main-color);
}

.back-profile:hover p {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  top: -1.8rem;
}

/* 🌗 Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  cursor: pointer;
  z-index: 999;
  color: var(--white-color);
}

/* Light Mode */
body.light {
  --bg-color: #f4f6f8;
  --pages-color: linear-gradient(90deg, #ffffff, #f1f1f1);
  --text-color: #111;
  --second-text-color: #333;
  --book-light: 0 0 1.5rem rgba(255, 180, 80, 0.55);
  --book-inner-light: inset 0 0 3rem rgba(255, 210, 120, 0.35);
}

/* Projects Page */
.projects-page {
  min-height: 100vh;
  padding: 4rem;
  background: var(--bg-color);
  color: var(--text-color);
  text-align: center;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 3rem 0;
}

/* Loading State */
.loading {
  color: var(--main-color);
  font-size: 1.2rem;
  grid-column: 1 / -1;
}

/* ============================================
   🌗 BB-8 TOGGLE - COMPLETE STYLES
   ============================================ */
.bb8-toggle {
  --toggle-size: 16px;
  --toggle-width: 10.625em;
  --toggle-height: 5.625em;
  --toggle-offset: calc((var(--toggle-height) - var(--bb8-diameter)) / 2);
  --toggle-bg: linear-gradient(#2c4770, #070e2b 35%, #628cac 50% 70%, #a6c5d4) no-repeat;
  --bb8-diameter: 4.375em;
  --radius: 99em;
  --transition: 0.4s;
  --accent: #de7d2f;
  --bb8-bg: #fff;
  
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  cursor: pointer;
  font-size: var(--toggle-size);
  -webkit-tap-highlight-color: transparent;
}

.bb8-toggle,
.bb8-toggle *,
.bb8-toggle *::before,
.bb8-toggle *::after {
  box-sizing: border-box;
}

.bb8-toggle__checkbox {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  display: none;
}

.bb8-toggle__container {
  width: var(--toggle-width);
  height: var(--toggle-height);
  background: var(--toggle-bg);
  background-size: 100% 11.25em;
  background-position-y: -5.625em;
  border-radius: var(--radius);
  position: relative;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.bb8 {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: absolute;
  top: calc(var(--toggle-offset) - 1.688em + 0.188em);
  left: var(--toggle-offset);
  transition: var(--transition);
  z-index: 2;
}

.bb8__head-container {
  position: relative;
  transition: var(--transition);
  z-index: 2;
  transform-origin: 1.25em 3.75em;
}

.bb8__head {
  overflow: hidden;
  margin-bottom: -0.188em;
  width: 2.5em;
  height: 1.688em;
  background: linear-gradient(
      transparent 0.063em,
      dimgray 0.063em 0.313em,
      transparent 0.313em 0.375em,
      var(--accent) 0.375em 0.5em,
      transparent 0.5em 1.313em,
      silver 1.313em 1.438em,
      transparent 1.438em
    ),
    linear-gradient(45deg, transparent 0.188em, var(--bb8-bg) 0.188em 1.25em, transparent 1.25em),
    linear-gradient(-45deg, transparent 0.188em, var(--bb8-bg) 0.188em 1.25em, transparent 1.25em),
    linear-gradient(var(--bb8-bg) 1.25em, transparent 1.25em);
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0.063em 0.125em gray);
}

.bb8__head::before {
  content: "";
  position: absolute;
  width: 0.563em;
  height: 0.563em;
  background: radial-gradient(0.125em circle at 0.25em 0.375em, red, transparent),
    radial-gradient(0.063em circle at 0.375em 0.188em, var(--bb8-bg) 50%, transparent 100%),
    linear-gradient(45deg, #000 0.188em, dimgray 0.313em 0.375em, #000 0.5em);
  border-radius: var(--radius);
  top: 0.413em;
  left: 50%;
  transform: translate(-50%);
  box-shadow: 0 0 0 0.089em lightgray, 0.563em 0.281em 0 -0.148em,
    0.563em 0.281em 0 -0.1em var(--bb8-bg), 0.563em 0.281em 0 -0.063em;
  z-index: 1;
  transition: var(--transition);
}

.bb8__head::after {
  content: "";
  position: absolute;
  bottom: 0.375em;
  left: 0;
  width: 100%;
  height: 0.188em;
  background: linear-gradient(
    to right,
    var(--accent) 0.125em,
    transparent 0.125em 0.188em,
    var(--accent) 0.188em 0.313em,
    transparent 0.313em 0.375em,
    var(--accent) 0.375em 0.938em,
    transparent 0.938em 1em,
    var(--accent) 1em 1.125em,
    transparent 1.125em 1.875em,
    var(--accent) 1.875em 2em,
    transparent 2em 2.063em,
    var(--accent) 2.063em 2.25em,
    transparent 2.25em 2.313em,
    var(--accent) 2.313em 2.375em,
    transparent 2.375em 2.438em,
    var(--accent) 2.438em
  );
  transition: var(--transition);
}

.bb8__antenna {
  position: absolute;
  transform: translateY(-90%);
  width: 0.059em;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: var(--transition);
}

.bb8__antenna:nth-child(1) {
  height: 0.938em;
  right: 0.938em;
  background: linear-gradient(#000 0.188em, silver 0.188em);
}

.bb8__antenna:nth-child(2) {
  height: 0.375em;
  left: 50%;
  transform: translate(-50%, -90%);
  background: silver;
}

.bb8__body {
  width: 4.375em;
  height: 4.375em;
  background: var(--bb8-bg);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  z-index: 1;
  transform: rotate(45deg);
  background: linear-gradient(-90deg, var(--bb8-bg) 4%, var(--accent) 4% 10%, transparent 10% 90%, var(--accent) 90% 96%, var(--bb8-bg) 96%),
    linear-gradient(var(--bb8-bg) 4%, var(--accent) 4% 10%, transparent 10% 90%, var(--accent) 90% 96%, var(--bb8-bg) 96%),
    linear-gradient(to right, transparent 2.156em, silver 2.156em 2.219em, transparent 2.188em),
    linear-gradient(transparent 2.156em, silver 2.156em 2.219em, transparent 2.188em);
  background-color: var(--bb8-bg);
}

.bb8__body::after {
  content: "";
  bottom: 1.5em;
  left: 0.563em;
  position: absolute;
  width: 0.188em;
  height: 0.188em;
  background: rgb(236, 236, 236);
  color: rgb(236, 236, 236);
  border-radius: 50%;
  box-shadow: 0.875em 0.938em, 0 -1.25em, 0.875em -2.125em, 2.125em -2.125em,
    3.063em -1.25em, 3.063em 0, 2.125em 0.938em;
}

.bb8__body::before {
  content: "";
  width: 2.625em;
  height: 2.625em;
  position: absolute;
  border-radius: 50%;
  z-index: 0.1;
  overflow: hidden;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 0.313em solid var(--accent);
  background: radial-gradient(1em circle at center, rgb(236, 236, 236) 50%, transparent 51%),
    radial-gradient(1.25em circle at center, var(--bb8-bg) 50%, transparent 51%),
    linear-gradient(-90deg, transparent 42%, var(--accent) 42% 58%, transparent 58%),
    linear-gradient(var(--bb8-bg) 42%, var(--accent) 42% 58%, var(--bb8-bg) 58%);
}

.artificial__hidden {
  position: absolute;
  border-radius: inherit;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.bb8__shadow {
  content: "";
  width: var(--bb8-diameter);
  height: 20%;
  border-radius: 50%;
  background: #3a271c;
  box-shadow: 0.313em 0 3.125em #3a271c;
  opacity: 0.25;
  position: absolute;
  bottom: 0;
  left: calc(var(--toggle-offset) - 0.938em);
  transition: var(--transition);
  transform: skew(-70deg);
  z-index: 1;
}

.bb8-toggle__scenery {
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  position: relative;
  border-radius: inherit;
}

.bb8-toggle__scenery::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 30%;
  bottom: 0;
  background: #b18d71;
  z-index: 1;
}

.bb8-toggle__cloud {
  z-index: 1;
  position: absolute;
  border-radius: 50%;
}

.bb8-toggle__cloud:nth-last-child(1) {
  width: 0.875em;
  height: 0.625em;
  filter: blur(0.125em) drop-shadow(0.313em 0.313em #ffffffae)
    drop-shadow(-0.625em 0 #fff) drop-shadow(-0.938em -0.125em #fff);
  right: 1.875em;
  top: 2.813em;
  background: linear-gradient(to top right, #ffffffae, #ffffffae);
  transition: var(--transition);
}

.bb8-toggle__cloud:nth-last-child(2) {
  top: 0.625em;
  right: 4.375em;
  width: 0.875em;
  height: 0.375em;
  background: #dfdedeae;
  filter: blur(0.125em) drop-shadow(-0.313em -0.188em #e0dfdfae)
    drop-shadow(-0.625em -0.188em #bbbbbbae) drop-shadow(-1em 0.063em #cfcfcfae);
  transition: 0.6s;
}

.bb8-toggle__cloud:nth-last-child(3) {
  top: 1.25em;
  right: 0.938em;
  width: 0.875em;
  height: 0.375em;
  background: #ffffffae;
  filter: blur(0.125em) drop-shadow(0.438em 0.188em #ffffffae)
    drop-shadow(-0.625em 0.313em #ffffffae);
  transition: 0.8s;
}

.gomrassen,
.hermes,
.chenini {
  position: absolute;
  border-radius: var(--radius);
  background: linear-gradient(#fff, #6e8ea2);
  top: 100%;
}

.gomrassen {
  left: 0.938em;
  width: 1.875em;
  height: 1.875em;
  box-shadow: 0 0 0.188em #ffffff52, 0 0 0.188em #6e8ea24b;
  transition: var(--transition);
}

.gomrassen::before,
.gomrassen::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  box-shadow: inset 0 0 0.063em rgb(140, 162, 169);
  background: rgb(184, 196, 200);
}

.gomrassen::before {
  left: 0.313em;
  top: 0.313em;
  width: 0.438em;
  height: 0.438em;
}

.gomrassen::after {
  width: 0.25em;
  height: 0.25em;
  left: 1.25em;
  top: 0.75em;
}

.hermes {
  left: 3.438em;
  width: 0.625em;
  height: 0.625em;
  box-shadow: 0 0 0.125em #ffffff52, 0 0 0.125em #6e8ea24b;
  transition: 0.6s;
}

.chenini {
  left: 4.375em;
  width: 0.5em;
  height: 0.5em;
  box-shadow: 0 0 0.125em #ffffff52, 0 0 0.125em #6e8ea24b;
  transition: 0.8s;
}

.tatto-1,
.tatto-2 {
  position: absolute;
  width: 1.25em;
  height: 1.25em;
  border-radius: var(--radius);
}

.tatto-1 {
  background: #fefefe;
  right: 3.125em;
  top: 0.625em;
  box-shadow: 0 0 0.438em #fdf4e1;
  transition: var(--transition);
}

.tatto-2 {
  background: linear-gradient(#e6ac5c, #d75449);
  right: 1.25em;
  top: 2.188em;
  box-shadow: 0 0 0.438em #e6ad5c3d, 0 0 0.438em #d755494f;
  transition: 0.7s;
}

.bb8-toggle__star {
  position: absolute;
  width: 0.063em;
  height: 0.063em;
  background: #fff;
  border-radius: var(--radius);
  filter: drop-shadow(0 0 0.063em #fff);
  color: #fff;
  top: 100%;
}

.bb8-toggle__star:nth-child(1) {
  left: 3.75em;
  box-shadow: 1.25em 0.938em, -1.25em 2.5em, 0 1.25em, 1.875em 0.625em,
    -3.125em 1.875em, 1.25em 2.813em;
  transition: 0.2s;
}

.bb8-toggle__star:nth-child(2) {
  left: 4.688em;
  box-shadow: 0.625em 0, 0 0.625em, -0.625em -0.625em, 0.625em 0.938em,
    -3.125em 1.25em, 1.25em -1.563em;
  transition: 0.3s;
}

.bb8-toggle__star:nth-child(3) {
  left: 5.313em;
  box-shadow: -0.625em -0.625em, -2.188em 1.25em, -2.188em 0,
    -3.75em -0.625em, -3.125em -0.625em, -2.5em -0.313em, 0.75em -0.625em;
  transition: var(--transition);
}

.bb8-toggle__star:nth-child(4) {
  left: 1.875em;
  width: 0.125em;
  height: 0.125em;
  transition: 0.5s;
}

.bb8-toggle__star:nth-child(5) {
  left: 5em;
  width: 0.125em;
  height: 0.125em;
  transition: 0.6s;
}

.bb8-toggle__star:nth-child(6) {
  left: 2.5em;
  width: 0.125em;
  height: 0.125em;
  transition: 0.7s;
}

.bb8-toggle__star:nth-child(7) {
  left: 3.438em;
  width: 0.125em;
  height: 0.125em;
  transition: 0.8s;
}

/* ACTIONS - Toggle States */
.bb8-toggle__checkbox:checked + .bb8-toggle__container .bb8-toggle__star:nth-child(1) {
  top: 0.625em;
}

.bb8-toggle__checkbox:checked + .bb8-toggle__container .bb8-toggle__star:nth-child(2) {
  top: 1.875em;
}

.bb8-toggle__checkbox:checked + .bb8-toggle__container .bb8-toggle__star:nth-child(3) {
  top: 1.25em;
}

.bb8-toggle__checkbox:checked + .bb8-toggle__container .bb8-toggle__star:nth-child(4) {
  top: 3.438em;
}

.bb8-toggle__checkbox:checked + .bb8-toggle__container .bb8-toggle__star:nth-child(5) {
  top: 3.438em;
}

.bb8-toggle__checkbox:checked + .bb8-toggle__container .bb8-toggle__star:nth-child(6) {
  top: 0.313em;
}

.bb8-toggle__checkbox:checked + .bb8-toggle__container .bb8-toggle__star:nth-child(7) {
  top: 1.875em;
}

.bb8-toggle__checkbox:checked + .bb8-toggle__container .bb8-toggle__cloud {
  right: -100%;
}

.bb8-toggle__checkbox:checked + .bb8-toggle__container .gomrassen {
  top: 0.938em;
}

.bb8-toggle__checkbox:checked + .bb8-toggle__container .hermes {
  top: 2.5em;
}

.bb8-toggle__checkbox:checked + .bb8-toggle__container .chenini {
  top: 2.75em;
}

.bb8-toggle__checkbox:checked + .bb8-toggle__container {
  background-position-y: 0;
}

.bb8-toggle__checkbox:checked + .bb8-toggle__container .tatto-1 {
  top: 100%;
}

.bb8-toggle__checkbox:checked + .bb8-toggle__container .tatto-2 {
  top: 100%;
}

.bb8-toggle__checkbox:checked + .bb8-toggle__container .bb8 {
  left: calc(100% - var(--bb8-diameter) - var(--toggle-offset));
}

.bb8-toggle__checkbox:checked + .bb8-toggle__container .bb8__shadow {
  left: calc(100% - var(--bb8-diameter) - var(--toggle-offset) + 0.938em);
  transform: skew(70deg);
}

.bb8-toggle__checkbox:checked + .bb8-toggle__container .bb8__body {
  transform: rotate(225deg);
}

.bb8-toggle__checkbox:hover + .bb8-toggle__container .bb8__head::before {
  left: 100%;
}

.bb8-toggle__checkbox:not(:checked):hover + .bb8-toggle__container .bb8__antenna:nth-child(1) {
  right: 1.5em;
}

.bb8-toggle__checkbox:hover + .bb8-toggle__container .bb8__antenna:nth-child(2) {
  left: 0.938em;
}

.bb8-toggle__checkbox:hover + .bb8-toggle__container .bb8__head::after {
  background-position: 1.375em 0;
}

.bb8-toggle__checkbox:checked:hover + .bb8-toggle__container .bb8__head::before {
  left: 0;
}

.bb8-toggle__checkbox:checked:hover + .bb8-toggle__container .bb8__antenna:nth-child(2) {
  left: calc(100% - 0.938em);
}

.bb8-toggle__checkbox:checked:hover + .bb8-toggle__container .bb8__head::after {
  background-position: -1.375em 0;
}

.bb8-toggle__checkbox:active + .bb8-toggle__container .bb8__head-container {
  transform: rotate(25deg);
}

.bb8-toggle__checkbox:checked:active + .bb8-toggle__container .bb8__head-container {
  transform: rotate(-25deg);
}

.bb8:hover .bb8__head::before,
.bb8:hover .bb8__antenna:nth-child(2) {
  left: 50% !important;
}

.bb8:hover .bb8__antenna:nth-child(1) {
  right: 0.938em !important;
}

.bb8:hover .bb8__head::after {
  background-position: 0 0 !important;
}

/* Hide old simple theme toggle */
.theme-toggle {
  display: none !important;
}

/* ============================================
   📖 FIX: PAGE-BACK CONTENT DIRECTION
   ============================================ */
.page-back {
  transform: rotateY(180deg) translateZ(1px);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.page-back .page-content {
  transform: rotateY(0deg);
  backface-visibility: visible;
  -webkit-backface-visibility: visible;
  width: 100%;
  height: 100%;
  position: relative;
  direction: ltr;
  text-orientation: mixed;
}

.page-back h1,
.page-back h2,
.page-back h3,
.page-back p,
.page-back span,
.page-back div,
.page-back .title,
.page-back .workeduc-box,
.page-back .skills-box,
.page-back .contact-box,
.page-back .services-box {
  transform: none !important;
  direction: ltr;
}

.page-back .number-page {
  left: 50%;
  transform: translateX(-50%);
}

.page-back .nextprev-btn.back {
  left: 1.5rem;
  right: auto;
}

.page-back .back-profile {
  right: 2rem;
  left: auto;
}


/* ============================================
   🌸 GROWING FLOWERS ANIMATION - COMPATIBLE
   ============================================ */

.flowers-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1; /* Higher than book to be visible */
  overflow: hidden;
}

.flowers-left,
.flowers-right {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 25%;
  height: 100%;
}

.flowers-left { left: 0; }
.flowers-right { right: 0; }

/* Theme Colors */
:root {
  --flower-petal-1: #ff6236;
  --flower-petal-2: #ffd85f;
  --flower-center: #ffe4a0;
  --flower-stem: #da5800;
  --flower-leaf: #d86100aa;
  --flower-glow: rgba(255, 216, 95, 0.6);
}

body.light {
  --flower-petal-1: #9b59b6;
  --flower-petal-2: #e74c9a;
  --flower-center: #f4c2f7;
  --flower-stem: #8e44ad;
  --flower-leaf: #9b59b6aa;
  --flower-glow: rgba(231, 76, 154, 0.6);
}

/* Flower Container */
.flower-container {
  position: absolute;
  width: 60px;
  height: 200px;
  transform-origin: bottom center;
  opacity: 0;
}

/* Position flowers */
.flowers-left .flower-container:nth-child(1) { top: 75%; left: 15%; }
.flowers-left .flower-container:nth-child(2) { top: 55%; left: 35%; }
.flowers-left .flower-container:nth-child(3) { top: 85%; left: 55%; }
.flowers-left .flower-container:nth-child(4) { top: 45%; left: 10%; }
.flowers-left .flower-container:nth-child(5) { top: 65%; left: 70%; }

.flowers-right .flower-container:nth-child(1) { top: 70%; right: 20%; }
.flowers-right .flower-container:nth-child(2) { top: 50%; right: 45%; }
.flowers-right .flower-container:nth-child(3) { top: 80%; right: 15%; }
.flowers-right .flower-container:nth-child(4) { top: 40%; right: 35%; }
.flowers-right .flower-container:nth-child(5) { top: 60%; right: 60%; }

/* Flower Parts */
.flower-top {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 50px;
}

.flower-circle {
  position: absolute;
  width: 20px;
  height: 20px;
  background: var(--flower-center);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  box-shadow: 0 0 15px var(--flower-glow);
  z-index: 2;
}

.flower-petal {
  position: absolute;
  width: 25px;
  height: 25px;
  background: linear-gradient(135deg, var(--flower-petal-1), var(--flower-petal-2));
  border-radius: 50% 50% 50% 0;
  opacity: 0;
  transform: scale(0);
}

.flower-petal__1 { top: 10px; left: 5px; transform: rotate(-45deg); }
.flower-petal__2 { top: 10px; right: 5px; transform: rotate(45deg); }
.flower-petal__3 { top: 20px; left: -5px; transform: rotate(-90deg); }
.flower-petal__4 { top: 20px; right: -5px; transform: rotate(90deg); }
.flower-petal__5 { bottom: 5px; left: 10px; transform: rotate(-135deg); }
.flower-petal__6 { bottom: 5px; right: 10px; transform: rotate(135deg); }
.flower-petal__7 { bottom: -5px; left: 5px; transform: rotate(-180deg); }
.flower-petal__8 { bottom: -5px; right: 5px; transform: rotate(180deg); }

.flower-stem {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleY(0);
  width: 4px;
  height: 100px;
  background: linear-gradient(to top, var(--flower-stem), transparent);
  border-radius: 2px;
  transform-origin: bottom;
}

.flower-leaf {
  position: absolute;
  width: 20px;
  height: 12px;
  background: var(--flower-leaf);
  border-radius: 0 50% 0 50%;
  opacity: 0;
  transform: scale(0);
}

.flower-leaf.left {
  left: 50%;
  transform-origin: right center;
}

.flower-leaf.right {
  right: 50%;
  transform-origin: left center;
  border-radius: 50% 0 50% 0;
}

.flower-leaf:nth-child(3) { bottom: 40px; }
.flower-leaf:nth-child(4) { bottom: 60px; }
.flower-leaf:nth-child(5) { bottom: 20px; }
.flower-leaf:nth-child(6) { bottom: 80px; }

/* Glow lights */
.flower-light {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--flower-center);
  border-radius: 50%;
  opacity: 0;
  filter: blur(2px);
  animation: float 3s ease-in-out infinite;
}

.flower-light:nth-child(odd) { background: var(--flower-petal-2); }
.flower-light:nth-child(even) { background: var(--flower-petal-1); }

.flower-light:nth-child(7) { top: 30px; left: 10px; animation-delay: 0s; }
.flower-light:nth-child(8) { top: 50px; right: 15px; animation-delay: 0.5s; }
.flower-light:nth-child(9) { bottom: 70px; left: 20px; animation-delay: 1s; }
.flower-light:nth-child(10) { bottom: 40px; right: 10px; animation-delay: 1.5s; }

/* Animations */
@keyframes grow {
  to { opacity: 1; transform: scale(1); }
}

@keyframes stemGrow {
  to { transform: translateX(-50%) scaleY(1); }
}

@keyframes float {
  0%, 100% { opacity: 0.3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-10px); }
}

@keyframes sway {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(3deg); }
  75% { transform: rotate(-3deg); }
}

/* Animate class */
.flower-container.animate {
  animation: sway 4s ease-in-out infinite;
}

.flower-container.animate .flower-circle {
  animation: grow 0.3s ease forwards 2.5s;
}

.flower-container.animate .flower-petal {
  animation: grow 0.4s ease forwards;
}

.flower-container.animate .flower-petal__1 { animation-delay: 2.6s; }
.flower-container.animate .flower-petal__2 { animation-delay: 2.7s; }
.flower-container.animate .flower-petal__3 { animation-delay: 2.8s; }
.flower-container.animate .flower-petal__4 { animation-delay: 2.9s; }
.flower-container.animate .flower-petal__5 { animation-delay: 3.0s; }
.flower-container.animate .flower-petal__6 { animation-delay: 3.1s; }
.flower-container.animate .flower-petal__7 { animation-delay: 3.2s; }
.flower-container.animate .flower-petal__8 { animation-delay: 3.3s; }

.flower-container.animate .flower-stem {
  animation: stemGrow 1.5s ease forwards 1s;
}

.flower-container.animate .flower-leaf {
  animation: grow 0.5s ease forwards;
}

.flower-container.animate .flower-leaf:nth-child(3) { animation-delay: 2s; }
.flower-container.animate .flower-leaf:nth-child(4) { animation-delay: 2.2s; }
.flower-container.animate .flower-leaf:nth-child(5) { animation-delay: 1.8s; }
.flower-container.animate .flower-leaf:nth-child(6) { animation-delay: 2.4s; }

.flower-container.animate .flower-light {
  animation: float 3s ease-in-out infinite;
}

.flower-container.animate .flower-light:nth-child(7) { animation-delay: 3.5s; }
.flower-container.animate .flower-light:nth-child(8) { animation-delay: 4s; }
.flower-container.animate .flower-light:nth-child(9) { animation-delay: 4.5s; }
.flower-container.animate .flower-light:nth-child(10) { animation-delay: 5s; }

/* Hide on mobile */
@media (max-width: 768px) {
  .flowers-wrapper { display: none; }
}
