/* ============================================================
   Thiago Duarte — Portfólio
   Regras: texto só em cinza; o azul (#0000FF) aparece apenas
   em interações (hover, foco, seleção). Dois tamanhos de fonte.
   ============================================================ */

:root {
  /* Cores */
  --ink: #222222;   /* nomes de coisas: títulos, itens, links */
  --mid: #5c5c5c;   /* frases e descrições */
  --soft: #767676;  /* rótulos e metadados (datas, anos) */
  --line: #e6e6e6;  /* divisórias e bordas */
  --fill: #f4f4f4;  /* fundo das imagens enquanto carregam */
  --blue: #0000ff;  /* interação — cor da marca */

  /* Tipografia: só dois tamanhos */
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --fs: 1rem;
  --fs-display: clamp(1.625rem, 1rem + 2.6vw, 2.75rem);

  /* Espaço e forma */
  --gutter: clamp(16px, 4vw, 48px);
  --gap: 24px;
  --radius: 6px;
  --max: 1280px;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: #fff;
  color: var(--mid);
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
p,
ul,
dl,
dd {
  margin: 0;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
}

ul {
  list-style: none;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

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

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}

::selection {
  background: var(--blue);
  color: #fff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.display {
  font-size: var(--fs-display);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

/* Seta de link externo — o único ícone do site */
.ext::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-left: 0.35em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2.5 1H9v6.5M9 1 1 9' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2.5 1H9v6.5M9 1 1 9' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform 0.2s ease;
}

a:hover .ext::after,
a.ext:hover::after {
  transform: translate(2px, -2px);
}

/* ---------- Cabeçalho ---------- */

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 24px;
}

.mark {
  display: block;
  color: var(--ink);
}

.mark svg {
  display: block;
  width: 33px;
  height: 22px;
  fill: currentColor;
}

.nav ul {
  display: flex;
  gap: 24px;
}

/* ---------- Abertura ---------- */

.hero {
  padding-block: clamp(72px, 14vw, 176px) clamp(56px, 8vw, 104px);
}

.hero h1 {
  color: var(--ink);
  font-weight: 500;
}

.hero p {
  max-width: 21em;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding-inline: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  border-color: var(--blue);
  color: var(--blue);
}

.btn--primary {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.btn--primary:hover {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

/* ---------- Seções (grade de currículo) ---------- */

.section {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gap);
  padding-block: 40px 88px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}

.section__label {
  grid-column: 1 / 4;
  align-self: start;
  position: sticky;
  top: 24px;
  color: var(--soft);
  font-weight: 500;
}

.section__label a {
  display: inline-block;
  margin-top: 8px;
  color: var(--mid);
  font-weight: 400;
}

.section__label a:hover {
  color: var(--blue);
}

.section__body {
  grid-column: 4 / -1;
}

/* ---------- Projetos ---------- */

.projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px var(--gap);
}

/* O primeiro projeto ocupa a linha inteira; se o último sobrar sozinho, também. */
.projects > li:first-child,
.projects > li:last-child:nth-child(even) {
  grid-column: 1 / -1;
}

.project {
  display: block;
}

.project:focus-visible {
  outline: none;
}

.project__media {
  aspect-ratio: 808 / 632;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--fill);
  outline: 2px solid transparent;
  outline-offset: 4px;
  transition: outline-color 0.15s ease;
}

.project__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.project:hover .project__media,
.project:focus-visible .project__media {
  outline-color: var(--blue);
}

.project:hover .project__media img {
  transform: scale(1.02);
}

.project__info {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 16px;
  margin-top: 16px;
}

.project__title {
  color: var(--ink);
  font-weight: 500;
  transition: color 0.15s ease;
}

.project:hover .project__title {
  color: var(--blue);
}

.project__year {
  color: var(--soft);
}

.project__desc {
  grid-column: 1 / -1;
  max-width: 48ch;
  color: var(--mid);
}

/* ---------- Experiência e formação ---------- */

.entries {
  display: grid;
  gap: 32px;
}

.entry {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 24px;
}

.entry__title {
  color: var(--ink);
  font-weight: 500;
}

.entry__date {
  color: var(--soft);
  white-space: nowrap;
}

.entry__desc {
  grid-column: 1 / -1;
  max-width: 60ch;
}

/* ---------- Competências ---------- */

.skills {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px var(--gap);
}

.skills h3 {
  margin-bottom: 8px;
  color: var(--soft);
}

.skills li {
  color: var(--ink);
}

/* ---------- Contato ---------- */

.section--contact {
  align-items: baseline;
}

.contact__email {
  display: inline-block;
  color: var(--ink);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.contact__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 24px;
}

.contact__links a {
  color: var(--ink);
}

.contact__links a:hover {
  color: var(--blue);
}

.contact__place {
  margin-top: 8px;
  color: var(--soft);
}

/* ---------- Rodapé ---------- */

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 24px 40px;
  border-top: 1px solid var(--line);
  color: var(--soft);
}

/* ---------- Responsivo ---------- */

@media (max-width: 899px) {
  .section {
    grid-template-columns: minmax(0, 1fr);
    padding-block: 32px 64px;
  }

  .section__label {
    position: static;
    margin-bottom: 24px;
  }

  .section__label,
  .section__body {
    grid-column: 1 / -1;
  }

  .section__label a {
    display: block;
  }
}

@media (max-width: 599px) {
  .projects {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .entry {
    grid-template-columns: minmax(0, 1fr);
  }

  .entry__date {
    grid-row: 2;
  }

  .skills {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
