/* ═══════════════════════════════════════
   AHMED ELGAMAL PORTFOLIO — style.css
═══════════════════════════════════════ */

/* ── RESET & ROOT ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:      #060810;
  --bg2:     #0d1117;
  --bg3:     #111827;
  --cyan:    #00e5ff;
  --cyan2:   #00b4d8;
  --white:   #f0f4f8;
  --muted:   #8892a4;
  --border:  rgba(0, 229, 255, .12);
  --card:    rgba(13, 17, 23, .85);
  --font-h:  'Bebas Neue', sans-serif;
  --font-b:  'DM Sans', sans-serif;
  --font-m:  'JetBrains Mono', monospace;
  --radius:  12px;
  --trans:   .35s cubic-bezier(.4, 0, .2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-b);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

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

/* ── CANVAS BACKGROUND ── */
#bg-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .45;
}

/* ── GRID OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

section, nav, footer {
  position: relative;
  z-index: 1;
}

/* ════════════════════════════════
   NAVBAR
════════════════════════════════ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  height: 64px;
  background: rgba(6, 8, 16, .8);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: var(--trans);
}

.nav-logo {
  font-family: var(--font-m);
  font-size: .9rem;
  color: var(--cyan);
  letter-spacing: .05em;
  text-decoration: none;
}
.nav-logo span { color: var(--muted); }

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  font-family: var(--font-m);
  font-size: .78rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: color var(--trans);
}
.nav-links a:hover { color: var(--cyan); }

.nav-menu {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cyan);
  font-size: 1.3rem;
}

/* ════════════════════════════════
   BUTTONS
════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .7rem 1.7rem;
  border-radius: var(--radius);
  font-family: var(--font-b);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: var(--trans);
}

.btn-primary {
  background: var(--cyan);
  color: var(--bg);
}
.btn-primary:hover {
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(0, 229, 255, .4);
}

.btn-ghost {
  border: 1px solid var(--border);
  color: var(--white);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-2px);
}

/* ════════════════════════════════
   HERO
════════════════════════════════ */
#home {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
  padding: 100px 8% 60px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-m);
  font-size: .75rem;
  color: var(--cyan);
  border: 1px solid var(--border);
  padding: .35rem .9rem;
  border-radius: 99px;
  margin-bottom: 1.2rem;
  background: rgba(0, 229, 255, .05);
}
.hero-badge::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  animation: blink 1.4s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .2; }
}

.hero-title {
  font-family: var(--font-h);
  font-size: clamp(3.5rem, 7vw, 6.5rem);
  line-height: .95;
  letter-spacing: .02em;
  margin-bottom: 1rem;
  color: var(--white);
}
.hero-title .cyan { color: var(--cyan); }

.hero-sub {
  font-family: var(--font-m);
  font-size: .9rem;
  color: var(--cyan2);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero-desc {
  color: var(--muted);
  font-size: 1rem;
  max-width: 440px;
  margin-bottom: 2rem;
}

.hero-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-socials {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}
.hero-socials a {
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: .95rem;
  text-decoration: none;
  transition: var(--trans);
}
.hero-socials a:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(0, 229, 255, .08);
}

/* Hero Image */
.hero-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.hero-img-wrap {
  position: relative;
  width: 320px; height: 380px;
}
.hero-img-wrap::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--cyan), transparent 60%);
  z-index: 0;
}
.hero-img-wrap img {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 22px;
  filter: grayscale(20%);
}
.img-fallback {
  position: relative; z-index: 1;
  width: 100%; height: 100%;
  border-radius: 22px;
  background: var(--bg3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  color: var(--muted);
  font-family: var(--font-m);
  font-size: .8rem;
}
.img-fallback i {
  font-size: 3rem;
  color: var(--cyan);
  opacity: .4;
}

.hero-float-card {
  position: absolute;
  bottom: -20px; left: -30px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1.2rem;
  display: flex;
  align-items: center;
  gap: .8rem;
  font-family: var(--font-m);
  font-size: .75rem;
  color: var(--muted);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .4);
  animation: float 3s ease-in-out infinite;
}
.hero-float-card .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #22c55e;
  animation: blink 1.4s infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}

/* ════════════════════════════════
   SECTION SHARED
════════════════════════════════ */
section { padding: 100px 8%; }

.section-tag {
  font-family: var(--font-m);
  font-size: .75rem;
  color: var(--cyan);
  letter-spacing: .2em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: 1rem;
}
.section-tag::after {
  content: '';
  flex: 1;
  max-width: 60px;
  height: 1px;
  background: var(--cyan);
}

.section-title {
  font-family: var(--font-h);
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: .03em;
  line-height: 1;
  margin-bottom: 1rem;
}

.section-desc {
  color: var(--muted);
  max-width: 520px;
  margin-bottom: 3.5rem;
}

/* ════════════════════════════════
   ABOUT
════════════════════════════════ */
#about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}

.about-img {
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}
.about-img img {
  width: 100%; height: 420px;
  object-fit: cover;
  border-radius: 20px;
  filter: grayscale(30%) brightness(.9);
  transition: var(--trans);
}
.about-img:hover img {
  filter: grayscale(0) brightness(1);
}
.about-img::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, var(--bg) 100%);
  border-radius: 20px;
  pointer-events: none;
}

.about-p {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.about-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8rem;
  margin: 2rem 0;
}

.info-pill {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .6rem 1rem;
  font-size: .85rem;
}
.info-pill span {
  color: var(--muted);
  font-size: .75rem;
  display: block;
  font-family: var(--font-m);
}

/* ════════════════════════════════
   EDUCATION
════════════════════════════════ */
#education { background: var(--bg2); }

.edu-timeline { position: relative; }
.edu-timeline::before {
  content: '';
  position: absolute;
  left: 16px; top: 8px; bottom: 8px;
  width: 1px;
  background: var(--border);
}

.edu-item {
  position: relative;
  padding: 0 0 3rem 3.5rem;
}
.edu-item:last-child { padding-bottom: 0; }

.edu-dot {
  position: absolute;
  left: 8px; top: 8px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  background: var(--bg);
  transform: translateX(-50%);
  z-index: 2;
}
.edu-dot::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--cyan);
}

.edu-year {
  font-family: var(--font-m);
  font-size: .75rem;
  color: var(--cyan);
  letter-spacing: .1em;
  margin-bottom: .5rem;
}

.edu-title {
  font-family: var(--font-h);
  font-size: 1.5rem;
  letter-spacing: .04em;
  margin-bottom: .4rem;
}

.edu-desc {
  color: var(--muted);
  font-size: .9rem;
  max-width: 520px;
}

/* ════════════════════════════════
   PROJECTS
════════════════════════════════ */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: var(--trans);
}
.project-card:hover {
  border-color: rgba(0, 229, 255, .35);
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0, 229, 255, .08);
}

.project-thumb {
  width: 100%; height: 200px;
  object-fit: cover;
  display: block;
  filter: grayscale(30%);
  transition: var(--trans);
}
.project-card:hover .project-thumb { filter: grayscale(0); }

.project-thumb-placeholder {
  width: 100%; height: 200px;
  background: linear-gradient(135deg, var(--bg3) 0%, var(--bg2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  font-size: 3rem;
  opacity: .3;
}

.project-body { padding: 1.4rem; }

.project-tags {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-bottom: .8rem;
}
.project-tag {
  font-family: var(--font-m);
  font-size: .7rem;
  color: var(--cyan);
  background: rgba(0, 229, 255, .08);
  border: 1px solid var(--border);
  padding: .2rem .6rem;
  border-radius: 4px;
}

.project-name {
  font-family: var(--font-h);
  font-size: 1.4rem;
  letter-spacing: .04em;
  margin-bottom: .5rem;
}

.project-desc {
  color: var(--muted);
  font-size: .87rem;
  margin-bottom: 1rem;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-family: var(--font-m);
  font-size: .78rem;
  color: var(--cyan);
  text-decoration: none;
  letter-spacing: .08em;
  transition: var(--trans);
}
.project-link:hover { gap: .8rem; }
.muted-link { color: var(--muted); cursor: default; }

/* ════════════════════════════════
   SKILLS
════════════════════════════════ */
#skills { background: var(--bg2); }

.skills-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
}

.skill-group-title {
  font-family: var(--font-m);
  font-size: .8rem;
  color: var(--cyan);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.skill-item { margin-bottom: 1.5rem; }

.skill-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .5rem;
}
.skill-name { font-size: .9rem; font-weight: 500; }
.skill-pct {
  font-family: var(--font-m);
  font-size: .75rem;
  color: var(--cyan);
}

.skill-bar {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.skill-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--cyan2), var(--cyan));
  width: 0%;
  transition: width 1.2s cubic-bezier(.4, 0, .2, 1);
}

.soft-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.soft-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  transition: var(--trans);
}
.soft-card:hover {
  border-color: rgba(0, 229, 255, .3);
  background: rgba(0, 229, 255, .04);
}
.soft-card i {
  font-size: 1.3rem;
  color: var(--cyan);
  margin-bottom: .5rem;
  display: block;
}
.soft-card h4 { font-size: .95rem; font-weight: 600; margin-bottom: .2rem; }
.soft-card p  { font-size: .8rem; color: var(--muted); }

/* ════════════════════════════════
   SERVICES
════════════════════════════════ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.service-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  transition: var(--trans);
  position: relative;
  overflow: hidden;
}
.service-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0;
  transition: var(--trans);
}
.service-card:hover::before { opacity: 1; }
.service-card:hover {
  border-color: rgba(0, 229, 255, .25);
  transform: translateY(-4px);
}

.service-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  background: rgba(0, 229, 255, .1);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--cyan);
  margin-bottom: 1.2rem;
}
.service-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; }
.service-card p  { color: var(--muted); font-size: .87rem; line-height: 1.6; }

/* ════════════════════════════════
   CONTACT
════════════════════════════════ */
#contact {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 5rem;
  align-items: start;
}

.contact-intro {
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.8rem;
}
.contact-icon {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(0, 229, 255, .08);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cyan);
  font-size: 1rem;
}
.contact-info-item h4 {
  font-size: .85rem;
  color: var(--muted);
  font-family: var(--font-m);
  letter-spacing: .08em;
}
.contact-info-item p,
.contact-info-item a {
  color: var(--white);
  font-size: .95rem;
  text-decoration: none;
  transition: color var(--trans);
}
.contact-info-item a:hover { color: var(--cyan); }

.contact-socials {
  display: flex;
  gap: .8rem;
  margin-top: 2rem;
}
.contact-socials a {
  width: 42px; height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-decoration: none;
  transition: var(--trans);
}
.contact-socials a:hover {
  color: var(--cyan);
  border-color: var(--cyan);
  background: rgba(0, 229, 255, .08);
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.form-group label {
  font-family: var(--font-m);
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .1em;
}
.form-group input,
.form-group textarea {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .75rem 1rem;
  color: var(--white);
  font-family: var(--font-b);
  font-size: .9rem;
  outline: none;
  transition: var(--trans);
  resize: none;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, .08);
}
.form-group textarea { min-height: 130px; }

/* ════════════════════════════════
   FOOTER
════════════════════════════════ */
footer {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 2.5rem 8%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
footer p { color: var(--muted); font-size: .85rem; }
footer a { color: var(--cyan); text-decoration: none; }

.footer-links { display: flex; gap: 1rem; }
.footer-links a {
  color: var(--muted);
  font-size: .85rem;
  text-decoration: none;
  transition: color var(--trans);
}
.footer-links a:hover { color: var(--cyan); }

/* ════════════════════════════════
   SCROLL ANIMATIONS
════════════════════════════════ */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s ease, transform .7s ease;
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-width: 900px) {
  #home, #about, #contact {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  .hero-visual { order: -1; }
  .hero-img-wrap { width: 240px; height: 280px; }
  .skills-wrapper { grid-template-columns: 1fr; gap: 2.5rem; }
  .form-row { grid-template-columns: 1fr; }
  nav { padding: 0 5%; }

  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 64px 0 0 0;
    background: rgba(6, 8, 16, .97);
    padding: 3rem 2rem;
    gap: 2rem;
    align-items: center;
    justify-content: flex-start;
  }
  .nav-links.open a { font-size: 1rem; }
  .nav-menu { display: block; }
}

@media (max-width: 580px) {
  section { padding: 80px 5%; }
  #home { padding: 100px 5% 60px; }
  .about-info-grid { grid-template-columns: 1fr; }
  .soft-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; text-align: center; }
}
