:root {
  --bg: #070b12;
  --bg-elevated: #0f1623;
  --surface: #151d2e;
  --border: rgba(148, 163, 184, 0.14);
  --text: #e8edf5;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-2: #818cf8;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --container: min(1100px, 92vw);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(56, 189, 248, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(129, 140, 248, 0.1), transparent);
  pointer-events: none;
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: var(--container);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -100px;
  right: 1rem;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: 8px;
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(7, 11, 18, 0.82);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.logo:hover {
  opacity: 0.9;
  transform: scale(1.03);
}

.logo-img {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: contain;
}

.hero-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.hero-brand-logo {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(255, 255, 255, 0.08));
}

.hero-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hero-brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
}

.hero-eyebrow {
  margin: 0;
}

.nav {
  display: flex;
  gap: 1.25rem;
}

.nav a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover {
  color: var(--text);
}

/* Hero */
.hero {
  padding: 4rem 0 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-content > .hero-eyebrow {
  margin: 0 0 0.5rem;
}

.hero-brand .hero-eyebrow,
.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-name {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
}

.hero-title {
  margin: 0.5rem 0 1rem;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--accent-2);
  font-weight: 500;
}

.hero-location {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero-bio {
  margin: 0 0 1.5rem;
  color: var(--muted);
  max-width: 36rem;
  font-size: 1.05rem;
}

.hero-aside {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #0ea5e9);
  color: var(--bg);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.25);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: var(--surface);
}

.hero-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.code-block {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.9;
  display: flex;
  flex-direction: column;
}

.kw {
  color: #c084fc;
}

.str {
  color: #4ade80;
}

.fn {
  color: var(--accent);
}

/* Sections */
.section {
  padding: 3.5rem 0;
}

.section-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
}

.section-sub {
  margin: 0.35rem 0 2rem;
  color: var(--muted);
}

/* Timeline / Experience */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: minmax(140px, 200px) 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.timeline-meta time {
  display: block;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
}

.timeline-loc {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.timeline-role {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.timeline-company {
  margin: 0.2rem 0 0.65rem;
  color: var(--accent-2);
  font-weight: 500;
}

.timeline-bullets {
  margin: 0;
  padding-right: 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.timeline-bullets li {
  margin-bottom: 0.35rem;
}

/* Education */
.edu-grid {
  display: grid;
  gap: 1rem;
}

.edu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.edu-period {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
}

.edu-school {
  margin: 0.5rem 0 0.2rem;
  font-size: 1.15rem;
}

.edu-faculty {
  margin: 0 0 0.5rem;
  color: var(--accent-2);
  font-weight: 500;
}

.edu-detail {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.subsection-title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.skill-group {
  margin-bottom: 1.75rem;
}

.skill-bullets {
  margin: 0;
  padding-right: 1.2rem;
  color: var(--muted);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.25rem 1rem;
}

.languages-block {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.languages-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.lang-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.lang-name {
  font-weight: 600;
}

.lang-level {
  font-size: 0.85rem;
  color: var(--muted);
}

/* Certificates */
.cert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cert-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
}

.cert-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.cert-org {
  margin: 0 0 0.4rem;
  color: var(--accent-2);
  font-size: 0.9rem;
  font-weight: 500;
}

.cert-detail {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.project-subtitle {
  margin: 0;
  font-size: 0.88rem;
  color: var(--accent-2);
  font-weight: 500;
}

.project-highlights {
  margin: 0;
  padding-right: 1.1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.project-highlights li {
  margin-bottom: 0.3rem;
}

.projects-grid {
  grid-template-columns: 1fr;
}

.project-card-wide {
  max-width: 100%;
}

@media (min-width: 900px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Skills (legacy grid — unused) */
.skills-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}

.skill-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.skill-name {
  font-weight: 600;
  font-size: 0.98rem;
}

.skill-level {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: capitalize;
}

.skill-level[data-level='advanced']::before {
  content: '●●●';
  color: var(--accent);
  margin-left: 0.35rem;
  letter-spacing: 2px;
}

.skill-level[data-level='intermediate']::before {
  content: '●●○';
  color: var(--accent-2);
  margin-left: 0.35rem;
  letter-spacing: 2px;
}

/* Projects */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}

.project-card:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-3px);
}

.project-image {
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface);
}

.project-body {
  padding: 1.15rem 1.2rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.65rem;
}

.project-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.project-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
}

.tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tech-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent);
  border: 1px solid rgba(56, 189, 248, 0.2);
  font-family: var(--mono);
}

.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.project-link {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text);
  transition: background 0.15s;
}

.project-link:hover {
  background: var(--surface);
}

.project-link.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.project-link.primary {
  background: rgba(129, 140, 248, 0.15);
  border-color: rgba(129, 140, 248, 0.35);
  color: #c7d2fe;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: border-color 0.2s, transform 0.2s;
}

.contact-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.contact-icon {
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.contact-label {
  font-weight: 700;
  font-size: 1.05rem;
}

.contact-value {
  font-size: 0.88rem;
  color: var(--muted);
  word-break: break-all;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.footer-logo {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  opacity: 0.85;
}

@media (max-width: 768px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-aside {
    order: -1;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .nav {
    gap: 0.5rem;
    font-size: 0.78rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}
