:root {
  --midnight: #0D1117;
  --deep:     #111820;
  --surface:  #161D27;
  --card:     #1A2333;
  --teal:        #0D9488;
  --teal-light:  #2DD4BF;
  --gold:        #C9A84C;
  --gold-light:  #E8C878;
  --text:   #E8E6E0;
  --muted:  #8A9BB0;
  --border: rgba(201,168,76,0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--midnight);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  overflow-x: hidden;
}

/* ── CANVAS BACKGROUND ── */
#bg-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
  will-change: transform;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 4rem;
  background: rgba(13,17,23,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 0.5px solid var(--border);
}
.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.08em;
}
.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.3s;
}
.nav-links a:hover { color: var(--teal-light); }

/* ── SECTIONS ── */
section {
  position: relative;
  z-index: 1;
  padding: 5rem 4rem;
  max-width: 1100px;
  margin: 0 auto;
}

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: 6rem;
  max-width: 100%;
  padding-left: 6rem;
  padding-right: 6rem;
}
.hero-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s forwards;
}
.hero-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 300;
  line-height: 1.0;
  color: var(--text);
  margin-bottom: 0.4rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.4s forwards;
}
.hero-name span { color: var(--gold); }
.hero-urdu {
  font-size: clamp(1.2rem, 3vw, 2rem);
  color: var(--gold-light);
  margin-bottom: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.05em;
  direction: rtl;
  font-family: 'Cormorant Garamond', serif;
  opacity: 0;
  animation: fadeUp 0.8s 0.5s forwards;
}
.hero-role {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--muted);
  margin-bottom: 2.5rem;
  letter-spacing: 0.05em;
  opacity: 0;
  animation: fadeUp 0.8s 0.6s forwards;
}
.hero-role span {
  color: var(--teal-light);
  font-weight: 400;
}
.hero-desc {
  max-width: 560px;
  font-size: 0.95rem;
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 3rem;
  opacity: 0;
  animation: fadeUp 0.8s 0.8s forwards;
}
.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s 1s forwards;
}
.btn-primary {
  padding: 0.75rem 2rem;
  background: var(--teal);
  color: #fff;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.3s, transform 0.2s;
  display: inline-block;
}
.btn-primary:hover { background: var(--teal-light); transform: translateY(-2px); }
.btn-outline {
  padding: 0.75rem 2rem;
  background: transparent;
  color: var(--gold);
  border: 0.5px solid var(--gold);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
  display: inline-block;
}
.btn-outline:hover { background: rgba(201,168,76,0.1); transform: translateY(-2px); }
.hero-line {
  position: absolute;
  left: 6rem;
  top: 50%;
  width: 2px;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
  transform: translateY(-50%);
  opacity: 0.3;
}

/* ── SECTION HEADER ── */
.sec-header { margin-bottom: 3.5rem; }
.sec-label {
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
  display: block;
}
.sec-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 300;
  color: var(--text);
  line-height: 1.1;
}
.sec-rule {
  width: 48px;
  height: 1px;
  background: var(--teal);
  margin-top: 1rem;
}

/* ── ABOUT ── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}
.about-text p {
  font-size: 0.92rem;
  line-height: 2;
  color: var(--muted);
  margin-bottom: 1.2rem;
}
.about-text p strong {
  color: var(--text);
  font-weight: 400;
}
.about-facts {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.fact-item {
  border-left: 1px solid var(--border);
  padding-left: 1.25rem;
}
.fact-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.3rem;
}
.fact-value {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
}

/* ── PROJECTS ── */
.proj-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 3rem;
  border-bottom: 0.5px solid var(--border);
}
.proj-tab {
  padding: 0.75rem 1.75rem;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -0.5px;
  transition: all 0.3s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: 'DM Sans', sans-serif;
}
.proj-tab.active {
  color: var(--teal-light);
  border-bottom-color: var(--teal);
}
.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.proj-card {
  background: var(--card);
  border: 0.5px solid var(--border);
  padding: 1.75rem;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.proj-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 2px;
  height: 0;
  background: var(--teal);
  transition: height 0.4s;
}
.proj-card:hover::before { height: 100%; }
.proj-card:hover {
  border-color: rgba(13,148,136,0.3);
  transform: translateY(-3px);
}
.proj-number {
  font-family: 'Cormorant Garamond', serif;
  font-size: 3rem;
  font-weight: 300;
  color: rgba(201,168,76,0.1);
  position: absolute;
  top: 1rem; right: 1.25rem;
  line-height: 1;
}
.proj-tag {
  display: inline-block;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  background: rgba(13,148,136,0.1);
  color: var(--teal-light);
  margin-bottom: 1rem;
}
.proj-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}
.proj-desc {
  font-size: 0.82rem;
  line-height: 1.8;
  color: var(--muted);
  margin-bottom: 1.25rem;
}
.proj-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}
.stack-tag {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.5rem;
  border: 0.5px solid var(--border);
  color: var(--muted);
}
.proj-links { display: flex; gap: 1rem; }
.proj-link {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  text-decoration: none;
  transition: color 0.2s;
}
.proj-link:hover { color: var(--teal-light); }

/* ── SKILLS ── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
.skill-group {
  background: var(--card);
  border: 0.5px solid var(--border);
  padding: 1.5rem;
}
.skill-group-title {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 0.5px solid var(--border);
}
.skill-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.skill-item {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.skill-item span {
  color: var(--teal-light);
  font-weight: 400;
}

/* ── CV DOWNLOAD ── */
#cv { text-align: center; }
.cv-inner {
  background: var(--card);
  border: 0.5px solid var(--border);
  padding: 3.5rem;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}
.cv-inner::before, .cv-inner::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-color: var(--gold);
  border-style: solid;
  opacity: 0.4;
}
.cv-inner::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.cv-inner::after  { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.cv-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 300;
  margin-bottom: 0.75rem;
}
.cv-desc {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 2rem;
}
.cv-btns {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── CONTACT ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}
.contact-text .sec-title { margin-bottom: 1rem; }
.contact-text p {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 2rem;
}
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  padding: 1rem 1.25rem;
  background: var(--card);
  border: 0.5px solid var(--border);
  transition: all 0.3s;
}
.contact-link:hover {
  border-color: rgba(13,148,136,0.4);
  transform: translateX(4px);
}
.contact-link-icon {
  width: 36px; height: 36px;
  background: rgba(13,148,136,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--teal-light);
  flex-shrink: 0;
}
.contact-link-text { display: flex; flex-direction: column; }
.contact-link-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.2rem;
}
.contact-link-value {
  font-size: 0.85rem;
  color: var(--text);
}
.roots-quote {
  background: var(--card);
  border: 0.5px solid var(--border);
  border-left: 2px solid var(--gold);
  padding: 1.5rem 1.75rem;
}
.roots-quote p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--gold-light);
  line-height: 1.7;
  margin-bottom: 0.5rem;
}
.roots-quote small {
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── FOOTER ── */
footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  border-top: 0.5px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  nav { padding: 1rem 1.5rem; }
  .nav-links { display: none; }
  #hero { padding: 5rem 1.25rem 3rem; }
  section { padding: 3.5rem 1.25rem; }
  .about-grid, .contact-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-line { display: none; }
  .hero-name {
    font-size: clamp(2.4rem, 11vw, 5rem);
    word-break: break-word;
    overflow-wrap: break-word;
  }
}

.about-text p,
.proj-desc,
.skill-item,
.contact-text p {
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
}

.sec-title, .hero-name {
  text-shadow: 0 2px 24px rgba(0,0,0,0.95);
}
