/* =========================================================
   MAHMOUD OUADI PORTFOLIO — PREMIUM CINEMATIC DESIGN SYSTEM
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,700;0,900;1,700&family=Space+Grotesk:wght@300;400;500;600;700;800&display=swap');

/* ---------- CSS VARIABLES ---------- */
:root {
  --red:         #C23B22;
  --red-light:   #ff6b4a;
  --red-glow:    rgba(194, 59, 34, 0.4);
  --sand:        #d4b896;
  --sand-muted:  rgba(212, 184, 150, 0.6);
  --dark:        #060608;
  --dark-2:      rgba(6,6,10,0.92);
  --glass:       rgba(255,255,255,0.04);
  --glass-border:rgba(255,255,255,0.09);
  --glass-hover: rgba(255,255,255,0.08);
  --text:        #f0ede8;
  --text-muted:  rgba(240,237,232,0.55);
  --text-dim:    rgba(240,237,232,0.3);
}

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Space Grotesk', -apple-system, sans-serif;
  background: var(--dark);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--red);
  color: #fff;
}

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: var(--dark); }
::-webkit-scrollbar-thumb { background: var(--red); border-radius: 2px; }

/* ---------- GLOBAL FIXED BG PARALLAX ---------- */
/* The beach image stays fixed — content scrolls over it */
.site-bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: url('../images/custom-bg.jpg');
  background-size: cover;
  background-position: center 30%;
}

.site-bg-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  /* Dark overlay = 60% opacity → image visible at 40% */
  background: linear-gradient(
    160deg,
    rgba(6, 6, 10, 0.88) 0%,
    rgba(6, 6, 10, 0.62) 50%,
    rgba(6, 6, 10, 0.82) 100%
  );
}

/* Subtle animated noise grain */
.site-bg-layer::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  opacity: 0.35;
  pointer-events: none;
}

/* Everything above the bg */
body > * { position: relative; z-index: 1; }
header  { z-index: 50 !important; }

/* ---------- TYPOGRAPHY ---------- */
.font-display  { font-family: 'Playfair Display', Georgia, serif; }
.font-grotesk  { font-family: 'Space Grotesk', sans-serif; }
.font-bebas    { font-family: 'Bebas Neue', sans-serif; letter-spacing: 0.06em; }
.font-mono-num { font-family: 'Bebas Neue', sans-serif; font-size: 0.7em; opacity: 0.2; letter-spacing: 0.1em; }

/* ---------- GLASSMORPHISM PANELS ---------- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 1.25rem;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass:hover {
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.14);
}

.glass-dark {
  background: rgba(6,6,10,0.72);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--glass-border);
}

.glass-nav {
  background: rgba(6,6,10,0.80);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Red accent glow border */
.glass-red {
  border-color: rgba(194, 59, 34, 0.35);
  box-shadow: 0 0 0 1px rgba(194, 59, 34, 0.15), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* ---------- BUTTONS ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.75rem;
  border-radius: 100px;
  background: var(--red);
  color: #fff;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 20px rgba(194,59,34,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
  text-decoration: none;
}

.btn-primary:hover {
  background: #d94928;
  box-shadow: 0 8px 32px rgba(194,59,34,0.55), inset 0 1px 0 rgba(255,255,255,0.2);
  transform: translateY(-2px) scale(1.02);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.75rem;
  border-radius: 100px;
  background: transparent;
  color: var(--text);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  backdrop-filter: blur(12px);
}

.btn-ghost:hover {
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

/* ---------- TAGS / BADGES ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tag-red {
  background: rgba(194,59,34,0.18);
  color: var(--red-light);
  border: 1px solid rgba(194,59,34,0.35);
}

.tag-sand {
  background: rgba(212,184,150,0.12);
  color: var(--sand);
  border: 1px solid rgba(212,184,150,0.25);
}

.tag-white {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.12);
}

/* ---------- SECTION HEADINGS ---------- */
.section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--red-light);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-label::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1.5px;
  background: var(--red);
}

/* ---------- PHOTO CARDS ---------- */
.photo-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.45s ease, border-color 0.3s ease;
}

.photo-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(194,59,34,0.3);
  border-color: rgba(194,59,34,0.4);
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  display: block;
}

.photo-card:hover img {
  transform: scale(1.07);
}

.photo-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6,6,10,0.95) 0%, rgba(6,6,10,0.3) 55%, transparent 100%);
  transition: opacity 0.35s ease;
}

.photo-card:hover .photo-card-overlay {
  opacity: 0.95;
}

/* ---------- DIVIDER LINE ---------- */
.hr-red {
  display: inline-block;
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, var(--red), transparent);
  border-radius: 1px;
}

/* ---------- LIGHTBOX ---------- */
#lightboxModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 1rem;
}

#lightboxModal.open {
  display: flex;
}

#lightboxModal img {
  max-height: 80vh;
  max-width: 90vw;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 30px 80px rgba(0,0,0,0.8);
}

/* ---------- SCROLL FADE-IN ANIMATION ---------- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ---------- STAT NUMBER ---------- */
.stat-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3rem;
  line-height: 1;
  background: linear-gradient(135deg, #fff 40%, var(--red-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- HORIZONTAL SCROLL BTS STRIP ---------- */
.bts-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.bts-scroll::-webkit-scrollbar { display: none; }

.bts-item {
  flex: 0 0 clamp(240px, 75vw, 280px);
  scroll-snap-align: start;
  height: clamp(300px, 60vh, 360px);
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
}

.bts-item:hover {
  transform: scale(1.03);
  box-shadow: 0 16px 48px rgba(0,0,0,0.6), 0 0 0 1px rgba(194,59,34,0.4);
  border-color: rgba(194,59,34,0.45);
}

.bts-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.bts-item:hover img { transform: scale(1.06); }

.bts-item-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.25rem 1rem;
  background: linear-gradient(to top, rgba(6,6,10,0.98) 0%, transparent 100%);
}

/* ---------- GALLERY FILTER BUTTONS ---------- */
.filter-btn {
  padding: 0.45rem 1.1rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }

.filter-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  box-shadow: 0 4px 16px rgba(194,59,34,0.4);
}

/* ---------- CONTACT CARD ---------- */
.contact-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.contact-card:hover {
  border-color: rgba(194,59,34,0.45);
  background: rgba(194,59,34,0.07);
  transform: translateX(4px);
  box-shadow: -4px 0 0 var(--red);
}

/* ---------- SKILL CARD ---------- */
.skill-card {
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(20px);
  transition: all 0.35s cubic-bezier(0.16,1,0.3,1);
  position: relative;
  overflow: hidden;
}

.skill-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.skill-card:hover {
  border-color: rgba(194,59,34,0.35);
  background: rgba(194,59,34,0.05);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}

.skill-card:hover::before {
  opacity: 1;
}

/* ---------- CLIENT CARD ---------- */
.client-card {
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
}

.client-card:hover {
  background: var(--glass-hover);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-3px);
}

/* ---------- SECTION BG ACCENTS ---------- */
.section-glow-left {
  position: absolute;
  left: -15%;
  top: 10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(194,59,34,0.12) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(40px);
}

.section-glow-right {
  position: absolute;
  right: -10%;
  bottom: 5%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(194,59,34,0.09) 0%, transparent 70%);
  pointer-events: none;
  filter: blur(50px);
}

/* ---------- HORIZONTAL SEPARATOR ---------- */
.section-sep {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  padding: 0.85rem 1.4rem;
  border-radius: 0.875rem;
  background: var(--red);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 12px 40px rgba(194,59,34,0.45);
  animation: slideUp 0.35s cubic-bezier(0.16,1,0.3,1) forwards;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
