/* ============================================================
   Mohammed Shamil — Personal Portfolio
   Dark · Futuristic · Bilingual (AR/EN)
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --bg: #0A0A0F;
  --surface: #12121A;
  --surface-2: #161620;
  --accent: #6C63FF;
  --accent-2: #00D4FF;
  --text: #FFFFFF;
  --text-muted: #A0A0B0;
  --border: #2A2A3A;
  --grad: linear-gradient(135deg, #6C63FF, #00D4FF);
  --radius: 16px;
  --nav-h: 72px;
  --font-ar: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --font-en: 'Space Grotesk', 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 12px);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ar);
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.lang-en { font-family: var(--font-en); }
body.lang-en { letter-spacing: .01em; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

::selection { background: var(--accent); color: #fff; }

.container { width: min(1100px, 92%); margin-inline: auto; }

/* ---------- Glass cards ---------- */
.glass {
  background: rgba(18, 18, 26, 0.62);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ---------- Reveal on scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
  will-change: opacity, transform;
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  border: 1px solid transparent;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease),
              background .25s, border-color .25s;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 24px rgba(108, 99, 255, .35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(108, 99, 255, .5);
}

.btn-ghost {
  border-color: var(--border);
  background: rgba(18, 18, 26, .5);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background .35s, border-color .35s, backdrop-filter .35s;
  border-block-end: 1px solid transparent;
}
.navbar.scrolled {
  background: rgba(10, 10, 15, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-block-end-color: var(--border);
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  font-weight: 900;
  font-size: 1.35rem;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-inline-start: auto;
}
.nav-links a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: .95rem;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: color .25s, background .25s;
}
.nav-links a:hover { color: #fff; background: rgba(108, 99, 255, .12); }

.lang-btn {
  margin-inline-start: 8px;
  padding: 8px 16px;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: .9rem;
  background: rgba(108, 99, 255, .12);
  transition: background .25s, box-shadow .25s, transform .25s;
}
.lang-btn:hover {
  background: rgba(108, 99, 255, .28);
  box-shadow: 0 0 18px rgba(108, 99, 255, .4);
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: 10px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin-inline: auto;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .3s;
}
.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;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

#particles {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-glow::before,
.hero-glow::after {
  content: "";
  position: absolute;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(130px);
  opacity: .16;
  z-index: 0;
}
.hero-glow::before {
  background: var(--accent);
  inset-block-start: -140px;
  inset-inline-start: -140px;
}
.hero-glow::after {
  background: var(--accent-2);
  inset-block-end: -160px;
  inset-inline-end: -120px;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 110px 20px 80px;
}

.photo-ring {
  width: 196px;
  height: 196px;
  padding: 5px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--accent));
  box-shadow: 0 0 42px rgba(108, 99, 255, .45), 0 0 90px rgba(0, 212, 255, .18);
  animation: ring-pulse 5s ease-in-out infinite;
  margin-block-end: 26px;
}
.photo-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  border-radius: 50%;
  border: 4px solid var(--bg);
}
@keyframes ring-pulse {
  0%, 100% { box-shadow: 0 0 42px rgba(108, 99, 255, .45), 0 0 90px rgba(0, 212, 255, .18); }
  50%      { box-shadow: 0 0 58px rgba(108, 99, 255, .65), 0 0 120px rgba(0, 212, 255, .3); }
}

.hero-greeting {
  color: var(--accent-2);
  font-weight: 700;
  letter-spacing: .06em;
  font-size: 1.05rem;
}

.hero-name {
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  font-weight: 900;
  line-height: 1.25;
  margin-block: 6px 10px;
  background: linear-gradient(120deg, #fff 30%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-role {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  font-weight: 700;
  color: var(--text);
  min-height: 1.8em;
}
.caret {
  display: inline-block;
  width: 3px;
  height: 1.1em;
  margin-inline-start: 4px;
  background: var(--accent-2);
  vertical-align: text-bottom;
  animation: blink 1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-tagline {
  margin-block: 14px 30px;
  color: var(--text-muted);
  max-width: 560px;
  font-size: 1.05rem;
}

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }

.scroll-hint {
  position: absolute;
  inset-block-end: 26px;
  inset-inline: 0;
  margin-inline: auto;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: 50%;
  z-index: 1;
  animation: bob 2.2s ease-in-out infinite;
  transition: color .25s;
}
.scroll-hint:hover { color: var(--accent-2); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(8px); } }

/* ---------- Sections ---------- */
.section { padding-block: 96px; position: relative; }
.section:nth-child(even) { background: rgba(18, 18, 26, .35); }

.section-head { margin-block-end: 44px; }
.section-label {
  display: inline-block;
  color: var(--accent-2);
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .08em;
  margin-block-end: 6px;
}
body.lang-en .section-label { text-transform: uppercase; }
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.25rem);
  font-weight: 900;
  position: relative;
  padding-inline-start: 16px;
}
.section-head h2::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block: 6px 6px;
  width: 4px;
  border-radius: 4px;
  background: var(--grad);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
}
.about-text {
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 2;
}

.about-code {
  padding: 0;
  overflow: hidden;
  font-family: 'Cascadia Code', 'Fira Code', Consolas, monospace;
  font-size: .85rem;
  line-height: 1.75;
  direction: ltr;
  text-align: start;
}
.code-dots {
  display: flex;
  gap: 7px;
  padding: 13px 16px;
  border-block-end: 1px solid var(--border);
  background: rgba(10, 10, 15, .55);
}
.code-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border);
}
.code-dots i:nth-child(1) { background: #FF5F57; }
.code-dots i:nth-child(2) { background: #FEBC2E; }
.code-dots i:nth-child(3) { background: #28C840; }
.about-code pre { padding: 18px 20px 22px; overflow-x: auto; }
.about-code code { color: var(--text-muted); }
.tk-kw  { color: var(--accent-2); }
.tk-var { color: #fff; font-weight: 600; }
.tk-str { color: #A6E22E; }
.tk-fn  { color: #F7B42C; }

/* ---------- Education (timeline) ---------- */
.timeline {
  position: relative;
  max-width: 720px;
  padding-inline-start: 34px;
}
.timeline::before {
  content: "";
  position: absolute;
  inset-inline-start: 10px;
  inset-block: 8px 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--accent-2));
  border-radius: 2px;
  opacity: .6;
}
.timeline-item {
  position: relative;
  padding: 24px 26px;
  margin-block-end: 22px;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.timeline-item:last-child { margin-block-end: 0; }
.timeline-item:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .4);
}
.timeline-icon {
  position: absolute;
  inset-inline-start: -34px;
  inset-block-start: 26px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--accent);
  color: var(--accent-2);
  box-shadow: 0 0 16px rgba(108, 99, 255, .35);
}
.timeline-body h3 { font-size: 1.2rem; font-weight: 700; }
.timeline-inst { color: var(--text-muted); margin-block: 4px 12px; }

.badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
}
.badge-done {
  color: #28C840;
  background: rgba(40, 200, 64, .1);
  border: 1px solid rgba(40, 200, 64, .35);
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 22px;
}
.skill-card { padding: 26px 24px; transition: transform .3s var(--ease), border-color .3s; }
.skill-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.skill-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-block-end: 18px;
  color: var(--accent-2);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(10, 10, 15, .55);
  color: var(--text-muted);
  font-size: .92rem;
  font-weight: 600;
  transition: color .25s, border-color .25s, box-shadow .25s, transform .25s var(--ease);
}
.chip:hover {
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(108, 99, 255, .35);
  transform: translateY(-2px);
}

/* ---------- Contact ---------- */
.contact-card {
  max-width: 640px;
  margin-inline: auto;
  padding: 40px 36px;
  text-align: center;
}
.contact-text { color: var(--text-muted); margin-block-end: 24px; }

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(10, 10, 15, .5);
  font-weight: 700;
  direction: ltr;
  transition: border-color .3s, box-shadow .3s, transform .3s var(--ease);
}
.contact-email svg { color: var(--accent-2); transition: transform .3s var(--ease); }
.contact-email:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(108, 99, 255, .3);
  transform: translateY(-2px);
}
.contact-email:hover svg { transform: translateY(-3px) rotate(-8deg); }

.divider {
  height: 1px;
  background: var(--border);
  margin-block: 28px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-block-end: 14px;
  text-align: start;
}
#contactForm input,
#contactForm textarea {
  width: 100%;
  padding: 14px 16px;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(10, 10, 15, .6);
  color: var(--text);
  font: inherit;
  font-size: .95rem;
  transition: border-color .25s, box-shadow .25s;
}
#contactForm textarea { resize: vertical; min-height: 120px; }
#contactForm input:focus,
#contactForm textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(108, 99, 255, .22);
}
.btn-send { margin-block-start: 18px; width: 100%; }
.form-note { margin-block-start: 14px; color: var(--text-muted); font-size: .85rem; }

/* ---------- Footer ---------- */
.footer {
  border-block-start: 1px solid var(--border);
  padding-block: 26px;
  text-align: center;
  color: var(--text-muted);
  font-size: .9rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .exp-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  body { font-size: 16px; }
  .section { padding-block: 72px; }
  .logo { font-size: 1.05rem; }

  .nav-toggle { display: flex; order: 3; }
  .lang-btn { margin-inline-start: auto; order: 2; }

  .nav-links {
    position: fixed;
    inset-block-start: var(--nav-h);
    inset-inline-start: 0;
    flex-direction: column;
    align-items: stretch;
    width: min(300px, 78vw);
    height: calc(100vh - var(--nav-h));
    background: rgba(10, 10, 15, .97);
    border-inline-end: 1px solid var(--border);
    padding: 24px 18px;
    gap: 4px;
    transform: translateX(-105%);
    transition: transform .4s var(--ease);
    z-index: 99;
  }
  [dir="rtl"] .nav-links { transform: translateX(105%); }
  .nav-links.open { transform: translateX(0) !important; }
  .nav-links a { padding: 14px 16px; font-size: 1.05rem; }

  .photo-ring { width: 136px; height: 136px; }
  .hero-inner { padding-block: 120px 90px; }
  .contact-card { padding: 30px 22px; }
  .form-row { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .caret { animation: none; }
}
