/* ==========================================================================
   CINEMATIC DESIGN SYSTEM - YOUSSEF MOHAMED PORTFOLIO
   ========================================================================== */

/* --- Import Fonts & Icons --- */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Rajdhani:wght@400;500;600;700&family=Cairo:wght@400;700&family=Inter:wght@300;400;500;700&display=swap');

/* --- Theme Variables --- */
:root {
  --bg-black: #000000;
  --accent-red: #AF0101;
  --accent-red-glow: rgba(175, 1, 1, 0.45);
  --accent-red-dim: rgba(175, 1, 1, 0.15);
  --dark-grey: #121212;
  --border-grey: #424343;
  --text-primary: #FFFFFF;
  --text-secondary: #B0B0B0;
  --text-dimmed: #707070;
  --glass-bg: rgba(18, 18, 18, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --font-title: 'Bebas Neue', sans-serif;
  --font-body: 'Rajdhani', sans-serif;
  --font-alt: 'Inter', sans-serif;
  --font-arabic: 'Cairo', sans-serif;
}

/* --- Global Resets & Scrollbars --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-black);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
}

body {
  background-color: var(--bg-black);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  cursor: none !important;
}

* {
  cursor: none !important;
}

.background-stars {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(circle at 20% 15%, rgba(255,255,255,0.08), transparent 18%),
              radial-gradient(circle at 70% 25%, rgba(255,255,255,0.06), transparent 18%),
              radial-gradient(circle at 40% 70%, rgba(255,255,255,0.05), transparent 20%),
              linear-gradient(180deg, rgba(255,255,255,0.02), transparent 45%, rgba(255,255,255,0.04) 100%);
  opacity: 0.8;
  animation: driftStars 80s linear infinite;
}

.background-stars::before,
.background-stars::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,0.95) 1px, transparent 1px);
  background-size: 120px 120px;
  opacity: 0.12;
}

.background-stars::before {
  transform: translate(0, 0);
  animation: driftStars 38s linear infinite reverse;
}

.background-stars::after {
  transform: translate(0, 0);
  background-size: 200px 200px;
  opacity: 0.06;
  animation: driftStars 48s linear infinite;
}

.background-stars .background-star {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.45) 25%, rgba(255,255,255,0.05) 55%, transparent 100%);
  filter: blur(0.5px);
  opacity: 0.15;
  animation: starPulse var(--star-duration) ease-in-out infinite, starDrift var(--star-drift) ease-in-out infinite alternate;
}

.background-stars .background-star:hover {
  opacity: 0.15;
}

.background-icons {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.background-icons .background-icon {
  position: absolute;
  width: 44px;
  height: 44px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.14;
  filter: drop-shadow(0 0 16px rgba(255,255,255,0.12));
  mix-blend-mode: screen;
  transform-style: preserve-3d;
  animation: iconFloat var(--icon-duration) ease-in-out infinite alternate, iconSpin var(--icon-spin) linear infinite;
}

@keyframes starPulse {
  0%, 100% { opacity: 0.12; transform: scale(1); }
  50% { opacity: 0.32; transform: scale(1.3); }
}

@keyframes starDrift {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(var(--drift-x), var(--drift-y), 0); }
}

@keyframes iconFloat {
  0% { transform: translate3d(0, 0, 0) rotate3d(0.3, 0.7, 0.2, 0deg); }
  100% { transform: translate3d(var(--icon-drift-x), var(--icon-drift-y), 0) rotate3d(0.3, 0.7, 0.2, 14deg); }
}

@keyframes iconSpin {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}

.cursor-dot,
.cursor-ring {
  position: fixed;
  pointer-events: none;
  z-index: 2100;
  mix-blend-mode: screen;
}

.cursor-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 0 14px rgba(255,255,255,0.8);
  transform: translate(-50%, -50%);
  opacity: 1;
}

.cursor-ring {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 18px rgba(255,255,255,0.3), 0 0 32px rgba(175,1,1,0.18);
  opacity: 0.8;
  transform: translate(-50%, -50%) scale(0.98);
  transition: box-shadow 0.18s ease;
}

.cursor-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
}

.cursor-ring.active {
  opacity: 1;
}

.cursor-ring.clicked {
  transform: translate(-50%, -50%) scale(1.2);
  box-shadow: 0 0 28px rgba(255,255,255,0.6), 0 0 48px rgba(175,1,1,0.3);
}

@keyframes orbit-ring {
  from {
    transform: translate(-50%, -50%) rotate(0deg) scale(0.98);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg) scale(0.98);
  }
}

@keyframes driftStars {
  from { background-position: 0 0, 30px 60px, 80px 120px; }
  to { background-position: 200px -150px, 20px -90px, -100px 180px; }
}

@keyframes twinkleStars {
  0%, 100% { opacity: 0.12; }
  50% { opacity: 0.24; }
}

/* Scrollbar Customization */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-black);
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
  transition: background 0.3s;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-red);
}

/* --- Utility Classes --- */
.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 40px;
  width: 100%;
}

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
}

.glow-btn {
  background: var(--accent-red);
  color: var(--text-primary);
  border: none;
  text-decoration: none;
  font-family: var(--font-title);
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
}

.glow-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.glow-btn:hover::before {
  left: 100%;
}

.glow-btn:hover {
  background: #d40101;
  box-shadow: 0 0 20px var(--accent-red-glow);
  transform: translateY(-2px);
}

/* --- Sticky Header --- */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-grey);
  transition: all 0.3s ease;
}

/* Header uses .glass for the visual style, but backdrop-filter on the header itself
   breaks position:fixed for child elements (like the mobile nav-menu), confining them
   to the header's box instead of the full viewport. So we override .glass here and
   move the blur to a pseudo-element instead, keeping the same look without that bug. */
header.glass {
  position: sticky;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: transparent;
}

header.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  z-index: -1;
}

header.scrolled {
  height: 70px;
  background: rgba(0, 0, 0, 0.9);
  border-bottom: 1px solid rgba(175, 1, 1, 0.3);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo-link {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255,255,255,0.1));
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 32px;
}

.nav-link {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: 1.5px;
  transition: color 0.3s ease, transform 0.2s ease;
  display: inline-block;
}

.nav-link:hover {
  color: var(--accent-red);
  transform: scale(1.05);
}

.action-area {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Language Switcher */
.lang-toggle {
  background: transparent;
  border: 1px solid var(--text-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.lang-toggle:hover {
  background: var(--text-primary);
  color: var(--bg-black);
}

/* Main CTA */
.header-cta {
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 1.1rem;
}

/* Hamburger Menu Icon */
.hamburger {
  display: none;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 30px;
  height: 24px;
  position: relative;
  z-index: 1001;
}

.hamburger span {
  display: block;
  position: absolute;
  height: 2px;
  width: 100%;
  background: var(--text-primary);
  border-radius: 2px;
  opacity: 1;
  left: 0;
  transform: rotate(0deg);
  transition: .25s ease-in-out;
}

.hamburger span:nth-child(1) { top: 0px; }
.hamburger span:nth-child(2) { top: 10px; }
.hamburger span:nth-child(3) { top: 20px; }

.hamburger.open span:nth-child(1) {
  top: 10px;
  transform: rotate(135deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
  left: -60px;
}

.hamburger.open span:nth-child(3) {
  top: 10px;
  transform: rotate(-135deg);
}

/* --- Hero Section --- */
#hero {
  position: relative;
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 60px 0;
}

/* Ambient Backlight Glow */
.hero-glow {
  position: absolute;
  top: 50%;
  right: 15%;
  transform: translate(50%, -50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-red-glow) 0%, rgba(0,0,0,0) 70%);
  z-index: 0;
  pointer-events: none;
  filter: blur(40px);
  animation: pulse-glow 8s infinite alternate ease-in-out;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 40px;
  z-index: 1;
  position: relative;
}

.hero-content {
  display: flex;
  flex-direction: column;
}

.hero-headline {
  font-family: var(--font-title);
  font-size: 5rem;
  line-height: 0.95;
  letter-spacing: 1px;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.hero-headline span.red-glow-text {
  color: var(--accent-red);
  text-shadow: 0 0 10px rgba(175, 1, 1, 0.4);
}

.hero-subheadline {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1.5rem;
  letter-spacing: 3px;
  margin-bottom: 24px;
  color: var(--text-secondary);
}

.hero-subheadline-highlight {
  color: #fff;
  font-weight: 700;
  border-bottom: 2px solid var(--accent-red);
  padding-bottom: 2px;
}

/* Martyric Font Simulator for creative emphasis */
.hero-subheadline em {
  font-style: normal;
  color: #ccc;
  border-bottom: none;
  padding-bottom: 0;
}

/* Trust Indicators */
.hero-stats {
  display: flex;
  gap: 40px;
  margin-bottom: 40px;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: var(--font-title);
  font-size: 3rem;
  color: var(--accent-red);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-family: var(--font-alt);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Hero CTAs */
.hero-ctas {
  display: flex;
  gap: 20px;
}

.hero-ctas .btn-primary {
  padding: 14px 32px;
  border-radius: 4px;
  font-size: 1.15rem;
}

.hero-ctas .btn-secondary {
  padding: 14px 32px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-primary);
  font-family: var(--font-title);
  font-size: 1.15rem;
  letter-spacing: 1px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.hero-ctas .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-red);
  color: var(--accent-red);
  transform: translateY(-2px);
}

/* 3D Character Canvas Container */
.hero-avatar-container {
  position: relative;
  width: 100%;
  height: 550px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-avatar-canvas {
  width: 100%;
  height: 100%;
  outline: none;
  cursor: grab;
}

.hero-avatar-canvas:active {
  cursor: grabbing;
}

/* --- Section Heading --- */
.section-header {
  margin-bottom: 50px;
  position: relative;
  z-index: 10;
}

.section-title {
  font-family: var(--font-title);
  font-size: 3.5rem;
  letter-spacing: 2px;
  line-height: 1;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.section-subtitle {
  font-size: 1.1rem;
  letter-spacing: 2px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* --- Portfolio/Work Section --- */
#work {
  padding: 100px 0;
  position: relative;
  background: var(--bg-black);
}

/* Category Filter Bar */
.filter-bar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  list-style: none;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border-grey);
  color: var(--text-secondary);
  font-family: var(--font-title);
  font-size: 1.1rem;
  padding: 8px 20px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 1px;
}

.filter-btn.active, .filter-btn:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: var(--text-primary);
  box-shadow: 0 0 15px rgba(175, 1, 1, 0.3);
}

/* Bento Grid System */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 220px;
  gap: 24px;
}

.portfolio-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Bento Sizing Configurations */
.card-size-wide {
  grid-column: span 8;
  grid-row: span 2;
}

.card-size-tall {
  grid-column: span 4;
  grid-row: span 2;
}

.card-size-normal {
  grid-column: span 4;
  grid-row: span 1;
}

.card-size-medium {
  grid-column: span 6;
  grid-row: span 2;
}

.portfolio-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 60%, rgba(0,0,0,0.1) 100%);
  z-index: 1;
  transition: opacity 0.3s ease;
}

/* Frosted glass texture using GLi2TCh style */
.portfolio-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('LoGo/GLi2TCh.png');
  background-size: cover;
  background-position: center;
  mix-blend-mode: overlay;
  opacity: 0.05;
  z-index: 0;
  transition: opacity 0.5s ease;
}

/* Thumbnail and Loop Video */
.card-bg-wrap {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.card-bg-wrap::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%);
  z-index: 2;
  transition: transform 0.3s ease, background 0.3s ease;
}

.card-bg-wrap::after {
  content: '\f04b';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.92);
  font-size: 1.25rem;
  z-index: 3;
  pointer-events: none;
}

.card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.portfolio-card:hover .card-bg-wrap::before {
  transform: translate(-50%, -50%) scale(1.08);
  background: rgba(0, 0, 0, 0.65);
}

.card-video-loop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.portfolio-card:hover .card-thumbnail {
  transform: scale(1.08);
}

.portfolio-card:hover .card-video-loop {
  opacity: 1;
}

.portfolio-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-red);
  box-shadow: 0 10px 30px rgba(175, 1, 1, 0.15);
}

/* Card Content Details */
.card-details {
  position: relative;
  z-index: 2;
  transition: transform 0.3s ease;
}

.card-category {
  font-family: var(--font-alt);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-red);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.card-title {
  font-family: var(--font-title);
  font-size: 1.8rem;
  letter-spacing: 1px;
  line-height: 1.1;
  text-transform: uppercase;
}

/* Stagger Animation on filtering */
.portfolio-card.fade-out {
  opacity: 0;
  transform: scale(0.95);
  pointer-events: none;
  display: none;
}

.portfolio-card.fade-in {
  opacity: 1;
  transform: scale(1);
  display: flex;
}

/* --- Full Screen Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  padding: 40px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-container {
  position: relative;
  width: min(98vw, 1180px);
  max-width: 1180px;
  max-height: 95vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: translateY(30px);
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  overflow-y: auto;
  border-radius: 8px;
  padding-right: 8px;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  min-height: 56vh;
  background: #000;
  border: 1px solid var(--border-grey);
  border-radius: 6px;
  overflow: hidden;
}

.modal-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-video-wrap iframe,
.modal-video-wrap video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border: 0;
}

.modal-media-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  min-height: 56vh;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
}

.modal-media-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Case Study Content */
.modal-info-card {
  padding: 24px;
  border-radius: 6px;
}

.modal-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border-grey);
  padding-bottom: 16px;
}

.meta-field-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  letter-spacing: 1px;
  color: var(--accent-red);
  margin-bottom: 4px;
}

.meta-field-val {
  font-family: var(--font-alt);
  font-size: 0.95rem;
  color: var(--text-primary);
}

.modal-description-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.modal-description-body {
  font-family: var(--font-alt);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Custom Modal X Close Button */
.modal-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--glass-bg);
  border: 1px solid var(--border-grey);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  color: var(--text-primary);
}

.modal-close-btn:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
  color: var(--text-primary);
  transform: rotate(90deg);
  box-shadow: 0 0 10px var(--accent-red-glow);
}

/* --- About Me Section --- */
#about {
  padding: 100px 0;
  background: var(--bg-black);
  position: relative;
  overflow: hidden;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 60px;
  align-items: center;
}

.about-visual {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0,0,0,0.6);
  border: 1px solid var(--border-grey);
  aspect-ratio: 4/5;
}

.about-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(20%) contrast(110%);
  transition: transform 0.5s ease;
}

.about-visual:hover .about-photo {
  transform: scale(1.02);
}

/* About Narrative Content */
.about-content {
  display: flex;
  flex-direction: column;
}

.about-text {
  font-family: var(--font-alt);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.about-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Skill Badges Duality (Engineering & Creative Art) */
.skills-duality {
  margin-top: 20px;
  margin-bottom: 30px;
}

.duality-title {
  font-family: var(--font-title);
  font-size: 1.4rem;
  letter-spacing: 1px;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.skill-badge {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--border-grey);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.skill-badge.tech-badge {
  border-left: 3px solid #00E5FF;
}

.skill-badge.art-badge {
  border-left: 3px solid var(--accent-red);
}

.skill-badge:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
}

/* Edu-Mission Callout Box */
.edu-mission-banner {
  padding: 24px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  border-left: 4px solid var(--accent-red);
}

.edu-mission-title {
  font-family: var(--font-title);
  font-size: 1.3rem;
  letter-spacing: 1px;
  color: var(--accent-red);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.edu-mission-text {
  font-family: var(--font-alt);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* --- Tools of the Craft Section --- */
#tools {
  padding: 100px 0;
  background: linear-gradient(180deg, rgba(8,8,8,.96), rgba(12,12,12,.98));
  position: relative;
  overflow: hidden;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(240px, 1fr));
  gap: 28px;
}

.tool-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  padding: 28px;
  min-height: 240px;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.tool-card:hover {
  transform: translateY(-8px);
  border-color: rgba(175,1,1,0.22);
  background: rgba(255,255,255,0.04);
}

.tool-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background-size: 80% 80%;
  background-position: center;
  background-repeat: no-repeat;
  margin-bottom: 22px;
}

.tool-card-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-red);
  margin-bottom: 10px;
}

#tools .section-title {
  color: var(--accent-red);
}

.tool-card-meta {
  display: block;
  font-family: var(--font-alt);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.tool-skill-bar {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}

.tool-skill-level {
  display: block;
  height: 100%;
  border-radius: 999px;
  width: 0;
  transform-origin: left center;
  animation: none;
  background: linear-gradient(90deg, rgba(175,1,1,0.95), rgba(255,255,255,0.14));
}

.tool-skill-level.animate {
  animation: fillBar 3s ease forwards;
}

@keyframes fillBar {
  to { width: var(--fill-width); }
}

@media (max-width: 960px) {
  .tools-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 660px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Services Section --- */
#services {
  padding: 100px 0;
  background: var(--bg-black);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.service-card {
  padding: 40px 24px;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-grey);
}

.service-icon-box {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: rgba(175, 1, 1, 0.08);
  border: 1px solid var(--accent-red-dim);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
  font-size: 1.8rem;
  color: var(--accent-red);
  transition: all 0.4s ease;
}

.service-title {
  font-family: var(--font-title);
  font-size: 1.8rem;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.service-desc {
  font-family: var(--font-alt);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 20px;
}

.service-learn-more {
  margin-top: auto;
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--accent-red);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
  transition: gap 0.3s ease;
}

.service-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-red);
  box-shadow: 0 10px 25px rgba(175, 1, 1, 0.2);
}

.service-card:hover .service-icon-box {
  background: var(--accent-red);
  color: var(--text-primary);
  box-shadow: 0 0 15px var(--accent-red-glow);
}

/* --- Testimonials Section --- */
#testimonials {
  padding: 100px 0;
  background: var(--bg-black);
}

.testimonial-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 24px 32px;
  margin-bottom: 40px;
  border-radius: 24px;
  border: 1px solid var(--border-grey);
}

.rating-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.rating-score {
  font-family: var(--font-title);
  font-size: 4rem;
  letter-spacing: 1px;
  color: var(--accent-red);
}

.rating-label {
  font-size: 0.95rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.rating-details {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.rating-stars {
  color: #f4c150;
  font-size: 1.1rem;
}

.rating-count {
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.testimonial-carousel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.testimonial-slide {
  display: none;
  padding: 0;
}

.testimonial-slide.active {
  display: block;
}

.testimonial-card {
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.testimonial-image-frame {
  width: 100%;
  min-height: 420px;
  overflow: hidden;
  background: #111;
}

.testimonial-full-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.testimonial-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  background: rgba(0, 0, 0, 0.75);
}

.testimonial-stars {
  color: #f4c150;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.testimonial-rating-label {
  font-family: var(--font-title);
  font-size: 1rem;
  text-transform: uppercase;
  color: var(--accent-red);
  letter-spacing: 1px;
}

.testimonial-name {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: 1px;
  text-transform: uppercase;
}

@media (max-width: 1080px) {
  .testimonial-card-footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .testimonial-image-frame {
    min-height: 320px;
  }

  .testimonial-card-footer {
    padding: 18px 18px;
  }
}

.testimonial-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.testimonial-nav-btn {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--border-grey);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.testimonial-nav-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent-red);
  box-shadow: 0 10px 20px rgba(175, 1, 1, 0.18);
}

.testimonial-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.testimonial-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  cursor: pointer;
}

.testimonial-dot.active {
  background: var(--accent-red);
  border-color: var(--accent-red);
}

@media (max-width: 1080px) {
  .testimonial-slide.active {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .testimonial-slide.active {
    gap: 24px;
  }

  .testimonial-image-frame {
    min-height: 320px;
  }

  .testimonial-carousel-controls {
    flex-direction: column;
  }
}

.service-card:hover .service-learn-more {
  gap: 12px;
}

/* Service Popup Details Overlay */
.service-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 2100;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.service-popup-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.service-popup {
  width: 100%;
  max-width: 500px;
  padding: 40px 32px;
  border-radius: 12px;
  border: 1px solid var(--border-grey);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  text-align: left;
  position: relative;
}

.service-popup-overlay.active .service-popup {
  transform: scale(1);
}

.service-popup-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  letter-spacing: 1px;
  color: var(--text-primary);
  margin-bottom: 20px;
  border-bottom: 2px solid var(--accent-red);
  padding-bottom: 8px;
}

.service-inclusion-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.service-inclusion-item {
  font-family: var(--font-alt);
  font-size: 1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
}

.service-inclusion-item i {
  color: var(--accent-red);
  font-size: 1.1rem;
}

.popup-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: transparent;
  border: none;
  font-size: 1.3rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s ease;
}

.popup-close-btn:hover {
  color: var(--accent-red);
}

/* --- Contact Section --- */
#contact {
  padding: 100px 0;
  background: var(--bg-black);
  position: relative;
}

/* Faint Watermark of Logo as Background */
.contact-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  background-image: url('LoGo/GLiTCh.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.02;
  pointer-events: none;
  z-index: 0;
}

.contact-container {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
}

.direct-call-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-title);
  font-size: 1.8rem;
  letter-spacing: 1.5px;
  padding: 16px 36px;
  border-radius: 8px;
  text-decoration: none;
  margin-bottom: 35px;
  background: var(--accent-red);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  cursor: pointer;
}

.direct-call-btn:hover {
  background: #d40101;
  box-shadow: 0 0 25px var(--accent-red-glow);
  transform: translateY(-3px) scale(1.02);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: left;
}

.form-group-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.form-input, .form-textarea, .form-select {
  background: transparent;
  border: 1px solid var(--border-grey);
  border-radius: 4px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-alt);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.form-select option {
  background-color: var(--dark-grey);
  color: var(--text-primary);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--accent-red);
  box-shadow: 0 0 10px rgba(175, 1, 1, 0.2);
}

.contact-btn {
  margin-top: 10px;
  padding: 16px;
  border-radius: 4px;
  font-size: 1.15rem;
}

.contact-note {
  font-family: var(--font-alt);
  font-size: 0.85rem;
  color: var(--text-dimmed);
  margin-top: 20px;
  letter-spacing: 0.5px;
}

/* Footer Section */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--border-grey);
  background: var(--bg-black);
}

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

.footer-copy {
  font-family: var(--font-alt);
  font-size: 0.85rem;
  color: var(--text-dimmed);
}

/* --- Floating Elements --- */

/* Vertical Social Capsule */
.social-capsule {
  position: fixed;
  left: 30px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 12px;
  border-radius: 30px;
  z-index: 100;
  border: 1px solid var(--glass-border);
}

.social-icon-link {
  color: var(--text-primary);
  font-size: 1.25rem;
  text-decoration: none;
  transition: all 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

.social-icon-link:hover {
  color: var(--accent-red);
  transform: scale(1.25);
}

/* Floating WhatsApp Button */
.whatsapp-floating {
  position: fixed;
  right: 30px;
  bottom: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--dark-grey);
  border: 2px solid var(--border-grey);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
  z-index: 100;
  color: var(--accent-red);
  font-size: 1.8rem;
  box-shadow: 0 5px 20px rgba(0,0,0,0.5);
  transition: all 0.3s ease;
  animation: pulse-ring 2s infinite;
}

.whatsapp-floating:hover {
  background: var(--accent-red);
  color: var(--text-primary);
  border-color: var(--accent-red);
  box-shadow: 0 0 20px var(--accent-red-glow);
  transform: translateY(-3px) scale(1.05);
}

/* --- Arabic Localization Rules --- */
.rtl-lang {
  direction: rtl;
}

.rtl-lang body {
  font-family: var(--font-arabic), var(--font-body);
}


.rtl-lang .nav-link, 
.rtl-lang .section-title, 
.rtl-lang .section-subtitle, 
.rtl-lang .hero-headline,
.rtl-lang .hero-subheadline,
.rtl-lang .hero-subheadline em,
.rtl-lang .stat-number,
.rtl-lang .glow-btn,
.rtl-lang .direct-call-btn,
.rtl-lang .service-title,
.rtl-lang .service-learn-more,
.rtl-lang .modal-description-title,
.rtl-lang .meta-field-title,
.rtl-lang .edu-mission-title,
.rtl-lang .filter-btn,
.rtl-lang .duality-title {
  font-family: var(--font-arabic);
  letter-spacing: normal;
}

.rtl-lang .duality-title {
  color: var(--accent-red);
}

.rtl-lang #about .section-subtitle {
  color: var(--accent-red);
  margin-top: 18px;
}

.rtl-lang .hero-headline {
  font-size: 4rem;
  line-height: 1.2;
}

.rtl-lang .direct-call-btn {
  direction: ltr;
}

/* --- KEYFRAME ANIMATIONS --- */
@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(175, 1, 1, 0.4);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(175, 1, 1, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(175, 1, 1, 0);
  }
}

@keyframes pulse-glow {
  0% {
    opacity: 0.8;
    transform: translate(50%, -50%) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate(50%, -50%) scale(1.1);
  }
}

/* Glitch ripple animation simulator for images */
.glitch-active {
  animation: glitch-anim 0.3s ease;
}

@keyframes glitch-anim {
  0% {
    clip-path: inset(40% 0 61% 0);
    transform: skew(0.3deg);
  }
  20% {
    clip-path: inset(92% 0 1% 0);
    transform: skew(-0.5deg);
  }
  40% {
    clip-path: inset(15% 0 80% 0);
    transform: skew(0.5deg);
  }
  60% {
    clip-path: inset(80% 0 5% 0);
    transform: skew(-0.3deg);
  }
  80% {
    clip-path: inset(5% 0 92% 0);
    transform: skew(0.2deg);
  }
  100% {
    clip-path: inset(0 0 0 0);
    transform: skew(0deg);
  }
}

/* --- RESPONSIVE DESIGN --- */

@media (max-width: 1200px) {
  .hero-headline {
    font-size: 4rem;
  }
  .bento-grid {
    grid-auto-rows: 180px;
  }
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 991px) {
  .container {
    padding: 0 24px;
  }
  
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 50px;
    text-align: center;
  }
  
  .hero-content {
    align-items: center;
  }
  
  .hero-stats {
    justify-content: center;
  }
  
  .hero-avatar-container {
    height: 450px;
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .about-visual {
    max-width: 500px;
    margin: 0 auto;
  }
  
  .social-capsule {
    display: none; /* Hidden on mobile */
  }
  
  /* Mobile Navigation Hamburger Menu Open Layout */
  .hamburger {
    display: block;
  }
  
  .nav-menu {
    position: fixed;
    top: 80px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 80px);
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    gap: 40px;
    transition: left 0.4s ease;
    border-top: 1px solid var(--border-grey);
    z-index: 999;
  }
  
  .nav-menu.open {
    left: 0;
  }
  
  .nav-link {
    font-size: 2rem;
  }
  
  /* Include social links inside hamburger menu as specified */
  .nav-mobile-socials {
    display: flex;
    gap: 30px;
    margin-top: 20px;
  }
  
  .nav-mobile-socials a {
    color: var(--text-primary);
    font-size: 1.8rem;
    transition: color 0.3s;
  }
  
  .nav-mobile-socials a:hover {
    color: var(--accent-red);
  }
}

@media (max-width: 768px) {
  .hero-headline {
    font-size: 3rem;
  }
  
  .bento-grid {
    display: flex;
    flex-direction: column;
  }
  
  .portfolio-card {
    height: 250px;
  }
  
  .services-grid {
    grid-template-columns: 1fr;
  }
  
  .form-group-row {
    grid-template-columns: 1fr;
  }
  
  .direct-call-btn {
    font-size: 1.4rem;
    padding: 12px 24px;
  }
  
  .modal-meta-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .modal-overlay {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .hero-headline {
    font-size: 2.4rem;
  }
  .hero-ctas {
    flex-direction: column;
    width: 100%;
  }
  .hero-ctas button, .hero-ctas a {
    text-align: center;
    width: 100%;
  }
  .header-cta {
    display: none; /* Hide CTA text on header for extra small mobile */
  }
}
