html {
  box-sizing: border-box;
  font-size: 100%;
}

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

body,
input,
textarea,
button {
  font-family: "Manrope", sans-serif;
  font-optical-sizing: auto;
}

body {
  margin: 0;
  background-color: var(--black);
  color: var(--grey);
  font-size: var(--fs-18);   
  line-height: 1.56; /* 28/18 = 1.55555556 */
  padding-bottom: 25rem;  

  /* overflow-x: hidden; */
}

.bg-less-dark {
  background-color: var(--darkgray);
}

h1,
h2,
h3,
p {
  margin-block-start: 0;
}

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

.header-xl {
  font-size: var(--fs-40);
  font-size: clamp(2.5rem, 0.7rem + 7.68vw, 5.5rem); 
  /* https://royalfig.github.io/fluid-typography-calculator/ */
  letter-spacing: -0.028em; /* 2.5px / 88 = 0.028 */
  line-height: 1.1;
}

p {
  font-size: var(--fs-16);
  font-size: clamp(1rem, 0.79rem + 0.89vw, 1.125rem); 
  line-height: 1.5;
  color: var(--white);
}

a {
  transition: color var(--transition);
}

a:focus-visible, 
input:focus-visible, 
textarea:focus-visible {
  outline: 2px dashed var(--blu);
  outline-offset: 2px;
}

input:invalid, 
textarea:invalid {
  outline-color: var(--red);
}
/* https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/:invalid */

/* Using SVG as a background-image on https://css-tricks.com/using-svg/ */

a.underline, button {
  display: inline-block;
  padding-bottom: 0.625rem;
  font-size: 1rem;
  line-height: 1.625; /* 26px/16 */
  letter-spacing: 0.143em; /* 2.29 / 16 = 0.143125 */
  font-weight: 700;
  text-transform: uppercase;
  color: var(--grey);
  text-decoration: none;
  background-image: linear-gradient(to right, var(--blu) 75%, var(--blu) 75%);
  background-position: 0 2.1em;
  background-repeat: repeat-x;
  background-size: 8px 2px; 
}

a:hover {
  color: var(--blu);
}

img,
svg {
  display: block;
}

.visually-hidden {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.wrapper {
  width: calc(100% - 2rem);
  max-width: var(--container);
  margin-inline: auto;
}

/* tablet style 600px */
@media (min-width: 37.5em) { /* 600px / 16 */
  .wrapper {
    width: calc(100% - 3.75rem);  /* 60px / 16 */
  }
}

/* -----UTILITY----- */
  
.bottom-border {
  border-bottom: 1px solid var(--white);
}


/* ----HEADER----- */

.header {
  position: relative;
  z-index: 1;
  margin-block-start: 20px;
}

.header__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
  gap: 20px 25px;
}

.header__home {
  font-size: var(--fs-24);
  font-size: clamp(1.5rem, 1.02rem + 2.04vw, 2rem);  
  /* https://royalfig.github.io/fluid-typography-calculator/ */
  line-height: 1;
  color: var(--grey);
  text-decoration: none;
  flex: 1 0 100%;
}

.header__social > svg > path {
  transition: fill var(--transition);
}

.header__social:hover > svg > path {
  fill: var(--blu);
}

/* tablet header */
@media (min-width: 37.5em) { /* 600px / 16 */

  .header {
    margin-block-start: 30px;
    /* margin-bottom: 90px; */
  }

  .header__nav {
    justify-content: flex-start;
    align-items: center;
    text-align: left;
    gap: 32px;
    /* margin-bottom: 90px; */
  }

  .header__home {
    flex: 0 1 auto; 
    margin-inline-end: auto;
  }
}

/* desktop header */
@media (min-width: 64.0625em) {
  .header {
    margin-block-start: 40px;
    margin-block-end: 127px;
  }

  .header__nav {
    padding-right: 30px;
  }
}

/* -----HERO----- */

.hero__wrapper {
  padding-bottom: 80px;
}

.hero__image {
  position: absolute; 
  top: 0; 
  left: 50%; 
  translate: -50%; 
  display: block; 
  width: 174px;
  height: auto;
}
 
.hero__triangle {
  position: absolute;
  right: 50%;
  top: 130px; /* 130px / 16 = 8.125rem */
  z-index: -1; /* puts the rings behind Adam's image */
  height: auto;
}

.hero__text {
  position: relative;
  text-align: center;
  margin-block-start: 335px; /* no overlapping test, 335px / 16 = 20.9375 */
}

.hero__headline    {
  margin-block-end: 24px;
}

.hero__headline > br {
  display: none;
}

h1 > span {
  background-image: linear-gradient(to right, var(--blu) 75%, var(--blu) 75%);
  background-position: 0 1.18em;
  background-repeat: repeat-x;
  background-size: 8px 4px;
}

.hero__description {
  margin-block-end: 24px;
}

/* tablet hero */
@media (min-width: 37.5em) {
  .hero {
    position: relative;
    margin-block-start: -62px;
  }

  .hero__wrapper {
    padding-bottom: 60px;
  }

  .hero__content {
    display: flex;
    align-items: center;
  }

  .hero__content picture {
    order: 2;
  }

  .hero__image {
    position: relative;
    width: 42vw;
    max-width: 445px;
    height: auto;
    left: auto;
    right: 0;
    translate: 0;
  }

  .hero__triangle {
    top: 90px;
    right: auto;
    left: 0;
    translate: -50%;
  }

  .hero__text {
    margin-block-start: 90px;
    margin-right: -30px;
    flex: 1 0 58vw;
    text-align: left;
    z-index: 1;
  }

  .hero__headline {
    margin-block-end: 60px; 
  }

  .hero__headline > br {
    display: inline-block;
  }

  .hero__description {
    margin-block-end: 34px;
  }
}

/* desktop hero */
@media (min-width: 64.0625em) {  /* 1025px / 16 */

  .hero {
    margin-block-start: 0px;
  }

  .hero__wrapper {
    position: relative;
    padding-bottom: 100px;
  }

  .hero__content {
    align-items: flex-start;
  }

  .hero__content picture {
    margin-left: -80px;
  }

  .hero__image {
    /* width: 100%; */
    margin-block-start: -229px;
  }

  .hero__triangle {
    top: 0px;
    translate: -50% -30%;
  }

  .hero__text {
    margin-block-start: 0;
    margin-right: 0;
    flex: 1; 
  }

  .hero__headline {
    margin-block-end: 43px;
  }

  .hero__headline > br {
    display: none;
  }

  .hero__description {
    width: 38ch; /* ch is a unit for controlling the length of lines of text. */
    margin-block-end: 66px;
  }
}

/* -----SKILLS----- */

.skills {
  position: relative;
}

.skills__wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding-block: 40px; /* applies a vertical padding of 40px to both the top and bottom of the element, following the block direction. */
}

.skills__item {
  text-align: center;
}

.skills__title {
  font-size: 2rem;
  font-size: clamp(2rem, 0.33rem + 7.11vw, 3rem);
  line-height: 1.17;
  margin-block-end: 2px;
}

.skills__description {
  margin-block-end: 0;
}

.skills__circle {
  position: absolute;
  bottom: 0;
  left: 50%;
  translate: 0 50%; 
  z-index: -1;
}

/* tablet skills */
@media (min-width: 37.5em){
  .skills__wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 52px 24px;
    border: none;
    padding-block: 52px 0;
    
  }

  .skills__item {
    text-align: left;
  }

  .skills__circle {
    translate: 40% 50%; 
  }
}

/* desktop skills */
@media (min-width: 64.0625em) {  /* 1025px / 16 */
  .skills__wrapper {
    grid-template-columns: repeat(3, 1fr);
    gap: 58px 30px;
    padding-block-start: 72px;
  }

  .skills__circle {
    translate: -140% 50%;
    left: 100%;
  }
}

/* -----PROJECTS----- */

.projects__wrapper {
  padding-block: 140px;
}

.projects__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  justify-items: center;
  text-align: center;
}

.projects__headline {
  grid-column: 1 / span 2;
  margin-block-end: 0;
}

.projects__contact {
  grid-column: 1 / span 2;
  /* justify-self: end; */
  /* align-self: center; */
}

.projects__item {
  grid-column: 1 / span 2;
}

.projects__picture {
  display: block; 
  margin-block-end: 20px;
}

.projects__image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1.7px solid var(--blu);
}

.projects__name {
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 700;
  text-transform: uppercase;
  margin-block-end: 7px;
}

.projects__tags {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-block-end: 20px; /* instead of margin-bottom */
  text-transform: uppercase;
}

.projects__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* tablet projects */
@media (min-width: 37.5em){

  .projects__grid {
    gap: 60px 24px;
    justify-items: start;
    text-align: left;
  }

  .projects__contact {
    justify-self: end;
  }

  .projects__item {
    grid-column: span 1;
  }

  .projects__headline, 
  .projects__contact {
    grid-column: span 1;
  }

  .projects__contact {
    align-self: center;
  }

  .projects__tags,
  .projects__links {
    display: block;
  }

  .projects__tags span {
    margin-inline-end: 18px; /* instead of margin-right */
  }

  .projects__links a {
    margin-inline-end: 30px;
  }
} 

/* desktop projects */
@media (min-width: 64.0625em) {  /* 1025px / 16 */
  .projects__grid {
    gap: 70px 30px;
  }

  .projects__contact {
    justify-self: end;
  }
  
  .projects__item {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, auto);
  }

  .projects__picture {
    position: relative;
    grid-column: 1 / 2;
    grid-row: 1 / 2;
  }

  .projects__picture::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    background-color: hsl(0, 0%, 0%);
    opacity: 0;
    transition: opacity 150ms ease-in-out;
  }

  .projects__item:hover .projects__picture::after {
    opacity: 0.5;
  }

  .projects__item:hover .projects__links {
    opacity: 1;
  }

  .projects__item:focus-within .projects__links {
    opacity: 1;
  }

  .projects__item:focus-within .projects__picture::after {
    opacity: 0.5;
  }

  .projects__image {
    width: 100%;
    height: auto;
  }

  .projects__links {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    justify-self: center;
    align-self: center;
    z-index: 1;
    opacity: 0;
    transition: opacity 400ms ease-in-out;
  } 

  .projects__links:hover ~ .projects__picture::after {
    opacity: 0.5;
  }

  .projects__tags {
    margin-block-end: 0;
  }
}

/* -----CONTACT----- */

.contact {
  position: relative;
  /* background-color: var(--darkgray); */
}

.contact__wrapper {
  padding-block: 84px;
  /* max-width: 27.8125rem; */ 
  /* 445px / 16 = 27.8125 */
  /* margin-inline: auto; */
}

.contact__headline {
  margin-block-end: var(--fs-20);
}

.contact__control {
  position: relative;
  margin-block-end: 16px;
}

.contact__control input,
.contact__control textarea {
  width: 100%;
  /* margin-block-end: 16px; */
  padding-block: 16px; /* 16px/16 = 1rem */
  padding-inline: 24px; /* 24px/16 = 1.5rem */
  border: none;
  border-bottom: 1px solid var(--grey);
  background: transparent;
  font-size: var(--fs-16);
  line-height: 1.625; /* 26px/16 */
  color: var(--grey);
} 

.contact__control > *::placeholder {
  color: var(--grey);
  opacity: 0.5;
  text-transform: uppercase;
}

.contact__control textarea {
  margin-block-end: 32px;
} 

.contact__control.align-right {
  display: flex;
  justify-content: flex-end;
}

.contact__control button {
  background-color: transparent;
  border: none;
}

.contact__invalid-icon {
  display: none;
  width: var(--fs-24);
  height: var(--fs-24);
  position: absolute;
  right: 0;
  top: 50%;
  translate: -50% -50%;
}

.contact__control input:focus-visible:invalid ~ .contact__invalid-icon,
.contact__control textarea:focus-visible:invalid ~ .contact__invalid-icon {
  display: inline-block;
}

.contact__control textarea:focus-visible:invalid ~ .contact__invalid-icon {
  top: 1.2rem;
  right: 1.5rem;
  translate: none;
}

.contact__square {
  position: absolute;
  left: 0;
  bottom: 70px;
  translate: -20%;
}

/* tablet contact */

@media (min-width: 37.5em) {

  .contact__square {
    bottom: 55px;
    translate: -5%;
  }
}

/* desktop contact */

@media (min-width: 64.0625em) {  /* 1025px / 16 */

  .contact__wrapper {
    display: grid;
    grid-template-columns: repeat(2, 27.8125rem);
    justify-content: space-between;
  }

  .contact__headline {
    margin-block-end: var(--fs-36);
  }

  .contact__square {
    translate: 250%;
  }
} 

@media (max-width: 64.06125em) { /* 1024.98px / 16 */

  .contact__wrapper {
    max-width: 27.8125rem; /* 445px / 16 = 27.8125 */
  }

  .contatc__text {
    text-align: center;
  }
} 

footer {
  padding-block: 40px 60px;
}

/* tablet footer */

@media (min-width: 37.5em) {

  footer {
    padding-block: 30px 40px;
  }
}

/* desktop contact */

@media (min-width: 64.0625em) {  /* 1025px / 16 */

  footer {
    padding-block: 47px 92px;
  }
} 
