:root {
  --blue-dark: #1c2f64;
  --blue-light: #76a8f8;
  --text-black: #14151a;
  --grey-dark: #2c3546;
  --grey-light: #5c6777;
  --text-white: #f6f7f8;
}


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', sans-serif;
  font-display: swap;
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(135deg, var(--grey-dark), var(--grey-light));
  color: var(--text-white);
  line-height: 1.6;
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
}

/* Header */
.header {
  position: fixed;
  top: 0;
    width: 100vw;
  padding: 1rem 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--blue-dark);
  z-index: 1000;
  transition: background 0.3s ease;
}

.header.scrolled img {
  background: rgba(17, 24, 39, 0.9);
  height: 90px;
}

.header-logo {
  height: 250px;
  width: auto;
  margin-left: 1rem;
  opacity: 0.7;
  transition: height 0.7s ease, opacity 0.5s ease;
}

.nav a {
  margin: 1rem 1rem 1rem 1rem;
  padding: 0.5rem 0.5rem;
  text-decoration: none;
  color: var(--text-white);
  background-color: var(--grey-light);
  border-radius: 5px;
  border-color: var(--text-white);
  border-style: solid;
  border-width: 1px;
  transition: color 0.5s ease;
}
.nav a:hover {
  box-shadow: 0 0 8px 3px rgba(248, 246, 246, 0.25);
  padding: 0.75rem 0.75rem;
  transition-timing-function: ease-in-out;
  transition-duration: 0.3s;
  transition-property: padding;
}


/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  margin-top: 150px;
}
/* Responsive nav bar vertical stack */
@media (max-width: 700px) {
  .nav {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .header-logo {
    height: 150px;
    width: auto;
    margin: 0;
    opacity: 0.95;
  }
  .nav a {
    width: 100%;
    text-align: center;
    justify-content: space-between;
    margin: 0.7rem 0.7rem 0.7rem 0.7rem;
    padding: 0.9rem 1.2rem;
    min-height: 48px;
    min-width: 48px;
    font-size: 1.1rem;
  }
  .btn, button, .card a {
    margin: 0.7rem 0.7rem;
    padding: 0.9rem 1.2rem;
    min-height: 48px;
    min-width: 48px;
    font-size: 1.1rem;
  }
  }
}
@media (max-width: 400px) {
  .hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
  }
  .hamburger span {
    display: block;
    width: 28px;
    height: 2px;
    margin: 3px 0;
    background: var(--text-white);
    border-radius: 2px;
    transition: 0.3s;
  }
  .nav {
    display: none;
    flex-direction: column;
    align-items: center;
    position: sticky;
    top: 60px;
    left: 0;
    width: 100vw;
    z-index: 1099;
  }
  .nav.open {
    display: flex;
    align-content: center;
    max-width: 100px;
    top: 100px;
    right: 0;
    left: auto;
  }
  .nav a {
    margin: 0.5rem 0;
    padding: 0.5rem 0;
    font-size: 1.1rem;
    width: 90%;
    text-align: center;
  }

.header.scrolled nav {
  height: 70px;
}

  .header-logo {
    height: 150px;
  }
}
.hero-text {
  font-size: 2.8rem;
}
#changing-text {
  color: var(--blue-light);
}

.sub-text {
  font-size: 1.2rem;
  opacity: 0.8;
}

/* Projects */
.projects {
  padding: 5rem 5% 3rem;
  text-align: center;
  margin-bottom: 2rem;
}
.project-grid {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  padding: 2rem 0;
  margin-left: auto;
  margin-right: auto;
  margin-top: 2rem;
  gap: 2rem;
    width: 100vw;
    box-sizing: border-box;
}


/* Project card style matches nav buttons */
.card {
  background-color: var(--grey-dark);
  color: var(--text-light);
  border-radius: 5px;
  border: 1px solid var(--text-white);
  max-width: 300px;
  box-shadow: 0 0 6px 2px rgba(248, 246, 246, 0.25);
  padding: 1.5rem 1rem;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  }

  .card p {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a052cec; /* blue-dark with opacity */
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    border-radius: 5px;
    padding: 1rem;
    transition: opacity 0.3s;
  }
  .card:hover p,
  .card:focus-within p {
    opacity: 2;
    pointer-events: auto;
    text-align: left;
      .nav a {
        width: 96vw;
        max-width: 400px;
        text-align: center;
        justify-content: space-between;
        margin: 0.7rem auto;
        padding: 0.9rem 1.2rem;
        min-height: 48px;
        min-width: 48px;
        font-size: 1.1rem;
        box-sizing: border-box;
      }
      .btn, button, .card a {
        margin: 0.7rem auto;
        padding: 0.9rem 1.2rem;
        min-height: 48px;
        min-width: 48px;
        font-size: 1.1rem;
        width: 96vw;
        max-width: 400px;
        box-sizing: border-box;
      }
      .project-grid {
        flex-direction: column;
        align-items: center;
        gap: 1.2rem;
        width: 100vw;
        padding: 1rem 0.5vw;
        box-sizing: border-box;
      }
      .card {
        width: 96vw;
        max-width: 400px;
        margin: 0 auto;
        box-sizing: border-box;
      }