/* =================================================================
   BASE RESET & TYPOGRAPHY
   Eliminates browser defaults and establishes consistent foundation
   ================================================================= */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  color: #1a1a1a;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.2;
  font-weight: 600;
  margin-bottom: 0.5em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 600;
}

h3 {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-weight: 600;
}

p {
  line-height: 1.7;
  margin-bottom: 1em;
  color: #4a5568;
}

/* =================================================================
   COLOR SCHEME RATIONALE:
   - Primary: Teal (#0d9488) - Professional, modern, trustworthy
   - Secondary: Slate grays - Clean, sophisticated
   - Accent: Warm coral (#f97316) - Adds energy without being loud
   - Backgrounds: Soft gradients with neutral tones
   This palette conveys professionalism while remaining approachable
   ================================================================= */

/* =================================================================
   NAVIGATION BAR
   Fixed positioning with subtle shadow and smooth transitions
   ================================================================= */

.topnav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  padding: 0 clamp(16px, 5vw, 60px);
  align-items: center;
  min-height: 70px;
  transition: all 0.3s ease;
}

.brand {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  color: #ffffff;
  padding: 14px 0;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topnav .nav-links {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.topnav a {
  color: #e2e8f0;
  text-align: center;
  padding: 12px 20px;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
}

.topnav a::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: #0d9488;
  transition: transform 0.3s ease;
}

.topnav a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.topnav a:hover::after {
  transform: translateX(-50%) scaleX(1);
}

.topnav a.active {
  background-color: #0d9488;
  color: white;
}

/* =================================================================
   HERO SECTION (HOME)
   Full viewport height with overlay for text readability
   ================================================================= */

.containerHome {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  padding: 0 clamp(40px, 8vw, 120px);
  background-image: url("/Pictures/cjs_header.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
}

.containerHome::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.7) 0%,
    rgba(30, 41, 59, 0.5) 100%
  );
}

.home-content {
  background: rgba(255, 255, 255, 0.95);
  padding: clamp(30px, 5vw, 50px);
  border-radius: 20px;
  text-align: left;
  max-width: 700px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  z-index: 1;
  border-left: 5px solid #0d9488;
  animation: fadeInUp 0.8s ease-out;
}

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

.home-content h1 {
  color: #1e293b;
  margin-bottom: 0.3em;
}

.home-content h1:last-child {
  color: #0d9488;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 600;
}

/* =================================================================
   PROJECTS SECTION
   Card-based layout with smooth interactions
   ================================================================= */

.containerprojects {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  background: linear-gradient(to bottom, #f8fafc 0%, #e2e8f0 100%);
  padding: clamp(60px, 10vw, 100px) clamp(20px, 5vw, 40px);
}

.project-header {
  background-color: transparent;
  padding: 0;
  width: min(90vw, 1200px);
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.project-header > h1 {
  text-align: left;
  color: #1e293b;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 3px solid #0d9488;
  width: fit-content;
}

/* Project Cards - Expandable with smooth transitions */
.project-card {
  display: flex;
  gap: 28px;
  padding: 28px;
  border-radius: 16px;
  background: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: #0d9488;
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

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

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(13, 148, 136, 0.15);
  border-color: #0d9488;
}

.project-card:active {
  transform: translateY(-2px);
}

.project-card.expanded {
  box-shadow: 0 16px 48px rgba(13, 148, 136, 0.2);
}

.project-image {
  flex-shrink: 0;
}

.project-image img {
  width: 220px;
  height: 150px;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.03);
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.project-title {
  color: #1e293b;
  margin-bottom: 4px;
  font-weight: 700;
}

.project-summary {
  color: #475569;
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.project-tags span {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.875rem;
  border-radius: 20px;
  background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
  color: #0d9488;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.project-tags span:hover {
  background: #0d9488;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(13, 148, 136, 0.3);
}

.project-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding-top: 0;
}

.project-card.expanded .project-details {
  max-height: 1000px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  margin-top: 8px;
}

.project-details p {
  color: #64748b;
  line-height: 1.8;
  font-size: 0.95rem;
}

/* =================================================================
   RESUME SECTION
   Grid-based layout with visual hierarchy
   ================================================================= */

.containerresume {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: clamp(60px, 10vw, 100px) clamp(20px, 5vw, 40px);
  background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
}

/* Changed here 
.resume-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  grid-template-rows: auto auto;
  gap: 40px;
  width: min(90vw, 1200px);
  align-items: start;
} */ 
.resume-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  grid-template-rows: auto auto auto auto;  /* 4 rows for proper spacing */
  gap: 40px;
  width: min(90vw, 1200px);
  align-items: start;
  align-content: start;  /* Prevents gap stretching */
}
.resume-image {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}

.resume-image img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border: 4px solid white;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.resume-image img:hover {
  transform: scale(1.02);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.2);
}

.resume-intro {
  grid-column: 2 / 3;
  grid-row: 1 / 3; /* Now spans rows 1-2 */
  background: white;
  padding: clamp(28px, 5vw, 40px);
  border-radius: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #0d9488;
}
.resume-intro h1 {
  color: #1e293b;
  margin-bottom: 16px;
}

/* .resume-intro p {
  font-size: 1.125rem;
  color: #475569;
  line-height: 1.7;
} */
.resume-intro p {
  font-size: 1.125rem;
  color: #475569;
  line-height: 1.7;
}


.resume-highlights {
  grid-column: 1 / 2;
  grid-row: 2 / 4;
}

.resume-highlights h2 {
  color: #1e293b;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid #0d9488;
}

.highlight-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.highlight-card {
  background: white;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.highlight-card:hover {
  transform: translateX(8px);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.15);
  border-color: #0d9488;
}

.highlight-card h3 {
  color: #0d9488;
  margin-bottom: 8px;
  font-weight: 700;
}

.highlight-card p {
  color: #64748b;
  font-size: 0.95rem;
  margin: 0;
}

.contact-card {
  grid-column: 2 / 3;
  grid-row: 3 / 5;
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  padding: clamp(28px, 5vw, 36px);
  border-radius: 20px;
  align-self: start;
  box-shadow: 0 8px 32px rgba(13, 148, 136, 0.3);
  color: white;
/* layout change */
  display: flex;            /* new: make layout flexible */
  flex-direction: column;   /* stack by default (mobile-first) */
  gap: 12px;                /* spacing between items */
  align-items: flex-start;
  flex-wrap: wrap;
}

.contact-card h3 {
  margin-bottom: 0; /*changed */
  color: white;
  font-weight: 700;
}

.contact-card p {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0; /*changed */
  line-height: 1.7;
}
/* Contact Buttons Update */
.contact-button {
  display: block;
  padding: 14px 28px;
  background: white;
  color: #0d9488;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin: 0;                /* removed previous margin-right */
  width: 100%;              /* full width on small screens */
  max-width: 320px;         /* constrain width on larger screens */
  text-align: center;
}

.contact-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  background: #f0fdfa;
}

.contact-button:active {
  transform: translateY(-1px);
}
/* Resume Card Update  */
.resume-download {
  grid-column: 1 / 2;
  grid-row: 4 / 5;
  background: white;
  padding: clamp(24px, 4vw, 32px);
  border-radius: 20px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  border-left: 4px solid #0d9488;
}

.resume-download h3 {
  color: #1e293b;
  margin-bottom: 12px;
  font-weight: 700;
}

.resume-download p {
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.resume-button {
  display: inline-block;
  padding: 12px 24px;
  background: #0d9488;
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 4px 14px rgba(13, 148, 136, 0.4);
}

.resume-button:hover {
  background: #0f766e;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(13, 148, 136, 0.5);
}

.resume-button:active {
  transform: translateY(0);
}
/* =================================================================
   RESPONSIVE DESIGN
   Mobile-first breakpoints for optimal viewing on all devices
   ================================================================= */

@media (max-width: 968px) {
  .resume-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .resume-image,
  .resume-intro,
  .resume-highlights,
  .contact-card {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .highlight-cards {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .highlight-card {
    flex: 1 1 calc(50% - 10px);
    min-width: 200px;
  }
}

@media (max-width: 768px) {
  .topnav {
    flex-wrap: wrap;
    padding: 12px 20px;
    justify-content: center;
  }

  .brand {
    width: 100%;
    text-align: center;
    padding: 8px 0;
  }

  .topnav .nav-links {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }

  .project-card {
    flex-direction: column;
    gap: 20px;
  }

  .project-image img {
    width: 100%;
    height: 200px;
  }

  .containerHome {
    padding: 0 24px;
  }

  .home-content {
    padding: 30px;
  }

  .highlight-cards {
    flex-direction: column;
  }

  .highlight-card {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .topnav .nav-links {
    flex-direction: column;
    gap: 0;
    width: 100%;
  }

  .topnav a {
    width: 100%;
    text-align: center;
  }

  .project-header {
    width: 95vw;
  }

  .project-card {
    padding: 20px;
  }

  .project-tags span {
    font-size: 0.8rem;
    padding: 5px 12px;
  }

  .resume-grid {
    width: 95vw;
    gap: 24px;
  }
}
/* Desktop / tablet layout: place buttons inline and give horizontal spacing */
@media (min-width: 769px) {
  .contact-card {
    flex-direction: row;   /* horizontal layout on wider screens */
    align-items: center;
    gap: 16px;
  }

  .contact-button {
    width: auto;          /* natural width */
    max-width: none;
  }

  /* space between adjacent buttons */
  .contact-button + .contact-button {
    margin-left: 12px;
  }
}

/* Ensure stacked full-width on small breakpoints */
@media (max-width: 480px) {
  .contact-card {
    gap: 10px;
  }

  .contact-button {
    width: 100%;
    padding: 12px 18px;
  }
}

/* =================================================================
   ACCESSIBILITY ENHANCEMENTS
   ================================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid #0d9488;
  outline-offset: 2px;
}

.contact-button:focus-visible {
  outline: 3px solid white;
  outline-offset: 4px;
}
