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

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
  color: #484848;

  /* soft background */
  background: #ebf1f7;
}


/* ---- Header and Sticky nav ---- */
.site-header {
  position: sticky;
  top: 1.25rem;
  z-index: 100;

  /* glassy, lighter */
  background: rgba(255, 255, 255, 0.75);
  opacity: 0.8;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border-radius: 999px; /* pill shape */
  margin: 0 auto;
  width: fit-content;

  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.06),
    0 1px 2px rgba(0, 0, 0, 0.04);
}

/* ---- Nav ---- */
.nav {
  display: flex;
  justify-content: center;
  align-items: center;

  gap: 2.5rem;
  padding: 0.6rem 2rem;
}

.nav a {
  text-decoration: none;
  color: #484848;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 0;
  height: 1px; 
  background: #b93a32;
  transition: width 0.2s ease, left 0.2s ease;
}

.nav a:hover::after {
  width: 100%;
  left: 0;
}

/* Bootstrap icons on the nav */
.nav i{
  color: #836B4F;
}


/* ---- Main content ---- */
main {
  max-width: 1000px;
  margin: 0 auto;
}


/* Hero (top) section */
.hero {
  display: grid;
  position: relative;
  grid-template-columns: 60% 40%;
  min-height: 75vh;
  background-color: #faf5e6;
  text-align: center;
}

.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem;
}

.hero-text h2 {
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
  color: #c7a38f;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 4vw, 1.75rem);
  font-family: "Fraunces", serif;
  font-weight: 600;
  font-style: italic;
  color: #5F5E62;
  margin-bottom: 2rem;
  line-height: 1.45;
}

.hero-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: url("/img/sketch-updated.jpg");
    background-size: cover;
    background-position: 45% center;
}


/* About Me Section */
.about {
  display: grid;
  grid-template-columns: 1.86fr 1fr;  /* roughly 65/35 ratio */
  grid-template-rows: auto auto auto auto;
  gap: 4rem;
  padding: 2rem 1rem;  /* Add back some vertical padding */
  background-color: #DCE6F1;
  position: relative;
}

.about-content {
  padding: 4rem;
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.about-subtitle {
  font-family: "Fraunces", serif;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 600;
  color: #5F5E62;
  line-height: 1.45;
  padding-left: 1.25rem;
  border-left: 4px solid rgba(0,0,0,0.1);
}

.about-intro {
  grid-column: 1;
  grid-row: 1;
}

.about-image {
  grid-column: 2;
  grid-row: 1 / 3;
  background-image: url("/img/me_draw-sm.png");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center right;
}

.what-i-do {
  grid-column: 1;
  grid-row: 2;
}

.what-i-do-intro {
  font-family: "Fraunces", serif;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 600;
  color: #5F5E62;
  line-height: 1.45;
  padding-left: 1.25rem;
}

/* About section bottom row */
.cards {
  grid-column: 1 / -1;  /* span full width */
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem 0;
}

.card {
  flex: 0 0 33%;               /* each card takes ~33% of row */
  max-width: 275px;            /* optional: don’t let them stretch too wide */
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  background-color: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.card i {
  font-size: 2rem;
  color: #0061A3;
  margin-bottom: 0.5rem;
}

.card h4 {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.resume-section {
  grid-column: 1 / -1;  /* span full width of grid */
  grid-row: 4;
  display: grid;
  grid-template-columns: 1fr 1fr;  /* 50/50 split */
  gap: 4rem;
  background-color: #fff;
  padding: 1rem;
  border-radius: 12px;
}

.resume-section i {
  font-size: 2rem;
  color: #0061A3;
  margin-bottom: 0.5rem;
  margin-right: 0.75rem;
}

/* Skills list styling w/ separator */
.skill-category {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid rgba(0,0,0,0.1);
}

.skill-category:last-child {
  border-bottom: none;
}

.skill-category h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.skill-category p {
  font-size: 0.95rem;
}

/* Experience styling */
.job {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.job-meta {
  text-align: left;
}

.job-years {
  font-weight: 600;
  color: #484848;
  margin-bottom: 0.25rem;
}

.job-company {
  color: #6b7280;
  font-size: 0.9rem;
}

.job-title {
  color: #836B4F;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.job-description {
  color: #6b7280;
  font-size: 0.95rem;
}

.portfolio {
  padding: 2rem;
}

.project-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
}

.project-card {
  flex: 1 1 300px;
  max-width: calc(33.333% - 2rem);
  background: #faf7f2; /* warm paper tone */
  border-radius: 14px;
  padding: 1.25rem 1rem 1.5rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.project-card h3 {
  margin: 0;
  line-height: 1.25;
  text-align: center;
  overflow: hidden;
}

.project-card figure {
  margin: 0;
}

.project-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.project-image {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.project-links {
  margin-top: auto;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0,0,0,0.05);
}

.project-links a {
  font-size: 0.85rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: #e9e4da;
  color: #333;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.project-links a:hover {
  background: #ded7c8;
  transform: translateY(-1px);
}

.contact-section {
    padding: 2rem 1rem;
    background: #F9F2D9;
    background-image: url("/img/doodle.jpg");
    background-size: cover;
    background-position: 78% 40%;
    opacity: 0.8;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid #F4E1B1;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.contact-container {
    max-width: 600px;
    margin: 0 auto;
}

.contact-section h2 {
    margin-bottom: 10px;
    text-align: center;
}

.contact-intro {
  font-family: "Fraunces", serif;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 600;
  color: #5F5E62;
  line-height: 1.45;
  text-align: center;
  margin-bottom: 40px;
}

.contact-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #B93A32;
}

.form-group textarea {
    resize: vertical;
    min-height: 150px;
}

.form-button{
  display: flex;
  justify-content: center;
}

.contact-form button {
  background: #0061A3;
  color: #FFF;
  padding: 0.55rem 2.25rem;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: auto;

  box-shadow: 0 4px 12px rgba(0, 97, 163, 0.25);
  transition:
    background 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.contact-form button:hover:not(:disabled) {
  background: #004f86; /* darker, same hue */
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 97, 163, 0.35);
}

.contact-form button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 3px 8px rgba(0, 97, 163, 0.3);
}

.contact-form button:disabled {
  background: #8fa9bf;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.7;
}

.contact-form button:focus-visible {
  outline: 3px solid rgba(0, 97, 163, 0.4);
  outline-offset: 3px;
}

.message {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    padding-right: 40px; /* Make room for the X */
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
  padding: 0;
  line-height: 1;
}

.message-close:hover {
  opacity: 1;
}


/*--------------------------------- */
/* Sections section */
/*--------------------------------- */

/* anchor offset */
.section {
    scroll-margin-top: 8rem;
    background-repeat: no-repeat;
    border-radius: 1rem;
}

/* Space between sections */
.section + .section {
  margin-top: 3rem;
}

/*--------------------------------- */
/* ---- Typography ---- */
/*--------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: "Fraunces", serif;
  color: #836B4F;
}

h1 {
  font-size: clamp(2.7rem, 7vw, 4rem);
  font-weight: 900;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.015em;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  letter-spacing: -0.015em;
}

p {
  max-width: 65ch;
  font-size: 1rem;
  color: #4b5563;
}


/*--------------------------------- */
/* ---- Footer ---- */
/*--------------------------------- */
.site-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #ffffff;
    border-top: 1px solid #ddd;
    padding: 1.5rem 1.5rem;
    font-size: 0.8rem;
    color: #6b7280;
    opacity: 0.75;
}


/*--------------------------------- */
/* ---- Decorative elements ---- */
/*--------------------------------- */

/* coffee ring */
.hero::after {
  content: "";
  position: absolute;

  /* anchor near the column split */
  left: -4%;
  top: 85%;

  width: 320px;
  height: 320px;

  transform: translateX(-30%);

  background-image: url("/img/coffee-ring.png");
  background-size: contain;
  background-repeat: no-repeat;

  opacity: 0.5;
  pointer-events: none;
  /* let it overlap content */
  z-index: 10;
}

/* purple smudge */
.about::after {
  content: "";
  position: absolute;
  
  /* anchor on the right side */
  right: -15%;
  bottom: -15%;
  
  width: 350px;
  height: 350px;
  
  background-image: url("/img/purple-sm.png");
  background-size: contain;
  background-repeat: no-repeat;
  
  opacity: 0.7;
  pointer-events: none;
  z-index: -1;
}

/* Icon in hero section */
.book {
  width: 2rem;
  height: auto;
}


.term {
  font-weight: 700;
  color: #787878;
}

li {
  margin-bottom: 0.5rem;
}




/*--------------------------------- */
/* ---- Responsive Design ---- */
/*--------------------------------- */

/* Notes: No hamburger menu, nav looks good without */

@media (max-width: 768px) {
  /* Stack nav items if needed */
  .nav {
    gap: 1.5rem;
    padding: 0.6rem 1rem;
  }

  .hero {
    grid-template-columns: 1fr;
  }
  
  .hero-text {
    padding: 2rem 1.5rem;
  }
  
  .hero-image {
    min-height: 300px;
  }
  
  .about {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 2rem 1rem;
  }

  /* Reset grid rows for mobile - this is the key fix */
  .about-intro {
    grid-row: 1;
  }


  .about-image {
    grid-column: 1;
    grid-row: 2;
    min-height: 200px;  /* Reduced from 240px */
    max-height: 250px;  /* Add a max height to prevent it from being too tall */
    background-size: contain;  /* Already set, but ensuring it scales properly */
    background-position: center center;  /* Center it instead of center right */
    margin: 0 auto;  /* Center the div itself */
    margin-top: -1rem;  /* Reduce gap above */
    margin-bottom: -1rem;  /* Reduce gap below */
    width: 80%;  /* Make it a bit narrower so it doesn't take full width */
  }

  
  .what-i-do {
    grid-row: 3;
  }
  
  /* Fix cards flexbox for mobile */
  .cards {
    grid-row: 4;
    flex-direction: column;
    align-items: center;  /* Changed from stretch to center */
    padding: 1rem 1rem;  /* Add consistent padding */
  }
  
  .card {
    flex: 1 1 auto;
    max-width: 100%;
    width: 100%;  /* Ensure full width within padding */
  }
  
  /* Fix resume section grid for mobile */
  .resume-section {
    grid-row: 5; 
    grid-template-columns: 1fr;
    gap: 2rem;
    margin: 0 auto;  /* Center the section */
    width: 100%;
  }
  
  /* Fix project grid for mobile */
  .project-card {
    max-width: 100%;
    flex: 1 1 100%;
  }
  
  /* Adjust job layout for mobile */
  .job {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  
  .job-meta {
    margin-bottom: 0.5rem;
  }
  
  /* Hide background images on mobile */
  .hero::after,
  .about::after {
    display: none;
  }
}