:root {
  --nav-height: 60px;
}

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

html {
  font-family: "Poppins", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --primary-color: #0099ff;
  --color-body: #f3f3f3;
  --color-text: #383636;
  --btn-cta-shadow: rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] {
  --primary-color: #2c2c2c;
  --color-body: #494242;
  --color-text: #f3f3f3;
  --btn-cta-shadow: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] * {
  transition: all 0.3s ease;
}

body {
  margin: 0;
  background-color: var(--color-body);
  line-height: 2;
}

/* global */
a {
  text-decoration: none;
}

p,
h1 {
  color: var(--color-text);
}

ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
}

.wrapper {
  /* clamp(min, prefered, max) */
  width: clamp(320px, 95%, 1200px);
  margin: 0 auto;
}

.btn {
  padding: 0.5rem 1rem;
  outline: none;
  border: none;
}

/* navbar */
header {
  height: var(--nav-height);
  background-color: var(--primary-color);
}

.header-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

nav {
  display: flex;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 500;
  color: #f3f3f3;
}

.navbar {
  display: flex;
}

.navbar__link {
  color: #f3f3f3;
  padding: 0 1rem;
}

/* switch */
.theme-checkbox {
  display: none;
}

.switch {
  display: flex;
  align-items: center;
  position: relative;
  width: 55px;
  height: 30px;
  background-color: #f3f3f3;
  border-radius: 3rem;
}

.switch::before {
  position: absolute;
  content: "";
  left: 2px;
  height: 26px;
  width: 26px;
  border-radius: 50%;
  transform: scale(1.3);
  transition: left 0.3s ease-in;
  box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2),
    0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12);
  background: #fff url("./imgs/sun.png");
  background-size: 18px;
  background-repeat: no-repeat;
  background-position: center;
}

.theme-checkbox:checked + .switch {
  background-color: rgb(218, 216, 216);
}

.theme-checkbox:checked + .switch::before {
  left: 25px;
  background: #fff url("./imgs/moon.png");
  background-size: 18px;
  background-repeat: no-repeat;
  background-position: center;
}

/* hero */
.hero {
  display: flex;
  justify-content: center;
  align-items: center;
  height: calc(100vh - var(--nav-height));
}

.hero .hero__intro {
  flex: 1;
  animation: animateLeft 1s ease;
}
.hero .hero__intro h1 {
  font-size: 4.5rem;
  font-weight: 600;
  margin: 0.5rem 0;
}
.btn-cta {
  padding: 1rem 2rem;
  font-size: 1.5rem;
  background-color: var(--primary-color);
  color: #f3f3f3;
  border-radius: 3rem;
}

.btn-cta:hover {
  box-shadow: 0 0 0 6px var(--btn-cta-shadow);
}

.btn-cta:active {
  transform: scale(0.98);
}

.hero .hero__photo {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  animation: animateRight 1s ease;
}

@keyframes animateLeft {
  from {
    opacity: 0.2;
    transform: translateX(-150px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes animateRight {
  from {
    opacity: 0.2;
    transform: translateX(150px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.hero .hero__photo img {
  height: 60vh;
}

@media screen and (max-width: 768px) {
  .header-wrapper {
    padding: 0 1rem;
  }

  .hero {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero .hero__photo {
    display: flex;
    align-items: center;
  }

  .hero .hero__intro {
    padding: 1rem 2rem;
  }

  .hero .hero__intro h1 {
    font-size: 3rem;
  }

  .hero .hero__photo img {
    height: 30vh;
  }
}
