/* ============================================================
   XLLENZA — "Crimson Core"  (Red Hat page only)
   Deep charcoal-black + infrastructure red. Open-source heavyweight.
   ============================================================ */

:root {
  --bg:            #0A0A0B;   /* onyx charcoal */
  --bg-elev:       #121216;   /* sections */
  --bg-elev-2:     #17171C;   /* cards / tables */
  --bg-tint:       #1F1F25;
  --ink:           #0E0E11;   /* deepest band */

  --line:          #28282F;   /* hairline */
  --line-soft:     #1D1D22;

  --text:          #F5F5F7;   /* crisp white */
  --text-muted:    #9A9AA4;   /* secondary */
  --text-dim:      #6B6B74;

  --accent:        #E0162B;   /* infrastructure red */
  --accent-hover:  #FF2E45;
  --accent-soft:   rgba(224, 22, 43, 0.12);
  --accent-gradient: linear-gradient(135deg, #B00F20 0%, #E0162B 50%, #FF2E45 100%);
  --on-accent:     #FFFFFF;

  --brand-from:    #8360c3;
  --brand-to:      #2ebf91;
  --brand-gradient: linear-gradient(90deg, var(--brand-from) 0%, var(--brand-to) 100%);

  --on-dark:       #F5F5F7;
  --on-dark-muted: #9A9AA4;

  --font-body: 'Inter', 'Tajawal', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-display: 'Space Grotesk', var(--font-body);
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-brand: 'Comfortaa', var(--font-display);

  --maxw: 1180px;
  --gutter: 24px;
  --radius: 6px;
  --radius-lg: 12px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: .22s;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-body);
  background: var(--bg); color: var(--text);
  line-height: 1.6; font-size: 16px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; letter-spacing: -0.02em; font-weight: 700; }
[dir="rtl"], [lang="ar"] { font-family: 'Tajawal', var(--font-body); }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.text-accent { color: var(--accent); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: .76rem; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 0 0 20px;
}
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.section-eyebrow {
  font-family: var(--font-mono); font-size: .74rem; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px;
}
.section-title { font-size: clamp(1.6rem, 3.4vw, 2.4rem); margin-bottom: 14px; }
.section-lead { color: var(--text-muted); max-width: 58ch; font-size: 1.05rem; }
.section-head { max-width: 700px; margin-bottom: 48px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: .95rem; padding: 12px 22px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn-lg { padding: 15px 28px; font-size: 1rem; }
.btn-primary { background: var(--accent); color: var(--on-accent); font-weight: 700; box-shadow: 0 8px 24px -10px var(--accent); }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: 0 12px 30px -10px var(--accent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 10, 11, 0.8);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); opacity: .7; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 86px; gap: 20px; }
.brand { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 6px; flex: 0 0 auto; line-height: 1; border-radius: var(--radius); }
.brand-logo { height: 46px; width: auto; display: block; transition: transform var(--dur) var(--ease); }
.brand:hover .brand-logo { transform: translateY(-1px); }
.brand-tagline { display: block; font-family: var(--font-brand); font-weight: 500; font-size: .5rem; letter-spacing: .2em; text-transform: uppercase; white-space: nowrap; color: var(--text-dim); }
.main-nav { display: flex; align-items: center; }
.nav-menu { display: flex; align-items: center; flex-wrap: nowrap; gap: 2px; }
.nav-link { position: relative; padding: 9px 12px; border-radius: var(--radius); font-size: .92rem; font-weight: 500; color: var(--text-muted); white-space: nowrap; transition: color var(--dur) var(--ease), background var(--dur) var(--ease); }
.nav-link:hover { color: var(--text); background: var(--bg-elev); }
.nav-link.is-active { color: var(--text); }
.nav-link.is-active::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 2px; background: var(--accent); border-radius: 2px; }
.nav-cta-item { margin-left: 10px; }
.nav-cta { padding: 10px 18px; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: var(--dur); }

/* Page hero */
.page-hero { position: relative; overflow: hidden; padding: clamp(56px, 9vw, 110px) 0 clamp(40px, 5vw, 64px); border-bottom: 1px solid var(--line-soft); }
.hero-grid-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    radial-gradient(55% 55% at 75% 0%, rgba(224,22,43,.18), transparent 70%),
    linear-gradient(to right, var(--line-soft) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line-soft) 1px, transparent 1px);
  background-size: auto, 56px 56px, 56px 56px;
  mask-image: radial-gradient(125% 85% at 50% 0%, #000 38%, transparent 100%);
  -webkit-mask-image: radial-gradient(125% 85% at 50% 0%, #000 38%, transparent 100%);
}
.page-hero-inner { position: relative; z-index: 1; max-width: 800px; }
.page-title { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: 18px; letter-spacing: -0.02em; }
.page-lead { color: var(--text-muted); font-size: clamp(1.05rem, 2vw, 1.2rem); max-width: 62ch; margin: 0; }
.breadcrumb { display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--text-dim); margin-bottom: 22px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

/* Chips */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.chip {
  display: inline-flex; align-items: center; padding: 9px 16px; border-radius: 999px;
  font-size: .88rem; font-weight: 600; color: var(--text-muted);
  background: var(--bg-elev-2); border: 1px solid var(--line);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.chip:hover { color: #fff; border-color: var(--accent); background: var(--accent-soft); }

/* Sections */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-alt { background: var(--bg-elev); border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }

/* Process */
.process { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin: 0; padding: 0; }
.process.five { grid-template-columns: repeat(5, 1fr); }
.process li { list-style: none; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-elev-2); }
.process-num { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--accent); }
.process h3 { font-size: 1.12rem; margin: 12px 0 8px; }
.process p { margin: 0; color: var(--text-muted); font-size: .95rem; }

/* Callout */
.callout { margin-top: 28px; padding: 20px 22px; border-radius: var(--radius-lg); border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--bg-elev-2); color: var(--text-muted); font-size: .98rem; }
.callout strong { color: var(--text); }
.callout.warn { border-left-color: #E8A13A; background: rgba(232,161,58,.10); }
.callout.warn strong { color: #F0B454; }

.subhead { font-family: var(--font-display); font-size: 1.2rem; margin: 44px 0 18px; }
.fineprint { margin-top: 20px; font-size: .82rem; color: var(--text-dim); max-width: 90ch; }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); -webkit-overflow-scrolling: touch; background: var(--bg-elev-2); }
.catalog { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 720px; }
.catalog thead th {
  text-align: left; font-family: var(--font-body); font-weight: 700;
  font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--text-dim);
  padding: 14px 18px; background: var(--bg-tint); border-bottom: 1px solid var(--line); white-space: nowrap;
}
.catalog tbody td, .catalog tbody th { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--text-muted); }
.catalog tbody tr:last-child td { border-bottom: 0; }
.catalog tbody tr { transition: background var(--dur) var(--ease); }
.catalog tbody tr:hover { background: var(--bg-elev); }
.catalog td:nth-child(2) { color: var(--text); font-weight: 600; }
.catalog .sku { font-family: var(--font-mono); font-weight: 500; font-size: .82rem; color: var(--accent); white-space: nowrap; }

/* CTA */
.cta { padding: clamp(64px, 9vw, 110px) 0; }
.cta-inner {
  position: relative; overflow: hidden; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(40px, 6vw, 72px) 24px; background: var(--bg-elev-2);
}
.cta-inner::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--accent); }
.cta-inner::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 120% at 50% 0%, var(--accent-soft), transparent 70%); }
.cta-title { font-size: clamp(1.7rem, 4vw, 2.6rem); margin-bottom: 14px; position: relative; }
.cta-sub { color: var(--text-muted); margin: 0 auto 30px; max-width: 52ch; position: relative; }
.cta-inner .btn { position: relative; }

/* Footer */
.site-footer { border-top: 1px solid var(--line-soft); background: var(--ink); color: var(--on-dark); }
.footer-inner { display: grid; grid-template-columns: 1.6fr 1fr 1.2fr 1.2fr; gap: 36px; padding: 56px var(--gutter); align-items: start; }
.footer-logo { height: 40px; width: auto; display: block; margin-bottom: 16px; }
.footer-brand p { color: var(--on-dark-muted); margin: 0 0 16px; max-width: 42ch; font-size: .92rem; }
.footer-li { color: var(--accent-hover); font-weight: 600; font-size: .9rem; }
.footer-li:hover { color: #FF5566; }
.footer-col h4 { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-hover); margin: 0 0 16px; font-weight: 500; }
.footer-links { display: grid; gap: 10px; }
.footer-links a { color: var(--on-dark-muted); font-size: .92rem; transition: color var(--dur) var(--ease); }
.footer-links a:hover { color: var(--on-dark); }
.footer-col address { font-style: normal; color: var(--on-dark-muted); font-size: .9rem; line-height: 1.8; }
.footer-col address a { color: var(--on-dark-muted); transition: color var(--dur) var(--ease); }
.footer-col address a:hover { color: var(--accent-hover); }
.footer-base { border-top: 1px solid rgba(255,255,255,.07); }
.footer-base-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 18px; }
.footer-base-inner small { color: var(--on-dark-muted); }

/* Floating quick-contact buttons */
.quick-contact { position: fixed; left: 22px; bottom: 22px; z-index: 60; display: flex; flex-direction: column; gap: 12px; }
.qc-btn { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 8px 22px -8px rgba(0,0,0,.65); border: 1px solid rgba(255,255,255,.12); transition: transform var(--dur) var(--ease), filter var(--dur) var(--ease); }
.qc-btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.qc-btn svg { width: 22px; height: 22px; }
.qc-wa { background: #25D366; color: #fff; }
.qc-call, .qc-mail { background: var(--accent); color: #fff; }
@media (max-width: 560px) { .quick-contact { left: 16px; bottom: 16px; gap: 10px; } .qc-btn { width: 42px; height: 42px; } }

/* Back-to-top */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent); color: #fff;
  border: 1px solid rgba(255,255,255,.12); box-shadow: 0 10px 26px -8px var(--accent);
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.to-top svg { width: 20px; height: 20px; }
.to-top:hover { background: var(--accent-hover); }
.to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* Responsive */
@media (max-width: 1000px) { .process.five { grid-template-columns: repeat(3, 1fr); } .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 940px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute; top: 86px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 4px;
    background: var(--bg-elev); border-bottom: 1px solid var(--line);
    padding: 14px var(--gutter) 22px;
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
  }
  .nav-menu.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-link { padding: 12px 14px; }
  .nav-cta-item { margin: 6px 0 0; }
  .nav-cta { width: 100%; }
  .process, .process.five { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .process, .process.five { grid-template-columns: 1fr; } .footer-inner { grid-template-columns: 1fr; } .footer-base-inner { flex-direction: column; gap: 6px; } .to-top { right: 16px; bottom: 16px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
