/* ============================================================
   Mohamed Saad Taha — Personal Brand Platform
   Design: High-Energy Cinematic Creative
   Bold motion, expressive type, filmmaker aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600&family=Cairo:wght@300;400;500;600;700&family=Reem+Kufi:wght@400;600;700&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:         #080808;
  --surface:    #111111;
  --surface-2:  #1a1a1a;
  --surface-3:  #222222;
  --border:     #2c2c2c;
  --border-2:   #383838;
  --text:       #f5f0e8;
  --text-muted: #8a8680;
  --text-dim:   #4a4845;

  /* Signature accent palette */
  --red:        #e8321a;
  --red-dim:    rgba(232,50,26,0.12);
  --red-glow:   rgba(232,50,26,0.35);
  --gold:       #c9a84c;
  --gold-dim:   rgba(201,168,76,0.12);
  --cream:      #f5f0e8;

  --display:    'Bebas Neue', 'Impact', sans-serif;
  --sans:       'Outfit', system-ui, sans-serif;
  --sans-ar:    'Cairo', 'Reem Kufi', system-ui, sans-serif;
  --serif-ar:   'Reem Kufi', 'Cairo', system-ui, sans-serif;

  --radius:     4px;
  --radius-lg:  10px;
  --ease:       cubic-bezier(0.16, 1, 0.3, 1);
  --t:          0.28s;
  --max-w:      1200px;
  --nav-h:      68px;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ── Typography ────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
h4 { font-family: var(--sans); font-weight: 600; line-height: 1.3; }
h1 { font-size: clamp(3.5rem, 10vw, 9rem); }
h2 { font-size: clamp(2.5rem, 6vw, 5.5rem); }
h3 { font-size: clamp(1.6rem, 3vw, 2.5rem); }
p  { margin-bottom: 1.2em; }
p:last-child { margin-bottom: 0; }

/* ── Layout ─────────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 32px; }
.section    { padding: 100px 0; }

/* ── NAV ────────────────────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100; height: var(--nav-h);
  background: rgba(8,8,8,0.92);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-container {
  max-width: var(--max-w); margin: 0 auto; padding: 0 32px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--display);
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  transition: color var(--t);
}
.nav-logo:hover { color: var(--red); }
.nav-logo .dot { color: var(--red); }

.nav-links { list-style: none; display: flex; align-items: center; gap: 36px; }
.nav-links a {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color var(--t);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: -4px; left: 0; right: 0;
  height: 1px; background: var(--red);
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--t) var(--ease);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a:hover::after, .nav-links a.active::after { transform: scaleX(1); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 4px; }
.nav-toggle span { display: block; width: 24px; height: 1.5px; background: var(--text); transition: var(--t); }

/* Language Toggle */
.lang-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--sans-ar);
  font-size: 0.78rem; font-weight: 600;
  cursor: pointer; text-decoration: none;
  transition: all var(--t);
  flex-shrink: 0;
}
.lang-toggle:hover {
  border-color: var(--red); color: var(--red); background: var(--red-dim);
}

/* ── MAIN ───────────────────────────────────────────────────── */
.site-main { padding-top: var(--nav-h); }

/* ── HERO ───────────────────────────────────────────────────── */
.hero {
  min-height: calc(95vh - var(--nav-h));
  display: grid; grid-template-columns: 1fr 1fr;
  align-items: stretch; overflow: hidden;
}
.hero-left {
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 80px 60px 80px 32px;
  position: relative; z-index: 2;
}
.hero-right {
  position: relative; overflow: hidden;
  background: var(--surface);
}
.hero-right::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(232,50,26,0.15) 0%, transparent 60%);
  z-index: 1;
}
.hero-reel {
  position: absolute; inset: 0;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 60px,
      rgba(255,255,255,0.015) 60px,
      rgba(255,255,255,0.015) 61px
    ),
    linear-gradient(160deg, #1a0a05 0%, #0d0d0d 50%, #050510 100%);
}
/* Animated film grain */
.hero-right::after {
  content: '';
  position: absolute; inset: -50%;
  width: 200%; height: 200%;
  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.08'/%3E%3C/svg%3E");
  opacity: 0.4; z-index: 2;
  animation: grain 0.5s steps(2) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  25%      { transform: translate(-2%,1%); }
  50%      { transform: translate(1%,-2%); }
  75%      { transform: translate(2%,1%); }
}

.hero-number {
  font-family: var(--display);
  font-size: clamp(8rem, 18vw, 22rem);
  line-height: 0.85;
  color: transparent;
  -webkit-text-stroke: 1px rgba(232,50,26,0.3);
  position: absolute; bottom: -2rem; right: -1rem;
  z-index: 3; pointer-events: none;
  user-select: none;
}

.hero-eyebrow {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px;
}
.hero-eyebrow::before {
  content: ''; display: block;
  width: 32px; height: 1px; background: var(--red);
}
.hero h1 { color: var(--text); margin-bottom: 28px; line-height: 0.92; }
.hero h1 .highlight {
  color: transparent;
  -webkit-text-stroke: 2px var(--red);
  display: block;
}
.hero-sub {
  font-size: 1rem; color: var(--text-muted);
  max-width: 420px; margin-bottom: 48px; line-height: 1.75;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

/* ── BUTTONS ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px;
  font-family: var(--sans); font-size: 0.78rem;
  font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  border-radius: var(--radius);
  cursor: pointer; transition: all var(--t) var(--ease);
  text-decoration: none; border: none; white-space: nowrap;
}
.btn-primary {
  background: var(--red); color: #fff;
  box-shadow: 0 0 0 0 var(--red-glow);
}
.btn-primary:hover {
  background: #ff3d20;
  transform: translateY(-2px);
  box-shadow: 0 12px 40px var(--red-glow);
}
.btn-outline {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-2);
}
.btn-outline:hover {
  border-color: var(--text-dim); background: var(--surface-2);
}
.btn-gold {
  background: var(--gold); color: #080808;
}
.btn-gold:hover { background: #d4b05a; transform: translateY(-2px); }

/* ── SECTION LABEL ──────────────────────────────────────────── */
.section-label {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--red); margin-bottom: 16px;
}
.section-label::before {
  content: ''; display: block;
  width: 28px; height: 1px; background: var(--red);
}
.section-num {
  font-family: var(--display);
  font-size: 0.85rem; color: var(--border-2);
  letter-spacing: 0.05em;
}

/* ── CARDS ──────────────────────────────────────────────────── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px,1fr)); gap: 2px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: border-color var(--t);
  display: flex; flex-direction: column;
  position: relative;
}
.card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--red-dim), transparent);
  opacity: 0; transition: opacity var(--t);
}
.card:hover { border-color: var(--red); }
.card:hover::before { opacity: 1; }
.card-image { aspect-ratio: 16/9; overflow: hidden; background: var(--surface-2); }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.card:hover .card-image img { transform: scale(1.06); }
.card-body { padding: 28px; flex: 1; display: flex; flex-direction: column; position: relative; z-index: 1; }
.card-meta {
  font-size: 0.68rem; color: var(--red);
  letter-spacing: 0.14em; text-transform: uppercase;
  margin-bottom: 10px; font-weight: 500;
}
.card-title {
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  color: var(--text); margin-bottom: 12px;
  letter-spacing: 0.03em; text-transform: uppercase;
  line-height: 1.0;
}
.card-excerpt { font-size: 0.88rem; color: var(--text-muted); line-height: 1.7; flex: 1; }
.card-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--red); margin-top: 24px;
  transition: gap var(--t);
}
.card-link:hover { gap: 14px; }
.card-link::after { content: '→'; }
.tool-tag {
  display: inline-block; font-size: 0.65rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold); background: var(--gold-dim);
  padding: 3px 10px; border-radius: 2px; margin-bottom: 12px;
  border: 1px solid rgba(201,168,76,0.2);
}

/* ── POST CONTENT ───────────────────────────────────────────── */
.post-header { padding: 80px 0 40px; }
.post-header h1 { font-size: clamp(2.5rem, 6vw, 5rem); max-width: 900px; }
.post-meta { color: var(--text-dim); font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; margin-top: 16px; }
.post-featured-img { width: 100%; aspect-ratio: 21/9; object-fit: cover; margin-bottom: 60px; }
.post-content { max-width: 740px; }
.post-content h2, .post-content h3 { margin: 2em 0 0.75em; color: var(--text); }
.post-content h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
.post-content h3 { font-size: clamp(1.2rem, 2vw, 1.8rem); }
.post-content p { color: var(--text-muted); font-size: 1.05rem; line-height: 1.8; }
.post-content a { color: var(--red); text-decoration: underline; text-underline-offset: 3px; }
.post-content ul, .post-content ol { padding-left: 1.5em; margin-bottom: 1.2em; color: var(--text-muted); }
.post-content li { margin-bottom: 0.5em; }
.post-content blockquote {
  border-left: 3px solid var(--red); padding-left: 24px;
  margin: 2.5em 0; color: var(--text-muted);
  font-style: italic; font-size: 1.15rem;
}
.post-content pre {
  background: var(--surface); border: 1px solid var(--border);
  padding: 24px; overflow-x: auto; margin: 1.5em 0;
  font-size: 0.875rem; border-radius: var(--radius);
}
.post-content code { font-family: monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 3px; font-size: 0.875em; }
.post-content pre code { background: none; padding: 0; }

/* ── PAGE HERO ──────────────────────────────────────────────── */
.page-hero {
  padding: 80px 0 60px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 70px; position: relative; overflow: hidden;
}
.page-hero::after {
  content: attr(data-num);
  font-family: var(--display);
  font-size: 18rem; line-height: 1;
  position: absolute; right: 0; top: -2rem;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.03);
  pointer-events: none; user-select: none;
}
.page-hero h1 { margin-bottom: 16px; }
.page-hero p { color: var(--text-muted); font-size: 1.05rem; max-width: 560px; }

/* ── TOOL RENDERER ──────────────────────────────────────────── */
.tool-wrapper {
  background: var(--surface); border: 1px solid var(--border);
  border-top: 3px solid var(--red); min-height: 400px;
}
.tool-frame { padding: 40px; }

/* ── CONTACT FORM ───────────────────────────────────────────── */
.contact-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 80px; align-items: start; }
.contact-info h2 { font-size: clamp(2rem, 4vw, 3.5rem); margin-bottom: 20px; }
.contact-detail {
  display: flex; align-items: center; gap: 14px;
  margin-top: 20px; color: var(--text-muted); font-size: 0.9rem;
}
.contact-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red); flex-shrink: 0;
}

/* ── FORM ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block; font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 8px;
}
.form-hint { font-size: 0.72rem; color: var(--text-dim); margin-top: 5px; letter-spacing: 0; text-transform: none; }
.form-input, .form-textarea, .form-select {
  width: 100%; background: var(--surface);
  border: 1px solid var(--border); border-bottom: 1px solid var(--border-2);
  color: var(--text); font-family: var(--sans); font-size: 0.95rem;
  padding: 13px 16px; outline: none; transition: border-color var(--t);
  border-radius: var(--radius);
}
.form-input:focus, .form-textarea:focus { border-color: var(--red); }
.form-textarea { resize: vertical; min-height: 140px; }
.form-textarea.tall { min-height: 320px; font-family: monospace; font-size: 0.82rem; }

/* ── ABOUT ──────────────────────────────────────────────────── */
.about-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 80px; align-items: start; }
.about-img-wrap { position: relative; }
.about-img-wrap img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.about-img-wrap::before {
  content: ''; position: absolute;
  inset: 16px -16px -16px 16px;
  border: 1px solid var(--red); opacity: 0.4; z-index: -1;
}
.about-img-placeholder {
  width: 100%; aspect-ratio: 3/4; background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem; color: var(--text-dim);
  border: 1px solid var(--border);
}

/* ── DIVIDER ────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 0; }

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 100px 20px; color: var(--text-dim); }
.empty-state h3 { font-family: var(--display); font-size: 2rem; color: var(--text-muted); margin-bottom: 8px; }

/* ── BREADCRUMB ─────────────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.7rem; font-weight: 500;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 28px;
}
.breadcrumb a { color: var(--text-dim); transition: color var(--t); }
.breadcrumb a:hover { color: var(--text-muted); }
.breadcrumb span::before { content: '/'; margin-right: 10px; }

/* ── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border); padding: 60px 0; margin-top: 100px;
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.footer-logo {
  font-family: var(--display); font-size: 1.3rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text);
}
.footer-logo .dot { color: var(--red); }
.footer-brand p { font-size: 0.78rem; color: var(--text-dim); margin-top: 4px; }
.footer-links { display: flex; gap: 28px; }
.footer-links a {
  font-size: 0.72rem; font-weight: 500; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-dim);
  transition: color var(--t);
}
.footer-links a:hover { color: var(--red); }
.footer-copy { font-size: 0.72rem; color: var(--text-dim); letter-spacing: 0.06em; }

/* ── ALERTS ─────────────────────────────────────────────────── */
.alert { padding: 14px 20px; border-radius: var(--radius); font-size: 0.875rem; margin-bottom: 20px; border: 1px solid transparent; }
.alert-success { background: rgba(50,200,80,0.08); border-color: rgba(50,200,80,0.25); color: #5ddc78; }
.alert-error   { background: var(--red-dim); border-color: rgba(232,50,26,0.3); color: #ff6b54; }

/* ── BADGE ──────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 2px; font-size: 0.65rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; }

/* ── SCROLL ANIMATIONS ──────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up            { animation: fadeUp 0.7s var(--ease) forwards; }
.fade-up-delay-1    { opacity:0; animation: fadeUp 0.7s var(--ease) 0.12s forwards; }
.fade-up-delay-2    { opacity:0; animation: fadeUp 0.7s var(--ease) 0.24s forwards; }
.fade-up-delay-3    { opacity:0; animation: fadeUp 0.7s var(--ease) 0.38s forwards; }
.observe            { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.observe.in-view    { opacity: 1; transform: translateY(0); }

/* ── RTL / ARABIC ───────────────────────────────────────────── */
[dir="rtl"] body { font-family: var(--sans-ar); }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 {
  font-family: var(--serif-ar);
  letter-spacing: 0; font-weight: 700;
}
[dir="rtl"] .nav-logo, [dir="rtl"] .footer-logo { font-family: var(--serif-ar); letter-spacing: 0; }
[dir="rtl"] .nav-container { flex-direction: row-reverse; }
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] .hero { direction: rtl; }
[dir="rtl"] .hero-left { padding: 80px 32px 80px 60px; }
[dir="rtl"] .hero-eyebrow::before { display:none; }
[dir="rtl"] .hero-eyebrow::after { content:''; display:block; width:32px; height:1px; background:var(--red); }
[dir="rtl"] .section-label::before { display:none; }
[dir="rtl"] .section-label::after  { content:''; display:block; width:28px; height:1px; background:var(--red); }
[dir="rtl"] .card-link::after { content:'←'; }
[dir="rtl"] .card-link { flex-direction: row-reverse; }
[dir="rtl"] .breadcrumb { flex-direction: row-reverse; }
[dir="rtl"] .breadcrumb span::before { content:'\\'; margin-right:0; margin-left:10px; }
[dir="rtl"] .post-content { text-align:right; }
[dir="rtl"] .post-content blockquote { border-left:none; border-right:3px solid var(--red); padding-left:0; padding-right:24px; }
[dir="rtl"] .post-content ul, [dir="rtl"] .post-content ol { padding-left:0; padding-right:1.5em; }
[dir="rtl"] .footer-inner  { flex-direction: row-reverse; }
[dir="rtl"] .footer-links  { flex-direction: row-reverse; }
[dir="rtl"] .about-grid    { direction: rtl; }
[dir="rtl"] .about-img-wrap::before { inset: 16px 16px -16px -16px; }
[dir="rtl"] .contact-grid  { direction: rtl; }
[dir="rtl"] .hero-actions  { flex-direction: row-reverse; }
[dir="rtl"] .hero-content  { text-align: right; }
[dir="rtl"] .form-input, [dir="rtl"] .form-textarea, [dir="rtl"] .form-select { text-align:right; direction:rtl; font-family:var(--sans-ar); }
[dir="rtl"] .section-header { text-align:right; }
[dir="rtl"] .page-hero { text-align:right; }
[dir="rtl"] p, [dir="rtl"] .card-excerpt, [dir="rtl"] .hero-sub, [dir="rtl"] .post-content p { line-height:1.9; }
[dir="rtl"] .btn { font-family: var(--sans-ar); letter-spacing: 0; }
[dir="rtl"] .nav-links a { letter-spacing: 0.04em; font-family: var(--sans-ar); }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-right { display: none; }
  .hero-left { padding: 60px 0; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 48px; }
  .about-img-wrap::before { display: none; }
  .card-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { flex-direction: column; gap: 16px; }
  .section { padding: 70px 0; }
  h1 { font-size: clamp(3rem, 12vw, 5rem); }

  .nav-links {
    display: none; position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    background: rgba(8,8,8,0.97);
    border-bottom: 1px solid var(--border);
    flex-direction: column; padding: 32px;
    gap: 24px; align-items: flex-start;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }

  [dir="rtl"] .nav-links { align-items: flex-end; text-align: right; }
}
