/* ============================================================
   Hard4Tech — Design System
   Dark-tech corporate aesthetic. Brand gradient: cyan → blue → violet.
   Theme + accent + density + type are driven by CSS variables set
   from the Tweaks panel (data attributes on <html>).
   ============================================================ */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&family=Tajawal:wght@400;500;700;800&family=Sora:wght@400;500;600;700;800&display=swap');

/* ---------- Tokens ---------- */
:root {
  /* accent — overridden by tweaks */
  --accent: #2fe1e6;
  --accent-2: #b9a3ff;
  --accent-soft: rgba(47, 225, 230, 0.18);
  --grad: linear-gradient(100deg, #34e6e6 0%, #6aa8ff 48%, #b08cff 100%);

  /* vivid theme (default) — ITS-style blue→purple living gradient + glass */
  --bg: #2c1f8a;
  --bg-2: rgba(16, 12, 48, 0.42);
  --surface: rgba(255, 255, 255, 0.07);
  --surface-2: rgba(255, 255, 255, 0.11);
  --surface-3: rgba(255, 255, 255, 0.17);
  --border: rgba(255, 255, 255, 0.16);
  --border-strong: rgba(255, 255, 255, 0.34);
  --text: #ffffff;
  --text-muted: rgba(233, 237, 255, 0.80);
  --text-faint: rgba(222, 228, 255, 0.58);
  --shadow: 0 24px 60px -20px rgba(18, 8, 60, 0.55);
  --glow: 0 0 0 1px rgba(255,255,255,0.10), 0 20px 60px -24px rgba(56,150,255,0.45);

  /* type */
  --font-display: 'Space Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;

  /* density */
  --section-y: 120px;
  --gap: 28px;

  --maxw: 1240px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 26px;
  --base-size: 16px;
}

/* Dark theme (near-black) */
html[data-theme="dark"] {
  --bg: #070b16;
  --bg-2: #0a1020;
  --surface: #0e1526;
  --surface-2: #131c33;
  --surface-3: #18243f;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eaf0fa;
  --text-muted: #97a4be;
  --text-faint: #5e6b85;
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  --glow: 0 0 0 1px rgba(34,199,230,0.18), 0 20px 60px -24px rgba(34,199,230,0.35);
}

/* Light theme */
html[data-theme="light"] {
  --bg: #f3f5f9;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --surface-3: #eef2f9;
  --border: rgba(12, 24, 48, 0.10);
  --border-strong: rgba(12, 24, 48, 0.18);
  --text: #0c1424;
  --text-muted: #51607a;
  --text-faint: #8a97ad;
  --shadow: 0 24px 50px -24px rgba(20, 40, 80, 0.22);
  --glow: 0 0 0 1px rgba(34,199,230,0.25), 0 20px 50px -26px rgba(59,130,246,0.30);
}

/* Arabic typography */
html[lang="ar"] {
  --font-display: 'Tajawal', 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans Arabic', 'Tajawal', system-ui, sans-serif;
}

/* density variants */
html[data-density="compact"] { --section-y: 84px; --gap: 20px; }
html[data-density="comfy"]   { --section-y: 156px; --gap: 36px; }

/* ---------- Reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: var(--base-size);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .4s ease, color .4s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
::selection { background: var(--accent); color: #06101f; }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 28px; }
.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: calc(var(--section-y) * .62); }

/* ---------- Typography helpers ---------- */
.display { font-family: var(--font-display); font-weight: 700; line-height: 1.04; letter-spacing: -0.02em; }
html[lang="ar"] .display { letter-spacing: 0; line-height: 1.18; }
.h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
.h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
.h3 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent); display: inline-flex; align-items: center;
}
html[lang="ar"] .eyebrow { letter-spacing: 0.06em; }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--text-muted); max-width: 60ch; }
.gradient-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.muted { color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; font-weight: 600; font-size: 0.98rem;
  font-family: var(--font-body); transition: transform .25s, box-shadow .25s, background .25s, border-color .25s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn--primary { background: var(--grad); color: #04101f; box-shadow: 0 14px 36px -12px rgba(34,199,230,.5); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 22px 48px -14px rgba(59,130,246,.6); }
.btn--ghost { border: 1px solid var(--border-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); }
.btn--arrow .arr { transition: transform .25s; }
html[dir="rtl"] .btn--arrow .arr { transform: scaleX(-1); }
.btn--arrow:hover .arr { transform: translateX(4px); }
html[dir="rtl"] .btn--arrow:hover .arr { transform: scaleX(-1) translateX(4px); }

/* ---------- Cards & surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .3s, border-color .3s, box-shadow .3s, background .3s;
}
.panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); }

.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* ---------- Decorative backdrop ---------- */
.glow-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5; pointer-events: none; z-index: 0; }
.grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--border) 1px, transparent 1px),
    linear-gradient(to bottom, var(--border) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 75%);
}

/* ---------- Section heading block ---------- */
.sec-head { max-width: 720px; margin-bottom: 56px; }
.sec-head.center { margin-inline: auto; text-align: center; }
.sec-head .h2 { margin-top: 16px; margin-bottom: 18px; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* ---------- Image placeholder ---------- */
.ph {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background:
    repeating-linear-gradient(135deg, var(--surface-2) 0 14px, var(--surface-3) 14px 28px);
  border: 1px solid var(--border);
  display: grid; place-items: center;
}
.ph span {
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .8rem; letter-spacing: .04em;
  color: var(--text-faint); background: var(--bg); padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border);
}

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee__track { display: flex; gap: 56px; width: max-content; animation: scrollx 38s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
@keyframes scrollx { to { transform: translateX(-50%); } }
html[dir="rtl"] .marquee__track { animation-direction: reverse; }

/* ---------- Footer ---------- */
.footer { background: var(--bg-2); border-top: 1px solid var(--border); }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.field input, .field textarea, .field select {
  font-family: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 13px 16px; transition: border-color .2s, box-shadow .2s; width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- Utility ---------- */
.grid { display: grid; gap: var(--gap); }
.flex { display: flex; }
.center { align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
