/* =========================================================
   GLOBAL RESET / BASE
========================================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fff;
  color: #222;
}

main {
  padding-top: 0;
}

/* =========================================================
   HERO – BASE (NO SHADOW HERE)
========================================================= */

.split-hero {
  width: 100%;
  background: #fff;
  position: relative;
  overflow: hidden;

}

.split-container {
  width: 100%;
  position: relative;

  
  max-height: 600px;
  
}

/* =========================================================
   MOBILE / TABLET HERO IMAGE
========================================================= */

.hero-img {
  display: block;
  width: 100%;
  height: auto;
}

/* =========================================================
   HERO TEXT
========================================================= */

.hero-text {
  max-width: 320px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-text h2 {
  font-size: 50px;
  font-weight: 700;
  margin-bottom: 6px;
}

.hero-text p {
  font-size: 15px;
  line-height: 1.6;
  color: #555;
}


/* =========================================================
   DESKTOP & LAPTOP (>= 1024px)
========================================================= */

@media (min-width: 1024px) {

  .hero-img {
    display: none;
  }

  .split-hero {
    height: auto;          /* 🔑 critical */
    min-height: unset;
    max-height: unset;
    padding-left: 5%;
    padding-right: 5%;
  }

    .hero-layer {
    background-size: contain;
  }

  .split-container {
    height: 100%;
    aspect-ratio: 16 / 9;  /* or 3 / 2 if you prefer */
  }

  .hero-text h2 {
  font-size: 40px;

}
  



  /* ================= IMAGE LAYERS ================= */

  .hero-layer {
    position: absolute;
    inset: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    will-change: clip-path, transform;
  }

  .hero-layer.coder {
    background-image: url('../assets/images/hero/hero-coder.png');
    clip-path: inset(0 50% 0 0);
    z-index: 1;
  }

  .hero-layer.artist {
    background-image: url('../assets/images/hero/hero-artist.png');
    clip-path: inset(0 0 0 50%);
    z-index: 2;
  }

  /* ================= TEXT ================= */

  .hero-text {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;

    
  }

  .left-text {
    left: 48px;
    text-align: left;
  }

  .right-text {
    right: 48px;
    text-align: right;
  }
}

/* =====================================================
   HERO INTRO ANIMATION
===================================================== */

.split-container.hero-preload .hero-layer {
  clip-path: inset(0 0 0 0);
  opacity: 0;
}

.split-container.hero-preload .hero-layer.coder {
  transform: translate3d(-120px, 0, 0);
}

.split-container.hero-preload .hero-layer.artist {
  transform: translate3d(120px, 0, 0);
}

.split-container.hero-enter .hero-layer {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition:
    transform 0.9s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.6s ease;
}

.hero-text {
  opacity: 0;
  transform: translateY(-50px);
  transition:
    opacity 2s ease,
    transform 1.2s ease;
}

/* when page enters */
.split-container.hero-enter .hero-text {
  opacity: 1;
  transform: translateY(0);
}

/* stagger left & right text slightly */
.split-container.hero-enter .left-text {
  transition-delay: 0.6s;
}

.split-container.hero-enter .right-text {
  transition-delay: 0.8s;
}



/* =========================================================
   TABLET & MOBILE (< 1024px)
========================================================= */

@media (max-width: 1023px) {

  .split-hero {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-layer,
  .hero-text {
    display: none;
  }
}

/* =========================================================
   LAPTOP ONLY FIX (1024px–1199px)
========================================================= */


/* =========================================================
   NEXT SECTION (TOP SHADOW – ADHAM STYLE)
   👉 APPLY THIS CLASS TO THE SECTION AFTER HERO
========================================================= */




/* SHADOW ONLY BETWEEN HERO → ABOUT */

.split-hero + .about-section {
  position: relative;
}

.split-hero + .about-section::before {
  content: "";
  position: absolute;
  top: -40px;
  left: 0;
  right: 0;
  height: 40px;

  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.18),
    rgba(0, 0, 0, 0.08),
    rgba(0, 0, 0, 0.02),
    transparent
  );

  pointer-events: none;
  z-index: 2;
}





/* =========================================================
   SECTION DIVIDER SHADOW (DOWNWARD)
   Between Piechart → Skills
========================================================= */

.about-section {
  position: relative;
  background: #fff;
}

/* 🔥 Downward shadow */
.about-section::after {
  content: "";
  position: absolute;
  bottom: -40px;
  left: 0;
  right: 0;
  height: 40px;

  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.18),
    rgba(0, 0, 0, 0.08),
    rgba(0, 0, 0, 0.02),
    transparent
  );

  pointer-events: none;
  z-index: 2;
}

@media (max-width: 768px) {
  .about-section::after {
    height: 28px;
    bottom: -28px;
  }

  
}



.skills-section {
  position: relative;
  background: #fff;
}

/* =========================================================
   SECTION DIVIDER SHADOW (UPWARD)
   Between Piechart → Skills
========================================================= */

.skills-section {
  position: relative;
  background: #fff;  
}

.skills-section::before {
  content: "";
  position: absolute;
  top: -40px;

    left: 0;
  right: 0;
  width: 100%;
  transform: none;

  height: 40px;

  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.18),
    rgba(0, 0, 0, 0.08),
    rgba(0, 0, 0, 0.02),
    transparent
  );

  pointer-events: none;
  z-index: 2;
}





.piechart {
  position: relative;
  background: #fff;
  overflow: visible;
}

.piechart::before {
  height: 36px;
  top: -36px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.18),
    rgba(0, 0, 0, 0.08),
    transparent
  );
}



/* 🔒 HIDE HORIZONTAL SCROLL ONLY FOR PIECHART */
.piechart {
  overflow-x: hidden;
}



/* =====================================================
   PIECHART SCROLL INTRO ANIMATION
===================================================== */

.piechart-center {
  opacity: 0;
  transform: translateY(80px);
  transition:
    transform 1s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.8s ease;
}

/* when visible */
.piechart.visible .piechart-center {
  opacity: 1;
  transform: translateY(0);
}


/* ================= PIECHART SECTION ================= */
.piechart {
  width: 100%;
  padding: 50px 7%;
  background: white;
}

.piechart-container {
  max-width: 1200px;
  margin: 0 auto;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 64px;
  padding-bottom: 1px;
}

/* ================= SIDE TEXT ================= */

.piechart-side h3 {
  font-size: 28px;
  font-weight: 500;
  margin-bottom: 20px;
  color: #222;
}

.piechart-side ul {
  list-style: none;
  padding: 0;
}

.piechart-side li {
  font-size: 16px;
  line-height: 2;
  color: #555;
}

/* ALIGNMENT */
.piechart-side.left {
  text-align: right;
}

.piechart-side.right {
  text-align: left;
}

/* ================= CENTER IMAGE (ALWAYS SQUARE) ================= */

.piechart-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* square wrapper */
.piechart-center .pie-square {
  width: 400px;
  aspect-ratio: 1 / 1;   /* 🔥 always square */
}



.piechart-center .pie-square img {
  width: 100%;
  height: 100%;
  object-fit: contain;  /* no stretching */
  display: block;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 900px) {
  .piechart-container {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .piechart-side.left,
  .piechart-side.right {
    text-align: center;
  }

  .piechart-center .pie-square {
    width: 400px;
  }
}

@media (max-width: 500px) {
  .piechart-center .pie-square {
    width: 400px;
  }
}

@media (max-width: 900px) {
  .piechart-center .pie-square {
    width: 320px;
    max-width: 100%;
  }
}

@media (max-width: 500px) {
  .piechart-center .pie-square {
    width: 220px;
  }
}


html, body {
  overflow-x: hidden;
}

.piechart {
  overflow-x: hidden;
}



@media (max-width: 480px) {
  #about-3d {
    max-width: 280px;   /* ✅ visible width */
    height: 340px;
    margin: 0 auto;
  }
}


#about-3d {
  width: 100%;
  max-width: 420px;
  height: 520px;
  position: relative;
  overflow: visible;
}

/* Tablet */
@media (max-width: 768px) {
  #about-3d {
    max-width: 360px;
    height: 420px;
    margin: 0 auto;
  }
}

/* Mobile */
@media (max-width: 480px) {
  #about-3d {
    max-width: 280px;
    height: 340px;
    margin: 0 auto;
  }
}

#about-3d canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
























/* ================= ABOUT SECTION ================= */

.about-section {
  padding: 1px 7% 80px;
  background: #fff;
}

/* ================= LAYOUT ================= */

.about-wrapper {
  max-width: 1200px;
  margin: 0 auto;

  display: grid;
  grid-template-columns: 7fr 3fr; /* image slightly dominant */
  align-items: end;
  gap: 10px; /* reduced gap for tighter alignment */
}

/* ================= TEXT ================= */

.about-title {
  font-size: 96px;
  font-weight: 700;
  letter-spacing: -2px;
  margin-bottom: 10px;
  color: #222;

}

.about-lead {
  font-size: 26px;
  font-weight: 500;
  color: #444;
  margin-bottom: 40px;
  max-width: auto
  ;
}

.about-desc {
  font-size: 17px;
  line-height: 1.8;
  color: #666;
  max-width: auto;
  padding-bottom: 60px; /* remove artificial spacing */
}

/* ================= IMAGE ================= */

.about-image {
  display: flex;
  justify-content: flex-end;
}

.about-image img {
  width: 100%;
  max-width: 600px;   /* 🔥 bigger image */
  height: auto;       /* keeps original ratio */
  display: block;
}

/* ================= DIVIDER ================= */

.about-divider {
  max-width: 1200px;
  height: 2px; /* thinner like Adham */
  background: #e6e6e6;
  margin: 24px auto 32px; /* tight image → divider → gallery */
  margin-top: 0;
}



/* ================= LAPTOP ONLY (≤ 1200px) ================= */

@media (max-width: 1200px) {

  .about-title {
    font-size: 60px; /* down from 96 */
  }

  .about-lead {
    font-size: 17px; /* down from 26 */
  }

  .about-desc {
    font-size: 14px;
  }

  .about-image img {
    max-width: 560px; /* keeps image visually stronger */
  }
}

/* =====================================================
   RESPONSIVE
===================================================== */

@media (max-width: 768px) {

  .about-wrapper {
    grid-template-columns: 1fr;
    gap: 56px;
  }

  .about-image {
    justify-content: center;
  }

  .about-image img {
    max-width: 420px;
  }

  .about-divider {
    margin: 36px auto 28px;
      margin-top: 0;
  }
}

@media (max-width: 480px) {

  .about-title {
    font-size: 56px;
  }

  .about-lead {
    font-size: 18px;
  }

  .about-desc {
    font-size: 15px;
    line-height: 1.7;
  }

  .about-image img {
    max-width: 300px;
  }

    .about-divider {
      margin-top: 0;
  }
}



/* ================= GALLERY ================= */

.about-gallery {
  max-width: 1200px;
  margin: 0 auto;

  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(140px, 1fr);
  gap: 24px;

  overflow-x: auto;
  padding-bottom: 12px;
}

.about-gallery::-webkit-scrollbar {
  display: none;
}

/* ================= CARD ================= */

.about-card {
  background: #fff;
  border-radius: 18px;
  padding: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  overflow: hidden;
}

.about-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.15);
}

.about-card img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

/* =====================================================
   RESPONSIVE — MATCH ADHAM
===================================================== */

/* ✅ TABLET (≤ 768px) */
@media (max-width: 768px) {

  .about-wrapper {
    grid-template-columns: 1fr;
    gap: 60px;
  }

  .about-image {
    order: 2;
  }

  .about-image img {
    max-width: 420px;
    margin: 0 auto;
  }

  .about-section::after {
    margin: 40px auto 28px;
  }

  .about-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-flow: unset;
    overflow: visible;
  }
}

/* ✅ MOBILE (≤ 480px) */
@media (max-width: 480px) {

  .about-title {
    font-size: 56px;
  }

  .about-lead {
    font-size: 18px;
  }

  .about-desc {
    font-size: 15px;
    line-height: 1.7;
  }

  .about-image img {
    max-width: 280px;
  }

  .about-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =========================================================
   IMAGE MODAL (UNCHANGED – VERIFIED SAFE)
========================================================= */

.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  isolation: isolate;
}

.image-modal.hidden {
  display: none;
}

.modal-card {
  background: #fff;
  border-radius: 18px;
  padding: 20px;

  width: min(90vw, 900px);
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;
  z-index: 1;
}

.modal-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.modal-close {
  position: fixed;
  top: 24px;
  right: 28px;
  font-size: 32px;
  color: #fff;
  cursor: pointer;
}

/* Mobile modal */
@media (max-width: 700px) {
  .modal-card {
    height: auto;
  }
}

























/* ================= 3D MODEL CONTAINER ================= */

#about-3d {
  width: 100%;
  max-width: 420px;
  height: 520px;
  position: relative;
  
}

@media (max-width: 1200px) {
  #about-3d {
    max-width: 560px;
    height: 480px;
  }
}

@media (max-width: 768px) {
  #about-3d {
    max-width: 420px;
    height: 420px;
    margin: 0 auto;
  }
}

@media (max-width: 480px) {
  #about-3d {
    width: 100%;
    max-width: 280px;   /* ✅ visible */
    height: 340px;
    margin: 0 auto;
  }
}

#about-3d canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}



/* =========================================================
   REMOVE ENTIRE GAP BETWEEN TEXT & 3D MODEL
   MOBILE + TABLET — HARD OVERRIDE
========================================================= */

@media (max-width: 768px) {

  /* kill all spacing below text */
  .about-desc {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }

  /* remove grid gap completely */
  .about-wrapper {
    gap: 0 !important;
  }

  /* force image container to touch text */
  .about-image {
    margin-top: 0 !important;
    padding-top: 0 !important;
    align-items: flex-start !important;
  }

  /* lock model immediately below text */
  #about-3d {
    margin-top: -2px !important;
  }

  /* reduce section padding */
  .about-section {
    padding-bottom: 24px !important;
  }
}

/* EXTRA HARD FOR SMALL PHONES */
@media (max-width: 480px) {

  #about-3d {
    margin-top: -8px !important;
    height: 300px;
  }
}



.about-image {
  overflow: visible; /* 🔥 allow animation to breathe */
    display: flex;
  justify-content: center; /* 🔥 prevents side clipping */
  align-items: flex-end;
}


#about-3d {
  overflow: visible; /* 🔥 critical */
}














/* ================= SECTION ================= */

.skills-section {
  padding: 140px 7%;
  background: #fff;
  padding-bottom: 0;
  padding-top: 50px;
}

.skills-container {
  max-width: 1000px;
  margin: 0 auto;
}

/* ================= TITLE ================= */

.skills-title {
  font-size: 42px;
  font-weight: 500;
  text-align: right;
  margin-bottom: 10px;
  color: #333;
}

/* ================= LAYOUT ================= */

.skills-layout {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 24px;
}

/* ================= AXIS ================= */

.skills-axis {
  height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.skills-axis span {
  font-size: 14px;
  color: #666;
}

.skills-axis::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 1px;
  height: 100%;
  background: #ddd;
}

/* ================= CHART ================= */

.skills-chart {
  position: relative;
  height: 420px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 36px;
}

/* GRID LINES */
.skills-chart::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      transparent 24%,
      #e5e5e5 25%,
      transparent 26%,

      transparent 49%,
      #e5e5e5 50%,
      transparent 51%,

      transparent 74%,
      #e5e5e5 75%,
      transparent 76%
    );
  pointer-events: none;
}

/* ================= BAR ================= */

.skill-bar {
  position: relative;
  height: 100%;
}

/* animated bar */
.bar-fill {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 0;

  box-sizing: border-box;
  border-radius: 20px;
  padding-bottom: 22px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;

  transition: height 1.3s cubic-bezier(.22,.61,.36,1);
}

/* ACTIVE STATE (used by your JS) */
.skills-section.active .bar-fill {
  height: calc(var(--percent) * 1%);
}

/* ================= TEXT ================= */

.bar-value {
  font-size: 44px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.bar-label {
  margin-top: 6px;
  font-size: 15px;
  color: rgba(255,255,255,0.9);
  text-align: center;
}

/* ================= COLORS ================= */

.skill-bar:nth-child(1) .bar-fill { background: #78c6bc; }
.skill-bar:nth-child(2) .bar-fill { background: #f2cbbd; }
.skill-bar:nth-child(3) .bar-fill { background: #f3c24d; }
.skill-bar:nth-child(4) .bar-fill { background: #d5b07c; }
.skill-bar:nth-child(5) .bar-fill { background: #e15b5b; }

/* ================= DESKTOP ONLY ================= */

@media (max-width: 1023px) {
  .skills-section {
    display: none;
  }

  .piechart-container {

  padding-bottom: 1px;
}
}





/* FORCE HOME PAGE TO SCROLL WINDOW (not main) */
html, body {
  height: auto !important;
}

main {
  flex: unset !important;
}
