/* =============================================================
   CalculaYa — styles.css
   1. Tokens  2. Reset  3. Utilities  4. Typography  5. Components
   6. Sections  7. Effects  8. Responsive  9. Reduced motion
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --ink: #14141f;
  --ink-soft: #4b4b5c;
  --ink-faint: #86869c;
  --bg: #faf9f6;
  --bg-alt: #f1efe9;
  --surface: #ffffff;
  --border: #e6e3da;
  --border-strong: #d3cfc0;

  --accent: #3f3ff0;
  --accent-ink: #ffffff;
  --accent-soft: #ecebff;
  --accent-dark: #2c2cc4;

  --amber: #eb8c17;
  --amber-soft: #fdf1de;

  --success: #12805c;
  --success-soft: #e4f5ee;
  --danger: #c8412f;
  --danger-soft: #fbeae7;

  --money: #0f9d6f;
  --math: #3f3ff0;
  --dates: #b3501f;
  --convert: #0c7bb3;
  --health: #c23a6b;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(20, 20, 31, 0.06);
  --shadow: 0 8px 24px rgba(20, 20, 31, 0.08);
  --shadow-lg: 0 20px 50px rgba(20, 20, 31, 0.12);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --container: 1180px;
  --nav-h: 68px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 2;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  overflow-x: clip;
}
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.12; letter-spacing: -0.02em; font-family: var(--display); }
ul, ol { list-style: none; padding: 0; }
::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .7rem 1.1rem; background: var(--ink); color: #fff;
  border-radius: 8px; font-weight: 600;
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: 1.25rem; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.section { padding-block: clamp(2.5rem, 5vw, 4.5rem); }
.section-tight { padding-block: clamp(1.5rem, 3vw, 2.5rem); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent);
}
.text-center { text-align: center; }
.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); font-size: .9rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.cluster { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* =============================================================
   4. Typography
   ============================================================= */
h1 { font-size: clamp(2rem, 4.4vw, 3.2rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); font-weight: 700; }
h3 { font-size: clamp(1.15rem, 1.8vw, 1.4rem); font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-soft); max-width: 62ch; }
.prose { max-width: 74ch; color: var(--ink-soft); }
.prose h2 { color: var(--ink); margin-top: 2rem; margin-bottom: .75rem; }
.prose h3 { color: var(--ink); margin-top: 1.5rem; margin-bottom: .5rem; }
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.4rem; list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .4rem; }
.prose strong { color: var(--ink); }
.prose code { font-family: var(--mono); background: var(--bg-alt); padding: .1em .4em; border-radius: 4px; font-size: .9em; }

/* =============================================================
   5. Components
   ============================================================= */

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background .18s var(--ease-out);
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { background: var(--surface); border: 1px solid var(--border-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-soft { background: var(--accent-soft); color: var(--accent-dark); }
.btn-soft:hover { background: var(--accent); color: #fff; }
.btn-sm { padding: .5rem .9rem; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-icon { width: 1.1em; height: 1.1em; flex: none; }

/* --- Nav --- */
.site-header {
  position: sticky; top: 0; z-index: 500;
  background: rgba(250, 249, 246, 0.86);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
@supports not (backdrop-filter: blur(1px)) {
  .site-header { background: var(--bg); }
}
.nav-row {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h); gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 700; font-size: 1.2rem; color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 1.05rem;
}
.brand-ya { color: var(--accent); }
.nav-links { display: none; align-items: center; gap: 1.75rem; }
.nav-links a { font-weight: 500; font-size: .95rem; color: var(--ink-soft); transition: color .15s var(--ease-out); position: relative; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--ink); }
.nav-links a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -22px; height: 2px; background: var(--accent);
}
.nav-actions { display: flex; align-items: center; gap: .75rem; }
.nav-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
}
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.mobile-nav {
  display: none; position: fixed; inset: var(--nav-h) 0 0 0; z-index: 490;
  background: var(--bg); overflow-y: auto;
  padding: 1.25rem 1.25rem 2.5rem;
}
.mobile-nav.is-open { display: block; }
.mobile-nav a {
  display: block; padding: .95rem .25rem; font-size: 1.1rem; font-weight: 600;
  border-bottom: 1px solid var(--border); color: var(--ink);
}
.mobile-nav a[aria-current="page"] { color: var(--accent); }

/* --- Breadcrumbs --- */
.breadcrumbs { padding-block: 1rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .85rem; color: var(--ink-faint); }
.breadcrumbs a { color: var(--ink-faint); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: .4rem; color: var(--border-strong); }
.breadcrumbs li[aria-current="page"] { color: var(--ink-soft); }

/* --- Search box --- */
.searchbox { position: relative; max-width: 560px; margin-inline: auto; }
.searchbox-input-wrap {
  display: flex; align-items: center; gap: .6rem;
  background: var(--surface); border: 1.5px solid var(--border-strong);
  border-radius: 999px; padding: .3rem .4rem .3rem 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.searchbox-input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.searchbox svg.search-icon { width: 20px; height: 20px; color: var(--ink-faint); flex: none; }
.searchbox input {
  flex: 1; border: 0; background: none; padding: .7rem 0; font-size: 1rem; outline: none;
}
.searchbox .btn { flex: none; }
.search-results {
  position: absolute; top: calc(100% + .6rem); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden; z-index: 60;
  display: none; max-height: 380px; overflow-y: auto;
}
.search-results.is-open { display: block; }
.search-results a {
  display: flex; align-items: center; gap: .75rem; padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border); font-size: .95rem;
}
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a.is-active { background: var(--bg-alt); }
.search-results .result-icon {
  width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem; flex: none;
}
.search-results .result-name { font-weight: 600; }
.search-results .result-desc { color: var(--ink-faint); font-size: .82rem; }
.search-empty { padding: 1.1rem; color: var(--ink-faint); font-size: .9rem; text-align: center; }

/* --- Cards --- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out), border-color .2s var(--ease-out);
}
a.tool-card { display: flex; flex-direction: column; gap: .9rem; height: 100%; }
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.tool-card .tool-icon {
  width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; background: var(--accent-soft); color: var(--accent-dark);
}
.tool-card[data-cat="dinero"] .tool-icon { background: color-mix(in srgb, var(--money) 14%, white); color: var(--money); }
.tool-card[data-cat="matematicas"] .tool-icon { background: color-mix(in srgb, var(--math) 12%, white); color: var(--math); }
.tool-card[data-cat="fechas"] .tool-icon { background: color-mix(in srgb, var(--dates) 14%, white); color: var(--dates); }
.tool-card[data-cat="conversiones"] .tool-icon { background: color-mix(in srgb, var(--convert) 12%, white); color: var(--convert); }
.tool-card[data-cat="salud"] .tool-icon { background: color-mix(in srgb, var(--health) 12%, white); color: var(--health); }
.tool-card h3 { font-size: 1.08rem; }
.tool-card p { color: var(--ink-soft); font-size: .92rem; flex: 1; }
.tool-card .tool-cta {
  display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .9rem; color: var(--accent);
}
.tool-card:hover .tool-cta { gap: .6rem; }

.cat-pill {
  display: inline-flex; align-items: center; gap: .4rem; padding: .5rem 1rem; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: .88rem;
  color: var(--ink-soft); transition: all .15s var(--ease-out);
}
.cat-pill:hover, .cat-pill.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.grid-tools { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
.category-block { margin-bottom: 2.75rem; }
.category-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.category-head h2 { display: flex; align-items: center; gap: .55rem; }

/* --- Tool page: calculator card --- */
.tool-shell { padding-block: clamp(1.5rem, 3vw, 2.25rem) 0; }
.tool-head { max-width: 74ch; margin-bottom: 1.5rem; }
.tool-head .lede { margin-top: .6rem; }

.calc-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: clamp(1.25rem, 3vw, 2rem);
}
.calc-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.5rem; }
.calc-tab {
  padding: .55rem 1rem; border-radius: 999px; font-weight: 600; font-size: .88rem;
  background: var(--bg-alt); color: var(--ink-soft); border: 1px solid transparent;
}
.calc-tab[aria-selected="true"] { background: var(--ink); color: #fff; }

.field-grid { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .45rem; }
.field label { font-weight: 600; font-size: .88rem; color: var(--ink); }
.field .hint { font-size: .78rem; color: var(--ink-faint); }
.input, select.input {
  width: 100%; padding: .8rem .95rem; border-radius: var(--radius-sm); border: 1.5px solid var(--border-strong);
  background: var(--bg); font-size: 1rem; transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.input:focus, select.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.input.is-invalid { border-color: var(--danger); background: var(--danger-soft); }
.field-error { color: var(--danger); font-size: .82rem; font-weight: 600; display: none; }
.field-error.is-visible { display: block; }
.input-suffix-wrap { position: relative; }
.input-suffix-wrap .input { padding-right: 2.6rem; }
.input-suffix { position: absolute; right: .95rem; top: 50%; transform: translateY(-50%); color: var(--ink-faint); font-weight: 600; pointer-events: none; }

.radio-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.radio-chip {
  position: relative;
}
.radio-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radio-chip span {
  display: inline-flex; padding: .55rem 1rem; border-radius: 999px; border: 1.5px solid var(--border-strong);
  font-weight: 600; font-size: .86rem; color: var(--ink-soft); background: var(--surface);
  transition: all .15s var(--ease-out);
}
.radio-chip input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.radio-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.calc-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

.result-panel {
  margin-top: 1.75rem; padding: 1.5rem; border-radius: var(--radius); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, white);
  display: none;
}
.result-panel.is-visible { display: block; animation: resultIn .35s var(--ease-out); }
@keyframes resultIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.result-label { font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-dark); }
.result-value { font-family: var(--display); font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 700; color: var(--ink); margin-block: .3rem .5rem; }
.result-explain { color: var(--ink-soft); font-size: .95rem; }
.result-explain code { font-family: var(--mono); background: rgba(255,255,255,.6); padding: .1em .4em; border-radius: 4px; }
.result-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1rem; }
.result-stat { background: var(--surface); border-radius: var(--radius-sm); padding: 1rem; border: 1px solid var(--border); }
.result-stat .stat-label { font-size: .78rem; color: var(--ink-faint); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.result-stat .stat-value { font-family: var(--display); font-size: 1.4rem; font-weight: 700; margin-top: .2rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.copy-feedback { font-size: .82rem; color: var(--success); font-weight: 600; margin-left: .3rem; opacity: 0; transition: opacity .2s; }
.copy-feedback.is-visible { opacity: 1; }

.error-banner {
  display: none; margin-top: 1.25rem; padding: 1rem 1.1rem; border-radius: var(--radius-sm);
  background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 30%, white);
  color: #7a2318; font-size: .9rem; font-weight: 500;
}
.error-banner.is-visible { display: block; }

.disclaimer {
  margin-top: 1.25rem; padding: 1rem 1.1rem; border-radius: var(--radius-sm);
  background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 35%, white);
  font-size: .85rem; color: #6b4712;
}
.disclaimer strong { color: #4d3305; }

.demo-badge {
  display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 700;
  color: #6b4712; background: var(--amber-soft); border: 1px solid color-mix(in srgb, var(--amber) 35%, white);
  padding: .3rem .7rem; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em;
}

.chart-wrap { margin-top: 1.5rem; }
.chart-wrap canvas { width: 100%; height: 260px; background: var(--surface); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: .8rem; font-size: .85rem; }
.chart-legend .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: .4rem; }

/* --- Privacy badge --- */
.privacy-note {
  display: flex; align-items: flex-start; gap: .6rem; margin-top: 1.25rem;
  font-size: .84rem; color: var(--ink-faint);
}
.privacy-note svg { width: 18px; height: 18px; flex: none; margin-top: .1rem; color: var(--success); }

/* --- Ad slots --- */
.ad-slot {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 100px; border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border-strong); background: var(--bg-alt);
  color: var(--ink-faint); font-size: .78rem; font-weight: 700; letter-spacing: .08em;
  padding: 1rem;
}
.ad-slot small { display: block; font-weight: 500; letter-spacing: 0; margin-top: .25rem; text-transform: none; font-size: .75rem; }
.ad-slot-leaderboard { min-height: 110px; margin-block: 2rem; }
.ad-slot-incontent { min-height: 120px; margin-block: 2.25rem; }
.ad-slot-sidebar { min-height: 250px; }
.ad-slot-section { min-height: 90px; margin-block: 2rem; }
.ad-slot-mobile { min-height: 90px; margin-block: 1.5rem; }
@media (min-width: 960px) { .ad-slot-mobile { display: none; } }
.ad-sidebar-sticky { position: sticky; top: calc(var(--nav-h) + 1.5rem); }

/* --- Two-column layout (calculator + sidebar ad) --- */
.tool-layout { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: start; }

/* --- FAQ --- */
.faq-list { display: flex; flex-direction: column; gap: .75rem; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.faq-item summary {
  padding: 1.1rem 1.3rem; font-weight: 600; cursor: pointer; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; font-size: 1.3rem; color: var(--accent); flex: none; font-weight: 400;
  transition: transform .2s var(--ease-out);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-answer { padding: 0 1.3rem 1.2rem; color: var(--ink-soft); font-size: .94rem; }

/* --- Related tools --- */
.related-tools { margin-top: 2.5rem; }

/* --- How-to steps --- */
.steps { display: grid; grid-template-columns: 1fr; gap: 1.1rem; margin-block: 1.25rem; }
.step { display: flex; gap: 1rem; align-items: flex-start; }
.step-num {
  width: 34px; height: 34px; border-radius: 10px; background: var(--ink); color: #fff; flex: none;
  display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700;
}
.step p { color: var(--ink-soft); font-size: .94rem; }
.step strong { color: var(--ink); display: block; margin-bottom: .15rem; }

/* --- Example box --- */
.example-box {
  background: var(--bg-alt); border-radius: var(--radius-sm); padding: 1.1rem 1.25rem;
  border-left: 4px solid var(--accent); margin-block: 1.1rem; font-size: .94rem;
}
.example-box strong { color: var(--ink); }

/* --- Formula box --- */
.formula-box {
  background: var(--ink); color: #fff; border-radius: var(--radius-sm); padding: 1.25rem 1.4rem;
  font-family: var(--mono); font-size: .95rem; overflow-x: auto; margin-block: 1.1rem;
}
.formula-box .formula-label { display: block; font-family: var(--sans); font-size: .75rem; text-transform: uppercase;
  letter-spacing: .06em; color: #b8b8ff; margin-bottom: .5rem; font-weight: 700; }

/* =============================================================
   6. Sections
   ============================================================= */

/* --- Hero --- */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(2rem, 4vw, 3rem); text-align: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .9rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border-strong); font-size: .82rem; font-weight: 600;
  color: var(--ink-soft); margin-bottom: 1.25rem; box-shadow: var(--shadow-sm);
}
.hero-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.hero h1 { max-width: 22ch; margin-inline: auto; }
.hero .lede { margin: 1rem auto 2rem; }
.hero-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 2.25rem; margin-top: 2.75rem; }
.hero-stat .num { font-family: var(--display); font-size: 1.7rem; font-weight: 700; color: var(--accent); }
.hero-stat .label { font-size: .82rem; color: var(--ink-faint); }

.quick-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; margin-top: 1.5rem; }
.quick-links a {
  font-size: .84rem; font-weight: 600; padding: .45rem .9rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink-soft);
}
.quick-links a:hover { color: var(--accent); border-color: var(--accent); }

/* --- Footer --- */
.site-footer { background: var(--ink); color: #cfcfe0; padding-block: 3rem 2rem; margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 2.25rem; padding-bottom: 2.25rem; }
.footer-brand .brand { color: #fff; }
.footer-brand p { margin-top: .85rem; font-size: .88rem; color: #a3a3ba; max-width: 34ch; }
.footer-col h4 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 1rem; }
.footer-col ul { display: flex; flex-direction: column; gap: .65rem; }
.footer-col a { font-size: .9rem; color: #b6b6cc; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); padding-top: 1.5rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; font-size: .82rem; color: #8d8da8;
}
.footer-bottom a { color: #8d8da8; }
.footer-bottom a:hover { color: #fff; }

/* --- Popup ad dialog --- */
.ad-popup {
  border: 0; border-radius: var(--radius-lg); padding: 0; max-width: 420px; width: calc(100% - 2rem);
  box-shadow: var(--shadow-lg);
}
.ad-popup::backdrop { background: rgba(20,20,31,.55); backdrop-filter: blur(2px); }
.ad-popup-inner { padding: 1.5rem; position: relative; }
.ad-popup-close {
  position: absolute; top: .8rem; right: .8rem; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--bg-alt); color: var(--ink-soft);
}
.ad-popup-close:hover { background: var(--border-strong); }
.ad-popup .ad-slot { min-height: 220px; margin-top: 1rem; }
.ad-popup h3 { margin-bottom: .3rem; }

/* --- Page hero (secondary pages) --- */
.page-hero { padding-block: clamp(2rem, 4vw, 3rem) 1rem; }
.page-hero h1 { max-width: 40ch; }
.page-hero .lede { margin-top: .75rem; max-width: 60ch; }

/* --- Filter bar (calculadoras page) --- */
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 2rem; }

/* --- Contact form (visual only, no backend — mailto fallback) --- */
.contact-form { display: grid; gap: 1.1rem; max-width: 560px; }

/* --- Simple content page --- */
.legal-page .prose h2:first-of-type { margin-top: 0; }

/* =============================================================
   7. Effects
   ============================================================= */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }
.reveal[data-split] { opacity: 1; transform: none; }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .field-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 720px) {
  .grid-tools { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .result-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 960px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
  .grid-tools { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr repeat(4, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1280px) {
  .grid-tools.featured { grid-template-columns: repeat(3, 1fr); }
}

/* =============================================================
   9. Reduced motion — only truly intrusive effects
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
