/* ============================================================
   شركة الأخوة للمقاولات والتوريدات العمومية — brothers-pro.com
   Industrial 3D landing page
   ============================================================ */

:root {
  --navy-900: #0B1F35;
  --navy-700: #123A63;
  --navy-600: #17497c;
  --gold: #C9973E;
  --gold-600: #b3822f;
  --gold-800: #93691E;
  --paper: #F5F2EA;
  --white: #FFFFFF;
  --steel: #5A6B78;
  --steel-200: #d7dde1;

  --ink: var(--navy-900);
  --bg: var(--paper);

  --font-head-ar: "Cairo", "Space Grotesk", system-ui, sans-serif;
  --font-body-ar: "Tajawal", "Inter", system-ui, sans-serif;

  --maxw: 1160px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 4px 14px rgba(11, 31, 53, .08);
  --shadow-md: 0 18px 40px rgba(11, 31, 53, .14);
  --shadow-gold: 0 10px 30px rgba(201, 151, 62, .35);
  --header-h: 74px;
}

html[lang="en"] {
  --font-head-ar: "Space Grotesk", "Cairo", system-ui, sans-serif;
  --font-body-ar: "Inter", "Tajawal", system-ui, sans-serif;
}

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

html {
  font-size: 100%;                 /* deterministic 16px rem base */
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  overflow-x: hidden;
}

body {
  font-family: var(--font-body-ar);
  font-size: 1rem;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { font-family: var(--font-head-ar); line-height: 1.2; font-weight: 800; }

a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 22px; }

.section { padding: clamp(64px, 9vw, 120px) 0; }

.section-head { max-width: 640px; margin-bottom: 46px; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 6px 0 12px; }
.section-lead { color: var(--steel); font-size: 1.05rem; }

.eyebrow {
  font-family: var(--font-head-ar);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: .82rem;
  color: var(--gold-800);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--gold); display: inline-block; }
.eyebrow--light { color: var(--gold); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--gold);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-head-ar);
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 26px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--navy-900); box-shadow: var(--shadow-gold); }
.btn-gold:hover { background: var(--gold-800); color: var(--white); }
.btn-ghost { background: transparent; color: var(--white); border-color: rgba(255, 255, 255, .5); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-sm { padding: 10px 18px; font-size: .92rem; }
.btn-lg { padding: 17px 34px; font-size: 1.1rem; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  inset-inline-start: -999px;
  top: 0;
  z-index: 999;
  background: var(--navy-900);
  color: var(--white);
  padding: 10px 18px;
}
.skip-link:focus { inset-inline-start: 12px; top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: rgba(11, 31, 53, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  transition: background .3s ease;
}
.site-header.scrolled { background: rgba(11, 31, 53, .97); }

.header-inner { display: flex; align-items: center; gap: 20px; height: 100%; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--white); }
.brand-mark { height: 40px; width: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-head-ar); font-size: 1.05rem; }
.brand-text small { font-size: .7rem; color: var(--steel-200); }

.main-nav { display: flex; gap: 26px; margin-inline: auto; }
.main-nav a {
  color: rgba(255, 255, 255, .82);
  font-family: var(--font-head-ar);
  font-weight: 600;
  font-size: .95rem;
  padding: 6px 2px;
  position: relative;
}
.main-nav a::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform .2s ease;
}
.main-nav a:hover, .main-nav a:focus-visible { color: var(--white); }
.main-nav a:hover::after, .main-nav a:focus-visible::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.lang-toggle {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, .4);
  color: var(--white);
  font-family: var(--font-head-ar);
  font-weight: 700;
  font-size: .85rem;
  width: 42px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.lang-toggle:hover { border-color: var(--gold); color: var(--gold); }

.nav-burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-burger span { width: 24px; height: 2px; background: var(--white); transition: transform .25s ease, opacity .2s ease; }
.nav-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;            /* fallback for older engines */
  min-height: 100svh;           /* excludes mobile browser chrome */
  max-height: 1100px;           /* don't tower over on very tall desktops */
  display: flex;
  align-items: center;
  background: radial-gradient(120% 90% at 70% 20%, #143354 0%, var(--navy-900) 55%, #06121f 100%);
  color: var(--white);
  overflow: hidden;
}
#heroCanvas, .hero-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-poster {
  background:
    radial-gradient(60% 60% at 75% 40%, rgba(201, 151, 62, .28), transparent 70%),
    url("../img/logo-emblem.webp") no-repeat 78% center / min(440px, 58%);
  opacity: 0;
  transition: opacity .4s ease;
}
.hero.poster-mode #heroCanvas { display: none; }
.hero.poster-mode .hero-poster { opacity: 1; }

/* Overlay darkens the side the copy sits on. Base = LTR (copy left).
   RTL flips it so Arabic copy (right) also lands on the dark side. */
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(6, 18, 31, .94) 0%, rgba(6, 18, 31, .6) 42%, rgba(6, 18, 31, .12) 100%);
}
html[dir="rtl"] .hero-overlay { transform: scaleX(-1); }

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 40rem;
  padding-block: clamp(96px, 16vh, 150px) clamp(64px, 11vh, 100px);
}
.hero-kicker {
  font-family: var(--font-head-ar);
  letter-spacing: .06em;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 18px;
  font-size: clamp(.82rem, 2.4vw, .95rem);
}
.hero-title {
  font-size: clamp(2.05rem, 7vw, 4.2rem);
  font-weight: 900;
  line-height: 1.08;
  margin-bottom: 20px;
  text-wrap: balance;
  text-shadow: 0 10px 40px rgba(0, 0, 0, .4);
}
.hero-sub { font-size: clamp(1rem, 2.2vw, 1.2rem); color: rgba(255, 255, 255, .88); max-width: 34rem; margin-bottom: 34px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; }

.hero-scroll {
  position: absolute;
  inset-inline-start: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, .4);
  border-radius: 14px;
  z-index: 2;
}
.hero-scroll span {
  position: absolute;
  inset-inline-start: 50%;
  top: 8px;
  width: 4px;
  height: 8px;
  background: var(--gold);
  border-radius: 2px;
  transform: translateX(-50%);
  animation: scrollDot 1.6s ease-in-out infinite;
}
@keyframes scrollDot { 0%, 100% { opacity: 0; transform: translate(-50%, 0); } 50% { opacity: 1; transform: translate(-50%, 12px); } }

/* ---------- Trust bar ---------- */
.trust {
  background: var(--navy-700);
  color: var(--white);
  padding: 42px 0;
  border-bottom: 4px solid var(--gold);
}
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.trust-item { display: flex; flex-direction: column; gap: 6px; padding: 8px; }
.trust-item + .trust-item { border-inline-start: 1px solid rgba(255, 255, 255, .12); }
.trust-num { font-family: var(--font-head-ar); font-weight: 900; font-size: clamp(2rem, 5vw, 3rem); color: var(--gold); }
.trust-num--text { font-size: clamp(1.4rem, 3.5vw, 2rem); }
.trust-label { font-size: .95rem; color: rgba(255, 255, 255, .8); }
.trust-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--navy-900);
  font-family: var(--font-head-ar);
  font-weight: 800;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 1.02rem;
  box-shadow: var(--shadow-gold);
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 54px; align-items: center; }
.media-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--navy-700), var(--navy-900));
  border: 1px solid var(--steel-200);
  box-shadow: var(--shadow-md);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.about-emblem { width: 62%; opacity: .9; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .4)); }
.media-note {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  background: rgba(6, 18, 31, .7);
  color: rgba(255, 255, 255, .85);
  font-size: .85rem;
  padding: 8px;
  text-align: center;
}
.about-text h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin: 8px 0 16px; }
.about-text p { color: #3c4b57; margin-bottom: 14px; }
.about-points { list-style: none; margin-top: 20px; display: grid; gap: 10px; }
.about-points li { position: relative; padding-inline-start: 28px; color: var(--ink); font-weight: 500; }
.about-points li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: .55em;
  width: 12px;
  height: 12px;
  background: var(--gold);
  transform: rotate(45deg);
}

/* ---------- Cards grid (services) ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.card {
  background: var(--white);
  border: 1px solid var(--steel-200);
  border-radius: var(--radius);
  padding: 30px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  transform-style: preserve-3d;
  will-change: transform;
}
.card:hover { box-shadow: var(--shadow-md); border-color: var(--gold); }
.card-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  font-size: 1.7rem;
  background: linear-gradient(145deg, var(--navy-700), var(--navy-900));
  color: var(--gold);
  border-radius: 14px;
  margin-bottom: 18px;
  box-shadow: 0 10px 22px rgba(11, 31, 53, .25);
}
.card h3 { font-size: 1.16rem; margin-bottom: 8px; }
.card p { color: var(--steel); font-size: .95rem; }

/* ---------- Why us ---------- */
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.why-item {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  padding: 34px 28px;
  border: 1px solid var(--steel-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.why-num { font-family: var(--font-head-ar); font-weight: 900; font-size: 2.4rem; color: var(--steel-200); margin-bottom: 8px; }
.why-item h3 { font-size: 1.2rem; margin-bottom: 10px; }
.why-item p { color: var(--steel); font-size: .96rem; }
.why-item--feature {
  background: linear-gradient(160deg, var(--navy-700), var(--navy-900));
  color: var(--white);
  border-color: var(--gold);
}
.why-item--feature .why-num { color: rgba(201, 151, 62, .4); }
.why-item--feature p { color: rgba(255, 255, 255, .85); }
.why-tag {
  position: absolute;
  inset-inline-end: -34px;
  top: 20px;
  background: var(--gold);
  color: var(--navy-900);
  font-family: var(--font-head-ar);
  font-weight: 800;
  font-size: .72rem;
  padding: 5px 40px;
  transform: rotate(45deg);
}
html[dir="ltr"] .why-tag { transform: rotate(-45deg); inset-inline-end: auto; inset-inline-start: -34px; }

/* ---------- Sectors ---------- */
.sectors-grid { display: flex; flex-wrap: wrap; gap: 14px; }
.sector-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--steel-200);
  border-radius: 999px;
  padding: 12px 22px;
  font-family: var(--font-head-ar);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.sector-chip span:first-child { font-size: 1.2rem; }

/* ---------- Portfolio ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  border: 1px solid var(--steel-200);
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
  transform-style: preserve-3d;
}
.gallery-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(201, 151, 62, .06) 0 12px, transparent 12px 24px);
}
.gallery-item::after {
  content: attr(data-label);
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 14px 16px;
  background: linear-gradient(transparent, rgba(6, 18, 31, .9));
  color: var(--white);
  font-family: var(--font-head-ar);
  font-weight: 600;
  font-size: .92rem;
}
.gallery-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gallery-item:hover { box-shadow: var(--shadow-md); }
.gallery-note { margin-top: 18px; color: var(--steel); font-size: .9rem; }

/* ---------- Testimonials ---------- */
/* slides stack in one grid cell so the section height = tallest slide
   (no layout jump as it auto-rotates on narrow screens) */
.testi-slider { position: relative; max-width: 780px; display: grid; }
.testi-slide {
  grid-area: 1 / 1;
  visibility: hidden;
  opacity: 0;
  transition: opacity .4s ease;
}
.testi-slide.is-active { visibility: visible; opacity: 1; }
.testi-slide p {
  font-family: var(--font-head-ar);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  line-height: 1.5;
  color: var(--navy-700);
  margin-bottom: 16px;
}
.testi-slide footer { color: var(--steel); font-size: .95rem; }
.testi-dots { display: flex; gap: 8px; margin-top: 24px; }
.testi-dots button {
  width: 10px; height: 10px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--steel-200); transition: background .2s ease, transform .2s ease;
}
.testi-dots button[aria-current="true"] { background: var(--gold); transform: scale(1.3); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Contact ---------- */
.contact {
  position: relative;
  min-height: 620px;
  display: flex;
  align-items: center;
  background: radial-gradient(120% 100% at 20% 10%, #143354, var(--navy-900) 60%, #06121f);
  color: var(--white);
  overflow: hidden;
}
#contactCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* scrim: keeps the 3D reading as atmosphere and the text legible on top of it */
.contact::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(6, 18, 31, .35) 0%, rgba(6, 18, 31, .58) 55%, rgba(6, 18, 31, .78) 100%);
  pointer-events: none;
}
.contact-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.1fr 1fr; gap: 50px; align-items: center; width: 100%; }
.contact-head h2 { font-size: clamp(1.8rem, 4.5vw, 2.9rem); margin: 10px 0 14px; }
.contact-head p { color: rgba(255, 255, 255, .85); margin-bottom: 26px; max-width: 440px; }
.contact-cards { display: grid; gap: 18px; }
.contact-card {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius);
  padding: 22px 24px;
  backdrop-filter: blur(4px);
}
.contact-card h3 { font-size: 1.05rem; color: var(--gold); margin-bottom: 6px; }
.contact-card h3 + h3 { margin-top: 14px; }
.contact-card p { color: rgba(255, 255, 255, .9); font-size: .98rem; }
.contact-card a:hover { color: var(--gold); }

/* ---------- Footer ---------- */
.site-footer { background: #06121f; color: rgba(255, 255, 255, .8); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-block: 60px 40px; }
.footer-brand img { background: rgba(255, 255, 255, .96); border-radius: 10px; padding: 10px; margin-bottom: 14px; }
.footer-brand p { font-size: .95rem; max-width: 320px; }
.footer-links, .footer-contact { display: flex; flex-direction: column; gap: 8px; }
.footer-links h4, .footer-contact h4 { color: var(--white); font-size: 1rem; margin-bottom: 6px; }
.footer-links a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .1); padding: 20px 0; font-size: .85rem; text-align: center; }

/* ---------- WhatsApp float ---------- */
.wa-float {
  position: fixed;
  inset-inline-end: 20px;
  bottom: 20px;
  z-index: 90;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: var(--white);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px rgba(37, 211, 102, .5);
  transition: transform .2s ease;
}
.wa-float:hover { transform: scale(1.08); }

/* ---------- Reveal animation ---------- */
[data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .6s ease; }
[data-reveal].is-visible { opacity: 1; transform: none; }

/* ---------- Focus ---------- */
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

/* ---------- Responsive ---------- */

/* laptop / small desktop: keep the grid tighter so cards don't get gangly */
@media (max-width: 1180px) {
  .container { max-width: 960px; }
}

@media (max-width: 1000px) {
  .container { max-width: 100%; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: 1fr; }
  .about-grid, .contact-inner { grid-template-columns: 1fr; gap: 40px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section-head { margin-bottom: 38px; }
}

@media (max-width: 720px) {
  .container { padding-inline: 18px; }
  .main-nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: rgba(11, 31, 53, .98);
    padding: 10px 22px 20px;
    transform: translateY(-120%);
    transition: transform .3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
  }
  .main-nav.open { transform: translateY(0); }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); width: 100%; }
  .nav-burger { display: flex; }
  .header-inner .btn-gold { display: none; }
  .brand-text small { display: none; }

  /* let long Arabic CTA labels breathe; full-width tap targets on phones */
  .btn { white-space: normal; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
  .contact-head .btn { width: 100%; }

  /* uniform top-to-bottom darkening so hero copy is legible whatever side it sits on */
  .hero-overlay,
  html[dir="rtl"] .hero-overlay {
    transform: none;
    background: linear-gradient(180deg, rgba(6, 18, 31, .5) 0%, rgba(6, 18, 31, .82) 100%);
  }

  .trust-grid { grid-template-columns: repeat(2, 1fr); gap: 22px 12px; }
  .trust-item + .trust-item { border-inline-start: 0; }
  .trust-item--badge { grid-column: 1 / -1; }
  .cards-grid, .gallery { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .contact { min-height: 0; }
  #contactCanvas { opacity: .5; }
  .contact::before { background: linear-gradient(180deg, rgba(6, 18, 31, .55), rgba(6, 18, 31, .82)); }
  .contact-card { backdrop-filter: none; background: rgba(255, 255, 255, .08); }
}

/* short viewports (landscape phones, small laptops): don't let the hero eat the page */
@media (max-height: 720px) {
  .hero { max-height: none; }
  .hero-content { padding-block: 92px 44px; }
  .hero-scroll { display: none; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .hero-scroll span { animation: none; }
}
