:root {
  --color-accent: #ea5e5e;
  --background-accent: rgba(212, 45, 45, 0.1);
  --color-highlight: #f0e2e2;
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /* font-family: Helvetica; */
  font-family: "Inter", sans-serif;
}

body {
  background: #0e0d0d;
  color: #b89494;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 2rem;
}

p {
  line-height: 1.5rem;
}

p::selection,
h1::selection,
h2::selection,
h3::selection,
h4::selection,
h5::selection,
h6::selection,
a::selection {
  background: var(--color-accent);
  color: #2a0f0f;
}

.underlay {
  position: fixed;
  background: #541717;
  inset: 0;
  opacity: 0;
}

header,
main,
footer {
  position: relative;
  z-index: 10;
}

header {
  display: flex;
  gap: 1rem;
  width: 100%;
  padding: 2rem;
  /* justify-content: center; */
  border: 1px solid #b8949426;

  background-image: url('/public/headerbg3.png');
  background-size: cover;         /* Makes the image cover the whole header */
  background-position: center;    /* Centers the image */
  background-repeat: no-repeat;   /* Prevents image from repeating */


  box-shadow: 0 0 20px 10px #3d1515;
}

.img-and-text {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.profile-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

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

.profile-image-container {
  max-width: 100px;
  overflow: hidden;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border-radius: 0.25rem;
  flex-shrink: 0;
}

.profile-image-container img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  border-radius: 0.75rem;
}

header h1,
header h4,
.lightText {
  color: var(--color-highlight);
}

header a {
  text-decoration: none;
}

header h1 {
  font-weight: 600;
  font-size: 1.3rem;
}

header h4 {
  font-weight: 400;
  font-size: 0.8rem;
}

nav {
  display: none;
}

nav a {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

nav a:hover .nav-line {
  background: var(--color-accent);
  width: 50px;
}

.nav-line {
  height: 1px;
  width: 20px;
  background: var(--color-highlight);
  transition-duration: 200ms;
}

.social-link-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.social-link {
  font-size: 1.4rem;
  color: inherit;
  text-decoration: none;
  transition-duration: 200ms;
}

.social-link:hover {
  color: var(--color-highlight);
}

main {
  display: flex;
  flex-direction: column;
  gap: 6rem;
  padding: 0rem 2rem;
  margin-bottom: 3rem;
}

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

section h2 {
  text-transform: uppercase;
  font-size: 1rem;
  font-weight: 500;
}

.sticky-header {
  position: sticky;
  top: 0;
  padding: 1rem 0;
}

.sticky-header h2 {
  position: relative;
  z-index: 2;
}

.sticky-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #0e0d0d;
  backdrop-filter: blur(5px);
  opacity: 0.7;
}

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

.about-contents p {
  font-size: 1.1rem;
}

.about-image-container {
  max-width: 300px;
  overflow: hidden;
  display: flex;
  aspect-ratio: 16 / 7;
  justify-content: center;
  border-radius: 0.25rem;
  flex-shrink: 0;
  box-shadow: 0 0 15px 5px #2a0f0f;
}

.about-image-container img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  border-radius: 0.75rem;
}

.anchor-text {
  color: var(--color-highlight);
  text-decoration: none;
  transition-duration: 200ms;
}

.anchor-text:hover {
  color: var(--color-accent);
}

.experience-contents,
.project-contents {
  display: flex;
  flex-direction: column;
  gap: 4rem;
}

.experience-card,
.project-card {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.experience-card {
  gap: 0.5rem 1rem;
}

.project-card {
  gap: 1rem 1rem;
}

.card-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-header-link {
  text-decoration: none;
}

.tenure {
  opacity: 0.7;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.experience-card p {
  font-size: 0.9rem;
}

.card-header {
  font-weight: 400;
  font-size: 1rem;
}

.anchor-icon {
  padding-left: 0.5rem;
}

.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  color: var(--color-accent);
}

.tag {
  border-radius: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: var(--background-accent);
}

.tag p {
  font-size: 0.8rem;
}

.project-image-container {
  max-width: 200px;
  overflow: hidden;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  order: 2;
  border-radius: 0.25rem;
  box-shadow: 0 0 5px 3px #2a0f0f;
}

.project-image-container img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.project-card p {
  font-size: 0.9rem;
}

.project-stat-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.project-archive-link {
  position: relative;
  color: var(--color-highlight);
  text-decoration: none;
  transition-duration: 200ms;
  margin-right: auto;
}

.project-archive-link span {
  transition-duration: 200ms;
}

.project-archive-link:hover span {
  padding-left: 0.5rem;
}

.project-archive-link::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  bottom: 0;
  background: transparent;
  transition-duration: 200ms;
}

.project-archive-link:hover::after {
  background: var(--color-accent);
}

footer {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2rem 0rem;
  justify-content: space-between;
  align-items: flex-start;
}

footer p {
  font-size: 0.9rem;
}

.scroll-to-top {
  text-decoration: none;
  color: var(--color-accent);
  background: var(--background-accent);
  padding: 0 0.75rem;
  aspect-ratio: 1/1;
  display: grid;
  place-items: center;
  border-radius: 100%;
  overflow: hidden;
  transition-duration: 200ms;
}

.scroll-to-top:hover {
  opacity: 0.6;
}

/* MEDIUM SCREEN BREAKPOINT */
@media (min-width: 640px) {
  header {
    padding: 3rem 4rem;
  }

  .profile-image-container {
    max-width: 140px;
    overflow: hidden;
    display: grid;
    place-items: center;
    aspect-ratio: 1 / 1;
    border-radius: 0.25rem;
    flex-shrink: 0;
  }
  
  .profile-image-container img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    border-radius: 0.75rem;
  }

  main {
    padding: 0rem 4rem;
  }

  .project-card,
  .experience-card {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .card-column {
    grid-column: span 3 / span 3;
  }

  .project-image-container {
    order: 0;
  }

  header {
    max-width: unset;
  }

  header h1 {
    font-size: 2rem;
  }

  header h4 {
    font-size: 1.3rem;
  }

  header p {
    max-width: 300px;
  }

  .social-link-container {
    gap: 1.5rem;
  }

  .social-link-container i {
    font-size: 2rem;
  }
}

/* LARGE SCREEN BREAKPOINT */
@media (min-width: 1160px) {
  body {
    grid-template-columns: 2fr 3fr; /* 1/3 and 2/3 ratio */
    gap: 2rem;
    padding: 6rem;
    padding-top: 0;
    place-items: start center; /* aligns items vertically at the top, horizontally centered */
  }

  header {
    position: sticky;
    top: 96px;
    margin-left: auto;
    height: fit-content;
    padding: 3rem;
    justify-content: center;
    min-height: calc(100vh - 192px); /* 96px top + 96px bottom */
    border-radius: 3%;
    border: 1px solid #b8949426;
    /* background: rgba(212, 45, 45, 0.5); */

    /* background: rgb(62,20,20);
    background: linear-gradient(90deg, rgba(62,20,20,1) 27%, rgba(149,11,11,1) 76%); */

    background-image: url('/public/headerbg3.png');
    background-size: cover;         /* Makes the image cover the whole header */
    background-position: center;    /* Centers the image */
    background-repeat: no-repeat;   /* Prevents image from repeating */
    box-shadow: 0 0 20px 10px #3d1515;
  }

  .img-and-text {
    width: 100%;
    flex-wrap: nowrap; /* Keep items on one line */
  }
  
  .profile-image-container {
    flex-shrink: 1; /* Allow image to shrink */
    min-width: 80px; /* Set a minimum width so it doesn't get too small */
    width: auto; /* Let width be determined by available space */
    max-width: 125px; /* Limit maximum width */
  }
  
  .profile-text {
    flex: 1; /* Let text take available space */
    min-width: 0; /* Allow text container to be smaller than content */
    overflow:visible; /* Hide overflow */
  }

  header h1 {
    font-size: 2rem;
  }

  header h4 {
    font-size: 1.1rem;
  }

  header p { 
    font-size: 1.5rem;
    text-transform: uppercase;
    font-weight: 400;
    max-width: 300px;
  }

  nav {
    padding: 5rem 0;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    flex: 1;
    justify-content: center;
  }

  nav a {
    font-size: 1rem;
  }

   nav .anchor-text p {
    font-size: 1rem;
  }

  .social-link-container {
    margin-top: 20px;
    gap: 1.5rem;
  }

  .social-link-container i {
    font-size: 2rem;
  }

  header,
  main {
    padding-top: 6rem;
    max-width: 800px;
    width: 100%;
  }

  header {
    max-width: 550px;
  }

  main {
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .sticky-header {
    display: none;
  }

  .project-card,
  .experience-card {
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    transition-duration: 200ms;
  }

  .project-card:hover,
  .experience-card:hover {
    background: #411b1b;
    border: 1px solid #b8949426;
    box-shadow: 0 0 20px 3px #2a0f0f;
  }

  .project-archive-link,
  .resume-link {
    padding-left: 1rem;
  }

  footer {
    grid-column: span 2 / span 2;
    flex-direction: row;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
  }

  header {
    justify-self: end; /* align header block to the end of its grid column */
  }
  
  main {
    margin-right: auto;  /* remove this */
    width: 100%;
  }

  body {
    display: flex;
    gap: 3rem;
  }
}
