:root {
  --paper: #faf6ef;
  --paper-deep: #f1e8da;
  --ink: #2b2723;
  --muted: #6f6658;
  --accent: #d96a4a;
  --accent-ink: #a5442a;
  --accent2: #2a9d8f;
  --accent-soft: #f5e2d8;
  --gold: #d9a441;
  --line: #e6dccb;
  --card: #fffdf8;
  --shadow: 0 10px 30px rgba(120, 90, 50, 0.12);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.7;
  background:
    radial-gradient(900px 500px at 85% -5%, rgba(217, 164, 65, 0.18), transparent 60%),
    radial-gradient(700px 500px at 0% 30%, rgba(42, 157, 143, 0.1), transparent 55%),
    var(--paper);
}

/* Hero */
.hero {
  max-width: 780px;
  margin: 0 auto;
  padding: 96px 24px 60px;
  text-align: left;
  position: relative;
}

.hero::before {
  content: "01 / 07 — Las bases · 02 / 07 — Presupuesto · 03 / 07 — Ahorro · 04 / 07 — Interés · 05 / 07 — Deudas · 06 / 07 — Inversión · 07 / 07 — Hábitos";
  position: absolute;
  top: 20px;
  left: 24px;
  right: 24px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent2);
  margin-bottom: 22px;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.4rem, 7vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.hero h1 span {
  color: var(--accent);
  font-style: italic;
  font-weight: 500;
}

.hero-text {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 560px;
  margin-bottom: 36px;
}

.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  padding: 15px 32px;
  border-radius: 4px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  background: var(--accent);
}

/* Layout */
main {
  max-width: 780px;
  margin: 0 auto;
  padding: 48px 24px 90px;
}

/* TOC */
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 64px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.toc a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
  padding: 8px 14px;
  background: var(--paper);
  transition: background 0.2s, color 0.2s;
}

.toc a:hover {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* Lessons */
.lesson {
  padding: 48px 0;
  border-bottom: 1px dashed var(--line);
  scroll-margin-top: 24px;
}

.lesson-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--card);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 18px;
}

.lesson h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 4vw, 2rem);
  letter-spacing: -0.01em;
  margin: -2px 0 18px;
}

.lesson > p:first-of-type::first-letter {
  font-family: var(--serif);
  font-size: 3.2rem;
  font-weight: 600;
  float: left;
  line-height: 0.85;
  margin: 6px 10px 0 0;
  color: var(--accent);
}

.lesson p {
  color: var(--muted);
  margin-bottom: 18px;
}

.lesson p:last-child {
  margin-bottom: 0;
}

.lesson strong {
  color: var(--ink);
  border-bottom: 3px solid var(--accent-soft);
  padding: 0 2px;
}

/* Chart */
.chart {
  position: relative;
  height: 260px;
  margin: 30px 0 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chart::before {
  content: "";
  position: absolute;
  inset: 10px;
  background-image:
    linear-gradient(rgba(43, 39, 35, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 39, 35, 0.07) 1px, transparent 1px);
  background-size: 30px 30px;
}

.chart .bars {
  position: absolute;
  inset: 10px;
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.chart .bars span {
  flex: 1;
  background: linear-gradient(to top, rgba(42, 157, 143, 0.25), var(--accent2));
  border-radius: 3px 3px 0 0;
}

.chart .bars span.simple {
  background: repeating-linear-gradient(
    45deg,
    var(--accent-soft),
    var(--accent-soft) 4px,
    var(--paper-deep) 4px,
    var(--paper-deep) 8px
  );
  border: 1px solid var(--accent);
  border-bottom: none;
  opacity: 0.9;
}

.chart-axis {
  position: absolute;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--muted);
}

.chart-axis--time {
  right: 14px;
  bottom: 12px;
}

.chart-axis:not(.chart-axis--time) {
  top: 12px;
  left: 14px;
}

.caption {
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 10px;
}

/* Habits */
.habits {
  list-style: none;
  display: grid;
  gap: 12px;
  margin: 8px 0 20px;
}

.habits li {
  position: relative;
  padding: 16px 18px 16px 46px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.habits li::before {
  content: "✓";
  position: absolute;
  left: 14px;
  top: 16px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--card);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.habits strong {
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.05rem;
}

/* Closing */
.closing {
  padding: 72px 0 0;
  text-align: center;
  background: linear-gradient(var(--paper), var(--paper-deep));
  border-radius: 16px;
}

.closing h2 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--accent);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin-bottom: 16px;
}

.closing > p {
  color: var(--muted);
  max-width: 540px;
  margin: 0 auto;
}

.disclaimer {
  margin-top: 34px !important;
  font-size: 0.8rem;
  opacity: 0.85;
  border-top: 1px dashed var(--line);
  border-radius: 0 0 16px 16px;
  padding: 22px 24px;
  background: var(--card);
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 28px;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 480px) {
  .hero {
    padding-top: 72px;
  }
}