/* ─────────────────────────────────────────
   Aly Embaby Portfolio — Cinematic Dark
   Fonts: Space Grotesk (headings) + Inter (body)
───────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap');

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

:root {
  --bg:          #06060a;
  --surface:     #0e0e16;
  --surface2:    #141420;
  --border:      rgba(255,255,255,0.07);
  --border-h:    rgba(0,212,255,0.35);
  --text:        #f0eff8;
  --muted:       #7a7a9a;
  --muted2:      #4a4a6a;
  --cyan:        #00d4ff;
  --cyan-dim:    rgba(0,212,255,0.08);
  --cyan-glow:   rgba(0,212,255,0.2);
  --purple:      #9d78f5;
  --purple-dim:  rgba(157,120,245,0.08);
  --green:       #00e87a;
  --green-dim:   rgba(0,232,122,0.08);
  --font-head:   'Space Grotesk', system-ui, sans-serif;
  --font-body:   'Inter', system-ui, sans-serif;
}

/* ── PAGE TRANSITION ── */
@keyframes page-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── CUSTOM SCROLLBAR ── */
::-webkit-scrollbar {
  width: 10px;
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--muted2);
  border-radius: 5px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--cyan);
}

html {
  scroll-behavior: smooth;
  background: var(--bg); /* background lives here so blobs at z-index:-1 show through */
}

/* ── AMBIENT BACKGROUND BLOBS ── */
.bg-glow {
  position: fixed; inset: 0;
  z-index: -1; pointer-events: none;
  overflow: hidden;
}
.bg-blob {
  position: absolute; border-radius: 50%;
  filter: blur(110px);
}
.bg-blob.b1 {
  width: 680px; height: 680px;
  background: radial-gradient(circle, rgba(0,212,255,0.08), transparent 70%);
  top: -15%; left: -18%;
  animation: blob-a 24s ease-in-out infinite alternate;
}
.bg-blob.b2 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(157,120,245,0.08), transparent 70%);
  bottom: -12%; right: -12%;
  animation: blob-b 30s ease-in-out infinite alternate;
}
.bg-blob.b3 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(0,212,255,0.04), transparent 70%);
  top: 50%; left: 38%;
  animation: blob-c 19s ease-in-out infinite alternate;
}
@keyframes blob-a {
  from { transform: translate(0, 0)      scale(1);    }
  to   { transform: translate(140px, 200px) scale(1.3); }
}
@keyframes blob-b {
  from { transform: translate(0, 0)         scale(1);    }
  to   { transform: translate(-110px, -160px) scale(1.2); }
}
@keyframes blob-c {
  from { transform: translate(0, 0)      scale(1);   }
  to   { transform: translate(-70px, 110px) scale(0.8); }
}

body {
  animation: page-in 0.55s ease both;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.65;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

/* ── NAV ── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 3rem;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  background: rgba(6,6,10,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.logo {
  font-family: var(--font-head);
  font-weight: 700; font-size: 1rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text);
}
.logo span { color: var(--cyan); }

nav ul { list-style: none; display: flex; gap: 0.1rem; align-items: center; }

nav ul a {
  font-family: var(--font-head);
  font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--muted);
  padding: 0.38rem 0.85rem;
  border-radius: 3px;
  transition: color 0.2s;
}
nav ul a:hover { color: var(--text); }
nav ul a.active { color: var(--cyan); }

.nav-resume {
  margin-left: 0.5rem;
  background: var(--cyan) !important;
  color: #06060a !important;
  font-weight: 700 !important;
  border-radius: 3px !important;
  padding: 0.38rem 1rem !important;
}
.nav-resume:hover { opacity: 0.85 !important; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.72rem 1.6rem;
  font-family: var(--font-head);
  font-size: 0.875rem; font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 4px;
  cursor: pointer; transition: all 0.2s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }

.btn-cyan {
  background: var(--cyan); color: #06060a;
  box-shadow: 0 0 24px rgba(0,212,255,0.22);
}
.btn-cyan:hover { box-shadow: 0 0 44px rgba(0,212,255,0.38); transform: translateY(-1px); }

.btn-outline {
  border: 1px solid var(--border);
  color: var(--text); background: transparent;
}
.btn-outline:hover { border-color: var(--cyan); color: var(--cyan); }

/* ── PAGE WRAPPER ── */
.page {
  max-width: 960px;
  margin: 0 auto;
  padding: 5rem 2.5rem 8rem;
}

/* ── SECTION HEADER ── */
.sec-head {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 2.5rem;
}
.sec-head .sec-num {
  font-family: var(--font-head);
  font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.14em; color: var(--cyan);
}
.sec-head .sec-line {
  flex: 1; height: 1px; background: var(--border);
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.25s;
}
.reveal.revealed .sec-head .sec-line { transform: scaleX(1); }
.sec-head .sec-title {
  font-family: var(--font-head);
  font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted2);
}
.sec-block { margin-bottom: 5rem; }

/* ── PAGE HERO (inner pages) ── */
.page-hero {
  padding-bottom: 3rem;
  margin-bottom: 4rem;
  border-bottom: 1px solid var(--border);
}
.page-hero .overline {
  font-family: var(--font-head);
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 1rem;
  display: block;
}
.page-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700; letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
}
.page-hero p { color: var(--muted); font-size: 1rem; }

/* ── TAGS ── */
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.tag-cyan {
  font-size: 0.7rem; color: var(--cyan); background: var(--cyan-dim);
  border: 1px solid rgba(0,212,255,0.15);
  padding: 0.18rem 0.55rem; border-radius: 3px;
  font-family: var(--font-head); font-weight: 500;
}
.tag-purple {
  font-size: 0.7rem; color: var(--purple); background: var(--purple-dim);
  border: 1px solid rgba(157,120,245,0.15);
  padding: 0.18rem 0.55rem; border-radius: 3px;
  font-family: var(--font-head); font-weight: 500;
}
.tag-green {
  font-size: 0.7rem; color: var(--green); background: var(--green-dim);
  border: 1px solid rgba(0,232,122,0.15);
  padding: 0.18rem 0.55rem; border-radius: 3px;
  font-family: var(--font-head); font-weight: 500;
}
.tag-muted {
  font-size: 0.72rem; color: var(--muted); background: var(--surface2);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem; border-radius: 3px;
  font-family: var(--font-head); font-weight: 500;
}

/* ── PAGE BACKGROUND CANVAS ── */
#page-bg {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: -1; pointer-events: none;
}


/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  text-align: center; padding: 2rem;
  color: var(--muted2); font-size: 0.75rem;
  font-family: var(--font-head); letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── SCROLL REVEAL ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  nav ul { gap: 0; }
  nav ul a { padding: 0.3rem 0.5rem; font-size: 0.7rem; letter-spacing: 0.04em; }
  .nav-resume { padding: 0.3rem 0.7rem !important; }
  .page { padding: 3rem 1.25rem 5rem; }
}

/* ── FILM GRAIN ── */
body::after {
  content: '';
  position: fixed; inset: 0;
  z-index: 9996; pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain-shift 0.4s steps(1) infinite;
}
@keyframes grain-shift {
  0%  { transform: translate(0,0); }
  25% { transform: translate(-2px,1px); }
  50% { transform: translate(1px,-2px); }
  75% { transform: translate(-1px,2px); }
}
