/* ==========================================================================
   FabricioIA — sistema visual
   Neutros graves + azul contido. Dark é o modo natal; light é a mesma
   arquitetura sob luz de papel.
   ========================================================================== */

:root {
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --font-text: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --wrap: 1160px;
  --narrow: 720px;
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur: 260ms;
}

/* ── Pele escura (padrão) ────────────────────────────────────────────────── */
[data-theme='dark'] {
  --bg: #0b0d10;
  --bg-2: #0f1216;
  --surface: #141920;
  --surface-2: #1a2029;
  --line: #222a35;
  --text: #e9ecf1;
  --muted: #99a3b2;
  --accent: #7ba3e8;
  --accent-soft: rgba(123, 163, 232, .14);
  --accent-line: rgba(123, 163, 232, .38);
  --shadow: 0 18px 50px -24px rgba(0, 0, 0, .9);
  --grid-line: rgba(255, 255, 255, .035);
  color-scheme: dark;
}

/* ── Pele clara ──────────────────────────────────────────────────────────── */
[data-theme='light'] {
  --bg: #fbfbfc;
  --bg-2: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --line: #e2e6ec;
  --text: #12161c;
  --muted: #5a6472;
  --accent: #2f5da8;
  --accent-soft: rgba(47, 93, 168, .09);
  --accent-line: rgba(47, 93, 168, .30);
  --shadow: 0 16px 40px -26px rgba(15, 25, 45, .45);
  --grid-line: rgba(10, 20, 40, .04);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 40px, var(--narrow)); margin-inline: auto; }

.skip {
  position: absolute; left: -999px;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: var(--r-sm); z-index: 100;
}
.skip:focus { left: 16px; top: 12px; }

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

/* ── Cabeçalho ───────────────────────────────────────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 68px; }

.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-glyph { width: 34px; height: 34px; color: var(--text); }
.brand-glyph svg { width: 100%; height: 100%; }
.brand-word {
  font-family: var(--font-display);
  font-size: 21px; font-weight: 600; letter-spacing: -.02em;
}
.brand-word b { font-weight: 700; color: var(--accent); }

.nav { display: flex; align-items: center; gap: 6px; }
.nav a {
  text-decoration: none; color: var(--muted); font-size: 14.5px; font-weight: 500;
  padding: 8px 12px; border-radius: 999px; transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav a:hover { color: var(--text); background: var(--surface); }

.theme-toggle {
  margin-left: 6px; width: 38px; height: 38px; display: grid; place-items: center;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent-line); transform: rotate(-12deg); }
.theme-toggle svg { width: 18px; height: 18px; }
[data-theme='dark'] .ico-sun { display: block; }
[data-theme='dark'] .ico-moon { display: none; }
[data-theme='light'] .ico-sun { display: none; }
[data-theme='light'] .ico-moon { display: block; }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero { position: relative; padding: 84px 0 56px; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-inner { position: relative; z-index: 2; max-width: 820px; }
.hero-grid {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
                    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 68px 68px;
  mask-image: radial-gradient(ellipse 80% 70% at 30% 0%, #000 20%, transparent 78%);
}

.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 14px;
}
.eyebrow::before { content: '/ '; opacity: .6; }

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(38px, 6.2vw, 68px); line-height: 1.03; letter-spacing: -.03em;
  font-weight: 600; margin: 0 0 18px;
}
.hero-title em { font-style: italic; color: var(--accent); padding-right: .12em; }
.hero-sub { color: var(--muted); font-size: 18.5px; max-width: 56ch; margin: 0 0 30px; }

.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 7px 7px 18px; max-width: 560px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 4px var(--accent-soft); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input {
  flex: 1; background: none; border: 0; color: var(--text); font: inherit; font-size: 15.5px; padding: 8px 0;
}
.search input:focus { outline: none; }
.search button {
  border: 0; border-radius: 999px; padding: 10px 20px; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-weight: 600; font-size: 14.5px;
  transition: filter var(--dur) var(--ease);
}
.search button:hover { filter: brightness(1.1); }

/* ── Metadados & tags ────────────────────────────────────────────────────── */
.meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin: 0 0 14px;
  letter-spacing: .02em;
}
.tag {
  background: var(--accent-soft); color: var(--accent);
  padding: 4px 10px; border-radius: 999px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase;
}
.tag.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }

.section-title {
  font-family: var(--font-display); font-size: 26px; font-weight: 600; letter-spacing: -.02em;
  margin: 64px 0 24px; padding-left: 16px; position: relative;
}
.section-title::before {
  content: ''; position: absolute; left: 0; top: .25em; bottom: .25em; width: 3px;
  background: var(--accent); border-radius: 2px;
}

/* ── Destaque ────────────────────────────────────────────────────────────── */
.feature {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 0;
  margin-top: 56px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow);
}
/* O banner é um cartaz 21:9 com texto: esticá-lo até a altura do corpo cortaria
   a manchete. A mídia do destaque fica em 16:9 e centrada — o mesmo recorte dos
   cartões, que o estúdio de banners já respeita na zona segura. */
.feature-media { display: block; overflow: hidden; background: var(--bg-2); }
.feature-media img {
  width: 100%; height: 100%; min-height: 320px; object-fit: cover;
  object-position: left center;   /* o recorte alto come o diagrama, nunca a manchete */
  transition: transform 600ms var(--ease);
}
.feature:hover .feature-media img { transform: scale(1.035); }
.feature-body { padding: 38px 40px; display: flex; flex-direction: column; justify-content: center; }
.feature-body h2 {
  font-family: var(--font-display); font-size: clamp(26px, 2.6vw, 34px); line-height: 1.15;
  letter-spacing: -.02em; font-weight: 600; margin: 0 0 14px;
}
.feature-body h2 a { text-decoration: none; background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 2px; background-repeat: no-repeat; background-position: 0 100%;
  transition: background-size 400ms var(--ease); }
.feature-body h2 a:hover { background-size: 100% 2px; }
.excerpt { color: var(--muted); margin: 0 0 20px; }
.byline { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); margin: 0 0 22px; }
.byline img { width: 28px; height: 28px; border-radius: 999px; object-fit: cover; }

.btn {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; text-decoration: none;
  padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: transform var(--dur) var(--ease), filter var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn span { transition: transform var(--dur) var(--ease); }
.btn:hover span { transform: translateX(3px); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 26px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--accent-line); box-shadow: var(--shadow); }
.card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: left center; transition: transform 600ms var(--ease); }
.card:hover .card-media img { transform: scale(1.05); }
.card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 {
  font-family: var(--font-display); font-size: 21px; line-height: 1.25; letter-spacing: -.015em;
  font-weight: 600; margin: 0 0 10px;
}
.card-body h3 a { text-decoration: none; }
.card-body h3 a:hover { color: var(--accent); }
.card-body .excerpt { font-size: 15px; flex: 1; }
.card-body .byline { margin: 0; font-family: var(--font-mono); font-size: 12px; }

.result-note { font-family: var(--font-mono); font-size: 13px; color: var(--muted); margin-top: 32px; }
.empty { color: var(--muted); margin: 60px 0; }
.pager { display: flex; gap: 14px; justify-content: center; margin: 52px 0 0; }
.pager a { text-decoration: none; border: 1px solid var(--line); padding: 10px 18px; border-radius: 999px; font-size: 14.5px; }
.pager a:hover { border-color: var(--accent-line); color: var(--accent); }

/* ── Sobre ───────────────────────────────────────────────────────────────── */
.about {
  display: flex; gap: 32px; align-items: center; flex-wrap: wrap;
  margin: 84px 0 20px; padding: 36px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--r-lg);
}
.about img { width: 132px; height: 132px; border-radius: 50%; object-fit: cover; border: 2px solid var(--accent-line); }
.about h2 { font-family: var(--font-display); font-size: 28px; margin: 0 0 8px; letter-spacing: -.02em; }
.about p { color: var(--muted); margin: 0 0 14px; max-width: 60ch; }
.about > div { flex: 1; min-width: 260px; }

/* ── Artigo ──────────────────────────────────────────────────────────────── */
.article-head { padding: 62px 0 30px; text-align: left; }
.article-head h1 {
  font-family: var(--font-display); font-size: clamp(32px, 4.6vw, 52px); line-height: 1.08;
  letter-spacing: -.03em; font-weight: 600; margin: 0 0 18px;
}
.lede { font-size: 20px; color: var(--muted); line-height: 1.55; margin: 0; }

.article-banner { margin: 10px 0 46px; width: min(100% - 40px, 1020px); margin-inline: auto; }
.article-banner img {
  width: 100%; aspect-ratio: 21 / 9; object-fit: cover;
  border-radius: var(--r-lg); border: 1px solid var(--line);
}
.article-banner figcaption {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 12px; text-align: center;
}

.prose { font-size: 18.5px; line-height: 1.78; }
.prose > * + * { margin-top: 1.25em; }
.prose h2 {
  font-family: var(--font-display); font-size: 30px; letter-spacing: -.02em; line-height: 1.2;
  margin-top: 1.9em; margin-bottom: .55em; font-weight: 600;
}
.prose h3 { font-family: var(--font-display); font-size: 23px; margin-top: 1.6em; margin-bottom: .45em; font-weight: 600; }
.prose h4 { font-size: 18px; font-weight: 600; margin-top: 1.4em; }
.prose p { color: color-mix(in oklab, var(--text) 92%, var(--muted)); }
.prose a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .5em; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  border-left: 3px solid var(--accent); padding: 4px 0 4px 22px; margin-left: 0;
  font-family: var(--font-display); font-size: 21px; font-style: italic; color: var(--text);
}
.prose code {
  font-family: var(--font-mono); font-size: .86em; background: var(--surface-2);
  border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px;
}
.prose pre {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 20px 22px; overflow-x: auto; font-size: 14.5px; line-height: 1.6;
}
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.prose strong { color: var(--text); font-weight: 600; }

/* ── Assinatura ──────────────────────────────────────────────────────────── */
.signature { margin: 70px 0 40px; }
.sig-rule { height: 1px; background: linear-gradient(90deg, var(--accent), var(--line) 40%, transparent); margin-bottom: 30px; }
.sig-body {
  display: flex; gap: 26px; align-items: flex-start; flex-wrap: wrap;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px;
}
.sig-avatar {
  width: 92px; height: 92px; border-radius: 50%; object-fit: cover; flex: none;
  border: 2px solid var(--accent-line);
}
.sig-text { flex: 1; min-width: 240px; }
.sig-kicker {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
}
.sig-name { font-family: var(--font-display); font-size: 25px; letter-spacing: -.02em; margin: 6px 0 2px; font-weight: 600; }
.sig-role { font-size: 14px; color: var(--muted); margin: 0 0 10px; }
.sig-bio { color: var(--muted); font-size: 15.5px; margin: 0 0 18px; max-width: 62ch; }

.sig-social { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; }
.sig-social a {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  padding: 8px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.sig-social a:hover { color: var(--accent); border-color: var(--accent-line); transform: translateY(-2px); }
.sig-social svg { width: 16px; height: 16px; }

.notfound { padding: 90px 0; text-align: center; }
.notfound h1 { font-family: var(--font-display); font-size: 40px; letter-spacing: -.02em; margin: 0 0 12px; }
.notfound p { color: var(--muted); margin-bottom: 26px; }

/* ── Rodapé ──────────────────────────────────────────────────────────────── */
.site-foot { margin-top: 100px; border-top: 1px solid var(--line); background: var(--bg-2); padding: 44px 0 38px; }
.foot-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot-brand p { color: var(--muted); font-size: 14.5px; margin: 6px 0 0; max-width: 44ch; }
.social { list-style: none; display: flex; gap: 10px; padding: 0; margin: 0; }
.social a {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.social a:hover { color: var(--accent); border-color: var(--accent-line); transform: translateY(-3px); }
.social svg { width: 17px; height: 17px; }
.site-foot small { color: var(--muted); font-family: var(--font-mono); font-size: 12px; }

/* ── Responsivo ──────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; }
  .feature-media img { min-height: 220px; aspect-ratio: 16/9; }
  .feature-body { padding: 28px 24px 32px; }
}
@media (max-width: 620px) {
  body { font-size: 16.5px; }
  .hero { padding: 56px 0 40px; }
  .nav a { padding: 8px 9px; font-size: 14px; }
  .about { padding: 26px; }
  .sig-body { padding: 24px; }
  .foot-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
