/* ===== CSS VARIABLES ===== */
:root {
  --header-height: 3rem;
  
  /* Colors */
  --hue-color: 230;
  --first-color: hsl(var(--hue-color), 69%, 61%);
  --first-color-second: hsl(var(--hue-color), 69%, 61%);
  --first-color-alt: hsl(var(--hue-color), 57%, 53%);
  --first-color-lighter: hsl(var(--hue-color), 92%, 85%);
  --title-color: hsl(var(--hue-color), 8%, 15%);
  --text-color: hsl(var(--hue-color), 8%, 45%);
  --text-color-light: hsl(var(--hue-color), 8%, 65%);
  --input-color: hsl(var(--hue-color), 70%, 96%);
  --body-color: hsl(var(--hue-color), 60%, 99%);
  --container-color: #fff;
  --scroll-bar-color: hsl(var(--hue-color), 12%, 90%);
  --scroll-thumb-color: hsl(var(--hue-color), 12%, 80%);

  /* Typography */
  --body-font: 'Inter', sans-serif;
  --code-font: 'JetBrains Mono', monospace;

  --big-font-size: 2rem;
  --h1-font-size: 1.5rem;
  --h2-font-size: 1.25rem;
  --h3-font-size: 1.125rem;
  --normal-font-size: .938rem;
  --small-font-size: .813rem;
  --smaller-font-size: .75rem;

  /* Font weight */
  --font-medium: 500;
  --font-semi-bold: 600;
  --font-bold: 700;

  /* Margins Bottom */
  --mb-0-25: .25rem;
  --mb-0-5: .5rem;
  --mb-0-75: .75rem;
  --mb-1: 1rem;
  --mb-1-5: 1.5rem;
  --mb-2: 2rem;
  --mb-2-5: 2.5rem;
  --mb-3: 3rem;

  /* z index */
  --z-tooltip: 10;
  --z-fixed: 100;
  --z-modal: 1000;

  /* Animation */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Font size for large devices */
@media screen and (min-width: 968px) {
  :root {
    --big-font-size: 3rem;
    --h1-font-size: 2.25rem;
    --h2-font-size: 1.5rem;
    --h3-font-size: 1.25rem;
    --normal-font-size: 1rem;
    --small-font-size: .875rem;
    --smaller-font-size: .813rem;
  }
}

/* Dark theme */
body.dark-theme {
  --first-color-second: hsl(var(--hue-color), 30%, 8%);
  --title-color: hsl(var(--hue-color), 8%, 95%);
  --text-color: hsl(var(--hue-color), 8%, 75%);
  --input-color: hsl(var(--hue-color), 29%, 16%);
  --body-color: hsl(var(--hue-color), 28%, 12%);
  --container-color: hsl(var(--hue-color), 29%, 16%);
  --scroll-bar-color: hsl(var(--hue-color), 12%, 48%);
  --scroll-thumb-color: hsl(var(--hue-color), 12%, 36%);
}

/* ===== BASE ===== */
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0 0 var(--header-height) 0;
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
  background-color: var(--body-color);
  color: var(--text-color);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
  line-height: 1.2;
}

ul {
  list-style: none;
}

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

img {
  max-width: 100%;
  height: auto;
}

/* ===== REUSABLE CSS CLASSES ===== */
.container {
  max-width: 1200px;
  margin-left: var(--mb-1-5);
  margin-right: var(--mb-1-5);
}

.grid {
  display: grid;
}

.section {
  padding: 2rem 0 4rem;
}

.section__title {
  font-size: var(--h1-font-size);
  color: var(--title-color);
  text-align: center;
  margin-bottom: var(--mb-0-5);
}

.section__subtitle {
  display: block;
  font-size: var(--small-font-size);
  color: var(--text-color-light);
  text-align: center;
  margin-bottom: var(--mb-3);
}

.section__header {
  margin-bottom: var(--mb-3);
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  background-color: var(--first-color);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: .5rem;
  font-weight: var(--font-medium);
  text-align: center;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  font-size: var(--normal-font-size);
}

.btn:hover {
  background-color: var(--first-color-alt);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.btn--secondary {
  background-color: transparent;
  color: var(--first-color);
  border: 2px solid var(--first-color);
}

.btn--secondary:hover {
  background-color: var(--first-color);
  color: #fff;
}

.btn--small {
  padding: .75rem 1rem;
  font-size: var(--small-font-size);
}

/* ===== HEADER & NAV ===== */
.nav {
  width: 100%;
  height: var(--header-height);
  background-color: var(--body-color);
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-fixed);
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nav__container {
  max-width: 1200px;
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 var(--mb-1-5);
}

.nav__logo {
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
  font-size: var(--h3-font-size);
}

.nav__menu {
  position: relative;
}

.nav__list {
  display: flex;
  column-gap: 2rem;
}

.nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: var(--small-font-size);
  color: var(--title-color);
  font-weight: var(--font-medium);
  padding: .5rem;
  border-radius: .25rem;
  position: relative;
  transition: var(--transition);
}

.nav__link:hover,
.nav__link.active {
  color: var(--first-color);
}

.nav__link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background-color: var(--first-color);
  border-radius: 50%;
}

.nav__toggle,
.nav__close {
  display: none;
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--body-color) 0%, var(--first-color-lighter) 100%);
  padding: calc(var(--header-height) + 2rem) 0 2rem;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.hero__container {
  max-width: 1200px;
  margin: 0 var(--mb-1-5);
  display: grid;
  gap: 1.5rem;
  align-items: center;
}

.hero__content {
  display: grid;
  gap: 1.5rem;
}

.hero__title {
  font-size: var(--big-font-size);
  margin-bottom: var(--mb-0-75);
  font-weight: var(--font-bold);
}

.hero__highlight {
  background: linear-gradient(135deg, var(--first-color), var(--first-color-alt));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__subtitle {
  font-size: var(--h3-font-size);
  color: var(--text-color);
  font-weight: var(--font-medium);
  line-height: 1.4;
  margin-bottom: var(--mb-2);
}

.hero__actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero__image {
  display: flex;
  justify-content: center;
}

.hero__blob {
  width: 200px;
  fill: var(--first-color);
}

.hero__blob path {
  fill: var(--first-color);
}

.hero__profile {
  width: 120px;
  height: 120px;
  border-radius: 50%;
}

/* ===== ABOUT ===== */
.about {
  padding: 4rem 0;
}

.about__content {
  display: grid;
  gap: 2rem;
}

.about__description {
  text-align: center;
  margin-bottom: var(--mb-2-5);
  font-size: var(--h3-font-size);
  line-height: 1.6;
}

.about__info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-bottom: var(--mb-2-5);
}

.about__box {
  background-color: var(--container-color);
  border-radius: .75rem;
  text-align: center;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.about__box:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.about__title {
  font-size: var(--normal-font-size);
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
  margin-bottom: var(--mb-0-25);
}

.about__subtitle {
  font-size: var(--small-font-size);
  color: var(--text-color-light);
}

/* ===== BLOG ===== */
.blog {
  background-color: var(--container-color);
  padding: 4rem 0;
}

.blog__container {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.blog__card {
  background-color: var(--body-color);
  padding: 1.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.blog__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

.blog__img {
  width: 100%;
  height: 200px;
  border-radius: .75rem;
  margin-bottom: var(--mb-1);
  object-fit: cover;
  background: linear-gradient(135deg, var(--first-color-lighter), var(--first-color));
}

.blog__title {
  font-size: var(--h3-font-size);
  margin-bottom: var(--mb-0-5);
  color: var(--title-color);
}

.blog__title:hover {
  color: var(--first-color);
}

.blog__description {
  margin-bottom: var(--mb-1);
  color: var(--text-color);
  line-height: 1.6;
}

.blog__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--mb-0-5);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.blog__date {
  font-size: var(--small-font-size);
  color: var(--text-color-light);
}

.blog__read-more {
  color: var(--first-color);
  font-weight: var(--font-medium);
  font-size: var(--small-font-size);
}

.blog__actions {
  text-align: center;
  margin-top: var(--mb-3);
}

/* ===== CONTACT ===== */
.contact {
  padding: 4rem 0;
}

.contact__content {
  display: grid;
  gap: 3rem;
}

.contact__info {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.contact__card {
  background-color: var(--container-color);
  padding: 1.5rem;
  border-radius: .75rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.contact__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.contact__icon {
  font-size: 2rem;
  margin-bottom: var(--mb-0-5);
}

.contact__title {
  font-size: var(--h3-font-size);
  color: var(--title-color);
  font-weight: var(--font-medium);
  margin-bottom: var(--mb-0-25);
}

.contact__data {
  color: var(--text-color);
  font-size: var(--small-font-size);
}

.contact__form {
  background-color: var(--container-color);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.contact__form-div {
  position: relative;
  margin-bottom: var(--mb-2);
  height: 4rem;
}

.contact__form-area {
  height: 7rem;
}

.contact__form-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid var(--text-color-light);
  background: none;
  color: var(--text-color);
  outline: none;
  border-radius: .75rem;
  padding: 1.5rem;
  z-index: 1;
  resize: none;
  font-family: inherit;
  transition: var(--transition);
}

.contact__form-input:focus {
  border-color: var(--first-color);
}

.contact__form-tag {
  position: absolute;
  top: -.75rem;
  left: 1.25rem;
  font-size: var(--smaller-font-size);
  padding: .25rem;
  background-color: var(--container-color);
  color: var(--title-color);
  z-index: 10;
}

/* ===== FOOTER ===== */
.footer {
  background-color: var(--container-color);
  padding: 2rem 0 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer__content {
  display: grid;
  gap: 2rem;
  align-items: center;
  text-align: center;
}

.footer__title {
  font-size: var(--h3-font-size);
  color: var(--title-color);
  margin-bottom: var(--mb-0-5);
}

.footer__description {
  max-width: 400px;
  margin: 0 auto;
  color: var(--text-color);
}

.footer__social {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.footer__social-link {
  background-color: var(--first-color-lighter);
  color: var(--first-color);
  padding: .75rem;
  border-radius: .5rem;
  font-size: var(--small-font-size);
  font-weight: var(--font-medium);
  transition: var(--transition);
}

.footer__social-link:hover {
  background-color: var(--first-color);
  color: #fff;
  transform: translateY(-2px);
}

.footer__copy {
  text-align: center;
  font-size: var(--smaller-font-size);
  color: var(--text-color-light);
  margin-top: var(--mb-2);
  padding-top: var(--mb-2);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* ===== SCROLL UP ===== */
.scrollup {
  position: fixed;
  right: 1rem;
  bottom: -20%;
  background-color: var(--first-color);
  opacity: .8;
  padding: 0 .3rem;
  border-radius: .4rem;
  z-index: var(--z-tooltip);
  transition: var(--transition);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scrollup:hover {
  background-color: var(--first-color-alt);
  opacity: 1;
  transform: translateY(-2px);
}

.scrollup__icon {
  color: #fff;
  font-size: 1.2rem;
}

.show-scroll {
  bottom: 5rem;
}

/* ===== SCROLL BAR ===== */
::-webkit-scrollbar {
  width: .60rem;
  background-color: var(--scroll-bar-color);
  border-radius: .5rem;
}

::-webkit-scrollbar-thumb {
  background-color: var(--scroll-thumb-color);
  border-radius: .5rem;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-color-light);
}

/* ===== MEDIA QUERIES ===== */

/* For small devices */
@media screen and (max-width: 350px) {
  .container {
    margin-left: var(--mb-1);
    margin-right: var(--mb-1);
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .nav__menu {
    padding: 2rem .25rem 4rem;
  }
  
  .nav__list {
    column-gap: 0;
  }

  .about__info {
    grid-template-columns: 1fr;
  }

  .contact__info {
    grid-template-columns: 1fr;
  }
}

/* For medium devices */
@media screen and (min-width: 568px) {
  .hero__content,
  .about__content,
  .contact__content {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero__content {
    align-items: center;
  }

  .hero__image {
    order: 1;
  }

  .hero__content {
    order: 2;
  }
}

@media screen and (max-width: 767px) {
  .nav__menu {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background-color: var(--body-color);
    padding: 2rem 1.5rem 4rem;
    box-shadow: 0 -1px 4px rgba(0, 0, 0, .15);
    border-radius: 1.5rem 1.5rem 0 0;
    transition: var(--transition);
  }

  .nav__list {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  .nav__toggle,
  .nav__close {
    display: block;
  }

  .nav__toggle {
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--title-color);
  }

  .nav__close {
    position: absolute;
    right: 1.3rem;
    bottom: .5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--first-color);
  }

  .show-menu {
    bottom: 0;
  }

  /* Scroll header */
  .scroll-header {
    box-shadow: 0 -1px 4px rgba(0, 0, 0, .15);
  }
}

/* For large devices */
@media screen and (min-width: 768px) {
  .container {
    margin-left: auto;
    margin-right: auto;
  }

  body {
    margin: 0;
  }

  .section {
    padding: 6rem 0 2rem;
  }

  .section__subtitle {
    margin-bottom: 4rem;
  }

  .nav {
    height: calc(var(--header-height) + 1.5rem);
  }

  .nav__list {
    column-gap: 2rem;
  }

  .nav__toggle,
  .nav__close {
    display: none;
  }

  .hero {
    padding: 0;
    min-height: 100vh;
  }

  .hero__container {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
  }

  .hero__content {
    text-align: left;
  }

  .hero__actions {
    justify-content: flex-start;
  }

  .about__container {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    column-gap: 4rem;
  }

  .about__content {
    text-align: left;
  }

  .about__description {
    text-align: left;
    margin-bottom: var(--mb-2-5);
  }

  .contact__content {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 4rem;
  }

  .footer__content {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
    text-align: left;
  }

  .footer__social {
    justify-content: flex-end;
  }
}

@media screen and (min-width: 1024px) {
  .header,
  .main,
  .footer__container {
    padding: 0;
  }

  .nav__container {
    margin: 0 auto;
  }

  .hero__blob {
    width: 320px;
  }

  .hero__profile {
    width: 170px;
    height: 170px;
  }

  .about__info {
    grid-template-columns: repeat(3, 1fr);
  }

  .blog__container {
    grid-template-columns: repeat(3, 1fr);
  }

  .contact__form {
    width: 460px;
  }

  .contact__inputs {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}