/* ================================================================
   SAFA SARFRAZ — Personal Website Stylesheet
   File: css/style.css

   TABLE OF CONTENTS:
   1. CSS Variables (color palette, fonts)
   2. Reset & Base Styles
   3. Custom Cursor
   4. Navigation
   5. Page System (show/hide pages)
   6. Animations & Keyframes
   7. HOME page
   8. ABOUT page
   9. COMMITMENTS page
   10. PROJECTS page
   11. CONTACT page
   12. Footer
   13. Responsive (mobile-friendly)
================================================================ */


/* ================================================================
   1. CSS VARIABLES
   Define all colors and fonts in one place.
   Change a value here and it updates everywhere!
================================================================ */
:root {
  /* Color palette — cool blue/teal + deep navy + soft ivory */
  --bg:        #F0EEE9;          /* Page background — warm ivory */
  --surface:   #E8E5DE;          /* Card / panel background */
  --ink:       #18181B;          /* Main text color — near black */
  --muted:     #7A7670;          /* Subdued text (labels, hints) */
  --accent:    #3B82C4;          /* Primary accent — steel blue */
  --accent2:   #5BBFAD;          /* Secondary accent — teal */
  --line:      rgba(100,100,90,0.18); /* Subtle borders */

  /* Typography */
  --font-display: 'Cormorant Garamond', serif;  /* For headings */
  --font-body:    'Outfit', sans-serif;         /* For body text */

  /* Spacing & shape */
  --radius:    14px;
  --nav-h:     72px;
}


/* ================================================================
   2. RESET & BASE STYLES
   Remove browser defaults, set up box model and base font.
================================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;   /* Prevent horizontal scroll */
  cursor: none;         /* Hide default cursor — we use a custom one */
}

/* Make links and buttons not show default cursor either */
a, button { cursor: none; }

ul { list-style: none; }


/* ================================================================
   3. CUSTOM CURSOR
   Two elements: a small filled dot and a larger hollow ring.
   They follow the mouse via JavaScript (see main.js).
================================================================ */
.cursor-dot {
  position: fixed;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;   /* Don't block clicks */
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, background 0.2s;
}

.cursor-ring {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  /* Slightly delayed so it "follows" with a lag */
  transition: transform 0.15s ease, width 0.2s, height 0.2s, opacity 0.2s;
  opacity: 0.6;
}

/* When hovering a link/button, the ring expands */
body.hovering .cursor-ring {
  width: 56px;
  height: 56px;
  opacity: 0.3;
}


/* ================================================================
   4. NAVIGATION
   Fixed to top. Semi-transparent with blur (glassmorphism).
================================================================ */
#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3.5rem;

  /* Glassmorphism effect */
  background: rgba(240, 238, 233, 0.80);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  border-bottom: 1px solid var(--line);

  /* Slide down on load */
  animation: slideDown 0.6s ease both;
}

/* Logo text */
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink);
}

/* Nav links list */
.nav-links {
  display: flex;
  gap: 2.5rem;
}

/* Individual nav link */
.nav-link {
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  padding-bottom: 3px;
  transition: color 0.25s;
}

/* Underline that animates in on hover / active */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0%; height: 1.5px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}


/* ================================================================
   5. PAGE SYSTEM
   All sections exist in the HTML but only one is visible at a time.
   JS adds/removes the "active" class to control which is shown.
================================================================ */
.page {
  display: none;
  min-height: 100vh;
  padding-top: var(--nav-h);
}

/* When a page becomes active, display it and animate in */
.page.active {
  display: block;
  animation: fadeUp 0.5s ease both;
}

/* Home page uses flex for centered layout */
#home.page.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Shared inner container for non-home pages */
.page-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 4rem 3rem 6rem;
}


/* ================================================================
   6. ANIMATIONS & KEYFRAMES
   Reusable animation classes applied to HTML elements.
================================================================ */

/* Page enters from below */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Nav slides down from top */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-100%); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Blob shapes slowly drift */
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -20px) scale(1.05); }
  66%       { transform: translate(-15px, 25px) scale(0.97); }
}

/* Staggered animation helpers — add these classes to elements */
.animate-up {
  opacity: 0;
  animation: fadeUp 0.7s ease forwards;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.25s; }
.delay-3 { animation-delay: 0.4s; }
.delay-4 { animation-delay: 0.55s; }
.delay-5 { animation-delay: 0.7s; }

/* Scroll hint line pulse */
@keyframes pulseLine {
  0%, 100% { opacity: 0.3; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(1.4); }
}

/* Card shimmer on hover */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}


/* ================================================================
   7. HOME PAGE
================================================================ */
#home {
  position: relative;
  padding: var(--nav-h) 3.5rem 4rem;
  overflow: hidden;
}

/* --- Background blobs ---
   Soft gradient circles that float in the background.
   Pure CSS — no images needed!
*/
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  pointer-events: none;
  animation: drift 12s ease-in-out infinite;
}

.blob-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #3B82C4, transparent);
  top: -100px; right: -80px;
  animation-duration: 14s;
}

.blob-2 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, #5BBFAD, transparent);
  bottom: 0; left: -60px;
  animation-duration: 10s;
  animation-delay: -4s;
}

.blob-3 {
  width: 260px; height: 260px;
  background: radial-gradient(circle, #A78BFA, transparent); /* Soft lavender */
  top: 50%; left: 40%;
  animation-duration: 16s;
  animation-delay: -8s;
  opacity: 0.15;
}

/* --- Home content container --- */
.home-content {
  max-width: 820px;
  margin: 0 auto;
  position: relative;
  z-index: 1; /* Sit above the blobs */
}

/* "Computer Engineering Student · ..." label */
.greeting {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.2rem;
}

/* Large name heading */
.home-name {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 300;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: 1.6rem;
}

/* The italic "Safa Sarfraz" in the heading */
.home-name em {
  font-style: italic;
  color: var(--accent);
}

/* Short description below the name */
.home-tagline {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 480px;
  line-height: 1.75;
  margin-bottom: 2.5rem;
  font-weight: 300;
}

/* --- Buttons --- */
.home-btns {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

/* Base button styles */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.72rem 2rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 100px;
  border: none;
  transition: all 0.28s cubic-bezier(0.34, 1.56, 0.64, 1); /* Springy effect */
}

/* Filled primary button */
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59,130,196,0.3);
}

/* Hollow outline button */
.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.btn-outline:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-2px);
}

/* --- Icons row --- */
.home-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
  width: 100%;
}

.stat {
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-divider {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.stat-divider svg {
  opacity: 0.5;
}

/* --- Scroll hint --- */
.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  right: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.scroll-line {
  width: 1px;
  height: 40px;
  background: var(--accent);
  animation: pulseLine 2s ease-in-out infinite;
}


/* ================================================================
   8. ABOUT PAGE
================================================================ */

/* Section header (reused across all pages) */
.section-header {
  margin-bottom: 3rem;
}

.section-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 300;
  line-height: 1.1;
}

/* Italic part of heading */
.section-title em {
  font-style: italic;
  color: var(--accent2);
}

/* Two-column layout */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  align-items: start;
}

/* Bio paragraphs */
.about-bio {
  font-size: 0.97rem;
  line-height: 1.9;
  color: #3a3530;
  font-weight: 300;
}

.about-bio p + p {
  margin-top: 1.2rem; /* Space between paragraphs */
}

/* Right-side block (education, skills) */
.aside-block {
  margin-bottom: 2.5rem;
}

/* Block title (e.g. "Education") */
.aside-title {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent2);
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.2rem;
}

.edu-item {
  margin-bottom: 1.3rem;
}

.edu-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.edu-detail {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
  line-height: 1.55;
}

/* Dean's list badge */
.badge {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  background: rgba(59,130,196,0.1);
  color: var(--accent);
  border: 1px solid rgba(59,130,196,0.2);
  padding: 0.15rem 0.65rem;
  border-radius: 100px;
  margin-top: 0.4rem;
}

/* Skills tag cloud */
.skills-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-tag {
  font-size: 0.74rem;
  padding: 0.3rem 0.85rem;
  background: var(--surface);
  border-radius: 100px;
  color: var(--ink);
  border: 1px solid var(--line);
  letter-spacing: 0.03em;
  transition: all 0.2s;
}

/* Tags pop on hover */
.skill-tag:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
}


/* ================================================================
   9. COMMITMENTS PAGE
================================================================ */
.commitments-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* Each commitment entry */
.commit-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  padding: 2rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  transition: border-color 0.25s, transform 0.3s cubic-bezier(0.34,1.4,0.64,1);
  position: relative;
  overflow: hidden;
}

/* Left-edge accent line that appears on hover */
.commit-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--accent), var(--accent2));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.35s ease;
}

.commit-card:hover::before {
  transform: scaleY(1);
}

.commit-card:hover {
  border-color: rgba(59,130,196,0.3);
  transform: translateX(6px);
}

.commit-meta {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding-top: 0.1rem;
}

.commit-date {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

.commit-org {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--accent);
  text-transform: uppercase;
}

.commit-role {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.commit-desc {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 300;
}


/* ================================================================
   10. PROJECTS PAGE
================================================================ */
.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
}

.proj-card {
  padding: 2rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s cubic-bezier(0.34,1.4,0.64,1), border-color 0.25s;

  /* Gradient shimmer will show on hover */
  background-image: linear-gradient(
    120deg,
    transparent 0%,
    transparent 40%,
    rgba(59,130,196,0.06) 50%,
    transparent 60%,
    transparent 100%
  );
  background-size: 200% 100%;
}

.proj-card:hover {
  transform: translateY(-6px);
  border-color: rgba(59,130,196,0.35);
  background-position: right center; /* Triggers the shimmer */
  animation: shimmer 0.8s ease;
}

/* Top bar that appears on hover */
.proj-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease;
}

.proj-card:hover::after {
  transform: scaleX(1);
}

/* Language label */
.proj-lang {
  display: inline-block;
  font-size: 0.67rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent2);
  background: rgba(91,191,173,0.1);
  border: 1px solid rgba(91,191,173,0.2);
  padding: 0.2rem 0.75rem;
  border-radius: 100px;
  margin-bottom: 1.1rem;
}

.proj-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 0.65rem;
  line-height: 1.2;
}

.proj-desc {
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.7;
  font-weight: 300;
}

/* Arrow in bottom-right that slides in on hover */
.proj-arrow {
  position: absolute;
  bottom: 1.4rem;
  right: 1.6rem;
  font-size: 1.1rem;
  color: var(--accent);
  opacity: 0;
  transform: translate(-6px, 6px);
  transition: all 0.25s ease;
}

.proj-card:hover .proj-arrow {
  opacity: 1;
  transform: translate(0, 0);
}


/* ================================================================
   11. CONTACT PAGE
================================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

/* Italic quote at the top of contact */
.contact-intro {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 300;
  font-style: italic;
  color: #3a3530;
  line-height: 1.6;
  margin-bottom: 2.2rem;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Individual contact link row */
.contact-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.5rem;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.88rem;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
}

/* Slide-in background on hover */
.contact-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 0;
}

.contact-link:hover::before {
  transform: translateX(0);
}

/* Make text/icon sit above the sliding background */
.contact-link span {
  position: relative;
  z-index: 1;
  transition: color 0.3s;
}

.contact-link:hover span {
  color: var(--bg);
}

.contact-icon {
  font-size: 1rem;
  width: 24px;
  text-align: center;
}

/* Certifications list */
.cert-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cert-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.87rem;
  color: #3a3530;
  line-height: 1.5;
}

/* Small colored dot before each cert */
.cert-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent2);
  flex-shrink: 0;
}


/* ================================================================
   12. FOOTER
================================================================ */
footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-top: 1px solid var(--line);
}


/* ================================================================
   13. RESPONSIVE — MOBILE FRIENDLY
   Collapses multi-column layouts to single column on small screens.
================================================================ */
@media (max-width: 768px) {
  /* Nav: reduce padding */
  #navbar {
    padding: 0 1.5rem;
  }

  /* Nav links: smaller and closer */
  .nav-links {
    gap: 1.4rem;
  }

  .nav-link {
    font-size: 0.68rem;
    letter-spacing: 0.09em;
  }

  /* Home: less padding */
  #home {
    padding: var(--nav-h) 1.5rem 4rem;
  }

  .scroll-hint {
    display: none; /* Hide on mobile to save space */
  }

  /* All multi-column grids → single column */
  .about-grid,
  .contact-grid,
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  /* Commitment cards: stack vertically */
  .commit-card {
    grid-template-columns: 1fr;
    gap: 0.8rem;
  }

  /* Inner pages: less padding */
  .page-inner {
    padding: 3rem 1.5rem 5rem;
  }
}
