/* ===== Modern Portfolio Theme (2026) ===== */

:root {
  --primary: #6366F1;
  --secondary: #0F172A;
  --accent: #22C55E;

  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --text: #0F172A;
  --muted: #475569;
  --border: rgba(15, 23, 42, 0.12);

  --shadow: 0 18px 50px rgba(2, 6, 23, 0.10);
  --shadow-soft: 0 10px 30px rgba(2, 6, 23, 0.08);
  --ring: rgba(99, 102, 241, 0.35);

  --radius: 18px;
}

html[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #0F172A;
  --surface-2: #111827;
  --text: #E5E7EB;
  --muted: #94A3B8;
  --border: rgba(226, 232, 240, 0.12);
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.35);
}

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

body {
  font-family: "Poppins", "Cairo", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16.5px;
  scroll-behavior: smooth;
  transition: background-color 250ms ease, color 250ms ease;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

a:not(.btn):hover {
  color: var(--primary);
}

::selection {
  background: rgba(99, 102, 241, 0.25);
}

.section {
  padding: 96px 0;
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section+.section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 1140px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.18), transparent);
}

.section-title {
  text-align: center;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: clamp(1.7rem, 2.5vw, 2.3rem);
  margin-bottom: 12px;
}

.section-lead {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
}

/* ===== Focus styles ===== */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.card:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--ring);
}

/* ===== Theme toggle ===== */
.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1100;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  padding: 10px 12px;
  border-radius: 999px;
  color: var(--text);
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, background-color 250ms ease, border-color 250ms ease;
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(15, 23, 42, 0.7);
}

.theme-toggle span {
  font-weight: 700;
  font-size: 14px;
}

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

/* ===== Navbar ===== */
.navbar {
  padding: 14px 0;
  background: transparent;
  transition: background-color 250ms ease, box-shadow 250ms ease, border-color 250ms ease;
}

.navbar-scrolled {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.08);
}

html[data-theme="dark"] .navbar-scrolled {
  background: rgba(15, 23, 42, 0.7);
}

.navbar-brand {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text) !important;
}

.nav-link {
  color: var(--text) !important;
  opacity: 0.85;
  font-weight: 600;
  transition: opacity 180ms ease, transform 180ms ease, color 180ms ease;
}

.nav-link:hover {
  opacity: 1;
  color: var(--primary) !important;
  transform: translateY(-1px);
}

/* add horizontal gap between navbar items to loosen layout */
.navbar-nav {
  display: flex;
  gap: 20px;
  /* converted from 1.2rem */
}

/* ===== Buttons ===== */
.btn {
  border-radius: 999px;
  font-weight: 700;
  padding: 12px 18px;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.btn-lg {
  padding: 14px 22px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  border: 0;
  box-shadow: 0 14px 30px rgba(99, 102, 241, 0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(99, 102, 241, 0.32);
}

.btn-outline-primary {
  border: 1px solid rgba(99, 102, 241, 0.45);
  color: var(--text);
  background: transparent;
}

.btn-outline-primary:hover {
  background: rgba(99, 102, 241, 0.10);
  border-color: rgba(99, 102, 241, 0.70);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(2, 6, 23, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
}

html[data-theme="dark"] .btn-secondary {
  background: rgba(226, 232, 240, 0.06);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: var(--text);
}

.btn-ghost:hover {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.70);
  transform: translateY(-2px);
}

/* ===== Hero ===== */
.hero {
  padding-top: 116px;
  /* for fixed navbar */
  padding-bottom: 80px;
  overflow: hidden;
  background:
    radial-gradient(800px 400px at 15% 10%, rgba(99, 102, 241, 0.22), transparent 60%),
    radial-gradient(700px 380px at 90% 40%, rgba(34, 197, 94, 0.16), transparent 55%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.02), transparent 35%),
    var(--bg);
}

html[data-theme="dark"] .hero {
  background:
    radial-gradient(800px 400px at 15% 10%, rgba(99, 102, 241, 0.20), transparent 60%),
    radial-gradient(700px 380px at 90% 40%, rgba(34, 197, 94, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 35%),
    var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 36px;
  align-items: center;
}

.hero-eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 700;
}

.hero-title {
  margin: 0;
  font-weight: 900;
  letter-spacing: -0.03em;
  font-size: clamp(2.2rem, 4.8vw, 3.6rem);
}

.hero-subtitle {
  margin: 10px 0 0;
  font-weight: 800;
  color: var(--text);
  opacity: 0.92;
}

.hero-sep {
  opacity: 0.45;
  padding: 0 8px;
}

.hero-desc {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 56ch;
}

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

.hero-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, border-color 180ms ease;
}

html[data-theme="dark"] .social-pill {
  background: rgba(15, 23, 42, 0.65);
}

.social-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.40);
}

.social-pill i {
  color: var(--primary);
}

.hero-media {
  display: grid;
  gap: 14px;
  justify-items: center;
}

.hero-avatar {
  width: min(340px, 78vw);
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(34, 197, 94, 0.10));
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
  transition: transform 250ms ease, filter 250ms ease;
  filter: contrast(1.04) saturate(1.02);
}

.hero-avatar:hover img {
  transform: scale(1.06);
}

.hero-card {
  width: min(340px, 78vw);
  padding: 14px 14px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.hero-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.dot-accent {
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.16);
}

.hero-card-title {
  font-weight: 800;
}

.hero-card-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ===== About ===== */
.about-layout {
  margin-top: 10px;
}

.about-photo img {
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.about-heading {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 10px;
}

.about-highlights {
  padding-left: 20px;
  /* converted from 1.2rem */
  margin-bottom: 0;
  color: var(--muted);
}

.about-highlights li+li {
  margin-top: 4px;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ===== About/Education/Services cards ===== */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.about-card,
.service-card {
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-soft);
  /* ensure consistent height: flex column lets body grow evenly */
  display: flex;
  flex-direction: column;
}

html[data-theme="dark"] .service-card {
  color: #fff;
  /* ensure headings/body text remain bright in dark mode */
}

/* make project titles and descriptions accessible in dark mode */
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .project-card h3,
html[data-theme="dark"] .project-desc {
  color: #fff;
}

/* ensure about section text is white in dark theme */
html[data-theme="dark"] #about,
html[data-theme="dark"] #about .about-main,
html[data-theme="dark"] #about p,
html[data-theme="dark"] #about h3,
html[data-theme="dark"] #about li {
  color: #fff;
}

.about-card ul.list-unstyled {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
}

.about-card ul.list-unstyled li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(99, 102, 241, 0.08);
  font-weight: 800;
}

.about-card ul.list-unstyled li i {
  color: var(--primary);
}

.about-card:hover,
.service-card:hover {
  transform: translateY(-3px);
  transition: transform 180ms ease, box-shadow 180ms ease;
  box-shadow: var(--shadow);
}

.service-card i {
  color: var(--primary);
}

/* make description paragraph stretch to push footer elements down */
.service-card p {
  flex-grow: 1;
}

/* ensure each card takes full height of its column */
#services .row {
  align-items: stretch;
}

.service-card {
  height: 100%;
}

/* Services refinements removed – only simple .service-card remains */

/* education section styles removed – not present in current HTML */

/* ===== Skills grid ===== */
.skills-grid,
.soft-skills-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (min-width: 768px) {

  /* medium screens: 4 columns */
  .skills-grid,
  .soft-skills-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1200px) {

  /* large screens: 3 columns (requested) */
  .skills-grid,
  .soft-skills-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* card-like tiles */
.skill-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 18px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 180ms ease, box-shadow 180ms ease;
  text-align: center;
  min-width: 140px;
  white-space: nowrap;
}

@media (max-width: 576px) {
  .skill-tile {
    padding: 12px 10px;
    font-size: 0.9rem;
  }
}

.skill-tile i {
  font-size: 1.6rem;
  color: var(--primary);
}

.skill-tile span {
  font-weight: 600;
  white-space: nowrap;
}

.skill-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

/* legacy .skill-badge design removed – site uses simple .skill-tile instead */

/* removed mismatched soft-skill styles; HTML uses .skill-soft-pill */

/* ===== Projects ===== */
.project-card {
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
  border-color: rgba(99, 102, 241, 0.28);
}

.project-media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(99, 102, 241, 0.06);
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 250ms ease;
}

.project-card:hover .project-media img {
  transform: scale(1.05);
}

.project-title {
  font-size: 1.12rem;
  font-weight: 900;
  margin: 0;
  letter-spacing: -0.01em;
}

.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tech-tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid var(--border);
  background: rgba(99, 102, 241, 0.08);
  color: var(--text);
}

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

.project-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== GitHub ===== */
.github-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.github-card {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-soft);
  padding: 16px;
}

.github-card h3 {
  font-size: 1rem;
  font-weight: 900;
  margin: 0 0 10px;
}

.github-card img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== Contact ===== */
.contact-modern .contact-info {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.contact-modern .contact-info::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 300px at -10% -10%, rgba(99, 102, 241, 0.18), transparent 45%),
    radial-gradient(700px 260px at 110% 110%, rgba(34, 197, 94, 0.12), transparent 50%);
}

.contact-info>* {
  position: relative;
  z-index: 1;
}

.cta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.contact-info-list {
  display: grid;
  gap: 12px;
}

.info-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
}

html[data-theme="dark"] .info-item {
  background: rgba(15, 23, 42, 0.45);
}

.info-item i {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
}

.info-item small {
  display: block;
  color: var(--muted);
  margin-bottom: 2px;
  font-weight: 700;
}

.info-item a,
.info-item span {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform 180ms ease, border-color 180ms ease;
}

html[data-theme="dark"] .social-link {
  background: rgba(15, 23, 42, 0.65);
}

.social-link:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.35);
}

.social-link i {
  color: var(--primary);
  font-size: 18px;
}

.social-link.whatsapp i {
  color: #16a34a;
}

/* ===== Footer ===== */
footer {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}

footer p {
  margin: 0;
  font-weight: 700;
}

.social-links {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ===== Back to top ===== */
.back-to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 1000;
}

html[data-theme="dark"] .back-to-top {
  background: rgba(15, 23, 42, 0.65);
}

.back-to-top i {
  color: var(--primary);
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 992px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-media {
    justify-items: start;
  }

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

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

@media (max-width: 768px) {
  .section {
    padding: 78px 0;
  }

  .theme-toggle {
    top: 12px;
    right: 12px;
    padding: 9px 11px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .social-links {
    justify-content: center;
    margin-top: 12px;
  }
}

/* extra small phones */
@media (max-width: 576px) {
  .hero {
    padding-top: 90px;
    padding-bottom: 60px;
  }

  .hero-title {
    font-size: clamp(2rem, 6vw, 2.8rem);
  }

  .hero-desc {
    font-size: 1rem;
  }

  .hero-actions .btn {
    display: block;
    width: 100%;
    margin-bottom: 8px;
  }

  .hero-media {
    gap: 24px;
  }

  .hero-avatar,
  .hero-card {
    width: 90vw;
  }

  .section {
    min-height: auto;
  }

  /* make about section stack nicely */
  .about-layout {
    flex-direction: column;
  }

  /* shrink spacing in navbar for very narrow viewports */
  .navbar {
    padding: 10px 0;
  }
}