/* Juan Carvalho — portfólio pessoal
   Uma coluna, fontes do sistema, hierarquia por tamanho/peso/espaço. */

:root {
  --bg: #fdfdfc;
  --text: #1f1f1d;
  --muted: #6d6d67;
  --rule: #e3e3de;
  --link: #1a5b96;
}

[data-theme='dark'] {
  --bg: #17181a;
  --text: #dedfdb;
  --muted: #93948f;
  --rule: #2d2f32;
  --link: #86b5e4;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* ── Controles (idioma e tema) ───────────────────────────────── */

.controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  /* margem negativa compensa o padding de toque dos botões */
  margin: -0.35rem -0.4rem 2.15rem;
}

.controls button {
  border: 0;
  background: none;
  /* padding garante alvo de toque de 24px sem engordar o visual */
  padding: 0.35rem 0.4rem;
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.2;
  cursor: pointer;
}

.langs {
  display: inline-flex;
}

.langs button:hover {
  color: var(--text);
}

.langs button[aria-pressed='true'] {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

#theme-toggle {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4rem;
  padding-left: 0.8rem;
  border-left: 1px solid var(--rule);
}

#theme-toggle:hover {
  color: var(--text);
}

#theme-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

[data-theme='dark'] .icon-moon,
[data-theme='light'] .icon-sun {
  display: none;
}

/* ── Cabeçalho ───────────────────────────────────────────────── */

.masthead {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.portrait {
  flex: none;
  width: 108px;
  height: 108px;
  border-radius: 3px;
  object-fit: cover;
}

h1 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
}

.role {
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ── Texto corrido ───────────────────────────────────────────── */

.bio p + p,
.bio-interests {
  margin-top: 0.9rem;
}

.bio b {
  font-weight: 600;
}

/* ── Seções ──────────────────────────────────────────────────── */

section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.entry + .entry {
  margin-top: 1.5rem;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
}

.meta {
  color: var(--muted);
  font-size: 0.875rem;
}

.meta a {
  color: inherit;
  text-decoration: none;
}

.meta a:hover {
  text-decoration: underline;
}

.sep {
  padding: 0 0.15rem;
  opacity: 0.55;
}

.entry .meta + p {
  margin-top: 0.4rem;
}

.links {
  margin-top: 0.9rem;
}

footer {
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.8125rem;
}

/* ── Telas estreitas ─────────────────────────────────────────── */

@media (max-width: 30rem) {
  body {
    font-size: 16px;
  }

  .masthead {
    gap: 1rem;
  }

  .portrait {
    width: 84px;
    height: 84px;
  }

  h1 {
    font-size: 1.3rem;
  }
}

/* ── Impressão ───────────────────────────────────────────────── */

@media print {
  .controls {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .page {
    max-width: none;
    padding: 0;
  }

  a {
    color: #000;
  }

  section {
    break-inside: avoid;
  }
}
