@import url("https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Karla:ital,wght@0,200..800;1,200..800&display=swap");

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

:root {
  --cream: #fef8f4;
  --white: #fff;
  --blue: #334efa;
  --blue-medium: #80a8e4;
  --blue-light: #dfebff;
  --black: #1e1e1e;
  --gray: #87878d;
  --red: #df4e36;
  --yellow: #ffc972;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --section-gap: 8rem;
}

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

::selection {
  background-color: var(--blue);
  color: var(--cream);
}

html {
  scroll-padding-top: 100px;
  overflow-x: hidden;
}

body {
  background-color: var(--cream);
  color: var(--black);
  font-family: "Karla", sans-serif;
  overflow-x: hidden;
  text-align: justify;
}

section {
  margin-bottom: var(--section-gap) !important;
}

h1,
h2,
h3 {
  color: #334efa;
  font-family: "Cinzel Decorative", serif;
  cursor: default;
}

p {
  line-height: 1.5;
  cursor: default;
}

.container {
  width: min(85vw, 1200px);
  box-sizing: border-box;
  margin-inline: auto;
  /* padding-inline: 1rem; */
}

header {
  outline: var(--blue-light) 1px solid;
  background-color: var(--cream);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  transition: transform 0.5s ease-in-out;
}

.header-hidden {
  transform: translateY(-105%);
}

#nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  top: 0;
  padding: 25px;
}

#logo {
  width: 35px;
  height: 35px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#logo img {
  width: 100%;
  height: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.nav-links a {
  color: var(--black);
  position: relative;
  text-decoration: none;
  padding-bottom: 4px;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background-color: var(--blue);
  transition: width 0.25s ease;
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  width: 100%;
}

.social-icon:hover {
  color: var(--blue);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--black);
}

#home {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-bottom: #dfe7ff solid 1px;
  margin: 85px auto 0;
  position: relative;
  overflow: hidden;
}

#home-text {
  position: absolute;
}

#home img {
  width: 100%;
  min-width: 900px;
  position: absolute;
  inset: 0;
  object-fit: cover;
  object-position: center;
}

#home img:first-of-type {
  position: relative;
  z-index: 2;
}

#home img:last-of-type {
  z-index: 1;
}

#work {
  text-align: center;
}

#work h2 {
  font-size: 2rem;
  margin-bottom: var(--space-lg);
}

.work-subheading {
  text-align: left;
  font-size: 1.3rem;
  margin-bottom: var(--space-lg);
}

.work-subheading::before {
  content: "✦";
  padding: 8px;
}

#categories {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  width: 300px;
  margin: 0 auto var(--space-lg) auto;
  justify-content: center;
  gap: var(--space-xs);
}

.category {
  cursor: pointer;
  padding: 0.35rem 0.75rem;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.category.active {
  color: var(--blue);
}

.category:hover {
  color: var(--blue);
}

.category img {
  height: 4em;
  transition: all 0.3s ease;
}

.category img:hover {
  transform: translateY(-5px);
}

.category p {
  cursor: pointer;
}

#grid-container {
  margin-bottom: var(--space-lg);
}

.masonry-container {
  column-count: 4;
  column-gap: var(--space-sm);
  width: 100%;
  margin-inline: auto;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: var(--space-sm);
  background: var(--cream);
  border: var(--black) solid 1px;
  overflow: hidden;
  opacity: 0;
  will-change: transform;
}

.masonry-item img {
  width: 100%;
  display: block;
  height: auto;
  object-fit: cover;
  cursor: pointer;
}

#personal-work {
  margin-bottom: var(--space-xl);
}

.project-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  width: 100%;
}

.project-card {
  display: block;
  text-align: left;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
  opacity: 0;
  will-change: transform;
}

.project-card:hover h3 {
  color: var(--blue);
}

.project-img-frame {
  height: 250px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: var(--black) 1px solid;
}

.project-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: all 0.3s ease;
}

.project-card img:hover {
  transform: scale(105%);
}

.project-text {
  margin: var(--space-sm) 0;
}

.project-text h3 {
  cursor: pointer;
}

.project-text p {
  color: var(--gray);
}

#project-link {
  margin: var(--space-sm) 0;
}

.button {
  background-color: var(--blue);
  color: var(--cream);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 10rem;
  display: inline-block;
}

.button::before {
  content: "✦ ";
}

.button.secondary {
  background-color: var(--cream);
  border: var(--blue) 2px solid;
  color: var(--blue);
}

.project-page {
  padding-top: 8rem;
  padding-bottom: 4rem;
  width: min(85vw, 1200px);
  margin: auto;
}

.back-link {
  margin-bottom: 2rem;
}

#project-top {
  position: absolute;
  top: 0;
}

#project-back-to-top-button {
  margin: 3rem auto 0;
  display: block;
  width: fit-content;
}

.project-eyebrow {
  color: var(--blue);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.project-overview {
  font-size: 1.05rem;
  max-width: 700px;
  margin: 0.5rem 0 1.5rem;
}

.project-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.project-meta div {
  background: var(--blue-light);
  border-radius: 8px;
  padding: 0.9rem 1rem;
}

.project-meta span {
  display: block;
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}

.project-video-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.project-video {
  width: 100%;
}

.project-video-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--black);
  display: block;
  background: var(--black);
}

.project-video-caption {
  margin-top: 0.5rem;
  color: var(--gray);
  font-size: 0.92rem;
  line-height: 1.5;
}

.project-image-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.project-image-grid--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1.5rem;
}

.project-image {
  position: relative;
  overflow: hidden;
  opacity: 0;
  will-change: transform;
}

.project-image img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--black);
  display: block;
  cursor: pointer;
}

.project-image-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 0.9rem;
  background: linear-gradient(
    180deg,
    transparent 5%,
    rgba(30, 30, 30, 0.95) 100%
  );
  color: var(--cream);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.project-image:hover .project-image-overlay,
.project-image:focus-within .project-image-overlay {
  opacity: 1;
}

.project-image-caption {
  font-size: 0.85rem;
  line-height: 1.4;
  max-width: 100%;
}

#egg-project-thumbnail {
  background-color: #1e1e1e;
}

.project-body {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
}

.project-body h2 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.project-body ul {
  padding-left: 1.2rem;
  display: grid;
  gap: 0.6rem;
}

.project-body li {
  line-height: 1.5;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease-in,
    visibility 0.3s ease-in;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
  z-index: 200;
}

.lightbox-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  max-width: min(95vw, 1100px);
}

.lightbox img {
  max-width: min(90vw, 900px);
  max-height: min(90vh, 800px);
  width: auto;
  height: auto;
  object-fit: contain;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox.active img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 8px;
  width: 42px;
  height: 42px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-caption {
  color: var(--cream);
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 280px;
  flex: 0 0 280px;
}

.lightbox-caption:empty {
  display: none;
}

#about {
  background-color: var(--white);
  border: 1px solid var(--blue-light);
}

#about-text {
  margin-right: var(--space-lg);
}

#about h2 {
  margin-bottom: var(--space-md);
}

#about h2::before {
  content: "✦ ";
}

#about .container {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  align-items: center;
  padding: var(--space-md);
}

#about-pic-me {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

#about-pic {
  position: relative;
  width: 310px;
  display: block;
  border: var(--cream) 1px solid;
  margin-left: auto;
  overflow: visible;
  border: solid 1px var(--blue-light);
}

#about-pic-stars {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  width: 350px;
  max-width: none;
}

#contact {
  background-color: var(--blue);
  color: var(--white);
  width: 100%;
}

#contact-container {
  text-align: center;
  padding: 40px;
  display: grid;
  place-items: center;
  grid-template-columns: 0.5fr 1fr 0.5fr;
  max-width: 600px;
}

#contact h2 {
  color: var(--white);
  margin-bottom: var(--space-md);
}

#contact h2::before {
  content: "✦ ";
}

#contact img {
  display: block;
  margin: auto;
}

#contact a {
  font-size: 1.5rem;
  color: var(--white);
}

#socials {
  margin-top: var(--space-md);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

@media screen and (max-width: 480px) {
  .masonry-container {
    column-count: 1 !important;
  }

  #contact-container {
    padding: var(--space-md);
  }

  #contact-container {
    grid-template-columns: 10% 80% 10%;
  }

  #contact img {
    width: 40px;
  }
}

@media screen and (max-width: 768px) {
  .masonry-container {
    column-count: 2;
  }

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

  .project-image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lightbox-content {
    flex-direction: column;
    align-items: center;
  }

  .lightbox-caption {
    max-width: 100%;
    flex-basis: auto;
    text-align: center;
  }

  #about .container {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    justify-items: center;
    padding: var(--space-md) 0;
  }

  #about-text {
    margin: 0;
  }

  #about .container > div:first-child {
    text-align: center;
  }

  #about-pic img {
    margin-left: 0;
    margin-inline: auto;
  }

  #nav-bar {
    flex-wrap: wrap;
    padding: 25px;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    display: flex;
    width: 100%;
    max-height: 0;
    flex-direction: column;
    align-items: flex-end;
    padding-top: 0;
    gap: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
      max-height 0.3s ease,
      opacity 0.3s ease,
      padding-top 0.3s ease,
      gap 0.3s ease;
  }

  .nav-links.active {
    max-height: 200px;
    padding-top: var(--space-md);
    gap: var(--space-md);
    opacity: 1;
    pointer-events: auto;
  }

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

@media screen and (min-width: 1100px) {
  #about .container {
    padding: 40px 80px;
  }

  .masonry-container {
    column-count: 4;
  }
}
