/* ============================================
   PRIMO PORTFOLIO — Design System & Styles
   Aligned with Figma: Portifa (node 2046-1289)
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors — from Figma */
  --color-bg: #FFFCF7;
  --color-bg-dark: #1a1a1a;
  --color-text: #262626;
  --color-text-muted: #6b6b6b;
  --color-accent: #d4641a;
  --color-accent-hover: #b8530f;
  --color-white: #ffffff;
  --color-border: #e5e5e5;
  --color-tag-bg: #ffffff;
  --color-tag-border: #d1d1d1;

  /* Typography — from Figma */
  --font-body: 'Funnel Display', Georgia, sans-serif;
  --font-display: 'Funnel Display', Georgia, sans-serif;
  --font-handwritten: 'Mansalva', cursive;

  /* Spacing — from Figma */
  --space-xs: 0.5rem;    /* 8px */
  --space-sm: 0.75rem;   /* 12px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 2.5rem;   /* 40px — Figma lateral padding */
  --space-3xl: 5rem;     /* 80px */
  --space-4xl: 6rem;     /* 96px — Figma section gap */

  /* Layout */
  --max-width: 1040px; /* 960px content + 40px×2 padding (border-box) */
  --header-height: 64px;

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --duration: 0.3s;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--color-bg); /* canvas fica acima disso */
}

body {
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: transparent; /* canvas fornece o fundo */
  line-height: 1.6;
}

/* --- Background pattern canvas --- */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;       /* atrás de todo o conteúdo, na frente do fundo do html */
  pointer-events: none;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

a:hover {
  color: var(--color-accent-hover);
}

/* --- Utilities --- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-2xl);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --- Header — floating pill, aligned to container right edge --- */
.header {
  position: fixed;
  top: 40px;
  left: 0;
  right: 0;
  z-index: 100;
  pointer-events: none; /* transparent areas don't block scrolling */
}

.header__inner {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-2xl);
  pointer-events: none;
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  height: 64px;
  background-color: var(--color-bg);
  border-radius: 100px;
  border: 1px solid #E8E8E8;
  pointer-events: auto;
}

.header__lang {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 8px 14px;
  background-color: #ECDDC7;
  border: none;
  cursor: pointer;
  border-radius: 56px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  color: #171412;
  text-decoration: none;
  transition: background-color var(--duration) var(--ease);
  white-space: nowrap;
}

.header__lang:hover {
  background-color: #DFD0B8;
  color: #171412;
}

.header__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 8px 16px;
  background-color: #171412;
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 56px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--duration) var(--ease);
}

.header__cta:hover {
  background-color: #E3700B;
  color: var(--color-white);
}

/* --- Hero --- Figma: padding 40px top/bottom, gap 80px between children */
.hero {
  padding-top: 40px;
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.hero__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  transition: opacity var(--duration) var(--ease);
}

.hero__avatar:hover {
  opacity: 0.85;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero__greeting {
  font-family: var(--font-handwritten);
  font-size: 2rem; /* 32px */
  line-height: 1.25; /* 40px */
  color: var(--color-text);
  font-weight: 400;
}

.hero__greeting strong {
  color: #E3700B;
  font-weight: 400;
}

/* Figma: Funnel Display, Bold, 48px, line-height 69.1 (≈1.44), color #262626 */
.hero__title {
  font-family: var(--font-display);
  font-size: 3rem; /* 48px */
  font-weight: 700;
  line-height: 1.5; /* 72px */
  color: var(--color-text);
}

.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.hero__tags li {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  border: 1.5px solid #826F5F;
  border-radius: 56px;
  font-size: 0.875rem; /* 14px */
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #826F5F;
  white-space: nowrap;
}

/* --- Projects --- Figma: section gap 80px */
.projects {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-3xl);
}

/* Figma: Link-Variant 1 has Container + Image side by side */
.project-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md); /* 16px */
  align-items: center;
  position: relative;
  isolation: isolate;
}

/* Gradient — fades in on hover, rising from the bottom line */
.project-card::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 200px;
  background: linear-gradient(to top, rgba(227, 112, 11, 0.10) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s var(--ease), width 0.4s var(--ease);
  z-index: -1;
  pointer-events: none;
}

/* Bottom border line — expands to viewport edges on hover */
.project-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 1px;
  background-color: #E3E3E3;
  transition: width 0.4s var(--ease);
}

.project-card:hover::before {
  opacity: 1;
  width: 100vw;
}

.project-card:hover::after {
  width: 100vw;
}

.project-card__date {
  font-size: 0.875rem;
  color: #826F5F;
  font-weight: 500;
}

/* Figma: project title ~32px Funnel Display Bold */
.project-card__title {
  font-family: var(--font-display);
  font-size: 2rem;        /* 32px — igual ao about__title */
  line-height: 2.5rem;    /* 40px */
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--color-text);
  transition: color var(--duration) var(--ease);
}

.project-card:hover .project-card__title {
  color: #E3700B;
}

.project-card__description {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  line-height: 1.8rem;
  margin-bottom: var(--space-lg);
}

.project-card__image {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  align-self: stretch; /* ocupa toda a altura da linha para alinhar imagem à base */
}

.project-card__image img {
  width: 100%;
  max-width: 440px;
}

.project-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.project-card-link:hover {
  color: inherit;
}

.project-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.project-card__link:hover {
  color: inherit;
}

/* --- About --- Figma: section with border-top, gap between sections = 80px */
.about {
  padding-top: var(--space-3xl);
  padding-bottom: var(--space-3xl);
}

.about__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xl);
}

.about__title {
  font-family: var(--font-display);
  font-size: 2rem;     /* 32px */
  line-height: 2.5rem; /* 40px */
  font-weight: 700;
  color: var(--color-text);
}

.about__resume {
  font-size: 1.25rem;
  line-height: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
}

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

.about__text {
  max-width: 100%;
}

.about__text p {
  font-size: 1.2rem;
  color: var(--color-text-muted);
  line-height: 1.8rem;
  margin-bottom: var(--space-lg);
}

.about__text p:last-child {
  margin-bottom: 0;
}

/* --- Contact --- Figma: dark bg, Fale comigo title */
.contact {
  background-color: var(--color-bg-dark);
  color: var(--color-white);
  padding-top: var(--space-4xl);
  padding-bottom: var(--space-4xl);
  margin-top: var(--space-3xl);
}

.contact__title {
  font-family: var(--font-display);
  font-size: 2rem;     /* 32px */
  line-height: 2.5rem; /* 40px */
  font-weight: 700;
  margin-bottom: var(--space-2xl);
}

.contact__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.contact__item-label {
  font-size: 0.8125rem;
  color: #999;
  margin-bottom: 0;
}

.contact__item-value {
  font-size: 1.25rem;
  line-height: 1.5rem;
  color: var(--color-accent);
  font-weight: 700;
}

.contact__item-value:hover {
  text-decoration: underline;
}

/* --- Footer --- */
.footer {
  background-color: var(--color-bg-dark);
  text-align: center;
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-2xl);
}

.footer__text {
  font-size: 0.8125rem;
  color: #666;
}

/* --- Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

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

/* --- Responsive --- */

/* Tablet: 600–1040px — margens laterais de 40px, conteúdo preenche a página */
@media (max-width: 1040px) {
  .container {
    max-width: 100%;
    padding-left: 40px;
    padding-right: 40px;
  }

  .header__inner {
    max-width: 100%;
    padding-left: 40px;
    padding-right: 40px;
  }

  .hero__title {
    font-size: 2.5rem; /* 40px on tablet */
  }

}


/* Mobile: abaixo de 600px — margens laterais de 24px */
@media (max-width: 600px) {
  .container {
    padding-left: 24px;
    padding-right: 24px;
  }


  .header__inner {
    padding-left: 24px;
    padding-right: 24px;
  }

  .hero {
    padding-top: var(--space-2xl);
    padding-bottom: var(--space-lg);
  }

  .hero__title {
    font-size: 1.75rem;
  }

  /* Artigos: foto em cima, texto embaixo */
  .project-card {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    padding-bottom: 24px;
  }

  .project-card__image {
    order: -1;
  }

  /* Fale comigo: links empilhados verticalmente */
  .contact__grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

.project-card__title {
    font-size: 1.5rem;
  }

}
