@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=Merriweather:wght@400;700&display=swap');


:root {
  --primary-color-p3: color(display-p3 0.051 0.435 0.992);
  --primary-color: var(--primary-color-p3, #0d6efd); /* Uses P3, falls back to sRGB */
  --secondary-color: #6c757d;
  --bg-color: #ffffff;
  --text-color: #212529;
  --header-bg: #f8f9fa;
  --footer-bg: #212529;
  --footer-text: #f8f9fa;
  --font-primary: 'Roboto', sans-serif;
  --font-secondary: 'Merriweather', serif;
  
  /* Baseline feature (relative color syntax) */
  --primary-hover: oklch(from var(--primary-color) calc(l * 0.9) c h);
}

html {
  /* Use 62.5% to make 1rem = 10px, for easy math */
  font-size: 62.5%; 
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-primary, sans-serif);
  font-size: 1.6rem;
  line-height: 1.6;
  color: var(--text-color, #212529);
  background-color: var(--bg-color, #ffffff);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

main {
  flex-grow: 1; /* Pushes footer down */
  width: 90%; 
  max-width: 960px;
  margin: 2em auto;
  padding: 2em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-secondary, serif); 
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

h1 { font-size: 4.0rem; } 
h2 { font-size: 3.2rem; }
h3 { font-size: 2.4rem; }

p { margin-bottom: 1.5rem; }

a {
  color: var(--primary-color, #0d6efd);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

a:hover {
  color: var(--primary-hover, #0a58ca);
  text-decoration: underline;
}

img, picture {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}


header {
  background-color: var(--header-bg, #f8f9fa);
  padding: 1.5em 2em;
  border-bottom: 1px solid #dee2e6;
  
  nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5em;
    list-style: none;
    margin: 0;
    padding: 0;

    li a {
      font-family: var(--font-primary, sans-serif);
      font-weight: 700;
      font-size: 1.8rem;
      text-decoration: none;
      color: var(--secondary-color, #6c757d);
      padding: 0.5em;
      display: block;
      
      transition: transform 0.2s ease, color 0.2s ease;

      &:hover {
        color: var(--primary-color, #0d6efd);
        transform: translateY(-2px); 
      }

      i {
        font-style: normal;
        color: var(--primary-color, #0d6efd);
        border-bottom: 3px solid var(--primary-color, #0d6efd);
      }
    }
  }
}
        

footer {
  background-color: var(--footer-bg, #212529);
  color: var(--footer-text, #f8f9fa);
  padding: 2em;
  margin-top: auto; /* Pushes footer to bottom */
  
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 2em;
  
  div a {
    color: var(--footer-text, #f8f9fa);
    margin-left: 1.5em;
    font-weight: 700;
    transition: color 0.2s ease-in-out;
    
    &:hover {
      color: var(--primary-color, #0d6efd);

      text-decoration: underline;
    }
  }
}

form {
  display: grid;
  gap: 2rem;
}

fieldset {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 2rem;
  display: grid;
  gap: 1.5rem;
}

legend {
  font-size: 2rem;
  font-weight: 700;
  padding: 0 0.5em;
}

fieldset:has(input[required]) legend::after,
fieldset:has(textarea[required]) legend::after {
  content: ' *';
  color: #dc3545;
  font-weight: 700;
}

form label {
  font-weight: 700;
  display: block;
  margin-bottom: 0.5rem;
}

form input[type="text"],
form input[type="email"],
form textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: var(--font-primary, sans-serif);
  font-size: 1.6rem;
}

form textarea {
  min-height: 150px;
  resize: vertical;
}
        
button,
input[type="submit"] {
  background-color: var(--primary-color, #0d6efd);
  color: white;
  border: none;
  padding: 1.2rem 2.4rem;
  font-size: 1.6rem;
  font-weight: 700;
  border-radius: 5px;
  cursor: pointer;
  
  transition: background-color 0.2s ease-in-out, transform 0.2s ease;
}

button:hover,
input[type="submit"]:hover {
  background-color: var(--primary-hover, #0a58ca); 
  transform: scale(1.03); 
}
        
/* Home Page */
main:has(> project-card) {
  display: grid;
  grid-template-columns: 2fr 1fr; /* 2/3 left col, 1/3 right col */
  grid-template-areas:
    "hero    hero"
    "summary right";
  gap: 2rem 3rem;
}

/* First section (Hero: H1 + H2 + Pic) */
main:has(> project-card) > section:nth-of-type(1) {
  grid-area: hero;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0;
}

/*Moves the <picture> element to the top of the flex container */
main:has(> project-card) > section:nth-of-type(1) picture {
  order: 1; /* Show first */
  margin-bottom: 1em;
}

/* Style the circular profile picture */
main:has(> project-card) > section:nth-of-type(1) picture img {
  border-radius: 50%;
  width: 15rem; 
  height: 15rem;
  object-fit: cover;
  border: 3px solid var(--primary-color, #0d6efd);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Styling for H1 (my name) */
main:has(> project-card) > section:nth-of-type(1) h1 {
  order: 2; 
  text-align: center;
  line-height: 1.3;
  margin-bottom: 0.25em;
  animation: fadeInUp 0.8s ease;
}

/* Styling for H2 ("Software Engineer") */
main:has(> project-card) > section:nth-of-type(1) h2 {
  order: 3; 
  text-align: center;
  font-size: 2.2rem; 
  font-family: var(--font-primary, sans-serif);
  font-weight: 400; 
  color: var(--secondary-color, #6c757d); 
  margin: 0; 
}

/* Second section (Summary) */
main:has(> project-card) > section:nth-of-type(2) {
  grid-area: summary;
  margin-top: 0;
}

/* Third element (Project Card) */
main:has(> project-card) > project-card {
  grid-area: right;
  margin-top: 0;
  align-self: start;
}
 
/* Resume Page */
#resume-frame {
  width: 100%;
  height: 80dvh; 
  border: 1px solid #ccc;
  border-radius: 8px;
}
        
/* Experience Page */
progress {
  width: 100%;
  height: 2.5rem;
  accent-color: var(--primary-color, #0d6efd);
}
        


@scope (project-card) {
  :scope {
    display: block;
    border: 1px solid #dee2e6;
    padding: 2em;
    margin-top: 1.5em;
    border-radius: 8px;
    background-color: var(--header-bg, #f8f9fa);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
  }
  :scope:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  }
  h3 {
    margin-top: 0;
    color: color-mix(in srgb, var(--primary-color, #0d6efd) 75%, var(--text-color, #212529));
  }
}
        
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
        

@media (max-width: 768px) {
  html {
    font-size: 56.25%; /* 1rem = 9px */
  }
  
  main {
    width: 95%;
    padding: 1.5em;
  }
  
  /* Stack navigation on mobile */
  header nav ul {
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
  }
  
  main:has(> project-card) {
    display: block; /* Reverts the 2-column grid to a single column for small screens*/
  }

  /* Stack footer on mobile */
  footer {
    flex-direction: column;
    text-align: center;
    gap: 1.5em;
    
    div {
      display: flex;
      flex-direction: column;
      gap: 1em;
      
      a {
        margin-left: 0;
      }
    }
  }
  
  /* Make profile picture smaller on mobile */
  picture img {
    /* Using max-width instead of fixed width for better responsiveness */
    max-width: 150px;
  }
}
        
@media (max-width: 480px) {
  h1 { font-size: 3.2rem; }
  h2 { font-size: 2.8rem; }
  
  /* Stack form elements on very small screens */
  form,
  fieldset {
    display: flex;
    flex-direction: column;
  }
}