@font-face {
  font-family: 'Gilroy';
  src: url('../font/Gilroy-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
}

@font-face {
  font-family: 'Gilroy';
  src: url('../font/Gilroy-LightItalic.ttf') format('truetype');
  font-weight: 300;
  font-style: italic;
}

@font-face {
  font-family: 'Gilroy';
  src: url('../font/Gilroy-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

@font-face {
  font-family: 'Gilroy';
  src: url('../font/Gilroy-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

:root,
[data-theme="retrato-1"],
[data-theme="retrato-9"] {
  --bg: #D1CCD9;
  --bg-card-primary: #0F2440;
  --bg-card-secondary: #071526;
  --fg-primary: var(--bg);
  --fg-primary-hv: #8C504A;
}

[data-theme="retrato-2"] {
  --bg: #201C26;
  --bg-card-primary: #D9D1BA;
  --bg-card-secondary: #A59A85;
  --fg-primary: var(--bg);
  --fg-primary-hv: #A66253;
}

[data-theme="retrato-3"] {
  --bg: #F2F1DC;
  --bg-card-primary: #025939;
  --bg-card-secondary: #02734A;
  --fg-primary: var(--bg);
  --fg-primary-hv: #D97E6A;
}

[data-theme="retrato-4"] {
  --bg: #241C40;
  --bg-card-primary: #B3A9D9;
  --bg-card-secondary: #6B78BF;
  --fg-primary: var(--bg);
  --fg-primary-hv: #A67C84;
}

[data-theme="retrato-5"] {
  --bg: #BCA85F;
  --bg-card-primary: #365959;
  --bg-card-secondary: #6D733F;
  --fg-primary: #D1CCD9;
  --fg-primary-hv: #8C5626;
}

[data-theme="retrato-6"] {
  --bg: #A3BFB5;
  --bg-card-primary: #F2A0A7;
  --bg-card-secondary: #C55863;
  --fg-primary: #252A2D;
  --fg-primary-hv: #A61C35;
}

[data-theme="retrato-7"] {
  --bg: #BFB4AA;
  --bg-card-primary: #252526;
  --bg-card-secondary: #232226;
  --fg-primary: var(--bg);
  --fg-primary-hv: #BF7C63;
}

[data-theme="retrato-8"] {
  --bg: #8C7765;
  --bg-card-primary: #35402D;
  --bg-card-secondary: #4D5644;
  --fg-primary: #DCD6D2;
  --fg-primary-hv: #FFB300;
}

:root {
  --projects-padding: clamp(22px, 3vw, 30px);
  --projects-gap: clamp(12px, 1.6vh, 18px);
  --project-card-padding: clamp(14px, 2vh, 20px);
  --project-card-gap: clamp(6px, 1.2vh, 10px);
  --project-title-size: clamp(0.82rem, 1.9vh, 1.1rem);
  --project-text-size: clamp(0.78rem, 1.65vh, 0.95rem);
  --project-lines: 3;
}


* {
  margin: 0;
  padding: 0;
}

.preloader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 25vw;
  height: 35vh;
  min-width: 250px;
  min-height: 350px;
  background-color: var(--bg-card-primary);
  border-radius: 15px;
  overflow: hidden;
  z-index: 30;
  transition: all 1.2s ease-out;
  will-change: top, left, width, height, opacity;
  opacity: 1;
}

.preloader img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.postloader {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: transparent;
  border-radius: 15px;
  overflow: hidden;
  opacity: 0;
  z-index: 1;
}

.postloader img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.preloader.moved {
  visibility: hidden;
}

.postloader.visible {
  opacity: 1;
  transition: opacity 0.3s ease;
}

body {
  background-color: var(--bg);
  color: var(--fg-primary);
  font-family: 'Gilroy', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  padding: 15px;
}

.grid-template {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(10, 1fr);
  grid-column-gap: 30px;
  grid-row-gap: 30px;
  height: calc(100vh - 30px);
}

.grid-header {
  grid-area: 1 / 1 / 2 / 13;
}

.grid-ref {
  grid-area: 2 / 1 / 8 / 6;
}

.grid-img {
  grid-area: 2 / 6 / 8 / 9;
}

.grid-projects {
  grid-area: 2 / 9 / 10 / 13;
}

.grid-about {
  grid-area: 8 / 1 / 11 / 5;
}

.grid-contact {
  grid-area: 8 / 5 / 11 / 9;
}

.grid-social {
  grid-area: 10 / 9 / 11 / 13;
}

/* Animações de entrada */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Animações que partem da imagem */
@keyframes slideFromImageLeft {
  from {
    opacity: 0;
    transform: translateX(40%) scale(0.3);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes slideFromImageRight {
  from {
    opacity: 0;
    transform: translateX(-40%) scale(0.3);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes slideFromImageTop {
  from {
    opacity: 0;
    transform: translateY(100%) scale(0.3);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes slideFromImageBottom {
  from {
    opacity: 0;
    transform: translateY(-100%) scale(0.3);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fadeInFromImage {
  from {
    opacity: 0;
    transform: scale(0.3);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.grid-header,
.grid-ref,
.grid-img,
.grid-projects,
.grid-about,
.grid-contact,
.grid-social {
  opacity: 0;
}

.grid-template.loaded .grid-img {
  /* animation: fadeInFromImage 0.6s ease-out forwards; */
  opacity: 1;
  animation-delay: 0s;
}

.grid-template.loaded .grid-header {
  animation: slideFromImageTop 0.8s ease-out forwards;
  animation-delay: 0.3s;
}

.grid-template.loaded .grid-ref {
  animation: slideFromImageLeft 0.8s ease-out forwards;
  animation-delay: 0.4s;
}

.grid-template.loaded .grid-projects {
  animation: slideFromImageRight 0.8s ease-out forwards;
  animation-delay: 0.5s;
}

.grid-template.loaded .grid-about {
  animation: slideFromImageLeft 0.8s ease-out forwards;
  animation-delay: 0.6s;
}

.grid-template.loaded .grid-contact {
  animation: slideFromImageBottom 0.8s ease-out forwards;
  animation-delay: 0.7s;
}

.grid-template.loaded .grid-social {
  animation: slideFromImageRight 0.8s ease-out forwards;
  animation-delay: 0.8s;
}


.grid-header {
  background-color: var(--bg-card-primary);
  border-radius: 15px;
  padding: 20px 30px;
}

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

.logo {
  display: flex;
  gap: 8px;
  font-size: 1.56rem;
  font-weight: 600;
  letter-spacing: 2px;
}

.name-first {
  color: var(--fg-primary);
  font-weight: 300;
  font-style: italic;
}

.name-last {
  color: var(--fg-primary);
  font-weight: 500;
}

.nav-menu {
  display: flex;
  gap: 40px;
}

.nav-menu a {
  color: var(--fg-primary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: bold;
  letter-spacing: 1.5px;
  transition: color 0.3s ease;
}

.nav-menu a:hover {
  color: var(--fg-primary-hv);
}

.navbar {
  padding: 0;
  width: 100%;
}

.navbar-toggler {
  border: 2px solid var(--fg-primary);
  padding: 8px 12px;
}

.navbar-toggler:focus {
  box-shadow: none;
  border-color: var(--fg-primary-hv);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  width: 24px;
  height: 24px;
}

.navbar-nav {
  gap: 40px;
}

.nav-link {
  color: var(--fg-primary) !important;
  text-decoration: none;
  font-size: 1rem !important;
  font-weight: bold !important;
  letter-spacing: 1.5px;
  padding: 0 !important;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--fg-primary-hv) !important;
}


@media (max-width: 992px) {
  .navbar {
    flex-wrap: wrap;
  }

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

  .navbar-collapse {
    width: 100%;
    margin-top: 5px;
    background-color: var(--bg-card-primary);
    padding: 10px;
    border-radius: 10px;
  }

  .navbar-nav {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
}

@media (min-width: 993px) {
  .navbar-toggler {
    display: none;
  }
}

.grid-ref {
  background-color: var(--bg-card-primary);
  border-radius: 15px;
  padding: 40px;
  display: flex;
  align-items: center;
}

.ref-content em {

  font-style: italic;
  font-weight: 300;
}

.ref-title {
  font-size: 3rem;
  line-height: 1.2;
  font-weight: bold;
  color: var(--fg-primary);
}

.title-line-2 {
  font-style: normal;
}


.grid-img {
  border-radius: 15px;
  overflow: hidden;
  position: relative;
}

.grid-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.grid-projects {
  background-color: var(--bg-card-primary);
  border-radius: 15px;
  padding: var(--projects-padding);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.projects-container {
  display: flex;
  flex-direction: column;
  gap: var(--projects-gap);
  width: 100%;
  height: 100%;
  min-height: 0;
}

.project-card {
  background-color: var(--bg-card-secondary);
  border-radius: 12px;
  padding: var(--project-card-padding);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--project-card-gap);
  position: relative;
  transition: transform 0.3s ease;
  cursor: pointer;
  text-decoration: none;
  color: var(--fg-primary);
  box-sizing: border-box;
  width: 100%;
  min-height: 0;
}

.project-card:hover {
  transform: translateY(-5px);
  background-color: var(--bg-card-primary);
}

.project-card h3 {
  color: var(--fg-primary);
  font-size: var(--project-title-size);
  font-weight: 500;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-card p {
  color: var(--fg-primary);
  font-size: var(--project-text-size);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: var(--project-lines);
  -webkit-box-orient: vertical;
  line-clamp: var(--project-lines);
  overflow: hidden;
  min-height: 0;
}

.project-card.musea {
  flex: 2;
}

.project-image {
  flex: 1;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 10px;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-card:not(.musea):after {
  content: '↗';
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--fg-primary);
  font-size: 20px;
  opacity: 0.6;
}

.grid-about {
  background-color: var(--bg-card-primary);
  border-radius: 15px;
  padding: 30px;
  display: flex;

}

.about-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  justify-content: flex-end;
}

.about-text {
  justify-content: flex-end;
  text-align: justify;
  color: var(--fg-primary);
  font-size: 1rem;
  line-height: 1.6;
  opacity: 0.9;
}

.grid-contact {
  background-color: var(--bg-card-secondary);
  border-radius: 15px;
  padding: 40px;

}

.contact-header {
  display: flex;
  justify-content: space-between;
}

.contact-header .contact-link {
  text-decoration: none;
}

.contact-content {
  color: var(--fg-primary);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.contact-content h2 {
  font-size: 3.2rem;
  font-weight: 300;
  margin-bottom: 30px;
}

.arrow {
  font-size: 2rem;
  color: var(--fg-primary);
}

.grid-social {
  background-color: var(--bg-card-primary);
  border-radius: 15px;
  padding: 20px 30px;
  display: flex;
  align-items: center;
}

.social-links {
  display: flex;
  gap: 30px;
  width: 100%;
  justify-content: space-around;
}

.social-links a {
  color: var(--fg-primary);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 1.5px;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: var(--fg-primary-hv);
}

/* Tablet/Notebook - 768px a 1024px */
@media (max-width: 1024px) {
  body {
    padding: 10px;
  }

  .grid-template {
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: auto;
    grid-column-gap: 20px;
    grid-row-gap: 20px;
    height: auto;
  }

  .grid-header {
    grid-area: 1 / 1 / 2 / 7;
    padding: 15px 20px;
  }

  .logo {
    font-size: 1.25rem;
    gap: 6px;
  }

  .nav-menu {
    gap: 25px;
  }

  .nav-menu a {
    font-size: 0.9rem;
    letter-spacing: 1.2px;
  }

  .grid-ref {
    grid-area: 2 / 1 / 3 / 7;
    padding: 30px;
    min-height: 280px;
  }

  .ref-title {
    font-size: 2.2rem;
    line-height: 1.3;
  }

  .grid-img {
    grid-area: 3 / 1 / 4 / 7;
    min-height: 400px;
  }

  .grid-img img {
    object-position: center;
  }

  .grid-projects {
    grid-area: 4 / 1 / 5 / 7;
    padding: var(--projects-padding);
    min-height: 500px;
  }

  .grid-about {
    grid-area: 5 / 1 / 6 / 7;
    padding: 25px;
    min-height: 180px;
  }

  .about-text {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  .grid-contact {
    grid-area: 6 / 1 / 7 / 7;
    padding: 30px;
    min-height: 250px;
  }

  .contact-content h2 {
    font-size: 2.5rem;
  }

  .contact-header span {
    font-size: 1rem;
  }

  .arrow {
    font-size: 1.8rem;
  }

  .grid-social {
    grid-area: 7 / 1 / 8 / 7;
    padding: 18px 25px;
  }

  .social-links a {
    font-size: 10px;
  }
}

@media (max-width: 768px) {
  body {
    padding: 8px;
  }

  .grid-template {
    grid-template-columns: 1fr;
    grid-column-gap: 0;
    grid-row-gap: 15px;
    height: auto;
  }

  .grid-header {
    grid-area: auto;
    padding: 12px 18px;
  }

  .header-content {
    /* flex-direction: column; */
    gap: 15px;
    align-items: center;
  }

  .logo {
    font-size: 1.1rem;
    gap: 5px;
  }

  .nav-menu {
    gap: 20px;
    width: 100%;
    justify-content: space-between;
  }

  .nav-menu a {
    font-size: 0.85rem;
    letter-spacing: 1px;
  }

  .grid-ref {
    grid-area: auto;
    padding: 25px 20px;
    min-height: 250px;
  }

  .ref-title {
    font-size: 1.75rem;
    line-height: 1.4;
  }

  .grid-img {
    grid-area: auto;
    min-height: 350px;
  }

  .grid-projects {
    grid-area: auto;
    padding: var(--projects-padding);
    min-height: 450px;
  }

  .projects-container {
    gap: var(--projects-gap);
  }

  .grid-about {
    grid-area: auto;
    padding: 20px;
    min-height: 160px;
  }

  .about-text {
    font-size: 0.875rem;
    line-height: 1.55;
  }

  .grid-contact {
    grid-area: auto;
    padding: 25px 20px;
    min-height: 220px;
  }

  .contact-content h2 {
    font-size: 2rem;
  }

  .contact-header span {
    font-size: 0.95rem;
  }

  .arrow {
    font-size: 1.6rem;
  }

  .grid-social {
    grid-area: auto;
    padding: 15px 20px;
  }

  .social-links {
    gap: 20px;
  }

  .social-links a {
    font-size: 9px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 6px;
  }

  .grid-template {
    grid-row-gap: 12px;
  }

  .grid-header {
    padding: 10px 15px;
  }

  .logo {
    font-size: 1rem;
  }

  .nav-menu a {
    font-size: 0.75rem;
  }

  .grid-ref {
    padding: 20px 15px;
    min-height: 220px;
  }

  .ref-title {
    font-size: 1.5rem;
    line-height: 1.35;
  }

  .grid-img {
    min-height: 300px;
  }

  .grid-projects {
    padding: var(--projects-padding);
  }

  .grid-about {
    padding: 18px 15px;
  }

  .about-text {
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .grid-contact {
    padding: 20px 15px;
  }

  .contact-content h2 {
    font-size: 1.75rem;
  }

  .contact-header span {
    font-size: 0.9rem;
    line-height: 1.3;
  }

  .arrow {
    font-size: 1.5rem;
  }

  .grid-social {
    padding: 12px 15px;
  }

  .social-links {
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .social-links a {
    font-size: 8px;
  }
}

@media (max-height: 900px) {
  :root {
    --projects-padding: clamp(20px, 2.4vw, 28px);
    --projects-gap: clamp(10px, 1.4vh, 14px);
    --project-card-padding: clamp(12px, 1.8vh, 16px);
    --project-title-size: clamp(0.78rem, 1.7vh, 1rem);
    --project-text-size: clamp(0.72rem, 1.5vh, 0.9rem);
    --project-lines: 2;
  }
}

@media (max-height: 780px) {
  :root {
    --project-lines: 2;
  }

  .about-text {
    font-size: 1rem;
    line-height: 1.2;
  }
}