/* =========================================================
   aiforwarddeployedengineer.com / .blog
   Tema: dark + cinza neutro (referência visual: Hashnode)
   ========================================================= */

:root {
  --bg: #0a0a0a;
  --bg-elev: #131313;
  --bg-elev-2: #1a1a1a;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --rule: rgba(255, 255, 255, 0.07);

  --text: rgba(255, 255, 255, 0.92);
  --text-soft: rgba(255, 255, 255, 0.62);
  --text-mute: rgba(255, 255, 255, 0.42);
  --text-dim: rgba(255, 255, 255, 0.28);

  --accent: rgb(120, 170, 230);
  --accent-soft: rgba(120, 170, 230, 0.18);
  --code-bg: rgba(255, 255, 255, 0.06);
  --code-fg: #ff9f8a;

  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Inter, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --font-serif: ui-serif, Georgia, Cambria, "Times New Roman", serif;

  --content-max: 980px;
  --reading-max: 720px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fafafa;
    --bg-elev: #ffffff;
    --bg-elev-2: #f3f3f3;
    --surface: rgba(0, 0, 0, 0.035);
    --surface-strong: rgba(0, 0, 0, 0.07);
    --border: rgba(0, 0, 0, 0.1);
    --border-strong: rgba(0, 0, 0, 0.18);
    --rule: rgba(0, 0, 0, 0.08);
    --text: rgba(0, 0, 0, 0.88);
    --text-soft: rgba(0, 0, 0, 0.6);
    --text-mute: rgba(0, 0, 0, 0.42);
    --text-dim: rgba(0, 0, 0, 0.28);
    --accent: rgb(36, 88, 168);
    --accent-soft: rgba(36, 88, 168, 0.12);
    --code-bg: rgba(0, 0, 0, 0.06);
    --code-fg: #c0392b;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  margin: 0 auto;
  max-width: var(--content-max);
  padding: 2rem 1.25rem 4rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.reading { max-width: var(--reading-max); }

/* ---- Tipografia ---- */

h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.015em;
  line-height: 1.25;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
  color: var(--text);
}

.page-title {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 0.5em;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.18rem; }
h4 { font-size: 1rem; }

p { margin: 0.6em 0; }

p.lead {
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--text);
  margin-top: 0.25em;
}

p.muted { color: var(--text-soft); }

a, a:visited {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--text-dim);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

a:hover {
  color: var(--text);
  text-decoration-color: var(--accent);
}

a.accent {
  color: var(--accent);
  text-decoration-color: var(--accent-soft);
}

hr {
  border: none;
  border-bottom: 1px solid var(--rule);
  margin: 2.5rem 0;
}

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

/* ---- Header / nav ---- */

.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.site-nav .brand {
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: -0.02em;
}

.site-nav nav a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: var(--text-soft);
}

.site-nav nav a:hover { color: var(--text); }

.site-nav .lang {
  margin-left: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-mute);
  text-decoration: none;
}

.site-nav .lang.active { color: var(--text); }

.page-header-icon {
  width: 44px;
  height: 44px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

/* ---- Callouts ---- */

.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  margin: 1.5rem 0;
}

.callout > *:first-child { margin-top: 0; }
.callout > *:last-child { margin-bottom: 0; }

/* ---- Listings (entry list) ---- */

.entry-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
}

.entry-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}

.entry-list li:last-child { border-bottom: none; }

.entry-list .title {
  font-weight: 500;
  text-decoration: none;
  flex: 1 1 auto;
  color: var(--text);
}

.entry-list .title:hover { text-decoration: underline; }

.entry-list .meta {
  font-size: 0.82rem;
  color: var(--text-mute);
  white-space: nowrap;
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

/* ---- Blog post cards (index listing) ---- */

.year-heading {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-soft);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  margin: 2.5rem 0 1rem;
}

.year-heading:first-of-type { margin-top: 1.5rem; }

.post-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.post-card {
  display: flex;
  align-items: stretch;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.post-card:hover {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.post-card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.post-card-title {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
  margin: 0 0 0.5rem;
}

.post-card-summary {
  font-size: 0.95rem;
  color: var(--text-soft);
  line-height: 1.55;
  margin: 0 0 1rem;
}

.post-card-meta {
  margin-top: auto;
  font-size: 0.82rem;
  color: var(--text-mute);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.post-card-meta .dot { margin: 0 0.5rem; opacity: 0.5; }

.post-card-cover {
  flex: 0 0 240px;
  align-self: center;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-elev-2);
}

.post-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---- Project grid ---- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.85rem;
  margin: 1.25rem 0;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.project-card:hover {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.project-card h3 {
  margin: 0;
  font-size: 1rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.project-card .project-summary {
  font-size: 0.92rem;
  color: var(--text-soft);
  margin: 0;
  line-height: 1.5;
}

.project-card .project-stack {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-mute);
  margin-top: 0.4rem;
  letter-spacing: 0.01em;
}

.project-card .project-meta {
  display: flex;
  gap: 0.85rem;
  margin-top: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-mute);
}

/* ---- Article (blog post reading view) ---- */

article.post {
  margin-top: 1rem;
}

article.post p { margin: 0.95em 0; line-height: 1.7; }
article.post h2 { margin-top: 2.2rem; }
article.post h3 { margin-top: 1.7rem; }

article.post blockquote {
  border-left: 3px solid var(--border-strong);
  margin: 1.4em 0;
  padding-left: 1.1em;
  font-style: italic;
  color: var(--text-soft);
}

article.post code {
  background: var(--code-bg);
  border-radius: var(--radius-sm);
  padding: 0.15em 0.4em;
  font-family: var(--font-mono);
  font-size: 88%;
  color: var(--code-fg);
}

article.post pre {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1em 1.1em;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.55;
}

article.post pre code {
  background: none;
  padding: 0;
  color: var(--text);
}

article.post img {
  border-radius: var(--radius-md);
  margin: 1.5em 0;
}

article.post figure { margin: 1.5em 0; }
article.post figcaption {
  font-size: 0.82rem;
  color: var(--text-mute);
  text-align: center;
  margin-top: 0.5em;
}

article.post .post-meta {
  font-size: 0.85rem;
  color: var(--text-mute);
  margin-bottom: 1.75rem;
  font-family: var(--font-mono);
}

article.post .post-tags {
  display: inline-flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-left: 0.5rem;
}

article.post .post-tags span {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.05em 0.5em;
  font-size: 0.78rem;
  color: var(--text-soft);
}

/* ---- Forms (contact, subscribe) ---- */

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.5rem;
}

.form-card label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-soft);
  margin: 0.85rem 0 0.4rem;
}

.form-card label:first-child { margin-top: 0; }

.form-card input,
.form-card textarea {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.65rem 0.85rem;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s ease;
}

.form-card input:focus,
.form-card textarea:focus {
  outline: none;
  border-color: var(--border-strong);
}

.form-card textarea {
  min-height: 6rem;
  resize: vertical;
}

.form-card button {
  margin-top: 1.1rem;
  width: 100%;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.form-card button:hover { opacity: 0.85; }

/* ---- Footer ---- */

.site-footer {
  margin-top: 5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.82rem;
  color: var(--text-mute);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-family: var(--font-mono);
}

.site-footer a { color: var(--text-soft); }
.site-footer a:hover { color: var(--text); }

/* ---- Responsive ---- */

@media (max-width: 640px) {
  body { font-size: 15.5px; padding: 1.25rem 1rem 3rem; }
  .page-title { font-size: 1.8rem; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  .entry-list li { flex-direction: column; gap: 0.2rem; align-items: flex-start; }
  .site-nav { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
  .site-nav nav a { margin-left: 0; margin-right: 1.25rem; }
  .site-nav .lang { margin-left: 0; margin-right: 0.85rem; }
}
