/* =============================================================
   Tipografias servidas desde este mismo dominio, no desde Google.
   Inter y Space Grotesk - SIL Open Font License 1.1
   ============================================================= */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('assets/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('assets/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('assets/fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* =============================================================
   QR3D — hoja de estilos única
   1 Tokens · 2 Reset · 3 Utilidades · 4 Tipografía · 5 Componentes
   6 Herramienta · 7 Secciones · 8 Anuncios · 9 Responsive · 10 Motion
   ============================================================= */

/* ============================ 1. Tokens ====================== */
:root {
  --bg: #f6f6fa;
  --surface: #ffffff;
  --surface-2: #fbfbfe;
  --ink: #15151f;
  --ink-2: #3d3d4d;
  --muted: #6d6d80;
  --line: #e5e5ef;
  --line-2: #d5d5e4;
  --accent: #5546ff;
  --accent-ink: #ffffff;
  --accent-soft: #eeecff;
  --warn: #b45309;
  --warn-soft: #fff6e6;
  --danger: #c0392b;
  --danger-soft: #fdeeec;
  --ok: #17795e;
  --ok-soft: #e8f6f1;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", var(--sans);

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --maxw: 1180px;
  --shadow: 0 1px 2px rgba(20, 20, 40, .05), 0 12px 32px -14px rgba(20, 20, 40, .18);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e14;
    --surface: #17171f;
    --surface-2: #1c1c26;
    --ink: #f2f2f7;
    --ink-2: #cfcfdc;
    --muted: #9a9ab0;
    --line: #292935;
    --line-2: #35354a;
    --accent: #8b7dff;
    --accent-ink: #12121a;
    --accent-soft: #23213a;
    --warn: #f0b45e;
    --warn-soft: #2c2415;
    --danger: #ff8b7d;
    --danger-soft: #2e1a18;
    --ok: #63d6b3;
    --ok-soft: #142b26;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5), 0 14px 34px -16px rgba(0, 0, 0, .8);
  }
}

/* ============================ 2. Reset ======================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
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 { text-wrap: balance; line-height: 1.12; letter-spacing: -.02em; font-family: var(--display); font-weight: 700; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ============================ 3. Utilidades ================== */
.wrap { width: min(100% - (var(--gutter) * 2), var(--maxw)); margin-inline: auto; }
.muted-sm { color: var(--muted); font-weight: 400; font-size: .875rem; font-family: var(--sans); letter-spacing: 0; }
.hint { color: var(--muted); font-size: .85rem; margin-top: .5rem; }
.skip-link { position: fixed; top: -100px; left: 1rem; z-index: 999; padding: .6rem 1rem; background: var(--accent); color: var(--accent-ink); border-radius: var(--r-s); }
.skip-link:focus { top: 1rem; }

/* ============================ 4. Cabecera / tipografía ======= */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 60px; }
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; }
.brand-mark { width: 24px; height: 24px; fill: var(--accent); }
.site-nav { display: flex; gap: 1.25rem; font-size: .92rem; color: var(--ink-2); }
.site-nav a { padding: .25rem 0; border-bottom: 1px solid transparent; }
.site-nav a:hover { border-bottom-color: var(--accent); }

.hero { padding: clamp(1rem, 5vw, 3rem) 0 clamp(1rem, 2.5vw, 1.5rem); text-align: center; }
.eyebrow { display: inline-block; font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: .28rem .65rem; border-radius: 100px; font-weight: 600; }
.hero h1 { font-size: clamp(1.65rem, 5.2vw, 3.1rem); margin: .65rem 0 .5rem; }
.lede { color: var(--ink-2); font-size: clamp(.95rem, 2.2vw, 1.12rem); max-width: 62ch; margin-inline: auto; }

/* ============================ 5. Componentes ================= */
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .1rem; padding: .7rem 1.1rem; border-radius: var(--r-m);
  font-weight: 600; font-size: .95rem; text-align: center;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  transition: transform .18s var(--ease-out), background .18s var(--ease-out), border-color .18s var(--ease-out);
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn:disabled { opacity: .5; cursor: progress; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); padding: .85rem 1.25rem; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 86%, #000); }
.btn-sub { font-weight: 400; font-size: .76rem; opacity: .85; }
.btn-small { font-size: .85rem; padding: .5rem .8rem; }
.btn-ghost { background: var(--surface-2); }
.file-btn { cursor: pointer; }

.field { display: block; }
.field-label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin: 0 0 .35rem; }
.field input[type="text"], .field select, input[type="text"], select {
  width: 100%; padding: .7rem .85rem; border: 1px solid var(--line-2);
  border-radius: var(--r-m); background: var(--surface-2); color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field.check { display: flex; align-items: center; gap: .5rem; align-self: end; padding-bottom: .55rem; }
.field.check input { width: auto; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }

/* ============================ 6. Herramienta ================= */
.noscript-note { background: var(--warn-soft); color: var(--warn); border: 1px solid currentColor; border-radius: var(--r-m); padding: .9rem 1rem; margin-bottom: 1rem; }

.tool-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-l); box-shadow: var(--shadow);
  padding: clamp(1rem, 3vw, 1.6rem);
}
.tool-head { padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.tabs { display: inline-flex; gap: .25rem; padding: .25rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 100px; margin-bottom: .9rem; }
.tab { padding: .4rem .95rem; border-radius: 100px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.tab.is-active { background: var(--accent); color: var(--accent-ink); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.chip { font-size: .82rem; padding: .35rem .7rem; border: 1px solid var(--line-2); border-radius: 100px; background: var(--surface-2); color: var(--ink-2); }
.chip:hover { border-color: var(--accent); color: var(--accent); }

.tool-body { display: grid; gap: 1.6rem; padding-top: 1.2rem; }
.block-title { font-size: .95rem; font-family: var(--display); font-weight: 700; margin-bottom: .6rem; }
.preview-block + .preview-block { margin-top: 1.4rem; }

.qr-stage {
  display: grid; place-items: center; padding: 1rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-m);
  min-height: 232px;
}
#qr-preview canvas, #qr-preview svg { width: 200px !important; height: 200px !important; border-radius: 6px; }

.viewer {
  position: relative; width: 100%; aspect-ratio: 4 / 3; min-height: 240px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-m);
  overflow: hidden; touch-action: none;
}
.viewer canvas { width: 100%; height: 100%; display: block; }
.viewer-msg {
  position: absolute; inset: 0; display: grid; place-items: center;
  padding: 1.2rem; text-align: center; color: var(--muted); font-size: .9rem;
}
.viewer-msg[hidden] { display: none; }

.dl-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: stretch; margin-top: .75rem; }
.dl-row select { width: auto; padding: .5rem .6rem; font-size: .85rem; }
.dl-main { flex-direction: column; }
.dl-main .btn-primary { width: 100%; }

.warnings { display: grid; gap: .4rem; margin-top: .7rem; }
.warn-item { font-size: .85rem; padding: .5rem .7rem; border-radius: var(--r-s); border: 1px solid transparent; display: flex; gap: .45rem; }
.warn-item.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.warn-item.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.warn-item.bad { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }

.control-group + .control-group { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.control-group .field-label { margin-top: .9rem; }
.control-group .field-label:first-of-type { margin-top: 0; }

.opt-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.opt { padding: .45rem .8rem; font-size: .87rem; font-weight: 600; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface-2); color: var(--ink-2); }
.opt.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.color-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.swatch { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--ink-2); cursor: pointer; }
.swatch input[type="color"] { width: 42px; height: 34px; padding: 2px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface-2); cursor: pointer; }
.btn-swap { width: 34px; height: 34px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--surface-2); font-size: 1rem; }
.btn-swap:hover { border-color: var(--accent); color: var(--accent); }
.pairs { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.pair { width: 34px; height: 24px; border-radius: 6px; border: 1px solid var(--line-2); overflow: hidden; display: flex; }
.pair span { flex: 1; }
.pair:hover, .pair.is-active { outline: 2px solid var(--accent); outline-offset: 1px; }

.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: .3rem; }
.emoji-btn { aspect-ratio: 1; display: grid; place-items: center; font-size: 1.15rem; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface-2); line-height: 1; }
.emoji-btn:hover { border-color: var(--accent); }
.emoji-btn.is-active { border-color: var(--accent); background: var(--accent-soft); }
.center-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }

.format-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .3rem; }
.format { display: grid; justify-items: center; gap: .15rem; padding: .8rem .4rem; text-align: center; border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--surface-2); }
.format svg { width: 30px; height: 30px; color: var(--muted); }
.format strong { font-size: .84rem; }
.format span { font-size: .73rem; color: var(--muted); }
.format.is-active { border-color: var(--accent); background: var(--accent-soft); }
.format.is-active svg { color: var(--accent); }

.privacy-badge { margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .87rem; color: var(--ink-2); }

/* ============================ 7. Secciones =================== */
.section { padding: clamp(2.5rem, 7vw, 4rem) 0; }
.section > h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); margin-bottom: .6rem; }
.section-lede { color: var(--muted); max-width: 60ch; margin-bottom: 1.6rem; }

.steps { list-style: none; padding: 0; display: grid; gap: 1rem; margin-top: 1.6rem; }
.steps li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 1.4rem; }
.step-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-family: var(--display); font-weight: 700; margin-bottom: .7rem; }
.steps h3 { font-size: 1.1rem; margin-bottom: .35rem; }
.steps p { color: var(--ink-2); font-size: .95rem; }

.prose { max-width: 72ch; }
.prose h2 { font-size: clamp(1.4rem, 3.4vw, 1.9rem); margin-bottom: .8rem; }
.prose h3 { font-size: 1.12rem; margin: 1.6rem 0 .5rem; }
.prose p { color: var(--ink-2); margin-bottom: .9rem; }
.tips { color: var(--ink-2); padding-left: 1.1rem; display: grid; gap: .45rem; }

.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; }
.idea { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 1.2rem; }
.idea-emoji { font-size: 1.5rem; line-height: 1; }
.idea h3 { font-size: 1rem; margin: .55rem 0 .3rem; }
.idea p { font-size: .9rem; color: var(--ink-2); }

.faq { display: grid; gap: .5rem; max-width: 78ch; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); padding: .9rem 1.1rem; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin-top: .6rem; color: var(--ink-2); font-size: .93rem; }

.site-footer { border-top: 1px solid var(--line); padding: 2.2rem 0 2.6rem; margin-top: 1rem; background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: space-between; align-items: start; }
.footer-inner p { max-width: 44ch; margin-top: .3rem; }
.site-footer nav { display: flex; gap: 1rem; font-size: .9rem; color: var(--ink-2); }
.site-footer nav a:hover { color: var(--accent); }
.credits { margin-top: 1.4rem; font-size: .78rem; }

/* ============================ 8. Anuncios (placeholders) ===== */
/* Los huecos reservan altura aunque el anuncio tarde o no se rellene,
   para que el contenido no dé saltos al cargar. */
.ad-slot { position: relative; color: var(--muted); }
.ad-slot .adsbygoogle, .ad-unit .adsbygoogle { display: block; width: 100%; }
.ad-tag {
  display: block; font-size: .62rem; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 600; color: var(--muted); text-align: center; margin-bottom: .3rem;
}
.ad-leaderboard { min-height: 100px; margin: .5rem 0 1rem; }
.ad-incontent { min-height: 260px; max-width: 360px; margin: 1.5rem auto; }

.ad-toast {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 60;
  width: min(300px, calc(100vw - 2rem)); min-height: 108px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-m);
  box-shadow: var(--shadow); padding: 1rem;
  transition: bottom .2s var(--ease-out);
}
.ad-toast[hidden] { display: none; }
.ad-toast-close { position: absolute; top: 2px; right: 6px; font-size: 1.15rem; line-height: 1; color: var(--muted); padding: .2rem .35rem; }
.ad-toast-close:hover { color: var(--ink); }


/* ---- Guías (páginas de contenido) ---- */
.guia { max-width: 74ch; padding: clamp(1.25rem, 4vw, 2.5rem) 0 3rem; }
.migas { font-size: .82rem; color: var(--muted); margin-bottom: .9rem; }
.migas a:hover { color: var(--accent); text-decoration: underline; }
.guia h1 { font-size: clamp(1.6rem, 4.4vw, 2.5rem); margin-bottom: .7rem; }
.guia .lede { margin: 0 0 2rem; text-align: left; }
.guia h2 { font-size: clamp(1.2rem, 3vw, 1.5rem); margin: 2.2rem 0 .7rem; }
.guia p { color: var(--ink-2); margin-bottom: .9rem; }
.guia code {
  font-family: ui-monospace, "SFMono-Regular", "JetBrains Mono", Consolas, monospace;
  font-size: .88em; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 5px; padding: .1em .35em; word-break: break-word;
}
.guia .tips { margin-bottom: 1rem; }

.cta-tool {
  margin: 2.5rem 0 1.5rem; padding: 1.5rem;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--r-l);
}
.cta-tool h2 { margin: 0 0 .5rem; font-size: 1.25rem; }
.cta-tool p { margin-bottom: 1.1rem; }

.otras-guias { margin-top: 2.5rem; }
.otras-guias h2 { font-size: 1.25rem; margin-bottom: 1rem; }
.idea h3 a:hover { color: var(--accent); }

/* ============================ 9. Responsive ================== */
@media (min-width: 540px) {
  .dl-main { flex-direction: row; align-items: center; }
  .dl-main .btn-primary { width: auto; flex: 1 1 220px; }
}
@media (min-width: 720px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .ad-incontent { max-width: 336px; }
}
@media (min-width: 960px) {
  .tool-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
  #qr-preview canvas, #qr-preview svg { width: 240px !important; height: 240px !important; }
  .qr-stage { min-height: 272px; }
}
@media (max-width: 539px) {
  .site-nav { display: none; }
  .ad-toast { right: .5rem; left: .5rem; bottom: .5rem; width: auto; min-height: 70px; padding: .6rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .format-row { grid-template-columns: 1fr; }
  .format { grid-template-columns: 34px 1fr; justify-items: start; align-items: center; column-gap: .7rem; text-align: left; }
  .format svg { grid-row: span 2; }
}

/* ============================ 10. Motion ===================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}
