/* =============================================================================
   Julio G. · Finanzas con cabeza
   Editorial styling: cream + navy + gold, Fraunces + Manrope
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700;9..144,900&family=Manrope:wght@400;500;600;700&display=swap');

/* ---------- Design tokens ---------- */
:root {
  --cream-bg: #FAF6EC;
  --cream-bg-alt: #F4EDDC;
  --cream-line: #E8DEC4;
  --ink: #1A1814;
  --ink-soft: #4A4540;
  --ink-mute: #7A726A;
  --navy: #1F4E78;
  --navy-deep: #14385A;
  --navy-tint: #E5EDF5;
  --gold: #B8901E;
  --gold-soft: #D4A933;
  --gold-tint: #F8EDC9;
  --green: #1D9E75;
  --green-tint: #DCF1E8;
  --red: #B73E1F;
  --red-tint: #F4DCD2;

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container: 1180px;
  --container-narrow: 760px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(26,24,20,0.04), 0 1px 3px rgba(26,24,20,0.05);
  --shadow-md: 0 4px 12px rgba(26,24,20,0.06), 0 2px 4px rgba(26,24,20,0.04);
  --shadow-lg: 0 12px 32px rgba(26,24,20,0.08), 0 4px 8px rgba(26,24,20,0.04);

  --duration: 220ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --cream-bg: #14110C;
    --cream-bg-alt: #1E1A13;
    --cream-line: #332D22;
    --ink: #F0EAD9;
    --ink-soft: #C9C0AE;
    --ink-mute: #8A8275;
    --navy: #88B5DC;
    --navy-deep: #5A8DBA;
    --navy-tint: #1B2D44;
    --gold: #E0B854;
    --gold-soft: #C9A227;
    --gold-tint: #3A2E0F;
    --green: #4DBA92;
    --green-tint: #143C2E;
    --red: #D85A30;
    --red-tint: #3D1A0F;
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--navy); text-decoration: none; transition: color var(--duration) var(--ease); }
a:hover { color: var(--gold); }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

::selection { background: var(--gold-tint); color: var(--ink); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
  font-variation-settings: "opsz" 32;
}
h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 144;
}
h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-variation-settings: "opsz" 96;
  margin-bottom: 0.6em;
}
h3 {
  font-size: 1.4rem;
  font-variation-settings: "opsz" 48;
  margin-bottom: 0.4em;
}
p { margin-bottom: 1em; color: var(--ink-soft); }
p.lead {
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--ink);
  font-weight: 400;
}
.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.muted { color: var(--ink-mute); }
.tiny { font-size: 0.85rem; line-height: 1.5; }

/* ---------- Layout ---------- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 24px; }
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
@media (max-width: 720px) { .section { padding: 56px 0; } }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--cream-line);
  background: var(--cream-bg);
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--cream-bg) 92%, transparent);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; max-width: var(--container); margin: 0 auto;
}
.brand {
  font-family: var(--serif); font-weight: 600; font-size: 1.25rem;
  color: var(--ink); letter-spacing: -0.01em;
  font-variation-settings: "opsz" 48;
  display: flex; align-items: center; gap: 10px;
}
.brand-mark {
  width: 28px; height: 28px;
  background: var(--navy);
  color: var(--cream-bg);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 0.85rem; font-weight: 600;
  font-variation-settings: "opsz" 9;
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  color: var(--ink-soft); font-size: 0.95rem; font-weight: 500;
  position: relative;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.current { color: var(--ink); }
.nav-links a.current::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -22px;
  height: 2px; background: var(--gold);
}
@media (max-width: 720px) {
  .nav-links { gap: 18px; }
  .nav-links a:not(.cta) { display: none; }
}

.cta {
  display: inline-block;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--cream-bg) !important;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform var(--duration) var(--ease), background var(--duration) var(--ease);
}
.cta:hover {
  background: var(--navy);
  color: var(--cream-bg) !important;
  transform: translateY(-1px);
}
.cta-gold {
  background: var(--gold);
  color: var(--ink) !important;
}
.cta-gold:hover { background: var(--gold-soft); color: var(--ink) !important; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--cream-line);
  background: var(--cream-bg-alt);
  padding: 60px 0 40px;
  margin-top: 80px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }
.footer-col h4 {
  font-family: var(--sans);
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-mute); margin-bottom: 16px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--ink-soft); font-size: 0.95rem; }
.footer-col a:hover { color: var(--ink); }
.footer-tagline { font-family: var(--serif); font-size: 1.15rem; color: var(--ink-soft); max-width: 380px; line-height: 1.5; }
.footer-bottom {
  padding-top: 30px;
  border-top: 1px solid var(--cream-line);
  display: flex; justify-content: space-between;
  font-size: 0.85rem; color: var(--ink-mute);
  flex-wrap: wrap; gap: 16px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 100px 0 80px;
  border-bottom: 1px solid var(--cream-line);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: 0; right: -100px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--gold-tint) 0%, transparent 65%);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.hero-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 1;
}
@media (max-width: 920px) {
  .hero { padding: 60px 0; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
}
.hero h1 { margin-bottom: 24px; }
.hero h1 em { font-style: italic; color: var(--navy); font-weight: 400; }
.hero-side {
  background: var(--cream-bg-alt);
  border: 1px solid var(--cream-line);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
}
.hero-side::before {
  content: '';
  position: absolute; top: -1px; left: 24px; right: 24px;
  height: 3px; background: var(--gold);
  border-radius: 0 0 2px 2px;
}

/* ---------- Cards / featured calculators on home ---------- */
.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 920px) { .calc-grid { grid-template-columns: 1fr; } }
.calc-card {
  background: var(--cream-bg-alt);
  border: 1px solid var(--cream-line);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  transition: transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease);
  display: flex; flex-direction: column;
  text-decoration: none;
  color: var(--ink);
}
.calc-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
  color: var(--ink);
}
.calc-card-mark {
  width: 44px; height: 44px;
  background: var(--navy);
  color: var(--cream-bg);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 1.2rem; font-weight: 600;
  margin-bottom: 24px;
  font-variation-settings: "opsz" 9;
}
.calc-card h3 { margin-bottom: 10px; }
.calc-card p {
  color: var(--ink-soft); font-size: 0.95rem; line-height: 1.5; margin-bottom: 24px;
  flex: 1;
}
.calc-card .arrow {
  font-size: 0.9rem; color: var(--gold);
  font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
}
.calc-card:hover .arrow { color: var(--gold-soft); }
.calc-card .arrow-icon { transition: transform var(--duration) var(--ease); }
.calc-card:hover .arrow-icon { transform: translateX(4px); }

/* ---------- Calculator UI (used in calculator pages) ---------- */
.calc-page-header {
  padding: 64px 0 32px;
  border-bottom: 1px solid var(--cream-line);
}
.calc-page-header .eyebrow { color: var(--navy); }
.calc-page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 16px;
}
.calc-page-header p.lead { max-width: 640px; }

.calc-shell {
  background: var(--cream-bg-alt);
  border: 1px solid var(--cream-line);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-top: 40px;
}
@media (max-width: 600px) { .calc-shell { padding: 24px 18px; } }

.calc-grid-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
  margin-bottom: 28px;
}
@media (max-width: 600px) { .calc-grid-inputs { grid-template-columns: 1fr; } }

.calc-grid-inputs-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 600px) { .calc-grid-inputs-3 { grid-template-columns: 1fr; } }

.input-group { display: flex; flex-direction: column; gap: 8px; }
.input-label {
  font-size: 0.88rem;
  color: var(--ink-soft);
  display: flex; justify-content: space-between; align-items: baseline;
  font-weight: 500;
}
.input-value {
  font-weight: 600; color: var(--ink); font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.slider {
  width: 100%; height: 6px;
  -webkit-appearance: none; appearance: none;
  background: var(--cream-line);
  border-radius: var(--radius-pill);
  outline: none;
  transition: background var(--duration) var(--ease);
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px;
  background: var(--navy);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--cream-bg);
  box-shadow: 0 0 0 1px var(--navy);
  transition: transform var(--duration) var(--ease);
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.slider::-moz-range-thumb {
  width: 20px; height: 20px;
  background: var(--navy);
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid var(--cream-bg);
  box-shadow: 0 0 0 1px var(--navy);
}

/* Result cards (used in calculators) */
.results-row {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}
.results-row.two { grid-template-columns: 1fr 1fr; }
.results-row.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 600px) {
  .results-row.two, .results-row.three { grid-template-columns: 1fr; }
}

.result-card {
  padding: 20px 22px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
}
.result-card .result-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  opacity: 0.8;
}
.result-card .result-value {
  font-family: var(--serif);
  font-size: 1.95rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  font-variation-settings: "opsz" 48;
}
.result-card .result-sub {
  font-size: 0.82rem;
  margin-top: 6px;
  opacity: 0.75;
}
.result-card.green { background: var(--green-tint); color: var(--green); }
.result-card.green .result-value { color: var(--green); }
.result-card.red { background: var(--red-tint); color: var(--red); }
.result-card.red .result-value { color: var(--red); }
.result-card.navy { background: var(--navy-tint); color: var(--navy); }
.result-card.navy .result-value { color: var(--navy); }
.result-card.gold { background: var(--gold-tint); color: var(--gold); }
.result-card.gold .result-value { color: var(--gold); }

/* Bar comparison block */
.bar-block {
  padding: 18px 22px;
  border-radius: var(--radius-md);
  background: var(--cream-bg);
  border: 1px solid var(--cream-line);
  margin-bottom: 14px;
}
.bar-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 12px;
  font-size: 0.92rem; color: var(--ink-soft);
}
.bar-row strong {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--ink);
  font-weight: 500;
  font-variation-settings: "opsz" 48;
  font-variant-numeric: tabular-nums;
}
.bar-track {
  height: 12px;
  background: var(--cream-line);
  border-radius: var(--radius-pill);
  overflow: hidden;
  display: flex;
}
.bar-track.tall { height: 32px; }
.bar-fill {
  transition: width 350ms var(--ease);
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
}
.bar-fill.green { background: var(--green); }
.bar-fill.red { background: var(--red); }
.bar-fill.navy { background: var(--navy); }
.bar-fill.gold { background: var(--gold); }
.bar-fill.cream {
  background: var(--cream-line);
  color: var(--ink-mute);
}
.bar-legend {
  display: flex; justify-content: space-between;
  margin-top: 8px;
  font-size: 0.78rem; color: var(--ink-mute);
}

/* Highlight banner under results */
.highlight-banner {
  padding: 18px 22px;
  border-radius: var(--radius-md);
  background: var(--cream-bg);
  border: 1px solid var(--cream-line);
  border-left: 3px solid var(--gold);
  margin-top: 12px;
}
.highlight-banner .highlight-row {
  display: flex; justify-content: space-between; align-items: baseline;
}
.highlight-banner .highlight-label { color: var(--ink-soft); font-size: 0.92rem; }
.highlight-banner .highlight-value {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--ink);
  font-variation-settings: "opsz" 48;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.highlight-banner .highlight-sub {
  font-size: 0.85rem;
  color: var(--ink-mute);
  margin-top: 8px;
  line-height: 1.45;
}

/* Notes */
.calc-note {
  font-size: 0.82rem;
  color: var(--ink-mute);
  line-height: 1.55;
  margin-top: 16px;
}

/* ---------- Email capture form ---------- */
.email-capture {
  background: var(--ink);
  color: var(--cream-bg);
  padding: 40px 36px;
  border-radius: var(--radius-lg);
  margin-top: 48px;
}
.email-capture h3 {
  color: var(--cream-bg);
  margin-bottom: 8px;
}
.email-capture p {
  color: rgba(250, 246, 236, 0.75);
  margin-bottom: 20px;
}
.email-form {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.email-form input[type="email"] {
  flex: 1;
  min-width: 220px;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(250, 246, 236, 0.2);
  background: rgba(250, 246, 236, 0.05);
  color: var(--cream-bg);
  font-size: 0.95rem;
}
.email-form input[type="email"]::placeholder { color: rgba(250, 246, 236, 0.5); }
.email-form input[type="email"]:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(250, 246, 236, 0.1);
}
.email-form button {
  padding: 12px 24px;
  background: var(--gold);
  color: var(--ink);
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform var(--duration) var(--ease), background var(--duration) var(--ease);
}
.email-form button:hover { background: var(--gold-soft); transform: translateY(-1px); }
.email-form-tiny {
  font-size: 0.78rem;
  color: rgba(250, 246, 236, 0.5);
  margin-top: 12px;
}

/* ---------- Books showcase ---------- */
.books-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 32px;
}
@media (max-width: 720px) { .books-row { grid-template-columns: 1fr; } }
.book {
  display: flex; gap: 20px;
  padding: 24px;
  background: var(--cream-bg-alt);
  border: 1px solid var(--cream-line);
  border-radius: var(--radius-lg);
}
.book-cover {
  width: 90px; height: 130px;
  background: var(--navy);
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  color: var(--cream-bg);
  font-family: var(--serif);
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  padding: 12px 8px;
  flex-shrink: 0;
  font-variation-settings: "opsz" 9;
  position: relative;
  box-shadow: var(--shadow-md);
}
.book-cover.gold { background: var(--gold); color: var(--ink); }
.book h4 {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ink);
  font-variation-settings: "opsz" 48;
}
.book p {
  font-size: 0.9rem;
  margin-bottom: 8px;
  color: var(--ink-soft);
}

/* ---------- Author bio block ---------- */
.author-block {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 720px) {
  .author-block { grid-template-columns: 1fr; gap: 24px; }
}
.author-photo {
  width: 200px; height: 200px;
  border-radius: 50%;
  background: var(--navy-tint);
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 5rem;
  color: var(--navy);
  font-weight: 500;
  font-variation-settings: "opsz" 144;
}

/* ---------- Hairline divider ---------- */
.hairline {
  height: 1px;
  background: var(--cream-line);
  border: none;
  margin: 32px 0;
}
.hairline-gold {
  height: 1px;
  background: var(--gold);
  border: none;
  width: 60px;
  margin: 24px 0;
}

/* ---------- Misc ---------- */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 32px; }
.mt-4 { margin-top: 32px; }

/* ---------- Animation: page load fade ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeUp 600ms var(--ease) both; }
.fade-in-2 { animation: fadeUp 600ms var(--ease) 100ms both; }
.fade-in-3 { animation: fadeUp 600ms var(--ease) 200ms both; }
@media (prefers-reduced-motion: reduce) {
  .fade-in, .fade-in-2, .fade-in-3 { animation: none; }
  * { transition: none !important; }
}
