/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --ink: #1B1B1F;
  --ink-soft: #5B5D66;
  --ink-faint: #8A8C94;
  --border: #E6E3DB;
  --border-strong: #D4D0C5;
  --accent: #FF6A3D;
  --accent-dark: #E24E22;
  --accent-ink: #7A2C10;
  --accent-soft: #FFE9DE;
  --success: #1E8E5A;
  --success-soft: #E3F5EC;
  --warning: #B4650B;
  --warning-soft: #FCEFDC;
  --danger: #C4372B;
  --danger-soft: #FBE7E4;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(24,20,12,0.06);
  --shadow: 0 10px 30px rgba(24,20,12,0.09);
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  --display: "Sora", var(--sans);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16151A;
    --surface: #1E1D23;
    --surface-2: #24232A;
    --ink: #F2F1EE;
    --ink-soft: #B7B6BE;
    --ink-faint: #85838D;
    --border: #322F38;
    --border-strong: #423F4A;
    --accent: #FF7A4D;
    --accent-dark: #FF6A3D;
    --accent-ink: #FFD9C8;
    --accent-soft: #3A281F;
    --success-soft: #16311F;
    --warning-soft: #3A2A0E;
    --danger-soft: #3A1B17;
    --shadow-sm: 0 2px 10px rgba(0,0,0,0.35);
    --shadow: 0 14px 34px rgba(0,0,0,0.45);
  }
}

/* =============================================================
   2. Reset y base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, canvas, 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: 700; }
::selection { background: var(--accent-soft); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.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;
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   3. Utilidades
   ============================================================= */
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
[hidden] { display: none !important; }

/* =============================================================
   4. Tipografía general
   ============================================================= */
h1 { font-size: clamp(1.9rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: .6em; }
.section-lead { color: var(--ink-soft); max-width: 62ch; margin-top: -.6rem; margin-bottom: 1.6rem; }

/* =============================================================
   5. Componentes
   ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .85rem 1.4rem; border-radius: 999px; font-weight: 700; font-size: .96rem;
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), background-color .15s var(--ease-out);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px rgba(255,106,61,0.35); }
.btn--primary:hover { background: var(--accent-dark); }
.btn--primary:disabled { background: var(--border-strong); color: var(--ink-faint); box-shadow: none; cursor: not-allowed; }
.btn--outline { background: var(--surface); border: 1.5px solid var(--border-strong); color: var(--ink); }
.btn--outline:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-soft); }
.btn--ghost:hover { color: var(--ink); border-color: var(--border-strong); }
.btn--sm { padding: .55rem .9rem; font-size: .84rem; border-radius: 999px; }
.btn--file { position: relative; }

/* =============================================================
   6. Cabecera
   ============================================================= */
.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(--border); }
.site-header__row { display: flex; align-items: center; justify-content: space-between; padding-block: .85rem; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .5rem; font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
.brand__mark { color: var(--accent); font-size: 1.3rem; }
.site-header__nav { display: flex; gap: 1.4rem; font-weight: 600; font-size: .92rem; color: var(--ink-soft); }
.site-header__nav a:hover { color: var(--ink); }
@media (max-width: 719px) { .site-header__nav { display: none; } }

/* =============================================================
   7. Hero + tarjeta de la herramienta
   ============================================================= */
.hero { padding-block: 2.2rem 1.6rem; }
.hero__intro { max-width: 68ch; margin-bottom: 1.6rem; }
.hero__lead { font-size: 1.08rem; color: var(--ink-soft); margin-top: .6rem; }

.tool-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: clamp(1rem, 2.4vw, 1.8rem);
}
.tool-card__grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(1.2rem, 3vw, 2.2rem); align-items: start; }
@media (max-width: 959px) { .tool-card__grid { grid-template-columns: 1fr; } }

.field-group { margin-bottom: 1.6rem; }
.field-group:last-child { margin-bottom: 0; }
.field-label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: .6rem; }
.field-label--inline { margin-bottom: 0; }
.field-hint { font-size: .82rem; color: var(--ink-faint); margin-top: .5rem; min-height: 1.2em; }
.field-hint.is-warning { color: var(--warning); }
.field-hint.is-danger { color: var(--danger); font-weight: 600; }
.field-hint.is-ok { color: var(--success); }

.text-input {
  width: 100%; padding: .78rem .95rem; border-radius: var(--radius-sm); border: 1.5px solid var(--border-strong);
  background: var(--surface-2); color: var(--ink); font-size: .96rem;
}
.text-input:focus { border-color: var(--accent); background: var(--surface); }
.text-input--select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%); background-position: calc(100% - 18px) center, calc(100% - 13px) center; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 2.2rem; }
.input-row { display: grid; grid-template-columns: 1fr; gap: .6rem; }
@media (min-width: 540px) { .input-row { grid-template-columns: 1fr 1fr 1fr; } .input-row--tight { grid-template-columns: 2fr 1.2fr; } }

.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; margin-bottom: .8rem; }
.segmented__btn { padding: .5rem 1rem; border-radius: 999px; font-weight: 600; font-size: .86rem; color: var(--ink-soft); }
.segmented__btn.is-active { background: var(--ink); color: var(--bg); }

.style-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .55rem; margin-bottom: 1rem; }
.style-opt { padding: .7rem .4rem; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface-2); font-size: .82rem; font-weight: 600; text-align: center; }
.style-opt.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
@media (max-width: 420px) { .style-grid { grid-template-columns: repeat(2, 1fr); } }

.color-row { display: flex; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: .3rem; }
.color-swatch { display: flex; flex-direction: column; gap: .4rem; font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.color-swatch input[type="color"] { width: 52px; height: 38px; border-radius: var(--radius-sm); border: 1.5px solid var(--border-strong); padding: 3px; background: var(--surface); cursor: pointer; }

.center-row { position: relative; }
.center-controls { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.emoji-picker { display: grid; grid-template-columns: repeat(8, 1fr); gap: .3rem; margin-top: .7rem; padding: .7rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); max-height: 190px; overflow-y: auto; }
.emoji-picker button { font-size: 1.3rem; padding: .35rem; border-radius: 8px; }
.emoji-picker button:hover { background: var(--accent-soft); }

.format-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1rem; }
.format-opt { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .9rem .5rem; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--surface-2); font-size: .82rem; font-weight: 600; text-align: center; }
.format-opt__icon { font-size: 1.4rem; }
.format-opt.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
@media (max-width: 540px) { .format-grid { grid-template-columns: repeat(3, 1fr); font-size: .74rem; } }

.tool-col--preview { position: sticky; top: 90px; }
@media (max-width: 959px) { .tool-col--preview { position: static; } }
.preview-tabs { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; margin-bottom: .9rem; }
.preview-tab { padding: .5rem 1.1rem; border-radius: 999px; font-weight: 700; font-size: .86rem; color: var(--ink-soft); }
.preview-tab.is-active { background: var(--ink); color: var(--bg); }

.preview-pane { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 1rem; }
.preview-pane canvas { width: 100%; height: 100%; object-fit: contain; }
.viewer-wrap { position: relative; width: 100%; height: 100%; }
.viewer-wrap canvas { width: 100%; height: 100%; touch-action: none; cursor: grab; }
.viewer-wrap canvas:active { cursor: grabbing; }
.viewer-hint { position: absolute; bottom: .6rem; left: 50%; transform: translateX(-50%); font-size: .74rem; color: var(--ink-faint); background: color-mix(in srgb, var(--surface) 80%, transparent); padding: .3rem .7rem; border-radius: 999px; pointer-events: none; }
.viewer-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 1.5rem; color: var(--ink-soft); font-size: .9rem; }

.privacy-badge { font-size: .82rem; color: var(--ink-soft); margin-bottom: 1rem; }

.download-grid { display: flex; flex-direction: column; gap: .6rem; }
.btn--primary#dl3mf { width: 100%; padding-block: 1rem; font-size: 1rem; }
.download-secondary { display: flex; gap: .5rem; flex-wrap: wrap; }
.download-secondary .btn { flex: 1 1 auto; }

/* =============================================================
   8. Anuncios (placeholders)
   ============================================================= */
.ad-slot { border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-size: .82rem; font-family: var(--mono); background: var(--surface-2); }
.ad-slot--banner { min-height: 90px; margin-block: 2.2rem; }
.ad-slot--incontent { min-height: 250px; max-width: 336px; margin: 2.4rem auto; }
.ad-slot--dialog { min-height: 200px; margin-block: 1rem; }
.ad-slot__label { letter-spacing: .08em; text-transform: uppercase; }

.ad-corner { position: fixed; right: 16px; bottom: 16px; z-index: 60; width: 280px; min-height: 96px; background: var(--surface); border: 1.5px dashed var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-size: .8rem; font-family: var(--mono); padding: 1.4rem 1rem .8rem; }
.ad-corner__close { position: absolute; top: 6px; right: 8px; font-size: .9rem; color: var(--ink-faint); padding: .2rem; }
.ad-corner__close:hover { color: var(--ink); }
@media (max-width: 539px) { .ad-corner { width: calc(100% - 32px); left: 16px; right: 16px; } }

.download-dialog { border: none; border-radius: var(--radius); padding: 1.4rem; max-width: 380px; width: calc(100% - 2rem); background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.download-dialog::backdrop { background: rgba(10,10,10,0.5); }
.download-dialog__close { position: absolute; top: 10px; right: 12px; font-size: 1rem; color: var(--ink-faint); }
.download-dialog__kicker { font-weight: 700; margin-bottom: .3rem; padding-right: 1.4rem; }
#downloadDialogContinue { width: 100%; margin-top: .4rem; }

/* =============================================================
   9. Secciones de contenido
   ============================================================= */
.intro, .steps, .formats-explain, .ideas, .faq, .cta-final { padding-block: 2.4rem; }
.intro p { color: var(--ink-soft); max-width: 72ch; line-height: 1.65; margin-bottom: 1rem; }
.intro p:last-child { margin-bottom: 0; }
.steps__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 719px) { .steps__grid { grid-template-columns: 1fr; } }
.step-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; }
.step-card__num { font-family: var(--mono); color: var(--accent); font-weight: 700; font-size: .82rem; margin-bottom: .5rem; display: block; }
.step-card h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.step-card p { color: var(--ink-soft); font-size: .93rem; }

.formats-explain__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 719px) { .formats-explain__grid { grid-template-columns: 1fr; } }
.format-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem; }
.format-card h3 { font-size: 1rem; margin-bottom: .4rem; }
.format-card p { color: var(--ink-soft); font-size: .9rem; }

.ideas__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
@media (max-width: 719px) { .ideas__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .ideas__grid { grid-template-columns: 1fr; } }
.idea-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; }
.idea-card__icon { font-size: 1.6rem; display: block; margin-bottom: .5rem; }
.idea-card h3 { font-size: .98rem; margin-bottom: .3rem; }
.idea-card p { color: var(--ink-soft); font-size: .88rem; }

.faq__list { max-width: 76ch; }
.faq-item { border-bottom: 1px solid var(--border); padding-block: 1rem; }
.faq-item summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--accent); flex-shrink: 0; }
.faq-item[open] summary::after { content: "–"; }
.faq-item p { color: var(--ink-soft); margin-top: .7rem; font-size: .94rem; }

.cta-final { text-align: center; }
.cta-final p { color: var(--ink-soft); max-width: 50ch; margin: .6rem auto 1.4rem; }

/* =============================================================
   10. Pie
   ============================================================= */
.site-footer { border-top: 1px solid var(--border); padding-block: 1.6rem; margin-top: 1rem; }
.site-footer__row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .8rem; font-size: .84rem; color: var(--ink-faint); }
.site-footer__row nav { display: flex; gap: 1rem; }
.site-footer__row a:hover { color: var(--ink); }

/* =============================================================
   12. Guías, artículos y páginas internas
   ============================================================= */
.section-more { margin-top: 1.4rem; font-weight: 700; }
.section-more a { color: var(--accent-ink); }
.section-more a:hover { color: var(--accent-dark); }
@media (prefers-color-scheme: dark) { .section-more a { color: var(--accent); } }

.guides-home { padding-block: 2.4rem; }
.guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
@media (max-width: 899px) { .guide-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .guide-grid { grid-template-columns: 1fr; } }
.guide-card {
  display: flex; flex-direction: column; gap: .5rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1.3rem;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out), transform .15s var(--ease-out);
}
.guide-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.guide-card h3 { font-size: 1.02rem; }
.guide-card p { color: var(--ink-soft); font-size: .9rem; }
.guide-card__cta { margin-top: auto; font-weight: 700; font-size: .88rem; color: var(--accent-dark); }
.guide-card--sm { padding: 1rem 1.1rem; }
.guide-card--sm h3 { font-size: .95rem; }

.article { max-width: 780px; padding-block: 2.2rem 3rem; }
.article--wide { max-width: 1180px; }
.breadcrumbs { font-size: .84rem; color: var(--ink-faint); margin-bottom: 1rem; }
.breadcrumbs a { color: var(--accent-dark); font-weight: 600; }
.breadcrumbs a:hover { text-decoration: underline; }
.article h1 { margin-bottom: .5rem; }
.article__meta { font-size: .84rem; color: var(--ink-faint); margin-bottom: 1.2rem; }
.article__lead { font-size: 1.1rem; color: var(--ink-soft); margin-bottom: 1.6rem; line-height: 1.65; }
.article--wide .article__lead { max-width: 70ch; }
.article h2 { font-size: clamp(1.25rem, 2.4vw, 1.55rem); margin-top: 2.2rem; margin-bottom: .7rem; }
.article h3 { font-size: 1.08rem; margin-top: 1.5rem; margin-bottom: .5rem; }
.article p, .article li { color: var(--ink-soft); line-height: 1.75; }
.article p { margin-bottom: 1rem; }
.article ul, .article ol { padding-left: 1.4rem; margin-bottom: 1.2rem; }
.article li { margin-bottom: .45rem; }
.article li strong, .article p strong { color: var(--ink); }
.article a:not(.btn):not(.guide-card) { color: var(--accent-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
@media (prefers-color-scheme: dark) { .article a:not(.btn):not(.guide-card) { color: var(--accent); } }
.article code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: .1em .4em; }

.article table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.6rem; font-size: .92rem; display: block; overflow-x: auto; }
.article thead th { text-align: left; font-weight: 700; color: var(--ink); background: var(--surface-2); }
.article th, .article td { padding: .65rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--ink-soft); }
.article tbody tr:last-child td { border-bottom: 0; }

.callout { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: var(--radius-sm); padding: 1rem 1.2rem; margin: 1.6rem 0; color: var(--accent-ink); line-height: 1.65; }
.callout strong { color: var(--accent-ink); }
.article .callout a { color: var(--accent-ink); }

.checklist { list-style: none; padding-left: 0 !important; }
.checklist li { position: relative; padding-left: 1.8rem; }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--success); font-weight: 800; }

.diagram { margin: 1.4rem 0 1.8rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; color: var(--ink); }
.diagram svg { width: 100%; height: auto; }
.diagram figcaption { font-size: .86rem; color: var(--ink-faint); margin-top: .6rem; line-height: 1.55; }

.article-cta { margin-top: 2.6rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.6rem; text-align: center; box-shadow: var(--shadow-sm); }
.article-cta h2 { margin-top: 0; }
.article-cta p { max-width: 52ch; margin-inline: auto; }
.related { margin-top: 2.4rem; }
.related h2 { margin-top: 0; }

.contact-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.4rem; margin: 1rem 0 1.6rem; }
.contact-card__label { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); margin-bottom: .2rem !important; }
.contact-card__value { font-size: 1.15rem; font-weight: 700; margin-bottom: .6rem !important; word-break: break-word; }
.contact-card__note { font-size: .9rem; margin-bottom: 0 !important; }

.site-footer__row nav { flex-wrap: wrap; }

/* =============================================================
   11. Reducción de movimiento
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
