/* 1. General Reset & Variable Definitions */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

:root {
  /* 2. Colour Palette - Light Mode (Cosmic Day) */
  --bg-color: #f0f4f8;
  --text-color: #0B0C10;
  --text-secondary: #4a4e57;
  --card-bg: #ffffff;
  --primary-accent: #45A29E;
  --primary-accent-hover: #367e7a;
  --shadow-color: rgba(0, 0, 0, 0.1);

  /* Typography */
  --font-main: 'Inter', sans-serif;
  --font-heading: 'Share Tech Mono', monospace;
  --overlay-bg: rgba(240, 244, 248, 0.7); /* Light overlay */
}

/* Colour Palette - Dark Mode (Cosmic Night) */
body.dark-mode {
  --bg-color: #0B0C10; /* Deep Space Black */
  --text-color: #C5C6C7; /* Starlight Silver */
  --text-secondary: #6c757d;
  --card-bg: #1F2833; /* Asteroid Gray */
  --primary-accent: #66FCF1; /* Hyperdrive Cyan */
  --primary-accent-hover: #45A29E;
  --shadow-color: rgba(102, 252, 241, 0.1);
  --overlay-bg: rgba(11, 12, 16, 0.6); /* Dark overlay */
}

/* 3. General Body & Layout Styles */
body {
  font-family: var(--font-main);
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
  --shadow-color: rgba(102, 252, 241, 0.1); /* testing for removal */ 
 }

/* Apply the heading font */
h1, h2, h3 {
  font-family: var(--font-heading);
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* 4. Hero Section & Navigation */
.hero {
 position: relative; /* Needed for absolute positioning of the image */
  overflow: hidden; /* Hides image overflow */
  display: flex;
  flex-direction: column; /* Stack intro and image vertically initially */
  align-items: center;
  justify-content: center; /* Center content vertically */
  min-height: 100vh; /* Ensure it takes full viewport height */
  padding: 20px;
  text-align: center; /* Center text by default */
}

/* New: Make the image an overlay background */
.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0; /* Place behind text */
  display: flex; /* Use flex to center the image itself */
  align-items: center;
  justify-content: center;
  overflow: hidden; /* Ensure image doesn't overflow its container */
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* This is key: crops and covers the area */
  object-position: center center; /* Centers the image within its bounds */
  filter: brightness(0.4) contrast(1.2); /* Adjust for mood and readability */
}

/* New: Ensure text is readable */
.hero .intro {
  position: relative; /* Bring text above the image */
  z-index: 1; /* Place above the image */
  background: var(--overlay-bg);
  backdrop-filter: blur(5px); /* Opt: Adds cool frosted-glass effect */
  padding: 30px;
  border-radius: 10px;
  max-width: 800px;
  text-align: center; /* Ensure text is centered within its own box */
}

/* Original intro styles - ensure z-index and text alignment */
.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 10px;
  color: var(--text-color); /* Ensure heading color is correct */
}

#tagline {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-secondary);
  min-height: 30px; /* prevents jump during typing */
  margin-bottom: 20px;
}

.elevator-pitch {
  margin-bottom: 30px;
  color: var(--text-color);
}

.main-nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.main-nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 600;
  transition: color 0.3s;
}

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

#dark-mode-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: var(--primary-accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, outline-offset 0.2s;
}

#dark-mode-btn:hover {
  background: var(--primary-accent-hover);
  outline-offset: 3px;
}

/* Accessibility: Focus state for button */
#dark-mode-btn:focus-visible {
  outline: 3px solid var(--primary-accent);
  outline-offset: 3px;
}

/* Media Query for larger screens: Revert to two columns if desired,
   or keep it centered over the image. For a background banner,
   keeping it centered usually works best.
*/
@media (min-width: 768px) {
  .hero {
    flex-direction: row; /* You can adjust this if you want the "intro" text to split side-by-side with something else on larger screens */
    /* For a full-width background banner, keeping flex-direction: column
       and centering the intro content works very well.
       If you want a side-by-side layout (intro on left, image on right),
       then you'd configure flex-direction: row here and adjust intro/image widths.
       For a banner, text over full-width image is generally preferred.
    */
  }
}



/* 5. Section & Content Styles */
section h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
  text-align: center;
}

section h3 {
  font-size: 1.5rem;
  margin-top: 20px;
  margin-bottom: 10px;
}

/* 6. Projects Grid & Cards */
.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.project-card {
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px var(--shadow-color);
  transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px var(--shadow-color);
}

.project-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.project-info {
  padding: 20px;
}

.project-info h3 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.3rem;
}

.project-info p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* 7. Footer */
footer {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  color: var(--text-secondary);
}

/* 8. Animation Keyframes (No longer used by project-card) */
@keyframes fadeInUp {
to {
  opacity: 1;
  transform: translateY(0);
}
}

/* 9. Skills Section */
.skills-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  text-align: center;
  margin-top: 30px;
}

.skill-category {
  flex: 1;
  min-width: 250px;
}

.skill-category h3 {
  margin-bottom: 15px;
  color: var(--primary-accent);
}

.skill-category ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.skill-category li {
  background: var(--card-bg);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.skill-category li:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 10. Project Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 600px;
  position: relative;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.modal-content h2 {
  margin-top: 0;
  margin-bottom: 15px;
}

.modal-content h3 {
  font-size: 1.1rem;
  margin-top: 20px;
  margin-bottom: 10px;
}

#modal-tech-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#modal-tech-list li {
  background: var(--bg-color);
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 0.9rem;
}

.modal-links {
  margin-top: 25px;
  display: flex;
  gap: 20px;
}

.modal-links a {
  display: inline-block;
  padding: 10px 20px;
  text-decoration: none;
  background: var(--primary-accent);
  color: #fff;
  border-radius: 6px;
  transition: background 0.3s;
}

.modal-links a:hover {
  background: var(--primary-accent-hover);
}

/* 11. Project Card Button */
.details-btn {
  display: inline-block;
  margin-top: 15px;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: var(--primary-accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.3s, transform 0.2s;
}

.details-btn:hover {
  background: var(--primary-accent-hover);
  transform: translateY(-2px);
}

.details-btn:focus-visible {
  outline: 3px solid var(--primary-accent);
  outline-offset: 2px;
}

/* 12. Resume/Experience Section */
.resume-timeline {
  position: relative;
  max-width: 750px;
  margin: 30px auto;
  padding-left: 20px;
  border-left: 3px solid var(--primary-accent);
}

.resume-item {
  margin-bottom: 30px;
  position: relative;
}

.resume-item::before {
  content: '';
  position: absolute;
  left: -31px;
  top: 5px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--bg-color);
  border: 3px solid var(--primary-accent);
}

.resume-item h3 {
  margin: 0;
  font-size: 1.4rem;
}

.resume-item h4 {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin: 5px 0;
}

.resume-dates {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--primary-accent);
  margin-bottom: 10px;
}

.resume-download {
  text-align: center;
  margin-top: 40px;
}

.btn {
  display: inline-block;
  padding: 12px 25px;
  background: var(--primary-accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  border-radius: 8px;
  transition: background 0.3s, transform 0.2s;
}

.btn:hover {
  background: var(--primary-accent-hover);
  transform: translateY(-3px);
}

/* 13. Contact Form */
.contact-intro {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 30px auto;
  color: var(--text-secondary);
}

#contact-form {
  max-width: 700px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 1rem;
  font-family: var(--font-main);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(0, 119, 255, 0.2);
}

#contact-form button[type="submit"] {
  width: 100%;
  border: none;
  font-size: 1.1rem;
}

/* 14. Scroll Animations */
.fade-in-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 15. Glow Effect for Links & Buttons */
.btn:hover,
.details-btn:hover,
.main-nav a:hover {
  box-shadow: 0 0 15px var(--primary-accent-hover);
  color: var(--primary-accent);
}
