/*=============== GOOGLE FONTS ===============*/
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap");

/*=============== VARIABLES CSS ===============*/
:root {
  --header-height: 3rem;

  /*========== Colors ==========*/
  --hue: 0;
  --sat: 0%;
  --title-color: hsl(var(--hue), var(--sat), 20%);
  --title-color-dark: hsl(var(--hue), var(--sat), 0%);
  --text-color: hsl(var(--hue), var(--sat), 46%);
  --body-color: hsl(var(--hue), var(--sat), 98%);
  --container-color: #fff;

  /*========== Font and typography ==========*/
  --body-font: "Poppins", sans-serif;

  --big-font-size: 3.5rem;
  --h1-font-size: 2.25rem;
  --h2-font-size: 1.5rem;
  --h3-font-size: 1.25rem;
  --normal-font-size: 1rem;
  --small-font-size: 0.875rem;
  --smaller-font-size: 0.813rem;
  --tiny-font-size: 0.625rem;

  /*========== Font weight ==========*/
  --font-normal: 400;
  --font-medium: 500;
  --font-semi-bold: 600;

  /*========== Margenes Bottom ==========*/
  --mb-0-25: 0.25rem;
  --mb-0-5: 0.5rem;
  --mb-0-75: 0.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;
}

/* Responsive typography */
@media screen and (max-width: 992px) {
  :root {
    --big-font-size: 2.75rem;
    --h1-font-size: 1.5rem;
    --h2-font-size: 1.25rem;
    --h3-font-size: 1rem;
    --normal-font-size: 0.938rem;
    --small-font-size: 0.813rem;
    --smaller-font-size: 0.75rem;
  }
}

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

html {
  scroll-behavior: smooth;
}

body,
button,
input,
textarea {
  font-family: var(--body-font);
  font-size: var(--normal-font-size);
}

body {
  background-color: var(--body-color);
  color: var(--text-color);
}

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

ul {
  list-style: none;
}

a {
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
}

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

/*=============== REUSABLE CSS CLASSES ===============*/
.section {
  padding: 1rem 0 2rem;
}

.section__title {
  font-size: var(--h1-font-size);
  color: var(--title-color);
}

.section__subtitle {
  display: block;
  font-size: var(--small-font-size);
  margin-bottom: 4rem;
}

.section__title,
.section__subtitle {
  text-align: center;
}

/*=============== LAYOUT ===============*/
.container {
  max-width: 968px;
  margin-left: auto;
  margin-right: auto;
}

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

.main {
  margin-top: var(--header-height);
}

/*=============== SCROLL REVEAL ===============*/
.reveal {
  opacity: 0;
  transform: translateY(2.5rem);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.reveal.reveal--visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .home__hand,
  .home__scroll-arrow,
  .wheel {
    animation: none;
  }

  .reveal {
    transition: none;
    opacity: 1;
    transform: none;
  }
}

/*=============== BUTTONS ===============*/
.button {
  display: inline-block;
  background-color: var(--title-color);
  color: var(--container-color);
  padding: 1.25rem 1.5rem;
  border-radius: 1rem;
  font-weight: var(--font-medium);
}

.button:hover {
  background-color: var(--title-color-dark);
}

.button__icon {
  margin-left: var(--mb-0-5);
}

.button--flex {
  display: inline-flex;
  align-items: center;
}

/*=============== HEADER ===============*/
.header {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-fixed);
  background-color: var(--container-color);
}

.nav {
  height: calc(var(--header-height) + 1.5rem);
  display: flex;
  justify-content: space-between;
  align-items: center;
  column-gap: 1rem;
}

.nav__logo,
.nav__toggle {
  color: var(--title-color);
  font-weight: var(--font-medium);
}

.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);
  transition: 0.1s;
}

.nav__icon,
.nav__close,
.nav__toggle {
  display: none;
}

.nav__mobile-actions {
  display: none;
}

.nav__lang {
  display: none;
}

.active-link,
.nav__link:hover {
  color: var(--title-color-dark);
  font-weight: var(--font-semi-bold);
}

.header.scroll-header {
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.15);
}

/*=============== HOME ===============*/
.home {
  position: relative;
  background-color: var(--body-color);
  background-image:
    linear-gradient(
      to bottom,
      var(--body-color) 0,
      rgba(10, 20, 40, 0.2) 12px,
      rgba(10, 20, 40, 0.1) 20%,
      rgba(10, 20, 40, 0.1) calc(100% - 12px),
      var(--body-color) 100%
    ),
    url(../assets/banniere_2.webp);
  background-repeat: no-repeat;
  background-position: top;
  /* A bare gradient has no intrinsic ratio, so "contain" makes it fill the
     whole box instead of matching the image below it. Give both layers the
     same explicit size (the image's native ratio scaled to the section's
     width) so the fade/scrim lines up exactly with the visible image. */
  background-size:
    100% calc(100vw * 394 / 1879),
    100% calc(100vw * 394 / 1879);
}

.home .button {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.home__container.container {
  max-width: 1200px;
}

.home__container {
  row-gap: 7rem;
}

.home__content {
  grid-template-columns: auto 250px;
  justify-content: left;
  padding-top: 5.5rem;
  column-gap: 0.5rem;
  align-items: center;
  column-gap: 2rem;
}

.home__social {
  display: flex;
  column-gap: 1.25rem;
  margin-bottom: var(--mb-1-5);
}

.home__social-icon {
  display: inline-flex;
  align-items: center;
  font-size: 1.25rem;
  color: var(--title-color);
}

.home__social-icon:hover {
  color: var(--title-color-dark);
  scale: 1.1;
}

.home__social-icon-label {
  margin-left: 0.4rem;
  font-size: var(--small-font-size);
  color: var(--text-color);
}

.home__title {
  font-size: var(--big-font-size);
  margin-bottom: var(--mb-0-25);
  white-space: nowrap;
  color: var(--title-color);
}

.home__hand {
  width: 38px;
  height: 38px;
  margin-left: 0.4rem;
  vertical-align: middle;
  display: inline-block;
  transform-origin: 70% 70%;
  animation: wave 2.5s ease-in-out infinite;
}

@keyframes wave {
  0%,
  60%,
  100% {
    transform: rotate(0deg);
  }

  10% {
    transform: rotate(14deg);
  }

  20% {
    transform: rotate(-8deg);
  }

  30% {
    transform: rotate(14deg);
  }

  40% {
    transform: rotate(-4deg);
  }

  50% {
    transform: rotate(10deg);
  }
}

.home__subtitle {
  position: relative;
  font-size: var(--h3-font-size);
  font-weight: var(--font-normal);
  margin-bottom: var(--mb-1);
  padding-left: 5.4rem;
}

.home__subtitle::before {
  content: "";
  position: absolute;
  width: 70px;
  height: 1px;
  background-color: var(--text-color);
  left: 0;
  top: 1rem;
}

.home__description {
  width: 100%;
  margin-bottom: var(--mb-3);
}

.home__data {
  background-color: var(--container-color);
  max-width: 700px;
  padding: 1.75rem 2rem;
  border-radius: 1.25rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.home__img {
  background: url(../assets/profil-pic.webp);
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 9px rgb(255 255 255 / 30%);
  order: 1;
  justify-self: center;
  width: 300px;
  height: 300px;
  border-radius: 50%;
}

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

.wheel {
  animation: scroll 2s ease infinite;
}

@keyframes scroll {
  0% {
    transform: translateY(0);
  }

  30% {
    transform: translateY(3.75rem);
  }
}

.home__scroll-name {
  color: var(--title-color);
  font-weight: var(--font-medium);
  margin-right: var(--mb-0-25);
  margin-left: 2px;
}

.home__scroll-arrow {
  font-size: 1.25rem;
  color: var(--title-color);
  display: inline-block;
  animation: bounce-arrow 1.5s ease infinite;
}

@keyframes bounce-arrow {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(6px);
  }
}

.home__button {
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: 0.5rem;
  font-size: var(--small-font-size);
}

/*=============== WORK ===============*/
.work .section__subtitle {
  margin-bottom: var(--mb-0-75);
}

.work__hint {
  display: block;
  text-align: center;
  font-size: var(--smaller-font-size);
  color: var(--text-color);
  margin-bottom: var(--mb-2);
}

.work__filters {
  display: flex;
  justify-content: center;
  align-items: center;
  column-gap: 0.75rem;
  margin-bottom: var(--mb-2);
}

.work__item {
  cursor: pointer;
  color: var(--title-color);
  padding: 0.25rem 0.75rem;
  font-weight: var(--font-medium);
  border-radius: 0.5rem;
  text-transform: capitalize;
}

.work__item:hover {
  background-color: var(--title-color);
  color: var(--container-color);
}

.work__container {
  grid-template-columns: repeat(2, 380px);
  gap: 3rem;
  justify-content: center;
}

.work__card {
  background-color: var(--container-color);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.work__img {
  object-fit: cover;
  object-position: center;
  width: 100%;
  height: 200px;
  border-radius: 1rem;
  margin-bottom: var(--mb-1);
}

.work__img:hover {
  transform: scale(1.01);
  filter: brightness(0.95);
}

.work__title {
  font-size: var(--normal-font-size);
  font-weight: var(--font-medium);
  line-height: 1.3;
  margin-bottom: var(--mb-0-5);
  text-align: center;
  /* Reserve room for two lines so a short one-line title and a longer
     two-line title leave every card the same height. */
  min-height: calc(1.3em * 2 + var(--mb-0-5));
}

.work__links {
  display: flex;
  justify-content: space-around;
  column-gap: 0.5rem;
  margin-top: auto;
}

.work__button {
  color: var(--text-color);
  font-size: var(--small-font-size);
  display: flex;
  align-items: center;
  column-gap: 0.25rem;
}

.work__button-icon {
  font-size: 1rem;
  transition: 0.4s;
}

.work__button:hover .work__button-icon {
  transform: translateX(0.25rem);
}

.work__button:hover .work__button-icon-github {
  scale: 1.1;
}

.active-work {
  background-color: var(--title-color);
  color: var(--container-color);
}

.work__card--hidden {
  display: none;
}

.work__img__link {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 1rem;
}

.work__img__link:focus-visible {
  outline: 2px solid var(--title-color);
  outline-offset: 3px;
}

/*=============== WORK MODAL ===============*/
dialog.work-modal {
  position: fixed;
  margin: auto;
  border: none;
  background-color: var(--container-color);
  border-radius: 1.25rem;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: scale(0.9) translateY(1rem);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    overlay 0.3s ease allow-discrete,
    display 0.3s ease allow-discrete;
}

dialog.work-modal[open] {
  opacity: 1;
  transform: scale(1) translateY(0);
}

@starting-style {
  dialog.work-modal[open] {
    opacity: 0;
    transform: scale(0.9) translateY(1rem);
  }
}

dialog.work-modal::backdrop {
  background-color: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition:
    opacity 0.3s ease,
    overlay 0.3s ease allow-discrete,
    display 0.3s ease allow-discrete;
}

dialog.work-modal[open]::backdrop {
  opacity: 1;
}

@starting-style {
  dialog.work-modal[open]::backdrop {
    opacity: 0;
  }
}

.work-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  background-color: var(--body-color);
  color: var(--title-color);
  border: none;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  transition: 0.3s;
}

.work-modal__close:hover {
  background-color: var(--title-color);
  color: var(--container-color);
}

.work-modal__img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 1rem;
  margin-bottom: var(--mb-1);
}

.work-modal__title {
  font-size: var(--h3-font-size);
  font-weight: var(--font-semi-bold);
  color: var(--title-color-dark);
  margin-bottom: var(--mb-0-75);
}

.work-modal__description {
  font-size: var(--small-font-size);
  color: var(--text-color);
  margin-bottom: var(--mb-1-5);
}

.work-modal__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--mb-1-5);
}

.work-modal__tech-item {
  display: inline-flex;
  align-items: center;
  column-gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  background-color: var(--body-color);
  border-radius: 0.5rem;
  font-size: var(--smaller-font-size);
  color: var(--title-color);
  font-weight: var(--font-medium);
}

.work-modal__tech-icon {
  font-size: 1.1rem;
  color: var(--title-color);
}

/* Angular's and Railway's devicon glyphs are white (meant for a colored
   badge behind them), so they need their own visible color instead of the
   "colored" class. Claude Code and Neon have no devicon entry at all, so
   they borrow a generic boxicons/unicons glyph with a brand-ish accent. */
.work-modal__tech-icon--angular {
  color: #dd0031;
}

.work-modal__tech-icon--railway {
  color: #0b0d0e;
}

.work-modal__tech-icon--claude {
  color: #d97757;
}

.work-modal__tech-icon--neon {
  color: #00e599;
}

.work-modal__links {
  display: flex;
  column-gap: 1rem;
}

.work-modal__link {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  column-gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-radius: 0.75rem;
  border: 2px solid transparent;
  font-weight: var(--font-medium);
  font-size: var(--small-font-size);
  transition: 0.3s;
}

.work-modal__link .work__button-icon {
  transition: 0.4s;
}

.work-modal__link:hover .work__button-icon {
  transform: translateX(0.25rem);
}

.work-modal__link:hover .work__button-icon-github {
  scale: 1.15;
}

.work-modal__link--demo {
  background-color: var(--title-color);
  border-color: var(--title-color);
  color: var(--container-color);
}

.work-modal__link--demo:hover {
  background-color: var(--title-color-dark);
  border-color: var(--title-color-dark);
}

.work-modal__link--github {
  border-color: var(--title-color);
  color: var(--title-color);
}

.work-modal__link--github:hover {
  background-color: var(--title-color);
  color: var(--container-color);
}

@media screen and (max-width: 350px) {
  .work-modal__links {
    flex-direction: column;
    row-gap: 0.75rem;
  }
}

/*=============== SKILLS ===============*/
.skills__container {
  grid-template-columns: repeat(2, 400px);
  column-gap: 3rem;
  justify-content: center;
}

.skills__content {
  background-color: var(--container-color);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 2rem 4rem;
  border-radius: 1.25rem;
}

.skills__title {
  font-size: var(--normal-font-size);
  font-weight: var(--font-medium);
  text-align: center;
  margin-bottom: var(--mb-1-5);
}

.skills__box {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  column-gap: 2.5rem;
  row-gap: 1.25rem;
}

.skills__data {
  display: flex;
  align-items: center;
  column-gap: 0.5rem;
}

.skills__icon {
  font-size: 1.1rem;
  color: var(--title-color);
  flex-shrink: 0;
}

/* Angular's and Railway's devicon glyphs are white (meant for a colored
   badge behind them), so they need their own visible color instead of the
   "colored" class. */
.skills__icon--angular {
  color: #dd0031;
}

.skills__icon--railway {
  color: #0b0d0e;
}

/* No official web brand color exists for these — Claude Code, Copilot and
   Neon get a representative accent, the rest stay neutral like generic
   icons. */
.skills__icon--claude {
  color: #d97757;
}

.skills__icon--copilot {
  color: #181616;
}

.skills__icon--neon {
  color: #00e599;
}

.skills__icon--max,
.skills__icon--faust,
.skills__icon--puredata,
.skills__icon--webaudio {
  color: var(--title-color);
}

.skills__name {
  font-size: var(--normal-font-size);
  font-weight: var(--font-medium);
}

/*=============== CONTACT ===============*/
.contact__container {
  grid-template-columns: repeat(2, max-content);
  justify-content: center;
  column-gap: 6rem;
  padding-bottom: 3rem;
}

.contact__title {
  text-align: center;
  font-size: var(--h3-font-size);
  font-weight: var(--font-medium);
  margin-bottom: var(--mb-1-5);
}

.contact__info {
  display: grid;
  row-gap: 1rem;
  grid-template-columns: 300px;
}

.contact__card {
  background-color: var(--container-color);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 1rem;
  border-radius: 0.75rem;
  text-align: center;
}

.contact__card-icon {
  font-size: 2rem;
  color: var(--title-color);
  margin-bottom: var(--mb-0-25);
}

.contact__card-title,
.contact__card-data {
  font-size: var(--small-font-size);
}

.contact__card-title {
  font-weight: var(--font-medium);
}

.contact__card-data {
  display: block;
  margin-bottom: var(--mb-0-75);
}

.contact__button {
  color: var(--text-color);
  font-size: var(--small-font-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  column-gap: 0.25rem;
}

.contact__button-icon {
  font-size: 1rem;
  transition: 0.3s;
}

.contact__button:hover .contact__button-icon {
  transform: translateX(0.25rem);
}

.contact__form {
  width: 360px;
}

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

.contact__form-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 2px solid rgba(0, 0, 0, 0.3);
  background: none;
  color: var(--text-color);
  outline: none;
  border-radius: 0.75rem;
  padding: 1.5rem;
  z-index: 1;
}

.contact__form-tag {
  position: absolute;
  top: -0.75rem;
  left: 1.25rem;
  font-size: var(--smaller-font-size);
  padding: 0.25rem;
  background-color: var(--body-color);
  z-index: 10;
}

.contact__form-area {
  height: 11rem;
}

.contact__form-area textarea {
  resize: none;
}

.contact__form-spinner {
  display: none;
  width: 18px;
  height: 18px;
  margin-left: var(--mb-0-5);
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--container-color);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.contact__form-button--loading {
  opacity: 0.85;
  cursor: not-allowed;
}

.contact__form-button--loading .button__icon {
  display: none;
}

.contact__form-button--loading .contact__form-spinner {
  display: inline-block;
}

.contact__form-status {
  min-height: 1.5em;
  margin-top: var(--mb-0-75);
  font-size: var(--small-font-size);
  text-align: center;
}

.contact__form-status--success {
  color: #1a9c53;
}

.contact__form-status--error {
  color: #e5484d;
}

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

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

.footer__title,
.footer__link {
  color: var(--title-color);
}

.footer__title {
  text-align: center;
  margin-bottom: var(--mb-2);
}

.footer__link:hover {
  color: var(--title-color-dark);
}

.footer__list {
  display: flex;
  justify-content: center;
  column-gap: 1.5rem;
  margin-bottom: var(--mb-2);
}

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

.footer__social-link {
  background-color: var(--title-color);
  color: var(--container-color);
  font-size: 1.125rem;
  padding: 0.4rem;
  border-radius: 0.5rem;
  display: inline-flex;
}

.footer__social-link:hover {
  background-color: var(--title-color-dark);
}

.footer__copy {
  display: block;
  margin-top: 4.5rem;
  color: var(--title-color);
  text-align: center;
  font-size: var(--smaller-font-size);
}

/*=============== SCROLL UP ===============*/
.scrollup {
  position: fixed;
  right: 2.5rem;
  bottom: -20%;
  background-color: var(--title-color);
  opacity: 0.8;
  padding: 0.3rem 0.5rem;
  border-radius: 0.4rem;
  z-index: var(--z-tooltip);
  transition: 0.4s;
}

.scrollup:hover {
  background-color: var(--title-color-dark);
}

.scrollup__icon {
  font-size: 1.5rem;
  color: var(--container-color);
}

.scrollup.show-scroll {
  bottom: 3rem;
}

/*=============== BREAKPOINTS ===============*/

@media screen and (max-width: 1440px) {
  .home__content {
    max-width: 800px;
    margin-inline: auto;
  }
}
/* For large devices */
@media screen and (max-width: 992px) {
  .container {
    margin-left: var(--mb-1-5);
    margin-right: var(--mb-1-5);
  }

  .button {
    padding: 1rem 1.75rem;
  }

  .button__icon {
    width: 22px;
    height: 22px;
  }

  .nav__link {
    font-size: var(--smaller-font-size);
  }

  .home__content {
    grid-template-columns: auto 250px;
    column-gap: 0.5rem;
  }

  .home__data {
    padding: 1.5rem 1.75rem;
  }

  .home__title {
    font-size: var(--h1-font-size);
  }

  .home__hand {
    width: 26px;
    height: 26px;
  }

  .home__subtitle {
    padding-left: 3.75rem;
    margin-bottom: var(--mb-1);
  }

  .home__subtitle::before {
    width: 42px;
    top: 0.8rem;
  }

  .home__description {
    max-width: initial;
    margin-bottom: var(--mb-2-5);
  }

  .home__img {
    width: 250px;
    height: 250px;
    box-shadow: inset 0 0 0 8px rgb(255 255 255 / 30%);
  }

  .work__container {
    gap: 1.25rem;
  }

  .work__card {
    padding: 1rem;
  }

  .work__img {
    margin-bottom: 0.75rem;
  }

  .work__title {
    margin-bottom: 0.25rem;
  }

  .skills__container {
    grid-template-columns: max-content;
    row-gap: 2rem;
  }

  .contact__container {
    column-gap: 3rem;
  }

  .footer__social-link {
    padding: 0.25rem;
    border-radius: 0.25rem;
  }

  .scrollup {
    right: 1.5rem;
    padding: 0.25rem 0.4rem;
  }

  .scrollup__icon {
    font-size: 1.25rem;
  }
}

/* For medium devices */
@media screen and (max-width: 768px) {
  body {
    margin: 0 0 var(--header-height) 0;
  }

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

  /* On narrow screens the stacked layout puts the photo above the card,
     so the banner only needs to fill that top area (behind the photo),
     not the whole hero down to the card. Fix the height and let the width
     scale automatically to keep the image's own aspect ratio. */
  .home {
    background-position: top center;
    background-size: auto 320px;
  }

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

  .header {
    top: initial;
    bottom: 0;
  }

  .nav {
    height: var(--header-height);
  }

  .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, 0.15);
    border-radius: 1.5rem 1.5rem 0 0;
    transition: 0.3s;
  }

  .nav__menu.show-menu {
    bottom: 0;
  }

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

  .nav__icon {
    font-size: 1.2rem;
  }

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

  .nav__close:hover {
    color: var(--title-color-dark);
  }

  .nav__toggle {
    font-size: 1.1rem;
    cursor: pointer;
  }

  .nav__icon,
  .nav__close,
  .nav__toggle {
    display: block;
  }

  .nav__mobile-actions {
    display: flex;
    align-items: center;
    column-gap: 1rem;
  }

  .nav__lang {
    display: inline-flex;
    align-items: center;
    column-gap: 0.25rem;
    color: var(--title-color);
    font-weight: var(--font-medium);
    font-size: var(--small-font-size);
  }

  .nav__lang:hover {
    color: var(--title-color-dark);
  }

  .home__content {
    display: flex;
    flex-direction: column;
    padding-top: 3.5rem;
  }

  .home__social {
    justify-content: center;
  }

  .home__img {
    order: 0;
    justify-self: center;
    box-shadow: inset 0 0 0 6px rgb(255 255 255 / 30%);
    width: 200px;
    height: 200px;
  }

  .home__data {
    order: 1;
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
  }

  .home__data .home__description {
    width: 100%;
    text-align: center;
  }

  .home__button {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 0.75rem;
  }

  .home__scroll {
    display: none;
  }

  .work__container {
    grid-template-columns: max-content;
  }

  .contact__container {
    grid-template-columns: 1fr;
    row-gap: 3rem;
  }

  .contact__info {
    justify-content: center;
  }

  .contact__form {
    margin: 0 auto;
  }

  .scrollup.show-scroll {
    bottom: 4rem;
  }
}

@media screen and (max-width: 576px) {
  .skills__container {
    grid-template-columns: 1fr;
  }

  .skills__content {
    padding: 1.5rem;
  }

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

  .work__img {
    width: 100%;
  }

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

  .contact__form {
    width: 100%;
  }
}

/* For small devices */
@media screen and (max-width: 350px) {
  :root {
    --big-font-size: 2.25rem;
  }

  .container {
    margin-left: var(--mb-1);
    margin-right: var(--mb-1);
  }

  .home__img {
    width: 180px;
    height: 180px;
  }

  .home__hand {
    width: 22px;
    height: 22px;
  }

  .work__item {
    font-size: var(--small-font-size);
  }

  .work__filters {
    column-gap: 0.25rem;
  }

  .skills__box {
    column-gap: 1.25rem;
  }

  .skills__name {
    font-size: var(--small-font-size);
  }

  .nav__menu {
    padding: 2rem 0.25rem 4rem;
  }

  .nav__list {
    column-gap: 0;
  }

  .scrollup {
    right: 1rem;
  }
}
