/* ============================================================
   Duraid Eleiwi — Personal Website
   ============================================================ */

:root {
  --bg: #070912;
  --bg-soft: #0d1020;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --text: #e9ecf5;
  --muted: #9aa3bd;
  --accent: #6d6bff;
  --accent-2: #00e0c6;
  --accent-3: #ff5db1;
  --grad: linear-gradient(120deg, #6d6bff 0%, #00e0c6 50%, #ff5db1 100%);
  --maxw: 1120px;
  --radius: 18px;
  --shadow: 0 20px 60px -25px rgba(0, 0, 0, 0.7);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
strong { color: #fff; font-weight: 600; }

/* ---------- Animated background ---------- */
.bg-grid {
  position: fixed; inset: 0; z-index: -3;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

#constellation {
  position: fixed; inset: 0; z-index: -2; opacity: 0.6;
}

.orb {
  position: fixed; z-index: -2; border-radius: 50%;
  filter: blur(90px); opacity: 0.45;
  animation: float 18s ease-in-out infinite;
}
.orb-1 { width: 480px; height: 480px; background: #6d6bff; top: -120px; left: -100px; }
.orb-2 { width: 420px; height: 420px; background: #00e0c6; bottom: -140px; right: -80px; animation-delay: -6s; }
.orb-3 { width: 360px; height: 360px; background: #ff5db1; top: 40%; left: 55%; animation-delay: -11s; opacity: 0.3; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.08); }
  66% { transform: translate(-30px, 25px) scale(0.95); }
}

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--grad); z-index: 100;
  box-shadow: 0 0 12px rgba(109,107,255,0.6);
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 48px);
  transition: background .3s, padding .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(7, 9, 18, 0.72);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--border);
  padding-top: 12px; padding-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.15rem; }
.brand-mark {
  font-family: "JetBrains Mono", monospace; font-size: .85rem;
  color: var(--accent-2); border: 1px solid var(--border);
  padding: 3px 7px; border-radius: 8px; background: var(--surface);
}
.dot { color: var(--accent-2); }

.nav-links { display: flex; gap: 28px; }
.nav-links a {
  font-size: .92rem; color: var(--muted); font-weight: 500;
  position: relative; transition: color .25s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 2px; width: 0;
  background: var(--grad); transition: width .28s ease;
}
.nav-links a:hover, .nav-links a.active { color: #fff; }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav-toggle span { width: 24px; height: 2px; background: #fff; border-radius: 2px; transition: .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Layout ---------- */
main { width: 100%; }
.section {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(70px, 11vw, 130px) clamp(20px, 5vw, 48px);
}
.section-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 48px; }
.section-index {
  font-family: "JetBrains Mono", monospace; color: var(--accent-2);
  font-size: .95rem; letter-spacing: 2px;
}
.section-title {
  font-family: "Space Grotesk", sans-serif; font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.1;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start;
  max-width: var(--maxw); margin: 0 auto;
  padding: 120px clamp(20px, 5vw, 48px) 80px;
  position: relative;
}
.hero-inner { max-width: 760px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: "JetBrains Mono", monospace; font-size: .82rem;
  color: var(--accent-2); background: var(--surface);
  border: 1px solid var(--border); padding: 6px 14px; border-radius: 999px;
  margin-bottom: 26px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(0,224,198,0.6); animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0,224,198,0.5); }
  70% { box-shadow: 0 0 0 10px rgba(0,224,198,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,224,198,0); }
}
.hero-title {
  font-family: "Space Grotesk", sans-serif; font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 5.2rem); line-height: 1.02; letter-spacing: -1px;
}
.grad-text {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; background-size: 200% auto;
  animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }
.hero-sub {
  font-family: "Space Grotesk", sans-serif; font-weight: 500;
  font-size: clamp(1.3rem, 4vw, 2.1rem); margin-top: 14px; color: var(--text);
  min-height: 1.4em;
}
.typed { color: var(--accent-2); }
.cursor { color: var(--accent-2); animation: blink 1s step-end infinite; font-weight: 300; }
@keyframes blink { 50% { opacity: 0; } }
.hero-desc { color: var(--muted); font-size: 1.08rem; margin-top: 22px; max-width: 600px; }

.hero-cta { display: flex; gap: 14px; margin-top: 34px; flex-wrap: wrap; }
.btn {
  font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: .98rem;
  padding: 13px 26px; border-radius: 12px; cursor: pointer;
  transition: transform .2s, box-shadow .25s, background .25s; display: inline-block;
}
.btn-primary { background: var(--grad); color: #07101a; box-shadow: 0 12px 30px -10px rgba(109,107,255,.6); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -10px rgba(109,107,255,.7); }
.btn-ghost { border: 1px solid var(--border); color: var(--text); background: var(--surface); }
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--accent-2); color: #fff; }

.hero-stats { display: flex; gap: 38px; margin-top: 54px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat-num {
  font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 2.1rem;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

.scroll-hint { position: absolute; bottom: 34px; left: 50%; transform: translateX(-50%); }
.mouse { display: block; width: 24px; height: 38px; border: 2px solid var(--muted); border-radius: 14px; position: relative; }
.wheel { position: absolute; top: 7px; left: 50%; transform: translateX(-50%); width: 4px; height: 8px; background: var(--accent-2); border-radius: 2px; animation: wheel 1.6s infinite; }
@keyframes wheel { 0% { opacity: 1; top: 7px; } 100% { opacity: 0; top: 18px; } }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.about-text p { color: var(--muted); margin-bottom: 18px; }
.about-list { list-style: none; margin-top: 22px; display: grid; gap: 12px; }
.about-list li { display: flex; align-items: center; gap: 12px; color: var(--text); }
.check { color: var(--accent-2); font-weight: 700; }

.code-window {
  background: linear-gradient(180deg, #0e1224, #0a0d1c);
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow);
}
.code-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.02); }
.dotr, .doty, .dotg { width: 12px; height: 12px; border-radius: 50%; }
.dotr { background: #ff5f57; } .doty { background: #febc2e; } .dotg { background: #28c840; }
.code-title { margin-left: auto; font-family: "JetBrains Mono", monospace; font-size: .78rem; color: var(--muted); }
.code-body { padding: 22px 24px; font-family: "JetBrains Mono", monospace; font-size: .86rem; line-height: 1.7; overflow-x: auto; }
.c-key { color: #ff79c6; } .c-cls { color: #8be9fd; } .c-str { color: #50fa7b; } .c-num { color: #bd93f9; }

/* ---------- Skills ---------- */
.skill-cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.cat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; transition: transform .3s, border-color .3s, background .3s;
}
.cat-card:hover { transform: translateY(-5px); border-color: var(--accent); background: var(--surface-2); }
.cat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.cat-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.2rem; background: var(--surface-2); border: 1px solid var(--border);
}
.cat-head h3 { font-family: "Space Grotesk", sans-serif; font-size: 1.2rem; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 10px 18px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--border); font-size: .92rem; font-weight: 500;
  transition: transform .2s, border-color .2s, color .2s, background .2s; cursor: default;
}
.chip:hover { transform: translateY(-4px); border-color: var(--accent-2); color: #fff; background: var(--surface-2); }

/* ---------- Apps ---------- */
.apps-lead { color: var(--muted); font-size: 1.12rem; max-width: 560px; margin-bottom: 40px; }
.apps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.apps-empty { color: var(--muted); font-style: italic; }
.app-card {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; transition: transform .3s, border-color .3s, background .3s;
}
.app-card:hover { transform: translateY(-6px); border-color: var(--accent); background: var(--surface-2); }
.app-icon {
  flex: none; width: 60px; height: 60px; border-radius: 16px; object-fit: cover;
  background: var(--grad); box-shadow: 0 12px 28px -12px rgba(109,107,255,.6);
}
.app-body h3 { font-family: "Space Grotesk", sans-serif; font-size: 1.3rem; }
.app-platform { font-family: "JetBrains Mono", monospace; font-size: .78rem; color: var(--accent-2); }
.app-body p { color: var(--muted); font-size: .95rem; margin: 10px 0 16px; }
.app-links { display: flex; gap: 10px; flex-wrap: wrap; }
.app-btn {
  font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: .86rem;
  padding: 9px 18px; border-radius: 10px; background: var(--grad); color: #07101a;
  transition: transform .2s, box-shadow .2s, border-color .2s, color .2s;
}
.app-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -10px rgba(109,107,255,.6); }
.app-btn.ghost { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.app-btn.ghost:hover { border-color: var(--accent-2); color: #fff; box-shadow: none; }

/* ---------- Contact ---------- */
.contact-lead { color: var(--muted); font-size: 1.15rem; max-width: 520px; margin-bottom: 40px; }
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.contact-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 24px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform .3s, border-color .3s, background .3s; position: relative; overflow: hidden;
}
.contact-card::before {
  content: ""; position: absolute; inset: 0; background: var(--grad); opacity: 0;
  transition: opacity .3s; z-index: 0;
}
.contact-card:hover { transform: translateY(-6px); border-color: transparent; }
.contact-card:hover::before { opacity: 0.14; }
.contact-card > * { position: relative; z-index: 1; }
.ci { font-size: 1.5rem; font-family: "Space Grotesk", sans-serif; font-weight: 700; }
.cl { font-weight: 600; font-size: 1.05rem; }
.cv { color: var(--muted); font-size: .9rem; font-family: "JetBrains Mono", monospace; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border); padding: 30px clamp(20px, 5vw, 48px);
  display: flex; justify-content: space-between; align-items: center;
  max-width: var(--maxw); margin: 0 auto; color: var(--muted); font-size: .9rem; flex-wrap: wrap; gap: 12px;
}
.to-top {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border);
  display: grid; place-items: center; background: var(--surface);
  transition: transform .2s, border-color .2s, color .2s;
}
.to-top:hover { transform: translateY(-4px); border-color: var(--accent-2); color: #fff; }

/* ---------- Reveal animations ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; gap: 34px; }
  .skill-cats { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }

  .nav-links {
    position: fixed; inset: 0 0 0 auto; width: min(74vw, 300px);
    background: rgba(9, 12, 24, 0.96); backdrop-filter: blur(16px);
    flex-direction: column; justify-content: center; gap: 30px; padding: 40px;
    transform: translateX(100%); transition: transform .35s ease;
    border-left: 1px solid var(--border);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-links a { font-size: 1.2rem; }
  .nav-toggle { display: flex; z-index: 95; }
}

@media (max-width: 520px) {
  .contact-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 26px; }
  .stat-num { font-size: 1.7rem; }
  .section-head { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
