/* ---------------------- */
/* Custom properties      */
/* ---------------------- */

:root {
  /* colors */
  --clr-dark: 214 17% 16%;
  --clr-light: 0 0% 93%;
  --clr-bright: 0 100% 66%;
  --clr-accent-dk: 232 58% 21%;
  --clr-accent-xdk: 232 58% 13%;
  --clr-accent-lg: 189 76% 74%;
  --clr-mint: 170, 68%, 61%;
  --clr-white: 0 0% 100%;
  --hue: 206;
  --bkg: var(--hue) 50% 96%;
  --text: var(--hue) 70% 9%;
  --dark: var(--hue) 70% 3%;

  --gradient: linear-gradient(
    40deg,
    rgba(14,46,112,1) 15%,
    rgba(42,89,182,1) 48%,
    rgba(22,213,190,1) 95%
    );

  /* font-sizes */
  --fs-700: clamp(2rem, 7vw + 1rem, 7rem);
  --fs-600: 1.5rem;
  --fs-500: 1.2rem;
  --fs-400: 1rem;
  --fs-300: 0.95rem;

  /* font-families */
  --ff-serif: "Judson", serif;
  --ff-sans: "Oxygen", sans-serif;
}

@media (min-width: 35em) {
  :root {
    --fs-400: 1.25rem;
    --fs-300: 1rem;
  }
}

@media (min-width: 45em) {
  :root {
    /* font-sizes */
    --fs-400: 1.75rem;
    --fs-300: 1.125rem;
  }
}

/* ------------------- */
/* Reset               */
/* ------------------- */

/* Box sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--scroll-padding, 72px);
}

/* Reset margins */
body,
h1,
h2,
h3,
h4,
h5,
p,
figure,
picture {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  overflow-wrap: break-word;
}

/* body re-sets */
body {
  font-family: var(--ff-sans);
  font-size: var(--fs-300);
  color: hsl(var(--clr-dark));
  line-height: calc(1em + 0.5rem);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;

  display: grid;
  /* grid-template-rows: min-content 1fr; */

  overflow-x: hidden;
}

/* make images easier to work with */
img,
svg,
video {
  max-width: 100%;
  height: auto;
}

picture {
  display: block;
}

/* make form elements easier to work with */
input,
button,
textarea,
select {
  font: inherit;
}

/* remove animations for people who've turned them off */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------- */
/* Utility classes     */
/* ------------------- */

/* ---- general ---- */

.grid {
  display: grid;
}

.flex {
  display: flex;
}

.d-block {
  display: block;
}

/* ---- colors ---- */

.bg-dark {
  background-color: hsl(var(--clr-dark));
}
.bg-accent-dk {
  background-color: hsl(var(--clr-accent-dk));
}
.bg-accent-lg {
  background-color: hsl(var(--clr-accent-lg));
}
.bg-bright {
  /*background-color: hsl(var(--clr-bright));*/
}
.bg-light {
  background-color: hsl(var(--clr-light));
}
.bg-white {
  background-color: hsl(var(--clr-white));
}
.bg-mint {
  background-color: hsl(var(--clr-mint));
}

.text-dark {
  color: hsl(var(--clr-dark));
}
.text-accent-dk {
  color: hsl(var(--clr-white));
}
.text-accent {
  color: hsl(var(--clr-light));
}
.text-white {
  color: hsl(var(--clr-white));
}

/* ---- typography ---- */

.ff-serif {
  font-family: var(--ff-serif);
}
.ff-sans-normal {
  font-family: var(--ff-sans);
}

.letter-spacing-1 {
  letter-spacing: 4.75px;
}
.letter-spacing-2 {
  letter-spacing: 2.7px;
}
.letter-spacing-3 {
  letter-spacing: 2.35px;
}

.uppercase {
  text-transform: uppercase;
}

.fs-700 {
  font-size: var(--fs-700);
}
.fs-600 {
  font-size: var(--fs-600);
}
.fs-500 {
  font-size: var(--fs-500);
}
.fs-400 {
  font-size: var(--fs-400);
}
.fs-300 {
  font-size: var(--fs-300);
}

h1.quote {
  line-height: calc(1em + 0.5rem);
  text-align: right;
}

h2.credit {
  line-height: 1em;
  text-align: right;
  font-size: clamp(0.4rem, 3vw + 0.5rem, 1.8rem);
}

h3.portfolio-title,
h3.cta-title,
h3.about-title {
  text-align: center;
  color: hsl(var(--clr-accent-dk));
  font-size: clamp(2rem, 6vw + 1rem, 3.5rem);
  line-height: calc(1em + 0.25rem);
  padding-bottom: 4rem;
}

p {
  line-height: calc(1em + 0.75rem);
  padding-bottom: 1em;
}

/* ---- shared layout ---- */

.navbar-area,
.intro-area,
.portfolio-header,
.portfolio-container,
.about-wrapper,
.footer-area {
  width: 90%;
  max-width: 75em;
  margin-inline: auto;
}

/* ---- navigation ---- */

.navbar {
  background-color: hsl(var(--clr-accent-dk));
  z-index: 9999;
  position: fixed;
  width: 100%;
  top: 0;
}

.navbar-area {
  justify-content: space-between;
  align-items: center;
}

.navbar-logo {
  min-width: 8rem;
  margin-top: 4px;
  cursor: pointer;
}

.nav-menu {
  margin: 0;
  padding: 0;
}

.nav-menu li {
  list-style: none;
}

.nav-menu li a {
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 4px;
  color: hsl(var(--clr-light));
  padding: 1.5rem 2rem;
  display: block;
}

.nav-menu li a:hover,
.nav-menu li a:focus,
.nav-menu li a.active {
  background-color: hsl(var(--clr-accent-xdk));
  color: hsl(var(--clr-mint));
  transition: 0.3s ease;
}

.hamburger {
  display: inline-block;
  position: relative;
  z-index: 1;
  user-select: none;
  appearance: none;
  border: none;
  outline: none;
  cursor: pointer;
  width: fit-content;
}

.hamburger span {
  display: block;
  width: 35px;
  height: 4px;
  margin-bottom: 5px;
  position: relative;
  background-color: hsl(var(--clr-light));
  border-radius: 6px;
  z-index: 1;
  transform-origin: 0 0;
  transition: 0.3s;
}

.hamburger:hover span:nth-child(2) {
  transform: translateX(10px);
  background-color: hsl(var(--clr-mint));
}

.hamburger.is-active span:nth-child(2) {
  opacity: 0;
  transform: translateX(15px);
}

.hamburger.is-active span:nth-child(1) {
  transform: translate(0px, -3px) rotate(45deg);
}

.hamburger.is-active span:nth-child(3) {
  transform: translate(-3px, 3px) rotate(-45deg);
}

.hamburger.is-active:hover span {
  background-color: hsl(var(--clr-mint));
}
@media only screen and (min-width: 58em) {
  .hamburger {
    display: none;
  }
}

@media only screen and (max-width: 58em) {
  .navbar-area {
    height: 74px;
  }

  .nav-menu {
    position: fixed;
    left: -100%;
    top: 72px;
    flex-direction: column;
    background-color: hsl(var(--clr-accent-dk));
    width: 100%;
    text-align: center;
    font-size: var(--fs-600);
    transition: 0.2s ease-in-out;
    padding: 0.75em 0;
  }

  .nav-menu.is-active {
    left: 0;
  }

  .nav-menu li:not(:last-child) {
    margin-bottom: 0.5em;
  }
}

/* ---- intro section ---- */
.intro {
  /* max-height: 70vh; */
  justify-items: end;
  align-items: end;
  padding: 3em 0 1em 0;
  margin-top: 74px;
  background-image: var(--gradient);
  background-size: 300%;
  animation: into-animation 10s infinite alternate;
}

@keyframes into-animation {
  0% {background-position: left;}
  100% {background-position: right}
}

.credit {
  padding: 1em 0 3em 0;
}

@media only screen and (max-width: 44em) {
  .intro {
    /* height: 60vh; */
    align-items: center;
    padding-top: 5em;
  }
}

/* ---- portfolio section ---- */

.portfolio,
.about,
.cta {
  padding: 7rem 0;
}

.portfolio-container {
  /* height: auto; */
  /* grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));*/
  grid-template-areas:
    "project_1 project_2 project_3 project_4"
    "project_5 project_6 project_7 project_8"
    "project_9 project_10 project_11 project_12";
  grid-gap: 0.75em;
}

@media only screen and (max-width: 57em) {
  .portfolio-container {
    grid-template-areas:
      "project_1 project_2 project_3"
      "project_4 project_5 project_6"
      "project_7 project_8 project_9"
      "project_10 project_11 project_12";
  }
}

@media only screen and (max-width: 56em) {
  .portfolio-container {
    grid-template-areas:
      "project_1 project_2 project_3"
      "project_4 project_5 project_6"
      "project_7 project_8 project_9"
      "project_10 project_11 project_12";
  }
}

@media only screen and (max-width: 44em) {
  .portfolio-container {
    grid-template-areas:
      "project_1 project_2"
      "project_3 project_4"
      "project_5 project_6"
      "project_7 project_8"
      "project_9 project_10"
      "project_11 project_12";
  }
}

@media only screen and (max-width: 35em) {
  .portfolio-container {
    grid-template-areas:
      "project_1"
      "project_2"
      "project_3"
      "project_4"
      "project_5"
      "project_6"
      "project_7"
      "project_8"
      "project_9"
      "project_10"
      "project_11"
      "project_12";
  }

  .portfolio,
  .about,
  .cta {
    padding: 5rem 0;
  }
}

.project-1 {
  grid-area: project_1;
}

.project-2 {
  grid-area: project_2;
}

.project-3 {
  grid-area: project_3;
}

.project-4 {
  grid-area: project_4;
}

.project-5 {
  grid-area: project_5;
}

.project-6 {
  grid-area: project_6;
}

.project-7 {
  grid-area: project_7;
}

.project-8 {
  grid-area: project_8;
}

.project-9 {
  grid-area: project_9;
}

.project-10 {
  grid-area: project_10;
}

.project-11 {
  grid-area: project_11;
}

.project-12 {
  grid-area: project_12;
}

.project .project-image {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.project .project-image picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  cursor: pointer;
  background-color: hsl(var(--clr-white));
  opacity: 1;

  transition: 0.5s ease-in-out;
}

.project .project-image:hover picture img {
  transform: scale(1.15);
  opacity: 0.3;
}

.project-image .project-name {
  opacity: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 999;
}

.project-name {
  text-align: center;
  width: 80%;
}

.project-image:hover .project-name {
  opacity: 1;
  animation: move-down 0.3s linear;
}

@keyframes move-down {
  0% {
    top: 10%;
  }
  50% {
    top: 35%;
  }
  100% {
    top: 50%;
  }
}

@media only screen and (max-width: 35em) {
  .project-name {
    font-size: var(--fs-600);
    line-height: 1.5;
  }
}

/* ---- about section ---- */

.about-content {
  grid-template-areas: "about_image about_text about_text";
  grid-gap: 2em;
}

.about-image {
  grid-area: about_image;
}

.mobile {
  display: none;
}

.about-text {
  grid-area: about_text;
}

@media only screen and (max-width: 44em) {
  .about-content {
    grid-template-areas:
      "about_image"
      "about_text";
  }

  .about {
    padding: 5rem 0;
  }

  .about-text {
    font-size: var(--fs-500);
  }
}

/* ---- contact section ---- */

.cta {
  background-color: hsl(var(--clr-light));
}

.cta-form {
  width: 70%;
  max-width: 45em;
  margin-inline: auto;
  grid-template-areas:
    "greeting greeting"
    "name phone"
    "email email"
    "message message"
    "submit submit";
  grid-gap: 1em;
}

@media only screen and (max-width: 50em) {
  .cta-form {
    width: 90%;
    grid-template-areas:
      "greeting"
      "name"
      "phone"
      "email"
      "message"
      "submit";
  }
  .about-text,
  .cta-text {
    font-size: var(--fs-400);
  }

}

.cta-text {
  grid-area: greeting;
}

.name {
  grid-area: name;
}

.phone {
  grid-area: phone;
}

.email {
  grid-area: email;
}

.message {
  grid-area: message;
}

.submit {
  grid-area: submit;
}

.cta-text {
  font-size: var(--fs-300);
  padding-bottom: 1rem;
}

.input-group {
  margin-bottom: 1em;
  position: relative;
}

input,
textarea {
  width: 100%;
  padding: 0.75em;
  outline: 0;
  border: 1px solid hsl(var(--clr-accent-dk));
  color: hsl(var(--clr-accent-dk));
  background: transparent;
  font-size: 1em;
}

label {
  height: 100%;
  position: absolute;
  left: 0;
  top: 0.2em;
  padding: 0.5em;
  cursor: text;
  transition: 0.2s;
}

button {
  padding: 0.5em 0;
  outline: 0;
  background: transparent;
  border: 1px solid hsl(var(--clr-accent-dk));
  width: 100%;
  cursor: pointer;
}

.submit {
  color: hsl(var(--clr-accent-dk));
}

input:focus ~ label,
input:valid ~ label,
textarea:focus ~ label,
textarea:valid ~ label {
  top: -2.5rem;
  font-size: 0.9rem;
}

.cta-form input[type="text"]:hover,
.cta-form input[type="number"]:hover,
.cta-form input[type="email"]:hover,
.cta-form textarea:hover,
button.submit:hover {
  -webkit-transition: border-color 0.3s ease-in-out;
  transition: border-color 0.3s ease-in-out;
  border: 1px solid hsl(var(--clr-mint));
}

/* ---- footer section ---- */
.footer-area {
  padding: 2em 0 3em 0;
  justify-content: space-between;
  flex-direction: row;
  align-items: center;
}

@media only screen and (max-width: 40em) {
  .footer-area {
    flex-direction: column;
  }
  .copyright {
    padding: 2em 0 2.5em 0;
  }
}

.footer-logo {
  width: 8rem;
}

.copyright {
  font-size: 0.7em;
}

.fa-linkedin {
  font-size: 2.2em;
  color: hsl(var(--clr-accent-dk));
  transition: color 0.2s;
}
.fa-linkedin:hover {
  color: hsla(232, 58%, 21%, 0.6);
}
