/* ═══════════════════════════════════════════════
   Eslam Salem — hacker theme
   ═══════════════════════════════════════════════ */

/* ── Variables ───────────────────────────────── */
:root {
  --bg:          #0a0c10;
  --bg2:         #0f1117;
  --bg3:         #161b27;
  --border:      #1e2535;
  --cyan:        #22d3ee;
  --purple:      #a78bfa;
  --cyan-dim:    rgba(34,211,238,0.1);
  --purple-dim:  rgba(167,139,250,0.1);
  --text:        #e2e8f0;
  --muted:       #64748b;
  --card-hover:  #13182a;
  --font-mono:   'JetBrains Mono', monospace;
  --font-sans:   'Inter', sans-serif;
  --radius:      10px;
}

/* ── Reset ───────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; font-size: 16px; }
body  {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img   { max-width: 100%; display: block; }
a     { color: inherit; text-decoration: none; }

/* ── Typography ─────────────────────────────── */
h1,h2,h3,h4 { font-family: var(--font-mono); line-height: 1.2; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 600; color: var(--text); }
code, pre {
  font-family: var(--font-mono);
  font-size: .875em;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 5px;
}
code  { padding: 2px 6px; }
pre   { padding: 20px 24px; overflow-x: auto; margin: 1.5rem 0; }
pre code { background: none; border: none; padding: 0; }

/* ── Scrollbar ───────────────────────────────── */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Layout wrappers ─────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.site-main  { padding-top: 60px; } /* offset fixed nav */

/* ── NAV ─────────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: blur(12px);
  background: rgba(10,12,16,0.88);
  border-bottom: 1px solid var(--border);
  height: 60px;
}
.nav__inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.nav__logo {
  font-family: var(--font-mono); font-weight: 800; font-size: 15px;
  color: var(--cyan); letter-spacing: -.5px;
}
.nav__logo span { color: var(--muted); }
.nav__links {
  display: flex; align-items: center; gap: 28px;
  list-style: none;
}
.nav__links a {
  font-size: 13px; font-weight: 500; color: var(--muted);
  transition: color .2s; letter-spacing: .3px;
}
.nav__links a:hover,
.nav__links a.active { color: var(--text); }
.nav__links a.active { color: var(--cyan); }

/* Language toggle */
.lang-toggle {
  display: flex; border: 1px solid var(--border);
  border-radius: 6px; overflow: hidden;
  font-family: var(--font-mono); font-size: 12px;
}
.lang-toggle a {
  padding: 5px 12px; color: var(--muted); transition: all .2s;
}
.lang-toggle a.active,
.lang-toggle a:hover { background: var(--cyan-dim); color: var(--cyan); }

/* Hamburger (mobile) */
.nav__burger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav__burger span {
  display: block; width: 22px; height: 2px;
  background: var(--muted); border-radius: 2px; transition: all .25s;
}

/* ── HERO ─────────────────────────────────────── */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  padding: 80px 24px 60px; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -200px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(167,139,250,.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; bottom: -150px; left: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(34,211,238,.06) 0%, transparent 70%);
  pointer-events: none;
}
.hero__inner   {
  max-width: 1100px; margin: 0 auto; width: 100%;
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center;
}
.hero__pre     {
  font-family: var(--font-mono); font-size: 13px; color: var(--cyan);
  margin-bottom: 20px; display: flex; align-items: center; gap: 8px;
}
.hero__pre::before {
  content: ''; display: inline-block; width: 32px; height: 1px; background: var(--cyan);
}
.hero__name    {
  font-size: clamp(48px, 8vw, 88px); font-weight: 800;
  line-height: .95; letter-spacing: -4px; margin-bottom: 24px;
}
.hero__name .line1 { display: block; color: var(--text); }
.hero__name .line2 { display: block; color: var(--purple); transition: color .3s; }
.hero__name .line2:hover { color: var(--cyan); }
.hero__title {
  font-family: var(--font-sans);
  font-size: 16px; color: var(--muted); margin-bottom: 16px;
  font-weight: 400; max-width: 540px;
}
.cursor {
  display: inline-block; width: 2px; height: 1em;
  background: var(--cyan); margin-left: 2px;
  animation: blink 1s step-end infinite; vertical-align: text-bottom;
}
@keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0;} }
.hero__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.tag {
  font-family: var(--font-mono); font-size: 11px; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 4px; color: var(--muted);
}
.tag--cyan   { border-color: rgba(34,211,238,.3); color: var(--cyan); background: var(--cyan-dim); }
.tag--purple { border-color: rgba(167,139,250,.3); color: var(--purple); background: var(--purple-dim); }
.hero__ctas  { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── HERO VISUAL (right column) ──────────────── */
.hero__visual { display: flex; align-items: center; justify-content: center; }

.hero__photo {
  max-height: 420px;
  width: auto;
  object-fit: contain;
  display: block;
}

/* ── Buttons ─────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; background: var(--cyan);
  color: #0a0c10; font-weight: 600; font-size: 13px;
  border-radius: 6px; transition: all .2s; font-family: var(--font-mono);
}
.btn-primary:hover { background: #67e8f9; transform: translateY(-1px); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border: 1px solid var(--border);
  color: var(--text); font-size: 13px;
  border-radius: 6px; transition: all .2s; font-family: var(--font-mono);
}
.btn-ghost:hover { border-color: var(--purple); color: var(--purple); transform: translateY(-1px); }

/* Scroll hint */
.scroll-hint {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  color: var(--muted); font-size: 11px; font-family: var(--font-mono);
}
.scroll-hint__line {
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--muted), transparent);
  animation: scrollpulse 2s ease-in-out infinite;
}
@keyframes scrollpulse { 0%,100%{opacity:.3;} 50%{opacity:1;} }

/* ── STATS ───────────────────────────────────── */
.stats {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.stats__inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.stat {
  padding: 28px 16px; text-align: center;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: none; }
.stat__num   { font-family: var(--font-mono); font-size: 28px; font-weight: 800; color: var(--cyan); display: block; }
.stat__label { font-size: 11px; color: var(--muted); margin-top: 6px; text-transform: uppercase; letter-spacing: .8px; }

/* ── SECTIONS ────────────────────────────────── */
.section        { padding: 80px 24px; }
.section--alt   { background: var(--bg2); }
.section__inner { max-width: 1100px; margin: 0 auto; }
.section__header {
  display: flex; align-items: baseline; gap: 16px; margin-bottom: 48px;
  flex-wrap: wrap;
}
.section__label {
  font-family: var(--font-mono); font-size: 11px; color: var(--cyan);
  text-transform: uppercase; letter-spacing: 2px; white-space: nowrap;
}
.section__title {
  font-family: var(--font-mono); font-size: clamp(18px,3vw,28px);
  font-weight: 800; color: var(--text); letter-spacing: -1px; white-space: nowrap;
}
.section__line  { flex: 1; height: 1px; background: var(--border); min-width: 20px; }
.section__all   {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); padding: 6px 14px; border-radius: 5px;
  transition: all .2s; white-space: nowrap;
}
.section__all:hover { color: var(--cyan); border-color: var(--cyan); }

/* ── PAGE HEADER (list/single pages) ─────────── */
.page-header       { padding: 60px 24px 40px; border-bottom: 1px solid var(--border); }
.page-header__inner{ max-width: 1100px; margin: 0 auto; }
.page-header__back {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 24px; transition: color .2s;
}
.page-header__back:hover { color: var(--cyan); }
.page-header__label{
  font-family: var(--font-mono); font-size: 11px; color: var(--cyan);
  text-transform: uppercase; letter-spacing: 2px; margin-bottom: 8px;
}
.page-header__title{
  font-size: clamp(28px,5vw,48px); font-weight: 800;
  letter-spacing: -2px; line-height: 1.1; margin-bottom: 12px;
}
.page-header__meta {
  font-size: 13px; color: var(--muted); font-family: var(--font-mono);
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
}
.page-header__desc { font-size: 15px; color: var(--muted); max-width: 640px; margin-top: 12px; }

/* ── CVE CARDS ───────────────────────────────── */
.cve-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 16px; }
.cve-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  position: relative; overflow: hidden; transition: all .25s;
  display: block; color: inherit;
}
.cve-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple)); opacity: 0; transition: opacity .25s;
}
.cve-card:hover { border-color: rgba(34,211,238,.3); background: var(--card-hover); transform: translateY(-2px); }
.cve-card:hover::before { opacity: 1; }
.cve-card__id   {
  font-family: var(--font-mono); font-size: 11px; color: var(--cyan);
  background: var(--cyan-dim); padding: 3px 8px; border-radius: 4px;
  display: inline-block; margin-bottom: 12px;
}
.cve-card__name  { font-size: 15px; font-weight: 600; margin-bottom: 8px; line-height: 1.4; }
.cve-card__desc  { font-size: 13px; color: var(--muted); line-height: 1.6; }
.cve-card__footer{
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
}
.cve-card__link  { font-size: 11px; color: var(--muted); font-family: var(--font-mono); transition: color .2s; }
.cve-card:hover .cve-card__link { color: var(--cyan); }

/* Severity badges */
.sev { font-family: var(--font-mono); font-size: 11px; padding: 2px 8px; border-radius: 4px; }
.sev--critical { color: #f87171; background: rgba(248,113,113,.1); }
.sev--high     { color: #fb923c; background: rgba(251,146,60,.1); }
.sev--medium   { color: #fbbf24; background: rgba(251,191,36,.1); }
.sev--low      { color: #34d399; background: rgba(52,211,153,.1); }

/* ── TALKS LIST ──────────────────────────────── */
.talks-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); border-radius: var(--radius); overflow: hidden; }
.talk-item  {
  background: var(--bg2); padding: 20px 24px;
  display: grid; grid-template-columns: 1fr auto; gap: 16px;
  align-items: center; transition: background .2s;
}
.talk-item:hover { background: var(--card-hover); }
.talk-item__conf  {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--purple); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 4px;
}
.talk-item__title { font-size: 14px; font-weight: 500; line-height: 1.5; }
.talk-item__year  { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-bottom: 6px; text-align: right; }
.talk-item__links { display: flex; gap: 8px; justify-content: flex-end; }
.talk-item__link  {
  font-family: var(--font-mono); font-size: 10px; padding: 4px 10px;
  border: 1px solid var(--border); border-radius: 4px;
  color: var(--muted); transition: all .2s;
}
.talk-item__link:hover { border-color: var(--cyan); color: var(--cyan); }

/* ── OSS CARDS ───────────────────────────────── */
.oss-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 16px; }
.oss-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; transition: all .25s;
}
.oss-card:hover { border-color: rgba(167,139,250,.3); background: var(--card-hover); transform: translateY(-2px); }
.oss-card__header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.oss-card__icon   {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--purple-dim); border: 1px solid rgba(167,139,250,.2);
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.oss-card__name   { font-family: var(--font-mono); font-size: 14px; font-weight: 700; color: var(--purple); }
.oss-card__desc   { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 16px; }
.oss-card__badges { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  font-family: var(--font-mono); font-size: 10px;
  padding: 3px 8px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted);
}

/* ── BLOG / WRITING CARDS ────────────────────── */
.posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px,1fr)); gap: 16px; }
.post-card  {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; transition: all .25s;
  position: relative; overflow: hidden; display: block; color: inherit;
}
.post-card:hover { border-color: rgba(34,211,238,.2); background: var(--card-hover); transform: translateY(-2px); }
.post-card__date { font-family: var(--font-mono); font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.post-card__title{ font-size: 15px; font-weight: 600; margin-bottom: 8px; line-height: 1.5; }
.post-card__excerpt { font-size: 13px; color: var(--muted); line-height: 1.6; }
.post-card__link { font-family: var(--font-mono); font-size: 11px; color: var(--cyan); margin-top: 12px; display: inline-block; transition: gap .2s; }
.post-card__ext  {
  position: absolute; top: 14px; right: 14px;
  font-size: 10px; font-family: var(--font-mono); color: var(--muted);
  background: var(--bg3); padding: 2px 6px; border-radius: 3px;
}
.post-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

/* ── PROSE (single pages) ────────────────────── */
.prose {
  max-width: 1100px; margin: 0 auto; padding: 48px 24px 80px;
}
.prose__body {
  max-width: 720px;
  font-size: 16px; color: var(--muted); line-height: 1.85;
}
.prose__body h2 { font-size: 22px; color: var(--text); margin: 2rem 0 1rem; }
.prose__body h3 { font-size: 18px; color: var(--text); margin: 1.5rem 0 .75rem; }
.prose__body a  { color: var(--cyan); border-bottom: 1px solid rgba(34,211,238,.3); transition: border-color .2s; }
.prose__body a:hover { border-color: var(--cyan); }
.prose__body ul, .prose__body ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.prose__body li { margin-bottom: .4rem; }
.prose__body blockquote {
  border-left: 3px solid var(--cyan); padding-left: 1rem;
  color: var(--muted); font-style: italic; margin: 1.5rem 0;
}
.prose__sidebar {
  position: sticky; top: 80px; align-self: flex-start;
  min-width: 220px;
}
.prose__meta-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.prose__meta-box h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 12px; }
.prose__meta-row  { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 8px; }
.prose__meta-row strong { color: var(--text); }
.prose__layout { display: grid; grid-template-columns: 1fr 260px; gap: 48px; align-items: start; }

/* ── ABOUT ───────────────────────────────────── */
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px;
  max-width: 1100px; margin: 0 auto; padding: 60px 24px;
  align-items: start;
}
.about-text p { font-size: 15px; color: var(--muted); margin-bottom: 1rem; }
.timeline { display: flex; flex-direction: column; }
.tl-item  { display: grid; grid-template-columns: 80px 1fr; position: relative; }
.tl-item::before {
  content: ''; position: absolute; left: 79px; top: 24px; bottom: -16px;
  width: 1px; background: var(--border);
}
.tl-item:last-child::before { display: none; }
.tl-year    { font-family: var(--font-mono); font-size: 11px; color: var(--muted); padding-top: 20px; text-align: right; padding-right: 20px; }
.tl-content { padding: 16px 0 28px 20px; position: relative; }
.tl-content::before {
  content: ''; position: absolute; left: -4px; top: 22px;
  width: 8px; height: 8px; background: var(--cyan); border-radius: 50%;
  box-shadow: 0 0 0 3px var(--bg2), 0 0 0 4px var(--border);
}
.tl-role    { font-size: 13px; font-weight: 600; }
.tl-company { font-size: 12px; color: var(--cyan); font-family: var(--font-mono); }

/* ── FOOTER ──────────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 36px 24px; }
.footer__inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.footer__left { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.footer__links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer__links a { font-size: 12px; color: var(--muted); font-family: var(--font-mono); transition: color .2s; }
.footer__links a:hover { color: var(--cyan); }

/* ── FADE-IN ANIMATION ───────────────────────── */
.fade { opacity: 0; transform: translateY(16px); transition: opacity .5s, transform .5s; }
.fade.visible { opacity: 1; transform: none; }

/* ── RTL overrides ───────────────────────────── */
[dir="rtl"] .hero__pre::before { display: none; }
[dir="rtl"] .hero__pre::after  { content: ''; display: inline-block; width: 32px; height: 1px; background: var(--cyan); }
[dir="rtl"] .tl-item::before   { left: auto; right: 79px; }
[dir="rtl"] .tl-year           { text-align: left; padding-right: 0; padding-left: 20px; }
[dir="rtl"] .tl-content        { padding: 16px 20px 28px 0; }
[dir="rtl"] .tl-content::before{ left: auto; right: -4px; }
[dir="rtl"] .section__all      { margin-left: 0; margin-right: auto; }
[dir="rtl"] .post-card__ext    { right: auto; left: 14px; }
[dir="rtl"] .prose__body blockquote { border-left: none; border-right: 3px solid var(--cyan); padding-left: 0; padding-right: 1rem; }

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 900px) {
  .hero__inner  { grid-template-columns: 1fr; }
  .hero__visual { order: -1; }
  .hero__photo  { max-height: 260px; }
}
@media (max-width: 768px) {
  .stats__inner        { grid-template-columns: repeat(3,1fr); }
  .stat:nth-child(3)   { border-right: none; }
  .stat:nth-child(4),
  .stat:nth-child(5)   { border-top: 1px solid var(--border); }
  .nav__links          { display: none; }
  .nav__links.open     { display: flex; flex-direction: column; position: fixed; top: 60px; left: 0; right: 0; background: var(--bg2); border-bottom: 1px solid var(--border); padding: 16px 24px; gap: 16px; }
  .nav__burger         { display: flex; }
  .prose__layout       { grid-template-columns: 1fr; }
  .about-grid          { grid-template-columns: 1fr; gap: 40px; }
  .talk-item           { grid-template-columns: 1fr; }
  .talk-item__year     { text-align: left; }
  .talk-item__links    { justify-content: flex-start; }
}
@media (max-width: 480px) {
  .stats__inner { grid-template-columns: repeat(2,1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(5) { grid-column: span 2; border-top: 1px solid var(--border); border-right: none; }
  .hero__name { letter-spacing: -2px; }
}