/* ============================================================
   عرض تقديمي — هديل عبدالقوي
   عربي RTL · خطّان متناسقان: El Messiri للعناوين + Cairo للنص
   أصغر خط 28px · ألوان فاتحة مع لمعان مضيء
   ============================================================ */

:root {
  --bg: #F2F7F5;
  --surface: #FFFFFF;
  --ink: #1E3238;
  --muted: #556A72;
  --line: #DCE9E4;

  --primary: #2F8F82;
  --primary-dark: #1F6E64;
  --primary-soft: #E1F4EF;

  --mint: #9BDDCE;
  --sky: #D8E9F6;
  --peach: #FFE3C2;
  --aqua: #7FD8E8;
  --gold: #F3C77E;

  --shadow: 0 14px 36px rgba(33, 68, 63, 0.12);
  --shadow-lg: 0 24px 60px rgba(33, 68, 63, 0.2);

  /* الخطّان */
  --font-display: "El Messiri", "Cairo", "Segoe UI", Tahoma, sans-serif;
  --font-body: "Cairo", "Segoe UI", Tahoma, "Noto Sans Arabic", sans-serif;

  /* تدرّج اللمعان المضيء */
  --glow: linear-gradient(100deg,
      #1F6E64 0%, #2F8F82 18%, #46B5A6 34%,
      #7FD8E8 52%, #A9B6F5 66%, #F3C77E 82%, #2F8F82 100%);
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(28px, 1.85vw, 32px); /* الحد الأدنى للخط 28px */
  font-weight: 500;
  line-height: 1.85;
  color: var(--ink);
  background-color: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   خلفية مميزة: شفق متحرك + نقاط ضوء لامعة
   ============================================================ */
body::before {
  content: "";
  position: fixed;
  inset: -22%;
  z-index: -2;
  background:
    radial-gradient(34% 30% at 18% 22%, rgba(155, 221, 206, 0.55), transparent 62%),
    radial-gradient(30% 28% at 80% 16%, rgba(216, 233, 246, 0.62), transparent 62%),
    radial-gradient(32% 30% at 66% 84%, rgba(255, 227, 194, 0.5), transparent 64%),
    radial-gradient(28% 26% at 10% 86%, rgba(127, 216, 232, 0.42), transparent 62%);
  filter: blur(26px);
  animation: aurora 30s ease-in-out infinite alternate;
}

@keyframes aurora {
  0% { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  50% { transform: translate3d(2%, -2.5%, 0) scale(1.09) rotate(3deg); }
  100% { transform: translate3d(-2%, 2%, 0) scale(1.04) rotate(-2deg); }
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 1.6px, transparent 2.4px),
    radial-gradient(circle, rgba(127, 216, 232, 0.85) 0 1.5px, transparent 2.2px),
    radial-gradient(circle, rgba(243, 199, 126, 0.85) 0 1.4px, transparent 2.2px);
  background-size: 240px 240px, 340px 340px, 430px 430px;
  background-position: 0 0, 70px 130px, 190px 45px;
  opacity: 0.6;
  animation: twinkle 7s ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.28; }
  to { opacity: 0.75; }
}

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

h1, h2, h3, p {
  margin: 0;
}

:focus-visible {
  outline: 4px solid var(--primary);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ============================================================
   الخطوط اللامعة المضيئة
   ============================================================ */
.luminous {
  background-image: var(--glow);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shimmer 9s linear infinite;
  filter: drop-shadow(0 0 22px rgba(47, 143, 130, 0.22));
}

@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}

/* ============================================================
   الشرائح
   ============================================================ */
.slide {
  position: fixed;
  inset: 0;
  display: none;
  padding: clamp(62px, 7vh, 84px) clamp(20px, 5vw, 72px) 148px;
  overflow-y: auto;
  isolation: isolate;
}

.slide.is-active {
  display: grid;
  animation: slide-in 0.55s ease both;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

/* شبكة نقاط ناعمة فوق الخلفية */
.slide::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(47, 143, 130, 0.16) 1.4px, transparent 1.6px);
  background-size: 34px 34px;
  mask-image: radial-gradient(85% 70% at 50% 42%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(85% 70% at 50% 42%, #000 25%, transparent 78%);
}

/* شعاع ضوء يمرّ ببطء */
.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(112deg,
      transparent 34%, rgba(255, 255, 255, 0.6) 47%, rgba(255, 255, 255, 0.2) 55%, transparent 66%);
  background-size: 280% 280%;
  opacity: 0.55;
  animation: sweep 17s ease-in-out infinite;
}

@keyframes sweep {
  0%, 100% { background-position: 120% 0%; }
  50% { background-position: -20% 0%; }
}

/* كرات لونية */
/* طبقة الزخرفة: تقصّ الكرات والخلفية داخل الشريحة فلا تُحدث تمريرًا */
.decor {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(74px);
  opacity: 0.5;
  z-index: -1;
  pointer-events: none;
  animation: float 12s ease-in-out infinite;
}

.blob--mint {
  inline-size: 22rem;
  block-size: 22rem;
  background: var(--mint);
  inset-block-start: -7rem;
  inset-inline-start: -8rem;
}

.blob--peach {
  inline-size: 18rem;
  block-size: 18rem;
  background: var(--peach);
  inset-block-end: -7rem;
  inset-inline-end: -6rem;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-24px) scale(1.06); }
}

/* ============================================================
   الشريحة ١ · الغلاف
   ============================================================ */
.slide--cover {
  place-content: center;
  justify-items: center;
  text-align: center;
}

.slide__photo {
  position: relative;
  margin-block-end: 1.5rem;
}

.slide__photo img {
  inline-size: clamp(180px, 23vh, 240px);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  border: 8px solid var(--surface);
  box-shadow: var(--shadow-lg);
}

.slide__photo::before {
  content: "";
  position: absolute;
  inset: -13px;
  border-radius: 50%;
  background: conic-gradient(from 120deg, var(--mint), var(--aqua), var(--sky), var(--peach), var(--gold), var(--mint));
  filter: blur(2px);
  z-index: -1;
  animation: spin 20s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.eyebrow {
  display: inline-block;
  padding: 0.4rem 1.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--line);
  color: var(--primary-dark);
  font-family: var(--font-body);
  font-size: 28px;
  font-weight: 700;
  margin-block-end: 1rem;
  box-shadow: var(--shadow);
}

.slide--cover h1 {
  font-family: var(--font-display);
  font-size: clamp(46px, 6.4vw, 84px);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: 0;
}

.slide__role {
  display: block;
  font-family: var(--font-body);
  color: var(--primary-dark);
  font-size: clamp(30px, 3.2vw, 42px);
  font-weight: 600;
  margin-block-start: 0.35rem;
}

.slide__lead {
  font-family: var(--font-body);
  color: var(--muted);
  max-inline-size: 46ch;
  margin-block: 1.1rem 1.4rem;
}

.hint {
  display: inline-block;
  padding: 0.45rem 1.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px dashed var(--primary);
  color: var(--primary-dark);
  font-size: 28px;
  font-weight: 500;
}

/* ============================================================
   العناوين العامة
   ============================================================ */
.slide__head {
  text-align: center;
  margin-block-end: clamp(1.3rem, 3.5vh, 2.2rem);
}

.slide__head h2 {
  font-family: var(--font-display);
  font-size: clamp(38px, 4.6vw, 60px);
  font-weight: 700;
  line-height: 1.3;
}

.slide__head p {
  color: var(--muted);
  margin-block-start: 0.5rem;
}

/* ============================================================
   الشريحة ٢ · لمحة عنّي
   ============================================================ */
.slide--about {
  align-content: center;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  max-inline-size: 1000px;
  margin-inline: auto;
  padding: 0;
  list-style: none;
}

.skills li {
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 28px;
  font-weight: 500;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.skills li:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 2px rgba(127, 216, 232, 0.55), var(--shadow-lg);
}

/* ============================================================
   شرائح المواقع — ترتيب متسلسل
   ============================================================ */
.slide--project {
  grid-template-columns: 0.9fr 1.1fr;
  align-items: center;
  gap: clamp(1.4rem, 3.2vw, 2.8rem);
  max-inline-size: 1420px;
  inline-size: 100%;
  margin-inline: auto;
}

/* خلفية الموقع (لقطة الشاشة مموّهة خلف المحتوى) */
.slide__bg {
  position: absolute;
  inset: -6%;
  z-index: -1;
  pointer-events: none;
  background-size: cover;
  background-position: top center;
  filter: blur(30px) saturate(1.15);
  opacity: 0.55;
}

.slide__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
      rgba(242, 247, 245, 0.82) 0%,
      rgba(242, 247, 245, 0.9) 55%,
      rgba(242, 247, 245, 0.95) 100%);
}

.slide--p1 .slide__bg { background-image: url("../images/shumukh-building.jpg"); }
.slide--p2 .slide__bg { background-image: url("../images/shumukh-fuel.jpg"); }
.slide--p3 .slide__bg { background-image: url("../images/alam-sihri.jpg"); }

.slide__img {
  position: relative;
  margin: 0;
}

.slide__img img {
  inline-size: 100%;
  max-block-size: 60vh;
  object-fit: cover;
  object-position: top center;
  border-radius: 20px;
  border: 6px solid var(--surface);
  box-shadow: var(--shadow-lg);
  background: var(--primary-soft);
}

.slide__number {
  position: absolute;
  inset-block-start: -26px;
  inset-inline-start: -16px;
  font-family: var(--font-display);
  font-size: clamp(54px, 6vw, 86px);
  font-weight: 700;
  line-height: 1;
  z-index: 2;
}

/* سطر التسلسل مع النوع */
.slide__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.9rem;
}

.slide__step {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 0;
}

.step-dots {
  display: inline-flex;
  gap: 0.35rem;
}

.step-dots i {
  inline-size: 14px;
  block-size: 14px;
  border-radius: 50%;
  background: rgba(47, 143, 130, 0.25);
  display: inline-block;
}

.step-dots i.is-on {
  background: linear-gradient(135deg, var(--primary), var(--aqua));
  box-shadow: 0 0 12px rgba(127, 216, 232, 0.9);
}

.slide__body {
  display: grid;
  gap: 0.75rem;
  align-content: center;
}

.tag {
  justify-self: start;
  padding: 0.32rem 1.1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  color: var(--primary-dark);
  font-size: 28px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.slide__body h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.4vw, 46px);
  font-weight: 700;
  line-height: 1.3;
}

.slide__desc {
  color: var(--muted);
}

.slide__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.slide__meta li {
  display: inline-flex;
  gap: 0.5rem;
  align-items: baseline;
}

.slide__meta strong {
  white-space: nowrap;
}

.slide__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-block-start: 0.3rem;
}

.slide__url {
  direction: ltr;
  unicode-bidi: isolate;
  font-size: 28px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.18rem 0.8rem;
}

/* ============================================================
   الأزرار
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-family: var(--font-body);
  font-size: clamp(28px, 2vw, 32px);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(47, 143, 130, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 0 3px rgba(127, 216, 232, 0.6), 0 18px 38px rgba(47, 143, 130, 0.42);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-dark);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

/* ============================================================
   الشريحة الأخيرة · التواصل
   ============================================================ */
.slide--end {
  place-content: center;
  justify-items: center;
  text-align: center;
}

.slide--end h2 {
  font-family: var(--font-display);
  font-size: clamp(44px, 6.4vw, 84px);
  font-weight: 700;
  line-height: 1.28;
}

.slide--end > p {
  color: var(--muted);
  max-inline-size: 48ch;
  margin-block: 0.9rem 1.5rem;
}

.contact-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-block-end: 1.6rem;
  padding: 0;
  list-style: none;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 28px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 0 2px rgba(127, 216, 232, 0.65), var(--shadow-lg);
}

.contact-card__icon {
  font-size: 30px;
  line-height: 1;
}

.contact-card__label {
  color: var(--muted);
  font-weight: 500;
}

.contact-card__value {
  direction: ltr;
  unicode-bidi: isolate;
  font-weight: 700;
  color: var(--primary-dark);
}

/* ============================================================
   عناصر التحكم (HUD)
   ============================================================ */
.counter {
  position: fixed;
  inset-block-start: 18px;
  inset-inline-start: 22px;
  z-index: 30;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 1.15rem;
  color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(127, 216, 232, 0.35), var(--shadow);
}

.controls {
  position: fixed;
  inset-block-end: 26px;
  inset-inline: 18px;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.control {
  pointer-events: auto;
  min-block-size: 64px;
  padding: 0.5rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--primary-dark);
  font-family: var(--font-body);
  font-size: clamp(28px, 2vw, 32px);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.control:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(127, 216, 232, 0.55), var(--shadow);
}

.control:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.progress {
  position: fixed;
  inset-block-end: 0;
  inset-inline: 0;
  z-index: 30;
  block-size: 8px;
  background: rgba(220, 233, 228, 0.9);
}

.progress__fill {
  display: block;
  block-size: 100%;
  background: linear-gradient(90deg, var(--gold), var(--aqua), var(--primary));
  box-shadow: 0 0 16px rgba(127, 216, 232, 0.9);
  transform: scaleX(0);
  transform-origin: right center; /* التقدّم من اليمين لليسار في RTL */
  transition: transform 0.45s ease;
}

/* ============================================================
   ملاءمة الشاشات: ارتفاع قصير أو عرض أقل
   ============================================================ */
@media (max-height: 920px) {
  .slide {
    padding-block: 44px 116px;
  }

  .slide__photo img {
    inline-size: clamp(148px, 17vh, 200px);
  }

  .slide--cover h1 {
    font-size: clamp(38px, 5.2vw, 64px);
  }

  .slide__img img {
    max-block-size: 46vh;
  }

  .slide__desc {
    line-height: 1.66;
  }

  .slide__body {
    gap: 0.5rem;
  }
}

@media (max-height: 800px) {
  .slide {
    padding-block: 40px 110px;
  }

  .slide__img img {
    max-block-size: 38vh;
  }

  .slide--cover h1 {
    font-size: clamp(34px, 4.6vw, 52px);
  }

  .slide__lead,
  .slide__desc {
    line-height: 1.58;
  }

  .slide__body {
    gap: 0.4rem;
  }

  .slide__head {
    margin-block-end: 0.9rem;
  }

  .slide--end h2 {
    font-size: clamp(38px, 5.4vw, 60px);
  }
}

@media (max-width: 1240px) {
  .slide {
    padding-inline: 34px;
  }

  .slide--project {
    gap: 1.1rem;
  }

  .slide__desc {
    line-height: 1.66;
  }
}

@media (max-height: 790px) {
  .slide {
    padding-block: 26px 96px;
  }

  .slide--cover h1 {
    font-size: clamp(32px, 4.2vw, 48px);
  }

  .slide__photo img {
    inline-size: clamp(132px, 15vh, 178px);
  }

  .slide__img img {
    max-block-size: 34vh;
  }

  .slide__body {
    gap: 0.25rem;
  }

  .slide__body h2 {
    font-size: clamp(30px, 3vw, 40px);
    line-height: 1.28;
  }

  .slide__lead,
  .slide__desc {
    line-height: 1.5;
  }

  .slide--end h2 {
    font-size: clamp(34px, 4.6vw, 52px);
  }
}

@media (max-width: 1150px) {
  /* على العرض المتوسط يُخفى وسم الرابط لتُبقي الشريحة داخل الشاشة (الزر يكفي للزيارة) */
  .slide__url {
    display: none;
  }
}

/* الجوال واللوحي: عمود واحد */
@media (max-width: 1000px) {
  .slide--project {
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: center;
    gap: 1rem;
  }

  .slide__img img {
    max-block-size: 32vh;
  }

  .slide__body {
    text-align: center;
    justify-items: center;
  }

  .slide__step {
    justify-content: center;
  }

  .tag {
    justify-self: center;
  }

  .slide__meta li {
    justify-content: center;
  }

  .slide__actions {
    justify-content: center;
  }

  .slide__number {
    inset-block-start: -14px;
    inset-inline-start: -6px;
    font-size: 54px;
  }
}

/* ============================================================
   الطباعة: كل شريحة صفحة أفقية مستقلة
   ============================================================ */
@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  html,
  body {
    height: auto;
    overflow: visible;
    background: #fff;
  }

  body::before,
  body::after,
  .counter,
  .controls,
  .progress,
  .blob,
  .slide::before,
  .slide::after,
  .slide__bg,
  .slide__photo::before {
    display: none !important;
  }

  /* اللمعان لا يُطبع — لون صلب واضح */
  .luminous,
  .slide__number,
  .counter {
    background: none !important;
    -webkit-text-fill-color: var(--primary-dark);
    color: var(--primary-dark);
    filter: none;
    animation: none;
  }

  .slide {
    position: static !important;
    display: grid !important;
    align-content: center;
    justify-items: center;
    text-align: center;
    gap: 6mm;
    inline-size: 297mm;
    block-size: 210mm;
    padding: 12mm 16mm;
    overflow: hidden;
    break-after: page;
    page-break-after: always;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  /* الشرائح النصية: عمود واحد متمركز */
  .slide--cover,
  .slide--about,
  .slide--end {
    grid-template-columns: 1fr;
  }

  /* شرائح المواقع: عمودان متجاوران في الصفحة الأفقية */
  .slide--project {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    justify-items: stretch;
    text-align: right;
    gap: 8mm;
  }

  .slide--project .slide__body {
    justify-items: stretch;
  }

  .slide--project .tag {
    justify-self: start;
  }

  .slide__step,
  .slide__actions {
    justify-content: flex-start;
  }

  .slide__meta li {
    justify-content: flex-start;
  }

  .slide:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .slide__img img {
    max-block-size: 148mm;
  }

  a {
    color: inherit;
    text-decoration: none;
  }

  .btn,
  .contact-card,
  .tag,
  .skills li {
    box-shadow: none;
    border: 2px solid var(--primary-dark);
    background: #fff;
    color: var(--primary-dark);
  }
}

/* ============================================================
   تقليل الحركة
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  body::before,
  body::after,
  .slide::after,
  .slide.is-active,
  .slide__photo::before,
  .blob,
  .luminous {
    animation: none !important;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}
