/* ========================================
   CAFE 404 - BLOG E PAGINA 404
   Mesma identidade da home: pagina clara, abertura escura, faixas
   de secao e linhas finas. Folha propria: tokens, navegacao, botoes,
   faixa e rodape espelham o style.css da raiz, sem carregar o resto
   da home. Se mudar la, muda aqui.
   ======================================== */

:root {
  --page: #f5f4f2;
  --canvas: #ffffff;
  --hero: #0f1013;
  --nav: #151517;
  --band: #2f302c;
  --band-tag: #17171a;
  --surface-dark: #141414;
  --surface-dark-2: #272727;

  --ink: #1e2124;
  --muted: #6b6b6b;
  --on-dark: #fafafa;
  --on-dark-muted: rgba(250, 250, 250, .68);

  --line: #c8c8c8;
  --line-soft: #e4e3e0;
  --line-on-dark: rgba(250, 250, 250, .14);

  --accent: #c8ff00;
  --accent-ink: #1e2124;

  --radius: 4px;
  --texture-lines: repeating-linear-gradient(0deg, transparent 0 5px, rgba(30, 33, 36, .035) 5px 6px);

  --section-gap: 56px;
  --band-h: 96px;
  --content-inset: clamp(20px, 4.4vw, 64px);
  --font-sans: "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.4, 0, .2, 1);

  /* coluna de leitura: 42rem de texto dentro da folha branca */
  --paper: 48rem;
  --paper-pad: clamp(20px, 5vw, 56px);
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
svg { display: block; }
strong { font-weight: 600; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: 0 0 0 4px var(--ink); }

::selection { background: var(--accent); color: var(--accent-ink); }

/* botao */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 41px;
  padding: 10px 18px;
  font-size: 16px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: .16px;
  white-space: nowrap;
  color: var(--accent-ink);
  background: var(--accent);
  border-radius: var(--radius);
  transition: background .15s var(--ease);
}
.btn:hover { background: #d9ff4d; }
.btn--sm { min-height: 34px; padding: 6px 14px; font-size: 14px; }

/* navegacao */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav);
  border-bottom: 1px solid var(--line-on-dark);
}
.nav-inner {
  display: flex;
  align-items: center;
  height: 65px;
  padding-inline: var(--content-inset);
  gap: 32px;
}
.brand { display: inline-flex; align-items: center; color: var(--on-dark); }
.brand-logo { display: block; width: auto; height: 32px; margin-left: -3px; }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a {
  position: relative;
  padding-block: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-dark-muted);
  transition: color .15s var(--ease);
}
.nav-links a:hover, .nav-links a[aria-current] { color: var(--on-dark); }
.nav-links a[aria-current]::after {
  content: "";
  position: absolute;
  inset: auto 0 -3px;
  height: 1px;
  background: var(--on-dark);
}
.nav-actions { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.nav-actions .text-link { font-size: 14px; font-weight: 500; color: var(--on-dark); }
.nav-actions .text-link:hover { color: var(--accent); }

.menu-btn { position: relative; display: none; width: 44px; height: 44px; margin-right: -10px; color: var(--on-dark); }
.menu-btn span {
  position: absolute;
  left: 11px;
  width: 22px;
  height: 2px;
  background: currentColor;
  transition: transform .2s var(--ease);
}
.menu-btn span:first-child { top: 17px; }
.menu-btn span:last-child { top: 25px; }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(4px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-4px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 89px var(--content-inset) 32px;
  background: var(--nav);
}
.mobile-menu.open { display: flex; }
.mobile-link {
  padding-block: 14px;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.02em;
  color: var(--on-dark);
  border-bottom: 1px solid var(--line-on-dark);
}

/* moldura: trilhos laterais em tela larga */
.frame { max-width: 1760px; margin-inline: auto; }

/* faixa de secao */
.band {
  display: flex;
  height: var(--band-h);
  background-color: var(--band);
  background-image: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, .16) 3px 4px);
}
.band-tag {
  display: flex;
  align-items: center;
  padding-inline: 48px;
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.05em;
  text-transform: uppercase;
  color: var(--on-dark);
  background: var(--band-tag);
}

/* abertura escura: indice do blog, cabecalho de artigo e pagina 404 */
.blog-hero, .article-head, .notfound {
  position: relative;
  color: var(--on-dark);
  background-color: var(--hero);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1545 510' preserveAspectRatio='xMaxYMax slice' fill='none' stroke='%23fafafa' stroke-opacity='.055'%3E%3Cpath d='M1700 372 846 412M1700 372 846 452M1700 372 846 500M1700 372 1000 510M1700 372 1160 510M1700 372 1320 510M1700 372 1460 510'/%3E%3Cpath d='M846 462H1545M846 490H1545' stroke-opacity='.035'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: cover;
}
.chip, .article-head .post-tag {
  display: inline-block;
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  line-height: 17px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--on-dark);
  background: rgba(250, 250, 250, .06);
  border: 1px solid var(--line-on-dark);
  border-radius: var(--radius);
}

/* indice do blog */
.blog-hero { padding: 44px var(--content-inset) 56px; }
.blog-hero h1 {
  max-width: 13em;
  margin-top: 28px;
  font-size: clamp(40px, 3.76vw, 58px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -.035em;
}
.blog-hero h1 em { font-style: normal; color: var(--accent); }
.blog-hero p { max-width: 580px; margin-top: 20px; line-height: 1.6; color: var(--on-dark-muted); }

.section { margin-top: var(--section-gap); padding-bottom: 72px; }

.post-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 30px var(--content-inset) 0;
  background: var(--line);
  border: 1px solid var(--line);
}
.post-item { display: flex; min-width: 0; background: var(--canvas); }
.post-link { display: flex; flex-direction: column; width: 100%; padding: 22px 24px 24px; }
.post-link > div:last-child { display: flex; flex-direction: column; flex: 1; align-items: flex-start; }
.post-meta-col {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 16px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-tag {
  display: inline-block;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 16px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
}
.post-link .post-tag { margin-top: 18px; }
.post-title {
  margin-top: 12px;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -.0136em;
}
.post-dek { margin-top: 8px; font-size: 15px; line-height: 1.5; color: var(--muted); }
.post-arrow {
  margin-top: auto;
  padding-top: 16px;
  font-size: 14px;
  font-weight: 600;
}
.post-arrow, .post-link:hover .post-title {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}

/* artigo: folha branca sobre a textura de linhas */
article {
  background-color: var(--page);
  background-image: var(--texture-lines);
}
.article-head {
  padding-block: 44px 48px;
  padding-inline: max(var(--content-inset), calc((100% - var(--paper)) / 2 + var(--paper-pad)));
}
.article-back {
  display: block;
  width: fit-content;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--on-dark-muted);
  transition: color .15s var(--ease);
}
.article-back:hover { color: var(--accent); }
.article-head h1 {
  margin-top: 22px;
  font-size: clamp(32px, 3.4vw, 46px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.035em;
}
.article-dek { margin-top: 20px; font-size: 18px; line-height: 1.55; color: var(--on-dark-muted); }
.article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 26px;
  padding-top: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 18px;
  color: var(--on-dark-muted);
  border-top: 1px solid var(--line-on-dark);
}
.article-byline .who { font-weight: 600; color: var(--on-dark); }
.article-byline .dot { font-size: 6px; color: var(--line-on-dark); }

.article-body {
  max-width: var(--paper);
  margin-inline: auto;
  padding: 40px var(--paper-pad) 56px;
  font-size: 17px;
  line-height: 1.7;
  text-align: left;        /* borda direita solta, nunca justificado */
  overflow-wrap: break-word;
  background: var(--canvas);
  border-inline: 1px solid var(--line);
}
.article-body > * + * { margin-top: 1.4em; }
.article-body a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}
.article-body a:hover { background: var(--accent); }
.article-body h2 {
  margin-top: 2em;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.035em;
}
.article-body h3 { margin-top: 1.8em; font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.article-body ul, .article-body ol { padding-left: 1.3em; }
.article-body ul { list-style: disc; }
.article-body li { margin-top: .5em; }
.article-body li::marker { color: var(--muted); }
.article-body blockquote {
  padding: 22px 24px;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: -.0136em;
  background: var(--page);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

/* caixa de destaque: o rotulo e o unico verde do bloco */
.callout {
  margin-top: 2em !important;
  padding: 22px 24px 24px;
  font-size: 16px;
  line-height: 1.6;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.callout-label {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 10px;
  padding: 2px 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent);
}
.callout p + p { margin-top: .8em; }
.callout cite {
  display: block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
  color: var(--muted);
}

/* chamada de servico no fim do artigo */
.article-cta {
  max-width: var(--paper);
  margin-inline: auto;
  padding: 40px var(--paper-pad) 44px;
  color: var(--on-dark);
  background: var(--surface-dark);
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 16px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}
.article-cta h2 {
  margin-top: 12px;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.04em;
}
.article-cta p { margin-top: 14px; line-height: 1.6; color: var(--on-dark-muted); }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

/* leia tambem */
.read-next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: var(--section-gap);
  padding: 0 var(--content-inset) 72px;
}
.read-next .band { grid-column: 1 / -1; margin: 0 calc(var(--content-inset) * -1) 30px; }
.read-next a {
  display: block;
  padding: 22px 24px 24px;
  background: var(--canvas);
  border: 1px solid var(--line);
}
.read-next a + a { border-left: 0; }
.rn-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 16px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.rn-title { margin-top: 8px; font-size: 17px; font-weight: 600; line-height: 1.35; }
.read-next a:hover .rn-title {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}

/* pagina 404 */
.page-404 { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; background: var(--surface-dark); }
.page-404 .frame { display: flex; flex-direction: column; flex: 1; width: 100%; }
.page-404 main { display: flex; flex: 1; }
.notfound {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  padding: 56px var(--content-inset);
}
.notfound-mark {
  font-family: var(--font-mono);
  font-size: clamp(96px, 14vw, 180px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -.05em;
  color: var(--accent);
}
.notfound h1 {
  margin-top: 18px;
  font-size: clamp(32px, 3.4vw, 46px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -.035em;
}
.notfound p { max-width: 580px; margin-top: 16px; line-height: 1.6; color: var(--on-dark-muted); }

/* rodape */
.footer { color: var(--on-dark); background: var(--surface-dark); }
.footer-top {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1.2fr;
  gap: 32px;
  padding: 44px var(--content-inset) 36px;
}
.footer-brand p { margin-top: 12px; font-size: 14px; color: var(--on-dark-muted); }
.footer-col p { margin-bottom: 12px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--on-dark-muted); }
.footer-col a { display: block; padding-block: 4px; font-size: 14px; color: var(--on-dark); overflow-wrap: anywhere; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 16px var(--content-inset) 20px;
  font-size: 13px;
  color: var(--on-dark-muted);
  border-top: 1px solid var(--line-on-dark);
}

.footer-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.footer-legal a:hover { color: var(--accent); }

@media (min-width: 1600px) {
  .frame { border-inline: 1px solid var(--line); }
}

@media (max-width: 1100px) {
  .nav-links { display: none; }
  .menu-btn { display: block; }
  .footer-top { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* a folha ocupa a tela inteira: sem filete encostado na borda */
@media (max-width: 768px) {
  .article-body { border-inline: 0; }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 72px; }
  .nav-inner { gap: 12px; }
  .nav-actions { gap: 8px; }
  .nav-actions .text-link { display: none; }
  .band { height: 64px; }
  .band-tag { padding-inline: var(--content-inset); font-size: 22px; letter-spacing: -.03em; }
  .chip, .article-head .post-tag { font-size: 11px; }
  .post-list { grid-template-columns: minmax(0, 1fr); }
  .post-link, .read-next a { padding: 18px 18px 20px; }
  .post-title { font-size: 20px; }
  .article-dek { font-size: 17px; }
  .article-byline .dot { display: none; }
  .article-body h2 { font-size: 26px; }
  .article-body blockquote { padding: 18px; font-size: 20px; }
  .callout { padding: 18px; }
  .article-cta h2 { font-size: 28px; }
  .btns { width: 100%; }
  .btns .btn { flex: 1 1 100%; white-space: normal; text-align: center; }
  .read-next { grid-template-columns: minmax(0, 1fr); }
  .read-next a + a { border-top: 0; border-left: 1px solid var(--line); }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-col:last-child { grid-column: 1 / -1; }
}

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