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

html {
    scroll-behavior: smooth;
}

:root {
    --primary: #1e40af;
    --secondary: #1e3a8a;
    --dark: #0f172a;
    --gray: #64748b;
    --light-gray: #f1f5f9;
    --white: #ffffff;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

.nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: transparent;
    backdrop-filter: none;
    z-index: 1000;
    padding: 1rem 0;
    box-shadow: none;
    transition: all 0.3s ease;
}

.nav.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.nav-content {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
    cursor: pointer;
}

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

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

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav.scrolled .nav-links a {
    color: var(--dark);
}

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

section {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px;
    background: url('https://images.unsplash.com/photo-1444723121867-7a241cacace9?q=80&w=2070&auto=format&fit=crop') center/cover no-repeat;
    position: relative;
    overflow: hidden;
    max-width: none;
    margin: 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.5) 100%);
    z-index: 1;
}

.hero-content {
    animation: fadeInUp 1s ease;
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 6rem;
    margin-bottom: 1rem;
    font-weight: 800;
    letter-spacing: -2px;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
    color: white;
    line-height: 1;
}

.hero .subtitle {
    font-size: 1.5rem;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
    opacity: 1;
}

.hero p {
    font-size: 1.125rem;
    color: white;
    max-width: 700px;
    margin: 0 auto 2rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: #1e40af;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.8s ease 0.4s backwards;
}

.cta-button:hover {
    transform: translateY(-2px);
    background: #1e3a8a;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    margin: 1rem auto 0;
    border-radius: 2px;
}

.about-content {
    display: grid;
    grid-template-columns: 500px 1fr;
    gap: 3rem;
    align-items: center;
}

.about-image {
    width: 500px;
    height: 500px;
    border-radius: 20px;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.about-image:hover {
    transform: scale(1.05);
}

.about-text h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

.about-text p {
    color: var(--gray);
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

.hobbies {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.hobby-tag {
    padding: 0.5rem 1rem;
    background: var(--light-gray);
    border-radius: 20px;
    color: var(--dark);
    font-size: 0.9rem;
    font-weight: 500;
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.project-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.project-card:nth-child(2) {
    grid-template-columns: 1fr 1.2fr;
}

.project-card:nth-child(2) .project-demo {
    order: 2;
}

.project-card:nth-child(2) .project-content {
    order: 1;
}

.project-demo {
    width: 100%;
    height: 100%;
    min-height: 400px;
    background: var(--light-gray);
    position: relative;
    overflow: hidden;
}

.project-demo video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-demo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dart-card {
    margin-bottom: 3rem;
}

.demo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--gray);
}

.project-content {
    padding: 2rem;
}

.project-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.project-content p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.tech-tag {
    padding: 0.25rem 0.75rem;
    background: var(--light-gray);
    border-radius: 15px;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    padding: 0.5rem 1.25rem;
    border: 2px solid var(--primary);
    color: var(--primary);
    text-decoration: none;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.project-link:hover {
    background: var(--primary);
    color: white;
}

.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.skill-category:hover {
    transform: translateY(-5px);
}

.skill-category h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-item {
    padding: 0.5rem 1rem;
    background: var(--light-gray);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--dark);
    font-weight: 500;
}

.leadership-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.leadership-card {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    border-left: 4px solid var(--primary);
}

.leadership-card:hover {
    transform: translateY(-5px);
}

.leadership-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.leadership-card .role {
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.leadership-card p {
    color: var(--gray);
}

.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-content p {
    font-size: 1.5rem;
    color: var(--gray);
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
}

.contact-item a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: var(--secondary);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.social-link {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--dark);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    transform: translateY(-3px);
}

footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 2rem;
}

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

.fade-in {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .about-image {
        margin: 0 auto;
    }

    .nav-links {
        gap: 1rem;
        font-size: 0.9rem;
    }

    section {
        padding: 4rem 1rem;
    }

    .projects-grid,
    .skills-container,
    .leadership-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   MOBILE RESPONSIVE OVERRIDES (ADD-ONLY)
   Paste at the very bottom of styles.css
   ========================================================= */

/* Make the about image actually responsive (your .about-image is 500x500 by default) */
@media (max-width: 768px) {
  .about-image {
    width: min(320px, 90vw);
    height: min(320px, 90vw);
  }

  /* Your HTML has <div class="about-image"><img class="about-image" ...></div> */
  .about-image img,
  img.about-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
    display: block;
  }
}

/* Projects: overlay content on top of media (video/image) */
@media (max-width: 768px) {
  .project-card {
    /* keep grid, but overlap demo + content in the same cell */
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    position: relative;
  }

  .project-demo {
    grid-area: 1 / 1;
    min-height: 320px; /* smaller than desktop 400px */
  }

  .project-content {
    grid-area: 1 / 1;              /* overlap on top of the media */
    align-self: end;               /* place near bottom */
    justify-self: stretch;
    z-index: 2;

    /* readable overlay */
    color: white;
    padding: 1.25rem;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.72) 0%,
      rgba(0, 0, 0, 0.35) 55%,
      rgba(0, 0, 0, 0.0) 100%
    );
  }

  .project-content h3 {
    color: white;
    margin-bottom: 0.5rem;
  }

  .project-content p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1rem;
  }

  /* Make tags readable on dark overlay */
  .tech-tag {
    background: rgba(255, 255, 255, 0.14);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.18);
  }

  /* Buttons readable on dark overlay */
  .project-link {
    border-color: rgba(255, 255, 255, 0.85);
    color: white;
  }

  .project-link:hover {
    background: rgba(255, 255, 255, 0.18);
    color: white;
  }

  /* Your 2nd card currently reverses order on desktop — undo that on mobile */
  .project-card:nth-child(2) .project-demo,
  .project-card:nth-child(2) .project-content {
    order: initial;
  }
}

/* Nav: prevent mobile overflow/squeezing */
@media (max-width: 768px) {
  .nav-content {
    padding: 0 1rem;
    gap: 0.75rem;
  }

  .nav-links {
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

/* =========================================================
   MOBILE: Featured Projects should be stacked (text then media)
   Add BELOW the previous mobile overrides so it wins
   ========================================================= */
@media (max-width: 768px) {
  /* Override the overlay behavior and switch to vertical stacking */
  .project-card {
    display: flex;              /* override grid/overlay */
    flex-direction: column;
  }

  /* Text first */
  .project-content {
    order: 1;
    position: static;
    background: white;
    color: var(--dark);
    padding: 1.5rem;
  }

  .project-content h3 {
    color: var(--dark);
  }

  .project-content p {
    color: var(--gray);
  }

  /* Media second */
  .project-demo {
    order: 2;
    min-height: auto;
  }

  /* Make video/image responsive and nicely sized */
  .project-demo video,
  .project-demo img {
    width: 100%;
    height: auto;
    display: block;
  }

  /* Keep tags readable in the normal (non-overlay) style */
  .tech-tag {
    background: var(--light-gray);
    color: var(--primary);
    border: none;
  }

  /* Buttons back to normal */
  .project-link {
    border-color: var(--primary);
    color: var(--primary);
  }

  .project-link:hover {
    background: var(--primary);
    color: white;
  }
}

/* =========================================================
   MOBILE: Featured projects should ALWAYS be media first, then text
   (fixes Meridian being reversed from nth-child(2) desktop staggering)
   ========================================================= */
@media (max-width: 768px) {
  /* Ensure stacked layout */
  .project-card {
    display: flex;
    flex-direction: column;
  }

  /* Force consistent order for ALL project cards on mobile */
  .project-demo {
    order: 1 !important;   /* top */
  }

  .project-content {
    order: 2 !important;   /* below */
    position: static;
    background: white;
    color: var(--dark);
  }

  .project-content h3 { color: var(--dark); }
  .project-content p  { color: var(--gray); }
}


/* HAMBURGER MENU */

.nav-toggle {
  display: none;                /* hidden on desktop */
  background: transparent;
  border: 0;
  padding: 0.25rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle__bar {
  display: block;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  margin: 5px 0;
  background: white;            /* default (hero) */
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

/* When nav background switches to white, make hamburger dark */
.nav.scrolled .nav-toggle__bar {
  background: var(--dark);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  /* hide links by default on mobile */
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 1rem;
    flex-direction: column;
    gap: 0;
    padding: 0.75rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    min-width: 200px;
    z-index: 1100;
  }

  /* links should be dark inside the dropdown */
  .nav-links a {
    color: var(--dark);
    padding: 0.75rem 0.9rem;
    display: block;
    border-radius: 10px;
  }

  .nav-links a:hover {
    background: rgba(0,0,0,0.05);
  }

  /* open state */
  .nav.nav--open .nav-links {
    display: flex;
  }

  /* animate hamburger into X when open */
  .nav.nav--open .nav-toggle__bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .nav.nav--open .nav-toggle__bar:nth-child(2) {
    opacity: 0;
  }
  .nav.nav--open .nav-toggle__bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  /* ensure nav-content can position dropdown */
  .nav-content {
    position: relative;
  }
}