/* --- Fonts Import --- */

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

:root {
  /* Color Palette - Red Door Minimalist & Warm Terroir */
  --bg-primary: #F7F4EF;       /* Travertine Sand */
  --bg-secondary: #EFECE5;     /* Darker Warm Sand */
  --text-primary: #1E1C1A;     /* Wenge Charcoal */
  --text-muted: #5E5A54;       /* Muted Earthy Grey */
  --brand-red: #8A1C14;        /* Crimson Bordeaux */
  --brand-red-rgb: 138, 28, 20;
  --accent-brass: #C5A26B;     /* Brushed Brass */
  --accent-brass-light: #DFCDAE;
  --white: #FFFFFF;
  --glass-bg: rgba(247, 244, 239, 0.75);
  
  /* Fonts */
  --font-serif: 'Playfair Display', serif;
  --font-sans: 'Montserrat', sans-serif;
  
  /* Layout & Transitions */
  --transition-smooth: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast: all 0.25s ease;
  --max-width: 1400px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--accent-brass);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--brand-red);
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
  position: relative;
}

/* Custom Text Selection */
::selection {
  background: var(--brand-red);
  color: var(--bg-primary);
}

/* --- Arabic Typography Overrides (RTL Mode) --- */
.rtl-mode {
  --font-serif: 'Amiri', serif;
  --font-sans: 'Cairo', sans-serif;
  letter-spacing: 0 !important;
}
.rtl-mode * {
  letter-spacing: 0 !important;
}

/* --- Custom Cursor --- */
.custom-cursor-dot,
.custom-cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transition: transform 0.15s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.custom-cursor-dot {
  width: 6px;
  height: 6px;
  background-color: var(--brand-red);
}

.custom-cursor-follower {
  width: 32px;
  height: 32px;
  border: 1px solid var(--accent-brass);
}

/* Cursor Hover states */
.custom-cursor-follower.hovered {
  width: 48px;
  height: 48px;
  border-color: var(--brand-red);
  background-color: rgba(138, 28, 20, 0.05);
}

.custom-cursor-dot.hovered {
  background-color: var(--brand-red);
  transform: translate(-50%, -50%) scale(1.5);
}

/* Hide real cursor on desktop if supported */
@media (hover: hover) and (pointer: fine) {
  body {
    cursor: none;
  }
  a, button, .project-card, .faq-header, input, textarea, select {
    cursor: none;
  }
}
@media (max-width: 1024px) {
  .custom-cursor-dot,
  .custom-cursor-follower {
    display: none;
  }
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 4rem;
}
@media (max-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}

section {
  padding: 8rem 0;
  position: relative;
}
@media (max-width: 768px) {
  section {
    padding: 5rem 0;
  }
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  line-height: 1.2;
}

p {
  line-height: 1.75;
  font-weight: 300;
  color: var(--text-muted);
}

/* Line / Dividers */
.divider {
  width: 100%;
  height: 1px;
  background: rgba(30, 28, 26, 0.1);
  margin: 4rem 0;
}

/* --- Header / Navigation --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: var(--transition-smooth);
  padding: 2rem 0;
}

.site-header.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  padding: 1.2rem 0;
  border-bottom: 1px solid rgba(197, 162, 107, 0.15);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02);
}

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

.logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.logo-dot {
  width: 8px;
  height: 8px;
  background-color: var(--brand-red);
  border-radius: 50%;
}

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

.nav-link {
  text-decoration: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: var(--transition-fast);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--brand-red);
  transition: var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link:hover {
  color: var(--brand-red);
}

/* Language Toggle Custom styles */
.lang-selector {
  display: flex;
  gap: 0.5rem;
  border: 1px solid rgba(197, 162, 107, 0.3);
  padding: 0.25rem;
  border-radius: 20px;
  background: rgba(239, 236, 229, 0.5);
  margin-inline-start: 1rem;
}

.lang-btn {
  background: none;
  border: none;
  padding: 0.3rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 15px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.lang-btn.active {
  background-color: var(--brand-red);
  color: var(--bg-primary);
}

/* RTL Header Layout support */
.rtl-mode .logo {
  flex-direction: row-reverse;
}
.rtl-mode .nav-menu {
  flex-direction: row;
}

/* --- Hero Section --- */
.hero {
  height: 100vh;
  min-height: 700px;
  background-color: #2a2119; /* warm dark fallback while the photo loads */
  display: flex;
  align-items: center;
  color: var(--bg-primary);
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* Rustic photo layer: film grain, vignette, warm wash, then the photo, all toned by the filter.
   Kept on ::before so the filter never touches the headline. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") repeat,
    radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(45, 24, 10, 0.6) 100%),
    linear-gradient(rgba(120, 70, 30, 0.18), rgba(120, 70, 30, 0.18)),
    linear-gradient(rgba(30, 28, 26, 0.35), rgba(30, 28, 26, 0.5)),
    var(--hero-img) no-repeat center center / cover;
  filter: sepia(0.35) saturate(0.85) contrast(1.06) brightness(0.95);
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 20vh;
  background: linear-gradient(transparent, var(--bg-primary));
  z-index: 2;
}

.hero-content {
  max-width: 900px;
  margin: 0 auto;
  position: relative; /* z-index only works when positioned: keeps text above the photo layer */
  z-index: 3;
  padding-top: 4rem;
}

.hero h1 {
  font-size: 4rem;
  margin-bottom: 2rem;
  color: var(--white);
  line-height: 1.15;
  animation: heroFadeIn 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 3rem;
  color: var(--bg-secondary);
  font-weight: 300;
  line-height: 1.6;
  opacity: 0.9;
  letter-spacing: 0.5px;
  animation: heroFadeIn 1.5s cubic-bezier(0.25, 1, 0.5, 1) 0.3s forwards;
}

.btn-luxe {
  display: inline-block;
  padding: 1.2rem 2.5rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  background-color: var(--brand-red);
  color: var(--white);
  border: 1px solid var(--brand-red);
  border-radius: 0;
  transition: var(--transition-smooth);
}

.btn-luxe:hover {
  background-color: transparent;
  color: var(--bg-primary);
  border-color: var(--bg-primary);
}

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

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  .hero p {
    font-size: 1rem;
  }
}

/* --- Philosophy Section --- */
.philosophy {
  background-color: var(--bg-primary);
}

.philosophy-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 6rem;
  align-items: center;
}

.philosophy-text-container h2 {
  font-size: 3rem;
  color: var(--brand-red);
  margin-bottom: 0.5rem;
}

.philosophy-text-container h3 {
  font-size: 1.5rem;
  font-style: italic;
  color: var(--accent-brass);
  margin-bottom: 2rem;
}

.philosophy-text-container p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

.philosophy-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 4/5;
  background-color: var(--bg-secondary);
  border: 1px solid rgba(197, 162, 107, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Editorial Graphic: A minimalist layout mockup of a blueprint frame */
.editorial-frame {
  position: absolute;
  top: 5%;
  left: 5%;
  width: 90%;
  height: 90%;
  border: 1px solid var(--accent-brass);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2rem;
  z-index: 2;
}

.editorial-monogram {
  font-family: var(--font-serif);
  font-size: 8rem;
  color: rgba(138, 28, 20, 0.04);
  font-weight: 700;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  line-height: 1;
}

.editorial-line {
  width: 40px;
  height: 1px;
  background-color: var(--brand-red);
}

.editorial-txt {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 3px;
  color: var(--accent-brass);
  text-transform: uppercase;
}

@media (max-width: 992px) {
  .philosophy-grid {
    grid-template-columns: 1fr;
    gap: 4rem;
  }
}

/* --- Selected Works Section --- */
.projects {
  background-color: var(--bg-secondary);
}

.section-intro {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 5rem auto;
}

.section-intro h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.section-intro p {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3rem;
}

.project-card {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-primary);
  border: 1px solid rgba(197, 162, 107, 0.1);
  aspect-ratio: 16/11;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2.5rem;
  transition: var(--transition-smooth);
}

/* Asymmetric sizing for architectural portfolio feel */
.projects-grid .project-card:nth-child(3n) {
  grid-column: span 2;
  aspect-ratio: 21/9;
}

.project-img-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

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

/* Project Card Gradient Overlay */
.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(30, 28, 26, 0.9) 0%, rgba(30, 28, 26, 0.55) 40%, rgba(30, 28, 26, 0.1) 75%, transparent 100%);
  z-index: 2;
  transition: opacity 0.5s ease;
}

.project-info {
  position: relative;
  z-index: 3;
  color: var(--white);
  transform: translateY(20px);
  transition: var(--transition-smooth);
}

.project-tag {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-brass);
  margin-bottom: 0.5rem;
  display: block;
}

.project-card h3 {
  font-size: 2.2rem;
  color: var(--white);
  margin-bottom: 0.75rem;
}

.project-card p {
  color: rgba(247, 244, 239, 0.85);
  font-size: 0.95rem;
  max-width: 500px;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Interactive Card Hovers */
.project-card:hover .project-img {
  transform: scale(1.08);
}

.project-card:hover .project-info {
  transform: translateY(0);
}

.project-card:hover p {
  opacity: 1;
}

.project-card:hover {
  border-color: var(--brand-red);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* Concept Drawing Special Style on Card 3 */
.concept-sketch-bg {
  background-color: var(--brand-red-rgb); /* SVG fallback background */
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.concept-sketch-svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 992px) {
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .projects-grid .project-card:nth-child(3n) {
    grid-column: span 1;
    aspect-ratio: 16/11;
  }
  .project-info {
    transform: translateY(0);
  }
  .project-card p {
    opacity: 1;
  }
}

/* --- Services / Expertise Section --- */
.services {
  background-color: var(--bg-primary);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background-color: rgba(197, 162, 107, 0.15); /* forms thin grid borders */
  border: 1px solid rgba(197, 162, 107, 0.15);
}

.service-card {
  background-color: var(--bg-primary);
  padding: 4rem 3rem;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.service-num {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: var(--brand-red);
  opacity: 0.7;
  margin-bottom: 2rem;
  display: block;
}

.service-card h3 {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.service-card p {
  font-size: 0.95rem;
  line-height: 1.7;
}

.service-card:hover {
  background-color: var(--bg-secondary);
  transform: translateY(-5px);
}

@media (max-width: 992px) {
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    background-color: transparent;
    border: none;
  }
  .service-card {
    border: 1px solid rgba(197, 162, 107, 0.15);
    padding: 3rem 2rem;
  }
}

/* --- FAQ Accordion Section --- */
.faq {
  background-color: var(--bg-secondary);
}

.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid rgba(197, 162, 107, 0.25);
  margin-bottom: 1.5rem;
}

.faq-header {
  padding: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-fast);
}

/* Adjust heading padding for RTL */
.rtl-mode .faq-header {
  text-align: right;
}

.faq-header:hover {
  color: var(--brand-red);
}

.faq-icon {
  width: 16px;
  height: 16px;
  position: relative;
  transition: transform 0.4s ease;
}

.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  background-color: var(--text-primary);
  transition: transform 0.4s ease;
}

/* Plus line horizontal */
.faq-icon::before {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1.5px;
  transform: translateY(-50%);
}

/* Plus line vertical */
.faq-icon::after {
  left: 50%;
  top: 0;
  width: 1.5px;
  height: 100%;
  transform: translateX(-50%);
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.faq-item.open .faq-icon::before,
.faq-item.open .faq-icon::after {
  background-color: var(--brand-red);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.faq-content p {
  padding-bottom: 2rem;
  font-size: 1rem;
  line-height: 1.7;
}

/* --- Contact Section --- */
.contact {
  background-color: var(--bg-primary);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 6rem;
}

.contact-info h2 {
  font-size: 3rem;
  color: var(--brand-red);
  margin-bottom: 0.5rem;
}

.contact-info h3 {
  font-size: 1.5rem;
  font-style: italic;
  color: var(--accent-brass);
  margin-bottom: 3rem;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.detail-item h4 {
  font-family: var(--font-sans);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: var(--accent-brass);
  margin-bottom: 0.5rem;
}

.detail-item p,
.detail-item a {
  font-size: 1.1rem;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 300;
  transition: var(--transition-fast);
}

.detail-item a:hover {
  color: var(--brand-red);
}

/* Form Styles */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.form-group {
  position: relative;
  width: 100%;
}

.form-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(30, 28, 26, 0.2);
  padding: 1rem 0;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: var(--transition-fast);
  outline: none;
  border-radius: 0;
}

.form-input:focus {
  border-bottom-color: var(--brand-red);
}

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

.submit-btn {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  border: 1px solid var(--text-primary);
  padding: 1.2rem 2.5rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 500;
  transition: var(--transition-smooth);
  align-self: flex-start;
}

.submit-btn:hover {
  background-color: var(--brand-red);
  border-color: var(--brand-red);
  color: var(--white);
}

/* Form Success message overlay state */
.form-success {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: var(--transition-smooth);
  background-color: rgba(197, 162, 107, 0.1);
  border: 1px solid transparent;
}

.form-success.visible {
  max-height: 200px;
  opacity: 1;
  padding: 1.5rem;
  border-color: var(--accent-brass);
  margin-top: 1rem;
}

.form-success p {
  color: var(--brand-red);
  font-weight: 500;
  font-size: 0.95rem;
}

@media (max-width: 992px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 4rem;
  }
}

/* --- Project Detail Modal --- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  background-color: rgba(30, 28, 26, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-content-container {
  width: 90%;
  max-width: 1200px;
  height: 85vh;
  background-color: var(--bg-primary);
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  position: relative;
  transform: translateY(40px);
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

.modal.visible .modal-content-container {
  transform: translateY(0);
}

.modal-image-container {
  position: relative;
  background-color: var(--bg-secondary);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.modal-text-container {
  padding: 4rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

.close-modal {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-primary);
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  transition: var(--transition-fast);
}

.close-modal:hover {
  color: var(--brand-red);
  transform: rotate(90deg);
}

.modal-project-loc {
  font-family: var(--font-sans);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: var(--accent-brass);
  margin-bottom: 0.5rem;
  display: block;
}

.modal-text-container h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(197, 162, 107, 0.2);
  padding-bottom: 1.5rem;
}

.modal-project-details {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 3rem;
}

/* Modal metadata grid */
.modal-metadata {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  border-t: 1px solid rgba(197, 162, 107, 0.2);
  padding-top: 2rem;
}

.meta-col h4 {
  font-family: var(--font-sans);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  color: var(--accent-brass);
  margin-bottom: 0.4rem;
}

.meta-col p {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 400;
}

/* RTL layout adjustments for Modal */
.rtl-mode .modal-content-container {
  grid-template-columns: 1fr 1.3fr;
}
.rtl-mode .close-modal {
  left: 2rem;
  right: auto;
}
.rtl-mode .modal-text-container {
  order: 1;
}
.rtl-mode .modal-image-container {
  order: 2;
}

@media (max-width: 992px) {
  .modal-content-container {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1.2fr;
    height: 90vh;
  }
  .modal-text-container {
    padding: 2rem;
  }
  .close-modal {
    top: 1rem;
    right: 1rem;
    color: var(--white);
    background: rgba(30, 28, 26, 0.6);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .rtl-mode .close-modal {
    left: 1rem;
    right: auto;
  }
  .rtl-mode .modal-content-container {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 1.2fr;
  }
}

/* --- Footer --- */
.site-footer {
  background-color: var(--text-primary);
  color: var(--bg-primary);
  padding: 4rem 0;
  border-top: 1px solid rgba(247, 244, 239, 0.05);
}

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

.footer-logo {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--bg-primary);
  text-decoration: none;
  font-weight: 700;
}

.footer-logo span {
  color: var(--brand-red);
}

.footer-rights {
  font-size: 0.8rem;
  color: rgba(247, 244, 239, 0.5);
  font-family: var(--font-sans);
  letter-spacing: 1px;
}

@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }
}

/* --- Reveal Scroll Animations --- */
.reveal {
  opacity: 0;
  transition: opacity 1s ease;
}

.reveal.active {
  opacity: 1;
}

.reveal-up {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 1s cubic-bezier(0.25, 1, 0.5, 1), transform 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

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

/* --- Before / After Transformations --- */
.transformations {
  background-color: var(--bg-primary);
}

.ba-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.ba-tab {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.8rem 1.4rem;
  border: 1px solid rgba(30, 28, 26, 0.2);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.ba-tab.active,
.ba-tab:hover {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: var(--white);
}

.ba-panel { display: none; }
.ba-panel.active { display: block; }

/* Always LTR so the drag math and the before-left / after-right layout hold in Arabic too */
.ba-slider {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  direction: ltr;
  container-type: inline-size;
  cursor: ew-resize;
  user-select: none;
  touch-action: pan-y;
  background: var(--text-primary);
}

.ba-slider > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* Before photo sits on the left; its image spans the full slider (100cqw) so both line up */
.ba-after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 50%;
  overflow: hidden;
}

.ba-after img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100cqw;
  max-width: none;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: var(--white);
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
}

.ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--white);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.ba-badge {
  position: absolute;
  top: 1rem;
  z-index: 2;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.45rem 0.9rem;
  pointer-events: none;
}

.ba-badge.bef { left: 1rem; background: rgba(30, 28, 26, 0.75); color: var(--white); }
.ba-badge.aft { right: 1rem; background: var(--brand-red); color: var(--white); }

.ba-info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 1.25rem;
}

.ba-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--text-primary);
}

.ba-detail {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-red);
}

@media (max-width: 768px) {
  .ba-slider { aspect-ratio: 4 / 3; }
  .ba-tab { padding: 0.7rem 1rem; font-size: 0.7rem; }
}

/* --- Header fit: the original had no mobile menu, links overflowed below ~1300px --- */
@media (max-width: 1280px) {
  .nav-menu { gap: 1.5rem; }
}

/* Below 1100px keep logo + language switch; sections stay reachable by scrolling */
@media (max-width: 1100px) {
  .nav-menu > li:not(.lang-selector) { display: none; }
}

@media (max-width: 600px) {
  .logo { font-size: 1rem; white-space: normal; line-height: 1.15; }
}

/* --- Brand logo (from Nader's logo file, IMG_0036.PNG) --- */
.logo { line-height: 0; }
.logo-img { height: 44px; width: auto; display: block; }
/* white over the hero photo, brand red once the header turns solid */
.logo-img--brand { display: none; }
.site-header.scrolled .logo-img--light { display: none; }
.site-header.scrolled .logo-img--brand { display: block; }
.footer-logo-img { height: 40px; width: auto; display: block; }

@media (max-width: 600px) {
  .logo-img { height: 34px; }
}

/* --- Founder portrait (Philosophy section) --- */
.philosophy-visual { margin: 0; display: block; }
.founder-portrait {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}
.founder-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.5rem 1.5rem 1.25rem;
  background: linear-gradient(transparent, rgba(30, 28, 26, 0.75));
  color: var(--white);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.founder-name { font-family: var(--font-serif); font-size: 1.4rem; }
.founder-role {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-brass-light);
}

/* --- Audit fixes 2026-10-31 --- */
/* Menu links were dark text on the dark hero photo: light until the header turns solid */
.site-header:not(.scrolled) .nav-link { color: rgba(255, 255, 255, 0.92); }
.site-header:not(.scrolled) .nav-link:hover,
.site-header:not(.scrolled) .nav-link.active { color: var(--white); }

/* Location tags on project cards were gold on bright photos: lighter tone, reads on the dark fade */
.project-tag { color: var(--accent-brass-light); }

/* Phones: 16:11 cards were too short, titles pushed the location tag out of the card */
@media (max-width: 600px) {
  .project-card,
  .projects-grid .project-card:nth-child(3n) { aspect-ratio: 4 / 5; padding: 1.75rem; }
  .project-card h3 { font-size: 1.8rem; }
}

/* Custom cursor hidden until the mouse moves */
.custom-cursor-dot,
.custom-cursor-follower { opacity: 0; }
body.cursor-ready .custom-cursor-dot,
body.cursor-ready .custom-cursor-follower { opacity: 1; }

/* --- Project photo slideshow (inside the project popup) --- */
.modal-image-container {
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  background-color: #1e1c1a;
  direction: ltr; /* arrows and swipe stay left = previous, right = next in every language */
}

.gallery-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  touch-action: pan-y;
}

/* contain, not cover: show the whole room, portrait or landscape */
.gallery-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(247, 244, 239, 0.85);
  color: var(--text-primary);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s ease;
}
.gallery-nav:hover { background: var(--white); }
.gallery-prev { left: 1rem; }
.gallery-next { right: 1rem; }
.gallery-nav[hidden] { display: none; }

.gallery-count {
  position: absolute;
  bottom: 0.75rem;
  right: 1rem;
  z-index: 2;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--white);
  background: rgba(30, 28, 26, 0.6);
  padding: 0.3rem 0.6rem;
}

.gallery-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0.45rem 0.9rem;
  background: rgba(30, 28, 26, 0.8);
  color: var(--white);
}
.gallery-badge[hidden] { display: none; }

.gallery-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
  background: #1e1c1a;
}
.gallery-thumbs[hidden] { display: none; }

.gallery-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 52px;
  padding: 0;
  border: 2px solid transparent;
  background: none;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb:hover { opacity: 0.85; }
.gallery-thumb.active { opacity: 1; border-color: var(--brand-red); }

@media (max-width: 600px) {
  .gallery-thumb { width: 56px; height: 42px; }
  .gallery-nav { width: 36px; height: 36px; font-size: 1.3rem; }
}

/* --- Before & After v2: one slider, apartments as tabs, rooms as thumbnails --- */
.ba-slider > img.ba-img-after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.ba-slider { cursor: col-resize; }
.ba-divider, .ba-after { transition: none; }

.ba-info > div {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.ba-count {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  opacity: 0.6;
}

.ba-pairs {
  display: flex;
  gap: 8px;
  margin-top: 1rem;
  overflow-x: auto;
  padding-bottom: 4px;
}
.ba-pairs:empty { display: none; }
.ba-pair {
  flex: 0 0 auto;
  width: 96px;
  height: 64px;
  padding: 0;
  border: 2px solid transparent;
  background: none;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
.ba-pair img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ba-pair:hover { opacity: 0.9; }
.ba-pair.active { opacity: 1; border-color: var(--brand-red); }

@media (max-width: 600px) {
  .ba-pair { width: 72px; height: 48px; }
}

/* dark scrollbar for the popup thumbnail strip (was bright white on Windows) */
.gallery-thumbs { scrollbar-color: #5a514a #1e1c1a; }
.gallery-thumbs::-webkit-scrollbar { height: 8px; }
.gallery-thumbs::-webkit-scrollbar-track { background: #1e1c1a; }
.gallery-thumbs::-webkit-scrollbar-thumb { background: #5a514a; border-radius: 4px; }

/* Hero photo: WebP, lighter file on phones (paths absolute so the variable resolves the same everywhere) */
.hero { --hero-img: url('/assets/projects/hero-1920.webp'); }
@media (max-width: 768px) { .hero { --hero-img: url('/assets/projects/hero-1080.webp'); } }
