/* ============================================================
   SALMAN IRFAN — PORTFOLIO STYLESHEET
   Author      : Salman Irfan
   Description : All visual styles for the portfolio website.
                 Organized by component in the same order as the HTML.
   Sections:
     01. CSS Reset & Custom Properties (Variables)
     02. Base / Global Styles
     03. Navigation
     04. Hero Section
     05. Hero — Profile Photo & Gallery
     06. Keyframe Animations
     07. Section Shared Styles
     08. About Section
     09. Skills Section
     10. Experience / Timeline
     11. Certificates
     12. Lightbox Modal
     13. Achievements
     14. Interests
     15. Contact Section
     16. Footer
     17. Scroll Reveal Utility
     18. Responsive / Media Queries
   ============================================================ */


/* ============================================================
   01. CSS RESET & CUSTOM PROPERTIES
   ============================================================ */

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

:root {
  /* Color Palette */
  --bg:          #0D0F14;
  --surface:     #13161D;
  --card:        #181C26;
  --border:      #242836;
  --ink:         #F0F2F8;
  --muted:       #7B82A0;
  --subtle:      #3A3F52;
  --blue:        #4F7EFF;
  --blue-dim:    #1B2A55;
  --blue-glow:   rgba(79, 126, 255, 0.15);
  --green:       #3FD68F;
  --green-dim:   #0F3327;

  /* Typography */
  --serif: 'Syne', sans-serif;
  --sans:  'Inter', system-ui, sans-serif;
}


/* ============================================================
   02. BASE / GLOBAL STYLES
   ============================================================ */

html {
  scroll-behavior: smooth;
}

body {
  background:    var(--bg);
  color:         var(--ink);
  font-family:   var(--sans);
  font-size:     16px;
  line-height:   1.7;
  overflow-x:    hidden;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background:    var(--subtle);
  border-radius: 4px;
}


/* ============================================================
   03. NAVIGATION
   ============================================================ */

nav {
  position:        fixed;
  top:             0;
  left:            0;
  right:           0;
  z-index:         200;
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  padding:         1.1rem 5rem;
  background:      rgba(13, 15, 20, 0.9);
  backdrop-filter: blur(16px);
  border-bottom:   1px solid transparent;
  transition:      border-color 0.3s;
}

nav.scrolled {
  border-color: var(--border);
}

.nav-brand {
  font-family:     var(--serif);
  font-size:       1.1rem;
  font-weight:     700;
  color:           var(--ink);
  text-decoration: none;
}

.nav-brand span {
  color: var(--blue);
}

.nav-links {
  display:     flex;
  gap:         2rem;
  list-style:  none;
  align-items: center;
}

.nav-links a {
  font-size:       0.82rem;
  letter-spacing:  0.07em;
  text-transform:  uppercase;
  color:           var(--muted);
  text-decoration: none;
  transition:      color 0.2s;
}

.nav-links a:hover {
  color: var(--ink);
}

/* CTA button inside nav */
.nav-cta {
  background:   var(--blue);
  color:        #fff !important;
  padding:      0.45rem 1.1rem;
  border-radius: 6px;
  font-weight:  500 !important;
}

.nav-cta:hover {
  opacity: 0.85;
}

/* Mobile hamburger icon */
.hamburger {
  display:        none;
  flex-direction: column;
  gap:            5px;
  cursor:         pointer;
  padding:        4px;
}

.hamburger span {
  display:       block;
  width:         22px;
  height:        2px;
  background:    var(--ink);
  border-radius: 2px;
}


/* ============================================================
   04. HERO SECTION
   ============================================================ */

.hero {
  min-height:           100vh;
  display:              grid;
  grid-template-columns: 1fr 1fr;
  align-items:          center;
  padding:              8rem 5rem 5rem;
  gap:                  4rem;
}

/* "Available for opportunities" badge */
.hero-badge {
  display:        inline-flex;
  align-items:    center;
  gap:            0.5rem;
  font-size:      0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color:          var(--green);
  background:     var(--green-dim);
  border:         1px solid rgba(63, 214, 143, 0.2);
  padding:        0.35rem 0.9rem;
  border-radius:  2rem;
  margin-bottom:  2rem;
  opacity:        0;
  animation:      fadeUp 0.6s 0.2s forwards;
}

.hero-badge::before {
  content:       '';
  width:         7px;
  height:        7px;
  border-radius: 50%;
  background:    var(--green);
  animation:     pulse 2s infinite;
}

/* Hero name */
.hero-name {
  font-family:    var(--serif);
  font-size:      clamp(2.8rem, 5.5vw, 5rem);
  font-weight:    800;
  line-height:    1.05;
  letter-spacing: -0.02em;
  color:          var(--ink);
  opacity:        0;
  animation:      fadeUp 0.7s 0.4s forwards;
}

.hero-name .hl {
  color: var(--blue);
}

/* Hero sub-title / role */
.hero-role {
  margin-top: 1.2rem;
  font-size:  1rem;
  color:      var(--muted);
  max-width:  460px;
  line-height: 1.6;
  opacity:    0;
  animation:  fadeUp 0.7s 0.6s forwards;
}

.hero-role strong {
  color:       var(--ink);
  font-weight: 500;
}

/* CTA buttons row */
.hero-actions {
  display:    flex;
  gap:        1rem;
  margin-top: 2.5rem;
  flex-wrap:  wrap;
  opacity:    0;
  animation:  fadeUp 0.7s 0.8s forwards;
}

/* Reusable button base */
.btn {
  display:     inline-flex;
  align-items: center;
  gap:         0.5rem;
  padding:     0.7rem 1.6rem;
  border-radius: 8px;
  font-size:   0.88rem;
  font-weight: 500;
  text-decoration: none;
  transition:  0.2s;
  cursor:      pointer;
  border:      none;
  font-family: var(--sans);
}

.btn-primary {
  background: var(--blue);
  color:      #fff;
}

.btn-primary:hover {
  opacity:   0.85;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color:      var(--ink);
  border:     1px solid var(--border);
}

.btn-ghost:hover {
  border-color: var(--blue);
  color:        var(--blue);
}

/* Key stats row */
.hero-stats {
  display:       flex;
  gap:           2.5rem;
  margin-top:    3rem;
  padding-top:   2rem;
  border-top:    1px solid var(--border);
  opacity:       0;
  animation:     fadeUp 0.7s 1s forwards;
}

.stat-num {
  font-family: var(--serif);
  font-size:   2rem;
  font-weight: 700;
  color:       var(--ink);
  line-height: 1;
}

.stat-label {
  font-size:      0.72rem;
  color:          var(--muted);
  margin-top:     0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}


/* ============================================================
   05. HERO — PROFILE PHOTO & GALLERY
   ============================================================ */

.hero-right {
  display:         flex;
  justify-content: center;
  align-items:     center;
  opacity:         0;
  animation:       fadeUp 0.8s 0.5s forwards;
}

.profile-wrap {
  position: relative;
  width:    340px;
}

.profile-img {
  width:           100%;
  aspect-ratio:    3 / 4;
  border-radius:   20px;
  object-fit:      cover;
  object-position: top;
  border:          1px solid var(--border);
  display:         block;
}

/* Decorative glow beneath photo */
.profile-glow {
  position:      absolute;
  bottom:        -40px;
  left:          50%;
  transform:     translateX(-50%);
  width:         200px;
  height:        80px;
  background:    var(--blue);
  filter:        blur(60px);
  opacity:       0.2;
  border-radius: 50%;
  pointer-events: none;
}

/* Award floating badge */
.profile-badge-award {
  position:        absolute;
  bottom:          24px;
  left:            -32px;
  background:      rgba(24, 28, 38, 0.95);
  border:          1px solid var(--border);
  border-radius:   12px;
  padding:         0.75rem 1rem;
  display:         flex;
  align-items:     center;
  gap:             0.75rem;
  backdrop-filter: blur(8px);
  max-width:       200px;
}

.pb-icon {
  font-size:   1.4rem;
  flex-shrink: 0;
  line-height: 1;
}

.pb-title {
  font-size:   0.78rem;
  font-weight: 600;
  color:       var(--ink);
  line-height: 1.2;
}

.pb-sub {
  font-size: 0.68rem;
  color:     var(--muted);
}

/* University floating badge */
.profile-badge-uni {
  position:      absolute;
  top:           24px;
  right:         -28px;
  background:    var(--blue-dim);
  border:        1px solid rgba(79, 126, 255, 0.3);
  border-radius: 10px;
  padding:       0.55rem 0.9rem;
  font-size:     0.72rem;
  color:         var(--blue);
  font-weight:   600;
  white-space:   nowrap;
}

/* Thumbnail gallery strip */
.gallery-strip {
  display:         flex;
  gap:             0.75rem;
  margin-top:      1.2rem;
  justify-content: center;
}

.gallery-thumb {
  width:         70px;
  height:        90px;
  border-radius: 10px;
  object-fit:    cover;
  object-position: top;
  border:        2px solid transparent;
  cursor:        pointer;
  transition:    0.2s;
  opacity:       0.6;
}

.gallery-thumb.active,
.gallery-thumb:hover {
  border-color: var(--blue);
  opacity:      1;
}


/* ============================================================
   06. KEYFRAME ANIMATIONS
   ============================================================ */

@keyframes fadeUp {
  from {
    opacity:   0;
    transform: translateY(20px);
  }
  to {
    opacity:   1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%,
  100% { opacity: 1; }
  50%   { opacity: 0.4; }
}


/* ============================================================
   07. SECTION SHARED STYLES
   ============================================================ */

.section {
  padding: 6rem 5rem;
}

/* Small coloured label above section headings */
.section-tag {
  display:        inline-flex;
  align-items:    center;
  gap:            0.6rem;
  font-size:      0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color:          var(--blue);
  margin-bottom:  1rem;
}

.section-tag::before {
  content:    '';
  width:      20px;
  height:     1px;
  background: var(--blue);
}

.section-title {
  font-family:    var(--serif);
  font-size:      clamp(2rem, 3.5vw, 2.8rem);
  font-weight:    700;
  line-height:    1.15;
  letter-spacing: -0.01em;
  margin-bottom:  1rem;
}

.section-sub {
  color:     var(--muted);
  max-width: 560px;
  font-size: 0.95rem;
}


/* ============================================================
   08. ABOUT SECTION
   ============================================================ */

.about-grid {
  display:               grid;
  grid-template-columns: 1.2fr 1fr;
  gap:                   5rem;
  align-items:           start;
  margin-top:            4rem;
}

.about-body p {
  color:         var(--muted);
  margin-bottom: 1rem;
  font-size:     0.95rem;
  line-height:   1.8;
}

.about-body p strong {
  color:       var(--ink);
  font-weight: 500;
}

/* Highlight cards (right column of about grid) */
.hcards {
  display:    grid;
  gap:        1rem;
  margin-top: 0;
}

.hcard {
  background:    var(--card);
  border:        1px solid var(--border);
  border-radius: 12px;
  padding:       1.1rem 1.3rem;
  display:       flex;
  align-items:   flex-start;
  gap:           0.9rem;
  transition:    border-color 0.2s;
}

.hcard:hover {
  border-color: var(--blue);
}

.hcard-icon {
  font-size:   1.4rem;
  flex-shrink: 0;
  line-height: 1;
}

.hcard-title {
  font-size:     0.88rem;
  font-weight:   600;
  color:         var(--ink);
  margin-bottom: 0.15rem;
}

.hcard-desc {
  font-size:   0.78rem;
  color:       var(--muted);
  line-height: 1.5;
}


/* ============================================================
   09. SKILLS SECTION
   ============================================================ */

.skills-bg {
  background: var(--surface);
}

.skills-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap:                   1rem;
  margin-top:            3.5rem;
}

.skill-card {
  background:    var(--card);
  border:        1px solid var(--border);
  border-radius: 12px;
  padding:       1.1rem 1.4rem;
  transition:    0.2s;
}

.skill-card:hover {
  border-color: var(--blue);
  transform:    translateY(-3px);
}

.skill-icon {
  font-size:     1.5rem;
  margin-bottom: 0.6rem;
}

.skill-name {
  font-size:     0.9rem;
  font-weight:   600;
  color:         var(--ink);
  margin-bottom: 0.5rem;
}

/* Progress bar track */
.skill-bar-bg {
  height:        4px;
  background:    var(--border);
  border-radius: 2px;
  overflow:      hidden;
}

/* Progress bar fill — width driven by JS */
.skill-bar {
  height:        100%;
  border-radius: 2px;
  background:    var(--blue);
  transition:    width 1.2s ease;
  width:         0%;
}

.skill-pct {
  font-size:  0.7rem;
  color:      var(--muted);
  margin-top: 0.35rem;
}


/* ============================================================
   10. EXPERIENCE / TIMELINE
   ============================================================ */

.exp-timeline {
  margin-top: 3.5rem;
  position:   relative;
  padding-left: 2rem;
}

/* Vertical line */
.exp-timeline::before {
  content:    '';
  position:   absolute;
  left:       0;
  top:        0;
  bottom:     0;
  width:      1px;
  background: var(--border);
}

.exp-item {
  position:     relative;
  margin-bottom: 3rem;
  padding-left: 2rem;
}

/* Timeline dot */
.exp-item::before {
  content:       '';
  position:      absolute;
  left:          -2.4rem;
  top:           0.35rem;
  width:         10px;
  height:        10px;
  border-radius: 50%;
  background:    var(--blue);
  border:        2px solid var(--bg);
  box-shadow:    0 0 0 3px var(--blue-dim);
}

.exp-period {
  font-size:      0.73rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color:          var(--blue);
  margin-bottom:  0.4rem;
}

.exp-title {
  font-family:   var(--serif);
  font-size:     1.2rem;
  font-weight:   700;
  color:         var(--ink);
  margin-bottom: 0.2rem;
}

.exp-company {
  font-size:     0.84rem;
  color:         var(--muted);
  margin-bottom: 0.75rem;
}

.exp-duties {
  list-style:     none;
  display:        flex;
  flex-direction: column;
  gap:            0.45rem;
}

.exp-duties li {
  font-size:    0.87rem;
  color:        var(--muted);
  padding-left: 1.2rem;
  position:     relative;
  line-height:  1.6;
}

/* Arrow bullet */
.exp-duties li::before {
  content:  '→';
  position: absolute;
  left:     0;
  color:    var(--blue);
  font-size: 0.75rem;
  top:      0.12rem;
}

/* Award badge beneath experience item */
.exp-award {
  display:       inline-flex;
  align-items:   center;
  gap:           0.4rem;
  margin-top:    0.75rem;
  font-size:     0.73rem;
  color:         var(--green);
  background:    var(--green-dim);
  border:        1px solid rgba(63, 214, 143, 0.2);
  padding:       0.25rem 0.75rem;
  border-radius: 2rem;
}


/* ============================================================
   11. CERTIFICATES
   ============================================================ */

.certs-bg {
  background: var(--surface);
}

.certs-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap:                   1.5rem;
  margin-top:            3.5rem;
}

.cert-card {
  background:    var(--card);
  border:        1px solid var(--border);
  border-radius: 14px;
  overflow:      hidden;
  transition:    0.2s;
  cursor:        pointer;
}

.cert-card:hover {
  border-color: var(--blue);
  transform:    translateY(-4px);
}

.cert-img {
  width:           100%;
  height:          200px;
  object-fit:      cover;
  object-position: top;
  display:         block;
  border-bottom:   1px solid var(--border);
}

.cert-body {
  padding: 1.1rem 1.25rem;
}

.cert-issuer {
  font-size:      0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color:          var(--blue);
  margin-bottom:  0.3rem;
}

.cert-title {
  font-size:     0.95rem;
  font-weight:   600;
  color:         var(--ink);
  margin-bottom: 0.25rem;
  line-height:   1.3;
}

.cert-date {
  font-size: 0.75rem;
  color:     var(--muted);
}

.cert-verify {
  display:         inline-flex;
  align-items:     center;
  gap:             0.3rem;
  margin-top:      0.6rem;
  font-size:       0.72rem;
  color:           var(--blue);
  text-decoration: none;
  border-bottom:   1px solid rgba(79, 126, 255, 0.3);
}

.cert-verify:hover {
  color: #fff;
}

/* PDF certificate placeholder — shown instead of an image for Coursera PDFs */
.cert-pdf-banner {
  display:         flex;
  align-items:     center;
  justify-content: center;
  background:      var(--blue-dim);
  border-bottom:   1px solid rgba(79, 126, 255, 0.3);
  object-fit:      unset;        /* override the img rule */
}

.cert-pdf-inner {
  text-align: center;
}

.cert-pdf-icon {
  font-size:     2.5rem;
  margin-bottom: 0.5rem;
  line-height:   1;
}

.cert-pdf-label {
  font-size:  0.75rem;
  color:      var(--blue);
  font-weight: 500;
  letter-spacing: 0.04em;
}


/* ============================================================
   12. LIGHTBOX MODAL
   ============================================================ */

.lightbox {
  display:         none;
  position:        fixed;
  inset:           0;
  z-index:         999;
  background:      rgba(0, 0, 0, 0.92);
  align-items:     center;
  justify-content: center;
  padding:         2rem;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width:   90vw;
  max-height:  90vh;
  border-radius: 10px;
  object-fit:  contain;
}

.lightbox-close {
  position:    absolute;
  top:         1.5rem;
  right:       2rem;
  font-size:   2rem;
  color:       var(--muted);
  cursor:      pointer;
  background:  none;
  border:      none;
  font-family: var(--sans);
}

.lightbox-close:hover {
  color: var(--ink);
}


/* ============================================================
   13. ACHIEVEMENTS
   ============================================================ */

.ach-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap:                   1.25rem;
  margin-top:            3.5rem;
}

.ach-card {
  background:    var(--card);
  border:        1px solid var(--border);
  border-radius: 14px;
  padding:       1.4rem;
  position:      relative;
  overflow:      hidden;
  transition:    0.2s;
}

.ach-card:hover {
  border-color: var(--blue);
  transform:    translateY(-3px);
}

/* Top accent line revealed on hover */
.ach-card::after {
  content:    '';
  position:   absolute;
  top:        0;
  left:       0;
  right:      0;
  height:     2px;
  background: var(--blue);
  opacity:    0;
  transition: 0.2s;
}

.ach-card:hover::after {
  opacity: 1;
}

.ach-icon {
  font-size:     1.8rem;
  margin-bottom: 0.9rem;
}

.ach-title {
  font-size:     0.93rem;
  font-weight:   600;
  color:         var(--ink);
  margin-bottom: 0.35rem;
}

.ach-desc {
  font-size:   0.8rem;
  color:       var(--muted);
  line-height: 1.6;
}


/* ============================================================
   14. INTERESTS
   ============================================================ */

.interests-wrap {
  display:    flex;
  flex-wrap:  wrap;
  gap:        0.75rem;
  margin-top: 3rem;
}

.interest-pill {
  display:       inline-flex;
  align-items:   center;
  gap:           0.5rem;
  padding:       0.5rem 1rem;
  border-radius: 2rem;
  background:    var(--card);
  border:        1px solid var(--border);
  font-size:     0.83rem;
  color:         var(--muted);
  transition:    0.2s;
  cursor:        default;
}

.interest-pill:hover {
  border-color: var(--blue);
  color:        var(--ink);
}


/* ============================================================
   15. CONTACT SECTION
   ============================================================ */

.contact-bg {
  background: var(--surface);
}

.contact-inner {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   5rem;
  align-items:           start;
  margin-top:            4rem;
}

.contact-text p {
  color:         var(--muted);
  margin-bottom: 1.2rem;
  font-size:     0.95rem;
  line-height:   1.8;
}

.social-links {
  display:        flex;
  flex-direction: column;
  gap:            0.75rem;
}

.social-link {
  display:         flex;
  align-items:     center;
  gap:             1rem;
  padding:         1rem 1.25rem;
  background:      var(--card);
  border:          1px solid var(--border);
  border-radius:   12px;
  text-decoration: none;
  color:           var(--ink);
  transition:      0.2s;
}

.social-link:hover {
  border-color: var(--blue);
  transform:    translateX(4px);
}

/* Social icon container */
.si {
  width:         36px;
  height:        36px;
  border-radius: 8px;
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     0.95rem;
  flex-shrink:   0;
}

/* Per-platform brand colours */
.si-li { background: #0A66C2; }
.si-gh { background: #161B22; border: 1px solid var(--border); }
.si-md { background: #000; }
.si-ig { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }

.sl-name {
  font-weight: 500;
  font-size:   0.88rem;
}

.sl-handle {
  font-size: 0.72rem;
  color:     var(--muted);
}

.sl-arrow {
  margin-left: auto;
  color:       var(--muted);
}


/* ============================================================
   16. FOOTER
   ============================================================ */

footer {
  padding:         2rem 5rem;
  border-top:      1px solid var(--border);
  display:         flex;
  justify-content: space-between;
  align-items:     center;
  font-size:       0.8rem;
  color:           var(--muted);
}

footer a {
  color:           var(--blue);
  text-decoration: none;
}


/* ============================================================
   17. SCROLL REVEAL UTILITY
   ============================================================ */

/* Elements start hidden; JS adds .visible when in viewport */
.reveal {
  opacity:    0;
  transform:  translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity:   1;
  transform: translateY(0);
}

/* Staggered delay helpers */
.rd1 { transition-delay: 0.1s; }
.rd2 { transition-delay: 0.2s; }
.rd3 { transition-delay: 0.3s; }


/* ============================================================
   18. RESPONSIVE / MEDIA QUERIES
   ============================================================ */

/* Tablet — collapse two-column layouts */
@media (max-width: 1024px) {
  nav {
    padding: 1rem 2rem;
  }

  .hero,
  .section {
    padding-left:  2rem;
    padding-right: 2rem;
  }

  .hero {
    grid-template-columns: 1fr;
    padding-top:           7rem;
  }

  .hero-right {
    order: -1;           /* Photo appears above text on smaller screens */
  }

  .profile-wrap {
    width: 260px;
  }

  .about-grid,
  .contact-inner {
    grid-template-columns: 1fr;
    gap:                   3rem;
  }

  .profile-badge-award {
    left: -10px;
  }

  .profile-badge-uni {
    right: -10px;
  }
}

/* Mobile — hide nav links, show hamburger */
@media (max-width: 768px) {
  .nav-links {
    display:          none;
    position:         fixed;
    top:              64px;
    left:             0;
    right:            0;
    flex-direction:   column;
    background:       var(--surface);
    border-bottom:    1px solid var(--border);
    padding:          2rem;
    gap:              1.5rem;
    z-index:          199;
  }

  .nav-links.open {
    display: flex;
  }

  .hamburger {
    display: flex;
  }

  .hero-stats {
    gap: 1.5rem;
  }

  footer {
    flex-direction: column;
    gap:            0.5rem;
    text-align:     center;
  }

  .certs-grid {
    grid-template-columns: 1fr;
  }
}
