/* ============================================================
   arthur_lima.dev — estilos
   Temas definidos por variáveis em [data-theme="dark"|"light"].
   ============================================================ */

:root {
  --accent: #F2A541;
  --on-accent: #0E1116;
  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1116;
  --surface: #161A21;
  --border: #262B33;
  --border-strong: #3A3F48;
  --text: #E8E6E1;
  --heading: #F5F3EE;
  --muted: #B9B6AE;
  --faint: #8A8780;
  --code: #C9C6BE;
  --string: #9CC79A;
  --accent-text: #F2A541;
  --danger: #F28B82;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #F6F5F1;
  --surface: #FFFFFF;
  --border: #E3E1DA;
  --border-strong: #CFCCC3;
  --text: #23262B;
  --heading: #111317;
  --muted: #4F525A;
  --faint: #62656C;
  --code: #33363C;
  --string: #2F6B2C;
  --accent-text: #8C6026; /* #F2A541 com cada canal × 0,58 */
  --danger: #B3261E;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  body { transition: background 0.2s, color 0.2s; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
}

a { color: inherit; }
a:hover { opacity: 0.85; }

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3, h4 { margin: 0; color: var(--heading); font-family: var(--font-head); }
p { margin: 0; }

[hidden] { display: none !important; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.accent-text { color: var(--accent-text); }
.muted-text { color: var(--muted); }
.faint-text { color: var(--faint); }
.mono { font-family: var(--font-mono); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 14px;
}
.eyebrow-wide { letter-spacing: 0.04em; }

/* ---------- Botões ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
}
.btn-sm { padding: 10px 18px; font-size: 15px; }
.btn-primary { background: var(--accent); color: var(--on-accent); border: 0; }
.btn-outline { color: var(--heading); border: 1px solid var(--border-strong); }

/* ---------- Header ---------- */

/* Header fixo no topo. Sem backdrop-filter/transform aqui: eles quebrariam
   o position: fixed da aba lateral, que fica dentro do header. */
.site-header-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid transparent;
}
.site-header-bar.is-scrolled { border-bottom-color: var(--border); }

/* Compensa o header fixo ao rolar para as âncoras (valor real vem do main.js). */
html { scroll-padding-top: var(--header-h, 96px); }

.site-header {
  padding-top: 24px;
  padding-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}

.brand {
  padding: 10px 0; /* alvo de toque ≥ 44px */
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  color: var(--heading);
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.main-nav a {
  padding: 10px 14px;
  text-decoration: none;
  font-size: 15px;
  color: var(--muted);
}

.lang-switch {
  display: flex;
  padding: 3px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
}
.lang-btn {
  position: relative;
  min-width: 44px;
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: var(--muted);
}
/* Amplia a área de toque até 44px sem mudar o visual. */
.lang-btn::after {
  content: '';
  position: absolute;
  inset: -4px 0;
}
.lang-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--heading);
  cursor: pointer;
}
[data-theme="dark"] .icon-moon,
[data-theme="light"] .icon-sun { display: none; }

/* Idioma + tema: no desktop seguem em linha com os outros itens. */
.prefs { display: contents; }

/* ---------- Menu mobile (aba lateral) ---------- */

.menu-toggle,
.menu-close { display: none; }
.menu-backdrop { display: none; }

@media (max-width: 899px) {
  .menu-toggle { display: inline-flex; }

  .header-actions {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    width: min(320px, 85vw);
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 24px;
    padding: 24px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    overflow-y: auto;
    transform: translateX(100%);
    visibility: hidden; /* fechado: fora da ordem de tab e dos leitores de tela */
  }
  .header-actions.is-open {
    transform: none;
    visibility: visible;
  }

  .menu-close {
    display: inline-flex;
    align-self: flex-end;
  }

  .main-nav {
    flex-direction: column;
    align-items: flex-start;
    margin-left: -14px; /* alinha o texto dos links com os outros itens */
  }

  .prefs {
    display: flex;
    gap: 8px;
    align-items: center;
  }

  .menu-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(14, 17, 22, 0.6);
  }

  html.menu-open { overflow: hidden; }
}

@media (max-width: 899px) and (prefers-reduced-motion: no-preference) {
  .header-actions { transition: transform 0.25s ease, visibility 0s linear 0.25s; }
  .header-actions.is-open { transition: transform 0.25s ease; }
}

/* ---------- Hero ---------- */

.hero {
  padding-top: 72px;
  padding-bottom: 96px;
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
  align-items: center;
}

.hero-text {
  flex: 1 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero h1 {
  font-weight: 700;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.lead {
  font-size: 19px;
  color: var(--muted);
  max-width: 560px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
}

.code-card {
  flex: 1 1 400px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.code-card-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--border-strong);
}
.code-card-file {
  margin-left: 10px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--faint);
}
.code {
  margin: 0;
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.75;
  color: var(--code);
  overflow-x: auto;
  white-space: pre;
}
.tok-annot { color: var(--faint); }
.tok-kw { color: var(--accent-text); }
.tok-str { color: var(--string); }

/* Efeito de digitação (js/main.js). */
@media (prefers-reduced-motion: no-preference) {
  .js .code:not(.typer-ready) { visibility: hidden; }
}
.code-ghost { visibility: hidden; }
/* Cursor sem largura (borda compensada pela margem): não empurra o texto. */
.code-caret {
  display: inline-block;
  width: 0;
  height: 1.2em;
  margin-left: 1px;
  margin-right: -3px;
  border-left: 2px solid var(--accent-text);
  vertical-align: -0.25em;
}
.code-caret.is-blinking { animation: caret-blink 1s steps(1) infinite; }
@keyframes caret-blink {
  50% { opacity: 0; }
}

/* ---------- Destaques (métricas) ---------- */

.stats {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.stats-grid {
  padding-top: 40px;
  padding-bottom: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 40px;
  color: var(--heading);
}
.stat-label {
  font-size: 15px;
  color: var(--faint);
}

/* ---------- Seções ---------- */

.section-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
}

h2 {
  font-weight: 700;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.1;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.services {
  padding-top: 112px;
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 48px;
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.service-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.service-card svg { color: var(--accent-text); }
.service-card h3 { font-size: 22px; }
.service-card p { color: var(--muted); font-size: 16px; }

.stack {
  padding-top: 48px;
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 8px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--code);
}

.experience {
  padding-top: 96px;
  padding-bottom: 96px;
  display: flex;
  flex-wrap: wrap;
  gap: 56px;
}
.experience-intro {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.experience-list {
  flex: 999 1 560px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.job {
  padding: 28px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
}
.job-period {
  flex: 0 0 180px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--faint);
}
.job-body {
  flex: 1 1 320px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.job-body h3 { font-size: 22px; }
.job-body > p { color: var(--muted); font-size: 16px; }

.win-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.win-label {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.win-card h4 { font-size: 19px; }
.win-card p { color: var(--muted); font-size: 16px; }

/* ---------- Contato ---------- */

.contact { padding-bottom: 96px; }

.contact-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(32px, 6vw, 72px);
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  align-items: flex-start;
}
.contact-text {
  flex: 1 1 360px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
}
.social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg);
  text-decoration: none;
}
.social img { display: block; }
.logo-whatsapp { width: 26px; height: 26px; }
.logo-linkedin { height: 24px; width: auto; }
.logo-github { height: 26px; width: auto; }

.contact-form {
  flex: 1 1 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 14px;
  color: var(--muted);
}
.field input,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--heading);
  font: inherit;
  font-size: 16px;
}
.field input { min-height: 48px; padding: 0 14px; }
.field textarea { padding: 12px 14px; resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--danger); }

.field-error {
  font-size: 14px;
  color: var(--danger);
}
.field-error:empty { display: none; }

.form-status {
  padding: 20px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--heading);
}
.form-status.is-error { border-color: var(--danger); }

.btn-submit {
  min-height: 52px;
  font: inherit;
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
}
.btn-submit:disabled { opacity: 0.6; cursor: progress; }

/* Honeypot fora da tela (não usar display:none, alguns bots ignoram). */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Rodapé ---------- */

.site-footer {
  padding-top: 32px;
  padding-bottom: 48px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  font-size: 14px;
  color: var(--faint);
}
