/* ============================================
   TAREQMELFI.SA — Lynxi Home B Style
   Minimal · Inspiring · Image-Focused
   ============================================ */

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

:root {
  /* Lynxi exact palette */
  --bg: #f6f5f1;
  --bg-light: #faf9f5;
  --text: #082F62;
  --text-70: rgba(8, 47, 98, 0.7);
  --text-55: rgba(8, 47, 98, 0.55);
  --text-30: rgba(8, 47, 98, 0.3);
  --text-10: rgba(8, 47, 98, 0.08);
  --text-05: rgba(8, 47, 98, 0.04);
  --accent: #2C7CE0;
  --yellow: #FECE1F;
  --white: #fcfcfb;
  --border: rgba(8, 47, 98, 0.1);
  --font: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-accent: 'Libre Caslon Display', 'Georgia', serif;
  --font-ar: 'IBM Plex Sans Arabic', 'Noto Sans Arabic', var(--font);
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-70);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main, .article-body, .contact-links, .projects-section, .articles-section {
  flex: 1;
}

/* Arabic text styling — auto-detect and apply Arabic font */
[lang="ar"], [dir="rtl"],
.ar, .arabic-text {
  font-family: var(--font-ar);
}

/* Universal Arabic Unicode range fallback */
@font-face {
  font-family: 'Arabic Fallback';
  src: local('IBM Plex Sans Arabic'), local('Noto Sans Arabic');
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}

body {
  font-family: var(--font), 'IBM Plex Sans Arabic', 'Noto Sans Arabic', sans-serif;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4 {
  font-family: var(--font);
  color: var(--text);
  font-weight: 700;
  line-height: 1.1;
}

h1 { font-size: clamp(2.8rem, 4.7vw, 5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.5rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.1rem, 1.4vw, 1.35rem); letter-spacing: -0.01em; }

h1 .italic, h2 .italic {
  font-family: var(--font-accent);
  font-style: italic;
  font-weight: 400;
}

p { font-size: 1rem; line-height: 1.7; color: var(--text-70); }

.label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-55);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* --- NAVBAR --- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 1.4rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.4s var(--ease);
}

.navbar.scrolled {
  background: rgba(246, 245, 241, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* Desktop inline links */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  list-style: none;
}
.nav-desktop a {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-70);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: color 0.3s;
  text-decoration: none;
}
.nav-desktop a:hover { color: var(--text); }

/* Mobile hamburger — hidden on desktop */
.menu-btn {
  display: none;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.menu-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--ease);
}

.menu-icon span {
  display: block; width: 16px; height: 1.5px;
  background: var(--white);
  position: relative;
}

.menu-icon span::before, .menu-icon span::after {
  content: ''; position: absolute;
  width: 100%; height: 1.5px;
  background: var(--white); left: 0;
}
.menu-icon span::before { top: -5px; }
.menu-icon span::after { top: 5px; }

.menu-btn:hover .menu-icon { transform: scale(1.06); }

/* Nav Overlay — Mobile dropdown card */
.nav-overlay {
  position: fixed;
  top: 1.2rem; right: 1.5rem;
  width: auto;
  min-width: 200px;
  background: var(--white);
  z-index: 999;
  border-radius: 14px;
  padding: 1.8rem 2rem;
  box-shadow: 0 12px 40px rgba(8, 47, 98, 0.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.97);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
  display: none;
}

.nav-overlay.open { opacity: 1; pointer-events: all; transform: translateY(0) scale(1); }

.close-btn {
  position: absolute; top: 0.8rem; right: 0.8rem;
  background: none; border: none;
  color: var(--text-55);
  font-size: 0; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
}

.close-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  color: var(--text-55);
  transition: color 0.3s;
}

.close-btn:hover .close-icon { color: var(--text); }

.nav-links { list-style: none; text-align: right; }
.nav-links li { margin: 0.6rem 0; }
.nav-links a {
  font-size: 1rem;
  font-weight: 600; color: var(--text);
  transition: color 0.3s;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.nav-links a:hover { color: var(--accent); }

/* --- HERO (Home B Style) --- */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  padding: 0 2.5rem 4rem;
  gap: 2rem;
}

.hero-text {
  padding-bottom: 2rem;
}

.hero h1 { margin-bottom: 1.5rem; }

.hero-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  transition: opacity 0.3s;
}

.hero-link::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text);
  opacity: 0.3;
}

.hero-link:hover { opacity: 0.6; }

.hero-images {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.hero-img {
  position: absolute;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(8, 47, 98, 0.12);
  transition: transform 1s var(--ease);
}

.hero-img img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.hero-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem; opacity: 0.15; color: var(--text);
}

.hero-img:nth-child(1) {
  width: 65%; height: 55%;
  top: 10%; right: 0;
  transform: rotate(-4deg);
}

.hero-img:nth-child(2) {
  width: 55%; height: 45%;
  bottom: 5%; right: 15%;
  transform: rotate(3deg);
}

/* Hero image — GSAP-powered parallax */
.hero-img-anim {
  will-change: transform;
  opacity: 0; /* GSAP handles entrance */
}

/* Hover: image zooms in, card pops forward */
.hero-img-anim:hover {
  z-index: 5;
}
.hero-img-anim img {
  transition: transform 0.6s var(--ease);
}
.hero-img-anim:hover img {
  transform: scale(1.05);
}

/* --- PROJECT IMAGES (Full-bleed, Lynxi-style) --- */
.projects-section {
  padding: 4rem 0 6rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.project-card {
  display: block;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  transform: perspective(1200px) rotateY(-6deg) rotateX(3deg);
  transition: transform 1.2s var(--ease), box-shadow 0.5s var(--ease);
  will-change: transform;
  box-shadow: 0 20px 60px rgba(8, 47, 98, 0.08);
}

.project-card.in-view {
  transform: perspective(1200px) rotateY(0deg) rotateX(0deg);
}

.project-card:hover {
  box-shadow: 0 30px 80px rgba(8, 47, 98, 0.14);
}

/* Image fills entire card */
.project-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.8s var(--ease);
}

.project-card:hover img {
  transform: scale(1.04);
}

/* Placeholder when no image */
.project-card .placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, rgba(8,47,98,0.04), rgba(8,47,98,0.08));
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; opacity: 0.06; color: var(--text);
}

/* Overlay label — bottom left, fades in on scroll */
.project-label {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 2rem 1.5rem 1.3rem;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.project-card.in-view .project-label {
  opacity: 1;
  transform: translateY(0);
}

.project-label .project-category {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 0.15rem;
  display: block;
}

.project-label h3 {
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
  font-weight: 600;
  color: white;
  line-height: 1.2;
}

/* --- ARTICLE LIST --- */
.articles-section { padding: 6rem 0; }

.article-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 2rem;
  align-items: center;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  transition: padding-left 0.4s var(--ease);
}

.article-row:hover { padding-left: 1rem; }

.article-thumb {
  width: 120px; height: 90px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-light);
  flex-shrink: 0;
}

.article-thumb .placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(8,47,98,0.03), rgba(8,47,98,0.06));
  font-size: 1.5rem; opacity: 0.1;
}

.article-meta { margin-bottom: 0.3rem; }

.article-date {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-55);
}

.article-row h3 { transition: opacity 0.3s; }
.article-row:hover h3 { opacity: 0.7; }

.article-arrow {
  font-size: 1.2rem;
  color: var(--text-30);
  transition: color 0.3s, transform 0.3s;
}

.article-row:hover .article-arrow {
  color: var(--text);
  transform: translateX(4px);
}

/* --- MINIMAL CTA (no button, just text) --- */
.cta-section {
  padding: 8rem 0;
  text-align: center;
}

.cta-section h2 {
  max-width: 600px;
  margin: 0 auto 1rem;
}

.cta-section p {
  max-width: 420px;
  margin: 0 auto;
  font-size: 0.95rem;
}

/* --- FOOTER (Single line, like Lynxi) --- */
.footer {
  padding: 1.5rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-55);
}

.footer-left, .footer-right {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.footer a {
  color: var(--text-55);
  transition: color 0.3s;
}

.footer a:hover { color: var(--text); }

/* --- PAGE HEADER (inner pages) --- */
.page-header {
  padding: 10rem 0 3rem;
}

.page-header h1 { margin-bottom: 0.8rem; }
.page-header p { max-width: 500px; }

/* --- TIMELINE (About) --- */
.timeline { padding-left: 2rem; position: relative; }
.timeline::before {
  content: ''; position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 1px; background: var(--border);
}

.timeline-item { padding-bottom: 2.5rem; position: relative; }
.timeline-item::before {
  content: ''; position: absolute;
  left: -2.05rem; top: 0.4rem;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-30);
}

.timeline-date {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-55);
  margin-bottom: 0.2rem;
}

.timeline-item h3 { margin-bottom: 0.2rem; }

.timeline-org {
  font-size: 0.9rem;
  color: var(--text-55);
  margin-bottom: 0.4rem;
}

/* --- CONTACT (Lynxi bold-link style) --- */
.contact-links {
  padding: 6rem 0 4rem;
}

.contact-link-item {
  display: block;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  position: relative;
  padding: 0.3rem 0;
  text-decoration: none;
  background-image: linear-gradient(var(--yellow), var(--yellow));
  background-size: 0% 4px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.5s var(--ease);
}

.contact-link-item:hover {
  background-size: 100% 4px;
}

.contact-link-item .link-detail {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  font-style: italic;
  font-family: var(--font-accent);
  color: var(--text-55);
  margin-top: -0.2rem;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}

.contact-link-item:hover .link-detail {
  opacity: 1;
  transform: translateY(0);
}

/* Legacy contact form styles (kept for compatibility) */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.contact-form { display: flex; flex-direction: column; gap: 1rem; }

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.3s;
}

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

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--text);
  background: var(--text);
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: all 0.3s var(--ease);
}

.btn:hover {
  background: transparent;
  color: var(--text);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-top: 1rem;
}

.contact-card h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-55);
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.contact-card p,
.contact-card a {
  font-size: 1rem;
  color: var(--text-70);
}

.contact-card a:hover { color: var(--text); }

/* --- ACCENT BANNER/BOX --- */
.accent-box {
  background: var(--accent);
  color: white;
  border-radius: 14px;
  padding: 2rem;
}

.accent-box h3,
.accent-box h4 { color: white; }
.accent-box p { color: rgba(255,255,255,0.85); }

/* --- PODCAST EPISODES --- */
.episode-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem 0;
  border-top: 1px solid var(--border);
}

.episode-num {
  width: 50px; height: 50px;
  border-radius: 10px;
  background: var(--text-10);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.8rem;
  color: var(--text);
}

.episode-meta {
  font-family: var(--font-accent);
  font-style: italic;
  font-size: 0.8rem;
  color: var(--text-55);
}

.episode-card h3 { margin-bottom: 0.2rem; }
.episode-card p { font-size: 0.9rem; margin: 0; }

/* --- ANIMATIONS (professional scroll-triggered) --- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Delayed reveal for children */
.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; }

/* Stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.3s; }

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* --- RESPONSIVE --- */
@media (max-width: 968px) {
  /* Show hamburger, hide desktop nav */
  .nav-desktop { display: none; }
  .menu-btn { display: flex; }
  .nav-overlay { display: block; }

  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 8rem; }
  .hero-images { height: 50vh; }
  .projects-grid { grid-template-columns: 1fr; }
  .article-row { grid-template-columns: 1fr auto; }
  .article-thumb { display: none; }
  .contact-grid { grid-template-columns: 1fr; }
  .contact-link-item { font-size: clamp(2rem, 8vw, 3.5rem); }
  .episode-card { grid-template-columns: auto 1fr; }
  .episode-card > *:last-child { display: none; }
}

@media (max-width: 600px) {
  .navbar { padding: 1.2rem 1.5rem; }
  .hero { padding: 7rem 1.5rem 3rem; }
  .container { padding: 0 1.5rem; }
  .footer { flex-direction: column; gap: 0.8rem; text-align: center; padding: 1.5rem; }
}
