/* Cores. Tema claro é o padrão; escuro segue o sistema ou a escolha no botão (data-theme no <html>). */
:root {
  --bg: #F4F1EA;
  --ink: #141414;
  --muted: #6B675F;
  --line: #D9D3C7;
  --accent: #0068D9;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121211;
    --ink: #EDEAE3;
    --muted: #9A958B;
    --line: #2C2B28;
    --accent: #38A3FF;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121211;
  --ink: #EDEAE3;
  --muted: #9A958B;
  --line: #2C2B28;
  --accent: #38A3FF;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Topo */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  padding-bottom: 28px;
}
.mark {
  font-family: var(--serif);
  font-size: 28px;
  text-decoration: none;
  letter-spacing: -0.02em;
}
.top-right { display: flex; align-items: center; gap: 28px; }
.top nav { display: flex; gap: 28px; }

/* Botão de tema (liga e desliga) */
.theme-toggle {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--muted) 55%, transparent);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .2s;
}
.theme-toggle:hover { border-color: var(--muted); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.theme-toggle .knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: grid;
  place-items: center;
  transition: transform .25s ease;
}
.theme-toggle svg { width: 12px; height: 12px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .knob { transform: translateX(24px); }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .knob { transform: translateX(24px); }
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
.top nav a {
  font-size: 14px;
  text-decoration: none;
  color: var(--muted);
  transition: color .2s;
}
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); }

/* Cursor do logo (bloco azul que pisca) */
.caret {
  display: inline-block;
  width: 0.32em;
  height: 0.68em;
  margin-left: 0.06em;
  background: var(--accent);
  vertical-align: baseline;
}
.mark .caret { width: 0.3em; height: 0.66em; margin-left: 0.05em; }
h1 .caret { animation: blink 1.1s steps(1) infinite; }
h1.typing .caret { animation: none; margin-right: 0.06em; }
@keyframes blink { 50% { opacity: 0; } }
.type { display: grid; white-space: pre-wrap; }
.type > .type-ghost, .type > .type-live { grid-area: 1 / 1; }
.type-ghost { visibility: hidden; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 340px);
  gap: 56px;
  align-items: end;
  padding-top: 10vh;
  padding-bottom: 12vh;
}
.portrait {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 584 / 600;
  object-fit: cover;
  border-radius: 6px;
  background: var(--line);
}
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(56px, 9vw, 120px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin-bottom: 40px;
}
.lede {
  font-size: clamp(20px, 2.4vw, 28px);
  line-height: 1.4;
  max-width: 30ch;
  letter-spacing: -0.01em;
}
.tenure {
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: -16px 0 36px;
}
.tenure strong {
  font-weight: 600;
  color: var(--accent);
}
.lede em {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15em;
  color: var(--accent);
}
.now {
  margin-top: 36px;
  font-size: 15px;
  color: var(--muted);
}
.now a {
  color: var(--ink);
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}

/* Blocos */
.block {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  padding-top: 56px;
  padding-bottom: 72px;
  border-top: 1px solid var(--line);
}
.label {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 6px;
}
.prose { max-width: 62ch; }
.prose p + p { margin-top: 1.1em; }
.prose p:first-child {
  font-size: 21px;
  line-height: 1.5;
}
.prose strong { font-weight: 600; }

/* O que eu faço */
.pillars {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px 40px;
}
.num {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 8px;
}
.pillars h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.pillars p { color: var(--muted); max-width: 38ch; }

/* Iniciativas */
.projects { list-style: none; }
.projects li { border-bottom: 1px solid var(--line); }
.projects li:first-child { border-top: 1px solid var(--line); }
.projects a, .projects .soon {
  display: grid;
  grid-template-columns: 1fr 1.4fr 150px;
  gap: 24px;
  align-items: baseline;
  padding: 24px 0;
  text-decoration: none;
}
.p-name {
  font-family: var(--serif);
  font-size: 30px;
  line-height: 1.1;
}
.p-desc { color: var(--muted); }
.p-meta {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}
.arrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: 18px;
  color: var(--accent);
  transition: transform .2s;
}
.projects a:hover .arrow { transform: translate(3px, -3px); }
.projects a:hover .p-name { color: var(--accent); }
.soon .p-name { color: var(--muted); }

/* Contato */
.big {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  max-width: 20ch;
  margin-bottom: 28px;
}
.channels {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 56px;
  margin-bottom: 32px;
}
.channels dt {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.channels dd a {
  font-size: 20px;
  text-decoration-color: var(--accent);
  text-underline-offset: 5px;
}
.links a.primary {
  background: var(--ink);
  color: var(--bg);
}
.links a.primary:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.links { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; }
.links a {
  display: inline-block;
  padding: 12px 22px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: background .2s, color .2s;
}
.links a:hover { background: var(--ink); color: var(--bg); }

/* Artigos: lista */
.articles-head { padding-top: 8vh; padding-bottom: 48px; }
.articles-head h1 { font-size: clamp(48px, 8vw, 96px); margin-bottom: 20px; }
.article-list { list-style: none; border-top: 1px solid var(--line); margin-bottom: 96px; }
.article-list li { border-bottom: 1px solid var(--line); }
.article-list a {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 6px 32px;
  padding: 28px 0;
  text-decoration: none;
}
.article-list time { grid-row: span 2; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-top: 8px; }
.al-title { font-family: var(--serif); font-size: clamp(28px, 3.4vw, 40px); line-height: 1.1; letter-spacing: -0.01em; }
.al-desc { color: var(--muted); max-width: 60ch; }
.article-list a:hover .al-title { color: var(--accent); }

/* Artigos na home: mesmo peso dos itens de "O que eu faço" */
.home-articles { display: grid; gap: 28px; min-width: 0; }
.home-list { list-style: none; display: grid; gap: 32px; }
.home-list a { display: block; text-decoration: none; }
.home-list h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.home-list p { color: var(--muted); max-width: 52ch; }
.home-list a:hover h3 { color: var(--accent); }
.see-all { justify-self: start; font-size: 15px; font-weight: 500; text-decoration-color: var(--accent); text-underline-offset: 5px; }
.see-all:hover { color: var(--accent); }

/* Artigos: página do artigo */
.article { max-width: 68ch; margin: 0 auto; padding-top: 6vh; padding-bottom: 96px; }
.article-head { margin-bottom: 48px; }
.article-meta { font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.article-meta a { color: var(--accent); text-decoration: none; }
.article h1 { font-size: clamp(44px, 7vw, 80px); line-height: 1; margin-bottom: 24px; text-wrap: balance; }
.article-lede { font-size: clamp(20px, 2.4vw, 26px); line-height: 1.4; letter-spacing: -0.01em; }
.article-body { font-size: 18px; line-height: 1.7; }
.article-body > * + * { margin-top: 1.1em; }
.article-body h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3.2vw, 36px); line-height: 1.1; letter-spacing: -0.01em; margin-top: 1.8em; }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body li + li { margin-top: 0.4em; }
.article-body em { font-family: var(--serif); font-size: 1.12em; }
.article-body strong { font-weight: 600; }
.article-body a { text-decoration-color: var(--accent); text-underline-offset: 4px; }
.article-body .steps li::marker { color: var(--accent); font-weight: 600; }
.todo { background: color-mix(in srgb, var(--accent) 14%, transparent); border-left: 3px solid var(--accent); padding: 10px 14px; font-size: 15px; }
.article-cta {
  margin-top: 56px;
  padding: 28px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  display: grid;
  gap: 12px;
}
.cta-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.cta-title { font-family: var(--serif); font-size: clamp(24px, 3vw, 30px); line-height: 1.15; letter-spacing: -0.01em; }
.article-cta p:not(.cta-eyebrow):not(.cta-title) { color: var(--muted); }
.cta-btn {
  justify-self: start;
  margin-top: 6px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: background .2s;
}
.cta-btn:hover { background: var(--accent); }
.article-foot { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); display: grid; gap: 12px; color: var(--muted); }
.article-foot a { color: var(--ink); text-decoration-color: var(--accent); text-underline-offset: 4px; }

.article-body .dd { margin: 2em 0; }
.dd svg { display: block; width: 100%; height: auto; }
.dd .dd-people { fill: color-mix(in srgb, var(--accent) 22%, transparent); stroke: var(--accent); stroke-width: 2; }
.dd .dd-ai { fill: color-mix(in srgb, var(--muted) 14%, transparent); stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 5; }
.dd .dd-line { stroke: var(--line); stroke-width: 1.5; }
.dd .dd-step { fill: var(--ink); font-family: var(--sans); font-size: 19px; font-weight: 500; }
.dd .dd-tag { font-family: var(--serif); font-size: 28px; }
.dd .dd-tag-people { fill: var(--accent); }
.dd .dd-tag-ai { fill: var(--muted); }
.dd .dd-note { fill: var(--muted); font-family: var(--sans); font-size: 16px; }
.dd figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* Rodapé */
.foot {
  display: flex;
  justify-content: space-between;
  padding-top: 28px;
  padding-bottom: 40px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  align-items: baseline;
  gap: 24px;
}

.foot-logo {
  white-space: nowrap;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

/* Celular */
@media (max-width: 760px) {
  body { font-size: 16px; }
  .wrap { padding: 0 20px; }
  .top nav { display: none; }
  .hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 4vh;
    padding-bottom: 10vh;
  }
  .portrait { width: 160px; order: -1; }
  .block {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-top: 40px;
    padding-bottom: 56px;
  }
  .prose p:first-child { font-size: 19px; }
  .pillars { grid-template-columns: 1fr; gap: 32px; }
  .pillars h3, .home-list h3 { font-size: 26px; }
  .projects a, .projects .soon {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .p-meta { text-align: left; }
  .p-name { font-size: 26px; }
  .article-list a { grid-template-columns: 1fr; }
  .article-list time { grid-row: auto; padding-top: 0; }
  .article-body { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  h1 .caret { animation: none; }
}
