/* ====================================================================
   QR3D — sistema visual
   Tinta azul-negra, gris frío sesgado al acento, un solo acento
   ultramar. Tipografía: Archivo (títulos), Public Sans (texto),
   IBM Plex Mono (medidas y etiquetas técnicas).
   ==================================================================== */
:root{
  --bg:#F3F5F8; --bg-grid:#E3E7EE;
  --surface:#FFFFFF; --surface-2:#EDF0F5; --surface-3:#E4E8EF;
  --ink:#141822; --ink-2:#3A4152; --muted:#69718330; --text-muted:#697183;
  --line:#DCE1E9; --line-strong:#C6CDD9;
  --accent:#2946E8; --accent-ink:#FFFFFF; --accent-soft:#E6EAFD; --accent-line:#B9C3F8;
  --ok:#0F7A52; --ok-soft:#E2F3EC;
  --warn:#A96908; --warn-soft:#FBF0DC;
  --bad:#BB362B; --bad-soft:#FBE7E4;
  --shadow:0 1px 2px rgba(20,24,34,.05), 0 8px 24px -12px rgba(20,24,34,.18);
  --shadow-lg:0 2px 4px rgba(20,24,34,.06), 0 24px 60px -24px rgba(20,24,34,.28);
  --r:14px; --r-sm:9px;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#0E1117; --bg-grid:#1A1F29;
    --surface:#161A23; --surface-2:#1D222D; --surface-3:#252B38;
    --ink:#E9ECF3; --ink-2:#B4BCCB; --text-muted:#8B94A5;
    --line:#272D3A; --line-strong:#39414F;
    --accent:#7C8CFF; --accent-ink:#0B0E14; --accent-soft:#1C2340; --accent-line:#39457A;
    --ok:#4FC694; --ok-soft:#12241E;
    --warn:#E5A742; --warn-soft:#2A2113;
    --bad:#F0776A; --bad-soft:#2C1815;
    --shadow:0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
    --shadow-lg:0 2px 4px rgba(0,0,0,.45), 0 24px 60px -24px rgba(0,0,0,.75);
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#0E1117; --bg-grid:#1A1F29;
  --surface:#161A23; --surface-2:#1D222D; --surface-3:#252B38;
  --ink:#E9ECF3; --ink-2:#B4BCCB; --text-muted:#8B94A5;
  --line:#272D3A; --line-strong:#39414F;
  --accent:#7C8CFF; --accent-ink:#0B0E14; --accent-soft:#1C2340; --accent-line:#39457A;
  --ok:#4FC694; --ok-soft:#12241E;
  --warn:#E5A742; --warn-soft:#2A2113;
  --bad:#F0776A; --bad-soft:#2C1815;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  --shadow-lg:0 2px 4px rgba(0,0,0,.45), 0 24px 60px -24px rgba(0,0,0,.75);
  color-scheme:dark;
}

*{box-sizing:border-box}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font-family:"Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size:16px; line-height:1.6; -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{font-family:"Archivo", ui-sans-serif, system-ui, sans-serif; margin:0; line-height:1.12; text-wrap:balance; letter-spacing:-.018em}
p{margin:0}
a{color:var(--accent); text-decoration-thickness:1px; text-underline-offset:3px}
button, input, select, textarea{font:inherit; color:inherit}
:focus-visible{outline:2.5px solid var(--accent); outline-offset:2px; border-radius:4px}
.mono{font-family:"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-variant-numeric:tabular-nums}
.wrap{width:min(1220px, calc(100% - 40px)); margin-inline:auto}
.measure{width:min(720px, calc(100% - 40px)); margin-inline:auto}
.sr{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap}

/* ---------- cabecera ---------- */
.top{
  position:sticky; top:0; z-index:40;
  background:color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter:saturate(1.6) blur(10px);
  border-bottom:1px solid var(--line);
}
.top-in{display:flex; align-items:center; gap:16px; padding:12px 0; justify-content:space-between}
.brand{display:flex; align-items:center; gap:10px; font-family:"Archivo",sans-serif; font-weight:800; font-size:19px; letter-spacing:-.03em}
.brand svg{display:block}
.brand em{font-style:normal; color:var(--accent)}
.top-actions{display:flex; align-items:center; gap:8px}
.chip{
  display:inline-flex; align-items:center; gap:6px; height:34px; padding:0 12px;
  border:1px solid var(--line-strong); border-radius:99px; background:var(--surface);
  font-size:13px; font-weight:600; cursor:pointer; transition:border-color .15s, background .15s;
}
.chip:hover{border-color:var(--accent); color:var(--accent)}
.lang{display:flex; border:1px solid var(--line-strong); border-radius:99px; overflow:hidden; background:var(--surface)}
.lang button{
  border:0; background:transparent; padding:0 11px; height:34px; cursor:pointer;
  font-size:12px; font-weight:700; letter-spacing:.06em; color:var(--text-muted);
  font-family:"IBM Plex Mono",monospace;
}
.lang button[aria-pressed="true"]{background:var(--accent); color:var(--accent-ink)}
.lang a{
  display:inline-flex; align-items:center; padding:0 11px; height:34px; text-decoration:none;
  font-family:"IBM Plex Mono",monospace; font-size:12px; font-weight:700; letter-spacing:.06em;
  color:var(--text-muted);
}
.lang a[aria-current="page"]{background:var(--accent); color:var(--accent-ink)}
.lang a:not([aria-current]):hover{color:var(--accent)}

/* ---------- héroe + placa de impresión ---------- */
.hero{
  position:relative; padding:26px 0 18px; overflow:hidden;
}
.hero::before{
  content:""; position:absolute; inset:0; z-index:0; pointer-events:none;
  background-image:linear-gradient(var(--bg-grid) 1px, transparent 1px),
                   linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size:34px 34px;
  mask-image:radial-gradient(120% 85% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image:radial-gradient(120% 85% at 50% 0%, #000 20%, transparent 78%);
}
.hero > *{position:relative; z-index:1}
.eyebrow{
  display:inline-flex; align-items:center; gap:8px; margin-bottom:11px;
  font-family:"IBM Plex Mono",monospace; font-size:11.5px; font-weight:600;
  letter-spacing:.13em; text-transform:uppercase; color:var(--accent);
  background:var(--accent-soft); border:1px solid var(--accent-line);
  padding:5px 11px; border-radius:99px;
}
h1{font-size:clamp(26px, 3.5vw, 39px); font-weight:800; max-width:26ch}
.lede{margin-top:10px; font-size:clamp(15px,1.35vw,16.8px); color:var(--ink-2); max-width:74ch}
.hero-meta{
  display:flex; flex-wrap:wrap; gap:6px 18px; margin-top:13px;
  font-family:"IBM Plex Mono",monospace; font-size:12.5px; color:var(--text-muted);
}
.hero-meta span{display:inline-flex; align-items:center; gap:7px}
.dot-ok{width:6px; height:6px; border-radius:99px; background:var(--ok)}

/* ---------- tarjeta de herramienta ---------- */
.tool{
  margin-top:20px; background:var(--surface); border:1px solid var(--line);
  border-radius:20px; box-shadow:var(--shadow-lg); overflow:hidden;
}
.tool-grid{display:grid; grid-template-columns:minmax(0,.87fr) minmax(0,1.13fr)}
@media (max-width:1000px){ .tool-grid{grid-template-columns:1fr} }
.pane{padding:22px}
.pane + .pane{border-left:1px solid var(--line)}
@media (max-width:1000px){ .pane + .pane{border-left:0; border-top:1px solid var(--line)} }
.pane-head{
  display:flex; align-items:baseline; justify-content:space-between; gap:12px; margin-bottom:14px;
}
.pane-head h2{font-size:15px; font-weight:700; letter-spacing:-.01em}
.step-tag{
  font-family:"IBM Plex Mono",monospace; font-size:11.5px; font-weight:600; letter-spacing:.06em;
  color:var(--text-muted); white-space:nowrap;
}
.field{margin-bottom:15px}
.field > label, .lbl{
  display:block; margin-bottom:7px; font-size:12px; font-weight:700;
  letter-spacing:.055em; text-transform:uppercase; color:var(--text-muted);
  font-family:"IBM Plex Mono",monospace;
}
input[type=text], input[type=url], input[type=password], select{
  width:100%; height:42px; padding:0 12px; border-radius:var(--r-sm);
  border:1px solid var(--line-strong); background:var(--surface-2); color:var(--ink);
  transition:border-color .15s, background .15s;
}
input[type=text]:focus, input[type=url]:focus, input[type=password]:focus, select:focus{
  background:var(--surface); border-color:var(--accent);
}
input::placeholder{color:var(--text-muted); opacity:.75}
.hint{margin-top:6px; font-size:12.5px; color:var(--text-muted)}
.examples{display:flex; flex-wrap:wrap; gap:6px; margin-top:9px}
.examples button{
  height:30px; padding:0 11px; border-radius:99px; cursor:pointer; font-size:12.5px; font-weight:600;
  border:1px solid var(--line-strong); background:var(--surface-2); color:var(--text-muted); transition:.15s;
}
.examples button:hover{border-color:var(--accent); color:var(--accent); background:var(--accent-soft)}

.tabs{display:flex; gap:6px; padding:4px; background:var(--surface-2); border-radius:11px; margin-bottom:16px}
.tabs button{
  flex:1; height:34px; border:0; border-radius:8px; background:transparent; cursor:pointer;
  font-size:13.5px; font-weight:600; color:var(--text-muted); transition:.15s;
}
.tabs button[aria-selected="true"]{background:var(--surface); color:var(--ink); box-shadow:var(--shadow)}

.opts{display:grid; grid-template-columns:repeat(4,1fr); gap:8px}
.opt{
  border:1px solid var(--line-strong); background:var(--surface-2); border-radius:11px;
  padding:9px 6px 8px; cursor:pointer; display:flex; flex-direction:column; align-items:center; gap:6px;
  font-size:11.5px; font-weight:600; color:var(--text-muted); transition:.15s;
}
.opt canvas, .opt svg{display:block; border-radius:5px}
.opt:hover{border-color:var(--line-strong); background:var(--surface-3)}
.opt[aria-pressed="true"]{border-color:var(--accent); background:var(--accent-soft); color:var(--accent)}
.opts-3{grid-template-columns:repeat(3,1fr)}
.opts-3 .opt{padding:11px 6px 9px; gap:8px}

.row{display:grid; grid-template-columns:1fr 1fr; gap:12px}
.swatch{
  display:flex; align-items:center; gap:9px; padding:6px; border-radius:var(--r-sm);
  border:1px solid var(--line-strong); background:var(--surface-2);
}
.swatch input[type=color]{
  inline-size:34px; block-size:34px; padding:0; border:1px solid var(--line-strong);
  border-radius:7px; background:none; cursor:pointer;
}
.swatch .v{font-family:"IBM Plex Mono",monospace; font-size:12.5px; color:var(--text-muted); text-transform:uppercase}

.emoji-row{display:flex; flex-wrap:wrap; gap:5px}
.emoji-row button{
  width:38px; height:38px; font-size:19px; line-height:1; border-radius:9px; cursor:pointer;
  border:1px solid var(--line-strong); background:var(--surface-2); transition:.15s;
}
.emoji-row button:hover{background:var(--surface-3)}
.emoji-row button[aria-pressed="true"]{border-color:var(--accent); background:var(--accent-soft)}

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:9px;
  height:44px; padding:0 18px; border-radius:var(--r-sm); border:1px solid var(--line-strong);
  background:var(--surface-2); font-weight:650; cursor:pointer; transition:.15s; font-size:14.5px;
}
.btn:hover{background:var(--surface-3)}
.btn-primary{
  background:var(--accent); border-color:var(--accent); color:var(--accent-ink);
  box-shadow:0 6px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-primary:hover{background:color-mix(in srgb, var(--accent) 88%, #000)}
.btn-lg{height:54px; font-size:16px; width:100%; font-weight:700}
.btn[disabled]{opacity:.5; cursor:not-allowed}
.btn-ghost{background:transparent; border-color:transparent; color:var(--text-muted); height:34px; padding:0 10px; font-size:13px}
.btn-ghost:hover{background:var(--surface-2); color:var(--ink)}
.btn-row{display:grid; grid-template-columns:1fr 1fr; gap:10px}

.file-btn{position:relative; overflow:hidden}
.file-btn input{position:absolute; inset:0; opacity:0; cursor:pointer}

/* ---------- vistas previas ---------- */
.preview-row{display:grid; grid-template-columns:196px minmax(0,1fr); gap:12px; margin-bottom:18px; min-height:312px}
@media (max-width:1000px){ .preview-row{grid-template-columns:1fr; min-height:0} }
.preview-2d{
  display:flex; align-items:center; justify-content:center; padding:14px;
  border:1px solid var(--line); border-radius:var(--r); background:var(--surface-2);
  background-image:
    linear-gradient(45deg, var(--surface-3) 25%, transparent 25%),
    linear-gradient(-45deg, var(--surface-3) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--surface-3) 75%),
    linear-gradient(-45deg, transparent 75%, var(--surface-3) 75%);
  background-size:18px 18px; background-position:0 0, 0 9px, 9px -9px, -9px 0;
}
.preview-2d canvas{
  width:min(226px, 68%); height:auto; border-radius:6px; display:block;
  box-shadow:0 2px 10px rgba(0,0,0,.10);
}
.viewer{
  position:relative; border:1px solid var(--line); border-radius:var(--r); overflow:hidden;
  background:
    radial-gradient(120% 90% at 50% 8%, color-mix(in srgb, var(--surface) 92%, var(--accent)) 0%, var(--surface-2) 62%, var(--surface-3) 100%);
  min-height:312px;
}
@media (max-width:1000px){ .viewer{aspect-ratio:4/3} }
.check-inline{display:flex; align-items:center; gap:8px; margin-top:9px; font-size:12.5px; color:var(--text-muted)}
.check-inline input{accent-color:var(--accent); width:15px; height:15px}
.viewer canvas{width:100%; height:100%; display:block; cursor:grab; touch-action:none}
.viewer canvas.is-dragging{cursor:grabbing}
.viewer-hint{
  position:absolute; left:12px; bottom:11px; display:flex; align-items:center; gap:7px;
  font-family:"IBM Plex Mono",monospace; font-size:11px; letter-spacing:.04em;
  color:var(--text-muted); background:color-mix(in srgb, var(--surface) 82%, transparent);
  border:1px solid var(--line); padding:4px 9px; border-radius:99px; pointer-events:none;
}
.viewer-tools{position:absolute; right:10px; top:10px; left:10px; display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end}
.viewer-tools .chip{height:30px; padding:0 10px; font-size:12px}
.viewer-state{
  position:absolute; inset:0; display:none; place-items:center; text-align:center; padding:24px;
  color:var(--text-muted); font-size:14px; background:var(--surface-2);
}
.viewer[data-state="loading"] .viewer-state,
.viewer[data-state="error"] .viewer-state{display:grid}
.viewer[data-state="loading"] .viewer-hint,
.viewer[data-state="error"] .viewer-hint{display:none}
.spin{
  width:20px; height:20px; border:2px solid var(--line-strong); border-top-color:var(--accent);
  border-radius:99px; animation:sp .8s linear infinite; margin:0 auto 10px;
}
@keyframes sp{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){ .spin{animation-duration:2.4s} }

/* ---------- avisos de impresión ---------- */
.checks{display:flex; flex-direction:column; gap:7px; margin-top:4px}
.check{
  display:flex; gap:9px; align-items:flex-start; padding:9px 11px; border-radius:var(--r-sm);
  font-size:13.2px; line-height:1.45; border:1px solid transparent;
}
.check b{font-weight:700}
.check-ok{background:var(--ok-soft); color:var(--ok); border-color:color-mix(in srgb, var(--ok) 25%, transparent)}
.check-warn{background:var(--warn-soft); color:var(--warn); border-color:color-mix(in srgb, var(--warn) 30%, transparent)}
.check-bad{background:var(--bad-soft); color:var(--bad); border-color:color-mix(in srgb, var(--bad) 30%, transparent)}
.check .ic{flex:0 0 auto; margin-top:2px}

.specs{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(96px,1fr)); gap:1px;
  background:var(--line); border:1px solid var(--line); border-radius:var(--r-sm); overflow:hidden; margin-top:14px;
}
.spec{background:var(--surface); padding:9px 11px}
.spec dt{font-family:"IBM Plex Mono",monospace; font-size:10.5px; letter-spacing:.08em; text-transform:uppercase; color:var(--text-muted)}
.spec dd{margin:2px 0 0; font-family:"IBM Plex Mono",monospace; font-size:14.5px; font-weight:600; font-variant-numeric:tabular-nums}

.slider{display:flex; align-items:center; gap:12px}
input[type=range]{flex:1; accent-color:var(--accent); height:22px}
.slider .v{font-family:"IBM Plex Mono",monospace; font-size:13px; min-width:52px; text-align:right; color:var(--ink-2)}

.preview-note{
  margin-top:11px; padding:11px 13px; border-radius:var(--r-sm); font-size:13px; line-height:1.5;
  background:var(--warn-soft); color:var(--warn); border:1px solid color-mix(in srgb, var(--warn) 30%, transparent);
}
.privacy{
  display:flex; gap:9px; align-items:center; margin-top:14px; padding:11px 13px;
  border:1px dashed var(--line-strong); border-radius:var(--r-sm);
  font-size:13px; color:var(--text-muted); background:var(--surface-2);
}

/* ---------- separador de capas ---------- */
.layers{height:44px; margin:52px 0 0; opacity:.75;
  background:repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 6px);
  mask-image:linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
  -webkit-mask-image:linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
}

/* ---------- huecos de anuncio ---------- */
.ad{
  display:grid; place-items:center; gap:4px; border:1.5px dashed var(--line-strong);
  border-radius:var(--r); background:var(--surface-2); color:var(--text-muted); text-align:center;
}
.ad b{font-family:"IBM Plex Mono",monospace; font-size:12px; letter-spacing:.24em; font-weight:600}
.ad small{font-family:"IBM Plex Mono",monospace; font-size:10.5px; letter-spacing:.06em; opacity:.75}
.ad-banner{min-height:92px; margin-top:22px}
.ad-inline{min-height:252px; margin:34px 0}
.ad-modal{min-height:236px; width:100%}
.toast{
  position:fixed; right:16px; bottom:16px; z-index:60; width:232px; padding:12px;
  border-radius:var(--r); border:1.5px dashed var(--line-strong); background:var(--surface);
  box-shadow:var(--shadow-lg); display:none;
}
.toast[data-open="1"]{display:block}
.toast .ad{min-height:96px; border:0; background:var(--surface-2)}
.toast .x{
  position:absolute; top:6px; right:6px; width:24px; height:24px; border-radius:99px;
  border:1px solid var(--line-strong); background:var(--surface); cursor:pointer; line-height:1;
  font-size:14px; color:var(--text-muted); display:grid; place-items:center;
}
dialog{
  border:1px solid var(--line); border-radius:18px; background:var(--surface); color:var(--ink);
  padding:0; width:min(440px, calc(100% - 32px)); box-shadow:var(--shadow-lg);
}
dialog::backdrop{background:rgba(10,13,20,.55); backdrop-filter:blur(3px)}
.dlg-head{display:flex; align-items:center; justify-content:space-between; padding:14px 16px; border-bottom:1px solid var(--line)}
.dlg-head strong{font-family:"Archivo",sans-serif; font-size:15px}
.dlg-body{padding:16px}
.dlg-foot{padding:12px 16px 16px; display:flex; justify-content:flex-end}

/* ---------- secciones de contenido ---------- */
section.content{padding:8px 0 0}
.sec-head{margin-bottom:24px}
.sec-head .eyebrow{margin-bottom:12px}
.sec-head h2{font-size:clamp(23px,2.9vw,31px); font-weight:800}
.sec-head p{margin-top:10px; color:var(--ink-2); max-width:62ch}

.steps{display:grid; grid-template-columns:repeat(3,1fr); gap:14px; counter-reset:s}
@media (max-width:820px){ .steps{grid-template-columns:1fr} }
.step{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:20px;
  position:relative;
}
.step .n{
  font-family:"IBM Plex Mono",monospace; font-size:12px; font-weight:600; color:var(--accent);
  letter-spacing:.1em; display:block; margin-bottom:10px;
}
.step h3{font-size:17px; font-weight:700; margin-bottom:7px}
.step p{color:var(--ink-2); font-size:14.6px}

.uses{display:grid; grid-template-columns:repeat(auto-fit,minmax(232px,1fr)); gap:14px}
.use{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:18px;
  display:flex; flex-direction:column; gap:8px;
}
.use .ic{
  width:34px; height:34px; border-radius:9px; display:grid; place-items:center;
  background:var(--accent-soft); color:var(--accent); border:1px solid var(--accent-line);
}
.use h3{font-size:15.5px; font-weight:700}
.use p{font-size:14px; color:var(--ink-2)}
.use .tag{
  margin-top:auto; font-family:"IBM Plex Mono",monospace; font-size:11px; letter-spacing:.06em;
  color:var(--text-muted); text-transform:uppercase;
}

.prose p{margin-top:14px; color:var(--ink-2)}
.prose h3{font-size:19px; margin-top:26px; font-weight:700}

details{border-bottom:1px solid var(--line); padding:2px 0}
details summary{
  cursor:pointer; list-style:none; padding:15px 30px 15px 0; position:relative;
  font-weight:650; font-size:16px;
}
details summary::-webkit-details-marker{display:none}
details summary::after{
  content:"+"; position:absolute; right:4px; top:50%; transform:translateY(-50%);
  font-family:"IBM Plex Mono",monospace; font-size:19px; color:var(--accent); font-weight:400;
}
details[open] summary::after{content:"−"}
details .a{padding:0 0 16px; color:var(--ink-2); font-size:15px}

footer{
  margin-top:56px; border-top:1px solid var(--line); padding:26px 0 40px;
  color:var(--text-muted); font-size:13.5px;
}
.foot-in{display:flex; flex-wrap:wrap; gap:12px 24px; justify-content:space-between; align-items:center}
.foot-links{display:flex; gap:18px; flex-wrap:wrap}
.foot-links a{color:var(--text-muted); text-decoration:none}
.foot-links a:hover{color:var(--accent)}
.noscript{padding:14px; border:1px solid var(--warn); background:var(--warn-soft); color:var(--warn); border-radius:var(--r-sm)}
