/* Black Energy Tech additions, loaded after the template styles. */

.lang-switch {
  padding: 4px 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 100px;
}
.lang-switch[lang="ar"] { font-family: 'Tajawal', 'Inter', sans-serif; }
.mobile-menu__nav .lang-switch { align-self: flex-start; }
[data-theme="light"] .mobile-menu__nav .lang-switch { border-color: rgba(0, 0, 0, 0.2); }

/* Six services: 3 columns on desktop, 2 on tablet */
@media (min-width: 1201px) {
  .services__grid--six { grid-template-columns: repeat(3, 1fr); }
  .services__grid--six .service-card:nth-child(3n) { border-right: none; }
  .services__grid--six .service-card:nth-child(-n+3) { border-bottom: 1px solid var(--border-subtle); }
}
@media (min-width: 769px) and (max-width: 1200px) {
  .services__grid--six .service-card:nth-child(2n) { border-right: none; }
  .services__grid--six .service-card:nth-child(-n+4) { border-bottom: 1px solid var(--border-subtle); }
}
html[dir="rtl"] .services__grid--six .service-card { border-right: none; border-left: 1px solid var(--border-subtle); }
@media (min-width: 1201px) {
  html[dir="rtl"] .services__grid--six .service-card:nth-child(3n) { border-left: none; }
}
@media (min-width: 769px) and (max-width: 1200px) {
  html[dir="rtl"] .services__grid--six .service-card:nth-child(2n) { border-left: none; }
}
@media (max-width: 768px) {
  html[dir="rtl"] .services__grid--six .service-card { border-left: none; }
}

/* Hero contact buttons */
.social-icon svg { width: 16px; height: 16px; }
.social-icon:hover { opacity: 0.7; }

/* Contact forms */
.form-status { min-height: 20px; font-size: 14px; line-height: 20px; color: var(--text-muted); }
.form-status--ok { color: #3ddc84; }
.form-status--error { color: #ff6b4a; }
/* Hidden in place: an off-screen offset becomes scrollable overflow on RTL pages */
.form-hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; opacity: 0; pointer-events: none; }
form button[disabled] { opacity: 0.6; cursor: wait; }

.site-footer__col-text a,
.contact-page__info-text a { color: inherit; text-decoration: none; }
.site-footer__col-text a:hover,
.contact-page__info-text a:hover { opacity: 0.7; }

/* Why us rows read at full strength */
.why-us .award-row { opacity: 1; }
.why-us .award-row__source { color: var(--text-muted); }

/* Privacy page */
.legal { padding: 100px 0; }
.legal__inner { max-width: 760px; margin: 0 auto; }
.legal h2 { margin: 40px 0 12px; font-size: 24px; line-height: 32px; font-weight: 500; color: var(--text-white); }
.legal p, .legal li { font-size: 16px; line-height: 26px; color: var(--text-muted); }
.legal ul { padding-inline-start: 22px; list-style: disc; }
.legal a { color: var(--text-white); }

/* Contact icons follow the theme: light mode paints the circles pale */
.social-icon { color: #fff; }
[data-theme="light"] .social-icon { color: #1a1a1a; }
.social-icon svg [stroke] { stroke: currentColor; }
.social-icon svg [fill="white"] { fill: currentColor; }

/* The mobile menu has its own theme switch; the header copy overlaps the logo on phones */
@media (max-width: 768px) {
  #bet-rocker-desktop { display: none; }
}

/* Contact form on phones: the template keeps its 60px desktop padding */
.contact-page__grid > * { min-width: 0; }
@media (max-width: 768px) {
  .contact-page__form-wrap { padding: 32px 20px; border-radius: 32px; }
  .contact-page__grid { gap: 48px; }
}

/* Dropdown arrow sits on the end side; in Arabic that is the left */
html:not([dir="rtl"]) .form-group select { padding-right: 44px; }
html[dir="rtl"] .form-group select { background-position: left 18px center; padding-left: 44px; padding-right: 18px; }
.legal p + p { margin-top: 12px; }

/* ===== Theme switch: physical rocker ===== */
.navbar__actions { display: inline-flex; align-items: center; gap: 18px; flex-shrink: 0; }

.bet-switch {
  --lit: #ff5a0a;
  position: relative;
  flex-shrink: 0;
  width: 88px;
  height: 40px;
  padding: 4px;
  border: 0;
  border-radius: 11px;
  direction: ltr;
  cursor: pointer;
  background: linear-gradient(180deg, #030303, #0b0b0b);
  box-shadow:
    0 0 0 1px #1d1d1d,
    0 1px 0 1px rgba(255, 255, 255, 0.07),
    0 10px 20px -8px rgba(0, 0, 0, 0.9),
    inset 0 2px 6px rgba(0, 0, 0, 0.95);
  -webkit-tap-highlight-color: transparent;
}
.bet-switch:focus-visible { outline: 2px solid rgba(255, 90, 10, 0.6); outline-offset: 4px; }

/* Light bleeding along the bezel beside the lit half */
.bet-switch::before,
.bet-switch::after {
  content: '';
  position: absolute;
  left: 9%;
  width: 38%;
  height: 1px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--lit) 50%, transparent);
  box-shadow: 0 0 6px 1px rgba(255, 90, 10, 0.5);
  transition: left 0.4s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.bet-switch::before { top: 1px; }
.bet-switch::after { bottom: 1px; }
[data-theme="light"] .bet-switch::before,
[data-theme="light"] .bet-switch::after { left: 53%; }

.bet-switch__plate {
  position: relative;
  display: flex;
  width: 100%;
  height: 100%;
  perspective: 150px;
}

.bet-switch__half {
  position: relative;
  flex: 1;
  display: grid;
  place-items: center;
  transition: transform 0.4s cubic-bezier(0.3, 0.7, 0.2, 1), background 0.4s ease, box-shadow 0.4s ease, color 0.4s ease;
}
.bet-switch__half svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: filter 0.4s ease;
}
.bet-switch__half--dark { border-radius: 8px 0 0 8px; transform-origin: right center; }
.bet-switch__half--light { border-radius: 0 8px 8px 0; transform-origin: left center; }

/* Pressed flat and lit */
.bet-switch__half--dark,
[data-theme="light"] .bet-switch__half--light {
  z-index: 0;
  color: var(--lit);
  transform: none;
  background: linear-gradient(180deg, #0c0c0c, #141414);
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.9), inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}
.bet-switch__half--dark svg,
[data-theme="light"] .bet-switch__half--light svg {
  filter: drop-shadow(0 0 2px rgba(255, 110, 20, 1)) drop-shadow(0 0 7px rgba(255, 90, 10, 0.65));
}

/* Raised, tilted towards the viewer, label engraved */
.bet-switch__half--light,
[data-theme="light"] .bet-switch__half--dark {
  z-index: 1;
  color: #050505;
  background: linear-gradient(180deg, #333 0%, #1d1d1d 40%, #0f0f0f 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -2px 3px rgba(0, 0, 0, 0.65),
    0 7px 10px -3px rgba(0, 0, 0, 0.9);
}
.bet-switch__half--light svg,
[data-theme="light"] .bet-switch__half--dark svg { filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.14)); }
.bet-switch__half--light { transform: rotateY(-18deg); }
[data-theme="light"] .bet-switch__half--dark { transform: rotateY(18deg); }

/* Side face of the lifted end */
.bet-switch__half::after {
  content: '';
  position: absolute;
  top: 8%;
  bottom: 8%;
  width: 4px;
  opacity: 0;
  border-radius: 2px;
  transition: opacity 0.4s ease;
}
.bet-switch__half--light::after { right: -2px; opacity: 1; background: linear-gradient(90deg, #262626, #070707); }
.bet-switch__half--dark::after { left: -2px; background: linear-gradient(90deg, #070707, #262626); }
[data-theme="light"] .bet-switch__half--light::after { opacity: 0; }
[data-theme="light"] .bet-switch__half--dark::after { opacity: 1; }

.bet-switch:hover .bet-switch__half--light,
[data-theme="light"] .bet-switch:hover .bet-switch__half--dark { filter: brightness(1.15); }

@media (prefers-reduced-motion: reduce) {
  .bet-switch::before, .bet-switch::after, .bet-switch__half, .bet-switch__half svg { transition: none; }
}

/* Phone menu: labeled row above the call-to-action */
.mobile-menu__theme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding: 12px 12px 12px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: #eee;
  font-size: 16px;
  font-weight: 500;
}
html[dir="rtl"] .mobile-menu__theme { padding: 12px 16px 12px 12px; }
[data-theme="light"] .mobile-menu__theme { background: rgba(0, 0, 0, 0.04); color: #1a1a1a; }
@media (max-width: 768px) {
  #bet-switch-desktop { display: none; }
}

/* ===== Header: one fixed height; scrolling only adds a backdrop ===== */
.navbar,
.navbar.scrolled {
  height: 84px;
  padding-top: 0;
  padding-bottom: 0;
  border-bottom: 1px solid transparent;
  transition: background-color 0.35s ease, border-color 0.35s ease;
}
.navbar.scrolled {
  background-color: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}
@media (max-width: 768px) {
  .navbar,
  .navbar.scrolled { height: 64px; }
}

/* ===== Light mode corrections ===== */
[data-theme="light"] { --text-muted: #6E6A66; }
[data-theme="light"] .site-footer__links a { color: var(--text-primary); }
[data-theme="light"] .site-footer__links a:hover,
[data-theme="light"] .site-footer__back-top:hover { color: #000; }
[data-theme="light"] .site-footer .navbar__logo-text-img { filter: brightness(0.08); }
[data-theme="light"] .about-stat__label { color: var(--text-muted); border-bottom-color: var(--border-subtle); }

/* ===== Team cards: icon medallion ===== */
.team-card__icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 96px;
  pointer-events: none;
}
/* Soft bloom under the disc, lit from below */
.team-card__icon::before {
  content: '';
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 70, 1, 0.34) 0%, rgba(233, 16, 5, 0.14) 38%, transparent 68%);
  filter: blur(14px);
  transform: translateY(18px);
  opacity: 0.75;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
/* Two faint orbit rings */
.team-card__icon::after {
  content: '';
  position: absolute;
  width: 176px;
  height: 176px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.07);
  outline: 1px solid rgba(255, 255, 255, 0.035);
  outline-offset: 30px;
  transition: transform 0.6s ease, border-color 0.6s ease;
}
.team-card__disc {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 18%, #323232 0%, #181818 48%, #0b0b0b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -12px 24px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 22px 40px -14px rgba(0, 0, 0, 0.9);
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.team-card__disc img { width: 50px; height: 50px; filter: drop-shadow(0 0 10px rgba(255, 70, 1, 0.35)); }
.team-card__role { max-width: 300px; }
.team-card:hover .team-card__disc { transform: translateY(-4px); }
.team-card:hover .team-card__icon::before { opacity: 1; transform: translateY(12px) scale(1.08); }
.team-card:hover .team-card__icon::after { transform: scale(1.04); border-color: rgba(255, 255, 255, 0.1); }
[data-theme="light"] .team-card__disc {
  background: radial-gradient(120% 120% at 30% 18%, #ffffff 0%, #f5f2ee 55%, #e7e2dc 100%);
  box-shadow: inset 0 1px 0 #fff, inset 0 -10px 20px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.06), 0 22px 36px -16px rgba(0, 0, 0, 0.28);
}
[data-theme="light"] .team-card__icon::after { border-color: rgba(0, 0, 0, 0.08); outline-color: rgba(0, 0, 0, 0.04); }
[data-theme="light"] .team-card__icon::before { background: radial-gradient(circle, rgba(255, 70, 1, 0.22) 0%, transparent 65%); }
@media (prefers-reduced-motion: reduce) {
  .team-card__disc, .team-card__icon::before, .team-card__icon::after { transition: none; }
}

/* ===== Floating WhatsApp button ===== */
.wa-float {
  position: fixed;
  inset-block-end: 24px;
  inset-inline-end: 24px;
  z-index: 90;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 6px 18px rgba(255, 70, 1, 0.45));
  transition: transform 0.3s cubic-bezier(0.3, 0.7, 0.2, 1), filter 0.3s ease;
}
.wa-float svg { width: 100%; height: 100%; }
.wa-float:hover { transform: translateY(-3px) scale(1.04); filter: drop-shadow(0 10px 26px rgba(255, 70, 1, 0.6)); }
.wa-float:focus-visible { outline: 2px solid #ff5a0a; outline-offset: 4px; border-radius: 50%; }
@media (max-width: 768px) {
  .wa-float { width: 52px; height: 52px; inset-block-end: 16px; inset-inline-end: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .wa-float { transition: none; }
}

/* Project detail text is hard-coded light for the dark theme */
[data-theme="light"] .blog-detail__heading,
[data-theme="light"] .blog-detail__points li { color: var(--text-primary); }
[data-theme="light"] .blog-detail__text { color: var(--text-muted); }

/* Header columns: logo | centered nav | actions, so the nav stays centered whatever the side widths */
.navbar__container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 24px;
}
.navbar__logo { justify-self: start; }
.navbar__nav { justify-self: center; }
.navbar__actions,
.navbar__cta,
.navbar__burger { justify-self: end; }
@media (max-width: 768px) {
  .navbar__container { grid-template-columns: 1fr auto; }
  .navbar__actions { display: none; }
}

/* Template set line height equal to font size here; lines touched */
.hero__description p { line-height: 1.35; }
.about__text { line-height: 1.4; }

/* Footer call-to-action hugs its text instead of stretching across the column */
.footer__cta { align-items: flex-start; }

/* Keep the last footer row clear of the floating WhatsApp button */
.footer,
.site-footer { padding-bottom: 96px; }
@media (max-width: 768px) {
  .footer,
  .site-footer { padding-bottom: 80px; }
}

/* Footer logo link shrink-wraps so it sits at the column start in both directions */
.footer__brand .navbar__logo,
.site-footer__brand .navbar__logo { align-self: flex-start; }
.about-intro__text p { line-height: 1.45; }

/* Required fields left empty after a send attempt */
.was-validated :is(input, select, textarea):invalid { border-color: rgba(255, 107, 74, 0.85); }

/* Project detail: images sat flush against the next heading */
.blog-detail__banner { margin-bottom: 40px; }

/* The template's 3D service icons carry a white glow meant for dark backgrounds */
[data-theme="light"] .service-card__icon img { mix-blend-mode: multiply; }

/* Team section: the dotted wave is painted for dark mode; invert it so light mode keeps the dots without a grey block */
[data-theme="light"] .team__bg { filter: invert(1); opacity: 0.85; }

/* Question toggles sit on the orange gradient in both themes; keep the mark white */
[data-theme="light"] .faq-item__icon { color: #fff; }

/* Light mode redefines --text-white as near-black; text on dark or orange surfaces must stay white */
[data-theme="light"] .btn-primary,
[data-theme="light"] .inner-contact-card--left .inner-contact__title { color: #fff; }
[data-theme="light"] .inner-contact__sub { color: var(--text-primary); }

/* Project cards sit on dark photos in both themes */
[data-theme="light"] :is(.project-card, .proj-card) :is(.tag, .award-title, .project-card__subtitle, .proj-card__subtitle, .proj-card__award-title) { color: #fff; }
[data-theme="light"] :is(.project-card, .proj-card) .tag { background: rgba(255, 255, 255, 0.12); }
[data-theme="light"] :is(.project-card, .proj-card) :is(.award-date, .proj-card__award-date) { color: rgba(255, 255, 255, 0.6); }

/* Pricing step numbers sit on the orange disc */
[data-theme="light"] .pricing-card__number { color: #fff; }
