/*
====================================================================
  Kevin Ngo Portfolio Stylesheet
====================================================================
  A modern dark‑themed layout with forest green accents. The design 
  adapts responsively for desktop and mobile devices and includes a 
  sliding mobile navigation. All colors are defined as CSS variables 
  for easy adjustment.
====================================================================
*/

/* ============================================================
   1. CSS VARIABLES & ROOT STYLES
   ============================================================ */
:root {
  --bg-color: #000000;      /* primary background (pure black) */
  --surface-color: #0a0d0a; /* card and section backgrounds (slightly lighter) */
  --text-color: #e5e5e5;    /* primary text color */
  --muted-text: #a0a0a0;    /* muted text color */
  --accent: #16764C;        /* brighter green accent */
  --accent-light: #1fa96a;  /* lighter green for hover */
  --error-color: #c62828;    /* red for form errors */
  --nav-height: 70px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
}

/* ============================================================
   2. GLOBAL RESETS & BASE STYLES
   ============================================================ */
html {
  scroll-behavior: smooth;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

ul {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: var(--accent-light);
}

/* ============================================================
   3. ACCESSIBILITY - SKIP NAVIGATION
   ============================================================ */
.skip-nav {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--accent);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 9999;
  border-radius: 0 0 4px 4px;
  font-weight: 600;
  transition: top 0.3s;
}

.skip-nav:focus {
  top: 0;
  color: white;
}

/* ============================================================
   4. HEADER NAVIGATION
   ============================================================ */
.header {
  width: 100%;
  height: var(--nav-height);
  background-color: var(--bg-color);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
}

.header__container {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo img {
  height: 40px;
  width: auto;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header__links {
  display: flex;
  gap: 1.5rem;
}

.header__links li a {
  font-size: 1rem;
  font-weight: 500;
  padding: 0.25rem 0;
  position: relative;
}

/* Style the resume link differently to resemble a button */
.header__links li.resume-link a {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background-color: var(--accent);
  color: #fff;
  transition: background-color 0.3s, color 0.3s;
}

.header__links li.resume-link a:hover {
  background-color: #01201A;
  color: #fff;
}

/* underline effect */
.header__links li a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

.header__links li a:hover::after {
  width: 100%;
}

.header__toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
}

.header__toggle span {
  display: block;
  height: 3px;
  background-color: var(--text-color);
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* ============================================================
   5. MOBILE NAVIGATION
   ============================================================ */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 80vw;
  max-width: 320px;
  height: 100vh;
  background-color: var(--surface-color);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 1200;
  display: flex;
  flex-direction: column;
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  height: var(--nav-height);
}

.mobile-menu__logo {
  height: 36px;
  width: auto;
}

.mobile-menu__close {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
}

.mobile-menu__nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.mobile-menu__nav li a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--text-color);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 1rem;
}

.mobile-menu__nav li a:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

/* ============================================================
   6. HERO SECTION
   ============================================================ */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 40vh;
  margin-top: var(--nav-height);
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  transform: none;
  object-fit: cover;
  opacity: 0.4;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.hero__text {
  flex: 1 1 320px;
  max-width: 60%;
}

.hero__text h1 {
  font-size: 2.75rem;
  font-weight: 700;
  margin-bottom: -0.4rem;
}

.hero__text p {
  font-size: 1.25rem;
  color: var(--muted-text);
  margin-bottom: 1.5rem;
}

.hero__icons {
  display: flex;
  gap: 1rem;
}

.hero__icons a {
  background-color: var(--surface-color);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.hero__icons a:hover {
  background-color: var(--accent);
  color: #fff;
}

.hero__image {
  flex: 1 1 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__image img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--accent);
}

/* ============================================================
   7. GENERAL SECTION STYLES
   ============================================================ */
section {
  padding: 4rem 0;
}

.section__container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  position: relative;
}

h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 50px;
  height: 3px;
  background-color: var(--accent);
}

.about p {
  margin-bottom: 1rem;
  color: var(--muted-text);
  line-height: 1.8;
}

/* ============================================================
   8. PROJECTS SECTION
   ============================================================ */
/* Subtle card hover effects for interactivity */
.project-card:hover, .expertise-card:hover {
  box-shadow: 0 4px 24px rgba(22, 118, 76, 0.15);
  transform: translateY(-7px) scale(1.03);
  border-color: var(--accent);
}
.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.expertise-card__icon {
  transition: transform 0.2s ease;
}
.expertise-card:hover .expertise-card__icon {
  transform: scale(1.1);
}


.project-card {
  background-color: var(--surface-color);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
}

/* Project image */
.project-image-wrapper {
  width: 100%;
  height: 160px;
  overflow: hidden;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.project-card p {
  flex-grow: 1;
  font-size: 0.9rem;
  color: var(--muted-text);
  margin-bottom: 1rem;
}

.project-card .project-meta {
  font-size: 0.8rem;
  color: var(--muted-text);
  margin-bottom: 0.75rem;
}

.project-card a.project-link {
  align-self: flex-start;
  color: var(--accent);
  font-weight: 600;
  transition: color 0.3s ease;
}

.project-card a.project-link:hover {
  color: var(--accent-light);
}

/* ============================================================
   9. CONTACT SECTION
   ============================================================ */
.contact p {
  margin-bottom: 1.5rem;
  color: var(--muted-text);
}

.contact__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
}

.contact__field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact__field label {
  font-size: 0.9rem;
  color: var(--text-color);
}

.contact__field input,
.contact__field textarea {
  background-color: var(--surface-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  color: var(--text-color);
  font-size: 0.9rem;
  resize: vertical;
}

.contact__field input:focus,
.contact__field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact__submit {
  align-self: flex-start;
  background-color: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: background-color 0.3s, color 0.3s;
}

.contact__submit:hover {
  background-color: #01201A;
  color: #fff;
  border: 1px solid var(--accent);
}

.contact__submit::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

.contact__submit:hover::after {
  width: 100%;
}

.contact__status {
  /* Contact form feedback styles */
  font-size: 1rem;
  margin-top: 0.75rem;
  color: #16764C;
  font-weight: 600;
  transition: color 0.2s;
}
.contact__status.error {
  color: #c62828;
}

/* ============================================================
   10. FOOTER
   ============================================================ */
.footer {
  background-color: var(--surface-color);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 1.5rem 0;
}

.footer__container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer__socials {
  display: flex;
  gap: 0.75rem;
}

.footer__socials a {
  background-color: var(--surface-color);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.footer__socials a:hover {
  background-color: var(--accent);
  color: #fff;
}

/* ============================================================
   11. RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 900px) {
  .hero__content {
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 0.5rem;
  }
  .hero__text,
  .hero__image {
    max-width: 100%;
    flex: 1 1 100%;
    text-align: center;
  }
  .hero__text {
    margin-bottom: 1rem; /* Reduced margin to bring image closer */
    font-size: 1.1rem;
    order: 1; /* Title and tagline first */
  }
  .hero__image {
    order: 2; /* Image second */
    margin-bottom: 1.5rem; /* Space between image and icons */
  }
  .hero__icons {
    order: 3; /* Icons last */
    justify-content: center;
    gap: 1.25rem;
    margin-top: 0; /* Remove any inherited margin */
  }
  .hero__text h1 {
    font-size: 2rem;
  }
  .hero__text p {
    font-size: 1rem;
    margin-bottom: 0; /* Remove margin since icons are now separate */
  }
  .hero__icons a {
    width: 38px;
    height: 38px;
  }
  .hero__image img {
    width: 120px; /* Slightly larger for better mobile viewing */
    height: 120px;
  }
  .projects__grid,
  .expertise__cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .project-card,
  .expertise-card {
    padding: 1rem;
  }
  section {
    padding: 2rem 0;
  }
}

@media (max-width: 768px) {
  .header__nav {
    display: none;
  }
  .header__toggle {
    display: flex;
  }
  
  /* Center footer content on mobile */
  .footer__container {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }
  
  /* Center section headers on mobile */
  h2 {
    text-align: center;
  }
  
  h2::after {
    left: 50%;
    transform: translateX(-50%);
  }
  
  /* Center contact form button and paragraph on mobile */
  .contact__submit {
    align-self: center;
  }
  
  .contact p {
    text-align: center;
  }
  
  /* Center all section icons on mobile */
  .expertise-card__icon {
    align-self: center;
  }
  
  .education__icon {
    align-self: center;
  }
  
  .project-card__icon {
    align-self: center;
  }
  
  /* Center all card headers and content on mobile */
  .expertise-card h3,
  .project-card h3,
  .timeline-card h3,
  .timeline-card h4,
  .education__content h3,
  .education__content h4 {
    text-align: center;
  }
  
  /* Center all card paragraph text on mobile */
  .expertise-card p,
  .project-card p,
  .timeline-card p,
  .education__content p {
    text-align: center;
  }
  
  /* Center tech lists on mobile */
  .tech-list {
    justify-content: center;
  }
  
  /* Center project metadata and links */
  .project-meta,
  .project-link,
  .education__meta {
    text-align: center;
  }
  
  /* Center project links container and individual links */
  .project-card > div:last-child {
    justify-content: center;
  }
  
  .project-card a.project-link {
    align-self: center;
  }
}

@media (max-width: 500px) {
  .hero__text h1 {
    font-size: 2.2rem;
  }
  .hero__text p {
    font-size: 1rem;
  }
  
  /* Extra small screen timeline adjustments */
  .timeline-item {
    padding-left: 45px;
  }
  
  .timeline-icon {
    width: 32px;
    height: 32px;
  }
  
  .timeline-card {
    padding: 1rem;
  }
  
  .timeline-card h3 {
    font-size: 0.95rem;
  }
  
  .timeline-card h4 {
    font-size: 0.8rem;
  }
  
  .timeline-card p {
    font-size: 0.75rem;
  }
}

/* ============================================================
   12. EXPERTISE SECTION
   ============================================================
   The expertise cards display areas of focus with an icon, title,
   description and a list of technologies. Cards are laid out in a
   responsive grid with tech pills highlighting individual items.
   ============================================================ */
.expertise__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.expertise-card {
  background-color: var(--surface-color);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  color: var(--text-color);
  transition: transform 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
}

.expertise-card__icon {
  color: var(--accent);
  margin-bottom: 1rem;
  transition: transform 0.2s ease;
}

.expertise-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.expertise-card p {
  font-size: 0.9rem;
  color: var(--muted-text);
  line-height: 1.6;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.tech-list span {
  font-size: 0.75rem;
  padding: 0.2rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--accent);
  color: var(--accent);
  white-space: nowrap;
}

/* ============================================================
   13. EXPERIENCE TIMELINE
   ============================================================
   A vertical timeline down the center of the page with alternating
   content panels. Each entry contains a card with job details,
   a date/location label, and a circular icon.
   ============================================================ */
.timeline {
  position: relative;
  margin-top: 2rem;
  padding: 2rem 0;
}

/* Central line */
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background-color: var(--accent);
  transform: translateX(-50%);
}

/* Each timeline row uses a three‑column grid: left content/date,
   middle icon, right content/date. */
.timeline-item {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 2rem 0;
  position: relative;
}

/* Circular icon positioned in the center column */
.timeline-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  z-index: 1;
}

/* Date/location label */
.timeline-date {
  /*
   * Adjust the appearance of the date/location labels in the timeline.
   * The original design used very small, low‑contrast text that could
   * look misaligned. Increase the font size slightly and use a
   * lighter colour so the label is legible against the dark
   * background. Reduce padding to bring it closer to the central line
   * for better alignment with the cards.
   */
  font-size: 0.85rem;
  color: #9aa99e; /* soft green‑grey that complements the accent */
  line-height: 1.4;
  padding: 0 0.5rem;
}

/* Content card */
.timeline-card {
  background-color: var(--surface-color);
  color: var(--text-color);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: 18px;
  margin-right: 18px;
}

/* Orientation: left entries (card on left, date on right) */
.timeline-item.left .timeline-card {
  order: 1;
}
.timeline-item.left .timeline-icon {
  order: 2;
}
.timeline-item.left .timeline-date {
  order: 3;
  text-align: left;
}

/* Orientation: right entries (card on right, date on left) */
.timeline-item.right .timeline-date {
  order: 1;
  text-align: right;
}
.timeline-item.right .timeline-icon {
  order: 2;
}
.timeline-item.right .timeline-card {
  order: 3;
}

.timeline-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text-color);
}

.timeline-card h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--accent);
  font-style: italic;
}

/* Specific color override for Sight Studio LLC heading */
.timeline-card h4.sight-studio {
  color: #01201A !important;
}

.timeline-card p {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted-text);
}

/* ============================================================
   14. EDUCATION SECTION
   ============================================================
   The education section uses a simple card layout with an icon
   and text content arranged side by side on larger screens
   and stacked on smaller devices.
   ============================================================ */
.education__item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  /* Use a subtle border on the left to tie the card into the theme */
  border-left: 4px solid var(--accent);
  background-color: var(--surface-color);
  padding: 1.5rem 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.education__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  padding-top: 6px;
}

.education__content h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  /* Use the same primary text colour as the rest of the site */
  color: var(--text-color);
}

.education__content h4 {
  margin: 0.2rem 0 0.6rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  font-style: italic;
}

.education__content p {
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  line-height: 1.5;
  /* Use muted text for body content */
  color: var(--muted-text);
}

.education__meta {
  font-size: 0.85rem;
  color: var(--muted-text);
}

@media (max-width: 768px) {
  .education__item {
    flex-direction: column;
    align-items: stretch;
  }
  .education__icon {
    margin-bottom: 1rem;
  }
  
  /* ============================================================
     MOBILE TIMELINE OPTIMIZATION
     ============================================================ */
  
  /* Move timeline line to the left for single-column layout */
  .timeline::before {
    left: 20px;
    transform: none;
  }
  
  /* Convert to single-column layout */
  .timeline-item {
    display: flex;
    flex-direction: column;
    margin: 1.5rem 0;
    padding-left: 50px;
    position: relative;
  }
  
  /* Position icon on the left */
  .timeline-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 36px;
    height: 36px;
    z-index: 2;
  }
  
  /* Reset card positioning for single column - cards always come first */
  .timeline-item.left .timeline-card,
  .timeline-item.right .timeline-card {
    order: 1;
    margin: 0;
    width: 100%;
  }
  
  /* Stack date below card for better readability - dates always come second */
  .timeline-item.left .timeline-date,
  .timeline-item.right .timeline-date {
    order: 2;
    text-align: left;
    padding: 0;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--muted-text);
  }
  
  /* Adjust card spacing */
  .timeline-card {
    padding: 1.25rem;
    margin-bottom: 0.5rem;
  }
  
  /* Smaller text on mobile */
  .timeline-card h3 {
    font-size: 1rem;
  }
  
  .timeline-card h4 {
    font-size: 0.85rem;
  }
  
  .timeline-card p {
    font-size: 0.8rem;
    line-height: 1.4;
  }
}

/* Prevent the vertical line from the timeline in the Work Experience section
   from spilling into subsequent sections. By setting overflow to hidden on
   the experience section, the pseudo-element that draws the central line
   is clipped at the bottom of the section. */
.experience {
  overflow: hidden;
}

/* ============================================================
   15. PROJECT CARD ICONS
   ============================================================ */
.project-card__icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.project-card__icon svg {
  width: 40px;
  height: 40px;
  display: block;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: transform 0.2s ease;
}

.project-card:hover .project-card__icon svg {
  transform: scale(1.1);
}

/* Optional soft circular badge behind icon */
.project-card__icon--badge {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: rgba(0,255,140,0.08);
  backdrop-filter: blur(2px);
  box-shadow: 0 0 0 1px rgba(0,255,140,0.15) inset;
  /* Add space for tech badges */
  position: relative;
}

.tech-list {
  margin-bottom: 0.75rem;
}
