/* ═══════════════════════════════════════
   RESET
═══════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ═══════════════════════════════════════
   TOKENS
═══════════════════════════════════════ */
:root {
  --bg:       #FCF9EF;
  --text:     #1a1918;
  --max-w:    1440px;
  --px:       48px;
  --row-gap:  80px;
  --img-gap:  14px;
}

/* ═══════════════════════════════════════
   BASE
═══════════════════════════════════════ */
html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 300;
  font-size: 13px;
  line-height: 1.6;
}

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

a {
  color: inherit;
}

/* ═══════════════════════════════════════
   HEADER / NAV
═══════════════════════════════════════ */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  padding: 22px var(--px);
}

nav {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 40px;
}

.nav-links a {
  font-size: 14px;
  font-weight: 400;
  text-decoration: none;
}

.nav-links a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ═══════════════════════════════════════
   MAIN WRAPPER
═══════════════════════════════════════ */
main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--px);
}

/* ═══════════════════════════════════════
   PORTFOLIO
═══════════════════════════════════════ */
#portfolio {
  padding-top: 12px;
}

.portfolio-row {
  display: flex;
  gap: var(--img-gap);
  align-items: flex-start;
  margin-bottom: var(--row-gap);
}

.work-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.portfolio-row .work-item img {
  height: 400px;
  object-fit: cover;
}

.caption {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 20px;
  font-weight: 300;
  font-style: italic;
  margin-top: 10px;
  line-height: 1.4;
  color: var(--text);
}

.caption a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: currentColor;
}

.caption a:hover {
  opacity: 0.6;
}

/* ═══════════════════════════════════════
   BIO — secção offset (penúltima)
═══════════════════════════════════════ */
.bio-section {
  padding-bottom: 20px;
}

.bio-flex {
  display: flex;
  align-items: flex-start;
  gap: var(--img-gap);
}

.bio-left {
  flex: 3;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.bio-left > img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

/* Offset para baixo — efeito "desencontrado" */
.bio-right {
  flex: 7;
  margin-top: 240px;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 40px;
}

.bio-text {
  flex: 1;
  max-width: 390px;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.8;
}

.bio-text p + p {
  margin-top: 20px;
}

.bio-photo-wrap {
  flex: 1;
}

/* ═══════════════════════════════════════
   CONTACTOS
═══════════════════════════════════════ */
#contactos {
  padding: 100px 0 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.email-link {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 20px;
  font-style: italic;
  font-weight: 400;
  text-decoration: none;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.email-link:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.linkedin-link {
  font-size: 13px;
  font-weight: 300;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--text);
}

.linkedin-link:hover {
  opacity: 0.6;
}

/* ═══════════════════════════════════════
   FOOTER
═══════════════════════════════════════ */
footer {
  text-align: center;
  padding: 16px var(--px) 36px;
  font-size: 11.5px;
  font-weight: 300;
  opacity: 0.55;
}

/* ═══════════════════════════════════════
   RESPONSIVE — tablet
═══════════════════════════════════════ */
@media (max-width: 960px) {
  :root {
    --px:      28px;
    --row-gap: 52px;
    --img-gap: 10px;
  }

  .bio-flex {
    gap: 40px;
  }

  .bio-right {
    margin-top: 120px;
  }
}

/* ═══════════════════════════════════════
   RESPONSIVE — mobile
═══════════════════════════════════════ */
@media (max-width: 640px) {
  :root {
    --px:      20px;
    --row-gap: 40px;
  }

  header {
    padding: 18px var(--px);
  }

  .nav-links {
    gap: 22px;
  }

  /* Stack portfolio rows vertically */
  .portfolio-row {
    flex-direction: column;
    gap: 24px;
  }

  /* Reset inline flex values */
  .portfolio-row .work-item {
    flex: unset !important;
    width: 100%;
  }

  /* Stack bio section */
  .bio-flex {
    flex-direction: column;
    gap: 28px;
  }

  .bio-right {
    margin-top: 0;
  }

  .bio-left > img,
  .bio-left > .caption {
    max-width: 100%;
  }

  .bio-text {
    max-width: 100%;
    margin-top: 28px;
  }

  #contactos {
    padding: 60px 0 40px;
  }
}
