/* =========================================
   CARLOSFANDANGO — main.css
   Stack: Lora (serif) + DM Mono
   Palette: white bg, near-black, yellow accent
   ========================================= */

:root {
  --bg:        #FFFFFF;
  --fg:        #1A1916;
  --mid:       #6B6760;
  --rule:      #E8E4DC;
  --accent:    #E8B500;
  --accent-fg: #1A1916;
  --card-hover:#FFFBEE;

  --font-serif: 'Lora', Georgia, serif;
  --font-mono:  'DM Mono', 'Courier New', monospace;

  --max-w: 720px;
  --pad:   clamp(1.25rem, 5vw, 2.5rem);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-serif);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Typography ---- */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

a { color: inherit; text-decoration: none; }

/* ---- Layout ---- */
.main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem var(--pad) 5rem;
}

/* ---- Header / Nav ---- */
.site-header { border-bottom: 1px solid var(--rule); }

.nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.1rem var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-home {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--accent-fg);
  background: var(--accent);
  padding: 0.25rem 0.6rem;
  transition: opacity 0.15s;
}

.nav-home:hover { opacity: 0.8; }

.nav-links { display: flex; gap: 2rem; }

.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--mid);
  transition: color 0.15s;
}

.nav-links a:hover { color: var(--fg); }

/* ---- Footer ---- */
.site-footer {
  border-top: 1px solid var(--rule);
  text-align: center;
  padding: 1.5rem var(--pad);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--mid);
}

/* ---- Homepage: Intro ---- */
.intro {
  padding: 4rem 0 3.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 3.5rem;
}

.intro h1 {
  font-size: clamp(2.8rem, 10vw, 5.5rem);
  font-weight: 400;
  font-style: italic;
  line-height: 1.05;
  margin-bottom: 1.25rem;
}

.tagline {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--mid);
  letter-spacing: 0.03em;
}

/* ---- Section labels ---- */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-style: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
  margin-bottom: 1.5rem;
}

/* ---- Projects ---- */
.projects { margin-bottom: 4rem; }

.project-grid {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--rule);
}

.project-card {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  color: var(--fg);
  margin: 0 -1rem;
  transition: background 0.1s;
  border-radius: 2px;
}

.project-card:hover { background: var(--card-hover); }
.project-card:hover .project-arrow { transform: translateX(4px); color: var(--accent); }

.project-number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--mid);
  letter-spacing: 0.05em;
}

.project-content h3 {
  font-size: 1rem;
  font-weight: 500;
  font-style: normal;
  margin-bottom: 0.15rem;
}

.project-content p {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--mid);
  line-height: 1.5;
}

.project-arrow {
  font-size: 1rem;
  color: var(--rule);
  transition: transform 0.15s, color 0.15s;
}

/* ---- Post lists ---- */
.recent-posts { margin-top: 3.5rem; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.view-all {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-fg);
  background: var(--accent);
  padding: 0.2rem 0.55rem;
  transition: opacity 0.15s;
}

.view-all:hover { opacity: 0.8; }

.post-list {
  list-style: none;
  border-top: 1px solid var(--rule);
}

.post-list-item a {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
  color: var(--fg);
  transition: color 0.15s;
}

.post-list-item a:hover .post-list-title { color: var(--mid); }

.post-list-main {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.post-list-title {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.4;
}

.post-list-excerpt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--mid);
  line-height: 1.5;
}

.post-list-date {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--mid);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 0.2rem;
}

/* ---- Blog header ---- */
.blog-header {
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 0;
}

.blog-header h1 {
  font-size: clamp(2rem, 7vw, 3.5rem);
  font-style: italic;
  font-weight: 400;
}

/* ---- Single post ---- */
.post { max-width: 660px; }

.post-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 2.5rem;
}

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--mid);
  margin-bottom: 1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.tag {
  background: var(--accent);
  color: var(--accent-fg);
  padding: 0.1rem 0.5rem;
  border-radius: 2px;
  font-size: 0.7rem;
}

.post-title {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.25;
}

.post-body { font-size: 1.05rem; line-height: 1.8; }
.post-body p { margin-bottom: 1.5rem; }
.post-body h2 { margin: 2.5rem 0 1rem; font-size: 1.3rem; }
.post-body h3 { margin: 2rem 0 0.75rem; font-size: 1.1rem; }
.post-body ul, .post-body ol { margin: 0 0 1.5rem 1.5rem; }
.post-body li { margin-bottom: 0.4rem; }
.post-body a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.post-body a:hover { text-decoration-color: var(--fg); }
.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--mid);
  font-style: italic;
}
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--rule);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}
.post-body pre {
  background: var(--fg);
  color: var(--bg);
  padding: 1.25rem;
  border-radius: 4px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.post-body pre code { background: none; padding: 0; }
.post-body img { max-width: 100%; height: auto; margin: 2rem 0; display: block; }

.post-footer { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--rule); }

.back-link {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--mid);
  transition: color 0.15s;
}

.back-link:hover { color: var(--fg); }

/* ---- Empty state ---- */
.empty-state {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--mid);
  padding: 2rem 0;
}

/* ---- Responsive ---- */
@media (max-width: 500px) {
  .post-list-item a { flex-direction: column; gap: 0.5rem; }
  .post-list-date { font-size: 0.68rem; }
  .project-card { grid-template-columns: 2rem 1fr auto; gap: 0.75rem; }
}
