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

@font-face {
  font-family: "Source Code Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/SourceCodePro-400.ttf");
}

@font-face {
  font-family: "Source Code Pro";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("./fonts/SourceCodePro-900.ttf");
}

@font-face {
  font-family: "Source Sans Pro";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("./fonts/SourceSansPro-300.ttf");
}

@font-face {
  font-family: "Source Sans Pro";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("./fonts/SourceSansPro-900.ttf");
}

:root {
  --ff-primary: "Source Sans Pro", sans-serif;
  --ff-secondary: "Source Code Pro", monospace;

  --fw-reg: 300;
  --fw-bold: 900;

  --clr-light: #fff;
  --clr-dark: #303030;
  --clr-accent: #16e0bd;

  --fs-h1: 3rem;
  --fs-h2: 2.25rem;
  --fs-h3: 1.25rem;
  --fs-body: 1rem;

  --bs: 0.25em 0.25em 0.75em rgba(0, 0, 0, 0.25),
    0.125em 0.125em 0.25em rgba(0, 0, 0, 0.15);
}

@media (min-width: 800px) {
  :root {
    --fs-h1: 4.5rem;
    --fs-h2: 3.75rem;
    --fs-h3: 1.5rem;
    --fs-body: 1.125rem;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--clr-light);
  color: var(--clr-dark);
  margin: 0;
  font-family: var(--ff-primary);
  font-size: var(--fs-body);
  line-height: 1.6;
}

section {
  padding: 5em 2em;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3 {
  line-height: 1;
  margin: 0;
}

h1 {
  font-size: var(--fs-h1);
}

h2 {
  font-size: var(--fs-h2);
}

h3 {
  font-size: var(--fs-h3);
}

strong {
  font-weight: var(--fw-bold);
}

:focus {
  outline: 3px solid var(--clr-accent);
  outline-offset: 3px;
}

.btn {
  display: inline-block;
  padding: 0.5em 2.5em;
  background: var(--clr-accent);
  color: var(--clr-dark);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: var(--fw-bold);
  transition: transform 200ms ease-in-out;
}

.btn:hover {
  transform: scale(1.1);
}

section > .title {
  margin-bottom: 0.25em;
}

section > .subtitle {
  margin: 0;
  font-size: var(--fs-h3);
}

section.intro > .title {
  font-weight: var(--fw-reg);
}

section.intro > .title > strong {
  display: block;
}

section.intro > .subtitle,
section.about > .subtitle {
  background: var(--clr-accent);
  padding: 0.25em 1em;
  font-family: var(--ff-secondary);
  margin-bottom: 1rem;
}

section.my-work > .subtitle {
  color: var(--clr-accent);
  font-weight: var(--fw-bold);
  margin-bottom: 2em;
}

header {
  display: flex;
  justify-content: space-between;
  padding: 1em;
}

header > .logo {
  margin: 0;
  padding: 0;
}

nav {
  position: fixed;
  background: var(--clr-dark);
  color: var(--clr-light);
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;

  transform: translateX(100%);
  transition: transform 250ms cubic-bezier(0.5, 0, 0.5, 1);
}

header > nav > ul {
  list-style: none;
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  margin: 0;
  padding: 0;
}

header > nav > ul > li > a {
  color: inherit;
  font-weight: var(--fw-bold);
  font-size: var(--fs-h2);
  text-decoration: none;
}

header > nav > ul > li > a:hover {
  color: var(--clr-accent);
}

header .nav-toggle {
  padding: 0.5em;
  background: transparent;
  border: 0;
  cursor: pointer;
  position: fixed;
  right: 2em;
  top: 2em;
  z-index: 4;
}

body.nav-open nav {
  transform: translateX(0);
}

body.nav-open > header .nav-toggle {
  position: fixed;
}

body.nav-open .hamburger {
  transform: rotate(0.625turn);
}

body.nav-open .hamburger::before {
  transform: rotate(90deg) translateX(-6px);
}

body.nav-open .hamburger::after {
  opacity: 0;
}

header .hamburger {
  display: block;
  position: relative;
}

header .hamburger,
header .hamburger::before,
header .hamburger::after {
  background: var(--clr-accent);
  width: 1.5em;
  opacity: 0.8;
  height: 3px;
  border-radius: 1em;
  transition: transform 250ms ease-in-out;
}

header .hamburger::before,
header .hamburger::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
}

header .hamburger::before {
  top: 6px;
}

header .hamburger::after {
  bottom: 6px;
}

section.intro {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

section.intro > img {
  box-shadow: var(--bs);
  max-width: 250px;
}

section.intro > .subtitle {
  display: inline-block;
}

section.intro > ul.links {
  list-style: none;
  padding: 0;
  grid-column: span 2;
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, 200px);
  justify-content: space-between;
}

section.intro > ul.links a {
  font-weight: var(--fw-bold);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  transition: transform 250ms ease-in-out;
}

section.intro > ul.links a:hover {
  transform: scale(1.2);
}

section.intro > .links a > img {
  width: 30px;
}

@media (min-width: 600px) {
  section.intro {
    display: grid;
    justify-content: center;
    grid-column-gap: 3em;
    grid-template-areas:
      "img title"
      "img subtitle";
    grid-template-columns: min-content max-content;
  }

  section.intro > img {
    grid-area: img;
    min-width: 250px;
  }

  section.intro > img.portfolio-image {
    min-width: 400px;
  }

  section.intro > .subtitle {
    align-self: start;
    grid-column: -1 / 1;
    grid-row: 2;
    text-align: right;
    padding-left: 200px;
    position: relative;
    left: -1.5em;
  }
}

@media (max-width: 400px) {
  section.intro > .links {
    flex-direction: column;
    gap: 20px;
  }
}

section.my-services {
  background-color: var(--clr-dark);
  background-image: url(./imgs/services-bg.jpg);
  background-size: cover;
  background-blend-mode: hard-light;
  color: var(--clr-light);
  text-align: center;
}

section.my-services > .title {
  color: var(--clr-accent);
  position: relative;
}

section.my-services > .title::after {
  content: "";
  display: block;
  width: 25%;
  height: 1px;
  margin: 0.5em auto 1em;
  background: var(--clr-light);
  opacity: 0.25;
}

section.my-services > .services {
  margin-bottom: 4em;
}

section.my-services .service {
  max-width: 500px;
  margin: 0 auto;
}

@media (min-width: 900px) {
  section.my-services > .services {
    display: grid;
    grid-template-columns: repeat(3, minmax(250px, 400px));
    justify-content: center;
    gap: 2em;
  }
}

section.about {
  max-width: 1000px;
  margin: 0 auto;
}

section.about > img {
  box-shadow: var(--bs);
}

@media (min-width: 600px) {
  section.about {
    display: grid;
    grid-template-columns: 1fr 200px;
    grid-template-areas:
      "title img"
      "subtitle img"
      "text img";
    grid-column-gap: 2em;
  }

  section.about > .title {
    grid-area: title;
  }

  section.about > .subtitle {
    grid-area: subtitle;
    grid-column: 1 / span 2;
    position: relative;
    left: -1em;
    width: calc(100% + 1.5em);
    padding-left: 1em;
    padding-right: calc(200px + 4em);
  }

  section.about > img {
    grid-area: img;
    position: relative;
    z-index: 2;
  }
}

section.my-work {
  background-color: var(--clr-dark);
  color: var(--clr-light);
  text-align: center;
}

section.my-work > .portfolio {
  display: grid;
  justify-content: center;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 8px;
}

section.my-work > .portfolio > .item {
  background-color: var(--clr-accent);
  overflow: hidden;
  position: relative;
}

section.my-work > .portfolio > .item > img.project {
  height: 100%;
  transition:
    transform 750ms cubic-bezier(0.5, 0, 0.5, 1),
    opacity 250ms linear;
}

section.my-work > .portfolio > .item > img.project:hover,
section.my-work > .portfolio > .item:focus > img.project {
  transform: scale(1.2);
  opacity: 0.5;
}

section.my-work > .portfolio > .item > img.language {
  width: 40px;
  position: absolute;
  right: 10px;
  bottom: 10px;
  opacity: 0.8;
}

section.my-work > .portfolio > .item:focus {
  position: relative;
  z-index: 2;
}

footer {
  background: #111;
  color: var(--clr-accent);
  text-align: center;
  padding: 2.5em 0;
}

footer .icon {
  width: 30px;
  height: 30px;
  background-size: cover;
  margin: 0 auto;
}

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

footer a {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
}

footer a:hover,
footer .icon:hover {
  opacity: 0.7;
}

footer a:hover {
  text-decoration: underline;
}

footer ul {
  list-style: none;
  display: flex;
  justify-content: center;
  margin: 2em 0 0;
  padding: 0;
  gap: 2em;
}

.portfolio-item-individual {
  font-size: 1.25rem;
  padding: 0 2em 2em;
  max-width: 1000px;
  margin: 0 auto;
}

.portfolio-item-individual > img {
  max-width: min(100%, 700px);
  margin: 0 auto;
}

.portfolio-item-individual > p {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}
