/* ---------------------------------------------------------------------------------------------
 * LibelulaBot — the one place colour, type and the shared primitives are decided.
 *
 * Linked by every page, so the landing page and the legal pages cannot drift apart. That drift is
 * what the previous version was already starting to do: two stylesheets, two palettes, no link
 * between them.
 *
 * The palette is a dragonfly's wing — cyan through indigo and violet to pink. It is used for
 * *accent*: headings, numerals, edges, glows. Body text stays near-black on near-white in both
 * themes, because a bright site that is hard to read is not a brighter site.
 *
 * No web fonts. The privacy page tells sellers that nothing about them goes to a third party, and
 * hot-linking Google Fonts would send every visitor's IP to Google and make that sentence untrue.
 * If a display face is wanted later, self-host it.
 * ------------------------------------------------------------------------------------------ */

:root {
  /* Wing ramp */
  --c-cyan: #06b6d4;
  --c-blue: #3b82f6;
  --c-indigo: #6366f1;
  --c-violet: #8b5cf6;
  --c-pink: #ec4899;
  --c-amber: #f59e0b;

  --grad-wing: linear-gradient(120deg, var(--c-cyan), var(--c-indigo) 45%, var(--c-violet) 70%, var(--c-pink));
  --grad-action: linear-gradient(135deg, #7c3aed, #2563eb);

  /* Surfaces and ink */
  --bg: #fcfcfe;
  --panel: #ffffff;
  --panel-2: #f6f7fb;
  --ink: #131826;
  --muted: #5b6478;
  --line: #e6e8f0;
  --line-strong: #d3d7e4;

  --accent: #6d28d9;
  --accent-ink: #ffffff;
  --link: #6d28d9;

  --warn-bg: #fff8ec;
  --warn-line: #f5d9a8;
  --warn-ink: #7a4d06;

  --shadow-sm: 0 1px 2px rgba(19, 24, 38, 0.06), 0 2px 8px rgba(19, 24, 38, 0.04);
  --shadow-md: 0 4px 12px rgba(19, 24, 38, 0.07), 0 16px 40px rgba(19, 24, 38, 0.07);

  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 1100px;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0a0d16;
    --panel: #141a29;
    --panel-2: #1b2234;
    --ink: #e9ecf6;
    --muted: #9aa4bd;
    --line: #262e42;
    --line-strong: #333d55;

    --accent: #a78bfa;
    --accent-ink: #14091f;
    --link: #a78bfa;

    --warn-bg: #241c0f;
    --warn-line: #4d3c1c;
    --warn-ink: #f0d093;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.55);

    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #0a0d16;
  --panel: #141a29;
  --panel-2: #1b2234;
  --ink: #e9ecf6;
  --muted: #9aa4bd;
  --line: #262e42;
  --line-strong: #333d55;
  --accent: #a78bfa;
  --accent-ink: #14091f;
  --link: #a78bfa;
  --warn-bg: #241c0f;
  --warn-line: #4d3c1c;
  --warn-ink: #f0d093;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* ---------------------------------------------------------------------------------------------
 * Base
 * ------------------------------------------------------------------------------------------ */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: 20px; }

/**
 * Anchored sections clear the sticky header. Without this the nav links land with the section's
 * eyebrow and heading tucked underneath it — which is how every "Cómo funciona" click arrived
 * before this line existed.
 */
section[id],
[id]:target { scroll-margin-top: 86px; }

html { scroll-behavior: smooth; }
/**
 * Narrow phones. Everything above is fluid — auto-fit grids, flex-wrap, clamp() type — so this is
 * only the handful of places a fixed size could still push the page sideways.
 */
@media (max-width: 430px) {
  .wrap { padding-inline: 16px; }
  .btn { padding: 12px 20px; }
  .cta-row .btn { flex: 1 1 auto; justify-content: center; }
  .brand { font-size: 1rem; }
  .card { padding: 20px; }
}

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

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.025em; margin: 0 0 0.5em; font-weight: 680; }
h1 { font-size: clamp(2.1rem, 5.4vw, 3.6rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.25rem); }
h3 { font-size: 1.08rem; font-weight: 650; }
p { margin: 0 0 1em; }

/** Gradient type. Always paired with a solid colour first, so a browser that can't clip still reads. */
.wing-text {
  color: var(--accent);
  background: var(--grad-wing);
  -webkit-background-clip: text;
  background-clip: text;
}
@supports (-webkit-background-clip: text) or (background-clip: text) {
  .wing-text { color: transparent; }
}

.lede { font-size: clamp(1.06rem, 2.1vw, 1.25rem); color: var(--muted); max-width: 60ch; }

/* ---------------------------------------------------------------------------------------------
 * Primitives
 * ------------------------------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--grad-action);
  color: #fff;
  padding: 13px 26px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 620;
  border: 1px solid transparent;
  box-shadow: 0 6px 20px rgba(109, 40, 217, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(109, 40, 217, 0.36); }

.btn.ghost {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.btn.ghost:hover { box-shadow: var(--shadow-md); }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card > :last-child { margin-bottom: 0; }

/** A coloured edge along the top. Each card in a row takes a different hue from the ramp. */
.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--card-accent, var(--grad-wing));
}

.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 560;
  box-shadow: var(--shadow-sm);
}
.pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--grad-wing);
  flex: none;
}
/* On a narrow phone this label is longer than the screen; let it wrap rather than push the page. */
.pill { max-width: 100%; flex-wrap: wrap; }

.callout {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn-ink);
  border-radius: var(--radius);
  padding: 24px 26px;
}
.callout h3 { margin-top: 0; color: inherit; }
.callout > :last-child { margin-bottom: 0; }
.callout strong { color: inherit; }

/* ---------------------------------------------------------------------------------------------
 * Header and footer, shared by every page
 * ------------------------------------------------------------------------------------------ */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 18px; padding-block: 13px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.06rem;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  background: var(--grad-wing);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.brand-mark svg { width: 20px; height: 20px; }

.site-head nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.site-head nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 540;
  padding: 7px 12px;
  border-radius: 8px;
}
.site-head nav a:hover { color: var(--ink); background: var(--panel-2); }
.site-head nav a.btn { color: #fff; padding: 9px 18px; }
.site-head nav a.btn:hover { color: #fff; background: var(--grad-action); }

.site-foot {
  border-top: 1px solid var(--line);
  padding-block: 34px;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 40px;
}
.site-foot .wrap { display: flex; gap: 14px 26px; flex-wrap: wrap; align-items: center; }
.site-foot a { color: var(--muted); text-decoration: none; }
.site-foot a:hover { color: var(--ink); }
.site-foot .spacer { margin-left: auto; }

@media (max-width: 560px) {
  .site-head nav a:not(.btn) { display: none; }
  .site-foot .spacer { margin-left: 0; flex-basis: 100%; }
}

/**
 * Narrow phones. Everything above is fluid — auto-fit grids, flex-wrap, clamp() type — so this is
 * only the handful of places a fixed size could still push the page sideways.
 */
@media (max-width: 430px) {
  .wrap { padding-inline: 16px; }
  .btn { padding: 12px 20px; }
  .cta-row .btn { flex: 1 1 auto; justify-content: center; }
  .brand { font-size: 1rem; }
  .card { padding: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .card:hover, .btn:hover { transform: none; }
}
