:root {
  --background: #030711;
  --surface: rgba(12, 18, 37, 0.82);
  --surface-strong: rgba(15, 22, 44, 0.95);
  --text: #f7f8ff;
  --muted: #b6bdd1;
  --line: rgba(144, 162, 255, 0.22);
  --blue: #1ea7ff;
  --purple: #7d3cff;
  --cyan: #25e2d1;
  --pink: #ef4fff;
  --orange: #ff9e3d;
  --radius: 16px;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 64% 16%, rgba(53, 43, 176, 0.22), transparent 29%),
    linear-gradient(180deg, #050812 0%, var(--background) 100%);
  font-family: "Inter", sans-serif;
}

body.menu-open {
  overflow: hidden;
}

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

button {
  font: inherit;
}

.container {
  width: min(1200px, calc(100% - 48px));
  margin-inline: auto;
}

.section {
  scroll-margin-top: 100px;
}

.glass-card {
  background: linear-gradient(145deg, rgba(18, 26, 51, 0.83), rgba(6, 10, 23, 0.91));
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(14px);
}

.background-glow {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(135px);
  opacity: 0.17;
  pointer-events: none;
}

.glow-one {
  top: 170px;
  left: -170px;
  background: #144fff;
}

.glow-two {
  top: 20px;
  right: -190px;
  background: #7027ff;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  transition: 0.25s ease;
}

.header.scrolled {
  background: rgba(3, 7, 17, 0.82);
  border-bottom: 1px solid rgba(144, 162, 255, 0.12);
  backdrop-filter: blur(18px);
}

.header-inner {
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 34px;
  font-weight: 600;
  letter-spacing: 3px;
}

.navigation {
  display: flex;
  align-items: center;
  gap: 38px;
}

.nav-link {
  position: relative;
  color: #eef1fb;
  font-size: 14px;
  transition: 0.25s;
}

.nav-link:hover,
.nav-link.active {
  color: #43adff;
}

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--blue), var(--purple));
  transform: scaleX(0);
  transition: 0.25s;
}

.nav-link.active::after {
  transform: scaleX(1);
}

.menu-button {
  display: none;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 27px;
  height: 2px;
  margin: 6px;
  background: white;
  transition: 0.25s;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  transition: 0.25s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: linear-gradient(120deg, #168df5, #6c2cff);
  box-shadow: 0 10px 28px rgba(74, 54, 255, 0.32);
}

.button-outline {
  border: 1px solid rgba(144, 154, 222, 0.55);
  background: rgba(6, 9, 22, 0.55);
}

.small-button {
  padding: 11px 17px;
  font-size: 12px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(390px, 1fr) minmax(350px, 460px) 275px;
  gap: 27px;
  min-height: 560px;
  padding-top: 15px;
  align-items: center;
}

.technology-rail {
  display: flex;
  width: 55px;
  padding: 15px 8px;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  border-radius: 14px;
}

.technology-rail span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 9px;
  color: #56c5ff;
  font-size: 20px;
}

.technology-rail .next-icon {
  background: #02040a;
  color: #fff;
}

.technology-rail .js-icon {
  background: #56baf7;
  color: #06101e;
  font-size: 14px;
  font-weight: 800;
}

.technology-rail .node-icon {
  color: #72d45c;
}

.hero-content {
  z-index: 3;
  padding-left: 12px;
}

.arabic-text {
  margin: 0 0 16px;
  color: #f8f8fc;
  font-family: "Noto Naskh Arabic", serif;
  font-size: 29px;
}

.hero-content h1 {
  margin: 0;
  background: linear-gradient(120deg, #23a7ff 12%, #8242ff 72%);
  color: transparent;
  font-size: clamp(74px, 9vw, 118px);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: 1px;
  background-clip: text;
  -webkit-background-clip: text;
}

.hero-content h2 {
  margin: 14px 0 15px;
  font-size: clamp(25px, 3vw, 30px);
}

.location {
  margin: 0 0 20px;
  font-size: 16px;
  line-height: 1.55;
}

.location span {
  margin-right: 8px;
  color: #638cff;
}

.hero-description {
  max-width: 530px;
  color: #eceef6;
  font-size: 14px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 17px;
  margin-top: 22px;
}

.hero-image-wrap {
  position: relative;
  display: flex;
  height: 515px;
  align-self: end;
  align-items: flex-end;
  justify-content: center;
}

.hero-orb {
  position: absolute;
  top: 49px;
  left: 50%;
  width: 390px;
  height: 390px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, rgba(0, 194, 255, 0.95), rgba(44, 78, 255, 0.65) 37%, rgba(99, 38, 231, 0.82) 67%, rgba(35, 9, 86, 0.2) 71%);
  box-shadow: 0 0 70px rgba(42, 72, 255, 0.55);
  transform: translateX(-50%);
}

.portrait-placeholder {
  position: relative;
  z-index: 2;
  display: flex;
  width: 390px;
  height: 500px;
  overflow: hidden;
  align-items: center;
  justify-content: flex-end;
  flex-direction: column;
  border-radius: 42% 42% 8px 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(2,4,12,0.5)),
    linear-gradient(135deg, #263143, #080b13 65%);
}

.portrait-head {
  position: absolute;
  top: 72px;
  width: 122px;
  height: 142px;
  border-radius: 48% 48% 44% 44%;
  background: linear-gradient(145deg, #d3a07f, #8f5d43);
  box-shadow: 0 -22px 0 7px #1b1b23;
}

.portrait-body {
  position: absolute;
  bottom: 0;
  width: 320px;
  height: 300px;
  border-radius: 48% 48% 0 0;
  background: linear-gradient(145deg, #171a20, #05070b);
}

.portrait-placeholder p {
  position: relative;
  z-index: 4;
  margin-bottom: 18px;
  color: rgba(255,255,255,0.45);
  font-size: 11px;
}

.code-card {
  z-index: 4;
  align-self: start;
  margin-top: 40px;
  padding: 24px 20px;
  border-radius: var(--radius);
}

.code-card pre {
  margin: 0;
  color: #dce3ff;
  font: 12px/1.75 ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre-wrap;
}

.code-keyword {
  color: #ffae4a;
}

.code-string {
  color: #93d4ff;
}

.floating-code {
  position: absolute;
  top: 250px;
  right: 0;
  display: grid;
  width: 85px;
  height: 85px;
  place-items: center;
  border-radius: 13px;
  color: #58b6ff;
  font-size: 38px;
}

.floating-experience {
  position: absolute;
  right: 110px;
  bottom: 83px;
  z-index: 5;
  padding: 19px 22px;
  border-radius: 14px;
}

.floating-experience strong {
  display: block;
  color: #52a9ff;
  font-size: 40px;
}

.floating-experience span {
  font-size: 12px;
  line-height: 1.5;
}

.stats {
  display: grid;
  overflow: hidden;
  margin-top: 10px;
  grid-template-columns: repeat(3, 1fr);
  border-radius: 17px;
}

.stat-item {
  display: flex;
  padding: 27px 32px;
  align-items: center;
  gap: 23px;
  border-right: 1px solid var(--line);
}

.stat-item:last-child {
  border-right: 0;
}

.stat-icon,
.service-icon {
  display: grid;
  width: 67px;
  height: 67px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  font-size: 32px;
}

.blue {
  color: #3db4ff;
  background: radial-gradient(circle, rgba(31, 141, 255, 0.25), rgba(31, 141, 255, 0.05));
  box-shadow: 0 0 30px rgba(31, 141, 255, 0.18);
}

.purple {
  color: #a768ff;
  background: radial-gradient(circle, rgba(122, 57, 255, 0.25), rgba(122, 57, 255, 0.05));
  box-shadow: 0 0 30px rgba(122, 57, 255, 0.18);
}

.cyan {
  color: #39ead8;
  background: radial-gradient(circle, rgba(32, 229, 208, 0.22), rgba(32, 229, 208, 0.04));
  box-shadow: 0 0 30px rgba(32, 229, 208, 0.16);
}

.pink {
  color: #f16dff;
  background: radial-gradient(circle, rgba(239, 79, 255, 0.25), rgba(239, 79, 255, 0.05));
  box-shadow: 0 0 30px rgba(239, 79, 255, 0.16);
}

.orange {
  color: #ffad4d;
  background: radial-gradient(circle, rgba(255, 154, 55, 0.25), rgba(255, 154, 55, 0.05));
  box-shadow: 0 0 30px rgba(255, 154, 55, 0.15);
}

.stat-item strong {
  font-size: 34px;
}

.stat-item p {
  margin: 5px 0;
  font-size: 13px;
}

.stat-item small {
  color: var(--muted);
  font-size: 11px;
}

.content-section {
  padding-top: 40px;
}

.section-header p {
  margin: 0 0 10px;
  color: #66a4ff;
  font-size: 11px;
  letter-spacing: 2px;
}

.section-header h2 {
  margin: 0 0 21px;
  font-size: 26px;
}

.portfolio-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.service-card {
  min-height: 286px;
  padding: 22px 20px;
  border-radius: 15px;
  transition: 0.28s ease;
}

.service-card:hover,
.project-card:hover {
  border-color: rgba(100, 145, 255, 0.46);
  transform: translateY(-6px);
}

.service-card .service-icon {
  width: 59px;
  height: 59px;
  margin-bottom: 15px;
  font-size: 27px;
}

.service-card h3 {
  margin: 0 0 19px;
  font-size: 15px;
  line-height: 1.3;
}

.service-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-card li {
  margin: 8px 0;
  color: #f0f2f9;
  font-size: 12px;
}

.service-card li::before {
  margin-right: 9px;
  content: "•";
}

.service-card:nth-child(1) li::before { color: var(--blue); }
.service-card:nth-child(2) li::before { color: var(--purple); }
.service-card:nth-child(3) li::before { color: var(--cyan); }
.service-card:nth-child(4) li::before { color: var(--pink); }
.service-card:nth-child(5) li::before { color: var(--orange); }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.project-card {
  overflow: hidden;
  border-radius: 17px;
  transition: 0.28s ease;
}

.project-preview {
  position: relative;
  display: flex;
  height: 240px;
  padding: 20px;
  align-items: center;
  justify-content: center;
}

.preview-mint {
  background: linear-gradient(145deg, #5edbc9, #d9fff6);
}

.preview-beige {
  background: linear-gradient(145deg, #e5ba79, #fff1d8);
}

.preview-navy {
  background: linear-gradient(145deg, #254b75, #cedcf2);
}

.laptop {
  width: 86%;
}

.laptop-screen {
  height: 164px;
  padding: 14px;
  border: 8px solid #141927;
  border-radius: 10px 10px 4px 4px;
  background: rgba(255, 255, 255, 0.89);
  color: #253144;
  text-align: center;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.27);
}

.laptop-screen small {
  display: block;
  margin-bottom: 42px;
  font-weight: 700;
}

.laptop-screen h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.laptop-base {
  width: 108%;
  height: 13px;
  margin-left: -4%;
  border-radius: 0 0 18px 18px;
  background: #1b202c;
}

.phone-preview {
  position: absolute;
  right: 27px;
  bottom: 9px;
  display: grid;
  width: 61px;
  height: 127px;
  place-items: center;
  border: 6px solid #171b25;
  border-radius: 15px;
  background: #f8f8f8;
  color: #30384c;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.project-content {
  position: relative;
  padding: 20px 22px 23px;
}

.project-name {
  display: flex;
  align-items: center;
  gap: 13px;
}

.project-name h3 {
  margin: 0;
  font-size: 17px;
}

.project-name span {
  padding: 7px 10px;
  border-radius: 8px;
  color: #44dbad;
  background: rgba(35, 160, 126, 0.12);
  font-size: 11px;
}

.project-content p {
  margin: 12px 30px 0 0;
  color: #dfe2ed;
  font-size: 12px;
  line-height: 1.65;
}

.project-content > a {
  position: absolute;
  right: 16px;
  bottom: 17px;
  color: #59b8ff;
  font-size: 21px;
}

.contact {
  position: relative;
  display: grid;
  margin-top: 35px;
  margin-bottom: 30px;
  padding: 22px 26px 48px;
  grid-template-columns: 1.1fr 2.2fr 0.7fr;
  gap: 22px;
  border-radius: 18px;
}

.contact-intro h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.contact-intro p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.contact-intro .button {
  margin-top: 9px;
}

.contact-links {
  display: grid;
  align-self: center;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.contact-card {
  display: flex;
  padding: 17px 15px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(128, 145, 221, 0.18);
  border-radius: 13px;
  background: rgba(11, 17, 35, 0.55);
}

.contact-card > span {
  color: #44c8ff;
  font-size: 23px;
}

.contact-card strong {
  display: block;
  font-size: 13px;
}

.contact-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.social-links {
  align-self: center;
}

.social-links > strong {
  font-size: 12px;
}

.social-links div {
  display: flex;
  margin-top: 13px;
  gap: 9px;
}

.social-links a {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 9px;
  background: #121a30;
  font-size: 11px;
}

.copyright {
  position: absolute;
  bottom: 12px;
  left: 50%;
  margin: 0;
  color: #8f96a9;
  font-size: 10px;
  transform: translateX(-50%);
}

.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: grid;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, #168df5, #6c2cff);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: 0.25s;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.75s ease, transform 0.75s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .navigation {
    gap: 21px;
  }

  .hero {
    grid-template-columns: 50px 1fr 370px;
  }

  .code-card {
    display: none;
  }

  .floating-code {
    right: 10px;
  }

  .floating-experience {
    right: 88px;
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

  .social-links {
    display: none;
  }
}

@media (max-width: 820px) {
  .container {
    width: min(100% - 28px, 1200px);
  }

  .header-button {
    display: none;
  }

  .menu-button {
    display: block;
    order: 3;
  }

  .navigation {
    position: absolute;
    top: 74px;
    right: 14px;
    left: 14px;
    display: none;
    padding: 22px;
    flex-direction: column;
    gap: 18px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(7, 12, 27, 0.97);
    box-shadow: var(--shadow);
  }

  .navigation.open {
    display: flex;
  }

  .hero {
    display: flex;
    padding-top: 30px;
    flex-direction: column;
    align-items: stretch;
  }

  .technology-rail {
    display: none;
  }

  .hero-content {
    padding-left: 0;
    text-align: center;
  }

  .location,
  .hero-description {
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-image-wrap {
    height: 420px;
  }

  .hero-orb {
    width: 310px;
    height: 310px;
  }

  .portrait-placeholder {
    width: 320px;
    height: 410px;
  }

  .portrait-body {
    width: 280px;
    height: 250px;
  }

  .floating-code {
    display: none;
  }

  .floating-experience {
    right: 14px;
    bottom: 34px;
  }

  .stats {
    margin-top: 17px;
    grid-template-columns: 1fr;
  }

  .stat-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stat-item:last-child {
    border-bottom: 0;
  }

  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .portfolio-header {
    align-items: flex-start;
    gap: 15px;
  }
}

@media (max-width: 520px) {
  .header-inner {
    height: 74px;
  }

  .logo {
    font-size: 29px;
  }

  .arabic-text {
    font-size: 24px;
  }

  .hero-content h2 {
    font-size: 22px;
  }

  .hero-actions {
    flex-direction: column;
  }

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

  .portfolio-header {
    flex-direction: column;
  }

  .project-preview {
    height: 215px;
  }

  .contact {
    padding-inline: 18px;
  }

  .contact-card small {
    white-space: normal;
  }

  .copyright {
    width: 100%;
    text-align: center;
  }
}
