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

:root {
  --bg: #FAF9F6;
  --bg-card: #FFFFFF;
  --text: #2C2C2C;
  --text-light: #6B6B6B;
  --text-muted: #9B9B9B;
  --accent: #5B7F5E;
  --accent-light: #E8F0E8;
  --accent-hover: #4A6B4D;
  --accent-warm: #7A9E6E;
  --accent-sage: #8FA88A;
  --accent-olive: #A3B899;
  --accent-lichen: #C5D5BD;
  --accent-moss: #6B8F5E;
  --border: #E2E0D8;
  --shadow: rgba(91, 127, 94, 0.06);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Lora', Georgia, serif;
  --max-width: 780px;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent-hover);
}

/* ── Nav ── */
header {
  padding: 1.5rem 2rem;
}

nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text);
  letter-spacing: -0.5px;
}

.logo:hover {
  color: var(--accent);
}

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

.nav-links a {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 400;
}

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

/* ── Main ── */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

/* ── Hero ── */
.hero {
  padding: 3rem 0 2rem;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 1.2rem;
  letter-spacing: -0.3px;
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.about-space {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ── (diagram styles moved below) ── */

/* ── Topics ── */
.topics {
  padding: 2rem 0 3rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.topic-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.3rem 1.4rem;
  transition: all 0.2s ease;
  position: relative;
}

.topic-card:hover {
  border-color: var(--accent-sage);
  box-shadow: 0 2px 16px var(--shadow);
  transform: translateY(-1px);
}

.topic-status {
  font-size: 1rem;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.topic-card h3 {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.topic-card p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 0.7rem;
}

.topic-tag {
  font-size: 0.75rem;
  color: var(--accent-hover);
  background: var(--accent-light);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.topic-tag[href*="sociedad"], .topic-tag.sociedad { background: var(--accent-lichen); color: var(--accent-moss); }
.topic-tag[href*="filosof"], .topic-tag.filosofia { background: #e8e0f0; color: #6B5B8F; }
.topic-tag[href*="tecnolog"], .topic-tag.tecnologia { background: #e0ecf5; color: #4A6B8F; }
.topic-tag[href*="emprender"], .topic-tag.emprender { background: #f5ece0; color: #8F6B4A; }

.topics-note {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── Connect ── */
.connect {
  padding: 2rem 0 3rem;
  text-align: center;
  border-top: 1px solid var(--accent-lichen);
}

.connect p {
  font-size: 0.95rem;
  color: var(--text-light);
  max-width: 440px;
  margin: 0 auto 1.5rem;
  line-height: 1.7;
}

.connect .invite {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--accent);
  font-style: italic;
  line-height: 1.6;
}

.connect-links {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

.connect-btn {
  display: inline-block;
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 400;
  transition: all 0.2s;
}

.connect-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

/* ── Footer ── */
/* ── Diagram embed ── */
.diagram {
  padding: 1rem 0 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.excalidraw-embed {
  width: 100%;
  max-width: 700px;
  height: 420px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}

.excalidraw-embed iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.diagram-loading {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.diagram-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  text-align: center;
}

footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--accent-lichen);
}

footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 300;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .hero h1 {
    font-size: 1.7rem;
  }

  .subtitle {
    font-size: 1rem;
  }

  .subtitle br {
    display: none;
  }

  .topic-grid {
    grid-template-columns: 1fr;
  }

  main {
    padding: 0 1.2rem 3rem;
  }

  .diagram {
    display: none;
  }
}

/* ── Topic Page Styles ── */
.topic-page {
  padding-top: 2rem;
}

.topic-page .back {
  display: inline-block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.topic-page .back:hover {
  color: var(--accent);
}

.topic-page .back::before {
  content: "← ";
}

.topic-page h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.topic-page .meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.topic-page .content {
  max-width: 600px;
  line-height: 1.8;
}

.topic-page .content p {
  margin-bottom: 1.2rem;
  color: var(--text);
}

.topic-page .seedling-note {
  background: var(--accent-light);
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin-top: 2rem;
  font-size: 0.9rem;
  color: var(--accent-hover);
  line-height: 1.7;
}

.topic-page .seedling-note::before {
  content: "🌱 ";
}
