/* Dark theme reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #111111;
  color: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 5%;
  border-bottom: 1px solid #222;
}

.logo h1 {
  font-size: 1.4rem;
  letter-spacing: 2px;
  font-weight: 600;
}

.logo span {
  font-size: 0.8rem;
  color: #888;
  letter-spacing: 1px;
}

nav a {
  color: #ccc;
  text-decoration: none;
  margin-left: 20px;
  font-size: 0.9rem;
  transition: color 0.2s;
}

nav a:hover, nav a.active {
  color: #fff;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 1rem;
}

.hero h2 {
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 3px;
  color: #ddd;
}

/* Portfolio Grid */
.portfolio {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 4rem;
}

.portfolio h3 {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  letter-spacing: 1px;
  border-bottom: 1px solid #333;
  padding-bottom: 0.5rem;
  color: #aaa;
}

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

.show-card {
  background: #1a1a1a;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #2a2a2a;
  transition: transform 0.2s, border-color 0.2s;
}

.show-card:hover {
  transform: translateY(-4px);
  border-color: #444;
}

.card-image img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
}

.card-info {
  padding: 1.2rem;
}

.card-info h4 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  color: #fff;
}

.card-info .company {
  color: #999;
  font-size: 0.85rem;
}

.card-info .year {
  color: #666;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.card-info .description {
  color: #bbb;
  font-size: 0.85rem;
}

footer {
  text-align: center;
  padding: 2rem;
  color: #555;
  font-size: 0.8rem;
  border-top: 1px solid #222;
}

/* ==========================================
   MOBILE & TABLET RESPONSIVENESS (Screens <= 768px)
   ========================================== */

/* Fix mobile browser address bar height jumping */
#bg-video,
.video-overlay {
  height: 100dvh !important; /* Uses dynamic viewport height for mobile browsers */
}

@media (max-width: 768px) {
  
  /* 1. Header & Navigation Layout */
  header {
    flex-direction: column;
    align-items: center;
    padding: 1rem 1.5rem !important;
    gap: 1rem;
  }

  .logo img {
    max-height: 120px !important; /* Scale down logo for phone screens */
  }

  nav {
    flex-wrap: wrap; /* Allows menu items to wrap neatly onto a second line */
    justify-content: center;
    gap: 1rem 1.5rem !important;
  }

  nav a {
    font-size: 1.1rem !important; /* Readable touch targets */
    padding: 0.25rem 0.5rem;
  }

  .header-socials {
    gap: 1rem !important;
  }

  .header-socials a img {
    width: 32px !important;
    height: 32px !important;
  }

  /* 2. Hero Titles & Headings */
  .contact-title,
  .resume-title,
  .about-title,
  .portfolio-title {
    font-size: 2rem !important;
    letter-spacing: 2px !important;
  }

  .contact-hero,
  .resume-hero,
  .about-hero,
  .portfolio-hero {
    padding: 2rem 1.5rem 1rem 1.5rem !important;
  }

  /* 3. Cards & Main Containers */
  .contact-container,
  .documents-container,
  .about-container,
  .portfolio-container {
    width: 90% !important;
    max-width: 100% !important;
    margin: 1.5rem auto 4rem auto !important;
    padding: 1.5rem !important;
  }

  /* 4. Action Buttons (Resume/CV) */
  .documents-container {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem !important;
  }

  .doc-button {
    width: 100%;
    text-align: center;
    padding: 1rem 1.5rem !important;
    font-size: 1.1rem !important;
  }

  /* 5. Social Links on Contact Page */
  .social-connect-links {
    flex-direction: column;
    gap: 0.75rem !important;
  }

  /* 6. Portfolio Table Horizontal Scrolling (Prevents page stretch) */
  .portfolio-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Add/Replace inside your @media (max-width: 768px) block */
@media (max-width: 768px) {
  .hero {
    padding: 2rem 1.5rem 1rem 1.5rem !important;
    text-align: center !important; /* Center align titles on phones */
  }

  .hero-title {
    font-size: 1.75rem !important;
    margin-left: 0 !important; /* Remove huge left margin on mobile */
    letter-spacing: 1px !important;
    text-align: center !important;
  }

  .hero-tagline {
    font-size: 0.9rem !important;
    margin-left: 0 !important; /* Remove huge left margin on mobile */
    letter-spacing: 6px !important; /* Reduce wide letter spacing so it fits on screen */
    text-align: center !important;
  }
}
