/* =====================================================================
   CorteOptimizador · hoja de estilos
   Concepto: hoja de taller. Papel técnico con trama milimétrica, tinta
   grafito, cinta métrica amarilla y lápiz rojo de carpintero para los cortes.
   Archivo (ancho variable) para títulos e interfaz, Source Serif 4 para leer
   guías largas, IBM Plex Mono para medidas.
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --paper: #f2f3ef;
  --surface: #ffffff;
  --sunk: #f8f9f6;
  --field: #ffffff;
  --ink: #1c2226;
  --ink-2: #333b3f;
  --muted: #5b676d;
  --line: #d8dcd6;
  --line-strong: #b5bdb8;
  --grid: rgba(28, 34, 38, .055);
  --accent: #f5b800;          /* cinta métrica */
  --accent-deep: #d39a00;
  --accent-tint: #fff6d6;
  --on-accent: #1c2226;
  --cut: #c93a24;             /* lápiz de carpintero */
  --cut-tint: #fdf0ec;
  --ok: #2c7a4d;
  --warn: #b3471d;
  --board: #efe3cb;
  --band: #1c2226;            /* franjas oscuras (cabecera, compra) */
  --on-band: #f2f3ef;
  --on-band-muted: #c9d0cc;

  --f-display: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-read: "Source Serif 4", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-card: 14px;
  --r-ctl: 8px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --maxw: 1200px;
  --measure: 68ch;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14181a; --surface: #1b2124; --sunk: #172023; --field: #111618; --ink: #e9ece8; --ink-2: #cfd5d1; --muted: #98a4a0;
    --line: #2c3539; --line-strong: #435055; --grid: rgba(233, 236, 232, .045);
    --accent: #f5b800; --accent-deep: #c08a00; --accent-tint: #2c2712; --on-accent: #1c2226;
    --cut: #ff7a5e; --cut-tint: #33201b; --ok: #5cc28a; --warn: #f09a6e; --board: #3a3326;
    --band: #0e1113; --on-band: #e9ece8; --on-band-muted: #a7b2ae;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14181a; --surface: #1b2124; --sunk: #172023; --field: #111618; --ink: #e9ece8; --ink-2: #cfd5d1; --muted: #98a4a0;
  --line: #2c3539; --line-strong: #435055; --grid: rgba(233, 236, 232, .045);
  --accent: #f5b800; --accent-deep: #c08a00; --accent-tint: #2c2712; --on-accent: #1c2226;
  --cut: #ff7a5e; --cut-tint: #33201b; --ok: #5cc28a; --warn: #f09a6e; --board: #3a3326;
  --band: #0e1113; --on-band: #e9ece8; --on-band-muted: #a7b2ae;
  color-scheme: dark;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--f-display); font-size: 16px; line-height: 1.55;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.12; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
main [id] { scroll-margin-top: calc(72px + env(safe-area-inset-top, 0px)); }

.wrap {
  width: 100%; max-width: var(--maxw); margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
@media (min-width: 720px) { .wrap { padding-left: max(32px, env(safe-area-inset-left, 0px)); padding-right: max(32px, env(safe-area-inset-right, 0px)); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem; background: var(--accent); color: var(--on-accent); z-index: 99; border-radius: 8px; font-weight: 700; }
.skip-link:focus { top: calc(1rem + env(safe-area-inset-top, 0px)); }
.mono, .num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.fill-me { background: var(--accent); color: var(--on-accent); padding: 0 .3em; border-radius: 3px; font-weight: 700; }

/* ---------- 3. Cabecera ---------- */
.site-header { background: var(--band); color: var(--on-band); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 58px; }
.logo { display: flex; align-items: center; gap: .55rem; text-decoration: none; font-weight: 800; font-size: 1.12rem; letter-spacing: -.01em; font-stretch: 92%; white-space: nowrap; }
.logo svg { color: var(--on-band); }
.nav-toggle { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .7rem; border: 1px solid rgba(255,255,255,.22); border-radius: 8px; font-weight: 700; font-size: .88rem; color: var(--on-band); }
.header-nav { display: none; }
.header-nav a { text-decoration: none; color: var(--on-band-muted); font-weight: 600; font-size: .92rem; padding: .35rem 0; border-bottom: 2px solid transparent; }
.header-nav a:hover { color: var(--on-band); }
.header-nav a[aria-current="page"] { color: var(--on-band); border-bottom-color: var(--accent); }
.site-header.is-open .header-nav {
  display: grid; position: absolute; left: 0; right: 0; top: 100%; gap: 0;
  background: var(--band); border-top: 1px solid rgba(255,255,255,.1);
  padding: 6px max(16px, env(safe-area-inset-right, 0px)) 14px max(16px, env(safe-area-inset-left, 0px));
}
.site-header.is-open .header-nav a { padding: .7rem 0; border-bottom: 1px solid rgba(255,255,255,.08); }
@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .header-nav { display: flex; gap: 1.6rem; }
}

/* ---------- 4. Hero de portada ---------- */
.hero {
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 10px 10px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 10px 10px;
  border-bottom: 1px solid var(--line);
}
.hero-inner { padding-block: clamp(26px, 4.5vw, 52px) clamp(18px, 3vw, 28px); display: grid; gap: 14px; }
.eyebrow { font-family: var(--f-mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hero h1 {
  font-size: clamp(2rem, 1.2rem + 3.6vw, 3.6rem); font-weight: 800; font-stretch: 72%;
  letter-spacing: -.02em; max-width: 18ch; line-height: 1.02;
}
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--accent) 62%, var(--accent) 92%, transparent 92%); padding-inline: .05em; }
.hero-sub { color: var(--ink-2); max-width: 60ch; font-size: clamp(1rem, .95rem + .3vw, 1.14rem); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .86rem; color: var(--muted); list-style: none; padding: 0; }
.hero-facts li { display: flex; align-items: center; gap: 6px; }
.hero-facts li::before { content: ""; width: 7px; height: 7px; background: var(--accent); border-radius: 1px; }
.ruler {
  height: 16px; max-width: 560px; opacity: .8;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 50px) bottom / 100% 16px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 10px) bottom / 100% 7px no-repeat;
  border-bottom: 2px solid var(--ink);
}

/* ---------- 5. Herramienta: sus estilos van en v2/tool.css (encerrados en .tool) ---------- */
.tool { padding-block: clamp(18px, 3vw, 28px) 4px; }

/* ---------- 6. Secciones de portada ---------- */
.section { padding-block: clamp(40px, 6vw, 72px) 0; }
.section-head { display: grid; gap: 6px; margin-bottom: 22px; max-width: 70ch; }
.section h2, .h2 { font-size: clamp(1.5rem, 1.1rem + 1.5vw, 2.2rem); font-weight: 800; font-stretch: 78%; letter-spacing: -.01em; }
.section-head p { color: var(--muted); }
.steps { list-style: none; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.steps li { background: var(--surface); padding: 20px; display: grid; gap: 6px; align-content: start; }
.steps .step-k { font-family: var(--f-mono); font-size: .78rem; color: var(--muted); }
.steps h3 { font-size: 1.08rem; }
.steps p { color: var(--muted); font-size: .95rem; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }

/* Ejemplo resuelto */
.worked { display: grid; gap: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: clamp(18px, 3vw, 32px); }
.worked-cols { display: grid; gap: 22px; }
@media (min-width: 900px) { .worked-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; } }
.worked figure { margin: 0; display: grid; gap: 8px; }
.worked figcaption { font-size: .84rem; color: var(--muted); }
.diagram { background: #ffffff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; overflow-x: auto; }
.diagram svg { width: 100%; height: auto; min-width: 280px; }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.compare div { background: var(--sunk); padding: 12px 14px; display: grid; gap: 2px; }
.compare dt { font-size: .76rem; color: var(--muted); font-weight: 600; }
.compare dd { margin: 0; font-family: var(--f-mono); font-size: 1.05rem; font-weight: 600; }
.compare .good dd { color: var(--ok); }

/* Rejilla de guías */
.guide-grid { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.guide-card { display: grid; gap: 8px; align-content: start; height: 100%; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); text-decoration: none; transition: border-color .15s, transform .2s var(--ease-out); }
.guide-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.guide-card .tag { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.guide-card h3 { font-size: 1.1rem; font-stretch: 90%; }
.guide-card p { color: var(--muted); font-size: .92rem; }
.guide-card .read { font-size: .8rem; color: var(--muted); font-family: var(--f-mono); }

.uses { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.uses > div { background: var(--surface); padding: 16px 18px; display: grid; gap: 4px; align-content: start; }
.uses h3 { font-size: 1rem; }
.uses p { color: var(--muted); font-size: .92rem; }
.uses a { font-size: .86rem; font-weight: 700; }
@media (min-width: 560px) { .uses { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .uses { grid-template-columns: repeat(3, 1fr); } }

.trust { display: grid; gap: 18px; padding: clamp(18px, 3vw, 30px); border-radius: var(--r-card); background: var(--band); color: var(--on-band); }
.trust h2 { color: var(--on-band); }
.trust p { color: var(--on-band-muted); }
.trust a { color: var(--accent); font-weight: 700; }
.trust-cols { display: grid; gap: 18px; }
@media (min-width: 820px) { .trust-cols { grid-template-columns: repeat(3, 1fr); } }
.trust h3 { font-size: 1rem; color: var(--on-band); margin-bottom: 4px; }

.faq details { border-bottom: 1px solid var(--line); max-width: 80ch; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--muted); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 14px; color: var(--ink-2); font-family: var(--f-read); font-size: 1.04rem; }

/* ---------- 7. Páginas de lectura (guías, materiales, institucionales) ---------- */
.crumbs { font-size: .82rem; color: var(--muted); padding-top: 18px; }
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { color: var(--muted); }
.page-head { padding-block: 14px clamp(20px, 3vw, 30px); display: grid; gap: 12px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(1.9rem, 1.2rem + 2.8vw, 3.1rem); font-weight: 800; font-stretch: 74%; letter-spacing: -.02em; max-width: 24ch; line-height: 1.04; }
.lead { font-family: var(--f-read); font-size: clamp(1.08rem, 1rem + .35vw, 1.25rem); color: var(--ink-2); max-width: 62ch; line-height: 1.5; }
.byline { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .84rem; color: var(--muted); }
.byline span { display: inline-flex; align-items: center; gap: 6px; }

.read-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: clamp(22px, 3vw, 36px); }
@media (min-width: 1040px) { .read-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 56px; } }
.toc { display: none; }
@media (min-width: 1040px) {
  .toc { display: block; position: sticky; top: calc(76px + env(safe-area-inset-top, 0px)); align-self: start; font-size: .86rem; }
  .toc p { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
  .toc ol { list-style: none; padding: 0; display: grid; gap: 2px; border-left: 2px solid var(--line); }
  .toc a { display: block; padding: 4px 0 4px 12px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
  .toc a:hover, .toc a.is-here { color: var(--ink); border-left-color: var(--accent); }
}

.prose { max-width: var(--measure); font-family: var(--f-read); font-size: 1.1rem; line-height: 1.68; color: var(--ink-2); min-width: 0; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { font-family: var(--f-display); color: var(--ink); font-size: clamp(1.35rem, 1.15rem + .8vw, 1.75rem); font-weight: 800; font-stretch: 82%; margin-top: 2em; scroll-margin-top: 80px; }
.prose h3 { font-family: var(--f-display); color: var(--ink); font-size: 1.15rem; font-weight: 750; margin-top: 1.6em; }
.prose h2 + *, .prose h3 + * { margin-top: .55em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose strong { color: var(--ink); }
.prose a { color: var(--ink); text-decoration-color: var(--accent-deep); text-decoration-thickness: 2px; }
.prose a:hover { background: var(--accent-tint); }
.prose code, .prose .mono { font-size: .9em; }

.summary-box { font-family: var(--f-display); font-size: .98rem; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 0 12px 12px 0; padding: 16px 18px; }
.summary-box h2 { font-size: .78rem !important; font-family: var(--f-mono) !important; letter-spacing: .08em; text-transform: uppercase; color: var(--muted) !important; margin: 0 0 8px !important; font-weight: 600 !important; }
.summary-box ul { padding-left: 1.1em; }
.callout { font-family: var(--f-display); font-size: .97rem; background: var(--sunk); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.callout-title { font-weight: 800; color: var(--ink); display: block; margin-bottom: 4px; }
.callout.warn { background: var(--cut-tint); border-color: color-mix(in srgb, var(--cut) 40%, var(--line)); }
.example { font-family: var(--f-display); font-size: .97rem; border: 1px dashed var(--line-strong); border-radius: 12px; padding: 16px 18px; background: var(--surface); }
.example .callout-title::before { content: "Ejemplo de taller · "; font-family: var(--f-mono); font-weight: 500; font-size: .78rem; color: var(--muted); letter-spacing: .04em; }
.example ol, .example ul { padding-left: 1.2em; }
.calc-line { font-family: var(--f-mono); font-size: .9rem; background: var(--sunk); border-radius: 6px; padding: 8px 10px; display: block; overflow-x: auto; white-space: nowrap; margin-top: 6px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-family: var(--f-display); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
.table-wrap caption { text-align: left; padding: 12px 14px 4px; font-weight: 700; color: var(--ink); font-size: .92rem; }
.table-wrap th { text-align: left; font-size: .76rem; color: var(--muted); font-weight: 700; padding: 8px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-wrap td { padding: 8px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap tr:last-child td { border-bottom: 0; }
.table-wrap td.n { font-family: var(--f-mono); white-space: nowrap; }
.table-note { font-family: var(--f-display); font-size: .82rem; color: var(--muted); margin-top: 6px !important; }

.prose figure { margin-inline: 0; display: grid; gap: 8px; }
.prose figcaption { font-family: var(--f-display); font-size: .84rem; color: var(--muted); }

.cta-band { font-family: var(--f-display); display: grid; gap: 10px; padding: 20px; border-radius: var(--r-card); background: var(--band); color: var(--on-band); }
.cta-band p { color: var(--on-band-muted); font-size: .96rem; }
.cta-band strong { color: var(--on-band); font-size: 1.1rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 10px; font-weight: 800; text-decoration: none; background: var(--accent); color: var(--on-accent) !important; box-shadow: inset 0 -3px 0 var(--accent-deep); justify-self: start; }
.btn:hover { filter: brightness(1.06); background: var(--accent) !important; }
.btn.ghost { background: transparent; color: var(--ink) !important; border: 1.5px solid var(--line-strong); box-shadow: none; }

.author-box { font-family: var(--f-display); display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: start; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.author-box .avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; }
.author-box p { font-size: .92rem; color: var(--muted); }
.author-box strong { color: var(--ink); }

.related { display: grid; gap: 10px; }
.related h2 { font-size: 1.1rem !important; margin-top: 0 !important; }
.related ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.related a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-decoration: none; font-family: var(--f-display); font-weight: 700; font-size: .95rem; }
.related a:hover { border-color: var(--ink); background: var(--surface); }
.related a small { display: block; font-weight: 500; color: var(--muted); font-size: .84rem; }

/* ---------- 8. Calculadoras ---------- */
/* Campos de formulario de las calculadoras (las herramientas usan los suyos, en v2/tool.css) */
.calc .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: 10px; }
.calc .row .grow { grid-column: 1 / -1; }
.calc .row[hidden] { display: none !important; }
.calc .field { display: grid; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--muted); min-width: 0; align-content: start; }
.calc .field[hidden] { display: none !important; }
.calc .field input, .calc .field select {
  width: 100%; min-width: 0; height: 42px; padding: 0 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl); background: var(--field);
  font: inherit; font-size: .98rem; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s;
}
.calc .field input:focus, .calc .field select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(245, 184, 0, .35); }
.calc .check { display: flex; align-items: center; gap: 8px; font-size: .92rem; font-weight: 500; color: var(--ink); }
.calc .check input { width: 18px; height: 18px; accent-color: var(--accent-deep); margin: 0; }
.hint { font-size: .84rem; color: var(--muted); }
.calc-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.calc { display: grid; gap: 12px; align-content: start; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); scroll-margin-top: 80px; }
.calc h2 { font-size: 1.2rem !important; font-stretch: 86%; }
.calc > p { color: var(--muted); font-size: .92rem; }
.calc-out { border-radius: 10px; background: var(--band); color: var(--on-band); padding: 12px 14px; display: grid; gap: 2px; }
.calc-out .big { font-family: var(--f-mono); font-size: 1.5rem; font-weight: 600; color: var(--accent); }
.calc-out small { color: var(--on-band-muted); font-size: .84rem; }
.calc-how { font-size: .84rem; color: var(--muted); }
.calc-how summary { cursor: pointer; font-weight: 700; color: var(--ink); }
.calc-how p { margin-top: 6px; }

/* ---------- 9. Publicidad (sin huecos visibles: si no hay anuncio, no ocupa nada) ---------- */
.ad-unit { margin-block: 28px; }
.ad-unit:empty, .ad-unit ins[data-ad-status="unfilled"] { display: none !important; }
.ad-unit::before { content: "Publicidad"; display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }

/* ---------- 10. Pie ---------- */
.site-footer { margin-top: clamp(56px, 8vw, 96px); border-top: 1px solid var(--line); background: var(--surface); padding-block: 36px 28px; font-size: .9rem; }
.footer-grid { display: grid; gap: 26px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-grid h2 { font-size: .74rem; font-family: var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.footer-grid ul { list-style: none; padding: 0; display: grid; gap: 6px; }
.footer-grid a { color: var(--ink-2); text-decoration: none; }
.footer-grid a:hover { text-decoration: underline; }
.footer-about p { color: var(--muted); max-width: 40ch; margin-top: 8px; }
.footer-base { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: .8rem; color: var(--muted); }

/* ---------- 11. Movimiento e impresión ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; color: #000; }
  .site-header, .hero, .mode-switch, .tool-inputs, .privacy, .ad-unit, .section, .site-footer, .viewer-bar, .piece-info, .downloads, .project-name, .options, .skip-link, .crumbs, .toc { display: none !important; }
  .tool-card { border: 0; box-shadow: none; }
  .tool-grid { display: block; }
  .tool-output { border: 0; padding: 0; background: #fff; }
  .buy { background: #fff; color: #000; border: 2px solid #000; }
  .plan { height: 150mm; border: 0; }
  .viewer, .cutlist { border: 0; break-inside: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- 12. Capa visual 2.1: hero con plano, ficha de guía, miniaturas ---------- */
.hero-inner { grid-template-columns: minmax(0, 1fr); align-items: center; column-gap: 48px; }
@media (min-width: 980px) { .hero-inner { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); padding-block: 56px 48px; } }
.hero-copy { display: grid; gap: 16px; align-content: start; min-width: 0; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-cta .btn { justify-self: auto; }
.hero-plan { margin: 0; display: grid; gap: 8px; min-width: 0; }
.hero-plan figcaption { font-size: .8rem; color: var(--muted); }
.sheet-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden;
  box-shadow: 0 1px 0 rgba(28,34,38,.05), 0 30px 60px -36px rgba(28,34,38,.55);
  transform: rotate(-.6deg);
}
.sheet-bar { display: flex; justify-content: space-between; gap: 10px; padding: 9px 14px; background: var(--band); color: var(--on-band-muted); font-family: var(--f-mono); font-size: .72rem; letter-spacing: .03em; }
.sheet-bar span:first-child { color: var(--on-band); }
.sheet-svg { background: #ffffff; padding: 10px 12px 6px; }
.sheet-svg svg { width: 100%; height: auto; }
.sheet-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.sheet-stats div { padding: 9px 12px; display: grid; gap: 1px; }
.sheet-stats div + div { border-left: 1px solid var(--line); }
.sheet-stats dt { font-size: .68rem; color: var(--muted); font-weight: 600; }
.sheet-stats dd { margin: 0; font-family: var(--f-mono); font-weight: 600; font-size: 1rem; }
.sheet-stats div:nth-child(2) dd { color: var(--ok); }
@media (max-width: 520px) { .sheet-stats { grid-template-columns: repeat(2, 1fr); } .sheet-stats div:nth-child(3) { border-left: 0; } .sheet-stats div:nth-child(n+3) { border-top: 1px solid var(--line); } }

/* Animación de carga: las piezas se colocan una a una (estado final visible siempre) */
@media (prefers-reduced-motion: no-preference) {
  .plan-anim .pp { animation: place .55s var(--ease-out) both; animation-delay: calc(250ms + var(--i) * 110ms); transform-box: fill-box; transform-origin: center; }
  @keyframes place { from { opacity: .25; transform: scale(.82); } to { opacity: 1; transform: none; } }
  .sheet-card { transition: transform .4s var(--ease-out); }
  .hero-plan:hover .sheet-card { transform: rotate(0deg); }
}

/* Banda de cabecera en páginas interiores */
.page-band {
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 10px 10px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 10px 10px;
  border-bottom: 1px solid var(--line);
}
.page-band .page-head { border-bottom: 0; padding-bottom: clamp(24px, 3.5vw, 40px); }
.page-head-text { display: grid; gap: 12px; align-content: start; min-width: 0; }
.page-head.has-spec { display: grid; gap: 24px; }
@media (min-width: 980px) { .page-head.has-spec { grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; } }
.spec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; display: grid; }
.spec-thumb { aspect-ratio: 32 / 15; max-width: 100%; border-bottom: 1px solid var(--line); }
.spec-thumb svg { width: 100%; height: 100%; }
.spec dl { display: grid; }
.spec dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: .86rem; }
.spec dt { color: var(--muted); }
.spec dd { margin: 0; font-family: var(--f-mono); font-weight: 600; text-align: right; }
.spec .btn { margin: 14px 16px 16px; justify-self: stretch; }
@media (max-width: 979px) { .spec { display: none; } }

/* Barra de lectura (cinta métrica) */
.read-progress { position: sticky; top: calc(58px + env(safe-area-inset-top, 0px)); z-index: 39; height: 3px; background: transparent; }
.read-progress span { display: block; height: 100%; width: 0; background: var(--accent); }

/* Tarjetas de guía con miniatura de plano */
.guide-card { padding: 0; overflow: hidden; gap: 0; }
.guide-card .thumb { display: block; aspect-ratio: 32 / 13; max-width: 100%; border-bottom: 1px solid var(--line); overflow: hidden; }
.guide-card .thumb svg { width: 100%; height: 100%; transition: transform .5s var(--ease-out); }
.guide-card:hover .thumb svg { transform: scale(1.04); }
.guide-card .tag, .guide-card h3, .guide-card p, .guide-card .read { margin-inline: 18px; }
.guide-card .tag { margin-top: 16px; }
.guide-card h3 { margin-top: 6px; }
.guide-card p { margin-top: 8px; }
.guide-card .read { margin-top: 12px; margin-bottom: 16px; }

/* Ejemplo: antes / después */
.worked-cols.stack { grid-template-columns: minmax(0, 1fr) !important; }
.worked-cols.stack .prose { max-width: 75ch; }
.before-after { margin: 0; display: grid; gap: 18px; }
@media (min-width: 900px) { .before-after { grid-template-columns: repeat(2, minmax(0, 1fr)); } .before-after figcaption { grid-column: 1 / -1; } }
.ba-col { display: grid; gap: 10px; align-content: start; min-width: 0; }
.ba-boards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ba-label { font-family: var(--f-mono); font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.ba-label::before { content: ""; width: 10px; height: 10px; border-radius: 2px; }
.ba-label.bad::before { background: var(--cut); }
.ba-label.good::before { background: var(--ok); }
.compare.good dd { color: var(--ok); }
.before-after .diagram svg { min-width: 0; }

/* Correos y medidas largas no empujan el ancho de la página */
.author-box > div, .callout, .prose li, .prose p { min-width: 0; }
span.mono, a.mono { overflow-wrap: anywhere; }
