/* ═══════════════════════════════════════
   nanopisaroni.vercel.app — Design System
   ═══════════════════════════════════════ */

/* ── Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,400&family=Inter:wght@300;400;500;600&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Variables ── */
:root {
  color-scheme: light;

  /* Palette — warm paper */
  --bg: #faf7f2;
  --surface: #ffffff;
  --text: #1c1917;
  --text-muted: #78716c;
  --text-faint: #a8a29e;
  --accent: #b45309;
  --accent-soft: #fde68a;
  --accent-glow: rgba(180, 83, 9, 0.06);
  --rule: #e7e5e4;
  --rule-light: #f5f3f0;
  --hover-bg: #f5f2ed;

  /* Typography */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Layout */
  --content-w: 580px;
  --content-pad: 24px;
  --section-gap: 48px;
}

/* ── Base ── */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16.5px;
  line-height: 1.65;
}

img {
  max-width: 100%;
  height: auto;
}

/* ── Links ── */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: #92400e;
}
a:visited {
  color: #a16207;
}

/* ── Wrapper ── */
.site {
  width: min(100% - 2 * var(--content-pad), var(--content-w));
  margin: 0 auto;
  padding: 0 0 64px;
}

/* ── Header / Nav ── */
header {
  padding: 36px 0 0;
  margin-bottom: 0;
}

.site-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  font-variation-settings: 'opsz' 36;
  color: var(--text);
  letter-spacing: -0.01em;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 14px;
}
.site-title:hover {
  color: var(--accent);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--rule);
}

nav a {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 5px;
  transition: all 0.15s ease;
}
nav a:hover {
  color: var(--text);
  background: var(--hover-bg);
}
nav a.active {
  color: var(--accent);
  background: var(--accent-glow);
}

/* ── Main ── */
main {
  padding-top: var(--section-gap);
}

/* ── Typography ── */
h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 8vw, 52px);
  font-weight: 600;
  font-variation-settings: 'opsz' 72;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--text);
}

h1 + .subtitle {
  font-size: 17.5px;
  color: var(--text-muted);
  margin: 0 0 32px;
  line-height: 1.45;
  font-weight: 400;
}

h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 500;
  font-variation-settings: 'opsz' 48;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 40px 0 18px;
  color: var(--text);
}

h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  font-variation-settings: 'opsz' 36;
  line-height: 1.3;
  margin: 0 0 8px;
}

p {
  margin: 0 0 20px;
}

small, .meta {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-faint);
}

/* ── Essay / List layout ── */
.entry-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-light);
}
.entry-item:first-child {
  padding-top: 0;
}

.entry-item a {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}
.entry-item a:hover {
  color: var(--accent);
}

.entry-item .date {
  flex: 0 0 auto;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-faint);
  white-space: nowrap;
}

/* ── Section intro / description ── */
.section-intro {
  margin-bottom: 32px;
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Highlight / New badge ── */
.highlight {
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 18px 22px;
  margin-bottom: 32px;
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
}
.highlight strong {
  font-weight: 600;
}
.highlight a {
  font-weight: 500;
}

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 36px 0;
}

/* ── Footer ── */
footer {
  margin-top: var(--section-gap);
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.5;
}

/* ── Cards (for buy page, panteon) ── */
.card-grid {
  display: grid;
  gap: 20px;
  margin: 24px 0;
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 28px;
  transition: box-shadow 0.2s ease;
}
.card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  font-variation-settings: 'opsz' 36;
  margin: 0 0 4px;
}

.card .price {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  font-variation-settings: 'opsz' 48;
  color: var(--accent);
  margin: 6px 0 2px;
}

.card .desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ── Buttons ── */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 24px;
  border-radius: 7px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: #92400e;
  color: #fff;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--rule);
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-full {
  display: block;
  width: 100%;
  text-align: center;
}

/* ── Thinker list (Panteón) ── */
.thinker-list {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-muted);
  margin: 20px 0;
}
.thinker-list strong {
  color: var(--text);
}
.thinker-list .sep {
  color: var(--rule);
  margin: 0 4px;
}

/* ── Prose (about, longer text) ── */
.prose {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--text);
}
.prose p {
  margin-bottom: 22px;
}
.prose a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── TOC (for ideas.html) ── */
.toc {
  margin: 30px 0;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
}
.toc-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 0 0 10px;
}
.toc a {
  display: block;
  padding: 3px 0;
  font-size: 14px;
  color: var(--text-muted);
  transition: color 0.1s;
}
.toc a:hover {
  color: var(--accent);
}
.toc .count {
  color: var(--text-faint);
  font-size: 12px;
  margin-left: 3px;
}

/* ── Concept cards (ideas.html) ── */
.concept {
  margin: 0;
  padding: 18px 0 16px;
  border-bottom: 1px solid var(--rule-light);
}
.concept:last-of-type {
  border-bottom: none;
}
.concept h3 {
  margin: 0 0 3px;
  font-size: 17px;
}
.concept h3 .num {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 500;
  margin-right: 3px;
}
.concept p {
  margin: 0;
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Chapter list (audiolibro) ── */
.chapter-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.chapter-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-light);
  display: flex;
  align-items: center;
  gap: 14px;
}
.chapter-item:first-child {
  padding-top: 0;
}
.chapter-num {
  flex: 0 0 28px;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-faint);
  font-variation-settings: 'opsz' 36;
}
.chapter-info {
  flex: 1;
  min-width: 0;
}
.chapter-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}
.chapter-meta {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 1px;
}
.chapter-play {
  flex: 0 0 auto;
}

/* ── Audio player ── */
audio {
  width: 100%;
  height: 40px;
  border-radius: 6px;
  margin: 4px 0;
}
audio::-webkit-media-controls-panel {
  background: var(--surface);
}

/* ── Responsive ── */
@media (max-width: 520px) {
  :root {
    --content-pad: 16px;
    --section-gap: 36px;
  }

  body {
    font-size: 15.5px;
  }

  h1 {
    font-size: clamp(28px, 9vw, 38px);
  }

  nav {
    gap: 4px;
  }
  nav a {
    font-size: 12.5px;
    padding: 3px 10px;
  }

  .entry-item {
    flex-direction: column;
    gap: 2px;
    padding: 12px 0;
  }
  .entry-item .date {
    font-size: 12px;
  }

  .card {
    padding: 20px;
  }

  .toc {
    padding: 16px 18px;
  }
}

/* ── Print ── */
@media print {
  body {
    background: #fff;
    font-size: 12pt;
  }
  .site {
    width: 100%;
    padding: 0;
  }
  nav, footer {
    display: none;
  }
  main {
    padding-top: 0;
  }
}

/* ── Utilities ── */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 12px; }
.mt-2 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 12px; }
.mb-2 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
