/* ====== main.css — Portfolio of Nathanael King ====== */

@import url("https://fonts.googleapis.com/css?family=IM+Fell+French+Canon+SC|Lato");

/* ====== CSS Variables ====== */
:root {
  --primary-color: #2C3E50;
  --secondary-color: #3E5C76;
  --accent1-color: #FF6B6B;
  --accent2-color: #A8DADC;
  --background: #F1F1F1;
  --text: #1E1E2F;
  --headline-color-on-light: #2C3E50;
  --headline-color-on-dark: #F1F1F1;
  --heading-font: "Poppins", sans-serif;
  --paragraph-font: "Roboto", sans-serif;
  --paragraph-color-on-light: #333;
  --paragraph-color-on-dark: #F1F1F1;
  --paragraph-background-color: #2C3E50;
  --nav-background-color: #3E5C76;
  --nav-link-color: #F1F1F1;
  --nav-hover-link-color: #1E1E2F;
  --nav-hover-background-color: #A8DADC;
}

/* ====== Reset ====== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  scroll-behavior: smooth;
  font-family: var(--paragraph-font, sans-serif);
  background-color: var(--background);
  color: var(--text);
  line-height: 1.6;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

ul, ol {
  list-style: none;
}

button, input, textarea, select {
  font: inherit;
  border: none;
  background: none;
  outline: none;
}

/* ====== Typography ====== */
body {
  font-family: var(--paragraph-font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5em;
  color: var(--headline-color-on-light);
}

h1, h2 {
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  line-height: 1.2;
}

h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  margin-bottom: 1em;
  color: var(--text);
}

a {
  font-family: var(--paragraph-font);
  color: var(--primary-color);
  text-decoration: underline;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent1-color);
}

ul, ol {
  margin-bottom: 1em;
  padding-left: 2em;
}

li {
  margin-bottom: 0.5em;
}

blockquote {
  font-style: italic;
  border-left: 4px solid var(--accent2-color);
  padding-left: 1em;
  margin: 1em 0;
  color: var(--accent1-color);
}

html {
  font-size: 100%;
}

@media (max-width: 600px) {
  html { font-size: 95%; }
}

/* ====== Buttons ====== */
.button, .cta-button, .github-link {
  display: inline-block;
  padding: 0.75em 1.5em;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 5px;
  background-color: var(--accent2-color);
  color: var(--nav-background-color);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  font-family: var(--heading-font);
}

.button:hover, .cta-button:hover, .github-link:hover {
  background-color: var(--accent1-color);
  color: white;
}

.button-outline {
  background: transparent;
  border: 2px solid var(--accent2-color);
  color: var(--accent2-color);
}

.button-outline:hover {
  background-color: var(--accent2-color);
  color: var(--nav-background-color);
}

.button-large {
  font-size: 1.1rem;
  padding: 1em 2em;
}

.button-small {
  font-size: 0.875rem;
  padding: 0.5em 1em;
}

/* ====== Projects Section ====== */
.projects {
  padding: 4em 2em;
  background-color: var(--paragraph-color-on-dark);
  color: var(--secondary-color);
  text-align: center;
}

.projects h2 {
  font-family: var(--heading-font);
  font-size: 2em;
  color: var(--primary-color);
  margin-bottom: 1em;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5em;
  padding: 1em;
}

.project-card {
  display: block;
  text-decoration: none;
  background-color: var(--accent2-color);
  border: 2px solid var(--accent1-color);
  padding: 1.5em;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease;
  color: var(--headline-color-on-light);
}

.project-card:hover {
  background-color: var(--nav-link-color);
  color: var(--headline-color-on-light);
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  text-decoration: none;
  cursor: pointer;
}

.project-card:visited, .project-card:active {
  text-decoration: none;
  color: var(--text);
}

.project-card img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 1em;
}

.project-card h3, .project-card p {
  color: inherit;
  font-family: var(--paragraph-font);
  transition: color 0.3s ease;
}

/* ====== Navbar ====== */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--nav-background-color);
  padding: 1em 2em;
  position: sticky;
  top: 0;
  z-index: 1000;
  flex-wrap: nowrap;
}

.nav-left {
  font-size: 1.5em;
  color: var(--accent2-color);
}

.nav-left img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2em;
}

.nav-links a {
  color: var(--nav-link-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 1em;
  text-decoration: none;
  padding: 0.5em;
  transition: 0.3s;
  font-family: var(--heading-font);
}

.nav-links a:hover {
  background-color: var(--nav-hover-background-color);
  color: var(--nav-hover-link-color);
  border-radius: 5px;
}

.nav-right {
  font-weight: 700;
  font-size: 1.2em;
  color: var(--nav-link-color);
  font-family: var(--heading-font);
}

.nav-right span {
  color: var(--accent2-color);
}

/* Hamburger button — hidden on desktop */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1100;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--nav-link-color);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Animate hamburger to X when open */
.hamburger.open span:nth-child(1) {
  transform: translateY(8.5px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-8.5px) rotate(-45deg);
}

/* ====== Mobile ====== */
@media (max-width: 700px) {
  body { font-size: 16px; }

  header, footer { padding: 1em; text-align: center; }

  .hamburger { display: flex; }
  .nav-right { display: none; }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--nav-background-color);
    z-index: 1000;
    padding: 0.5em 0 1em;
  }

  .nav-links.open { display: flex; }

  .nav-links li { width: 100%; text-align: center; }

  .nav-links a {
    display: block;
    padding: 0.75em 1em;
    width: 100%;
  }

  .navbar {
    position: relative;
    flex-wrap: wrap;
  }

  .hero {
    height: auto;
    min-height: 60vh;
    padding: 2em 1em;
    background-size: cover;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .hero-main {
    flex-direction: column;
    text-align: center;
    gap: 1em;
    position: static;
    width: 100%;
  }

  .hero-text {
    position: static;
    transform: none;
    top: auto;
    left: auto;
    width: 100%;
    max-width: 100%;
    padding: 1em;
  }

  .hero-text h1 {
    font-size: 1.8rem;
    line-height: 1.2;
  }

  .hero-right { display: none; }

  .name-banner {
    font-size: 1.1rem;
    padding: 0.4em 1em;
    width: 100%;
    max-width: 100%;
  }

  .project-grid, .about-project-grid {
    grid-template-columns: 1fr;
  }

  .about-card {
    flex-direction: column;
    text-align: center;
  }

  .about-image { margin-bottom: 1em; }

  .about-text h2 { font-size: 1.6rem; }
  .about-text p { font-size: 1rem; }

  .contact-form {
    padding: 1em;
    font-size: 1rem;
  }

  .cta-button, .github-link, button[type="submit"] {
    width: 100%;
    font-size: 1rem;
    padding: 0.75em;
    margin-top: 1em;
  }

  .footer-links {
    flex-direction: column;
    gap: 0.5em;
  }

  .cert-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  body { line-height: 1.4; }
  p { margin-bottom: 0.75em; }

  .cert-grid {
    grid-template-columns: 1fr;
  }
}

/* ====== Hero Section ====== */
.hero {
  background-image: url("../pics/space.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 80% auto;
  background-color: var(--primary-color);
  color: var(--accent2-color);
  position: relative;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  overflow: hidden;
  padding: 2em 30px;
}

.name-banner {
  background-color: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-family: var(--heading-font);
  font-size: 1.6em;
  padding: 0.4em 1.2em;
  border-radius: 30px;
  text-align: center;
  width: fit-content;
  margin: 0 auto;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
  animation: fadeInSlideDown 0.8s ease-out forwards;
  opacity: 0;
}

@keyframes fadeInSlideDown {
  0% { opacity: 0; transform: translateY(-20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.hero-container { position: relative; }

.hero-container::before, .hero-container::after {
  content: "";
  position: absolute;
  border: 4px solid var(--accent1-color);
  opacity: 0;
  animation: drawLines 1.2s ease-out forwards;
}

.hero-container::before {
  top: 0;
  left: 0;
  width: 150px;
  height: 60px;
  border-right: none;
  border-bottom: none;
  animation-delay: 0.2s;
}

.hero-container::after {
  bottom: 0;
  right: 0;
  width: 150px;
  height: 60px;
  border-left: none;
  border-top: none;
  animation-delay: 0.6s;
}

@keyframes drawLines {
  0% { opacity: 0; transform: scaleX(0) scaleY(0); }
  50% { opacity: 1; transform: scaleX(1.2) scaleY(0.2); }
  100% { opacity: 1; transform: scaleX(1) scaleY(1); }
}

.hero-main {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2em;
  flex: 1;
  position: relative;
  width: 100%;
  margin-top: 2em;
}

.hero-right {
  position: absolute;
  top: -2em;
  right: 1em;
  width: 250px;
  max-width: 250px;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  z-index: 0;
  margin-top: 1em;
}

.hero-text {
  text-align: center;
  z-index: 1;
  background-color: var(--paragraph-color-on-light);
  padding: 10px 20px;
}

.hero-text h1 {
  font-family: var(--heading-font);
  font-size: 2.5em;
  color: white;
  line-height: 1.3;
}

.hero-text h1 span {
  color: var(--accent2-color);
}

.cta-button, .github-link {
  display: inline-block;
  margin-top: 1em;
  padding: 0.75em 1.5em;
  background-color: var(--accent2-color);
  color: var(--nav-background-color);
  text-decoration: none;
  font-weight: 600;
  border-radius: 5px;
  transition: 0.3s ease;
}

.hero::before, .hero::after {
  content: "";
  position: absolute;
  border: 2px solid #FF4F4F;
  opacity: 0;
  animation: drawLines 1.2s ease-out forwards;
}

.hero::before {
  top: 0;
  left: 0;
  width: 150px;
  height: 60px;
  border-right: none;
  border-bottom: none;
  animation-delay: 0.2s;
}

.hero::after {
  bottom: 0;
  right: 0;
  width: 150px;
  height: 60px;
  border-left: none;
  border-top: none;
  animation-delay: 0.6s;
}

@media (max-width: 700px) {
  .hero-main {
    flex-direction: column;
    text-align: center;
  }
}

/* ====== Footer ====== */
footer {
  background-color: var(--primary-color);
  color: var(--headline-color-on-dark);
  padding: 2em 1em;
  text-align: center;
  font-family: var(--paragraph-font);
  font-size: 0.9rem;
}

footer p {
  margin: 0.5em 0;
  color: var(--headline-color-on-dark);
}

footer a {
  color: var(--accent2-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--accent1-color);
}

footer .footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1em;
  margin-top: 1em;
}

footer .footer-links a {
  font-size: 1rem;
}

/* ====== About Page ====== */
.about {
  padding: 4em 2em;
  background-color: var(--background);
  display: flex;
  justify-content: center;
}

.about .about-card {
  background-color: #fff;
  color: var(--paragraph-color-on-light);
  padding: 2em;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  max-width: 1000px;
  display: flex;
  flex-wrap: wrap;
  gap: 2em;
  align-items: center;
}

.about .about-image {
  flex: 1 1 250px;
  max-width: 250px;
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
}

.about .about-text {
  flex: 2 1 400px;
}

.about .about-text h2 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1em;
  font-family: var(--heading-font);
}

.about .about-text p {
  font-size: 1.1rem;
  margin-bottom: 1em;
  font-family: var(--paragraph-font);
  color: var(--paragraph-color-on-light);
}

.section-divider {
  border: 0;
  height: 3px;
  background: var(--accent1-color);
  margin: 4em auto 3em;
  width: 60%;
  border-radius: 2px;
  animation: growLine 1s ease forwards;
  transform: scaleX(0);
  transform-origin: left;
}

@keyframes growLine {
  to { transform: scaleX(1); }
}

@media (max-width: 700px) {
  .about .about-card {
    flex-direction: column;
    text-align: center;
  }

  .about .about-image { margin-bottom: 1em; }
  .about .about-text h2 { font-size: 1.6rem; }
  .about .about-text p { font-size: 1rem; }

  .section-divider { width: 80%; }
}

/* ====== Certifications Section ====== */
.certifications {
  padding: 3em 2em;
  background-color: var(--background);
  text-align: center;
}

.certifications h2 {
  font-family: var(--heading-font);
  font-size: 2em;
  color: var(--primary-color);
  margin-bottom: 1.5em;
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2em;
  max-width: 800px;
  margin: 0 auto;
  justify-items: center;
}

.cert-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75em;
  background-color: #fff;
  border-radius: 12px;
  padding: 1.5em;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cert-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.cert-badge {
  width: 140px;
  height: 140px;
  object-fit: contain;
}

.cert-name {
  font-family: var(--heading-font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
}

/* ====== Contact Page ====== */
.contact-intro {
  color: var(--paragraph-color-on-light);
  font-size: 1rem;
  margin-bottom: 0.5em;
  font-style: italic;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
  max-width: 700px;
  margin: 2em auto;
  text-align: left;
}

.contact-form label {
  font-weight: 600;
  font-family: var(--heading-font);
  color: var(--primary-color);
}

.contact-form input, .contact-form textarea {
  padding: 0.75em;
  font-size: 1rem;
  font-family: var(--paragraph-font);
  border: 1px solid var(--accent1-color);
  border-radius: 5px;
  background-color: #fff;
  color: var(--text);
}

.contact-form input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--accent2-color);
  box-shadow: 0 0 0 2px rgba(168, 218, 220, 0.4);
}

.contact-form .cta-button {
  align-self: flex-start;
  background-color: var(--accent2-color);
  color: var(--nav-background-color);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.75em 1.5em;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.contact-form .cta-button:hover {
  background-color: var(--accent1-color);
  color: #fff;
}
