/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #1c1c22;
  --ink-soft: #55555f;
  --line: #e4e1d8;
  --accent: #b4501f;
  --accent-ink: #ffffff;
  --accent-soft: #f3e3d6;
  --success: #2e7d4f;
  --danger: #b3261e;
  --radius: 14px;
  --radius-sm: 8px;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --display: "Sora", var(--sans);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 1px 2px rgba(20, 18, 10, 0.04), 0 10px 30px -12px rgba(20, 18, 10, 0.14);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15151a;
    --surface: #1e1e25;
    --ink: #f1f0ec;
    --ink-soft: #b6b4ac;
    --line: #33333c;
    --accent: #e08a4f;
    --accent-ink: #1c1208;
    --accent-soft: #3a2a1c;
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  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; }
a { color: inherit; text-decoration: none; }
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: 700; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
input, select { font: inherit; color: inherit; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.skip-link {
  position: fixed; top: -100px; left: 1rem;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg);
  z-index: 9999; border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }
.is-hidden { display: none !important; }

/* =============================================================
   4. Header / footer
   ============================================================= */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: .5rem; font-family: var(--display); font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.header-nav { display: none; gap: 1.6rem; font-weight: 600; font-size: .92rem; }
.header-nav a { color: var(--ink-soft); transition: color .2s var(--ease-out); }
.header-nav a:hover { color: var(--accent); }
@media (min-width: 720px) { .header-nav { display: flex; } }

.site-footer { border-top: 1px solid var(--line); margin-top: 4rem; padding: 2.4rem 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1.2rem; align-items: center; justify-content: space-between; }
.footer-tagline { color: var(--ink-soft); font-size: .88rem; margin-top: .3rem; }
.footer-links { display: flex; gap: 1.4rem; font-size: .88rem; color: var(--ink-soft); }
.footer-links a:hover { color: var(--accent); }

/* =============================================================
   5. Hero
   ============================================================= */
.hero { padding: 2.6rem 20px 1.4rem; text-align: center; }
.hero h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); max-width: 18ch; margin: 0 auto; }
.hero-sub { color: var(--ink-soft); max-width: 52ch; margin: .9rem auto 0; font-size: 1.05rem; }

/* =============================================================
   6. Tool card
   ============================================================= */
.tool-section { padding-bottom: 1.4rem; }
.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.4rem;
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 720px) { .tool-card { padding: 2rem; } }

.tc-block { display: grid; gap: .7rem; }
.field-label { display: block; font-size: .82rem; font-weight: 700; color: var(--ink-soft); margin-bottom: .35rem; text-transform: uppercase; letter-spacing: .03em; }

.tc-tabs { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.tc-tab { padding: .5rem 1.1rem; border-radius: 999px; font-weight: 700; font-size: .88rem; color: var(--ink-soft); transition: background .2s var(--ease-out), color .2s var(--ease-out); }
.tc-tab.is-active { background: var(--ink); color: var(--bg); }

input[type="text"], input[type="url"], select {
  width: 100%; padding: .75rem .9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font-size: .98rem; transition: border-color .2s var(--ease-out);
}
input[type="text"]:focus, input[type="url"]:focus, select:focus { border-color: var(--accent); }
.field-row { display: grid; gap: .8rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .field-row { grid-template-columns: repeat(3, 1fr); } }
.field-row--colors { grid-template-columns: repeat(2, 1fr); max-width: 360px; }
.field-grow { grid-column: 1 / -1; }
@media (min-width: 640px) { .field-grow { grid-column: span 2; } }

input[type="color"] { width: 100%; height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg); padding: 3px; cursor: pointer; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.size-readout { display: block; font-size: .8rem; color: var(--ink-soft); margin-top: .2rem; }

.style-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 540px) { .style-grid { grid-template-columns: repeat(4, 1fr); } }
.style-chip, .format-chip {
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .6rem;
  text-align: center; font-weight: 700; font-size: .85rem; background: var(--bg);
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}
.style-chip.is-active, .format-chip.is-active { border-color: var(--accent); background: var(--accent-soft); }

.center-picker { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.emoji-grid { display: flex; flex-wrap: wrap; gap: .3rem; }
.emoji-btn { width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1.5px solid var(--line); font-size: 1.2rem; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.emoji-btn.is-active { border-color: var(--accent); background: var(--accent-soft); }
.file-btn { position: relative; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .8rem 1.3rem; border-radius: 999px; font-weight: 700; font-size: .95rem; transition: transform .15s var(--ease-out), background .2s var(--ease-out), opacity .2s; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { opacity: .88; }
.btn-secondary { background: var(--bg); border: 1.5px solid var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost { color: var(--ink-soft); }
.btn-ghost:hover { color: var(--ink); }
.btn-small { padding: .5rem .9rem; font-size: .84rem; }
.btn-large { padding: 1rem 1.6rem; font-size: 1.02rem; width: 100%; }
@media (min-width: 540px) { .btn-large { width: auto; } }
.link-btn { font-weight: 700; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.preview-2d-wrap { display: flex; justify-content: center; padding: 1rem; background: repeating-conic-gradient(var(--bg) 0% 25%, var(--surface) 0% 50%) 0 0/20px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
#qr-canvas { width: min(280px, 60vw); height: min(280px, 60vw); border-radius: 4px; }
.download-row { display: flex; flex-wrap: wrap; gap: .7rem; }
.privacy-badge { font-size: .84rem; color: var(--ink-soft); }
.contrast-warning { font-size: .84rem; font-weight: 700; color: var(--danger); }

.tc-3d-block { border-top: 1px dashed var(--line); padding-top: 1.4rem; }
.format-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.format-chip .fc-title { display: block; font-size: .88rem; }
.format-chip .fc-text { display: block; font-weight: 500; font-size: .74rem; color: var(--ink-soft); margin-top: .25rem; }

.viewer-3d-wrap { position: relative; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: linear-gradient(180deg, #eceae2, #dedad0); aspect-ratio: 16/10; }
@media (prefers-color-scheme: dark) { .viewer-3d-wrap { background: linear-gradient(180deg, #2a2a32, #202027); } }
#viewer-3d { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.viewer-3d-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: .85rem; color: var(--ink-soft); pointer-events: none; background: transparent; }

.print-warnings { display: grid; gap: .4rem; list-style: none; }
.print-warnings li { font-size: .85rem; font-weight: 600; padding: .5rem .8rem; border-radius: var(--radius-sm); }
.print-warnings li.ok { color: var(--success); background: color-mix(in srgb, var(--success) 12%, transparent); }
.print-warnings li.warn { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.secondary-download { font-size: .85rem; color: var(--ink-soft); }

/* =============================================================
   7. Ad slots (placeholders)
   ============================================================= */
.ad-slot { border: 1.5px dashed color-mix(in srgb, var(--ink) 25%, transparent); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--ink-soft); font-weight: 700; letter-spacing: .08em; font-size: .78rem; background: color-mix(in srgb, var(--ink) 4%, transparent); }
.ad-slot-label { opacity: .65; }
.ad-slot--banner { min-height: 90px; margin-top: 1.4rem; }
.ad-slot--incontent { min-height: 250px; margin: 2.4rem auto; max-width: 728px; }
.ad-slot--popup { min-height: 200px; width: 300px; max-width: 100%; }

.ad-toast { position: fixed; right: 16px; bottom: 16px; z-index: 60; background: var(--surface); border: 1.5px dashed color-mix(in srgb, var(--ink) 25%, transparent); border-radius: var(--radius-sm); padding: 1rem 2.2rem 1rem 1rem; box-shadow: var(--shadow-card); font-weight: 700; font-size: .78rem; letter-spacing: .08em; color: var(--ink-soft); max-width: 220px; }
.ad-toast-close { position: absolute; top: 6px; right: 8px; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .75rem; background: color-mix(in srgb, var(--ink) 8%, transparent); }

dialog#ad-popup { border: none; border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow-card); max-width: 92vw; }
dialog#ad-popup::backdrop { background: rgba(10, 10, 10, .5); }
.ad-popup-close { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 8%, transparent); display: flex; align-items: center; justify-content: center; }
.ad-popup-continue { margin-top: 1rem; width: 100%; }

/* =============================================================
   8. Sections: como funciona / ideas / faq / seo text
   ============================================================= */
.section { padding: 3.2rem 0; }
.section h2 { font-size: clamp(1.5rem, 3vw, 2rem); text-align: center; margin-bottom: 2rem; }
.section--muted { background: color-mix(in srgb, var(--ink) 3%, var(--bg)); }

.steps-grid { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .steps-grid { grid-template-columns: repeat(3, 1fr); } }
.step-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; }
.step-card h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.step-card p { color: var(--ink-soft); font-size: .92rem; }

.usecases-grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .usecases-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .usecases-grid { grid-template-columns: repeat(3, 1fr); } }
.usecase-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem; display: grid; gap: .5rem; }
.usecase-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.usecase-card h3 { font-size: 1rem; }
.usecase-card p { color: var(--ink-soft); font-size: .9rem; }

.seo-text { max-width: 760px; }
.seo-text h2 { text-align: left; font-size: 1.5rem; }
.seo-text p { color: var(--ink-soft); margin-top: 1rem; }
.seo-text p:first-of-type { margin-top: 0; }

.faq-list { display: grid; gap: .7rem; max-width: 760px; margin: 0 auto; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .2rem .3rem; }
.faq-item summary { cursor: pointer; list-style: none; padding: .9rem 1rem; font-weight: 700; 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 { padding: 0 1rem 1rem; color: var(--ink-soft); font-size: .92rem; }

/* =============================================================
   9. Reduced motion — solo efectos intrusivos
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
