/*
 * Global styles for Ben Boyer's portfolio website.
 * This stylesheet defines the colour palette, typography and layout
 * rules used across the site. It embraces a modern, minimalist
 * aesthetic with industrial undertones as recommended by design
 * research. Colours are neutral with a deep blue accent and fonts
 * blend geometric rigidity (Montserrat) with friendly readability
 * (Open Sans). Responsiveness is baked in via flexible units and
 * media queries.
 */

/* Colour palette variables */
:root {
  /* Neutral background and text colours */
  --colour-bg: #f8f9fa;
  --colour-dark: #1f2937;
  --colour-mid: #4b5563;
  --colour-light: #ffffff;
  /* Accent: a calm, trustworthy blue reminiscent of engineering and
     aerospace, inspired by research highlighting the reliability of
     blues for technology and construction sectors【952643382130758†L93-L104】. */
  --colour-accent: #0f4c81;
  --colour-accent-light: #e8f2fb;
  /* Shadow for subtle depth */
  --shadow-colour: rgba(0, 0, 0, 0.05);
  --colour-complete: rgba(30, 255, 50, 0.3);
}

/* Reset and base typography */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Open Sans', sans-serif;
  color: var(--colour-dark);
  background-color: var(--colour-bg);
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  color: var(--colour-dark);
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--colour-mid);
}

a {
  color: inherit;
  text-decoration: none;
}

/* Container utility */
.container {
  width: 90%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero Section */
.hero {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: 3rem 0;
  background-color: var(--colour-bg);
}

.hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero__content {
  flex: 1 1 500px;
  max-width: 600px;
}

.hero__heading {
  font-size: 2.75rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.hero__subheading {
  font-size: 1.125rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  max-width: 40em;
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Button styles */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 500;
  border-radius: 0.375rem;
  transition: background-color 0.3s ease, color 0.3s ease,
    box-shadow 0.3s ease;
  border: 2px solid transparent;
}

.btn--primary {
  background-color: var(--colour-accent);
  color: var(--colour-light);
}

/* Primary button hover styles are defined at the bottom of the file,
 * using a custom accent dark variable. Remove unsupported darken()
 * function here to avoid CSS errors. */

.btn--secondary {
  background-color: var(--colour-accent-light);
  color: var(--colour-accent);
  border-color: var(--colour-accent);
}

/* DEPRACATED
.btn--secondary:hover,
.btn--secondary:focus {
  background-color: var(--colour-accent);
  color: var(--colour-light);
  box-shadow: 0 4px 6px var(--shadow-colour);
}
*/

/* Hero Image */
.hero__image-wrapper {
  flex: 1 1 400px;
  max-width: 500px;
  text-align: center;
}

.hero__image {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  object-fit: cover;
  box-shadow: 0 2px 8px var(--shadow-colour);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
  .hero__inner {
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
  .hero__content {
    max-width: none;
    flex-basis: auto;
  }
  .hero__heading {
    font-size: 2.25rem;
  }
  .hero__subheading {
    font-size: 1rem;
    max-width: none;
  }
  .hero__actions {
    justify-content: center;
  }
  .hero__image-wrapper {
    margin-top: 2rem;
    max-width: none;
  }
}

/* Utility for darken function using filter (for browsers without CSS variables). */
/* Note: CSS native darken isn't widely supported; this placeholder
 * fallback uses filter for demonstration. It could be replaced with
 * preprocessed SCSS or manually selected colours. */

/* Use CSS custom properties for darkened accent: */
:root {
  --colour-accent-dark: #0a385e;
}

.btn--primary:hover,
.btn--primary:focus {
  /* Use the darker accent colour on hover/focus for better contrast */
  background-color: var(--colour-accent-dark);
  box-shadow: 0 4px 6px var(--shadow-colour);
}

/* ------------------------------------------------------------ */
/* Header / Navigation */
/* ------------------------------------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  width: 100%;
  background-color: var(--colour-bg);
  border-bottom: 1px solid #e5e7eb;
  z-index: 100;
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.site-logo {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--colour-dark);
}

.site-nav .nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  color: var(--colour-mid);
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link:focus {
  color: var(--colour-accent);
}

/* Mobile navigation: stack links on small screens */
@media (max-width: 640px) {
  .site-nav .nav-list {
    gap: 0.75rem;
  }
  .nav-link {
    font-size: 0.875rem;
  }
}

/* Section common styles */
.section-heading {
  font-family: 'Montserrat', sans-serif;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--colour-dark);
}

/* Hamburger button baseline styling */
.hamburger {
  display: none;             /* show only on small screens */
  flex-direction: column;
  justify-content: space-between;
  width: 1.8rem;
  height: 1.2rem;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
}

.hamburger__line {
  width: 100%;
  height: 2px;
  background-color: var(--colour-accent);
  border-radius: 1px;
}

/* Contact button styles for header */
.contact-btn {
  margin-left: 1rem;
}

/* Desktop layout: align nav and contact on the right and hide the hamburger */
@media (min-width: 769px) {
  .site-nav {
    margin-left: auto; /* push nav list to the right of the logo */
  }
  .hamburger {
    display: none;    /* no hamburger on large screens */
    margin-left: 0;
  }
  .contact-btn {
    margin-left: 1rem;
    padding: 0.5rem 0.75rem;
  }
}

/* Responsive behaviour */
@media (max-width: 768px) {
  
  /* Position the nav relative so the dropdown appears below it */
  .site-nav {
    position: relative;
  }

  /* Hide the inline nav list and show hamburger */
  .site-nav .nav-list {
    /* more specific selector overrides the existing display:flex */
    position: absolute;
    width: fit-content;
    min-width: 6rem;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    background-color: var(--colour-bg);
    padding: 1rem;
    box-shadow: 0 2px 6px var(--shadow-colour);
  }

  /* When open, display the menu */
  .site-nav .nav-list.open {
    display: flex;
  }

  .hamburger {
    display: flex; /* show the hamburger on small screens */
    justify-self: right;
  }

  /* Tuck the contact button next to the hamburger */
  .contact-btn {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    margin-left: 1rem;
  }
}

@media (max-width: 320px) {
  .contact-btn {
    display: none;
  }
}



/* ------------------------------------------------------------ */
/* About Section */
/* ------------------------------------------------------------ */
.about {
  padding: 4rem 0;
  background-color: var(--colour-light);
}

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

.about__image-wrapper {
  flex: 1 1 400px;
  max-width: 500px;
}

.about__image {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  object-fit: cover;
  box-shadow: 0 2px 8px var(--shadow-colour);
}

.about__content {
  flex: 1 1 500px;
  max-width: 600px;
  font-size: 1rem;
}

.about__content p {
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  .about__inner {
    flex-direction: column;
    text-align: center;
  }
  .about__content {
    max-width: none;
  }
}

/* ------------------------------------------------------------ */
/* Skills Section */
/* ------------------------------------------------------------ */
.skills {
  padding: 4rem 0;
  background-color: var(--colour-bg);
}

.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.skill {
  background-color: var(--colour-light);
  border-left: 4px solid var(--colour-accent);
  padding: 1.5rem;
  border-radius: 0.375rem;
  box-shadow: 0 2px 4px var(--shadow-colour);
}

.skill__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--colour-dark);
}

.skill__list {
  margin: 0;
  padding-left: 1.25rem;
}

.skill__list li {
  margin-bottom: 0.5rem;
  color: var(--colour-mid);
}

/* ------------------------------------------------------------ */
/* Projects Section */
/* ------------------------------------------------------------ */
.projects {
  padding: 4rem 0;
  background-color: var(--colour-light);
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  align-items: stretch;
}

.project-card {
  background-color: var(--colour-bg);
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--shadow-colour);
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: transform 0.2s ease;
}

.project-card:hover {
  transform: translateY(-4px);
}

.project-card__image-wrapper {
  width: 100%;
  overflow: hidden;
}

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

.project-card__content {
  padding: 1rem 1.5rem 1.5rem;
  flex: 1;
}

.project-card__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--colour-dark);
}

.project-card__description {
  font-size: 0.95rem;
  color: var(--colour-mid);
}

.btn-wrapper--projects {
  display: flex;
  justify-content: center;
}

.btn--projects {
  display: inline-block;
  margin: 2rem auto 0;
  text-align: center;
}

/* ------------------------------------------------------------ */
/* Experience & Education Section */
/* ------------------------------------------------------------ */
.experience {
  padding: 4rem 0;
  background-color: var(--colour-bg);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.timeline__item {
  position: relative;
  padding-left: 2rem;
  border-left: 4px solid var(--colour-accent);
}

.timeline__title {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.timeline__subtitle {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--colour-mid);
  margin-bottom: 0.5rem;
}

.timeline__description {
  font-size: 0.9rem;
  color: var(--colour-mid);
  margin-bottom: 0.2rem;
}

.timeline__link {
  font-size: 0.8rem;
  color: var(--colour-mid);
  margin-bottom: 0.4rem;
  font-style: italic;
}

.timeline__link:hover,
.timeline__link:focus {
  color: var(--colour-accent);
}

.timeline__subtitle:hover,
.timeline__subtitle:focus {
  color: var(--colour-accent);
}

/* ------------------------------------------------------------ */
/* Contact Section */
/* ------------------------------------------------------------ */
.contact {
  padding: 4rem 0;
  background-color: var(--colour-light);
}

.contact__intro {
  max-width: 600px;
  margin-bottom: 2rem;
  color: var(--colour-mid);
}

.contact__form {
  max-width: 600px;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
  color: var(--colour-dark);
}

.form-group input,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-family: 'Open Sans', sans-serif;
  font-size: 1rem;
  resize: vertical;
  color: var(--colour-dark);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--colour-accent);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.2);
}

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

.contact__link {
  color: var(--colour-accent);
  font-weight: 600;
  transition: color 0.2s ease;
}

.contact__link:hover,
.contact__link:focus {
  color: var(--colour-accent-dark);
}

/* ------------------------------------------------------------ */
/* Footer */
/* ------------------------------------------------------------ */
.site-footer {
  background-color: var(--colour-bg);
  border-top: 1px solid #e5e7eb;
  padding: 2rem 0;
}

.footer__inner {
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--colour-mid);
}

/* ------------------------------------------------------------ */
/* ------------------------------------------------------------ */
/* Projects.html */
/* ------------------------------------------------------------ */
/* ------------------------------------------------------------ */

/* ------------------------------------------------------------ */
/* Coming Soon Message */
/* ------------------------------------------------------------ */

.coming-soon {
  padding: 2rem 1rem;
  padding-bottom: 0;
  text-align: center;
}

/* ------------------------------------------------------------ */
/* Filters */
/* ------------------------------------------------------------ */

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 1.4rem;
}

.filter-btn {
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn.active {
  background-color: var(--colour-accent);
  color: var(--colour-light);
}

@media (hover: hover) {
  .btn--secondary:not(.active):hover {
    background-color: var(--colour-accent);
    color: var(--colour-light);
  }
}

@media (hover: none) {
  .btn--secondary:not(.active):hover {
    background-color: var(--colour-accent-light);
    color: var(--colour-accent);
  }
}

.project-card--hidden {
  display: none !important;
}

/* DEPRACATED
.btn--secondary:not(.active):focus {
  background-color: var(--colour-accent-light);
  color: var(--colour-accent);
  box-shadow: none;
  outline: none;
}
*/


/* ------------------------------------------------------------ */
/* Projects */
/* ------------------------------------------------------------ */

.all-projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  align-items: stretch; /* Makes all cards in a row equal height */
  justify-items: start; /* Ensures left alignment on the last row */
}

.all-projects__grid > a {
  flex: 0 0 280px;
  display: flex;
}

.project-card {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card-max {
  max-width: 380px;
  margin-inline-start: 0;
}

@media (max-width: 768px) {
  .project-card-max {
    margin-inline: auto;
  }
}

