:root {
  /*Color palette*/
  --color-bg: #1c1c1a; /*Page background*/
  --color-surface: #2a2a27; /*Cards, nav, section panels*/
  --color-border: #444441; /*Hairlines, dividers*/
  --color-text: #f1efe8; /*Primary text*/
  --color-text-muted: #b4b2a9; /*Secondary text, descriptions*/
  --color-accent: #d85a30; /*CTAs, links, active states, highlights*/
  --color-accent-dark: #4a1b0c; /*Text-on-accent, hover depth*/
  --color-error: #c1443a; /* Errors, failed states */

  /*Fonts*/
  --font-heading: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "Space Mono", monospace;

  --header-height: 4rem; /* update if .nav-toggle padding/bars change */
}

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

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  font-size: 1rem;
  font-weight: 400;
}

.container {
  max-width: 45rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
  padding-bottom: 5rem;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 500;
}

h1 {
  font-size: 2.5rem;
  line-height: 1.1;
}

h2 {
  font-size: 1.75rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.3;
  padding-bottom: 1rem;
}

a {
  transition: background-color 0.2s, color 0.2s;
}

header {
  height: var(--header-height);
}

.nav-toggle {
  background-color: var(--color-bg);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.9rem;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  background-color: var(--color-text);
  width: 2rem;
  height: 0.2rem;
}
 
nav {
  display: none;
}

hr {
  display: none;
}

#hero .container {
  font-size: 1.125rem;
  min-height: calc(100dvh - var(--header-height));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2rem;
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items:flex-start;
  text-align: left;
}

.role-line {
  color: var(--color-text-muted);
}

.tagline {
  font-size: 1.25rem;
}

.hero-buttons {
  display: flex;
  gap: 1.5rem;
}
.hero-buttons a {
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  text-decoration: none;
}

#about .container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#skills .container {
  max-width: 68.75rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  font-size: 0.9rem;
}


#skills ul {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 2.5rem 1.5rem;
}

#skills li {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
}

#skills svg {
  width: 2rem;
  height: 2rem;
}

#skills li h3 {
  padding-bottom: 0.5rem;
}

#projects .container {
  max-width: 68.75rem;
}

.projects-layout {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.project-item {
  border: 1px solid var(--color-border);
  border-radius: 1rem;
  overflow: hidden;
}

.project-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 1rem;
}

.project-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
}

.project-content p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

.projects-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

.filter-container {
  display: flex;
  gap: 0.5rem;
}

.filter-button {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--color-accent);
  background-color: var(--color-surface);
  color: var(--color-accent);
  border-radius: 0.2rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.projects-buttons a {
  text-decoration: none;
  padding: 0.8rem 2.5rem;
  border: 1px solid var(--color-accent);
  border-radius: 0.5rem;
  color: var(--color-accent);
}

#contact .container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

#contact form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

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

input,
textarea {
  font-family: var(--font-body);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 0.2rem;
  color: var(--color-text);
  padding: 0.75rem 1rem;
}

textarea {
  min-height: 8rem;
  resize: vertical;
}

form button {
  background-color: var(--color-surface);
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  color: var(--color-accent);
  padding: 1rem;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

form span {
  color: var(--color-accent);
  font-size: 0.75rem;
}

.contact-links {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

.success-message {
  color: var(--color-accent);
  font-size: 1.5rem;
  text-align: center;
}

.error-status-message {
  color: var(--color-error);
  font-size: 1.5rem;
  text-align: center;
}

.contact-links a {
  background-color: var(--color-surface);
  text-decoration: none;
  border: 1px solid var(--color-accent);
  border-radius: 0.5rem;
  color: var(--color-accent);
  flex: 1;
  padding: 0.4rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

a:hover,
form button:hover {
  background-color: var(--color-accent);
  color: var(--color-accent-dark);
}

a:active,
form button:active {
  background-color: var(--color-accent-dark);
  color: var(--color-text);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  
}

.nav-style {
  position: absolute;
  top: var(--header-height);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--color-bg);
  z-index: 10;
  width: 75%;
  gap: 0.25rem;
}

.nav-item-style {
  text-decoration: none;
  color: var(--color-accent);
  border: 1px solid var(--color-border);
  padding: 0.5rem 0.8rem;
}

.error-message {
  display: none;
}

.hidden {
  display: none;
}

@media screen and (min-width: 45rem) {
  .nav-toggle {
    display: none;
  }

  nav {
    display: flex;
    justify-content: space-evenly;
    padding-top: 2rem;
    max-width: 68.75rem; 
    margin-inline: auto;
  }

  hr {
    display: block;
    border: none;
    border-top: 1px solid var(--color-border);
    margin-top: 1rem;
  }

  nav a {
    text-decoration: none;
    color: var(--color-accent);
    transition: background-color 0.2s, color 0.2s, border 0.2s, padding 0.2s;
  }

  nav a:hover {
    border: 1px solid var(--color-border);
    padding: 0.3rem 1rem;
  }

  #about .container {
  border: 1px solid var(--color-border);
  box-sizing: content-box; /* lets padding extend beyond the 45rem text cap, widening the visible box without widening the reading column */
  padding: 2rem 5rem;
  border-radius: 0.5rem;
  margin-bottom: 2rem;
  }

  .project-item {
    display: flex;
    flex-direction: column;
  }

  .projects-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    align-items: stretch;
  }

  .project-content {
    flex: 1;
    justify-content: space-between;
  }

  .projects-buttons {
    gap: 1rem;
    width: 100%;
  }

  .projects-buttons a {
    padding: 0.8rem;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

  .contact-links a {
    padding: 1rem 1.5rem;
  }

  .hidden {
    display: none;
  }
}