/* ==========================================================================
   Variables & Theme Defaults
   ========================================================================== */
:root {
  /* New Exact Color Palette */
  --primary-bg: #001133; /* Midnight Navy */
  --secondary-action: #0bd1a9; /* MAIN TURQUOISE COLOR: Greener, vibrant hue */
  --text-contrast: #faffff; /* Ice White */
  /* Legacy Color mappings for existing elements */
  --clr-navy: var(--primary-bg);
  /* Lighter Navy for Cards in Dark */
  --clr-navy-light: #152849; 
  --clr-green: var(--secondary-action);
  /* Lighter Green - Hover states */
  --clr-green-light: #8eeeec;
  --clr-offwhite: #f4f9fd;
  --clr-white: var(--text-contrast);
  --clr-text-light: var(--text-contrast);
  --clr-text-dark: #1e293b;
  --clr-muted: #94a3b8;
  --clr-border: #1a2c4e;

  /* Typography */
  --font-ar: 'Cairo', sans-serif;
  --font-en: 'Inter', sans-serif;
  --font-main: var(--font-ar);

  /* Spacing & Layout */
  --container-width: 1300px;
  --spacing-section: 7rem; /* Increased for cognitive breathing room */
  --spacing-element: 2rem;
  
  /* Soft Geometry - Global Border Radius */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-pill: 50px;

  /* Header height */
  --header-height: 50px;

  /* Shadows & Transitions */
  --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 20px rgba(0, 127, 127, 0.4);
  /* Fluidity: 0.4s ease-in-out */
  --transition-fast: 0.2s ease-in-out;
  --transition-smooth: 0.4s ease-in-out;
}

/* English Override Class */
html[lang="en"] {
  --font-main: var(--font-en);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Native smooth scroll padding to account for fixed header */
  scroll-padding-top: var(--header-height);
}

body {
  /* Move overflow-x handling to body to avoid clipping fixed overlays 
     but ensure it does not break scroll-behavior on html */
  overflow-x: hidden;

  font-family: var(--font-main);
  color: var(--clr-text-light);
  background-color: var(--clr-navy);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

ul {
  list-style: none;
}

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

.container {
  width: 90%;
  max-width: var(--container-width);
  margin-inline: auto;
}

section {
  padding-block: var(--spacing-section);
}

/* Typography Utilities */
.highlight {
  color: var(--clr-green);
  font-weight: 800;
}

.dark-text {
  color: var(--clr-navy) !important;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-pill);
  font-weight: 800;
  cursor: pointer;
  transition: all var(--transition-smooth);
  text-align: center;
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--secondary-action);
  color: var(--primary-bg); /* Maximum contrast against turquoise */
  padding: 0.95rem 2rem;
  font-size: 1.0rem;
  box-shadow: 0 0 0 0 rgba(0, 127, 127, 0);
  transition: all var(--transition-smooth), box-shadow var(--transition-smooth);
}

.btn-primary:hover {
  background-color: var(--clr-green-light);
  color: var(--primary-bg);
  transform: translateY(-3px);
  box-shadow: 0 0 28px rgba(0, 200, 200, 0.411), var(--shadow-md);
}

.btn-secondary {
  background-color: transparent;
  color: rgba(255, 255, 255, 0.800);
  border-color: rgba(255, 255, 255, 0.256);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 1.5rem;
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.666);
  color: var(--clr-white);
  transform: translateY(-2px);
}

.btn-outline-dark {
  background-color: transparent;
  color: var(--clr-navy);
  border-color: var(--clr-navy);
}

.btn-outline-dark:hover {
  background-color: var(--clr-navy);
  color: var(--clr-white);
}

/* ==========================================================================
   Section Dividers
   ========================================================================== */
.section-divider {
  height: 100px;
  width: 100%;
}

.bg-navy-to-light {
  background: linear-gradient(to bottom, var(--clr-navy), var(--clr-offwhite));
}

.bg-light-to-navy {
  background: linear-gradient(to bottom, var(--clr-offwhite), var(--clr-navy));
}

/* Sections Backgrounds */
.bg-navy {
  background-color: var(--clr-navy);
  color: var(--clr-text-light);
}

.bg-light {
  background-color: var(--clr-offwhite);
  color: var(--clr-text-dark);
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  border-bottom: none;
  padding-block: 1rem;
  transition: padding-block var(--transition-smooth);
}

/* Background & Glass effect moved to ::before to fix nested backdrop-filter bug. 
   When a parent has backdrop-filter, it breaks backdrop-filters on children. */
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
  transition: background-color var(--transition-smooth),
              backdrop-filter var(--transition-smooth),
              -webkit-backdrop-filter var(--transition-smooth),
              box-shadow var(--transition-smooth);
}

/* EDIT HEADER GLASS STYLES HERE */
/* Scrolled state OR pages with light background — Apple-style frosted glass */
.site-header.is-scrolled,
.page-light-bg .site-header {
  padding-block: 0.55rem;
}

.site-header.is-scrolled::before,
.page-light-bg .site-header::before {
  background-color: rgba(0, 17, 51, 0.85); /* Darker tint to make white text readable on white backgrounds */
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.026);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--clr-white);
}

.logo img {
  height: 30px;
  width: auto;
}

.logo span {
  color: var(--clr-green);
}

.main-nav ul {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.main-nav a {
  color: var(--clr-white);
  font-weight: 800;
  position: relative;
}

.main-nav a:hover {
  color: var(--clr-green);
}

.lang-toggle-btn {
  background: none;
  border: none;
  color: var(--clr-white);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  transition: color var(--transition-fast);
}

.lang-toggle-btn:hover {
  color: var(--clr-green);
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--clr-white);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Mobile nav open state - Base */
.nav-open {
  display: block !important;
  position: absolute;
  top: 100%;
  inset-inline-start: 0;
  width: 100%;
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  transition: background var(--transition-smooth),
              background-color var(--transition-smooth),
              backdrop-filter var(--transition-smooth),
              -webkit-backdrop-filter var(--transition-smooth),
              box-shadow var(--transition-smooth);
}

/* 1. Dark Pages - Top of Page State (Gradient) */
.site-header:not(.is-scrolled) .nav-open {
  background: linear-gradient(to bottom, rgba(0, 17, 51, 0.053) 10%, rgba(0, 17, 51, 0.9) 70%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: none;
}

/* 2. Dark Pages - Scrolled State (Standard Glassmorphism) */
.site-header.is-scrolled .nav-open {
  background-color: rgba(0, 17, 51, 0.85); /* Lower opacity allows the frosted glass (blur) to show clearly */
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 3. Light Background Pages (Portfolio) - OVERRIDE both states to match the dark frosted header */
.page-light-bg .site-header .nav-open,
.page-light-bg .site-header:not(.is-scrolled) .nav-open {
  background: rgba(0, 17, 51, 0.85); /* Opaque enough to hide white background and keep text readable */
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.026);
}

.nav-open ul {
  flex-direction: column;
  gap: 1.25rem;
}

/* Mobile Contact CTA in nav — hidden on desktop (desktop uses .cta-btn) */
.mobile-cta-item {
  display: none;
}

.mobile-cta-item .btn {
  width: 100%;
  justify-content: center;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding-top: calc(var(--header-height) + var(--spacing-section) + 1rem);
  padding-bottom: calc(var(--spacing-section) + 1rem);
  position: relative;
  overflow: hidden;
  background-color: var(--primary-bg); /* Fallback */
}

/* 
 * ==========================================================================
 * EDIT HERO GRADIENT HERE: إشعاع ضوء الشمس
 * لتعديل الإشعاع لاحقاً:
 * - لتغيير السطوع: قم بتعديل نسبة 18% في دالة color-mix
 * - لتغيير مساحة الانتشار: قم بتعديل نسبة 65% في نهاية التدرج
 * ==========================================================================
 */

/* اتجاه اليمين لليسار (العربية): الإشعاع من الزاوية اليمنى العليا */
html[lang="ar"] .hero, 
html[dir="rtl"] .hero {
  background-image: radial-gradient(circle at top right, color-mix(in srgb, var(--secondary-action) 20%, var(--primary-bg)) 0%, var(--primary-bg) 70%);
}

/* اتجاه اليسار لليمين (الإنجليزية): الإشعاع من الزاوية اليسرى العليا */
html[lang="en"] .hero, 
html[dir="ltr"] .hero {
  background-image: radial-gradient(circle at top left, color-mix(in srgb, var(--secondary-action) 20%, var(--primary-bg)) 0%, var(--primary-bg) 70%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 10rem;
  align-items: center;
}

.badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: rgba(16, 185, 129, 0.169);
  color: var(--clr-green);
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(5px);
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.2;
  margin-bottom: 1.5rem;
  color: var(--clr-white);
}

.hero-desc {
  font-size: 1.0rem;
  margin-bottom: 2.5rem;
  max-width: 90%;
  color: var(--clr-muted);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-image-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.profile-image-container {
  width: 100%;
  max-width: 500px;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--clr-navy-light) 0%, transparent 70%);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  position: relative;
  z-index: 1;
}

.profile-image {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
  object-fit: cover;
  border-radius: 50% 50% 0 0;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0) 100%);
  transform: translateY(2rem);
}

/* Skills Floating Tags */
.hero-footer-container {
  margin-top: 2.5rem;
  position: relative;
  z-index: 5;
}

.skills-floating-group {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1rem 0;
}

.skill-tag {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-pill);
  background-color: rgba(0, 17, 51, 0.4);
  border: 1px solid rgba(224, 253, 251, 0.12);
  color: var(--text-contrast);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--transition-fast);
}

.skill-tag:hover {
  border-color: rgba(224, 253, 251, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 17, 51, 0.3);
}

.skill-tag i {
  color: var(--secondary-action);
}

/* Scroll Nudge Indicator */
.hero-scroll-indicator {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
  animation: bounceNudge 2s infinite ease-in-out;
}

.hero-scroll-indicator i {
  color: var(--secondary-action);
  font-size: 1.5rem;
  opacity: 0.8;
}

@keyframes bounceNudge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* ==========================================================================
   Portfolio Section
   ========================================================================== */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  gap: 1rem;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
}

/* Counter badge next to 'View All' button */
.view-all-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-direction: row;
}

.portfolio-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.85rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1.2px solid rgba(0, 255, 170, 0.443);
  color: var(--clr-green);
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Portfolio Market Wrapper (Tier 1) - Frosted Glass & Sticky Sidebar
   ═══════════════════════════════════════════════════════════════════════════ */
.portfolio-market-wrapper {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 3rem;
  background-color: rgba(248, 250, 252, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  padding: 3rem;
  box-shadow: 0 10px 40px rgba(21, 216, 187, 0.123), 0 0 10px rgba(21, 216, 187, 0.05) inset;
  margin-bottom: 4rem;
}

/* For dark mode / dark backgrounds if section overlaps */
.bg-navy .portfolio-market-wrapper {
  background-color: rgba(23, 41, 71, 0.6);
  border-color: rgba(21, 216, 187, 0.15);
  box-shadow: 0 10px 40px rgba(21, 216, 187, 0.05), 0 0 10px rgba(21, 216, 187, 0.05) inset;
}

.market-sticky-sidebar {
  position: relative; 
}

.market-sidebar-title {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--clr-primary-bg);
  text-shadow: 0 2px 10px rgba(21, 216, 187, 0.3);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 0 auto;
  opacity: 0.9;
  white-space: nowrap;
}

/* Adjust for Arabic explicitly to look best */
html[lang="ar"] .market-sidebar-title {
  color: var(--clr-navy);
}

/* Adjust for English reading flow */
html[lang="en"] .market-sidebar-title {
  writing-mode: vertical-lr; 
  transform: rotate(180deg);
  color: var(--clr-navy);
}

.market-content-col {
  display: flex;
  flex-direction: column;
  gap: 4rem; /* Spacing between internal sections like Projects and Case Studies */
}

/* Subheadings inside the wrapper */
.market-content-col .portfolio-page-subtitle {
  margin-bottom: 1.5rem;
  color: var(--clr-navy);
  font-size: 1.5rem;
  border-bottom: 2px solid rgba(21, 216, 187, 0.2);
  padding-bottom: 0.5rem;
  display: inline-block;
}

/* Mobile responsive degradation */
@media (max-width: 900px) {
  .portfolio-market-wrapper {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 2rem;
  }
  
  .market-sidebar-title {
    position: relative;
    top: 0;
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 1.75rem;
    margin-bottom: 0;
    text-align: center;
  }
  
  html[lang="en"] .market-sidebar-title {
    writing-mode: horizontal-tb;
    transform: none;
  }
}


/* ── Full-card clickable link wrapper ──────────────────────────────── */
.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  /* Stretch to fill the grid cell so the card occupies the full height */
  height: 100%;
  border-radius: var(--radius-lg);
}

.card-link:focus-visible {
  outline: 2px solid var(--clr-green);
  outline-offset: 3px;
  border-radius: var(--radius-lg);
}

.portfolio-card {
  background-color: var(--clr-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-smooth);
  border: 1px solid rgba(0, 17, 51, 0.05);
  height: 100%;
  color: var(--primary-bg);
}

.card-link:hover .portfolio-card,
.portfolio-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: var(--shadow-md), 0 0 24px rgba(21, 216, 187, 0.15);
  border-color: rgba(21, 216, 187, 0.3);
}

.card-image {
  height: 240px;
  background-color: var(--clr-border);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-card:hover .card-image img {
  transform: scale(1.05);
}

/* Fallback placeholder for cards without an image */
.card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-border);
}

.card-content {
  padding: 2rem;
}

.category {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--clr-green);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  display: block;
}

.card-content h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--clr-navy);
}

.card-content p {
  color: var(--clr-text-dark);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.read-more {
  color: var(--clr-green);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.read-more:hover {
  color: var(--clr-green-light);
}

/* ==========================================================================
   Resume / CV Section
   -- DYNAMIC HEIGHT: The section uses a flexible max-height so new timeline
   -- items don't break the layout. The fade gradient and the download button
   -- are always pinned to the bottom of .cv-container via absolute positioning.
   ========================================================================== */
.resume {
  /* Allow Certifications section to be visible but fade out near the button */
  position: relative;
}

.cv-container {
  position: relative;
  /* Basic height cap applied globally */
  max-height: 700px;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  /* Extra bottom padding so the fade doesn't obscure the last line of text immediately */
  padding-bottom: 2rem;
}

/* Expanded state */
.cv-container.is-expanded {
  max-height: 9999px;
  padding-bottom: 50px;
}

/* Fade-out gradient inside the container */
.cv-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 200px;
  /* fixed soft fade height perfectly matching --primary-bg */
  background: linear-gradient(to bottom,
      rgba(0, 17, 51, 0) 0%,
      rgba(0, 17, 51, 0.9) 60%,
      rgba(0, 17, 51, 1) 100%);
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.3s ease;
}

.cv-container.is-expanded::after {
  opacity: 0;
  pointer-events: none;
}


/* Download CV button — centered below the section heading, above the expandable area */
.cv-download-btn-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

/* RTL/LTR: no directional override needed since we use flexbox centering */

.cv-header-center {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  z-index: 2;
}

.cv-header-center .section-desc {
  margin-bottom: 0;
}

.cv-grid {
  display: flex;
  gap: 5rem;
  margin-bottom: 5rem;
  position: relative;
  z-index: 2;
}

.cv-column {
  flex: 1;
}

.cv-column-title {
  font-size: 1.5rem;
  color: var(--clr-green);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cv-certifications {
  margin-top: 2rem;
  position: relative;
  z-index: 2;
}

/* When Certifications are nested inside a cv-column, force single-column grid
   so cards stack neatly and match the Experience column's visual height */
.cv-column .cv-certifications .certification-grid {
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* Dot indicators: hidden everywhere — replaced by expand button on mobile */
.cv-dots {
  display: none;
}

/* ── Mobile vertical timeline section separators ───────────────────── */
.cv-mobile-section-title {
  display: none;
  /* shown only in mobile media query */
}

/* ── Expandable CV wrapper — controls height + fade on ALL viewports ── */
/* ── Action Area (Holds the Expand Button Outside Container) ────────── */
.cv-action-area {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 10;
  margin-top: -1rem;
  /* pull button up slightly over the fade */
}

/* ── Show More / Show Less button (desktop + mobile) ───────────────── */
.cv-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.75rem;
  background: rgba(0, 235, 200, 0.154);
  border: 2px solid var(--secondary-action);
  border-radius: var(--radius-pill);
  color: var(--secondary-action);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  animation: cv-btn-pulse 2s ease-in-out infinite;
  position: relative;
  z-index: 10;
}

.cv-expand-btn:hover {
  background: rgba(0, 235, 200, 0.291);
}

.cv-expand-btn.is-expanded {
  animation: none;
}

.cv-expand-btn i {
  font-size: 1rem;
  transition: transform 0.5s ease;
}

.cv-expand-btn.is-expanded i {
  transform: rotate(180deg);
}

@keyframes cv-btn-pulse {

  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 0 0 0 rgba(0, 235, 199, 0.4);
  }

  50% {
    transform: translateY(-4px);
    box-shadow: 0 0 0 10px rgba(0, 235, 199, 0);
  }
}

.certification-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.cert-card {
  background: var(--clr-navy-light);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--clr-border);
}

.cert-card h4 {
  color: var(--clr-white);
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.cert-card p {
  color: var(--clr-muted);
  font-size: 0.9rem;
}

.section-desc {
  margin-bottom: 2rem;
  font-size: 1.1rem;
  color: var(--clr-muted);
}

.timeline {
  position: relative;
  padding-inline-start: 2rem;
}

/* Vertical timeline line */
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  width: 2px;
  background-color: var(--clr-border);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  inset-inline-start: -2.35rem;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: var(--secondary-action);
  border: 4px solid var(--primary-bg);
}

.timeline-date {
  color: var(--clr-green);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.timeline-role {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--clr-white);
  margin-bottom: 0.25rem;
}

.timeline-company {
  font-size: 0.9rem;
  color: var(--clr-muted);
  margin-bottom: 1rem;
}

/* ==========================================================================
   Contact Section
   ========================================================================== */
/* Single-column layout: form always on top, alternatives below.
   DOM order in index.md controls the visual order (form-wrapper first). */
.contact-inner {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  max-width: 680px;
  margin-inline: auto;
}


.contact-info {
  margin-top: 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-box {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--clr-green);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.info-item span {
  display: block;
  font-size: 0.85rem;
  color: var(--clr-muted);
}

.info-item strong {
  color: var(--clr-white);
  font-size: 1.1rem;
}

.contact-form-wrapper {
  background-color: var(--clr-navy-light);
  padding: 3rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--clr-border);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--clr-white);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  background-color: var(--clr-navy);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  color: var(--clr-white);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--clr-green);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--clr-muted);
  opacity: 0.7;
}

.submit-btn {
  width: 100%;
}

/* ── Contact: direct-link alternatives ──────────────────────────────── */
.contact-alternatives {
  margin-top: 2rem;
}

.contact-alternatives-label {
  font-size: 0.85rem;
  color: var(--clr-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.contact-alternatives-label::before,
.contact-alternatives-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--clr-border);
}

.direct-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.direct-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background-color: var(--clr-navy-light);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-pill);
  color: var(--clr-text-light);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.direct-link i {
  color: var(--clr-green);
  font-size: 1rem;
  flex-shrink: 0;
}

.direct-link:hover {
  border-color: var(--clr-green);
  color: var(--clr-green);
  transform: translateX(-4px);
}

html[dir="ltr"] .direct-link:hover {
  transform: translateX(4px);
}


/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--clr-border);
  padding-top: 4rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 3rem;
}

.footer-col h3 {
  color: var(--clr-white);
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
}

.brand-col p {
  margin-top: 1rem;
  color: var(--clr-muted);
  max-width: 80%;
}

.links-col ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.links-col a {
  color: var(--clr-muted);
  transition: all var(--transition-fast);
}

.links-col a:hover {
  color: var(--clr-green);
  padding-inline-start: 5px;
}

.social-links {
  display: flex;
  gap: 1rem;
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--clr-navy-light);
  color: var(--clr-green);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all var(--transition-fast);
}

.social-links a:hover {
  background-color: var(--clr-green);
  color: var(--clr-white);
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-block: 1.5rem;
  border-top: 1px solid var(--clr-border);
  color: var(--clr-muted);
  font-size: 0.9rem;
}

/* ==========================================================================
   Arrow Icon — RTL/LTR Direction Utility
   fa-arrow-left points "forward" in RTL. In LTR it must flip to point right.
   ========================================================================== */
html[dir="rtl"] .arrow-icon {
  transform: rotate(0deg);
}

html[dir="ltr"] .arrow-icon {
  transform: rotate(180deg);
}

/* ==========================================================================
   Portfolio List Page Layout
   ========================================================================== */
.portfolio-page-section {
  padding-top: calc(var(--header-height) + 5rem);
  padding-bottom: 60px;
  min-height: 100vh;
}

.portfolio-page-title {
  text-align: center;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 3rem;
  color: var(--clr-navy);
}

.portfolio-page-subtitle {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--clr-navy-light);
  border-bottom: 2px solid var(--clr-green);
  display: inline-block;
  padding-bottom: 0.5rem;
}

.portfolio-grid-custom {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 4rem;
}

/* ==========================================================================
   Markdown / Prose Content Styling
   (Used in Case Study and Project detail pages)
   ========================================================================== */
.markdown-content,
.page-content {
  max-width: 800px;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

.markdown-content {
  /* Clear the fixed header using the CSS variable */
  padding-top: calc(var(--header-height) + 2rem);
  padding-bottom: 4rem;
}

.page-content {
  padding-bottom: var(--spacing-section);
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
  color: var(--clr-white);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 800;
  line-height: 1.3;
}

.page-content h2 {
  color: var(--clr-green);
  font-size: 1.8rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 800;
}

.markdown-content p,
.page-content p {
  /* Use clr-text-light instead of clr-muted for improved readability */
  color: var(--clr-text-light);
  line-height: 1.9;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.markdown-content img {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin-block: 2rem;
  box-shadow: var(--shadow-sm);
}

.markdown-content ul,
.markdown-content ol,
.page-content ul,
.page-content ol {
  margin-bottom: 1.5rem;
  padding-inline-start: 2rem;
  color: var(--clr-text-light);
  line-height: 1.9;
}

.markdown-content li,
.page-content li {
  margin-bottom: 0.5rem;
}

.markdown-content a {
  color: var(--clr-green);
  text-decoration: underline;
}

.markdown-content a:hover {
  color: var(--clr-green-light);
}

.markdown-content blockquote {
  border-inline-start: 4px solid var(--clr-green);
  padding-inline-start: 1.25rem;
  margin-inline: 0;
  margin-bottom: 1.5rem;
  font-style: italic;
  color: var(--clr-muted);
  background-color: rgba(16, 185, 129, 0.05);
  padding-block: 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Markdown tables */
.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  overflow-x: auto;
  display: block;
}

.markdown-content th {
  background-color: var(--clr-green);
  color: var(--clr-white);
  padding: 0.75rem 1rem;
  text-align: start;
  font-weight: 700;
}

.markdown-content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--clr-border);
  color: var(--clr-text-light);
}

.markdown-content tr:last-child td {
  border-bottom: none;
}

.markdown-content tr:nth-child(even) td {
  background-color: rgba(255, 255, 255, 0.03);
}

/* ==========================================================================
   Single Post / Case Study Layout
   ========================================================================== */
.case-study.cs-header {
  padding-top: var(--header-height);
  background-color: var(--clr-navy);
  min-height: 100vh;
}

/* Post header (title banner at top of case study) */
.post-header {
  background: linear-gradient(135deg, var(--clr-navy-light) 0%, var(--clr-navy) 100%);
  border-bottom: 1px solid var(--clr-border);
  padding-block: 3rem;
  position: relative;
}

.post-header h1 {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--clr-white);
  line-height: 1.3;
}

.cs-meta-bar {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem 2rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--clr-border);
}

.cs-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cs-meta-label {
  color: var(--clr-green);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cs-meta-value {
  color: var(--clr-white);
  font-weight: 600;
  font-size: 1.05rem;
}

/* ==========================================================================
   Training Works Single Case Study
   ========================================================================== */
.mkt-lab-page {
  background-color: var(--clr-navy);
  color: var(--clr-text-light);
}

.mkt-lab-hero {
  position: relative;
  padding: 8rem 2rem 4rem;
  background: linear-gradient(135deg, #0d1b2a 0%, var(--clr-navy) 100%);
  border-bottom: 1px dashed rgba(148, 163, 184, 0.2);
  text-align: center;
}

.mkt-lab-hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.mkt-lab-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--clr-muted);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
  margin-bottom: 2rem;
  transition: color var(--transition-fast);
}

.mkt-lab-back-link:hover {
  color: var(--clr-white);
}

.mkt-lab-type-badge {
  display: block;
  margin-bottom: 1rem;
}

.mkt-lab-title {
  color: var(--clr-white);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.mkt-lab-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.95rem;
  color: var(--clr-muted);
}

.mkt-lab-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.mkt-lab-body {
  padding-block: 4rem;
  max-width: 800px;
}

.mkt-lab-heading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  color: var(--clr-white);
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.mkt-lab-heading i {
  color: var(--clr-green);
  opacity: 0.8;
}

/* Callout Boxes */
.callout-box-dark {
  background-color: rgba(15, 23, 42, 0.4);
  border-inline-start: 4px solid var(--clr-muted);
  padding: 2rem;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  margin-bottom: 3rem;
}
html[dir="ltr"] .callout-box-dark {
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.callout-box-accent {
  background-color: rgba(16, 185, 129, 0.05); /* Green tint */
  border-inline-start: 4px solid var(--clr-green);
  padding: 2rem;
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  margin-bottom: 3rem;
}
html[dir="ltr"] .callout-box-accent {
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

/* ==========================================================================
   Utility helpers
   ========================================================================== */
.w-100 {
  width: 100%;
}

.d-block {
  display: block;
}

/* ==========================================================================
   Media Queries
   ========================================================================== */

/* ── Tablet / Small Desktop ─────────────────────────── */
@media (max-width: 992px) {

  .hero-inner,
  .contact-inner {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .hero-image-wrapper {
    order: -1;
  }

  .cv-grid {
    gap: 2rem;
  }
}

/* ── Mobile ─────────────────────────────────────────── */
@media (max-width: 791px) {

  /* Navigation */
  .main-nav {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .cta-btn {
    display: none;
  }

  /* Show the Contact CTA inside the hamburger menu */
  .mobile-cta-item {
    display: block;
  }

  /* Hero */
  .hero-title {
    font-size: 2rem;
  }

  .profile-image-container {
    width: 100%;
    max-width: 280px;
    margin-inline: auto;
  }

  .badge-top,
  .badge-bottom {
    position: relative;
    animation: none;
    top: auto;
    inset-inline-end: auto;
    bottom: auto;
    inset-inline-start: auto;
    transform: none !important;
    margin-top: 1rem;
  }

  .hero-image-wrapper {
    flex-direction: column;
  }

  /* Skills bar */
  .skills-bar {
    gap: 1rem;
    padding: 1rem;
    margin-top: 2rem;
  }

  /* ── CV section: vertical expandable timeline on mobile ──────────── */


  /* Remove the desktop absolutely-positioned download button */
  .cv-download-btn-wrapper {
    position: static;
    inset-inline-start: auto;
    transform: none !important;
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
  }

  /* Convert the 2-column desktop grid to a single-column vertical flow */
  .cv-grid {
    flex-direction: column;
    gap: 0;
    overflow: visible;
  }

  .cv-column {
    min-width: 100%;
    flex-shrink: 1;
    padding-inline-end: 0;
  }

  /* Vertical dotted green timeline line (replaces solid desktop line) */
  .cv-column .timeline::before,
  .cv-certifications .timeline::before {
    border-inline-start: 2px dashed rgba(16, 185, 129, 0.45);
    background: none;
    width: 0;
  }

  /* ── Mobile section divider headings ──────────────────────────────── */
  .cv-mobile-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--clr-green);
    margin-top: 2rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px dashed rgba(16, 185, 129, 0.3);
  }

  .cv-mobile-section-title:first-child {
    margin-top: 0;
  }

  .cv-mobile-section-title i {
    font-size: 1rem;
    opacity: 0.8;
  }

  /* ── CV Container height override for mobile ──────────────────────── */
  .cv-container {
    /* تم زيادة الارتفاع هنا ليُظهر قسم الخبرات بالكامل في الجوال */
    max-height: 1100px;
  }

  .cv-container.is-expanded {
    max-height: 9999px;
  }


  /* ── Show More / Show Less button (mobile overrides only) ────────── */
  /* الأنماط الأساسية مُعرَّفة بالأعلى في الطبقة الافتراضية */

  /* Contact form */
  .contact-form-wrapper {
    padding: 1.5rem 1rem;
  }

  /* On mobile: single-column layout, form on top (primary), alternatives below */
  .contact-inner {
    grid-template-columns: 1fr;
    grid-template-areas: "form" "info";
    gap: 2rem;
  }

  /* Portfolio page */
  .portfolio-page-title {
    font-size: 2rem;
  }

  .portfolio-page-subtitle {
    font-size: 1.5rem;
  }

  /* Case study meta bar */
  .cs-meta-bar {
    flex-direction: column;
    gap: 1rem;
    padding-inline: 1rem;
  }

  /* Footer */
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .brand-col p {
    max-width: 100%;
  }
}

/* ── Very small phones ──────────────────────────────── */
@media (max-width: 500px) {

  :root {
    --spacing-section: 3rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-desc {
    font-size: 1rem;
    max-width: 100%;
  }

  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .portfolio-grid,
  .portfolio-grid-custom {
    grid-template-columns: 1fr;
  }

  .tier-lab-blueprint .portfolio-card {
    flex-direction: column;
    padding-bottom: 2rem;
  }

  .tier-lab-blueprint .card-image {
    width: 100%;
    margin-right: 0;
    margin-bottom: 1.25rem;
  }

  html[dir="rtl"] .tier-lab-blueprint .card-image {
    margin-left: 0;
  }

  .certification-grid {
    grid-template-columns: 1fr;
  }

  .contact-form-wrapper {
    padding: 1rem;
    border-radius: var(--radius-md);
  }

  .markdown-content {
    padding-inline: 1rem;
  }

  .post-header h1 {
    font-size: 1.5rem;
  }
}

/* ==========================================================================
   Project Status Tags (Cards)
   ========================================================================== */
.project-status-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--clr-green);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(16, 185, 129, 0.3);
  width: fit-content;
}

/* ==========================================================================
   Portfolio Tier Styles — Backend Agent's structural classes
   ========================================================================== */

/* ── Tier Wrapper Shared ─────────────────────────────────────────────────── */
.portfolio-tier-market,
.portfolio-tier-training,
.portfolio-tier-coming-soon {
  margin-bottom: 5rem;
}

/* Tier heading / label */
.tier-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1.5rem;
}

/* ── Tier 1: Market / Real Work ──────────────────────────────────────────── */
/* Elevate the existing card design with a smoother, unified micro-interaction */
.portfolio-tier-market .tier-label {
  background-color: rgb(16, 185, 129);
  color: var(--clr-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}



/* ── Tier 2: Training Works ─────────────────────────────────── */
.portfolio-tier-training .tier-label {
  background-color: rgba(47, 104, 125, 0.712); /* Dark Blue */
  color: var(--clr-white);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.training-wrapper {
  background-color: rgba(248, 250, 252, 0.45);
  padding: 3rem 2rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.829);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(3, 130, 193, 0.282), 0 0 10px rgba(21, 216, 187, 0.05) inset;
}

/* On mobile, reduce padding for the wrapper */
@media (max-width: 791px) {
  .training-wrapper {
    padding: 2rem 1rem;
  }
}

/* Training badges system (References Front-Matter class) */
.training-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  width: fit-content;
}

.badge-academic {
  background-color: rgba(113, 246, 92, 0.15); /* Purple tint */
  color: #313e2b;
  border: 1px solid rgba(113, 246, 92, 0.3);
}

.badge-strategic {
  background-color: rgba(56, 210, 248, 0.106); /* Light blue tint */
  color: #17434d;
  border: 1px solid rgba(56, 184, 248, 0.3);
}

.badge-default {
  background-color: rgba(65, 73, 75, 0.099); /* Gray/Slate */
  color: #2f3338;
  border: 1px solid rgb(65, 73, 75);
}

/* Ensure the training grid matches the market grid columns */
.tier-training-grid {
  /* It already uses .portfolio-grid-custom which behaves properly */
  margin-bottom: 0; /* Remove bottom margin inside wrapper */
}

/* ── Tier 3: Coming Soon ─────────────────────────────────────────────────── */
.portfolio-tier-coming-soon .tier-label {
  background-color: rgba(148, 163, 184, 0.1);
  color: var(--clr-muted);
  border: 1px dashed rgba(148, 163, 184, 0.4);
}

/* Coming Soon Horizontal Slider */
.tier-coming-soon-slider {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 2rem;
  padding-top: 1rem;
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}
.tier-coming-soon-slider::-webkit-scrollbar {
  display: none;
}
.tier-coming-soon-slider .coming-soon-card {
  flex: 0 0 calc(33.333% - 1.5rem);
  min-width: 280px;
  scroll-snap-align: center;
}

/* The locked card wrapper */
.coming-soon-card {
  position: relative;
  display: block;
  height: 100%;
  border-radius: var(--radius-lg);
  cursor: default;
  pointer-events: auto;
}

/* The actual card in the locked state */
.coming-soon-card .portfolio-card {
  opacity: 0.55;
  filter: grayscale(50%);
  border: 2px dashed rgba(148, 163, 184, 0.35) !important;
  box-shadow: none !important;
  transition: opacity var(--transition-smooth),
              filter var(--transition-smooth);
}

/* Card block stays perfectly static on hover — requested by user */
.coming-soon-card:hover .portfolio-card {
  transform: none !important;
  box-shadow: none !important;
  cursor: default !important;
}

/* Ensure the wrapper itself shows a default cursor when hovered */
.coming-soon-card {
  cursor: default !important;
}

/* ::after overlay — appears on hover with overlay text */
.coming-soon-card::after {
  content: "قيد التنفيذ\A Under Construction";
  white-space: pre;
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.78);
  color: var(--clr-text-light);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Trick: use flex via display, override white-space for the \A newline */
  opacity: 0;
  transition: opacity var(--transition-smooth);
  pointer-events: none;
  border: 1.5px dashed rgba(148, 163, 184, 0.4);
}

.coming-soon-card:hover::after {
  opacity: 1;
}

/* Small "lock" accent badge on the card */
.coming-soon-card .portfolio-card::before {
  content: "\f023"; /* fa-lock unicode */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  top: 0.75rem;
  inset-inline-end: 0.75rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(2, 78, 255, 0.7);
  color: var(--clr-muted);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

/* Coming-soon grid no hover lift on child card */
.coming-soon-card .card-link,
.portfolio-tier-coming-soon .card-link {
  pointer-events: none;    /* disable navigation — it's a locked card */
}

/* ── Tier responsive overrides ───────────────────────────────────────────── */
@media (max-width: 791px) {
  .portfolio-tier-market,
  .portfolio-tier-training,
  .portfolio-tier-coming-soon {
    margin-bottom: 2.5rem;
  }
}

/* ==========================================================================
   Hero Image — CSS-only fade-in (LCP optimization)
   Triggers immediately on load, no JS dependency.
   ========================================================================== */
@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-image-wrapper {
  animation: heroFadeIn 0.8s ease-out 0.15s both;
}

/* ==========================================================================
   Global Animations & Reveal Logic
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
  will-change: opacity, transform;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}
