/* =============================================================
   PrivaPDF — hoja de estilos única
   1. Tokens · 2. Reset · 3. Utilidades · 4. Tipografía
   5. Componentes · 6. Secciones · 7. Efectos
   8. Responsive · 9. Reduced-motion
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          "Noto Sans", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --bg:        #f7f7fb;
  --bg-soft:   #eeeef6;
  --surface:   #ffffff;
  --surface-2: #f3f3f9;
  --ink:       #16151f;
  --ink-soft:  #52505f;
  --ink-mute:  #78768a;
  --line:      #e3e2ee;
  --line-soft: #eeedf6;

  --accent:      #5b3df5;
  --accent-ink:  #ffffff;
  --accent-soft: #ede9ff;
  --accent-line: #c9beff;
  --accent-deep: #3f27c9;

  --safe:      #0f8f5f;
  --safe-soft: #e3f6ed;
  --safe-line: #b6e6ce;

  --warn:      #a35a00;
  --warn-soft: #fdf1de;
  --warn-line: #f2d9ab;

  --danger:      #c0332e;
  --danger-soft: #fdeceb;
  --danger-line: #f4c7c4;

  --radius:    14px;
  --radius-sm: 9px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(22, 21, 31, .05), 0 1px 3px rgba(22, 21, 31, .04);
  --shadow:    0 2px 6px rgba(22, 21, 31, .05), 0 12px 28px -12px rgba(22, 21, 31, .16);
  --shadow-lg: 0 4px 12px rgba(22, 21, 31, .07), 0 30px 60px -24px rgba(22, 21, 31, .28);

  --gutter: clamp(1rem, 4vw, 2rem);
  --maxw: 1120px;
  --maxw-read: 68ch;

  --ease-out:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0f0e16;
    --bg-soft:   #16151f;
    --surface:   #1a1925;
    --surface-2: #22212f;
    --ink:       #f2f1f8;
    --ink-soft:  #b9b7c8;
    --ink-mute:  #8d8ba0;
    --line:      #2e2c3d;
    --line-soft: #262433;

    --accent:      #9885ff;
    --accent-ink:  #12101d;
    --accent-soft: #241f3d;
    --accent-line: #43397a;
    --accent-deep: #b9adff;

    --safe:      #4fd0a0;
    --safe-soft: #10291f;
    --safe-line: #245743;

    --warn:      #f0b45c;
    --warn-soft: #2c2113;
    --warn-line: #5a4321;

    --danger:      #ff8b84;
    --danger-soft: #2e1614;
    --danger-line: #5e2c28;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow:    0 2px 6px rgba(0, 0, 0, .35), 0 12px 28px -12px rgba(0, 0, 0, .7);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, .4), 0 30px 60px -24px rgba(0, 0, 0, .8);
  }
}

/* =============================================================
   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;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
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, h4 { text-wrap: balance; line-height: 1.12; letter-spacing: -0.02em; }
::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* =============================================================
   3. Utilidades
   ============================================================= */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 780px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

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

.hidden { display: none !important; }

/* =============================================================
   4. Tipografía
   ============================================================= */
.h1 { font-size: clamp(1.9rem, 1.35rem + 2.4vw, 3rem); font-weight: 800; }
.h2 { font-size: clamp(1.45rem, 1.15rem + 1.2vw, 2rem); font-weight: 750; }
.h3 { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); font-weight: 700; }

.lede {
  font-size: clamp(1.02rem, .97rem + .28vw, 1.16rem);
  color: var(--ink-soft);
  max-width: 62ch;
}

.prose { max-width: var(--maxw-read); color: var(--ink-soft); }
.prose h2 { color: var(--ink); margin-block: 2.2rem .7rem; }
.prose h3 { color: var(--ink); margin-block: 1.6rem .4rem; }
.prose p + p { margin-top: .9rem; }
.prose ul { margin: .8rem 0 0 1.1rem; display: grid; gap: .4rem; }
.prose strong { color: var(--ink); font-weight: 650; }

/* =============================================================
   5. Componentes
   ============================================================= */

/* --- Cabecera --- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; gap: 1rem;
  min-height: 62px;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; letter-spacing: -.02em; }
.brand svg { width: 26px; height: 26px; flex: none; }
.brand span b { color: var(--accent); font-weight: 800; }

.site-nav { margin-left: auto; }
.site-nav ul { display: flex; align-items: center; gap: .15rem; list-style: none; padding: 0; }
.site-nav a {
  display: block; padding: .45rem .7rem; border-radius: 8px;
  font-size: .93rem; font-weight: 550; color: var(--ink-soft);
  transition: background .18s var(--ease-out), color .18s var(--ease-out);
}
.site-nav a:hover { background: var(--surface-2); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.15rem; border-radius: 11px;
  font-weight: 650; font-size: .96rem; line-height: 1.2;
  border: 1px solid transparent;
  transition: transform .18s var(--ease-out), background .18s var(--ease-out),
              border-color .18s var(--ease-out), box-shadow .18s var(--ease-out), opacity .18s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--accent-deep); box-shadow: var(--shadow); }

.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent-line); background: var(--surface-2); }

.btn-link { padding: .3rem .2rem; color: var(--ink-mute); font-weight: 550; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--accent); }

.btn-lg { padding: .95rem 1.5rem; font-size: 1.05rem; border-radius: 13px; }
.btn-block { width: 100%; }

/* --- Tarjeta de herramienta --- */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(1rem, .6rem + 1.6vw, 1.6rem);
}

.tool-card [data-when] { display: none; }
.tool-card[data-state="idle"]    [data-when~="idle"],
.tool-card[data-state="ready"]   [data-when~="ready"],
.tool-card[data-state="engine"]  [data-when~="engine"],
.tool-card[data-state="working"] [data-when~="working"],
.tool-card[data-state="done"]    [data-when~="done"],
.tool-card[data-state="error"]   [data-when~="error"] { display: block; }
.tool-card[data-state="ready"]   [data-when~="ready"].is-flex,
.tool-card[data-state="done"]    [data-when~="done"].is-flex,
.tool-card[data-state="error"]   [data-when~="error"].is-flex { display: flex; }
.tool-card[data-state="ready"]   [data-when~="ready"].is-grid { display: grid; }

/* --- Dropzone --- */
.dropzone {
  display: grid; place-items: center; gap: .55rem; text-align: center;
  min-height: 214px; padding: 1.5rem 1.1rem;
  border: 2px dashed var(--accent-line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--accent-soft), transparent 70%);
  cursor: pointer;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out), transform .2s var(--ease-out);
}
.dropzone:hover { border-color: var(--accent); }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.005); }
.dropzone-icon { width: 46px; height: 46px; color: var(--accent); }
.dropzone-title { font-size: 1.14rem; font-weight: 750; color: var(--ink); }
.dropzone-hint { font-size: .9rem; color: var(--ink-mute); }
.dropzone .btn { margin-top: .35rem; pointer-events: none; }

/* --- Insignia de privacidad y avisos --- */
.privacy-badge {
  display: flex; align-items: flex-start; gap: .6rem;
  margin-top: 1rem; padding: .8rem .95rem;
  background: var(--safe-soft); border: 1px solid var(--safe-line);
  border-radius: var(--radius-sm);
  font-size: .93rem; color: var(--ink-soft);
}
.privacy-badge svg { width: 20px; height: 20px; color: var(--safe); flex: none; margin-top: 1px; }
.privacy-badge b { color: var(--ink); }

.limits-note { margin-top: .7rem; font-size: .86rem; color: var(--ink-mute); text-align: center; }

.notice {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .8rem .95rem; border-radius: var(--radius-sm);
  font-size: .92rem; line-height: 1.5;
}
.notice svg { width: 19px; height: 19px; flex: none; margin-top: 2px; }
.notice-warn   { background: var(--warn-soft);   border: 1px solid var(--warn-line);   color: var(--ink-soft); }
.notice-warn svg { color: var(--warn); }
.notice-error  { background: var(--danger-soft); border: 1px solid var(--danger-line); color: var(--ink-soft); }
.notice-error svg { color: var(--danger); }
.notice-info   { background: var(--surface-2);   border: 1px solid var(--line);        color: var(--ink-soft); }
.notice-info svg { color: var(--accent); }
.notice b { color: var(--ink); }

/* --- Progreso --- */
.progress-wrap { display: grid; gap: .6rem; padding: 1.4rem .4rem; text-align: center; }
.progress-label { font-weight: 600; font-size: .98rem; }
.progress-sub { font-size: .87rem; color: var(--ink-mute); }
.progress-bar { height: 9px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.progress-bar i { display: block; height: 100%; width: 0%; background: var(--accent); border-radius: 99px; transition: width .25s var(--ease-out); }

/* --- Lista de archivos --- */
.file-list { list-style: none; padding: 0; display: grid; gap: .5rem; margin-bottom: 1rem; }
.file-row {
  display: flex; align-items: center; gap: .7rem;
  padding: .6rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: .92rem;
}
.file-row svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.file-row .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .meta { margin-left: auto; color: var(--ink-mute); font-size: .85rem; white-space: nowrap; }

/* --- Rejilla de miniaturas --- */
.thumbs-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  margin-bottom: .8rem;
}
.thumbs-head .h3 { margin-right: auto; }
.thumbs-count { font-size: .88rem; color: var(--ink-mute); }

.thumbs {
  display: grid; gap: .7rem;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  max-height: 430px; overflow-y: auto; overflow-x: hidden;
  padding: .3rem; margin: 0 -.3rem;
  list-style: none;
}
.thumb {
  position: relative;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); overflow: hidden;
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out), opacity .18s;
  touch-action: none;
}
.thumb canvas, .thumb .thumb-ph {
  width: 100%; height: auto; aspect-ratio: 1 / 1.414;
  background: #fff; object-fit: contain;
}
.thumb .thumb-ph { display: grid; place-items: center; color: var(--ink-mute); font-size: .75rem; }
.thumb-label {
  display: flex; align-items: center; gap: .3rem;
  padding: .3rem .4rem; font-size: .74rem; color: var(--ink-mute);
  border-top: 1px solid var(--line-soft); background: var(--surface);
}
.thumb-label b { color: var(--ink); font-weight: 650; }
.thumb-src { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.thumb.is-draggable { cursor: grab; }
.thumb.is-dragging { opacity: .35; }
.thumb.is-flying {
  position: fixed; z-index: 90; pointer-events: none; cursor: grabbing;
  box-shadow: var(--shadow-lg); border-color: var(--accent); opacity: 1;
  transform: rotate(1.5deg);
}
.thumb-drop-marker {
  border: 2px dashed var(--accent); border-radius: 10px; background: var(--accent-soft);
  aspect-ratio: 1 / 1.55;
}

.thumb-tools {
  position: absolute; inset: auto 0 auto 0; top: 0;
  display: flex; justify-content: space-between; padding: .25rem;
  opacity: 0; transition: opacity .18s var(--ease-out);
}
.thumb:hover .thumb-tools, .thumb:focus-within .thumb-tools { opacity: 1; }
.thumb-tools button {
  display: grid; place-items: center; width: 25px; height: 25px;
  border-radius: 7px; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-soft); box-shadow: var(--shadow-sm);
}
.thumb-tools button:hover { color: var(--accent); border-color: var(--accent-line); }
.thumb-tools button svg { width: 13px; height: 13px; }
.thumb-tools .group { display: flex; gap: .2rem; }

/* Selección (dividir) */
.thumb.is-selectable { cursor: pointer; }
.thumb.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-line); }
.thumb.is-selected .thumb-check { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.thumb-check {
  position: absolute; top: .3rem; left: .3rem;
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--line);
  display: grid; place-items: center; color: transparent;
  box-shadow: var(--shadow-sm);
}
.thumb-check svg { width: 13px; height: 13px; }

/* --- Campos de formulario --- */
.field { display: grid; gap: .35rem; }
.field label { font-size: .9rem; font-weight: 600; }
.field .help { font-size: .83rem; color: var(--ink-mute); }
.input, .select {
  width: 100%; padding: .65rem .8rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.option-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.option {
  position: relative;
  border: 1px solid var(--line); border-radius: 12px; padding: .8rem .9rem;
  background: var(--surface); cursor: pointer;
  transition: border-color .18s var(--ease-out), background .18s var(--ease-out);
}
.option:hover { border-color: var(--accent-line); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option .t { display: block; font-weight: 650; font-size: .95rem; }
.option .d { display: block; font-size: .83rem; color: var(--ink-mute); margin-top: .1rem; }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent-line); }
.option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: 1.1rem; }
.actions .grow { flex: 1 1 220px; }

/* --- Resultado --- */
.result { display: grid; gap: .9rem; text-align: center; padding: .4rem 0 .2rem; }
.result-icon { width: 52px; height: 52px; margin-inline: auto; color: var(--safe); }
.result-title { font-size: 1.25rem; font-weight: 750; }
.result-meta { font-size: .93rem; color: var(--ink-mute); }

.size-compare {
  display: flex; align-items: center; justify-content: center; gap: .9rem; flex-wrap: wrap;
  padding: 1rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.size-box { text-align: center; min-width: 96px; }
.size-box .k { display: block; font-size: .76rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-mute); }
.size-box .v { display: block; font-size: 1.32rem; font-weight: 800; letter-spacing: -.02em; }
.size-arrow { color: var(--ink-mute); width: 22px; height: 22px; }
.size-saved {
  padding: .35rem .8rem; border-radius: 99px; font-weight: 750; font-size: 1rem;
  background: var(--safe-soft); color: var(--safe); border: 1px solid var(--safe-line);
}
.size-saved.is-worse { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }

/* --- Pad de firma --- */
.sign-grid { display: grid; gap: 1.1rem; }
.sign-pad-wrap { display: grid; gap: .5rem; }
.sign-pad {
  width: 100%; aspect-ratio: 5 / 2;
  background: #ffffff;
  border: 2px dashed var(--accent-line); border-radius: var(--radius);
  touch-action: none; cursor: crosshair;
}
.sign-pad.has-ink { border-style: solid; border-color: var(--accent); }
.sign-pad-tools { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.sign-pad-tools .swatches { display: flex; gap: .35rem; margin-left: auto; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); }
.swatch[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

.page-stage {
  position: relative; margin-inline: auto; max-width: 100%;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  overflow: hidden; touch-action: none;
}
.page-stage canvas { width: 100%; height: auto; background: #fff; }
.sig-box {
  position: absolute; top: 0; left: 0;
  border: 1.5px dashed var(--accent); border-radius: 4px;
  background: rgba(91, 61, 245, .06);
  cursor: grab; touch-action: none;
}
.sig-box img { width: 100%; height: 100%; pointer-events: none; }
.sig-box.is-grabbing { cursor: grabbing; }
.sig-handle {
  position: absolute; right: -8px; bottom: -8px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface);
  cursor: nwse-resize; touch-action: none;
}
.stage-hint { font-size: .86rem; color: var(--ink-mute); text-align: center; margin-top: .5rem; }

.page-picker { display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; }
.page-picker .input { width: 5.5rem; text-align: center; }

.tool-card [data-when].is-grid { gap: 1rem; }
.tool-card [data-when].is-flex { gap: .6rem; flex-wrap: wrap; }

code {
  font-family: var(--mono); font-size: .88em;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 5px; padding: .06em .38em;
}

/* =============================================================
   6. Secciones
   ============================================================= */
.hero { padding: clamp(1.4rem, .8rem + 2.4vw, 2.6rem) 0 0; }
.hero-head { text-align: center; max-width: 720px; margin: 0 auto clamp(1rem, .6rem + 1.6vw, 1.5rem); }
.hero-head .h1 { margin-bottom: .5rem; }
.hero-head .lede { margin-inline: auto; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .75rem; margin-bottom: .8rem;
  border-radius: 99px; background: var(--safe-soft); border: 1px solid var(--safe-line);
  color: var(--safe); font-size: .82rem; font-weight: 650;
}
.eyebrow svg { width: 14px; height: 14px; }

.section { padding: clamp(2rem, 1.2rem + 3vw, 3.4rem) 0; }
.section-head { max-width: 700px; margin-bottom: 1.4rem; }
.section-head .h2 { margin-bottom: .4rem; }
.section-head p { color: var(--ink-soft); }

/* Pasos */
.steps { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); list-style: none; padding: 0; counter-reset: step; }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem; box-shadow: var(--shadow-sm);
}
.step-n {
  display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: .7rem;
  border-radius: 10px; background: var(--accent-soft); color: var(--accent);
  font-weight: 800; font-size: .98rem;
}
.step h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: .25rem; }
.step p { font-size: .93rem; color: var(--ink-soft); }

/* Ideas de uso */
.uses { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); list-style: none; padding: 0; }
.use {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .95rem 1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
}
.use svg { width: 20px; height: 20px; color: var(--accent); flex: none; margin-top: 2px; }
.use b { display: block; font-weight: 650; }
.use span { font-size: .91rem; color: var(--ink-soft); }

/* FAQ */
.faq { display: grid; gap: .6rem; max-width: 820px; }
.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .95rem 1.1rem;
  transition: border-color .18s var(--ease-out);
}
.faq details[open] { border-color: var(--accent-line); }
.faq summary {
  cursor: pointer; font-weight: 650; list-style: none;
  display: flex; align-items: flex-start; gap: .7rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; margin-left: auto; flex: none; width: 10px; height: 10px;
  border-right: 2px solid var(--ink-mute); border-bottom: 2px solid var(--ink-mute);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq p { margin-top: .6rem; color: var(--ink-soft); font-size: .95rem; }

/* Tarjetas de herramientas */
.tool-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); }
.tool-tile {
  display: flex; flex-direction: column; gap: .45rem;
  padding: 1.15rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease-out), border-color .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.tool-tile:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: var(--shadow); }
.tool-tile .ic { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--accent-soft); color: var(--accent); margin-bottom: .3rem; }
.tool-tile .ic svg { width: 20px; height: 20px; }
.tool-tile b { font-size: 1.04rem; font-weight: 700; }
.tool-tile span { font-size: .92rem; color: var(--ink-soft); }
.tool-tile em { font-style: normal; margin-top: auto; padding-top: .5rem; color: var(--accent); font-weight: 650; font-size: .9rem; }

/* Pie */
.site-footer {
  border-top: 1px solid var(--line); background: var(--bg-soft);
  padding: 2.2rem 0 2.6rem; margin-top: 1rem;
}
.footer-grid { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.site-footer h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); margin-bottom: .6rem; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: .35rem; }
.site-footer a { color: var(--ink-soft); font-size: .93rem; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom {
  margin-top: 1.8rem; padding-top: 1.1rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  font-size: .87rem; color: var(--ink-mute);
}
.footer-bottom .brand { font-size: .95rem; }

/* =============================================================
   7. Huecos de anuncios (marcadores vacíos — sin código de terceros)
   ============================================================= */
.ad-slot {
  display: grid; place-items: center;
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink-mute);
  font-size: .72rem; font-weight: 700; letter-spacing: .16em;
  margin-inline: auto; width: 100%; overflow: hidden;
}
.ad-leaderboard { max-width: 728px; min-height: 90px; margin-block: clamp(1.2rem, .8rem + 1.6vw, 2rem); }
.ad-incontent   { max-width: 580px; min-height: 250px; margin-block: 1.6rem; }
.ad-dialog      { width: 100%; max-width: 336px; min-height: 280px; }
.ad-toast       { width: 100%; min-height: 100px; }

/* Interstitial */
.ad-modal {
  width: min(420px, calc(100vw - 2rem));
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg);
}
.ad-modal::backdrop { background: rgba(12, 11, 20, .55); backdrop-filter: blur(2px); }
.ad-modal-in { padding: 1.2rem; display: grid; gap: .9rem; }
.ad-modal-head { display: flex; align-items: flex-start; gap: .8rem; }
.ad-modal-head p { font-size: .95rem; color: var(--ink-soft); }
.ad-modal-head b { display: block; color: var(--ink); font-size: 1.05rem; font-weight: 750; }
.ad-close {
  margin-left: auto; flex: none;
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft);
}
.ad-close:hover { color: var(--ink); border-color: var(--accent-line); }
.ad-close svg { width: 15px; height: 15px; }

/* Aviso de esquina */
.ad-corner {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 60;
  width: min(280px, calc(100vw - 2rem));
  padding: .75rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
  display: grid; gap: .5rem;
  transform: translateY(12px); opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
.ad-corner.is-open { transform: none; opacity: 1; pointer-events: auto; }
.ad-corner-head { display: flex; align-items: center; gap: .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .14em; color: var(--ink-mute); }
.ad-corner-head .ad-close { width: 24px; height: 24px; border-radius: 7px; }
.ad-corner-head .ad-close svg { width: 12px; height: 12px; }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (max-width: 539px) {
  .site-header .container { gap: .5rem; }
  .brand span { font-size: .96rem; }
  /* Cuatro enlaces no caben a 375 px: se encogen y, si aún así no entran,
     el menú se desliza en horizontal sin desbordar la página. */
  .site-nav {
    min-width: 0; flex: 0 1 auto;
    overflow-x: auto; scrollbar-width: none;
    margin-right: calc(var(--gutter) * -1); padding-right: var(--gutter);
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav ul { gap: 0; flex-wrap: nowrap; }
  .site-nav a { padding: .4rem .42rem; font-size: .85rem; white-space: nowrap; }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); max-height: 330px; }
  .ad-corner { right: .6rem; bottom: .6rem; }
}

@media (min-width: 720px) {
  .sign-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: clamp(1.8rem, 1rem + 3vw, 3rem); }
}

@media (min-width: 960px) {
  .page-stage { max-width: 620px; }
}

/* =============================================================
   9. Reduced-motion — solo efectos intrusivos
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ad-corner { transition-duration: .01ms; }
  .thumb.is-flying { transform: none; }
}
