/* variables */

:root {
  --foreground: #f8f8ff;
  --background: #181c1f;
  --accent: #059669;
}

/* z-index */

/* 
nav = 10
iphone mask = 30
iphone statusbar = 25
project description = 20
*/

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

html {
  /* Set font size for easy rem calculations
   * default document font size = 16px, 1rem = 16px, 100% = 16px
   * (100% / 16px) * 10 = 62.5%, 1rem = 10px, 62.5% = 10px
   */
  font-size: 62.5%;
  scroll-behavior: smooth;
}

/* I use the following max-widths as styling points for media query */
/* 1200px / 16px = 75em */
@media (max-width: 75em) {
  html {
    font-size: 60%;
  }
}

/* 980px / 16px = 61.25em */
@media (max-width: 61.25em) {
  html {
    font-size: 58%;
  }
}

/* 460px / 16px = 28.75em */
@media (max-width: 28.75em) {
  html {
    font-size: 55%;
  }
}

/* poppins-regular - latin */
@font-face {
  font-display: swap;
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  src: url("../fonts/poppins-v20-latin-regular.woff2") format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* raleway-regular - latin */
@font-face {
  font-display: swap;
  font-family: "Raleway";
  font-style: normal;
  font-weight: 400;
  src: url("../fonts/raleway-v28-latin-regular.woff2") format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

/* raleway-700 - latin */
@font-face {
  font-display: swap;
  font-family: "Raleway";
  font-style: normal;
  font-weight: 700;
  src: url("../fonts/raleway-v28-latin-700.woff2") format("woff2"); /* Chrome 36+, Opera 23+, Firefox 39+, Safari 12+, iOS 10+ */
}

@font-face {
  font-family: "Fira Mono";
  src: url("../fonts/FiraMono-Regular.ttf") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fira Mono";
  src: url("../fonts/FiraMono-Medium.ttf") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fira Mono";
  src: url("../fonts/FiraMono-Bold.ttf") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

body {
  font-family: "Poppins", sans-serif;
  font-size: 1.8rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--foreground);
}

h1,
h2 {
  font-family: "Raleway", sans-serif;
  font-weight: 700;
  text-align: center;
}

h1 {
  font-size: 6rem;
}

h2 {
  font-size: 4.2rem;
  margin-top: 6rem;
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
  color: var(--foreground);
}

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

.about-section,
.services-section,
.projects-section,
.contact-section,
.impressum-section,
.datenschutz-section {
  min-height: 100dvh;
  padding: 2rem;
}

/* navigation on small media devices > 450px */
.hamburger-menue {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger-menue-bar {
  font-size: 4rem;
  color: var(--foreground);
  transition: 0.3s;
  transition: transform 0.3s cubic-bezier(0.4, 2, 0.6, 1), color 0.2s;
}

.hamburger-menue.open .hamburger-menue-bar {
  transform: rotate(90deg) scale(1.2);
  color: var(--accent);
}

@media (max-width: 28.125em) {
  /* 450px / 16 = 28.125em */
  .hamburger-menue {
    display: flex;
    margin: 1rem;
  }
  .nav-list {
    position: absolute;
    top: 70px;
    left: 15px;
    flex-direction: column;
    background: var(--background);
    box-shadow: 0 2px 8px 0
        color-mix(in srgb, var(--foreground) 15%, transparent),
      0 1.5px 4px 0 color-mix(in srgb, var(--accent) 10%, transparent);
    border-radius: 1.5rem;
    padding: 2rem 0;
    display: none;
  }
  .nav-list.open {
    display: flex; /* show when toggled */
    flex-direction: column;
  }
}

/* navigation desktop */
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--background);
  z-index: 10;
  box-shadow: 0 4px 16px -6px rgba(0, 0, 0, 0.13);
}

@media (min-width: 28.126em) {
  /* 450px + 1px */
  .nav-list {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
  }
}

.nav-list a {
  display: block;
  font-size: 2.2rem;
  padding: 2rem;
  transition: background 0.2s;
}

.nav-list a:hover {
  background: var(--accent);
  color: var(--background);
}

/* about section */
.about-section {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  overflow: hidden;
  background-color: var(--background);
}

.about-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/img/background.webp") center center/cover no-repeat;
  -webkit-mask-image: url("/img/splash.webp");
  mask-image: url("/img/splash.webp");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100%;
  mask-size: 100%;
  -webkit-mask-position: center center;
  mask-position: center center;
  pointer-events: none;
  opacity: 0.5;
}

@media (max-width: 61.25em) {
  .about-section::before {
    -webkit-mask-size: 140%;
    mask-size: 140%;
  }
}

@media (max-width: 28.75em) {
  .about-section::before {
    -webkit-mask-size: 180%;
    mask-size: 180%;
  }
}

.about-section h1 {
  position: relative;
  width: 80vw;
  margin: 0 auto;
  z-index: 5;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.about-section .code {
  color: var(--accent);
}

.about-section-slogans {
  position: relative;
  text-align: center;
  font-size: 2.5rem;
  font-weight: 200;
  font-family: "Fira Mono", monospace;
  z-index: 5;
  margin: 0 auto;
  width: 350px;
  height: 100px;
}

/* services section */
.services-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: var(--background);
}

.services-section-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 4rem;
  margin: 2rem;
}

.services-section-card {
  background: var(--background);
  border-radius: 3rem;
  box-shadow: 0 2px 8px 0 color-mix(in srgb, var(--foreground) 15%, transparent),
    0 1.5px 4px 0 color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 2rem 1.5rem 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.service-icon {
  font-size: 3rem;
  padding: 1rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 8%, var(--background) 92%);
  color: var(--accent);
  border: none;
  box-shadow: 0 2px 12px 0 color-mix(in srgb, var(--accent) 20%, transparent);
  margin: 1rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* projects section */
.projects-section {
  background-color: var(--background);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* projects carousel */
.carousel {
  overflow: hidden;
}

.carousel-cell {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 50vw;
  margin: 2rem 5rem;
}

/* 28.75 x 16px = 460px */
@media (max-width: 28.125em) {
  .carousel-cell {
    width: 50vw;
  }
}

.project {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  text-align: center;
}

.project:hover .code {
  color: var(--accent);
}

.project-title {
  text-align: center;
  font-size: 2.5rem;
}

.code {
  color: var(--background);
  transition: color 0.3s ease-out;
}

/* iphone */
.preview {
  position: relative;
  width: 210px;
}

.status-bar {
  position: absolute;
  top: 10px;
  left: 0px;
  width: 100%;
  height: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  margin: 0 auto;
  font-size: 1rem;
  color: var(--foreground);
  border-radius: 100%;
  background: var(--background);
  z-index: 25;
  box-sizing: border-box;
  pointer-events: none;
  overflow: hidden;
}

.mask {
  background: url("/img/iphone-frame.webp");
  background-size: cover;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 30;
}

.preview:before {
  display: block;
  content: "";
  padding-top: 200%;
  border-radius: 3.5rem;
}

.canvas {
  position: absolute;
  left: 6.409266409266409%;
  right: 6.409266409266409%;
  top: 30px;
  bottom: 2.908587257617734%;
  overflow: hidden;
}

.project-description {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  transition: opacity 0.2s;
  background: var(--foreground);
  color: var(--background);
  padding: 1rem;
  margin: 0 10px 10px 10px;
  text-align: center;
  z-index: 20;
}

.project-description.visible {
  opacity: 1;
}

/* contact section */
.contact-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 2rem;
  background: var(--background);
}

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

@media (max-width: 28.125em) {
  .contact-section-header > h2 {
    font-size: 4rem;
  }
}

.contact-section-link {
  font-size: 2.4rem;
  transition: transform 0.3s ease-out;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 1.5rem 3rem;
  border-radius: 5px;
  box-shadow: 0 2px 8px 0 color-mix(in srgb, var(--foreground) 15%, transparent),
    0 1.5px 4px 0 color-mix(in srgb, var(--accent) 10%, transparent);
}

.contact-details:hover {
  transform: translateY(0.8rem);
}

/* footer */
footer {
  font-weight: 300;
  display: flex;
  justify-content: space-evenly;
  padding: 2rem;
  background: var(--background);
}

footer ul {
  font-size: 1.5rem;
  display: flex;
  gap: 2rem;
}

/* impressum */
.impressum-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  margin: 0 auto;
  background-color: var(--background);
  color: var(--foreground);
}

.impressum-section h1 {
  text-align: left;
  font-size: 5rem;
  margin-bottom: 20px;
}

.impressum-section p strong {
  display: block;
  margin: 1.5rem 0 0.5rem 0;
  font-size: 2rem;
  color: var(--accent);
}

/* datenschutz */
.datenschutz-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  margin: 0 auto;
  background-color: var(--background);
  color: var(--foreground);
}

.datenschutz-section h1 {
  text-align: left;
  font-size: 5rem;
  margin-top: 6rem;
  line-break: auto;
}

.datenschutz-section h4 {
  margin: 1.5rem 0 0.5rem 0;
  font-size: 2rem;
  color: var(--accent);
}

.datenschutz-section p {
  margin: 1.5rem 0 0.5rem 0;
}

.back-btn {
  font-size: 3rem;
  border: none;
  margin-bottom: 2rem;
  background: none;
  color: var(--accent);
  cursor: pointer;
}
