/* P-Rune: misma paleta que el tema Moderno de la app (grafito + verde salvia). */
:root {
  color-scheme: dark;
  --bg: #111110;
  --panel: #151514;
  --card: #191918;
  --card-hi: #20201e;
  --line: #2b2a28;
  --ink: #e6e4de;
  --mute: #a19e96;
  --faint: #6f6c66;
  --accent: #8fb5a0;
  --moderate: #d2ad6a;
  --advanced: #d98b7f;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "Cascadia Mono", Consolas, ui-monospace, monospace;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; }
code, .mono { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--ink); color: var(--bg); padding: 8px 12px; border-radius: 6px; }

.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; }
.brand img { width: 28px; height: 28px; }
.nav nav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.nav nav a { color: var(--mute); text-decoration: none; }
.nav nav a:hover { color: var(--ink); }
.nav nav a.nav-cta { color: var(--bg); background: var(--ink); padding: 6px 14px; border-radius: 7px; font-weight: 600; }
.nav nav a.nav-cta:hover { background: #fff; }

/* Hero */
.hero { padding: 88px 0 0; }
.eyebrow { font: 12.5px/1 var(--mono); color: var(--accent); letter-spacing: 0.04em; margin-bottom: 22px; }
.hero h1 { font-size: clamp(34px, 5.4vw, 60px); line-height: 1.06; max-width: 20ch; }
.lead { margin-top: 22px; max-width: 60ch; font-size: 18px; color: var(--mute); }

.cta { margin-top: 34px; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--ink); color: var(--bg);
  padding: 13px 22px; border-radius: 9px;
  font-weight: 600; font-size: 16px; text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: #fff; transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; }
.alt { font-size: 14px; color: var(--mute); text-underline-offset: 3px; }
.alt:hover { color: var(--ink); }
.cta-meta { margin-top: 14px; font-size: 13.5px; color: var(--faint); }
.cta-hash { margin-top: 6px; font: 12px/1.5 var(--mono); color: var(--faint); overflow-wrap: anywhere; max-width: 70ch; }
.cta-hash b { color: var(--mute); font-weight: 400; }
[hidden] { display: none !important; }

.shot {
  margin-top: 64px;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: var(--panel);
  box-shadow: 0 40px 120px -40px rgba(143, 181, 160, 0.18), 0 30px 60px -30px #000;
}
.shot-note { margin-top: 14px; font-size: 13px; color: var(--faint); text-align: center; }

/* Secciones */
.section { padding: 112px 0 0; }
.section h2 { font-size: clamp(26px, 3.4vw, 38px); line-height: 1.12; max-width: 22ch; }
.section-lead { margin-top: 16px; max-width: 62ch; color: var(--mute); font-size: 17px; }

/* Plan: el diff que la app muestra antes de escribir */
.plan { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: center; }
.steps { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 22px; }
.steps li { display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: baseline; }
.steps .k { font: 12.5px/1.6 var(--mono); color: var(--accent); }
.steps p { color: var(--mute); }
.steps strong { color: var(--ink); font-weight: 600; }
.fine { margin-top: 26px; font-size: 14px; color: var(--faint); max-width: 56ch; }

.diff { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.diff-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.diff-head span { font: 12px/1 var(--mono); color: var(--faint); font-weight: 400; }
.diff-body { padding: 18px; display: grid; gap: 12px; }
.entry { border: 1px solid var(--line); border-radius: 9px; background: var(--card); padding: 14px 16px; }
.entry-title { font-size: 14px; font-weight: 600; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.entry-title i { font: normal 12px/1 var(--sans); color: var(--accent); }
.entry-title i.undo { color: var(--moderate); }
.reg { margin-top: 10px; background: var(--bg); border-radius: 6px; padding: 10px 12px; font: 12px/1.7 var(--mono); overflow-x: auto; white-space: nowrap; }
.reg .path { color: var(--faint); display: block; }
.reg .name { color: var(--ink); font-weight: 600; }
.reg .old { color: var(--advanced); }
.reg .new { color: var(--accent); }
.reg .arrow { color: var(--faint); padding: 0 4px; }
.diff-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--faint); }
.diff-foot b { background: var(--ink); color: var(--bg); padding: 6px 12px; border-radius: 6px; font-weight: 600; font-size: 13px; }

/* Funciones */
.grid { margin-top: 44px; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.feature { padding: 26px 24px 28px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feature h3 { font-size: 16px; font-weight: 600; }
.feature p { margin-top: 8px; color: var(--mute); font-size: 14.5px; line-height: 1.6; }

/* Capturas */
.gallery { margin-top: 44px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.gallery figure { margin: 0; }
.gallery a { display: block; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; transition: border-color 0.15s; }
.gallery a:hover { border-color: var(--faint); }
.gallery figcaption { margin-top: 12px; font-size: 14px; color: var(--mute); }
.gallery figcaption strong { color: var(--ink); font-weight: 600; }

/* Seguridad */
.cols { margin-top: 36px; display: grid; grid-template-columns: 1.5fr 1fr; gap: 48px; align-items: start; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.checks li { padding-left: 26px; position: relative; color: var(--mute); }
.checks li::before { content: ""; position: absolute; left: 2px; top: 0.55em; width: 10px; height: 5px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.checks strong { color: var(--ink); font-weight: 600; }
.aside { display: grid; gap: 16px; }
.note { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 20px 22px; }
.note h3 { font-size: 14px; font-weight: 600; }
.note p { margin-top: 8px; font-size: 14px; color: var(--mute); }
.note.warn { border-color: color-mix(in srgb, var(--moderate) 40%, var(--line)); }
.note.warn h3 { color: var(--moderate); }

/* Preguntas */
.faq { margin-top: 32px; border-top: 1px solid var(--line); max-width: 820px; }
details { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; padding: 18px 28px 18px 0; font-weight: 600; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 16px; color: var(--faint); font: 18px/1.4 var(--mono); }
details[open] summary::after { content: "−"; }
details p { padding: 0 0 20px; color: var(--mute); max-width: 68ch; }
details p + p { margin-top: -8px; }
details code { font-size: 13px; background: var(--card); border: 1px solid var(--line); padding: 2px 6px; border-radius: 5px; overflow-wrap: anywhere; }
details a, .note a, .fine a { color: var(--ink); text-underline-offset: 3px; }

/* Cierre y pie */
.closing { margin-top: 112px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--panel); padding: 64px 0; }
.closing .wrap { display: flex; justify-content: space-between; align-items: center; gap: 28px; flex-wrap: wrap; }
.closing h2 { font-size: clamp(22px, 2.8vw, 30px); max-width: 24ch; }
footer { padding: 32px 0 48px; font-size: 13.5px; color: var(--faint); }
footer .wrap { display: flex; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; }
footer nav { display: flex; gap: 22px; flex-wrap: wrap; }
footer a { color: var(--mute); text-decoration: none; }
footer a:hover { color: var(--ink); }

/* 404 */
.lost { min-height: 70vh; display: grid; place-content: center; text-align: center; gap: 18px; }
.lost h1 { font-size: 40px; }
.lost p { color: var(--mute); }

@media (max-width: 900px) {
  .plan, .cols { grid-template-columns: 1fr; gap: 36px; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding-top: 56px; }
  .section { padding-top: 80px; }
  .closing { margin-top: 80px; }
}
@media (max-width: 640px) {
  .nav nav a:not(.nav-cta):not(.lang) { display: none; }
  .grid, .gallery { grid-template-columns: 1fr; }
  .steps li { grid-template-columns: 1fr; gap: 2px; }
  .lead { font-size: 17px; }
  .btn { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* P-Rune Core */
.core { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.core .eyebrow { margin-bottom: 18px; }
.core-points { margin-top: 28px; }
.core-points code { font-size: 13px; background: var(--card); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--faint); padding: 12px 20px; }
.btn.ghost:hover { background: var(--card-hi); border-color: var(--mute); }
.term { border: 1px solid var(--line); border-radius: 12px; background: #0c0c0b; overflow: hidden; }
.term-head { display: flex; justify-content: space-between; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--panel); font: 12px/1 var(--mono); color: var(--faint); }
.term-head a { color: var(--mute); text-decoration: none; font-family: var(--sans); font-size: 12.5px; }
.term-head a:hover { color: var(--ink); }
.term-body { margin: 0; padding: 20px 20px 22px; font: 13.5px/1.75 var(--mono); overflow-x: auto; }
.term-body .ps { color: var(--faint); }
.term-body .cmd { color: var(--ink); }
.term-body .cm { color: var(--accent); opacity: 0.8; }
@media (max-width: 900px) { .core { grid-template-columns: 1fr; gap: 36px; } }
