/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  /* Always white / black — professional, fixed regardless of system theme. */
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f6f6f6;
  --border: #e2e2e2;
  --text: #0a0a0a;
  --text-soft: #545454;
  --accent: #d9642c;
  --accent-ink: #ffffff;
  --ok: #197a3d;
  --ok-bg: #eaf7ee;
  --bad: #b5342a;
  --bad-bg: #fbeae8;
  --info: #1d4ed8;
  --info-bg: #eaf0fd;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px -12px rgba(0, 0, 0, .16);
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --header-h: 64px;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
input, select { font: inherit; color: inherit; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { font-family: var(--display); text-wrap: balance; line-height: 1.12; letter-spacing: -0.01em; font-weight: 600; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: 100%; max-width: 1080px; margin-inline: auto; padding-inline: 1.1rem; }

.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--text); color: var(--bg);
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Header / footer
   ============================================================= */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky; top: 0; z-index: 40;
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: .5rem; font-family: var(--display); font-weight: 700; font-size: 1.15rem; }
.brand-mark { color: var(--accent); font-size: 1.3rem; }
.site-nav { display: none; gap: 1.5rem; font-size: .92rem; font-weight: 500; color: var(--text-soft); }
.site-nav a:hover { color: var(--text); }
@media (min-width: 720px) { .site-nav { display: flex; } }

.site-footer { border-top: 1px solid var(--border); padding-block: 2rem; margin-top: 3rem; color: var(--text-soft); font-size: .88rem; }
.footer-row { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.footer-nav { display: flex; gap: 1.2rem; }
.footer-nav a:hover { color: var(--text); }
.footer-credits { margin-top: .8rem; font-size: .78rem; opacity: .75; }

/* =============================================================
   4. Hero
   ============================================================= */
.hero { padding-block: 2.4rem 1.4rem; text-align: center; }
.hero h1 { font-size: clamp(1.9rem, 5vw, 2.9rem); max-width: 20ch; margin-inline: auto; }
.hero-sub { margin-top: .9rem; font-size: clamp(1rem, 2vw, 1.15rem); color: var(--text-soft); max-width: 46ch; margin-inline: auto; }

/* =============================================================
   5. Tool card
   ============================================================= */
.tool-wrap { padding-bottom: 1.4rem; }
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.2rem;
}
@media (min-width: 720px) { .tool-card { padding: 1.8rem; } }

.js-warning { padding: 1rem; background: var(--bad-bg); color: var(--bad); border-radius: var(--radius-sm); }

.tool-grid { display: grid; gap: 1.6rem; }
@media (min-width: 960px) { .tool-grid { grid-template-columns: 1.05fr 1fr; gap: 2.2rem; } }

.tool-col { display: flex; flex-direction: column; gap: 1.2rem; }
.tool-col-preview { display: flex; flex-direction: column; }

.field-group { display: flex; flex-direction: column; gap: .5rem; }
.field-label { font-size: .82rem; font-weight: 600; color: var(--text-soft); }
.field-input {
  width: 100%; padding: .68rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: .96rem;
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.field-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.field-input-sm { padding: .5rem .6rem; font-size: .88rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.field-row-tight { align-items: end; }
.field-checkbox { display: flex; align-items: center; gap: .5rem; font-size: .9rem; padding-bottom: .6rem; }

.mode-tabs { display: flex; gap: .4rem; background: var(--surface-2); padding: .3rem; border-radius: var(--radius-sm); width: fit-content; }
.mode-tab { padding: .5rem 1rem; border-radius: 7px; font-size: .88rem; font-weight: 600; color: var(--text-soft); }
.mode-tab.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.mode-panel { margin-top: .9rem; display: flex; flex-direction: column; gap: .8rem; }
.mode-panel.is-hidden { display: none; }

.style-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .55rem; }
@media (min-width: 540px) { .style-grid { grid-template-columns: repeat(4, 1fr); } }
.style-btn {
  padding: .6rem .5rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .84rem; font-weight: 600; text-align: center; transition: all .16s var(--ease-out);
}
.style-btn:hover { border-color: var(--accent); }
.style-btn.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

.color-pick { display: flex; align-items: center; gap: .55rem; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .4rem .6rem; }
.color-pick input[type="color"] { width: 34px; height: 34px; border: 0; border-radius: 8px; padding: 0; background: none; cursor: pointer; }
.color-hex { font-family: var(--mono); font-size: .82rem; color: var(--text-soft); }

.center-picker { display: flex; flex-direction: column; gap: .7rem; }
.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .35rem; }
@media (min-width: 540px) { .emoji-grid { grid-template-columns: repeat(9, 1fr); } }
.emoji-btn {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; border-radius: var(--radius-sm); border: 1px solid var(--border);
  transition: all .14s var(--ease-out);
}
.emoji-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.emoji-btn.is-active { background: var(--accent); border-color: var(--accent); }
.center-actions { display: flex; gap: .6rem; align-items: center; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .75rem 1.2rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .92rem;
  transition: transform .14s var(--ease-out), background .14s var(--ease-out), border-color .14s var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-soft); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn-sm { padding: .5rem .85rem; font-size: .82rem; }
.btn-lg { padding: .9rem 1.4rem; font-size: 1rem; flex: 1 1 auto; }
.btn:disabled { opacity: .6; cursor: default; transform: none; }

/* Preview 2D */
.preview-2d {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.2rem; min-height: 260px;
}
.qr-canvas-wrap { line-height: 0; }
.qr-canvas-wrap canvas, .qr-canvas-wrap svg { max-width: 100%; height: auto; border-radius: 6px; }
.dl-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-top: .9rem; }
.dl-size { flex: 0 0 auto; }

/* Divider */
.divider { display: flex; align-items: center; gap: .8rem; margin-block: 1.8rem; color: var(--text-soft); font-size: .85rem; font-weight: 600; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.tool-grid-3d { margin-top: 0; }

.format-grid { display: flex; flex-direction: column; gap: .55rem; }
.format-btn {
  display: flex; flex-direction: column; gap: .2rem; text-align: left;
  padding: .75rem .9rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: all .16s var(--ease-out);
}
.format-btn:hover { border-color: var(--accent); }
.format-btn.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.format-btn-title { font-weight: 700; font-size: .92rem; }
.format-btn-desc { font-size: .8rem; color: var(--text-soft); }

.warnings { display: flex; flex-direction: column; gap: .45rem; }
.warn { padding: .55rem .75rem; border-radius: var(--radius-sm); font-size: .84rem; }
.warn-ok { background: var(--ok-bg); color: var(--ok); }
.warn-bad { background: var(--bad-bg); color: var(--bad); }
.warn-info { background: var(--info-bg); color: var(--info); }

.preview-3d {
  flex: 1; display: flex; flex-direction: column; gap: .5rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .8rem; min-height: 300px;
}
.viewer3d { flex: 1; min-height: 260px; border-radius: 10px; overflow: hidden; position: relative; touch-action: none; }
.viewer3d canvas { width: 100%; height: 100%; display: block; }
.viewer3d-hint {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 1rem; font-size: .85rem; color: var(--text-soft); background: var(--surface-2);
}
.viewer3d[data-status="ready"] .viewer3d-hint { display: none; }
.viewer3d-tip { text-align: center; font-size: .76rem; color: var(--text-soft); }

.privacy-badge { margin-top: 1.4rem; padding: .8rem 1rem; background: var(--surface-2); border-radius: var(--radius-sm); font-size: .84rem; color: var(--text-soft); }

/* =============================================================
   6. Ad slots
   ============================================================= */
.ad-slot {
  min-height: 90px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  margin-block: 1.6rem; background: var(--surface-2); position: relative;
}
.ad-slot-label { font-size: .72rem; letter-spacing: .12em; font-weight: 700; color: var(--text-soft); text-transform: uppercase; }
.ad-slot-leaderboard { min-height: 100px; }
.ad-slot-incontent { min-height: 250px; max-width: 728px; margin-inline: auto; }
.ad-slot-dialog { min-height: 250px; width: min(100%, 300px); margin-inline: auto; }

/* =============================================================
   7. Contenido (cómo funciona, ideas, seo, faq)
   ============================================================= */
.content-section { padding-block: 2.4rem; }
.content-section h2 { font-size: clamp(1.5rem, 3.4vw, 2rem); margin-bottom: 1.4rem; text-align: center; }
.content-section-alt { background: var(--surface-2); }

.steps-grid { display: grid; gap: 1.2rem; }
@media (min-width: 720px) { .steps-grid { grid-template-columns: repeat(3, 1fr); } }
.step-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-family: var(--display);
  margin-bottom: .8rem;
}
.step-card h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.step-card p { color: var(--text-soft); font-size: .92rem; }

.ideas-grid { display: grid; gap: 1rem; }
@media (min-width: 540px) { .ideas-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .ideas-grid { grid-template-columns: repeat(3, 1fr); } }
.idea-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.idea-emoji { font-size: 1.6rem; display: block; margin-bottom: .5rem; }
.idea-card h3 { font-size: 1rem; margin-bottom: .3rem; }
.idea-card p { color: var(--text-soft); font-size: .88rem; }

.seo-copy { max-width: 760px; }
.seo-copy p { margin-top: .9rem; color: var(--text-soft); }
.seo-copy h2 { text-align: left; }

.faq-list { display: flex; flex-direction: column; gap: .7rem; max-width: 760px; margin-inline: auto; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .95rem 1.1rem; }
.faq-item summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; color: var(--accent); font-size: 1.2rem; flex-shrink: 0; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin-top: .7rem; color: var(--text-soft); font-size: .92rem; }

/* =============================================================
   8. Dialog interstitial + aviso de esquina
   ============================================================= */
.download-dialog {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.4rem;
  max-width: min(92vw, 380px); background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.download-dialog::backdrop { background: rgba(20, 17, 10, .55); }
.dialog-close {
  position: absolute; top: .7rem; right: .7rem; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--surface-2);
}
.dialog-cta { margin-top: 1rem; width: 100%; }

.corner-toast {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 50;
  width: min(88vw, 280px); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 2rem .9rem .9rem;
}
.corner-toast-close {
  position: absolute; top: .5rem; right: .5rem; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--surface-2); font-size: .8rem;
}

/* =============================================================
   9. Reduced motion — solo lo intrusivo
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .viewer3d { touch-action: none; }
}
