/* =============================================================
   Ilmara — hoja de estilos unica
   1. Tokens · 2. Reset · 3. Utilidades · 4. Tipografia
   5. Componentes · 6. Secciones · 7. Efectos · 8. Responsive
   9. Reduced-motion
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f5f6fb;
  --bg-deep: #eceef7;
  --surface: #ffffff;
  --surface-2: #f9fafd;
  --ink: #0e1220;
  --ink-soft: #545c73;
  --ink-faint: #7d8598;
  --line: #e2e6f0;
  --line-strong: #cdd3e3;
  --accent: #6d5cff;
  --accent-ink: #4b3ce0;
  --accent-soft: #eeecff;
  --warm: #ff6a3d;
  --warm-soft: #fff0eb;
  --ok: #0f9e69;
  --ok-soft: #e7f7f0;
  --danger: #d64545;
  --danger-soft: #fdeded;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", var(--sans);
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(14, 18, 32, .05), 0 1px 3px rgba(14, 18, 32, .04);
  --shadow-md: 0 4px 12px rgba(14, 18, 32, .06), 0 12px 32px rgba(14, 18, 32, .06);
  --shadow-lg: 0 8px 24px rgba(14, 18, 32, .08), 0 28px 64px rgba(60, 50, 160, .10);

  --gutter: clamp(1rem, 4vw, 2rem);
  --maxw: 1120px;
  --maxw-prose: 46rem;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e18;
    --bg-deep: #070911;
    --surface: #141926;
    --surface-2: #1b2130;
    --ink: #eef1f8;
    --ink-soft: #a4adc2;
    --ink-faint: #7b8499;
    --line: #262d3f;
    --line-strong: #384258;
    --accent: #8d80ff;
    --accent-ink: #a99fff;
    --accent-soft: #211f46;
    --warm: #ff8158;
    --warm-soft: #2e1a12;
    --ok: #35c48d;
    --ok-soft: #10261e;
    --danger: #ff7a7a;
    --danger-soft: #2c1517;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .35), 0 12px 32px rgba(0, 0, 0, .3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .4), 0 28px 64px rgba(0, 0, 0, .45);
  }
}

/* =============================================================
   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.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
[hidden] { display: none !important; }
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; font-family: var(--display); font-weight: 600; }
::selection { background: var(--accent); color: #fff; }

: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); }
.prose-width { max-width: var(--maxw-prose); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--surface); color: var(--ink);
  border-radius: 8px; font-weight: 600; box-shadow: var(--shadow-md);
}
.skip-link:focus { top: 1rem; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

/* =============================================================
   4. Tipografia
   ============================================================= */
h1 { font-size: clamp(1.85rem, 1.25rem + 2.4vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); }
h3 { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); }
.lede { font-size: clamp(1.02rem, .98rem + .35vw, 1.18rem); color: var(--ink-soft); max-width: 42rem; }
.eyebrow {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent-ink); font-weight: 600;
}

.prose { max-width: var(--maxw-prose); }
.prose h2 { margin-top: 2.6rem; margin-bottom: .8rem; }
.prose h3 { margin-top: 1.9rem; margin-bottom: .5rem; }
.prose p { margin-bottom: 1.05rem; color: var(--ink-soft); }
.prose ul, .prose ol { margin: 0 0 1.15rem 1.15rem; color: var(--ink-soft); }
.prose li { margin-bottom: .45rem; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--accent); }
.prose code {
  font-family: var(--mono); font-size: .88em; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 6px; padding: .1em .38em;
}
.prose figure { margin: 1.6rem 0; }
.prose blockquote {
  margin: 1.6rem 0; padding: .9rem 1.2rem; border-left: 3px solid var(--accent);
  background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink); font-size: .97rem;
}
.prose table {
  width: 100%; border-collapse: collapse; margin: 1.4rem 0; font-size: .93rem;
  display: block; overflow-x: auto;
}
.prose th, .prose td { padding: .62rem .8rem; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { font-weight: 600; color: var(--ink); background: var(--surface-2); white-space: nowrap; }
.prose td { color: var(--ink-soft); }

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

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .7rem 1.15rem; border-radius: 11px; font-weight: 600; font-size: .95rem;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  transition: transform .25s var(--ease-out), background-color .25s var(--ease-out),
              border-color .25s var(--ease-out), box-shadow .25s var(--ease-out), color .25s var(--ease-out);
  text-align: center;
}
.btn:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 6px 18px rgba(109, 92, 255, .28);
}
.btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; box-shadow: 0 10px 26px rgba(109, 92, 255, .34); }
.btn-lg { padding: .95rem 1.6rem; font-size: 1.02rem; border-radius: 13px; }
.btn-sm { padding: .42rem .75rem; font-size: .84rem; border-radius: 9px; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-block { display: flex; width: 100%; }

/* --- Cabecera --- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; gap: 1rem;
  min-height: 62px; padding-block: .55rem;
}
.brand { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 700; font-size: 1.1rem; letter-spacing: -.03em; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, var(--accent) 0%, var(--warm) 100%);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 3px 10px rgba(109, 92, 255, .35);
}
.brand-mark svg { width: 16px; height: 16px; }
.header-nav { margin-left: auto; display: flex; align-items: center; gap: .3rem; }
.header-nav a {
  padding: .45rem .7rem; border-radius: 9px; font-size: .9rem; font-weight: 500; color: var(--ink-soft);
  transition: background-color .2s var(--ease-out), color .2s var(--ease-out);
}
.header-nav a:hover { background: var(--surface-2); color: var(--ink); }
.header-nav a[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); }

/* --- Menu de idiomas (details nativo: funciona sin JavaScript) --- */
.lang-menu { position: relative; margin-left: .35rem; }
.lang-menu > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .4rem .55rem; border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); font-size: .8rem; font-weight: 700; letter-spacing: .04em;
  color: var(--ink-soft);
  transition: border-color .2s var(--ease-out), color .2s var(--ease-out);
}
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary:hover,
.lang-menu[open] > summary { border-color: var(--accent); color: var(--ink); }
.lang-globe { width: 15px; height: 15px; flex: none; }
.lang-chev { width: 14px; height: 14px; flex: none; transition: transform .25s var(--ease-out); }
.lang-menu[open] .lang-chev { transform: rotate(180deg); }
.lang-menu ul {
  position: absolute; right: 0; top: calc(100% + .45rem); z-index: 80;
  min-width: 200px; list-style: none; padding: .35rem; margin: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-md);
}
.lang-menu li a {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .6rem; border-radius: 8px;
  font-size: .9rem; font-weight: 500; color: var(--ink-soft);
}
.lang-menu li a:hover { background: var(--surface-2); color: var(--ink); }
.lang-menu li a[aria-current="true"] { color: var(--accent-ink); font-weight: 600; }
.lang-code {
  font-family: var(--mono); font-size: .66rem; font-weight: 700; letter-spacing: .08em;
  padding: .16rem .34rem; border-radius: 5px;
  background: var(--accent-soft); color: var(--accent-ink);
  min-width: 32px; text-align: center; flex: none;
}

/* --- Hero de herramienta --- */
.tool-hero { padding: clamp(1.5rem, 1rem + 2.6vw, 3rem) 0 .6rem; text-align: center; }
.tool-hero h1 { margin-bottom: .55rem; }
.tool-hero .lede { margin-inline: auto; }

/* --- Tarjeta de herramienta --- */
.tool-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: clamp(1rem, .7rem + 1.4vw, 1.7rem);
  margin: 1.4rem auto 0; max-width: 780px;
}
/* Visibilidad por estado: cada bloque declara en que estados aparece.
   La regla de ocultar tiene menos especificidad que la de mostrar. */
.tool-card [data-when] { display: none; }
.tool-card[data-state="engine"] [data-when~="engine"],
.tool-card[data-state="working"] [data-when~="working"] { display: flex; }
.tool-card[data-state="done"] [data-when~="done"],
.tool-card[data-state="error"] [data-when~="error"],
.tool-card[data-state="idle"] [data-when~="idle"] { display: block; }

/* --- Dropzone --- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .55rem; text-align: center; cursor: pointer;
  min-height: 190px; padding: 1.6rem 1.1rem;
  border: 2px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface-2);
  transition: border-color .25s var(--ease-out), background-color .25s var(--ease-out), transform .25s var(--ease-out);
}
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.is-dragging { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.dropzone-icon { width: 44px; height: 44px; color: var(--accent); }
.dropzone-title { font-family: var(--display); font-weight: 600; font-size: 1.08rem; }
.dropzone-hint { font-size: .87rem; color: var(--ink-faint); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* --- Opciones --- */
.tool-options {
  display: flex; flex-wrap: wrap; gap: .9rem 1.4rem; align-items: flex-end;
  margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line);
}
.field { display: flex; flex-direction: column; gap: .32rem; min-width: 150px; flex: 1 1 190px; max-width: 300px; }
.field > label { font-size: .8rem; font-weight: 600; color: var(--ink-soft); letter-spacing: .01em; }
.field select, .field input[type="number"] {
  padding: .55rem .7rem; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: .92rem;
}
.field-range { flex: 1 1 240px; max-width: 400px; }
.field-range input[type="range"] { width: 100%; accent-color: var(--accent); }
.range-row { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.range-value { font-family: var(--mono); font-size: .82rem; color: var(--accent-ink); font-weight: 600; }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.segmented button {
  padding: .5rem .85rem; font-size: .87rem; font-weight: 600; color: var(--ink-soft);
  background: var(--surface); transition: background-color .2s var(--ease-out), color .2s var(--ease-out);
}
.segmented button + button { border-left: 1px solid var(--line-strong); }
.segmented button[aria-pressed="true"] { background: var(--accent); color: #fff; }

/* --- Lista de archivos --- */
.file-list { display: flex; flex-direction: column; gap: .6rem; margin-top: 1.1rem; }
.file-row {
  display: grid; grid-template-columns: 46px 1fr auto; gap: .8rem; align-items: center;
  padding: .65rem .75rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-2);
}
.file-thumb {
  width: 46px; height: 46px; border-radius: 9px; object-fit: cover;
  background: var(--bg-deep); border: 1px solid var(--line);
}
.file-meta { min-width: 0; }
.file-name {
  font-weight: 600; font-size: .91rem; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.file-sizes { font-size: .82rem; color: var(--ink-faint); display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline; }
.size-before { text-decoration: line-through; opacity: .75; }
.size-after { color: var(--ink); font-weight: 600; }
.badge-save {
  display: inline-block; padding: .06rem .42rem; border-radius: 999px;
  background: var(--ok-soft); color: var(--ok); font-weight: 700; font-size: .74rem;
}
.badge-warn { background: var(--warm-soft); color: var(--warm); }
.badge-err { background: var(--danger-soft); color: var(--danger); }
.file-actions { display: flex; align-items: center; gap: .4rem; }

.progress {
  height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: .4rem;
}
.progress > span {
  display: block; height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--warm));
  transition: width .25s var(--ease-out);
}

.tool-status {
  display: flex; align-items: center; gap: .55rem; margin-top: 1rem;
  font-size: .9rem; color: var(--ink-soft);
}
.spinner {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid var(--line-strong); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tool-summary {
  display: flex; flex-wrap: wrap; align-items: center; gap: .7rem;
  margin-top: 1.1rem; padding: .85rem 1rem;
  background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 25%, transparent);
  border-radius: var(--radius); font-size: .93rem; color: var(--ink);
}
.tool-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.tool-error {
  margin-top: 1rem; padding: .85rem 1rem; border-radius: var(--radius);
  background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent);
  color: var(--ink); font-size: .93rem;
}

.privacy-badge {
  display: flex; align-items: flex-start; gap: .55rem; margin: 1rem auto 0;
  max-width: 780px; padding: .7rem .9rem; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--ink-soft); font-size: .87rem;
}
.privacy-badge svg { width: 17px; height: 17px; flex: none; margin-top: .18rem; color: var(--accent-ink); }
.privacy-badge strong { color: var(--ink); }
.tool-limits { max-width: 780px; margin: .5rem auto 0; font-size: .82rem; color: var(--ink-faint); text-align: center; }

.nojs-note {
  max-width: 780px; margin: 1rem auto 0; padding: .8rem 1rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--warm-soft); color: var(--ink); font-size: .9rem;
}

/* --- Slots de publicidad --- */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  min-height: 96px; margin: 2rem auto; max-width: 970px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface-2); color: var(--ink-faint);
  font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-family: var(--mono);
}
.ad-slot--in-content { min-height: 250px; }

/* --- Pasos --- */
.steps { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-top: 1.4rem; }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.15rem; box-shadow: var(--shadow-sm);
}
.step-num {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: .9rem;
  font-family: var(--mono); margin-bottom: .6rem;
}
.step h3 { font-size: 1.02rem; margin-bottom: .3rem; }
.step p { font-size: .9rem; color: var(--ink-soft); }

/* --- FAQ --- */
.faq { margin-top: 1.2rem; max-width: var(--maxw-prose); }
.faq details {
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  margin-bottom: .6rem; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: .9rem 1.05rem; font-weight: 600; font-size: .97rem;
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-family: var(--mono); font-size: 1.15rem; color: var(--accent-ink);
  transition: transform .25s var(--ease-out); flex: none;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 1.05rem 1rem; color: var(--ink-soft); font-size: .94rem; }
.faq details > div p + p { margin-top: .7rem; }

/* --- Tarjetas de herramientas / guias --- */
.card-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-top: 1.3rem; }
.card {
  display: flex; flex-direction: column; gap: .45rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1.2rem; box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease-out), box-shadow .3s var(--ease-out), border-color .3s var(--ease-out);
}
a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.card-icon { width: 34px; height: 34px; color: var(--accent); margin-bottom: .2rem; }
.card h3 { font-size: 1.05rem; }
.card p { font-size: .9rem; color: var(--ink-soft); }
.card-tag {
  margin-top: auto; padding-top: .55rem; font-family: var(--mono); font-size: .72rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink);
}

/* --- Secciones --- */
.section { padding: clamp(2rem, 1.4rem + 2.6vw, 3.4rem) 0; }
.section-head { max-width: var(--maxw-prose); }
.section-head h2 { margin-bottom: .5rem; }
.section-head p { color: var(--ink-soft); }
.section--alt { background: var(--bg-deep); border-block: 1px solid var(--line); }

/* --- Migas --- */
.breadcrumb { font-size: .82rem; color: var(--ink-faint); padding-top: 1.1rem; }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--accent-ink); }
.breadcrumb span { margin-inline: .35rem; opacity: .6; }

/* --- Pie --- */
.site-footer {
  margin-top: 2rem; border-top: 1px solid var(--line);
  background: var(--surface); padding: 2.2rem 0 2.6rem;
}
.footer-grid { display: grid; gap: 1.6rem; grid-template-columns: 1fr; }
.footer-col h4 {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: .6rem; font-weight: 600;
}
.footer-col ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.footer-col a { font-size: .9rem; color: var(--ink-soft); }
.footer-col a:hover { color: var(--accent-ink); }
.footer-langs {
  display: flex; flex-wrap: wrap; gap: .35rem 1rem;
  margin-top: 1.6rem; padding-top: 1.2rem; border-top: 1px solid var(--line);
  font-size: .85rem;
}
.footer-langs a { color: var(--ink-soft); }
.footer-langs a:hover { color: var(--accent-ink); }
.footer-bottom {
  margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center;
  font-size: .82rem; color: var(--ink-faint);
}
.footer-credits { font-size: .78rem; color: var(--ink-faint); margin-top: .5rem; line-height: 1.5; }
.footer-credits a { text-decoration: underline; text-underline-offset: 2px; }

/* --- Home hero --- */
.home-hero { padding: clamp(2.2rem, 1.4rem + 3.6vw, 4.4rem) 0 1rem; text-align: center; }
.home-hero h1 { margin-bottom: .7rem; }
.home-hero .lede { margin-inline: auto; }
.hero-badges { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1.2rem; }
.hero-badge {
  display: inline-flex; align-items: center; gap: .38rem;
  padding: .38rem .75rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft);
}
.hero-badge svg { width: 14px; height: 14px; color: var(--ok); }

/* --- Asistente de formatos --- */
.wizard {
  display: grid; gap: 1.2rem; grid-template-columns: 1fr;
  margin-top: 1.4rem; align-items: start; max-width: 980px;
}
.wz-questions { display: flex; flex-direction: column; gap: .85rem; }
.wz-group {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow-sm); border-width: 1px; min-width: 0;
}
.wz-q {
  font-family: var(--display); font-weight: 600; font-size: 1rem;
  margin-bottom: .75rem; padding: 0;
  /* Un <legend> se coloca encima del borde del fieldset; con float vuelve
     a comportarse como un bloque normal dentro de la tarjeta. */
  float: left; width: 100%;
}
.wz-options { display: flex; flex-direction: column; gap: .45rem; clear: both; }
.wz-opt {
  display: flex; align-items: center; gap: .6rem; cursor: pointer;
  padding: .58rem .75rem; border: 1px solid var(--line); border-radius: 10px;
  font-size: .93rem; color: var(--ink-soft);
  transition: border-color .2s var(--ease-out), background-color .2s var(--ease-out), color .2s var(--ease-out);
}
.wz-opt:hover { border-color: var(--accent); color: var(--ink); }
.wz-opt input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; margin: 0; }
.wz-opt:has(input:checked) {
  border-color: var(--accent); background: var(--accent-soft);
  color: var(--ink); font-weight: 600;
}
.wz-panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 1.2rem 1.3rem; box-shadow: var(--shadow-md); min-width: 0;
}
.wz-empty { color: var(--ink-faint); font-size: .93rem; }
.wz-title { font-size: 1.15rem; margin-bottom: .85rem; }
.wz-chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.1rem; }
.wz-chip {
  padding: .35rem .7rem; border-radius: 999px; background: var(--surface-2);
  border: 1px solid var(--line); font-size: .84rem; font-weight: 600; color: var(--ink-soft);
}
.wz-chip--fmt {
  background: var(--accent); border-color: var(--accent); color: #fff;
  font-family: var(--display); font-size: .95rem; padding: .35rem .95rem;
}
.wz-why {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: .55rem; font-weight: 600;
}
.wz-reasons {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: .5rem; font-size: .9rem; color: var(--ink-soft);
}
.wz-reasons li { padding-left: 1.15rem; position: relative; }
.wz-reasons li::before { content: "→"; position: absolute; left: 0; color: var(--accent-ink); }
.wz-actions { margin-top: 1.2rem; }
.wz-actions .btn { display: flex; width: 100%; }
.wz-also { margin-top: .75rem; font-size: .86rem; color: var(--ink-faint); }
.wz-also a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.wz-reset { margin-top: .3rem; }

/* --- Pagina 404 --- */
.notfound { max-width: var(--maxw); }
.notfound > [data-nf-lang] { display: none; }
.notfound > [data-nf-lang="en"] { display: block; }   /* respaldo sin JavaScript */
html.is-ready .notfound > [data-nf-lang] { display: block; }
html.is-ready .notfound > [data-nf-lang][hidden] { display: none !important; }
.nf-code {
  font-family: var(--mono); font-size: clamp(3rem, 2rem + 6vw, 5.5rem);
  line-height: 1; letter-spacing: -.04em; margin-bottom: .8rem;
  background: linear-gradient(120deg, var(--accent), var(--warm));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nf-title { font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.3rem); margin-bottom: .5rem; }
.notfound .card-grid { margin-top: 1.6rem; }
.nf-home { margin-top: 1.6rem; }

/* --- Chooser raiz --- */
.chooser { min-height: 100svh; display: grid; place-items: center; padding: 2.5rem var(--gutter); text-align: center; }
.chooser-inner { max-width: 46rem; }
.chooser .brand { justify-content: center; font-size: 1.5rem; margin-bottom: 1.2rem; }
.chooser h1 { margin-bottom: .8rem; }
.chooser p { color: var(--ink-soft); max-width: 38rem; margin-inline: auto; }
.chooser-links {
  display: grid; gap: .6rem; margin-top: 2rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.chooser-lang {
  display: flex; flex-direction: column; align-items: flex-start; gap: .06rem;
  padding: .8rem .95rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); text-align: left;
  transition: transform .25s var(--ease-out), border-color .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.chooser-lang:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.chooser-code {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .12em;
  color: var(--accent-ink); font-weight: 700;
}
.chooser-name { font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--ink); }
.chooser-claim { font-size: .78rem; color: var(--ink-faint); }

/* =============================================================
   7. Efectos
   ============================================================= */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity .6s var(--ease-out), transform .6s var(--ease-out); }
html:not(.is-ready) .reveal { opacity: 1; transform: none; }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .chooser-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 960px) {
  .wizard { grid-template-columns: 1.05fr .95fr; }
  .wz-panel { position: sticky; top: 84px; }
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
@media (max-width: 719px) {
  .header-nav a.nav-hide-sm { display: none; }
  .file-row { grid-template-columns: 40px 1fr; }
  .file-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .file-thumb { width: 40px; height: 40px; }
}

/* =============================================================
   9. Reduced-motion (solo efectos intrusivos)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal.is-in { opacity: 1; transform: none; transition: none; }
}
