/* ===== Fadel Portfolio — Styles ===== */
:root {
  --bg: #07070d;
  --bg-soft: #0d0d18;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-border: rgba(255, 255, 255, 0.09);
  --text: #f2f2f7;
  --muted: #9a9ab0;
  --accent-1: #7c5cff;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --radius: 18px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  --font-display: 'Sora', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== Animated wallpaper ===== */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(124, 92, 255, 0.14), transparent 70%),
    radial-gradient(45% 45% at 90% 90%, rgba(34, 211, 238, 0.10), transparent 70%),
    radial-gradient(45% 45% at 10% 85%, rgba(244, 114, 182, 0.08), transparent 70%);
  pointer-events: none;
}

/* Cursor / touch glow that follows the pointer */
.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(124, 92, 255, 0.22), rgba(34, 211, 238, 0.08) 55%, transparent 70%);
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: transform;
}

.cursor-glow.on { opacity: 1; }

/* Film grain overlay for a premium finish */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Magnetic icon base */
.magnet {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  display: inline-block;
}

/* Tilt cards base */
[data-tilt] {
  transition: transform 0.25s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  transform-style: preserve-3d;
}

[data-tilt].tapped { animation: tap-pop 0.35s ease; }

@keyframes tap-pop {
  0% { transform: scale(1); }
  45% { transform: scale(0.96); }
  100% { transform: scale(1); }
}

/* ===== Container / header ===== */
.container {
  width: min(1140px, 92%);
  margin: 0 auto;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: rgba(7, 7, 13, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom-color: var(--surface-border);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 2px;
  color: var(--text);
  text-decoration: none;
}

.brand-dot { color: var(--accent-2); }

.main-nav {
  display: flex;
  gap: 34px;
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  transition: color 0.25s ease;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  transition: width 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active { color: var(--text); }

.main-nav a:hover::after,
.main-nav 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: 26px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.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); }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 130px 0 70px;
}

.hero .container { text-align: center; }

.eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 20px;
  padding: 7px 16px;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: var(--surface);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.3rem, 6vw, 4.4rem);
  line-height: 1.12;
  letter-spacing: -1px;
  max-width: 860px;
  margin: 0 auto 22px;
}

.gradient-text {
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2), var(--accent-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  max-width: 640px;
  margin: 0 auto 34px;
}

.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
  position: relative;
  overflow: hidden;
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

/* Cursor-following shine on buttons */
.btn.glow-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.3), transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.btn.glow-btn:hover::after { opacity: 1; }

.btn-primary {
  color: #fff;
  background: linear-gradient(90deg, var(--accent-1), #5b8cff);
  box-shadow: 0 10px 30px rgba(124, 92, 255, 0.35);
}

.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(124, 92, 255, 0.45); }

.btn-ghost {
  color: var(--text);
  border-color: var(--surface-border);
  background: var(--surface);
}

.btn-ghost:hover { transform: translateY(-3px); background: rgba(255, 255, 255, 0.08); }

.hero-stats {
  display: flex;
  gap: 50px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 64px;
}

.stat { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.stat-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  background: linear-gradient(180deg, #fff, var(--muted));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-label { font-size: 0.82rem; color: var(--muted); letter-spacing: 0.4px; }

/* ===== Sections ===== */
.section { padding: 110px 0; }

.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }

.section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  letter-spacing: -0.5px;
  line-height: 1.25;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.about-right {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.about-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 36px;
  font-size: 1.02rem;
  color: var(--muted);
}

.about-card p:first-child::first-letter {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.6em;
  line-height: 1;
  float: left;
  margin: 0 10px 0 0;
  color: var(--accent-2);
}

.skill-list { display: flex; flex-direction: column; gap: 24px; }

.skill-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  font-weight: 600;
  font-size: 0.92rem;
}

.skill-pct { color: var(--muted); font-weight: 500; }

.skill-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.skill-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.skill-bar.in-view i { transform: scaleX(1); }

/* Portrait */
.portrait {
  position: relative;
  width: min(320px, 100%);
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
}

.portrait svg { display: block; width: 100%; height: auto; }

.portrait-badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(10, 10, 20, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--surface-border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  animation: pulse 1.8s ease infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.5); }
  70% { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* ===== Cards (expertise) ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  padding: 34px 28px;
  transition: transform 0.25s ease, border-color 0.35s ease, box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--card-c1, var(--accent-1)), var(--card-c2, var(--accent-2)));
  opacity: 0;
  transition: opacity 0.35s ease;
}

.card:hover { border-color: rgba(255, 255, 255, 0.18); box-shadow: var(--shadow); }
.card:hover::before { opacity: 1; }

.card-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 22px;
}

.card-icon svg { width: 30px; height: 30px; }

.card-icon-ps { --card-c1: #31a8ff; --card-c2: #6fd6ff; color: #6fd6ff; background: rgba(49, 168, 255, 0.12); }
.card-icon-ai { --card-c1: #ff9a00; --card-c2: #ffd166; color: #ffc04d; background: rgba(255, 154, 0, 0.12); }
.card-icon-3d { --card-c1: #f472b6; --card-c2: #a78bfa; color: #d8b4fe; background: rgba(244, 114, 182, 0.12); }

.card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 18px; }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }

.tags li {
  font-size: 0.76rem;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--surface-border);
  color: var(--muted);
}

/* ===== Portfolio grid ===== */
.filter-bar { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 42px; }

.filter-btn {
  padding: 9px 22px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.filter-btn:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.2); }

.filter-btn.active {
  color: #fff;
  background: linear-gradient(90deg, var(--accent-1), #5b8cff);
  border-color: transparent;
}

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

.proj {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.35s ease, box-shadow 0.35s ease, opacity 0.4s ease, visibility 0.4s;
}

.proj:hover { border-color: rgba(255, 255, 255, 0.18); box-shadow: var(--shadow); }

.proj.hidden { display: none; }

.proj-thumb {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 20%, hsla(var(--thumb-hue), 90%, 70%, 0.35), transparent 55%),
    radial-gradient(circle at 75% 80%, hsla(calc(var(--thumb-hue) + 60), 90%, 60%, 0.25), transparent 55%),
    #0f0f1c;
  position: relative;
}

.proj-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 50%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000, transparent 75%);
}

.proj-thumb svg.art {
  width: 62%;
  max-width: 130px;
  height: auto;
  position: relative;
  filter: drop-shadow(0 0 26px hsla(var(--thumb-hue), 95%, 70%, 0.28));
}

.proj-body { padding: 22px 24px 26px; }

.proj-body h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; margin-bottom: 6px; }

.proj-body p { color: var(--muted); font-size: 0.9rem; margin-bottom: 12px; }

.proj-cat {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--accent-2);
}

/* ===== Contact ===== */
.contact-panel {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 24px;
  padding: 56px 48px;
  max-width: 720px;
  margin: 0 auto;
}

.contact-panel .section-head { margin-bottom: 16px; }

.contact-note { color: var(--muted); text-align: center; margin-bottom: 34px; }

.contact-form { display: flex; flex-direction: column; gap: 18px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 8px; }

.field label { font-size: 0.85rem; font-weight: 600; color: var(--text); }

.field input,
.field select,
.field textarea {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 13px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.25s ease, background 0.25s ease;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent-1);
  background: rgba(255, 255, 255, 0.07);
}

.field select option { background: #16162a; color: var(--text); }

.btn-block { width: 100%; text-align: center; border: 0; margin-top: 6px; }

.form-status { font-size: 0.9rem; text-align: center; min-height: 1.2em; }
.form-status.ok { color: #4ade80; }
.form-status.err { color: #f87171; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--surface-border);
  padding: 34px 0;
  margin-top: 40px;
}

.footer-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.site-footer p { color: var(--muted); font-size: 0.9rem; }

.socials { display: flex; gap: 12px; }

.socials a {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
  color: var(--muted);
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.socials a svg { width: 19px; height: 19px; }

.socials a:hover { color: var(--text); border-color: var(--accent-1); transform: translateY(-3px); }

/* ===== Scroll reveal ===== */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible { opacity: 1; transform: none; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .cards, .grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; gap: 34px; }
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .main-nav {
    position: fixed;
    top: 72px;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(10, 10, 18, 0.97);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--surface-border);
    width: 100%;
    transform: translateY(-16px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s;
  }

  .main-nav.open { transform: none; opacity: 1; visibility: visible; }

  .main-nav a { padding: 17px 6%; border-top: 1px solid rgba(255, 255, 255, 0.05); }

  .cards, .grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero-stats { gap: 30px; }
  .contact-panel { padding: 38px 22px; }
  .section { padding: 80px 0; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .skill-bar i { transform: scaleX(1); transition: none; }
  .magnet, [data-tilt] { transition: none !important; }
  .cursor-glow { display: none; }
  .pulse-dot { animation: none; }
}
