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

:root {
  --ff-primary: "Source Sans Pro", sans-serif;
  --ff-secondary: "Source Code Pro", monospace;

  --fw-reg: 300;
  --fw-semi-bold: 600;
  --fw-bold: 900;

  --clr-light: #fff;
  --clr-dark: #1f1c1c;
  --clr-accent: rgb(148, 172, 191);
  --clr-accent-bg: rgba(43, 68, 65, 0.4);
  --clr-profile: #0d183b;
  --clr-percent: #265ddc;
  --clr-percent-skills: #5b646879;
  --clr-icons-text: rgb(111, 164, 207);
  --clr-link: rgb(98, 36, 146);

  --clr-btn-svg: rgb(226, 59, 21);

  --fs-h1: 2.8rem;
  --fs-h2: 2rem;
  --fs-h3: 1.25rem;
  --fs-h4: 1rem;
  --fs-body: 0.8rem;

  --bs:
    0.25em 0.25em 0.75em rgba(0, 0, 0, 0.25),
    0.125em 0.125em 0.25em rgba(0, 0, 0, 0.15);
}

/* General styles */

html {
  scroll-behavior: smooth;
}

body {
  background: var(--clr-light);
  color: var(--clr-dark);
  margin: 0;
  font-family: var(--ff-primary);
  font-size: var(--fs-body);
  line-height: 1.6;
}

section {
  padding: 5em 2em;
}

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

strong {
  font-weight: var(--fw-bold);
}

:focus {
  outline: 3px solid var(--clr-accent);
  outline-offset: 3px;
}

/* BUTTONS */

.btn {
  display: inline-block;
  padding: 0.5em 2.5em;
  background-color: var(--clr-accent);
  color: var(--clr-dark);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: var(--fw-bold);
  transition: transform 200ms ease-in-out;
}

.btn:hover {
  transform: scale(1.1);
}

/* Typography */

h1,
h2,
h3,
h4,
h5 {
  line-height: 1;
  margin: 0;
}

h1 {
  font-size: var(--fs-h1);
}
h2 {
  font-size: var(--fs-h2);
}
h3 {
  font-size: var(--fs-h3);
}
h4 {
  font-size: var(--fs-h4);
}

.section__title {
  margin-bottom: 0.25em;
}

.section__title--intro {
  font-weight: var(--fw-reg);
}

.section__title--intro strong {
  display: block;
}

.section__subtitle {
  margin: 0;
  font-size: var(--fs-h3);
}

.section__subtitle--intro,
.section__subtitle--about {
  background: var(--clr-accent);
  padding: 0.25em 1em;
  font-family: var(--ff-secondary);
  margin-bottom: 1em;
}

.section__subtitle--work {
  color: var(--clr-accent);
  font-weight: var(--fw-bold);
  margin-bottom: 2em;
}

/* header */
header {
  display: flex;
  justify-content: space-between;
  padding: 1em;
}

.logo {
  position: fixed;
  inset: 1rem 0 0 1rem;
  max-width: 80px;
  min-width: 50px;
  z-index: 6;
}

.nav {
  position: fixed;
  color: var(--clr-light);
  inset: 0;
  z-index: 10;
  backdrop-filter: blur(0.9rem);
  -webkit-backdrop-filter: blur(0.9rem);
  background: rgba(41, 54, 52, 0.8);
  transform: translateX(-140%) translateY(100%) scale(0.4);
  transition: transform 900ms ease-in-out;
}

.hamburger {
  display: block;
  height: fit-content;
  border-radius: 0em;
  transition: transform 400ms ease-in-out;
  transform-style: preserve-3d;
  right: 2erm;
  top: 2em;
  width: 3rem;
  aspect-ratio: auto;
}

.hamburger div {
  transition: transform 800ms ease-in-out;
  border-radius: 100%;
  transform-style: preserve-3d;
  display: flex;
  justify-content: center;
  align-items: center;

  rotate: 0deg;
  transition: all 800ms ease-in-out;
}

.hamburger div.rotate {
  rotate: 90deg;
  transition: 1600ms ease-in-out;
  border-radius: 100%;
  background-color: var(--clr-accent-btn);
  opacity: 0.6;
}

.hamburger svg {
  width: 3rem;
  height: 3rem;
  aspect-ratio: auto;
  fill: var(--clr-accent);
}

.hamburger svg.rotate {
  fill: var(--clr-btn-svg);
}

.nav__list {
  list-style: none;
  display: flex;
  height: 100%;
  flex-direction: column;
  justify-content: space-evenly;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav__link {
  color: inherit;
  font-weight: var(--fw-bold);
  font-size: var(--fs-h2);
  text-decoration: none;
}
.nav__link:hover {
  color: var(--clr-accent);
}

.nav-toggle {
  margin: 0.3rem;
  padding: 1rem;
  background: transparent;
  border: 0;
  border-radius: 100%;
  cursor: pointer;
  position: absolute;
  right: 1em;
  top: 1em;
  z-index: 12;
  perspective: 800px;
  outline: none;
  transition: transform 600ms ease-in-out;
}

.nav-open .nav {
  transform: translateX(0%) translateY(0) scale(1);
  transition: transform 900ms ease-in-out;
  background: rgb(28, 51, 39, 0.5);
}

.nav-open .nav-toggle {
  position: fixed;
  margin: 0.3rem;
}

/*intro section */

.intro {
  position: relative;
}

.intro__img {
  box-shadow: var(--bs);
}

.section__subtitle--intro {
  display: inline-block;
}

@media (min-width: 680px) {
  .about-me {
    display: grid;
    grid-template-columns: 1fr 200px;
    grid-template-areas:
      "title img"
      "subtitle img"
      "text img";
    grid-column-gap: 2em;
  }
  .section__title--about {
    grid-area: title;
  }
  .section__subtitle--about {
    grid-column: 1/ -1;
    grid-row: 2;
    position: relative;
    left: -1em;
    width: calc(100% + 2em);
    padding-left: 1em;
    padding-right: calc(200px + 3em);
  }
  .about-me__img {
    grid-area: img;
    position: relative;
    z-index: 3;
  }
}

@media (min-width: 680px) {
  #box {
    display: flex;
  }

  #devLine {
    display: inline;
  }

  .intro {
    display: grid;
    width: min-content;
    margin: 0 auto;
    grid-column-gap: 1em;
    grid-template-areas:
      "img title"
      "img subtitle";
    grid-template-columns: min-content max-content;
  }

  .intro__img {
    grid-area: img;
    min-width: 250px;
    position: relative;
    z-index: 2;
  }
  .section__subtitle--intro {
    align-self: start;
    grid-column: -1/1;
    grid-row: 2;
    text-align: right;
    position: relative;
    left: -1.5em;
    width: calc(100% + 4em);
  }
}

.my-services {
  background-color: var(--clr-darkg);
  background-image: url(./images/backgroundImages/two.png); /* <---*/
  background-attachment: fixed;
  background-size: cover;
  background-position: top;
  background-attachment: fixed;
  background-blend-mode: multiply; /* this is optional it darkens background image to let text stand out*/
  color: var(--clr-light);
  text-align: center;
}

.section__title--services {
  color: var(--clr-accent);
  position: relative;
}

.section__title--services::after {
  content: "";
  display: block;
  width: 2em;
  height: 1px;
  margin: 0.5em auto 1em;
  background: var(--clr-light);
  opacity: 0.3;
}
.services {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* Three equal-width columns */
  gap: 20px; /* Adjust the gap as needed for spacing between columns */
  margin-bottom: 4em;
}

.service p {
  min-width: fit-content;
}

.skills {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
}

.sub-skills {
  flex-basis: calc(33.33% - 20px); /* 1/3 of the width with some margin */
  margin: 10px;
  padding: 10px;
  border: none;
  background-color: transparent;
  text-align: justify; /* To ensure even text distribution */
  line-height: 1.4; /* Adjust line height for readability */
}

.sub-skillset {
  flex-basis: calc(33.33% - 20px); /* 1/3 of the width with some margin */
  margin: 10px;
  padding: 10px;
  border: none;
  background-color: transparent;
  text-align: center;
  line-height: auto; /* Adjust line height for readability */
}

.sub-skills > ul li,
.sub-skillset > ul li {
  list-style-type: none;
}

@media (min-width: 850px) {
  #home {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1800px;
    background-image: url(./images/backgroundImages/backgroundImageIntro.png);
    background-size: cover;
    margin-top: -3rem;

    /*  background-blend-mode: multiply;  this is optional it darkens background image to let text stand out*/
  }

  .intro {
    transform-style: preserve-3d;
    padding: 1rem 5rem 0;
  }
  .intro h1 {
    transform-style: preserve-3d;
    transition: all 750ms ease-in-out;
    border-radius: 0.3rem;
    scale: 0.9;
    padding-left: 0.5rem;
  }

  .intro h1 strong {
    transition: all 750ms ease-in-out;
    /* background: transparent; */
    scale: 1;
    padding-left: 0rem;
  }

  #introPicture {
    transition: all 750ms ease-in-out;
  }

  /* devLine-container and #devLineAbout-container animation*/

  #devLine-container {
    transform-style: preserve-3d;
    transition: all 750ms ease-in-out;
    max-width: 80vw;
    overflow-x: hidden;
  }

  #devLine {
    transform-style: preserve-3d;
    transition: all 750ms ease-in-out;
    display: inline;
    position: relative;
    animation: snippet-slide 16s linear 1s forwards infinite;
  }

  /*added swapping effect to devLine*/
  #devLine {
    transition:
      opacity 0.5s ease,
      transform 0.5s ease;
  }

  .fade-out {
    opacity: 0;
    transform: translateY(5px); /* subtle downward fade */
  }

  .fade-in {
    opacity: 1;
    transform: translateY(0);
  }
  /* swapping effect ends here */
  #devLine:hover {
    animation-play-state: paused;
  }

  #devLine em {
    transition: all 950ms ease-in-out;
    scale: 1.2;
  }

  @keyframes snippet-slide {
    0% {
      left: -90%;
    }
    60% {
      left: -8%;
    }

    80% {
      left: -8%;
    }
    100% {
      left: 30%;
    }
  }

  #devLineAbout-container {
    position: relative;
    animation: snippet-slide-about 8s linear forwards infinite;
    overflow-x: auto;
  }

  #devLineAbout-container:hover {
    animation-play-state: paused;
  }

  @keyframes snippet-slide-about {
    from {
      left: 0%;
    }
    to {
      left: 35%;
    }
  }

  :root {
    --fs-h1: 4.5rem;
    --fs-h2: 3.75rem;
    --fs-h3: 1.5rem;
    --fs-body: 1.125rem;
  }
  /*
    .services {
        display: flex;
        max-width: 1000px;
        margin-left: auto;
        margin-right: auto;
        gap: 2rem;
    }
    .service p {
        min-width: fit-content;
    }
    */
  .services {
    flex-direction: row; /* Change flex-direction to column for smaller devices */
    align-items: stretch; /* Stretch divs to full width */
  }

  .service {
    flex: none; /* Remove flex value to disable equal width */
    max-width: 100%; /* Make divs full width */
  }

  .skills {
    flex-direction: row;
  }

  .sub-skills {
    flex-basis: 100%; /* Take up full width */
  }
}

.about-me {
  max-width: 1900px;
  margin: 0 auto;
  background-image: url(./images/backgroundImages/5.png);
  background-color: rgba(17, 26, 24, 0.6);
  background-size: cover;
  background-position: bottom;
  background-blend-mode: multiply; /* this is optional it darkens background image to let text stand out*/
}

.section__title.section__title--about {
  color: var(--clr-light);
}

.about-me__body {
  font-size: larger;
  background-color: var(--clr-accent-bg);
  color: var(--clr-light);
  backdrop-filter: blur(0.3rem);
  -webkit-backdrop-filter: blur(0.3rem);
  padding-left: 0.9rem;
  border-radius: 10px;
}

.about-me__img {
  box-shadow: var(--bs);
}

/* my work/ portfolio  */

.my-work {
  background-image: url(./images/backgroundImages/7.png); /* <---*/
  background-size: cover;
  background-position: bottom;
  background-attachment: fixed;
  background-color: var(--clr-dark);
  color: var(--clr-light);
  text-align: center;
}

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

.portfolio__item {
  background: var(--clr-accent);
  overflow: hidden;
  border-radius: 10%;
  margin-bottom: 1rem;
  scale: 95%;
  transition: all ease-in-out 600ms;
}

.portfolio__item:hover,
.portfolio__item:focus {
  filter: drop-shadow(1rem 0.5rem 0.75rem var(--clr-accent));
  -webkit-filter: drop-shadow(1rem 0.5rem 0.75rem var(--clr-accent));
  scale: 100%;
}

/* email card section  */

.email-showcase {
  display: grid;
  grid-template-columns: 75% 25%;
  gap: 1.2rem;
  max-width: 1400px;
  margin: 0 auto;
  align-items: center;
}

.email-showcase__viewer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.email-showcase__frame {
  width: 100%;
  height: 520px;
  overflow-y: auto;
  background: #000;
  border-radius: 14px;
  box-shadow: 0.25em 0.25em 1em rgba(0, 0, 0, 0.7);
}

.email-showcase__img {
  width: 100%;
  height: auto;
  display: block;
}

/* Email Arrows Overlay */

.email-showcase__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--clr-accent);
  color: var(--clr-accent);
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  border-radius: 6px;
}

.email-showcase__arrow--left {
  left: 10px;
}

.email-showcase__arrow--right {
  right: 10px;
}

/* Email Info Panel (Right Side)*/

.email-showcase__info {
  text-align: left;
}

.email-showcase__brand {
  font-size: 1.8rem;
  letter-spacing: 1px;
  color: var(--clr-accent);
  margin-bottom: 0.5rem;
}

.email-showcase__title {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}

.email-showcase__type {
  font-weight: var(--fw-semi-bold);
  color: var(--clr-accent);
  margin-bottom: 1rem;
}

.email-showcase__description {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* Email Tabs */

.email-showcase__tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.email-showcase__tab {
  background: transparent;
  border: 1px solid var(--clr-accent);
  color: var(--clr-accent);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  border-radius: 4px;
}

.email-showcase__tab.is-active {
  background: var(--clr-accent);
  color: var(--clr-dark);
}

/* Email media queries */

/* Tablet small desktop*/

@media (max-width: 900px) {
  .email-showcase {
    grid-template-columns: 1fr;
  }

  .email-showcase__info {
    text-align: center;
  }
}

/* Email Mobile Polish */

@media (max-width: 500px) {
  .email-showcase__frame {
    height: 420px;
  }

  .email-showcase__title {
    font-size: 1.3rem;
  }

  .email-showcase__description {
    font-size: 0.9rem;
  }
}

/* footer */

.footer {
  background: #111;
  color: var(--clr-accent);
  font-size: var(--fs-h3);
  text-align: center;
  padding: 2.5em 0 0.5em;
}
.footer.portfolio-item {
  position: static;
  bottom: 0;
  width: 100vw;
}

.footer a {
  color: inherit;
  text-decoration: none;
}
.footer__link {
  font-weight: var(--fw-bold);
}

.footer__link:hover,
.social-list__link:hover {
  opacity: 0.7;
}

.footer__link:hover {
  text-decoration: underline;
}

.social-list {
  list-style: none;
  display: flex;
  justify-content: center;
  margin: 2em 0 0;
  padding: 0;
}

.social-list__item {
  margin: 0 0.5em;
}

.social-list__link {
  padding: 0.5em;
}

/*individual portfolio section */

.portfolio-item-individual {
  padding: 0 2em 2em;
  max-width: 1000px;
  margin: 0 auto;
}

.portfolio-item-individual p {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 1rem;
}
.portfolio-item-individual a img,
.portfolio-item-individual a img {
  scale: 95%;
  filter: drop-shadow(0 0 0);
  -webkit-filter: drop-shadow(0 0 0);
  border-radius: none;
  outline-color: none;
  outline-width: 0;
  opacity: 0.9;
  transition: all 650ms cubic-bezier(0.5, 0, 0.5, 1);
}

.portfolio-item-individual a img:hover,
.portfolio-item-individual a img:focus {
  filter: drop-shadow(0 0 0.75rem var(--clr-dark));
  -webkit-filter: drop-shadow(0 0 0.75rem var(--clr-dark));
  opacity: 1;
  scale: 100%;
  border-radius: 1rem;
  outline-color: var(--clr-accent-bg);
  outline-width: 1rem;
}

#portfolio_subtitle--intro {
  z-index: 8;
}

/* portfolio project */

#gringoAchilenao,
#lightsVideoCaption {
  background: rgba(76, 82, 82, 0.15);
}

/* Added to skills section*/
.skillset {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
}

.skillset .sub-skillset {
  /*text-align: left;*/
  align-items: center;
}

.skillset .sub-skillset ul {
  width: 100%;
}

/* Desktop */
@media (max-width: 1200px) {
  .skillset {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Tablet */
@media (max-width: 900px) {
  .skillset {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .services {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 500px) {
  .skillset {
    grid-template-columns: 1fr;
    gap: 1rem 0.25rem;
  }
  .skillset .sub-skillset {
    /*text-align: left;*/
    text-align: center;
  }
  .skillset .sub-skillset h4 {
    margin-bottom: 1.3rem;
    text-align: center;
  }
  .skillset .sub-skillset ul {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    text-align: left;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  #emailWork > div {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 500px) {
  .email-showcase__tabs {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
  }
}

/* ==============================
   WEB CARDS
============================== */

.web-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  max-width: 1300px;
  margin: 0 auto;
}

/* CARD */
.web-card {
  background: var(--clr-accent-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--bs);
  transition:
    transform 300ms ease,
    box-shadow 300ms ease;
}

/* HOVER EFFECT */
.web-card:hover {
  transform: translateY(-6px);
  box-shadow: 0.4em 0.4em 1.2em rgba(0, 0, 0, 0.5);
}

/* IMAGE */
.web-card__img {
  width: 100%;
  display: block;
}

/* CONTENT */
.web-card__content {
  padding: 1.2rem;
  text-align: left;
}

/* TITLE */
.web-card__title {
  margin-bottom: 0.4rem;
}

/* ROLE / SUBTITLE */
.web-card__role {
  font-size: 0.85rem;
  color: var(--clr-accent);
  margin-bottom: 0.8rem;
}

/* DESCRIPTION */
.web-card__description {
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* CTA */
.web-card__cta {
  display: inline-block;
  text-decoration: none;
  font-weight: var(--fw-bold);
  color: var(--clr-accent);
}

.web-card__cta:hover {
  text-decoration: underline;
}

/* ==============================
   RESPONSIVE
============================== */

@media (max-width: 500px) {
  .web-card__content {
    text-align: center;
  }
}
