/* ============================================================
   Modar LLC — single-page site
   Visual language: HeroUI (dark) + Modar red + tech/3D motifs
   ============================================================ */

:root {
  /* ---- Brand red scale (anchored on logo #C40C0C) ---- */
  --red-50:  #fff1f1;
  --red-100: #ffdcdc;
  --red-200: #ffb8b8;
  --red-300: #ff8585;
  --red-400: #f74b4b;
  --red-500: #e01717;   /* primary */
  --red-600: #c40c0c;   /* logo */
  --red-700: #a30a0a;
  --red-glow: #ff2f2f;

  --primary: var(--red-500);
  --primary-600: var(--red-600);

  /* ---- HeroUI dark neutral layers (zinc-based) ---- */
  --bg:        #08080a;   /* page */
  --content1:  #111114;   /* cards */
  --content2:  #18181b;
  --content3:  #232328;
  --content4:  #2e2e35;
  --border:    rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.16);

  --fg:        #ECEDEE;   /* primary text */
  --fg-soft:   #b4b4bd;   /* secondary text */
  --fg-mute:   #82828d;   /* tertiary/labels */

  /* ---- Radii (HeroUI) ---- */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  /* ---- Shadows (HeroUI soft, layered) ---- */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow-md: 0 0 1px rgba(0,0,0,.6), 0 8px 30px rgba(0,0,0,.45);
  --shadow-lg: 0 0 1px rgba(0,0,0,.6), 0 24px 60px rgba(0,0,0,.55);
  --glow-red: 0 0 0 1px rgba(224,23,23,.35), 0 12px 50px rgba(224,23,23,.35);

  /* ---- Type ---- */
  --font-ui:      "Inter", system-ui, sans-serif;
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, monospace;
  --font-ar:      "Tajawal", "Inter", sans-serif;

  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
[dir="rtl"] body, [dir="rtl"] { font-family: var(--font-ar); }
[dir="rtl"] .mono, [dir="rtl"] .eyebrow { font-family: var(--font-mono); } /* keep tech labels mono */

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
section { position: relative; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------------- Typography helpers ---------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--red-400);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: linear-gradient(90deg, var(--red-500), transparent);
}
[dir="rtl"] .eyebrow::before { background: linear-gradient(270deg, var(--red-500), transparent); }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; line-height: 1.08; margin: 0; }
.display { font-size: clamp(40px, 6vw, 74px); font-weight: 700; }
.h2 { font-size: clamp(30px, 4vw, 46px); }
.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--fg-soft); line-height: 1.65; }
.muted { color: var(--fg-mute); }
.grad-red {
  background: linear-gradient(120deg, #ff5a5a 0%, var(--red-500) 45%, var(--red-600) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------------- Buttons (HeroUI) ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 48px; padding: 0 22px;
  border-radius: var(--r-md);
  font-family: var(--font-ui); font-weight: 600; font-size: 15px;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .12s ease, opacity .18s ease, background .18s ease, border-color .18s ease;
  white-space: nowrap; user-select: none;
}
[dir="rtl"] .btn { font-family: var(--font-ar); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 26px rgba(224,23,23,.32); }
.btn-primary:hover { opacity: .92; }
.btn-bordered { background: transparent; color: var(--fg); border-color: var(--border-strong); }
.btn-bordered:hover { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.28); }
.btn-ghost { background: transparent; color: var(--fg-soft); }
.btn-ghost:hover { color: var(--fg); background: rgba(255,255,255,.05); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 14px; }
.btn .ic { width: 18px; height: 18px; }

/* ---------------- Chips / badges ---------------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 13px; border-radius: var(--r-full);
  background: rgba(255,255,255,.05); border: 1px solid var(--border);
  font-size: 13px; color: var(--fg-soft); font-weight: 500;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red-500); box-shadow: 0 0 10px var(--red-glow); }
.chip .ic { width: 15px; height: 15px; color: var(--red-400); }

/* ---------------- Navbar ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px) saturate(140%);
  background: rgba(8,8,10,.62);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--border); background: rgba(8,8,10,.85); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 74px; gap: 20px; }
.nav-logo img { height: 26px; width: auto; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 9px 14px; border-radius: var(--r-sm); font-size: 14.5px; font-weight: 500;
  color: var(--fg-soft); transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--fg); background: rgba(255,255,255,.05); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.lang-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 14px; border-radius: var(--r-full);
  border: 1px solid var(--border-strong); background: transparent;
  color: var(--fg-soft); font-family: var(--font-ui); font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.lang-toggle:hover { color: var(--fg); border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.04); }
.lang-toggle .ic { width: 16px; height: 16px; }
.nav-burger { display: none; background: none; border: 1px solid var(--border-strong); border-radius: var(--r-sm); width: 42px; height: 42px; color: var(--fg); cursor: pointer; align-items: center; justify-content: center; }
.nav-burger .ic { width: 20px; height: 20px; }

/* ---------------- Backgrounds / tech motifs ---------------- */
.grid-bg::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 58px 58px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 0%, #000 30%, transparent 75%);
}
.glow {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; pointer-events: none; z-index: 0;
}
.glow.red { background: radial-gradient(circle, rgba(224,23,23,.55), transparent 70%); }

/* ---------------- Hero ---------------- */
.hero { padding: 92px 0 96px; overflow: hidden; }
.hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { margin-bottom: 22px; }
.hero .lead { max-width: 520px; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 30px; }
.hero-chips { display: flex; gap: 10px; flex-wrap: wrap; }

/* 3D floating visual */
.hero-visual { position: relative; height: 460px; perspective: 1400px; }
.stack { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(-18deg) rotateX(8deg); transition: transform .4s ease; }
.glass {
  position: absolute; border-radius: var(--r-lg);
  background: linear-gradient(155deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-lg);
}
.card-main {
  inset: 40px 30px 60px 40px;
  background: linear-gradient(165deg, #16161a, #0c0c0e);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  padding: 22px; overflow: hidden;
}
.card-main .bar { display: flex; gap: 7px; margin-bottom: 18px; }
.card-main .bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--content4); display: block; }
.card-main .bar i:first-child { background: var(--red-500); }
.code-line { height: 11px; border-radius: 4px; background: rgba(255,255,255,.08); margin-bottom: 12px; }
.code-line.red { background: linear-gradient(90deg, var(--red-600), transparent); }
.float-chip {
  position: absolute; display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 16px; border-radius: var(--r-md);
  background: rgba(17,17,20,.85); border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 600; backdrop-filter: blur(10px);
  transform: translateZ(60px);
}
.float-chip .ic { width: 18px; height: 18px; color: var(--red-400); }
.fc-1 { top: 8px; right: -6px; }
.fc-2 { bottom: 30px; left: -18px; transform: translateZ(90px); }

/* ---------------- Section scaffolding ---------------- */
.section { padding: 96px 0; }
.section-head { max-width: 680px; margin-bottom: 52px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .lead { margin-top: 16px; }

/* ---------------- Products ---------------- */
.products-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.product-card {
  position: relative; border-radius: var(--r-xl); overflow: hidden;
  background: var(--content1); border: 1px solid var(--border);
  box-shadow: var(--shadow-md); transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
  display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-6px); border-color: var(--border-strong); box-shadow: var(--shadow-lg); }
.product-media {
  position: relative; height: 240px; overflow: hidden;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(224,23,23,.18), transparent 60%),
    linear-gradient(165deg, #1a1417, #0c0c0e);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; padding: 26px;
}
.product-media image-slot { width: 100%; height: 100%; }
.product-body { padding: 28px; flex: 1; display: flex; flex-direction: column; }
.product-tag {
  align-self: flex-start; margin-bottom: 14px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--red-400); padding: 5px 11px; border-radius: var(--r-full);
  background: rgba(224,23,23,.1); border: 1px solid rgba(224,23,23,.25);
}
.product-card h3 { font-size: 26px; margin-bottom: 6px; }
.product-card .sub { color: var(--fg-mute); font-size: 14px; font-family: var(--font-ui); margin-bottom: 16px; font-weight: 500; }
[dir="rtl"] .product-card .sub { font-family: var(--font-ar); }
.product-card p { color: var(--fg-soft); font-size: 15px; margin: 0 0 20px; }
.feat-list { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; }
.feat-list li { display: flex; align-items: center; gap: 11px; font-size: 14.5px; color: var(--fg-soft); }
.feat-list .ic { width: 17px; height: 17px; color: var(--red-400); flex: none; }
.product-card .more { margin-top: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 600; font-size: 14.5px; }
.product-card .more .ic { width: 17px; height: 17px; transition: transform .2s; }
[dir="rtl"] .product-card .more .ic { transform: scaleX(-1); }
.product-card:hover .more .ic { transform: translateX(4px); }
[dir="rtl"] .product-card:hover .more .ic { transform: scaleX(-1) translateX(4px); }

/* tree motif for شجرتي */
.tree-motif { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.tree-node { width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(160deg,#1f1a1c,#141416); border: 1px solid var(--border-strong); position: absolute; box-shadow: var(--shadow-md); display:flex; align-items:center; justify-content:center; }
.tree-node .ic { width: 20px; height: 20px; color: var(--fg-soft); }
.tree-node.root { background: linear-gradient(160deg, var(--red-500), var(--red-700)); border-color: transparent; box-shadow: var(--glow-red); }
.tree-node.root .ic { color: #fff; }

/* ---------------- Services ---------------- */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.svc-card {
  padding: 28px; border-radius: var(--r-lg);
  background: var(--content1); border: 1px solid var(--border);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.svc-card:hover { transform: translateY(-4px); border-color: var(--border-strong); background: var(--content2); }
.svc-ico {
  width: 50px; height: 50px; border-radius: var(--r-md); margin-bottom: 20px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 120% at 30% 20%, rgba(224,23,23,.22), rgba(224,23,23,.06));
  border: 1px solid rgba(224,23,23,.28);
}
.svc-ico .ic { width: 23px; height: 23px; color: var(--red-400); }
.svc-card h3 { font-size: 19px; font-family: var(--font-display); margin-bottom: 9px; }
.svc-card p { color: var(--fg-soft); font-size: 14.5px; margin: 0; }

/* ---------------- Stats band ---------------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 40px; border-radius: var(--r-xl); background: linear-gradient(160deg, var(--content1), #0b0b0d); border: 1px solid var(--border); }
.stat .num { font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 1; background: linear-gradient(120deg,#fff,#b9b9c2); -webkit-background-clip:text; background-clip:text; color:transparent; }
.stat .num span { color: var(--red-500); -webkit-text-fill-color: var(--red-500); }
.stat .lbl { color: var(--fg-mute); font-size: 13.5px; margin-top: 8px; }

/* ---------------- Contact ---------------- */
.contact-grid { display: grid; grid-template-columns: .92fr 1.08fr; gap: 28px; }
.info-card { padding: 32px; border-radius: var(--r-xl); background: linear-gradient(165deg, var(--content1), #0b0b0d); border: 1px solid var(--border); }
.info-row { display: flex; gap: 15px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.info-row:last-child { border-bottom: none; }
.info-row .ico { width: 42px; height: 42px; border-radius: var(--r-md); flex: none; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.04); border: 1px solid var(--border); }
.info-row .ico .ic { width: 19px; height: 19px; color: var(--red-400); }
.info-row .k { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-mute); font-family: var(--font-mono); margin-bottom: 4px; }
.info-row .v { font-size: 15.5px; color: var(--fg); font-weight: 500; }
.info-row a.v:hover { color: var(--red-400); }

.form-card { padding: 32px; border-radius: var(--r-xl); background: var(--content1); border: 1px solid var(--border); box-shadow: var(--shadow-md); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 500; color: var(--fg-soft); margin-bottom: 8px; }
.field label .req { color: var(--red-500); }
.input, .textarea {
  width: 100%; font-family: var(--font-ui); font-size: 15px; color: var(--fg);
  background: var(--content2); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 13px 15px; transition: border-color .15s, background .15s, box-shadow .15s;
}
[dir="rtl"] .input, [dir="rtl"] .textarea { font-family: var(--font-ar); }
.input::placeholder, .textarea::placeholder { color: #5c5c66; }
.input:focus, .textarea:focus { outline: none; border-color: var(--red-500); background: var(--content1); box-shadow: 0 0 0 3px rgba(224,23,23,.18); }
.textarea { resize: vertical; min-height: 130px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-note { font-size: 12.5px; color: var(--fg-mute); margin-top: 14px; }
.form-success {
  display: none; align-items: center; gap: 12px; padding: 16px 18px; border-radius: var(--r-md);
  background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.3); color: #86efac; font-size: 14.5px; margin-bottom: 18px;
}
.form-success.show { display: flex; }
.form-success .ic { width: 19px; height: 19px; }

/* ---------------- Footer ---------------- */
.footer { border-top: 1px solid var(--border); padding: 56px 0 36px; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; flex-wrap: wrap; margin-bottom: 40px; }
.footer-logo img { height: 26px; margin-bottom: 16px; }
.footer-logo p { color: var(--fg-mute); font-size: 14px; max-width: 320px; margin: 0; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-mute); margin: 0 0 16px; font-weight: 500; }
.footer-col a, .footer-col span { display: block; color: var(--fg-soft); font-size: 14px; margin-bottom: 11px; transition: color .15s; }
.footer-col a:hover { color: var(--fg); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-top: 28px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.footer-bottom p { color: var(--fg-mute); font-size: 13px; margin: 0; }
.socials { display: flex; gap: 10px; }
.socials a { width: 38px; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--fg-soft); transition: all .15s; }
.socials a:hover { color: #fff; border-color: var(--border-strong); background: rgba(255,255,255,.05); }
.socials .ic { width: 17px; height: 17px; }

/* ---------------- Reveal animation ---------------- */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
  .reveal.in { opacity: 1; transform: none; }
}

/* ---------------- Mobile menu ---------------- */
.mobile-menu { display: none; position: fixed; inset: 74px 0 0; z-index: 49; background: rgba(8,8,10,.97); backdrop-filter: blur(16px); padding: 30px 24px; flex-direction: column; gap: 6px; }
.mobile-menu.open { display: flex; }
.mobile-menu a { padding: 16px; font-size: 18px; font-weight: 600; border-bottom: 1px solid var(--border); color: var(--fg); }

/* ---------------- Responsive ---------------- */
@media (max-width: 940px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { height: 360px; max-width: 460px; }
  .products-grid { grid-template-columns: 1fr; }
  .svc-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: 30px 24px; }
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .hero .lead { margin-inline: auto; }
}
@media (max-width: 560px) {
  .svc-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .section { padding: 68px 0; }
  .hero { padding: 60px 0 70px; }
  .display { font-size: 40px; }
}
