/* =============================================
   MALAKAII — PORTFOLIO STYLESHEET
   Deep purple-dark bg, electric violet accent
   Using Syne (headings) + DM Sans (body)
============================================= */


/* ── CSS CUSTOM PROPERTIES (VARIABLES) ──────
   Change colors and fonts in one place here
─────────────────────────────────────────── */
:root {
  /* Colors */
  --color-bg:          #0D0B12;   /* Main background — near-black with purple undertone */
  --color-bg-alt:      #100E16;   /* Alternate section background */
  --color-surface:     #161220;   /* Card / surface background */
  --color-border:      #2A2040;   /* Subtle borders */
  --color-accent:      #A855F7;   /* Electric violet — primary accent */
  --color-accent-dim:  #2D1657;   /* Muted violet for fills */
  --color-accent-hot:  #C084FC;   /* Bright violet for hovers */
  --color-text:        #F0ECF8;   /* Primary text — warm off-white with purple tint */
  --color-text-muted:  #8878A8;   /* Secondary text — muted violet-grey */
  --color-label:       #E879F9;   /* Section labels — fuchsia pop */

  /* Typography */
  --font-display: 'Plus Jakarta Sans', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Spacing */
  --section-padding: 100px 0;
  --container-width: 1100px;
  --container-padding: 0 24px;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-med:  0.35s ease;
}


/* ── RESET & BASE STYLES ────────────────────
   Remove browser defaults, set sensible base
─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth; /* Enables smooth scrolling for anchor links */
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Remove list styling globally (we'll add it back where needed) */
ul, ol {
  list-style: none;
}

/* Remove underline from links by default */
a {
  color: inherit;
  text-decoration: none;
}

/* Make images responsive */
img {
  max-width: 100%;
  display: block;
}

/* Focus styles for keyboard accessibility */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}


/* ── CONTAINER ──────────────────────────────
   Centers content and limits max width
─────────────────────────────────────────── */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: var(--container-padding);
}


/* ── SECTION BASE STYLES ────────────────────
   Shared styles for all main sections
─────────────────────────────────────────── */
.section {
  padding: var(--section-padding);
}

/* Alternating section backgrounds for visual rhythm */
.about-section,
.contact-section {
  background-color: var(--color-bg-alt);
}

/* Small label above section headings */
.section-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 12px;
}

/* Main section headings */
.section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 48px;
  line-height: 1.2;
}


/* ── NAVIGATION ─────────────────────────────
   Fixed top bar that gets a backdrop on scroll
─────────────────────────────────────────── */
.nav-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  transition: background-color var(--transition-med), border-bottom var(--transition-med);
}

/* This class is added by JavaScript when the user scrolls down */
.nav-header.scrolled {
  background-color: rgba(13, 11, 18, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
}

.nav-container {
  max-width: var(--container-width);
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo / Name in nav */
.nav-logo {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  transition: color var(--transition-fast);
}

.nav-logo:hover {
  color: var(--color-accent);
}

/* Desktop nav links in a row */
.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
  position: relative;
  padding-bottom: 2px;
}

/* Underline animation on hover */
.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-accent);
  transition: width var(--transition-med);
}

.nav-link:hover {
  color: var(--color-text);
}

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

/* Mobile hamburger button — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger-line {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-text);
  transition: transform var(--transition-med), opacity var(--transition-fast);
  border-radius: 2px;
}

/* Animate hamburger to X when menu is open */
.nav-toggle.open .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open .hamburger-line:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ── HERO SECTION ───────────────────────────
   Full-screen intro section
─────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}

.hero-content {
  max-width: var(--container-width);
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2; /* Sits above the background grid */
}

/* Small label text above name */
.hero-label {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

/* Large name heading */
.hero-name {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 9vw, 7rem);
  font-weight: 600;
  line-height: 1.0;
  color: var(--color-text);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

/* Blinking cursor — the signature element of this design */
.cursor {
  color: var(--color-accent);
  animation: blink 1.1s step-end infinite;
  text-shadow: 0 0 20px rgba(168, 85, 247, 0.8), 0 0 40px rgba(168, 85, 247, 0.4);
}

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

/* Job title */
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 3vw, 1.5rem);
  font-weight: 500;
  color: var(--color-accent);
  margin-bottom: 24px;
  letter-spacing: 0.01em;
}

/* Intro paragraph */
.hero-intro {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 520px;
  margin-bottom: 40px;
  line-height: 1.75;
}

/* CTA button row */
.hero-buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* Subtle CSS-only dot grid background pattern */
.hero-grid-bg {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: radial-gradient(
    circle,
    rgba(168, 85, 247, 0.12) 1px,
    transparent 1px
  );
  background-size: 36px 36px;
  mask-image: linear-gradient(to left, rgba(0,0,0,0.8) 0%, transparent 65%);
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.8) 0%, transparent 65%);
}


/* ── BUTTONS ────────────────────────────────
   Reusable button styles
─────────────────────────────────────────── */

/* Base button reset */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 6px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color var(--transition-fast),
              color var(--transition-fast),
              border-color var(--transition-fast),
              transform var(--transition-fast),
              box-shadow var(--transition-fast);
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
}

/* Solid primary button */
.btn-primary {
  background-color: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background-color: var(--color-accent-hot);
  border-color: var(--color-accent-hot);
  box-shadow: 0 8px 24px rgba(74, 158, 255, 0.25);
}

/* Outlined secondary button */
.btn-secondary {
  background-color: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Small outlined button (used on project cards) */
.btn-outline {
  background-color: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-outline:hover {
  background-color: var(--color-accent-dim);
}

/* Ghost button — no border, just text */
.btn-ghost {
  background-color: transparent;
  color: var(--color-text-muted);
  border-color: var(--color-border);
}

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

/* Small variant for project card buttons */
.btn-sm {
  font-size: 0.8rem;
  padding: 8px 18px;
}


/* ── ABOUT SECTION ──────────────────────────
─────────────────────────────────────────── */
.about-content {
  max-width: 680px;
}

.about-text {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-text:last-child {
  margin-bottom: 0;
}


/* ── SKILLS SECTION ─────────────────────────
─────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}

/* Individual skill group card */
.skill-group {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 28px 24px;
  transition: border-color var(--transition-fast);
}

.skill-group:hover {
  border-color: var(--color-label);
  box-shadow: 0 0 0 1px rgba(232, 121, 249, 0.15);
}

/* Group title (e.g. "Cloud (AWS)") */
.skill-group-title {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-label);
  margin-bottom: 16px;
}

/* Row of skill tags */
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Individual skill tag pill */
.skill-tag {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 5px 12px;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.skill-tag:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}


/* ── PROJECTS SECTION ───────────────────────
─────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

/* Project card */
.project-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color var(--transition-med), transform var(--transition-med);
  /* Left accent border — a clean structural marker */
  border-left: 3px solid var(--color-accent-dim);
}

.project-card:hover {
  border-color: var(--color-accent);
  border-left-color: var(--color-accent);
  transform: translateY(-4px);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.2), 0 12px 32px rgba(168, 85, 247, 0.12);
}

.project-card-inner {
  padding: 28px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 12px;
  line-height: 1.3;
}

.project-description {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
  flex-grow: 1; /* Push the tech tags and links to the bottom */
}

/* Tech tags row */
.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.tech-tag {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  background-color: var(--color-accent-dim);
  border-radius: 3px;
  padding: 3px 9px;
}

/* Button row at bottom of card */
.project-links {
  display: flex;
  gap: 10px;
}


/* ── CONTACT SECTION ────────────────────────
─────────────────────────────────────────── */
.contact-intro {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 520px;
  margin-bottom: 48px;
  line-height: 1.8;
}

/* Row of contact links */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 480px;
}

/* Individual contact link row */
.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.contact-item:hover {
  border-color: var(--color-accent);
  transform: translateX(4px);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.15);
}

.contact-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--color-accent);
}

.contact-item-text {
  display: flex;
  flex-direction: column;
}

.contact-item-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.contact-item-value {
  font-size: 0.9rem;
  color: var(--color-text);
}


/* ── FOOTER ─────────────────────────────────
─────────────────────────────────────────── */
.footer {
  padding: 28px 24px;
  border-top: 1px solid var(--color-border);
  background-color: var(--color-bg);
}

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

.footer-name {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

.footer-copy {
  font-size: 0.82rem;
  color: var(--color-text-muted);
}


/* ── SCROLL REVEAL ANIMATION ────────────────
   Elements with class "reveal" start hidden
   and fade in when scrolled into view.
   JavaScript adds the "visible" class.
─────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

/* Respect user's preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .cursor {
    animation: none;
  }

  .btn:hover {
    transform: none;
  }
}


/* ── RESPONSIVE: TABLET ─────────────────────
   Screens narrower than 768px
─────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Reduce section padding on smaller screens */
  .section {
    padding: 72px 0;
  }

  /* Hide nav links and show hamburger button */
  .nav-links {
    display: none;
    position: absolute;
    top: 64px; /* Height of the nav bar */
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background-color: rgba(13, 11, 18, 0.99);
    border-bottom: 1px solid var(--color-border);
    padding: 16px 0;
  }

  /* Show nav links when menu is open (class added by JS) */
  .nav-links.open {
    display: flex;
  }

  .nav-link {
    padding: 14px 24px;
    font-size: 1rem;
    display: block;
    width: 100%;
  }

  /* Remove the underline animation on mobile (not needed) */
  .nav-link::after {
    display: none;
  }

  /* Show hamburger button */
  .nav-toggle {
    display: flex;
  }

  /* Stack hero buttons vertically on small screens */
  .hero-buttons {
    flex-direction: column;
    align-items: flex-start;
  }

  .btn {
    width: 100%;
    text-align: center;
    max-width: 280px;
  }

  /* Projects in a single column */
  .projects-grid {
    grid-template-columns: 1fr;
  }

  /* Skills in a single column */
  .skills-grid {
    grid-template-columns: 1fr;
  }
}


/* ── RESPONSIVE: MOBILE ─────────────────────
   Screens narrower than 480px
─────────────────────────────────────────── */
@media (max-width: 480px) {
  .section {
    padding: 60px 0;
  }

  .hero-intro {
    font-size: 0.95rem;
  }

  .contact-item {
    padding: 16px 18px;
  }

  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
}
