/* ===========================================================
   SANA — Smart Security · Design System
   Command-center aesthetic · RTL · dark
   =========================================================== */

:root {
  /* palette */
  --bg:        #0a0d12;
  --bg-2:      #0f141b;
  --panel:     #141b24;
  --panel-2:   #1a232e;
  --line:      #243140;
  --ink:       #eef3f8;
  --ink-soft:  #9fb0c0;
  --ink-dim:   #64748b;
  /* signature: سنا = radiance */
  --gold:      #f5b942;
  --gold-soft: #ffd47a;
  --teal:      #2dd4bf;
  --teal-dim:  #14b8a6;
  --red:       #ff5d5d;
  --green:     #4ade80;

  --radius:    18px;
  --radius-sm: 12px;
  --maxw:      1180px;
  --shadow:    0 24px 60px -20px rgba(0,0,0,.7);
  --glow-gold: 0 0 0 1px rgba(245,185,66,.25), 0 12px 40px -12px rgba(245,185,66,.35);
  --glow-teal: 0 0 0 1px rgba(45,212,191,.3), 0 12px 40px -14px rgba(45,212,191,.35);

  --f-display: "Zain", system-ui, sans-serif;
  --f-body:    "Readex Pro", system-ui, sans-serif;
  --f-mono:    "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  direction: rtl;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* atmospheric background */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(900px 500px at 85% -5%, rgba(245,185,66,.10), transparent 60%),
    radial-gradient(800px 600px at 5% 100%, rgba(45,212,191,.08), transparent 55%),
    var(--bg);
}
body::after { /* grid texture */
  content: "";
  position: fixed; inset: 0; z-index: -1; opacity: .35;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 50% 30%, #000 30%, transparent 85%);
}

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

/* ---------- typography ---------- */
h1, h2, h3 { font-family: var(--f-display); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.eyebrow {
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .28em;
  text-transform: uppercase; color: var(--gold); display: inline-flex; align-items: center; gap: .6rem;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--gold); display: inline-block; }
.mono { font-family: var(--f-mono); }
.muted { color: var(--ink-soft); }

/* ---------- nav ---------- */
header.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10,13,18,.72);
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand .logo {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--gold), #c98c1f);
  color: #1a1206; font-family: var(--f-display); font-weight: 800; font-size: 1.4rem;
  box-shadow: var(--glow-gold);
}
.brand b { font-family: var(--f-display); font-size: 1.5rem; }
.brand small { display: block; font-size: .62rem; letter-spacing: .25em; color: var(--ink-dim); font-family: var(--f-mono); margin-top: -4px; }
.nav-links { display: flex; gap: 6px; align-items: center; }
.nav-links a {
  color: var(--ink-soft); text-decoration: none; font-size: .95rem;
  padding: 8px 16px; border-radius: 10px; transition: .2s;
}
.nav-links a:hover { color: var(--ink); background: var(--panel); }
.nav-links a.active { color: var(--gold); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--ink);
  width: 42px; height: 42px; border-radius: 10px; font-size: 1.2rem; cursor: pointer; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem; text-decoration: none;
  padding: 13px 24px; border-radius: 12px; font-weight: 600; font-size: .98rem;
  transition: .22s; cursor: pointer; border: 1px solid transparent;
}
.btn-gold { background: linear-gradient(145deg, var(--gold), #d99a26); color: #1a1206; box-shadow: var(--glow-gold); }
.btn-gold:hover { transform: translateY(-2px); }
.btn-ghost { background: var(--panel); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- hero ---------- */
.hero { position: relative; padding: 90px 0 70px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); margin: 18px 0 20px; }
.hero h1 .accent { color: var(--gold); }
.hero p.lead { font-size: 1.18rem; color: var(--ink-soft); max-width: 38ch; margin-bottom: 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-visual { position: relative; }
.hero-visual img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); display: block; box-shadow: var(--shadow); }
.hero-visual .scan {
  position: absolute; inset: 0; border-radius: var(--radius); overflow: hidden; pointer-events: none;
}
.hero-visual .scan::after {
  content: ""; position: absolute; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  box-shadow: 0 0 18px var(--teal);
  animation: scan 3.4s ease-in-out infinite;
}
@keyframes scan { 0%,100% { top: 6%; opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 92% { top: 94%; } }

.hud {
  position: absolute; bottom: 16px; inset-inline-start: 16px;
  display: flex; gap: 8px; font-family: var(--f-mono); font-size: .7rem;
}
.hud span { background: rgba(10,13,18,.78); border: 1px solid var(--line); padding: 5px 10px; border-radius: 8px; color: var(--teal); }
.hud span.live { color: var(--red); }
.hud span.live::before { content: "●"; margin-inline-end: 5px; animation: blink 1.3s infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* corner brackets on framed images */
.framed { position: relative; }
.framed b.bk { position: absolute; width: 20px; height: 20px; border: 2px solid var(--gold); }
.framed b.tl { top: 10px; inset-inline-start: 10px; border-bottom: 0; border-inline-end: 0; }
.framed b.tr { top: 10px; inset-inline-end: 10px; border-bottom: 0; border-inline-start: 0; }
.framed b.bl { bottom: 10px; inset-inline-start: 10px; border-top: 0; border-inline-end: 0; }
.framed b.br { bottom: 10px; inset-inline-end: 10px; border-top: 0; border-inline-start: 0; }

/* ---------- section ---------- */
section.block { padding: 76px 0; }
.sec-head { max-width: 60ch; margin-bottom: 44px; }
.sec-head h2 { font-size: clamp(2rem, 4vw, 2.9rem); margin: 14px 0 14px; }
.sec-head p { color: var(--ink-soft); font-size: 1.08rem; }
.center { text-align: center; margin-inline: auto; }

/* ---------- stats strip ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 24px 20px; }
.stat .n { font-family: var(--f-display); font-size: 2.6rem; color: var(--gold); line-height: 1; }
.stat .l { color: var(--ink-soft); font-size: .92rem; margin-top: 8px; }

/* ---------- capability cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 24px;
  transition: .25s; position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; top: 0; inset-inline-start: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--gold), transparent); opacity: 0; transition: .25s;
}
.card:hover { transform: translateY(-5px); border-color: rgba(245,185,66,.4); box-shadow: var(--shadow); }
.card:hover::before { opacity: 1; }
.card .ic { font-size: 1.7rem; width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line); margin-bottom: 18px; }
.card h3 { font-size: 1.32rem; margin-bottom: 8px; }
.card p { color: var(--ink-soft); font-size: .98rem; }
.card .tag { position: absolute; top: 22px; inset-inline-end: 22px; font-family: var(--f-mono); font-size: .62rem;
  letter-spacing: .12em; padding: 4px 9px; border-radius: 20px; }
.tag.ready { color: var(--green); background: rgba(74,222,128,.1); border: 1px solid rgba(74,222,128,.3); }

/* ---------- challenges (split) ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chal { display: flex; gap: 16px; padding: 22px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); border-inline-start: 3px solid var(--teal); }
.chal .ic { font-size: 1.5rem; }
.chal h3 { font-size: 1.15rem; margin-bottom: 4px; }
.chal p { color: var(--ink-soft); font-size: .94rem; }

/* ---------- video list ---------- */
.vid-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.vid-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: var(--ink); transition: .25s; display: block; }
.vid-card:hover { transform: translateY(-5px); border-color: rgba(245,185,66,.4); box-shadow: var(--shadow); }
.vid-card .thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; }
.vid-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: .4s; }
.vid-card:hover .thumb img { transform: scale(1.05); }
.vid-card .play { position: absolute; inset: 0; display: grid; place-items: center; }
.vid-card .play span { width: 60px; height: 60px; border-radius: 50%; background: rgba(245,185,66,.92); color: #1a1206;
  display: grid; place-items: center; font-size: 1.4rem; box-shadow: var(--glow-gold); }
.vid-card .badge { position: absolute; top: 12px; inset-inline-start: 12px; font-family: var(--f-mono); font-size: .66rem;
  background: rgba(10,13,18,.8); border: 1px solid var(--line); padding: 4px 10px; border-radius: 8px; color: var(--teal); }
.vid-card .meta { padding: 20px 22px; }
.vid-card .meta h3 { font-size: 1.28rem; margin-bottom: 6px; }
.vid-card .meta p { color: var(--ink-soft); font-size: .9rem; }
.vid-card.soon { opacity: .55; pointer-events: none; }
.vid-card.soon .thumb { background: var(--panel-2); display: grid; place-items: center; aspect-ratio: 16/9; }
.vid-card.soon .thumb .ph { font-size: 2rem; color: var(--ink-dim); }

/* ---------- video detail ---------- */
.vd-hero { padding: 50px 0 30px; }
.vd-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; align-items: start; }
.vd-grid img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.info-list { list-style: none; display: grid; gap: 2px; }
.info-list li { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); }
.info-list li span:first-child { color: var(--ink-soft); }
.info-list li span:last-child { font-family: var(--f-mono); color: var(--ink); }

.analysis-sec { padding: 56px 0; border-top: 1px solid var(--line); }
.analysis-sec .num { font-family: var(--f-mono); color: var(--gold); font-size: .85rem; letter-spacing: .2em; }
.analysis-sec h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); margin: 8px 0 14px; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; }
.gallery figure { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); position: relative; }
.gallery img { width: 100%; display: block; aspect-ratio: 16/9; object-fit: cover; }
.gallery figcaption { position: absolute; bottom: 0; inset-inline: 0; padding: 8px 12px; font-family: var(--f-mono); font-size: .68rem;
  background: linear-gradient(transparent, rgba(10,13,18,.9)); color: var(--teal); }

.entity-bars { display: grid; gap: 14px; margin-top: 12px; }
.ebar { }
.ebar .top { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: .95rem; }
.ebar .top b { font-family: var(--f-mono); color: var(--gold); }
.ebar .track { height: 9px; background: var(--panel-2); border-radius: 20px; overflow: hidden; }
.ebar .fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg, var(--gold), var(--teal)); }

.big-img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); margin-top: 8px; }
.legend { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 18px; font-size: .9rem; color: var(--ink-soft); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 7px; vertical-align: middle; }

/* AI scene descriptions */
.scenes { display: grid; gap: 14px; margin-top: 24px; }
.scene { display: grid; grid-template-columns: 130px 1fr; gap: 18px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; }
.scene img { width: 100%; border-radius: 9px; aspect-ratio: 16/9; object-fit: cover; }
.scene .txt p { color: var(--ink-soft); font-size: .96rem; }
.scene .txt .ts { font-family: var(--f-mono); color: var(--gold); font-size: .72rem; margin-bottom: 4px; }

/* alert feed */
.feed { display: grid; gap: 10px; margin-top: 22px; }
.alert { display: flex; gap: 14px; align-items: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 18px; border-inline-start: 3px solid var(--gold); }
.alert.warn { border-inline-start-color: var(--gold); }
.alert.info { border-inline-start-color: var(--teal); }
.alert .t { font-family: var(--f-mono); font-size: .82rem; color: var(--ink-dim); white-space: nowrap; }
.alert .ic { font-size: 1.2rem; }
.alert .m { font-size: .98rem; }

/* ---------- footer ---------- */
footer.ft { border-top: 1px solid var(--line); padding: 40px 0; margin-top: 40px; }
.ft-in { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.ft-in p { color: var(--ink-dim); font-size: .88rem; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .vd-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .cards, .stats { grid-template-columns: repeat(2, 1fr); }
  .split, .vid-grid { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; position: absolute; top: 68px; inset-inline: 0; flex-direction: column;
    background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 12px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px; }
  .nav-toggle { display: grid; place-items: center; }
}
@media (max-width: 560px) {
  .stats, .cards { grid-template-columns: 1fr; }
  .scene { grid-template-columns: 1fr; }
  .scene img { aspect-ratio: 16/7; }
  section.block { padding: 54px 0; }
  .zone-row { grid-template-columns: 92px 1fr 44px; gap: 8px; }
  .tlchart { height: 130px; gap: 2px; }
}

/* ── activity timeline chart (phase-2 analysis pages) ── */
.tlchart { display: flex; align-items: flex-end; gap: 4px; height: 170px;
  padding: 18px 16px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-top: 10px; }
.tlchart i { flex: 1; min-height: 5px; border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--teal), var(--teal-dim)); opacity: .9;
  transition: height .7s cubic-bezier(.2,.8,.2,1); }
.tlchart i.mid { background: linear-gradient(180deg, var(--gold-soft), var(--gold)); }
.tlchart i.hi  { background: linear-gradient(180deg, #ff8a8a, var(--red)); }
.tl-axis { display: flex; justify-content: space-between; font-family: var(--f-mono);
  font-size: .72rem; color: var(--ink-dim); margin-top: 8px; padding: 0 4px; }
.zone-row { display: grid; grid-template-columns: 120px 1fr 54px; align-items: center;
  gap: 12px; margin-bottom: 10px; }
.zone-row .zn { font-size: .92rem; color: var(--ink-soft); }
.zone-row .zt { height: 11px; background: var(--panel-2); border-radius: 20px; overflow: hidden; }
.zone-row .zf { height: 100%; border-radius: 20px; }
.zone-row b { font-family: var(--f-mono); color: var(--gold); font-size: .9rem; text-align: left; }
