/* === Base styles === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: "Kalnia", serif;
  background-color: #fefaee;
}

body {
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* === Portfolio Container === */
.portfolio {
  display: grid;
  grid-template-areas:
    "menu menu"
    "header header"
    "content--text content--image"
    "projects projects"
    "footer footer";
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  font-family: "Kalnia", serif;
}

.site-logo {
  position: fixed;
  top: 10px;
  left: 10px;
  width: 50px;
  height: auto;
  z-index: 1000;
}

/* === Typography === */
.kalnia-logo {
  font-family: "Kalnia", serif;
  font-weight: 400;
  font-style: normal;
  font-size: 100px;
  letter-spacing: 30px;
  font-variation-settings: "wdth" 100;
}

/* === Menu === */
.portfolio__menu {
  grid-area: menu;
  width: 100%;
  height: 94px;
  background: #fefaee url(../img/menu_top.png) no-repeat right;
  z-index: 2;
}

.portfolio__menu-inner {
  text-align: right;
}

.portfolio__menu-link {
  display: inline-block;
  margin: 0 45px;
  text-decoration: none;
  font-family: "Kalnia", serif;
  color: black;
}

.portfolio__menu-link img {
  height: 30px;
  width: auto;
  vertical-align: bottom;
}

/* === Header === */
.portfolio__header {
  grid-area: header;
  width: 100%;
  height: 700px;
  background: url(../img/dicte_front.png) no-repeat right;
  background-size: contain;
  z-index: 1;
}

.portfolio__header-textbox {
  position: relative;
  top: -15px;
  left: 10%;
  font-size: 50px;
  text-align: left;
  font-family: "Kalnia", serif;
}

/* === Content === */
.portfolio__content--text,
.portfolio__content--image {
  height: 700px;
  background-color: #67654b;
}

.portfolio__content--text {
  grid-area: content--text;
  position: relative;
}

.portfolio__content--image {
  grid-area: content--image;
  display: flex;
  justify-content: center;
  align-items: center;
}

.portfolio__content--image img {
  max-width: 100%;
  height: auto;
}

/* Animation */
.logo {
  width: 490px;
  height: 500px;
  background: url("../img/kat-01.png") 0 0 no-repeat;
  animation: play 3s steps(22) infinite;
}

@keyframes play {
  0% {
    background-position: 0px;
  }
  100% {
    background-position: -11000px;
  }
}

.portfolio__text-box {
  position: relative;
  top: 150px;
  left: 50px;
  text-align: left;
  font-size: 35px;
  font-family: "Kalnia", serif;
  color: white;
  padding: 20px;
}

/* === Projects === */
.portfolio__projects {
  grid-area: projects;
  text-align: center;
  padding: 40px 20px;
  background-color: #fefaee;
}

.portfolio__projects-title {
  margin-bottom: 30px;
  font-family: "Kalnia", serif;
  font-size: 50px;
  letter-spacing: 15px;
  color: #333;
}

.portfolio__projects-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 50px;
  justify-content: center;
  margin: 0 auto;
  max-width: 1200px;
}

.portfolio__project {
  flex: 0 0 calc(33.333% - 50px);
  aspect-ratio: 1 / 1;
  background-color: #f4f4f4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.portfolio__project:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.portfolio__project img,
.portfolio__project video {
  max-width: 100%;
  height: auto;
  object-fit: cover;
}

/* === Footer === */
.portfolio__footer {
  grid-area: footer;
  padding: 30px 20px;
  background-color: #fefaee;
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.portfolio__contact,
.portfolio__address {
  color: #333;
  font-family: "Kalnia", serif;
  font-size: 14px;
  line-height: 1.4;
  padding: 10px 15px;
  flex: 1;
}

.portfolio__contact {
  text-align: right;
}

/* === Links === */
a:link,
a:visited {
  font-family: "Kalnia", serif;
  color: black;
  text-decoration: none;
}

a:hover {
  color: #67654b;
  text-decoration: underline;
}

a:active {
  color: pink;
  text-decoration: underline;
}

/* === Media Queries === */
@media (max-width: 1024px) {
  .portfolio__header {
    height: 500px;
  }

  .kalnia-logo {
    font-size: 70px;
    letter-spacing: 20px;
  }

  .portfolio__text-box {
    font-size: 28px;
  }

  .logo {
    transform: scale(0.8);
  }

  .portfolio__project {
    flex: 0 0 calc(50% - 50px);
  }
}

@media (max-width: 768px) {
  .portfolio {
    grid-template-areas:
      "menu menu"
      "header header"
      "content--text content--text"
      "content--image content--image"
      "projects projects"
      "footer footer";
  }

  .portfolio__header {
    height: 400px;
  }

  .portfolio__header-textbox {
    top: 100px;
    font-size: 30px;
  }

  .kalnia-logo {
    font-size: 50px;
    letter-spacing: 15px;
  }

  .portfolio__content--text,
  .portfolio__content--image {
    height: 400px;
  }

  .portfolio__text-box {
    top: 80px;
    left: 30px;
    font-size: 24px;
  }
}

@media (max-width: 600px) {
  /* === Layout === */
  .portfolio {
    grid-template-areas:
      "menu menu"
      "header header"
      "content--text content--text"
      "content--image content--image"
      "projects projects"
      "footer footer";
  }

  /* === Typography === */
  .kalnia-logo {
    font-size: 20px;
    letter-spacing: 5px;
  }

  /* === Menu === */
  .portfolio__menu {
    height: 40px;
    background-size: contain;
    background-position: right;
  }

  .portfolio__menu-inner {
    position: absolute;
    right: 5%;
    text-align: right;
  }

  .portfolio__menu-link {
    margin: 0 5px;
    font-size: 12px;
  }

  /* === Header === */
  .portfolio__header {
    height: 300px;
  }

  .portfolio__header-textbox {
    top: 50px;
    font-size: 15px;
  }

  /* === Content === */
  .portfolio__content--text,
  .portfolio__content--image {
    height: 300px;
  }

  .portfolio__text-box {
    top: 40px;
    left: 20px;
    font-size: 18px;
    padding: 10px;
  }

  .logo {
    width: 200px;
    height: 200px;
    background-size: cover;
    background-size: 4800px 200px;
    animation: play-sm 3s steps(24) infinite;
  }

  @keyframes play-sm {
    0% {
      background-position: 0px;
    }
    100% {
      background-position: -4800px;
    }
  }

  /* === Projects === */
  .portfolio__projects {
    padding: 20px 10px;
  }

  .portfolio__projects-title {
    margin-bottom: 20px;
    font-size: 30px;
    letter-spacing: 5px;
  }

  .portfolio__projects-grid {
    gap: 20px;
  }

  .portfolio__project {
    flex: 0 0 100%;
    max-width: 300px;
  }

  /* === Footer === */
  .portfolio__footer {
    margin-top: 20px;
    padding: 15px;
    flex-direction: column;
  }

  .portfolio__contact,
  .portfolio__address {
    width: 100%;
    text-align: center;
    padding: 10px 0;
  }
}
