:root {

  --primary-color: #004494;

  --secondary-color: #6c757d;

  --background-color: #ffffff;

  --surface-color: #ffffff;

  --text-color: #212529;

  --text-color-light: #495057;

  --border-color: #dee2e6;

  --shadow-color: rgba(0, 0, 0, 0.1);

  /* ========================================
     TYPOGRAPHY
     ======================================== */

  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --font-size-base: 1rem;
  /* Typically defaults to 16px */

  --line-height-base: 1.5;
  --font-weight-normal: 400;
  --font-weight-bold: 700;

  /* ========================================
     SPACING & LAYOUT
     ======================================== */

  --spacing-unit: 1rem;

  --container-width: 1140px;

  --border-radius: 0.25rem;
}

html[data-theme='dark'] {

  --primary-color: #4dabf7;

  --secondary-color: #adb5bd;

  --background-color: #121212;

  --surface-color: #1e1e1e;

  --text-color: #e9ecef;

  --text-color-light: #ced4da;

  --border-color: #343a40;

  --shadow-color: rgba(255, 255, 255, 0.05);
}


/* CSS RESET */

*,
*::before,
*::after {
  box-sizing: border-box;
}


* {
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

#root,
#__next {
  isolation: isolate;
}

/*
  ========================================
  BASE STYLES
  ========================================

*/

body {

  font-family: var(--font-family-base);


  font-size: var(--font-size-base);


  line-height: var(--line-height-base);


  color: var(--text-color);


  background-color: var(--background-color);

  transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}


/*
  ========================================
  HEADER & NAVIGATION
  ========================================

*/

header {

  background-color: var(--surface-color);

  box-shadow: 0 2px 4px var(--shadow-color);

  padding: var(--spacing-unit) 0;

  position: sticky;
  top: 0;
  z-index: 100;

  transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}


header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* We also apply our max-width and centering here. */
  max-width: var(--container-width);
  margin: 0 auto;
  /* Centers the container horizontally */
  padding: 0 var(--spacing-unit);
  /* Adds padding on the sides for smaller screens */
}


header nav ul {

  display: flex;


  gap: calc(var(--spacing-unit) * 2);


  list-style: none;
}


header nav ul li a {

  text-decoration: none;


  color: var(--text-color);


  font-weight: var(--font-weight-bold);


  padding: 0.5rem;

  transition: color 0.3s ease-in-out;
}

header nav ul li a:hover {
  color: var(--primary-color);
}

/*
  ========================================
  MENU TOGGLE (HAMBURGER)
  ========================================

*/

.menu-toggle {
  display: none;

  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;

  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 24px;
}

.menu-toggle .bar {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--text-color);
  border-radius: 3px;


  transition: all 0.3s ease-in-out;
}


/*
  ========================================
  THEME SWITCHER
  ========================================
  
*/

.theme-switcher {
  display: flex;
  align-items: center;
}

.switch-label {

  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
  cursor: pointer;
}

.switch-checkbox {

  opacity: 0;
  width: 0;
  height: 0;
}

.slider {

  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 26px;
  transition: background-color 0.4s;
}

.slider::before {

  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.4s;
}


.switch-checkbox:checked+.slider {
  background-color: var(--primary-color);
}

.switch-checkbox:checked+.slider::before {
  transform: translateX(24px);
}


/*
  ========================================
  HERO SECTION
  ========================================
*/

#hero {

  min-height: 90vh;


  display: flex;
  align-items: center;
  justify-content: center;


  padding: calc(var(--spacing-unit) * 2) 0;
}

#hero .container {

  text-align: center;
}

#hero h1 {

  font-size: 3.5rem;
  /* ~56px */
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-unit);
}

#hero .hero-subtitle {

  font-size: 1.5rem;
  margin-bottom: calc(var(--spacing-unit) * 2);
  color: var(--text-color-light);
}

#hero p:last-of-type {

  max-width: 600px;

  margin: 0 auto;
}


/*
  ========================================
  ABOUT SECTION
  ========================================
 
*/

#about {

  padding: calc(var(--spacing-unit) * 4) 0;
}

#about h2 {

  text-align: center;
  margin-bottom: calc(var(--spacing-unit) * 3);
}

.about-content {

  display: flex;

  align-items: center;


  gap: calc(var(--spacing-unit) * 4);
}

.about-image {

  flex: 1;
  max-width: 300px;
}

.about-image img {

  max-width: 100%;


  height: auto;


  border-radius: 50%;


  box-shadow: 0 4px 15px var(--shadow-color);
}

.about-text {

  flex: 2;
}

.about-text p {

  margin-bottom: var(--spacing-unit);
}


.about-text p:last-child {
  margin-bottom: 0;
}


/*
  ========================================
  PROJECTS SECTION
  ========================================
  
*/

#projects {

  padding: calc(var(--spacing-unit) * 4) 0;

  background-color: var(--background-color);
}


#projects h2 {

  text-align: center;
  margin-bottom: calc(var(--spacing-unit) * 3);

}

.projects-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--spacing-unit) * 2);
}


/* === The Project Card Component === */

.project-card {

  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 8px var(--shadow-color);
  overflow: hidden;

  transition: background-color 0.3s ease-in-out, border-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.project-image {

  width: 100%;


  display: block;
}

.project-info {

  padding: calc(var(--spacing-unit) * 1.5);
}

.project-info h3 {

  margin-bottom: var(--spacing-unit);
}

.project-links {

  padding: 0 calc(var(--spacing-unit) * 1.5) calc(var(--spacing-unit) * 1.5);
  display: flex;
  gap: var(--spacing-unit);
}

.project-links a {

  display: inline-block;
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  border-radius: var(--border-radius);
  background-color: var(--primary-color);
  color: var(--surface-color);

  transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
}

.project-links a:hover {
  filter: brightness(90%);
}


.project-links a:last-child {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);

  transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out, border-color 0.3s ease-in-out;
}

.project-links a:last-child:hover {
  background-color: var(--primary-color);
  color: var(--surface-color);
  filter: none;
  /* Reset filter for this specific hover state */
}

/*
  ========================================
  CONTACT SECTION
  ========================================
  
*/

#contact {

  padding: calc(var(--spacing-unit) * 4) 0;
}

#contact .container>h2,
#contact .container>p {

  text-align: center;
}

#contact .container>p {

  margin-bottom: calc(var(--spacing-unit) * 3);

  max-width: 600px;

  margin-left: auto;
  margin-right: auto;
}

/* === Form Element Styling === */

#contact form {

  max-width: 700px;

  margin: 0 auto;
}

#contact label {

  display: block;

  font-weight: var(--font-weight-bold);

  margin-bottom: 0.5rem;
}

#contact input[type="text"],
#contact input[type="email"],
#contact textarea {

  width: 100%;

  padding: calc(var(--spacing-unit) * 0.75);

  margin-bottom: calc(var(--spacing-unit) * 1.5);


  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);


  background-color: var(--surface-color);


  font-family: inherit;
  font-size: inherit;
  color: var(--text-color);


  transition: border-color 0.2s ease-in-out,
    box-shadow 0.2s ease-in-out,
    background-color 0.3s ease-in-out,
    color 0.3s ease-in-out;
}


#contact textarea {
  resize: vertical;
  min-height: 150px;
}

/*
  The :focus pseudo-class is CRUCIAL for accessibility and user experience.
  It provides a clear visual indicator of which field the user is currently editing.
*/
#contact input[type="text"]:focus,
#contact input[type="email"]:focus,
#contact textarea:focus {

  outline: none;

  border-color: var(--primary-color);

  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

#contact button[type="submit"] {

  display: block;
  width: 100%;


  padding: var(--spacing-unit);


  border: none;
  border-radius: var(--border-radius);


  background-color: var(--primary-color);
  color: var(--surface-color);


  font-size: 1.1rem;
  font-weight: var(--font-weight-bold);


  cursor: pointer;


  transition: filter 0.2s ease-in-out, background-color 0.3s ease-in-out;
}

#contact button[type="submit"]:hover {
  filter: brightness(90%);
}

#contact button[type="submit"]:hover {

  filter: brightness(90%);
}


/*
  ========================================
  FOOTER SECTION
  ========================================
 
*/

footer {

  background-color: var(--surface-color);


  padding: calc(var(--spacing-unit) * 2) 0;


  border-top: 1px solid var(--border-color);


  color: var(--text-color-light);


  text-align: center;
}


footer .container {
  display: flex;


  justify-content: space-between;


  align-items: center;


  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-unit);

  transition: background-color 0.3s ease-in-out, border-top-color 0.3s ease-in-out, color 0.3s ease-in-out;
}


footer ul {

  display: flex;


  gap: var(--spacing-unit);


  list-style: none;
}


footer ul li a {

  text-decoration: none;


  color: var(--text-color-light);


  transition: color 0.2s ease-in-out;
}

footer ul li a:hover {
  color: var(--primary-color);
}


footer ul li a:hover {

  color: var(--primary-color);
}


/*
  ========================================
  RESPONSIVE STYLES - MEDIA QUERIES
  ========================================
  
*/

@media (max-width: 768px) {

  /* === Typography Adjustments === */
  #hero h1 {
    font-size: 2.8rem;
    /* Down from 3.5rem */
  }

  #hero .hero-subtitle {
    font-size: 1.25rem;
    /* Down from 1.5rem */
  }

  /* === Layout Adjustments === */
  .about-content {
    flex-direction: column;

    gap: calc(var(--spacing-unit) * 3);
  }

  .about-image {
    max-width: 250px;
    margin: 0 auto;
  }

  .projects-container {
    grid-template-columns: repeat(2, 1fr);
  }

  /* === Header Adjustments for Tablets === */
  header nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

}

@media (max-width: 480px) {

  /* === Layout Adjustments === */
  .projects-container {
    grid-template-columns: 1fr;
  }

  header .container {
    flex-direction: column;
    gap: var(--spacing-unit);
  }

  /* === Typography Adjustments === */

  #hero h1 {
    font-size: 2.2rem;
    /* Down from 2.8rem on tablet */
  }

  #hero .hero-subtitle {
    font-size: 1.1rem;
    /* Down from 1.25rem on tablet */
  }

  /* === Spacing Adjustments === */

  #about,
  #projects,
  #contact {
    padding: calc(var(--spacing-unit) * 2) 0;
  }

  .menu-toggle {
    padding: 0.5rem;
    /* Adds 8px of tappable space on all sides */
  }

  .project-links a {
    padding: 0.75rem 1.25rem;
    /* Increased from 0.5rem 1rem */
    font-size: 1rem;
    /* Ensure font size is consistently readable */
  }

  s footer ul {
    gap: calc(var(--spacing-unit) * 1.5);
    /* Increase the space between links */
  }

  footer ul li a {
    padding: 0.4rem;
    /* Add padding to create a larger tap target */
  }


}