/*
 * Design tokens — identidade visual improdutivo.com
 * Ver redesign-improdutivo.md para a especificação completa.
 */

:root {
  /* Modo claro (leitura) */
  --bg: #F6F2EA;
  --surface: #EDE8DD;
  --text: #1A1C22;
  --text-muted: #5A5650;
  --border: #D8D1C3;
  --highlight: #F2D14B;
  --on-highlight: #14171F;
  --link: #1A1C22;
}

:root[data-theme="dark"] {
  --bg: #14171F;
  --surface: #1C2029;
  --text: #EDE8DD;
  --text-muted: #B9B3A6;
  --border: #2E3340;
  --highlight: #F2D14B;
  --on-highlight: #14171F;
  --link: #F2D14B;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171F;
    --surface: #1C2029;
    --text: #EDE8DD;
    --text-muted: #B9B3A6;
    --border: #2E3340;
    --link: #F2D14B;
  }
}

* {
  border-color: var(--border);
}

html {
  background: var(--bg);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Source Serif 4", Georgia, serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .font-heading {
  font-family: "Instrument Serif", Georgia, serif;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

h1 { font-size: 42px; }
h2 { font-size: 28px; }
h3 { font-size: 22px; }

@media (min-width: 768px) {
  h1 { font-size: 64px; }
  h2 { font-size: 36px; }
  h3 { font-size: 26px; }
}

.font-mono-label {
  font-family: "IBM Plex Mono", "Fira Code", monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
}

code, pre, kbd, samp {
  font-family: "IBM Plex Mono", "Fira Code", monospace;
}

/* Marca-texto — assinatura visual */
.mark {
  background: var(--highlight);
  color: var(--on-highlight);
  padding: 0 0.15em;
  font-style: italic;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

mark {
  background: var(--highlight);
  color: var(--on-highlight);
  padding: 0 0.15em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Links de texto corrido */
.prose a,
.link-underline {
  color: var(--link);
  text-decoration-line: underline;
  text-decoration-color: var(--highlight);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
  transition: background-color 0.15s ease;
}

.prose a:hover,
.link-underline:hover {
  background-color: color-mix(in srgb, var(--highlight) 25%, transparent);
}

/* Foco visível */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 2px;
}

/* Botões */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.25rem;
  font-family: "IBM Plex Mono", "Fira Code", monospace;
  font-size: 14px;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  cursor: pointer;
}

.btn-primary {
  background: var(--highlight);
  color: var(--on-highlight);
  border: 1px solid var(--highlight);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--highlight) 85%, black 0%);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--text);
}

.btn-secondary:hover {
  background: var(--surface);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* Dropdown de idiomas (header) */
.lang-dropdown {
  display: none;
}

.lang-dropdown.show {
  display: block;
}

/* Menu mobile (header) */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 50;
}

.mobile-nav.active {
  display: block;
}

/* Chips de filtro (listagens) */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.9rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  background: transparent;
}

.chip.active,
.chip[aria-current="true"] {
  background: var(--highlight);
  color: var(--on-highlight);
  border-color: var(--highlight);
}

/* Título de post/card: sem sublinhado por padrão, só no hover/foco */
.title-link {
  color: var(--text);
  text-decoration: none;
}

.title-link:hover,
.title-link:focus-visible {
  text-decoration-line: underline;
  text-decoration-color: var(--highlight);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

/* Item ativo da navegação */
.nav-active {
  text-decoration-line: underline;
  text-decoration-color: var(--highlight);
  text-decoration-thickness: 3px;
  text-underline-offset: 3px;
}

/* Capa tipográfica (fallback quando não há imagem enviada) */
.typographic-cover {
  aspect-ratio: 16 / 9;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
  overflow: hidden;
}

/* Grade de cards (pensamentos, projetos, vídeos) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Barra de progresso fina */
.progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--highlight);
}
