/* ============================================
   SUPER DRIFT & CRASHES — racing aesthetic
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Syncopate:wght@400;700&family=JetBrains+Mono:wght@400;500;700&family=Oswald:wght@300;400;500;600;700&family=Cairo:wght@300;400;600;700;900&display=swap');

:root {
  --bg: #0a0a0b;
  --bg-2: #141416;
  --surface: #1a1a1d;
  --ink: #f5f5f5;
  --ink-dim: #8a8a8d;
  --ink-faint: #4a4a4d;
  --accent: #ff2d2d;
  --accent-2: #00ff9f;
  --accent-3: #ffcc00;
  --border: #252528;
  --asphalt: repeating-linear-gradient(
    90deg,
    transparent 0 60px,
    rgba(255,255,255,0.08) 60px 120px
  );
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Oswald', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  overflow-x: hidden;
  letter-spacing: 0.02em;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3 {
  font-family: 'Syncopate', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1;
}

.display {
  font-size: clamp(3rem, 10vw, 9rem);
  font-weight: 700;
  font-family: 'Syncopate', sans-serif;
  text-transform: uppercase;
  line-height: 0.9;
  letter-spacing: -0.02em;
}

.mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

a { color: var(--ink); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent); }

.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 1.25rem 2rem;
  background: rgba(10,10,11,0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: 'Syncopate', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-logo .dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
  box-shadow: 0 0 12px var(--accent);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
}

.nav-links {
  display: flex;
  gap: 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.nav-links a { position: relative; padding: 0.25rem 0; }

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--accent); }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 1.5rem;
  cursor: pointer;
}

main { padding-top: 70px; min-height: 100vh; }

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

section { padding: 6rem 0; position: relative; }

.hero {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 4rem 2rem;
}

.hero::before {
  content: '';
  position: absolute;
  bottom: 0; left: -50%;
  width: 200%; height: 40%;
  background: var(--asphalt);
  transform: perspective(400px) rotateX(65deg);
  transform-origin: top;
  opacity: 0.6;
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: 30%; right: -10%;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,45,45,0.15), transparent 70%);
  pointer-events: none;
  filter: blur(40px);
}

.hero-content {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2;
}

.hero-tag {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease both;
}

.hero h1 { margin-bottom: 1.5rem; animation: fadeInUp 0.8s 0.1s ease both; }

.hero h1 .line-2 {
  color: var(--accent);
  display: block;
  font-style: italic;
  transform: skewX(-5deg);
  margin-top: 1.5rem;
}

.hero-subtitle {
  font-size: clamp(1.15rem, 1.7vw, 1.4rem);
  color: var(--ink-dim);
  max-width: 640px;
  margin-bottom: 2.5rem;
  font-weight: 300;
  animation: fadeInUp 0.8s 0.2s ease both;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s 0.3s ease both;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  clip-path: polygon(0 0, 100% 0, 95% 100%, 0 100%);
  padding-right: 3rem;
}

.btn-primary:hover { background: var(--ink); transform: translateX(4px); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border);
  clip-path: polygon(5% 0, 100% 0, 100% 100%, 0 100%);
  padding-left: 3rem;
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 4rem 0;
}

.stat {
  background: var(--bg-2);
  padding: 2rem 1.5rem;
  position: relative;
}

.stat-value {
  font-family: 'Syncopate', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.section-header {
  margin-bottom: 4rem;
  display: flex;
  align-items: baseline;
  gap: 2rem;
  flex-wrap: wrap;
}

.section-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.2em;
}

.section-title { font-size: clamp(2rem, 5vw, 4rem); flex: 1; }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature {
  padding: 2.5rem 2rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.3s ease;
  overflow: hidden;
}

.feature::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 40px; height: 3px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.feature:hover { transform: translateY(-4px); border-color: var(--accent); }
.feature:hover::before { width: 100%; }

.feature-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-faint);
  letter-spacing: 0.2em;
  margin-bottom: 1.5rem;
}

.feature h3 { font-size: 1.3rem; margin-bottom: 1rem; letter-spacing: 0.04em; }

.feature p { color: var(--ink-dim); font-size: 0.95rem; font-weight: 300; }

.page-header {
  padding: 8rem 2rem 6rem;
  position: relative;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.page-header::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.page-header .container { position: relative; z-index: 2; }

.breadcrumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.breadcrumb .sep { color: var(--accent); margin: 0 0.5rem; }

.page-title { font-size: clamp(2.5rem, 7vw, 5rem); margin-bottom: 1rem; }

.page-subtitle {
  color: var(--ink-dim);
  font-size: 1.1rem;
  max-width: 600px;
  font-weight: 300;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-text h3 { font-size: 1.8rem; margin-bottom: 1.5rem; color: var(--accent); }

.about-text p {
  color: var(--ink-dim);
  margin-bottom: 1.25rem;
  font-weight: 300;
  font-size: 1rem;
  line-height: 1.7;
}

.about-sidebar {
  border-left: 2px solid var(--accent);
  padding-left: 2rem;
  position: sticky;
  top: 100px;
}

.sidebar-block { margin-bottom: 2.5rem; }

.sidebar-block h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 0.75rem;
}

.sidebar-block p {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  color: var(--ink);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}

.gallery-item {
  background: var(--bg-2);
  border: 1px solid var(--border);
  aspect-ratio: 16 / 10;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.gallery-item:hover { border-color: var(--accent); transform: scale(1.02); }

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(255,45,45,0.1),
    transparent 50%,
    rgba(0,255,159,0.05)
  );
  pointer-events: none;
}

.gallery-1 { grid-column: span 8; }
.gallery-2 { grid-column: span 4; }
.gallery-3 { grid-column: span 4; }
.gallery-4 { grid-column: span 4; }
.gallery-5 { grid-column: span 4; }
.gallery-6 { grid-column: span 6; }
.gallery-7 { grid-column: span 6; }

.gallery-placeholder {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-align: center;
  padding: 1rem;
}

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

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

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

.form-group label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 1rem;
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

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

.form-group textarea {
  resize: vertical;
  min-height: 150px;
  font-family: 'Oswald', sans-serif;
}

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

.info-block {
  padding: 2rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  position: relative;
}

.info-block::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--accent);
}

.info-block h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 0.75rem;
}

.info-block p,
.info-block a {
  font-size: 1.1rem;
  color: var(--ink);
  display: block;
  word-break: break-word;
}

footer {
  border-top: 1px solid var(--border);
  padding: 4rem 2rem 2rem;
  background: var(--bg-2);
  margin-top: 6rem;
}

.footer-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand h3 { font-size: 1.2rem; margin-bottom: 1rem; letter-spacing: 0.1em; }

.footer-brand p {
  color: var(--ink-dim);
  font-size: 0.9rem;
  font-weight: 300;
  max-width: 300px;
}

.footer-col h4 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 1rem;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a { font-size: 0.9rem; color: var(--ink); }

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--ink-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .about-grid,
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }

  .about-sidebar {
    border-left: none;
    border-top: 2px solid var(--accent);
    padding-left: 0;
    padding-top: 2rem;
    position: static;
  }

  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery-item { grid-column: span 1 !important; }

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

@media (max-width: 700px) {
  .nav { padding: 1rem; }
  .menu-toggle { display: block; }

  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg-2);
    flex-direction: column;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    display: none;
  }

  .nav-links.open { display: flex; }

  .hero { padding: 2rem 1rem; }
  .container { padding: 0 1rem; }
  section { padding: 4rem 0; }

  .hero-ctas { flex-direction: column; width: 100%; }
  .btn { width: 100%; justify-content: center; }

  .footer-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr; }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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

/* ============================================
   LANGUAGE TOGGLE BUTTON
   ============================================ */
.lang-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 0.4rem 0.8rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 1rem;
  text-transform: uppercase;
}

.lang-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* In RTL, shift margin to the other side */
body.rtl .lang-toggle {
  margin-left: 0;
  margin-right: 1rem;
}

/* ============================================
   RTL / ARABIC LAYOUT
   ============================================ */

/* Use Cairo for Arabic body text */
body.rtl {
  font-family: 'Cairo', 'Oswald', sans-serif;
  letter-spacing: 0;
}

/* Keep display/mono fonts intact, except swap headings to Cairo with stronger weight */
body.rtl h1,
body.rtl h2,
body.rtl h3,
body.rtl .display {
  font-family: 'Cairo', 'Syncopate', sans-serif;
  letter-spacing: 0;
  font-weight: 900;
}

body.rtl .page-title,
body.rtl .section-title,
body.rtl .display {
  letter-spacing: -0.01em;
}

/* RTL italic on line-2 doesn't look good — remove skew/italic */
body.rtl .hero h1 .line-2 {
  font-style: normal;
  transform: none;
}

/* Flip button arrows — in Arabic, "forward" direction is reversed */
body.rtl .btn {
  letter-spacing: 0.05em;
}

/* Breadcrumb separators flip automatically via dir=rtl on the container,
   but add some spacing tweaks */
body.rtl .breadcrumb {
  letter-spacing: 0;
}

/* Nav alignment flips naturally with dir=rtl, but fine-tune gap */
body.rtl .nav-links {
  letter-spacing: 0;
}

/* Feature numbers / section numbers stay LTR (they're codes) */
body.rtl .feature-num,
body.rtl .section-number,
body.rtl .hero-tag,
body.rtl .stat-value,
body.rtl .mono,
body.rtl .footer-bottom {
  direction: ltr;
  text-align: start;
  font-family: 'JetBrains Mono', 'Syncopate', monospace;
}

body.rtl .stat-label,
body.rtl .sidebar-block h4,
body.rtl .info-block h4,
body.rtl .footer-col h4,
body.rtl .form-group label {
  letter-spacing: 0;
  font-family: 'Cairo', 'JetBrains Mono', sans-serif;
}

/* Sidebar accent line flips to right side in RTL */
body.rtl .about-sidebar {
  border-left: none;
  border-right: 2px solid var(--accent);
  padding-left: 0;
  padding-right: 2rem;
}

@media (max-width: 900px) {
  body.rtl .about-sidebar {
    border-right: none;
    border-top: 2px solid var(--accent);
    padding-right: 0;
  }
}

/* Info block left accent flips to right */
body.rtl .info-block::before {
  left: auto;
  right: 0;
}

/* Feature top accent line — already spans from left, keep but mirror origin */
body.rtl .feature::before {
  left: auto;
  right: 0;
}

/* Hero asphalt + glow — keep as-is, visual only */

/* Button clip-paths: flip the angled cuts */
body.rtl .btn-primary {
  clip-path: polygon(5% 0, 100% 0, 100% 100%, 0 100%);
  padding-right: 2rem;
  padding-left: 3rem;
}

body.rtl .btn-secondary {
  clip-path: polygon(0 0, 95% 0, 100% 100%, 0 100%);
  padding-left: 2rem;
  padding-right: 3rem;
}

/* Nav dot — keep on the start side, naturally flips */

/* Hero title — in Arabic the accent color on the second line works, just make sure it's right-aligned */
body.rtl .hero-subtitle,
body.rtl .page-subtitle,
body.rtl .about-text p,
body.rtl .feature p {
  line-height: 1.8;
}

/* Footer brand — tagline max-width stays */
body.rtl .footer-brand p {
  max-width: 300px;
}

/* Nav-logo — keep brand name readable (it's English branding) */
body.rtl .nav-logo {
  direction: ltr;
  letter-spacing: 0.15em;
}
