:root {
  --bg: #0b1220;
  --bg-2: #0f1830;
  --surface: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.1);
  --text: #e8edf7;
  --muted: #9fb0c9;
  --teal: #2dd4bf;
  --amber: #f0b429;
  --radius: 18px;
  --container: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.8;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3 { line-height: 1.35; margin: 0 0 .6rem; font-weight: 700; letter-spacing: -0.2px; }
h1 { font-size: clamp(2rem, 5.2vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; color: var(--muted); }
.lead { color: #c3d0e4; font-size: 1.05rem; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }

.skip {
  position: absolute; inset-inline-start: -9999px; top: 0; z-index: 100;
  background: var(--teal); color: #04222a; padding: .6rem 1rem; border-radius: 0 0 10px 10px;
}
.skip:focus { inset-inline-start: 1rem; }

/* ===== Nav ===== */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(11, 18, 32, 0.72);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s;
}
.nav.is-scrolled { border-bottom-color: var(--border); background: rgba(11, 18, 32, 0.92); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 68px; }

.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; }
.brand img { border-radius: 9px; }
.brand small { display: block; font-size: .72rem; font-weight: 500; color: var(--muted); letter-spacing: .5px; }

.nav__links { display: flex; align-items: center; gap: .25rem; }
.nav__links a {
  padding: .5rem .8rem; border-radius: 10px; color: var(--muted); font-size: .95rem;
  transition: color .2s, background .2s;
}
.nav__links a:hover, .nav__links a.is-active { color: var(--text); background: var(--surface); }
.nav__cta {
  background: linear-gradient(135deg, var(--teal), #38bdf8) !important;
  color: #042027 !important; font-weight: 600;
}
.nav__cta:hover { filter: brightness(1.08); }

.nav__toggle {
  display: none; flex-direction: column; gap: 5px; background: none; border: 1px solid var(--border);
  border-radius: 10px; padding: .6rem .55rem; cursor: pointer;
}
.nav__toggle span { width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s, opacity .2s; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero { position: relative; padding: clamp(4rem, 11vw, 8rem) 0 clamp(3.5rem, 8vw, 6rem); overflow: hidden; }
.hero__bg {
  position: absolute; inset: 0;
  background: url("/images/hero-bg.jpg") center/cover no-repeat;
  opacity: .5;
}
.hero__bg::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(90% 70% at 70% 20%, rgba(11,18,32,.25), rgba(11,18,32,.93) 70%), linear-gradient(0deg, var(--bg), transparent 60%);
}
.hero__inner { position: relative; max-width: 760px; }
.eyebrow {
  display: inline-block; color: var(--amber); font-weight: 600; font-size: .88rem;
  letter-spacing: 1px; margin-bottom: .5rem;
}
.grad { background: linear-gradient(120deg, var(--teal), #60a5fa 55%, var(--amber)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__text { font-size: clamp(1rem, 2.2vw, 1.15rem); max-width: 620px; color: #c6d3e6; }
.hero__actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.6rem 0 1.8rem; }
.hero__tags { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.hero__tags li {
  font-size: .85rem; color: var(--muted); border: 1px solid var(--border);
  background: var(--surface); padding: .35rem .8rem; border-radius: 999px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .85rem 1.5rem; border-radius: 12px; font-weight: 600; font-size: .98rem;
  border: 1px solid transparent; cursor: pointer; transition: transform .15s, filter .2s, background .2s;
  font-family: inherit;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: linear-gradient(135deg, var(--teal), #38bdf8); color: #04222a; }
.btn--primary:hover { filter: brightness(1.08); }
.btn--ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn--ghost:hover { background: rgba(255,255,255,.09); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

/* ===== Sections ===== */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section--alt { background: linear-gradient(180deg, var(--bg), var(--bg-2) 50%, var(--bg)); }
.section__head { max-width: 640px; margin-bottom: 2.2rem; }
.grid-2 { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem; }
.chip {
  font-size: .85rem; padding: .35rem .85rem; border-radius: 999px;
  background: rgba(45, 212, 191, .1); color: var(--teal); border: 1px solid rgba(45,212,191,.25);
}

.about__card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.8rem; text-align: center;
}
.about__card img { margin-inline: auto; border-radius: 16px; margin-bottom: 1rem; }
.about__card .ticks { text-align: start; }

.ticks { list-style: none; padding: 0; margin: 1rem 0 0; }
.ticks li { position: relative; padding-inline-start: 1.6rem; margin-bottom: .55rem; color: var(--muted); font-size: .95rem; }
.ticks li::before {
  content: "✓"; position: absolute; inset-inline-start: 0; color: var(--teal); font-weight: 700;
}

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.cards--4 { grid-template-columns: repeat(4, 1fr); }
.card, .svc {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; transition: transform .25s, border-color .25s, background .25s;
}
.card:hover, .svc:hover { transform: translateY(-4px); border-color: rgba(45,212,191,.4); background: rgba(255,255,255,.06); }
.card__badge {
  display: inline-block; font-size: .75rem; color: var(--amber); background: rgba(240,180,41,.12);
  border: 1px solid rgba(240,180,41,.3); padding: .2rem .7rem; border-radius: 999px; margin-bottom: .7rem;
}
.svc__icon {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(135deg, rgba(45,212,191,.18), rgba(96,165,250,.14));
  color: var(--teal); font-size: 1.1rem; margin-bottom: .9rem;
}

/* ===== Timeline ===== */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; inset-inline-start: 7px; top: 6px; bottom: 6px;
  width: 2px; background: linear-gradient(var(--teal), rgba(45,212,191,.05));
}
.timeline li { position: relative; padding-inline-start: 2.2rem; padding-bottom: 1.8rem; }
.timeline li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 9px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--bg); border: 3px solid var(--teal);
}
.timeline li:last-child { padding-bottom: 0; }

/* ===== Skills ===== */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.skills__group {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem;
}
.skills__group h3 { color: var(--teal); font-size: 1rem; margin-bottom: .8rem; }
.skills__group ul { list-style: none; padding: 0; margin: 0; }
.skills__group li {
  color: var(--muted); font-size: .95rem; padding: .35rem 0;
  border-bottom: 1px dashed rgba(255,255,255,.07);
}
.skills__group li:last-child { border-bottom: none; }

/* ===== Contact ===== */
.section--contact { background: linear-gradient(180deg, var(--bg), #0d1526); }
.form {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.6rem;
}
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: .92rem; font-weight: 600; margin-bottom: .4rem; }
.field .opt { color: var(--muted); font-weight: 400; font-size: .85rem; }
.field input, .field textarea {
  width: 100%; padding: .8rem .9rem; border-radius: 12px; background: rgba(0,0,0,.25);
  border: 1px solid var(--border); color: var(--text); font-family: inherit; font-size: .97rem;
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder, .field textarea::placeholder { color: #6d7f99; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(45,212,191,.15);
}
.field textarea { resize: vertical; min-height: 120px; }
.form__status { margin: .9rem 0 0; font-size: .92rem; min-height: 1.3em; }
.form__status.ok { color: var(--teal); }
.form__status.err { color: #fca5a5; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); padding: 1.8rem 0; background: #090f1c; }
.footer__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer p { margin: 0; font-size: .9rem; }

/* ===== Reveal ===== */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .cards, .cards--4, .skills { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav__toggle { display: flex; }
  .nav__links {
    position: absolute; inset-inline: 0; top: 68px; flex-direction: column; align-items: stretch;
    background: #0c1424; border-bottom: 1px solid var(--border); padding: .8rem 1.25rem 1.2rem;
    gap: .2rem; display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: .75rem .8rem; }
  .nav__cta { text-align: center; margin-top: .4rem; }
  .cards, .cards--4, .skills { grid-template-columns: 1fr; }
  .hero__actions .btn { flex: 1 1 100%; }
}
