/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9em;
  font-weight: 400;
  background: #fff;
  color: #232333;
  line-height: 1.6;
  word-wrap: break-word;
}

/* ── Progress bar ──────────────────────────────────────────────────────────── */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0%;
  background: #ff0000;
  z-index: 9999;
  transition: width 0.1s linear;
}

/* ── Layout container ──────────────────────────────────────────────────────── */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
header {
  padding: 24px 0 16px;
  border-bottom: 3px dotted #232333;
  margin-bottom: 32px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.site-title a {
  font-size: 1.5em;
  font-weight: 700;
  color: #232333;
  text-decoration: none;
  margin-right: 16px;
}

.site-title a:hover { color: #ff0000; }

nav { display: flex; flex-wrap: wrap; gap: 0; }

nav a {
  color: #232333;
  text-decoration: none;
  margin-right: 8px;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s, background 0.15s;
}

nav a:hover,
nav a.active {
  color: #fff;
  background: #ff0000;
  border-bottom-color: #ff0000;
  padding: 0 3px;
}

/* ── Main content ──────────────────────────────────────────────────────────── */
main { min-height: 60vh; }

/* ── Tagline ───────────────────────────────────────────────────────────────── */
.tagline {
  font-style: italic;
  margin-bottom: 32px;
  color: #555;
}

/* ── Blog post list ────────────────────────────────────────────────────────── */
.blog-posts {
  list-style: none;
  margin: 16px 0 24px;
}

.blog-posts li {
  display: flex;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px dotted #ddd;
}

.blog-posts li:last-child { border-bottom: none; }

.blog-posts span {
  min-width: 130px;
  flex-shrink: 0;
}

.blog-posts time {
  font-style: italic;
  opacity: 0.6;
  font-size: 0.85em;
}

.blog-posts a {
  color: #232333;
  text-decoration: none;
  border-bottom: 1px solid #232333;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.blog-posts a:hover {
  color: #fff;
  background: #ff0000;
  border-bottom-color: #ff0000;
  padding: 0 3px;
}

/* ── Tag filter ────────────────────────────────────────────────────────────── */
.tag-filter {
  margin: 8px 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.8em;
  color: #232333;
  border: 1px solid #232333;
  padding: 2px 7px;
  border-radius: 3px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tag:hover, .tag.active-tag {
  background: #ff0000;
  color: #fff;
  border-color: #ff0000;
}

.blog-note {
  font-size: 0.85em;
  font-style: italic;
  opacity: 0.7;
  margin-bottom: 8px;
}

/* ── Article / Post ────────────────────────────────────────────────────────── */
article h1 {
  font-size: 1.4em;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}

.post-date {
  font-style: italic;
  opacity: 0.6;
  font-size: 0.85em;
  margin-bottom: 24px;
}

.post-body { margin-top: 20px; }

.post-body p  { margin-bottom: 1em; }
.post-body h1,
.post-body h2,
.post-body h3 { margin: 1.4em 0 0.5em; font-weight: 700; }
.post-body h2 { font-size: 1.1em; }
.post-body h3 {
  font-size: 1.1em;
  margin-top: 2.2em;
  padding: 8px 12px;
  border-left: 4px solid #ff0000;
  background: #f9f9f9;
  letter-spacing: 0.03em;
}

.post-body ul,
.post-body ol { margin: 0.5em 0 1em 1.4em; }
.post-body li { margin-bottom: 0.3em; }

.post-body a {
  color: #ff0000;
  text-decoration: none;
  border-bottom: 1px solid #ff0000;
}
.post-body a:hover { background: #ff0000; color: #fff; }

.post-body strong { font-weight: 700; }
.post-body em     { font-style: italic; }

.post-body blockquote {
  border-left: 4px solid #ff0000;
  background: #fff8f8;
  padding: 14px 18px;
  font-style: italic;
  font-size: 1em;
  margin: 1.6em 0;
  color: #232333;
  letter-spacing: 0.01em;
  line-height: 1.7;
}

.post-body pre {
  background: #f2f2f2;
  border-radius: 4px;
  padding: 14px;
  overflow-x: auto;
  margin: 1em 0;
  font-size: 0.85em;
}

.post-body code {
  background: #f2f2f2;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.88em;
}

.post-body pre code { background: none; padding: 0; }

.post-tags  { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 6px; }
.back-link  { margin-top: 20px; font-size: 0.9em; }
.back-link a { color: #232333; text-decoration: none; border-bottom: 1px solid #232333; }
.back-link a:hover { color: #ff0000; border-color: #ff0000; }

/* ── Contact line ──────────────────────────────────────────────────────────── */
.contact { margin-top: 32px; font-size: 0.9em; }
.contact a { color: #ff0000; text-decoration: none; border-bottom: 1px solid #ff0000; }
.contact a:hover { background: #ff0000; color: #fff; }

/* ── Footer ────────────────────────────────────────────────────────────────── */
footer {
  border-top: 3px dotted #232333;
  margin-top: 48px;
  padding: 16px 0 24px;
  font-size: 0.8em;
  opacity: 0.6;
}

/* ── Back to top ───────────────────────────────────────────────────────────── */
#back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #232333;
  color: #fff;
  border: none;
  padding: 8px 12px;
  font-family: 'Roboto Mono', monospace;
  font-size: 0.9em;
  cursor: pointer;
  display: none;
  border-radius: 3px;
  transition: background 0.15s;
}
#back-to-top:hover { background: #ff0000; }

/* ── Headings ──────────────────────────────────────────────────────────────── */
main > h1, main > h2 {
  font-size: 1.2em;
  font-weight: 700;
  margin-bottom: 16px;
}

/* ── One-page sections ─────────────────────────────────────────────────────── */
.section-proyectos,
.section-contadores,
.section-contact {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px dotted #ccc;
}

.section-proyectos h2,
.section-contadores h2,
.section-contact h2 {
  font-size: 1em;
  font-weight: 700;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Project list */
.project-list {
  list-style: none;
  margin: 0 0 16px;
}

.project-list li {
  padding: 5px 0;
  border-bottom: 1px dotted #eee;
  font-size: 0.9em;
}

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

.project-list a {
  color: #232333;
  text-decoration: none;
  border-bottom: 1px solid #232333;
  font-weight: 700;
}

.project-list a:hover {
  color: #fff;
  background: #ff0000;
  border-bottom-color: #ff0000;
  padding: 0 3px;
}

.project-list.dead a {
  opacity: 0.6;
}

/* Highlighted quote below each section */
.section-quote {
  font-style: italic;
  font-size: 0.88em;
  border-left: 3px solid #ff0000;
  background: #fff8f8;
  padding: 10px 14px;
  margin-top: 12px;
}

/* Contadores teaser */
.section-contadores p {
  margin-bottom: 8px;
  font-size: 0.9em;
}

.section-contadores a,
.section-contact a {
  color: #ff0000;
  text-decoration: none;
  border-bottom: 1px solid #ff0000;
}

.section-contadores a:hover,
.section-contact a:hover {
  background: #ff0000;
  color: #fff;
}

/* ── Counter page ──────────────────────────────────────────────────────────── */
.counter-list {
  list-style: none;
  margin-top: 24px;
}

.counter-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px dotted #ddd;
}

.counter-item:last-child { border-bottom: none; }

.counter-emoji {
  font-size: 1.6em;
  line-height: 1;
  min-width: 32px;
  text-align: center;
}

.counter-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.counter-label {
  font-weight: 700;
  font-size: 0.95em;
}

.counter-days {
  font-size: 1.4em;
  font-weight: 300;
  color: #ff0000;
  letter-spacing: -0.02em;
}

.counter-readable {
  font-size: 0.78em;
  opacity: 0.5;
  font-style: italic;
}

/* ── Utility ───────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 500px) {
  .blog-posts span { min-width: 90px; }
  .blog-posts time { font-size: 0.78em; }
  header { flex-direction: column; gap: 6px; }
}
