/* =======================
   Global Reset & Fonts
======================= */
* { margin: 0; padding: 0; box-sizing: border-box; }
h1, h2, h3 { 
    font-family: 'Inter', sans-serif; 
    font-weight: 700; 
    color: #111; 
}

:root {
    --bg: #ffffff;
    --muted-bg: #f6fbf6; /* very light green */
    --text: #16321a; /* dark green-ish */
    --accent: #16a34a; /* primary green */
    --accent-dark: #0f8a3a;
    --muted: #6b776d;
}

body { 
    font-family: 'Source Sans Pro', sans-serif; 
    background: var(--muted-bg); 
    color: var(--text); 
    line-height: 1.7; 
    scroll-behavior: smooth; 
}


/* =======================
   Navigation
======================= */
nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 3rem; position: fixed; width: 100%; top: 0; 
    background: rgba(186, 255, 209, 0.9); 
    backdrop-filter: blur(6px);
    border-bottom: 1px solid #eaeaea;
    z-index: 1000;
}
nav .logo { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
nav .logo img, .nav-logo { max-width: 140px; height: auto; display: block; }
nav ul { display: flex; list-style: none; }
nav ul li { margin-left: 2rem; }
nav ul li a { 
    text-decoration: none; 
    color: var(--text); 
    font-weight: 500; 
    transition: 0.3s ease; 
}
nav ul li a:hover, nav ul li a.active { color: var(--accent); }

/* =======================
   Hero Section
======================= */
header#hero {
    height: 100vh; display: flex; align-items: center; justify-content: center; 
    text-align: center; padding: 2rem;
    background: linear-gradient(135deg, var(--bg), var(--muted-bg));
}
.hero-content h1 { font-size: 3rem; margin-bottom: 0.8rem; }
.hero-content p { font-size: 1.3rem; color: #555; margin-bottom: 1.5rem; }
.btn { 
    padding: 0.8rem 1.6rem; 
    background: var(--accent); 
    color: #fff; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    text-decoration: none; 
    font-weight: 600;
    transition: all 0.3s ease;
}
.btn:hover { background: var(--accent-dark); }

.hero-logo { max-width: 120px; height: auto; display: block; margin: 0 auto 1rem; }

/* =======================
   Sections
======================= */
section { 
    padding: 5rem 3rem; 
    max-width: 1100px; 
    margin: 0 auto; 
    text-align: center; 
}
h2 { font-size: 2.2rem; margin-bottom: 2rem; color: #111; }


/* =======================
   Experience & Projects
======================= */
.experience-container, .projects-container { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 2rem; 
}
.experience-card, .project-card { 
    background: #fff; 
    border-radius: 12px; 
    padding: 1.5rem; 
    text-align: left; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.05); 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.experience-card:hover, .project-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 8px 30px rgba(0,0,0,0.08); 
}
.project-card img { 
    width: 100%; 
    height: 180px; 
    object-fit: cover; 
    border-radius: 8px; 
    margin-bottom: 1rem; 
}


/* =======================
   About Cards
======================= */
.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
    margin-top: 1.5rem;
}
.about-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 6px 24px rgba(14,52,22,0.06);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    min-height: 220px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.about-card h3 { margin-bottom: 0.6rem; font-size: 1.15rem; }
.about-card p { color: var(--muted); line-height: 1.6; }
.about-card:hover { transform: translateY(-6px); box-shadow: 0 12px 40px rgba(14,52,22,0.08); }

@media (min-width: 1000px) {
    .about-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 640px) and (max-width: 999px) {
    .about-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =======================
   Case Study Cards
======================= */
.case-grid {
    display: grid;
    grid-template-columns: 1fr; /* stack cards vertically by default */
    gap: 1rem;
    align-items: start;
    margin-top: 1.25rem;
}
.case-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.4rem;
    box-shadow: 0 6px 24px rgba(14,52,22,0.05);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}
.case-card::before {
    content: "";
    display: block;
    height: 6px;
    width: 48px;
    border-radius: 4px;
    background: var(--accent);
    margin-bottom: 0.8rem;
}
.case-card h3 { margin-bottom: 0.6rem; font-size: 1.05rem; }
.case-card p, .case-card li { color: var(--muted); line-height: 1.6; }
.case-card ul { padding-left: 1.1rem; margin: 0.4rem 0; }
.case-card.pdf-card { text-align: left; }
.case-card .pdf-wrap { width: 100%; border-radius: 8px; overflow: hidden; margin-bottom: 0.8rem; }
.case-card .pdf-wrap iframe { width: 100%; height: 240px; border: 0; display: block; }

@media (min-width: 700px) {
    .case-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1000px) {
    .case-grid { grid-template-columns: repeat(3, 1fr); }
    .case-card .pdf-wrap iframe { height: 320px; }
}

/* Modal for PDF viewer */
.pdf-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 2rem;
}
.pdf-modal .modal-content {
    width: 100%;
    max-width: 1100px;
    height: 80vh;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.pdf-modal .modal-content iframe { width: 100%; height: 100%; border: 0; }
.pdf-modal .modal-header { display:flex; justify-content:space-between; align-items:center; padding:0.8rem 1rem; border-bottom:1px solid #eef6ee; }
.pdf-modal .modal-header .close { background: transparent; border: none; font-size:1rem; cursor:pointer; color:var(--muted); }
.pdf-modal.show { display: flex; }



/* =======================
   Skills
======================= */
.skills-container { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    gap: 1rem; 
}
.skills-container span { 
    background: #ffffff; 
    color: var(--text); 
    padding: 0.6rem 1.2rem; 
    border-radius: 20px; 
    font-weight: 500; 
    transition: 0.3s;
    border: 1px solid #eef6ee;
}
.skills-container span:hover { 
    background: var(--accent); 
    color: #fff; 
}

/* Container helper */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

.about-section .intro {
    margin: 0 auto 1.25rem; 
    max-width: 820px; 
    color: var(--muted);
}

/* =======================
   Contact Form
======================= */
/* Contact info card */
.contact-info {
  max-width: 700px;
  margin: 0 auto;
  background: #fff;
  padding: 1.25rem 1.5rem;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(14,52,22,0.05);
  text-align: left;
}
.contact-info ul { list-style: none; padding-left: 0; margin-top: 0.75rem; }
.contact-info li { margin-bottom: 0.6rem; color: var(--text); }
.contact-info a { color: var(--accent); text-decoration: none; font-weight: 600; }
.contact-info a:hover { text-decoration: underline; }

/* =======================
   Footer
======================= */
footer { 
    text-align: center; 
    padding: 2rem; 
    color: var(--muted); 
    border-top: 1px solid #eef6ee; 
    margin-top: 2rem; 
}

/* Back to top button */
#backToTop {
    position: fixed;
    right: 20px;
    bottom: 30px;
    display: none;
    padding: 0.6rem 0.9rem;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    z-index: 1100;
}
#backToTop:hover { background: var(--accent-dark); }

/* =======================
   Fade-in Animations
======================= */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}
.appear {
    opacity: 1;
    transform: translateY(0);
}
/* --- Case Study Section (with background image) --- */
.case-study-section {
  position: relative;
  padding: 80px 20px;
  background-color: var(--muted-bg);
  /* image path: Green background.jpg (project root) -- use URL-encoded filename to avoid space issues */
  background-image: url('Green%20background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.case-study-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(4, 32, 18, 0.45), rgba(4, 32, 18, 0.45));
  /* subtle backdrop blur to soften the image under the overlay (desktop browsers) */
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 0;
}

.case-study-section .container {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1; /* ensure content sits above overlay */
}

/* Parallax effect: keep background fixed on large screens for a subtle parallax feel */
@media (min-width: 900px) {
  .case-study-section {
    background-attachment: fixed;
  }
}

.case-study-section h2 {
  text-align: center;
  margin-bottom: 40px;
  font-size: 2rem;
  color: #fff;
}

.case-study-section h3 {
  margin-top: 30px;
  color: #07220f; /* keep card headings dark; cards themselves remain white */
  font-weight: 700;
}

.case-study-section p,
.case-study-section li {
  line-height: 1.7;
  color: #e9f6ea; /* light text for intro over image */
}

.case-study-section ul { margin-left: 20px; }

.pdf-viewer { margin-top: 40px; text-align: center; }
.pdf-viewer iframe { margin-top: 10px; }
.pdf-viewer .btn { display: inline-block; margin-top: 20px; }
/* --- Simplified & Centered Case Study Layout --- */
.case-study-section {
  background: #fff;
  padding: 90px 1.5rem;
}

.case-study-section .container {
  max-width: 850px;
  margin: 0 auto;
  text-align: left;
}

.case-study-section h2 {
  text-align: center;
  font-size: 2.5rem;
  line-height: 1.3;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--accent-dark), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.case-study-section .intro {
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #333;
  max-width: 700px;
  margin: 0.5rem auto 1.5rem;
}

.meta-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
}
.meta-badges span {
  background: #f0f7f3;
  color: var(--accent-dark);
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

.case-body {
  display: block;
  gap: 2.5rem;
}

.case-section h3 {
  margin-bottom: 0.6rem;
  color: var(--accent-dark);
  font-size: 1.3rem;
}

.case-section p {
  color: #333;
  line-height: 1.8;
  font-size: 1.05rem;
}

.case-section ul {
  list-style: disc;
  margin-left: 1.8rem;
  color: #333;
  line-height: 1.8;
  font-size: 1.05rem;
}

.case-sections { 
  display: flex; 
  flex-direction: column; 
  gap: 1.5rem; 
}

.pdf-viewer { 
  text-align: center; 
  margin-top: 0; 
}

.pdf-buttons { 
  margin-top: 1rem; 
  display: flex; 
  justify-content: center; 
  gap: 1rem; 
}

/* Unified embed class for case study iframes */
.case-embed { 
  width: 100%; 
  height: 520px; 
  border: 0; 
  border-radius: 8px; 
  display: block; 
 }

@media (min-width: 900px) {
  .case-embed { height: 680px; }
}

@media (min-width: 1200px) {
  .case-embed { height: 760px; }
}

/* Two-column layout for case studies on wider screens */

/* Keep case sections stacked with centered previews on all breakpoints */
.case-sections { 
  display: block; 
}
.pdf-viewer { 
  text-align: center; 
  margin-top: 2rem; 
}
.pdf-viewer .pdf-wrap iframe { 
  max-width: 100%; 
  /* allow .case-embed to control height for consistent previews */
}

@media (min-width: 1200px) {
  .case-sections { max-width: 740px; }
}
