/* ==========================================================================
   satsh · estilos del sitio (satsh.org, satsh.org/lunagen, satsh.org/lunagen/docs)
   Inspirado en el lenguaje visual de las páginas de SpaceX: negro, paneles a
   pantalla completa, tipografía en mayúsculas muy espaciada, botones de borde fino.
   ========================================================================== */

:root {
  --bg: #000;
  --fg: #fff;
  --muted: rgba(255, 255, 255, .68);
  --dim: rgba(255, 255, 255, .44);
  --line: rgba(255, 255, 255, .22);
  --line-strong: rgba(255, 255, 255, .6);
  --header-h: 76px;
  --font: "Helvetica Neue", "Segoe UI", Roboto, Arial, system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 24px); }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font); font-weight: 300; line-height: 1.65;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: #fff; color: #000; }
:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

/* Idioma: el script de <head> fija html[lang]; el CSS muestra solo el bloque activo (sin parpadeo). */
html[lang="es"] [data-lang="en"],
html[lang="en"] [data-lang="es"] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; background: #fff; color: #000; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; }

#stars { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
main, .site-footer { position: relative; z-index: 1; }

/* ---------- cabecera ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; height: var(--header-h); z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
  transition: background .35s ease, backdrop-filter .35s ease, border-color .35s ease;
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled, .site-header.is-open {
  background: rgba(0, 0, 0, .74); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom-color: rgba(255, 255, 255, .1);
}
.brand {
  font-weight: 700; letter-spacing: .46em; text-transform: uppercase; font-size: 15px;
  color: #fff; text-decoration: none; display: flex; align-items: center; gap: 14px;
}
.brand small { font-weight: 400; letter-spacing: .3em; color: var(--dim); font-size: 11px; }
.nav { display: flex; align-items: center; gap: clamp(18px, 2.6vw, 40px); }
.nav a {
  position: relative; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; font-weight: 500;
  color: #fff; text-decoration: none; opacity: .88; padding: 8px 0;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: #fff;
  transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.lang { display: flex; gap: 2px; margin-left: 6px; padding-left: 18px; border-left: 1px solid var(--line); }
.lang button {
  background: none; border: 0; color: #fff; opacity: .5; font: inherit; font-size: 12px; font-weight: 500;
  letter-spacing: .2em; cursor: pointer; padding: 6px 8px; border-bottom: 1px solid transparent;
}
.lang button:hover { opacity: .85; }
html[lang="es"] .lang [data-set="es"], html[lang="en"] .lang [data-set="en"] { opacity: 1; border-bottom-color: #fff; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; position: relative; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 11px; right: 11px; height: 1px; background: #fff; transition: transform .3s, opacity .3s;
}
.nav-toggle span { top: 22px; }
.nav-toggle span::before { top: -7px; left: 0; right: 0; }
.nav-toggle span::after { top: 7px; left: 0; right: 0; }
.site-header.is-open .nav-toggle span { background: transparent; }
.site-header.is-open .nav-toggle span::before { transform: translateY(7px) rotate(45deg); }
.site-header.is-open .nav-toggle span::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- paneles a pantalla completa (paralaje) ---------- */
.panel {
  position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end;
  overflow: hidden; isolation: isolate;
}
.panel--tall { min-height: 118vh; }
.layer { position: absolute; z-index: -1; pointer-events: none; will-change: transform; }
.layer--full { inset: -16% 0; }
.panel__content {
  position: relative; width: 100%; max-width: 1480px;
  padding: calc(var(--header-h) + 40px) clamp(20px, 6vw, 96px) clamp(64px, 12vh, 132px);
}
.eyebrow { font-size: 12px; letter-spacing: .34em; text-transform: uppercase; font-weight: 500; color: var(--muted); margin: 0 0 18px; }
.display {
  font-size: clamp(46px, 10.5vw, 156px); line-height: .94; margin: 0 0 26px; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; text-wrap: balance;
}
.display--md { font-size: clamp(38px, 7.4vw, 108px); }
.title {
  font-size: clamp(26px, 4vw, 54px); line-height: 1.08; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; margin: 0 0 22px; text-wrap: balance;
}
.lead { max-width: 580px; font-size: clamp(15px, 1.35vw, 18px); color: rgba(255, 255, 255, .84); margin: 0 0 34px; }
.actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-width: 230px; padding: 17px 34px; font: 500 12px/1 var(--font); letter-spacing: .24em; text-transform: uppercase;
  color: #fff; text-decoration: none; background: rgba(0, 0, 0, .12); border: 1px solid rgba(255, 255, 255, .85);
  cursor: pointer; transition: background .28s ease, color .28s ease, border-color .28s ease;
}
.btn:hover { background: #fff; color: #000; }
.btn--ghost { border-color: var(--line); }
.btn--ghost:hover { border-color: #fff; }
.btn .arrow { transition: transform .28s ease; }
.btn:hover .arrow { transform: translateX(4px); }

.chip-status {
  display: inline-flex; align-items: center; gap: 10px; border: 1px solid var(--line); padding: 7px 14px;
  font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--muted); margin-bottom: 22px;
}
.chip-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #ffb454; box-shadow: 0 0 12px #ffb454; animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.scroll-hint {
  position: absolute; left: 50%; bottom: 26px; width: 1px; height: 54px; background: linear-gradient(#fff, transparent);
  transform-origin: top; animation: hint 2.2s ease-in-out infinite; opacity: .7;
}
@keyframes hint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

.reveal { opacity: 0; transform: translateY(34px); transition: opacity .9s ease, transform .9s ease; }
.reveal.is-in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ---------- imágenes procedurales ---------- */
.layer--limb {
  left: 50%; bottom: -142vw; width: 168vw; margin-left: -84vw; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, #000 97%, transparent 100%);
  box-shadow: 0 0 0 1px rgba(175, 208, 255, .2), 0 -3px 10px rgba(205, 228, 255, .75),
    0 -18px 70px 8px rgba(110, 165, 255, .34), inset 0 46px 110px -30px rgba(80, 130, 255, .32);
}
.layer--glow {
  left: 0; right: 0; bottom: 0; height: 62%;
  background: radial-gradient(60% 90% at 50% 100%, rgba(80, 135, 255, .30), rgba(0, 0, 0, 0) 70%);
}
.layer--haze {
  inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .0) 40%, rgba(0, 0, 0, .65) 100%);
}
.layer--vignette { inset: 0; background: radial-gradient(120% 90% at 30% 70%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .78) 100%); }
.layer--moon { width: min(78vmin, 720px); aspect-ratio: 1; right: -4vw; top: 6vh; }
.layer--moon svg { width: 100%; height: 100%; display: block; opacity: .86; }
.layer--cells { inset: 0; }
.layer--cells canvas { width: 100%; height: 100%; display: block; }
.layer--warm { inset: auto 0 0 0; height: 70%; background: radial-gradient(70% 100% at 70% 100%, rgba(255, 150, 70, .24), rgba(150, 70, 255, .10) 45%, rgba(0, 0, 0, 0) 75%); }
.word {
  position: absolute; left: var(--x); top: var(--y); font-size: var(--s); font-weight: 700; letter-spacing: .06em;
  color: rgba(255, 255, 255, var(--o, .12)); white-space: nowrap; user-select: none;
}
.word--out { color: transparent; -webkit-text-stroke: 1px rgba(255, 255, 255, var(--o, .25)); }

/* ---------- secciones de contenido ---------- */
.section { position: relative; padding: clamp(88px, 15vh, 168px) clamp(20px, 6vw, 96px); }
.section--bordered { border-top: 1px solid rgba(255, 255, 255, .1); }
.section__inner { max-width: 1280px; margin: 0 auto; }
.section--dark { background: linear-gradient(180deg, rgba(0, 0, 0, .86), rgba(0, 0, 0, .86)); }
.grid { display: grid; gap: clamp(28px, 4vw, 64px); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); align-items: center; }
.feature { border-top: 1px solid var(--line-strong); padding-top: 26px; }
.feature .num { font-size: 12px; letter-spacing: .3em; color: var(--dim); margin-bottom: 14px; }
.feature h3 { margin: 0 0 14px; font-size: 18px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.feature p { margin: 0; color: var(--muted); font-size: 15.5px; }

.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; gap: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 90px 1fr; gap: 20px; padding: 30px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before { content: "0" counter(s); font-size: clamp(30px, 4vw, 52px); font-weight: 700; letter-spacing: .06em; color: rgba(255, 255, 255, .28); line-height: 1; }
.steps h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.steps p { margin: 0; color: var(--muted); max-width: 720px; }

.shot { border: 1px solid var(--line); background: #000; box-shadow: 0 40px 140px rgba(0, 0, 0, .9); }
.shot img { width: 100%; height: auto; }
.shot-caption { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); margin-top: 14px; }

.install {
  display: inline-flex; align-items: center; gap: 18px; border: 1px solid var(--line-strong); padding: 10px 10px 10px 20px;
  font-family: var(--mono); font-size: 14.5px; background: rgba(0, 0, 0, .5); backdrop-filter: blur(8px); max-width: 100%;
}
.install code { white-space: nowrap; overflow: auto; }
.copy {
  background: none; border: 1px solid var(--line); color: #fff; font: 500 11px/1 var(--font); letter-spacing: .2em; text-transform: uppercase;
  padding: 10px 14px; cursor: pointer; transition: background .25s, color .25s;
}
.copy:hover { background: #fff; color: #000; }
.badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.badge { font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); padding: 6px 12px; }

.code { position: relative; margin: 0; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.code pre { margin: 0; padding: 24px 26px; overflow-x: auto; font-family: var(--mono); font-size: 13.5px; line-height: 1.7; color: #e9eef5; }
.code .copy { position: absolute; top: 10px; right: 10px; padding: 8px 12px; background: rgba(0, 0, 0, .6); }
.code .k { color: #9fd0ff; } .code .s { color: #ffd68a; } .code .c { color: rgba(255, 255, 255, .42); } .code .f { color: #b9f2c8; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { font-family: var(--mono); font-size: 12.5px; border: 1px solid var(--line); padding: 7px 13px; color: rgba(255, 255, 255, .82); }

.cta { text-align: center; }
.cta .actions { justify-content: center; }
.cta .title { margin-left: auto; margin-right: auto; max-width: 900px; }
.cta .lead { margin-left: auto; margin-right: auto; }

/* ---------- pie ---------- */
.site-footer {
  padding: 52px clamp(20px, 6vw, 96px); border-top: 1px solid var(--line); background: #000;
  display: flex; flex-wrap: wrap; gap: 26px 48px; justify-content: space-between; align-items: center;
  font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim);
}
.site-footer a { text-decoration: none; color: var(--muted); }
.site-footer a:hover { color: #fff; }
.site-footer .links { display: flex; flex-wrap: wrap; gap: 14px 30px; }
.site-footer .brand { font-size: 13px; }

/* ---------- documentación ---------- */
.docs-hero { padding: calc(var(--header-h) + 72px) clamp(20px, 5vw, 72px) 24px; max-width: 1500px; margin: 0 auto; position: relative; z-index: 1; }
.docs-hero .display { font-size: clamp(34px, 6vw, 84px); margin-bottom: 14px; }
.docs-hero p { color: var(--muted); max-width: 640px; margin: 0; }
.docs {
  display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: clamp(28px, 5vw, 76px);
  padding: 40px clamp(20px, 5vw, 72px) 110px; max-width: 1500px; margin: 0 auto; position: relative; z-index: 1;
}
.toc { position: sticky; top: calc(var(--header-h) + 22px); align-self: start; max-height: calc(100vh - var(--header-h) - 44px); overflow: auto; padding-right: 8px; font-size: 13.5px; }
.toc-title { font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--dim); margin: 0 0 14px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc a { display: block; padding: 5px 0 5px 14px; color: var(--muted); text-decoration: none; border-left: 1px solid var(--line); transition: color .2s, border-color .2s; line-height: 1.4; }
.toc a:hover { color: #fff; }
.toc a.active { color: #fff; border-left-color: #fff; font-weight: 500; }
.toc ul ul a { padding-left: 28px; font-size: 12.5px; color: var(--dim); }
.toc-toggle { display: none; }

.prose { max-width: 900px; min-width: 0; font-size: 16.5px; }
.prose > :first-child { margin-top: 0; }
.prose h2 { font-size: clamp(22px, 2.6vw, 32px); font-weight: 700; letter-spacing: .07em; text-transform: uppercase; margin: 88px 0 24px; padding-top: 36px; border-top: 1px solid var(--line); line-height: 1.15; }
.prose h2:first-of-type { margin-top: 0; border-top: 0; padding-top: 0; }
.prose h3 { font-size: 16px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin: 46px 0 14px; }
.prose h4 { font-size: 14px; letter-spacing: .12em; text-transform: uppercase; margin: 32px 0 10px; color: var(--muted); }
.prose p, .prose li { color: rgba(255, 255, 255, .86); }
.prose a { color: #fff; text-decoration-color: var(--dim); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: #fff; }
.prose strong { font-weight: 600; color: #fff; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .3em 0; }
.prose :not(pre) > code {
  font-family: var(--mono); font-size: .86em; background: rgba(255, 255, 255, .09); padding: .12em .42em; border-radius: 2px; color: #fff;
}
.prose pre { position: relative; margin: 22px 0; padding: 22px 24px; background: rgba(255, 255, 255, .045); border: 1px solid var(--line); overflow-x: auto; font-size: 13.5px; line-height: 1.7; }
.prose pre code { font-family: var(--mono); background: none; padding: 0; color: #e9eef5; }
.prose pre .copy { position: absolute; top: 8px; right: 8px; padding: 7px 11px; background: rgba(0, 0, 0, .65); }
.prose blockquote { margin: 26px 0; padding: 4px 0 4px 22px; border-left: 2px solid #fff; }
.prose blockquote p { color: rgba(255, 255, 255, .8); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 48px 0; }
.table-wrap { overflow-x: auto; margin: 24px 0; border: 1px solid var(--line); }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 520px; }
.prose th { text-align: left; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; background: rgba(255, 255, 255, .06); }
.prose th, .prose td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose td code { white-space: nowrap; }
.docs-nav { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

/* ---------- 404 ---------- */
.center-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 40px 20px; }

/* ---------- adaptativo ---------- */
@media (max-width: 980px) {
  .docs { grid-template-columns: 1fr; padding-top: 24px; }
  .toc { position: static; max-height: none; display: none; border: 1px solid var(--line); padding: 18px; margin-bottom: 28px; }
  .toc.is-open { display: block; }
  .toc-toggle { display: inline-flex; margin-bottom: 18px; min-width: 0; }
}
@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: flex-start; gap: 6px;
    padding: 18px clamp(20px, 6vw, 40px) 30px; background: rgba(0, 0, 0, .94); backdrop-filter: blur(14px);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; border-bottom: 1px solid var(--line);
  }
  .site-header.is-open .nav { opacity: 1; transform: none; pointer-events: auto; }
  .nav a { font-size: 15px; padding: 12px 0; width: 100%; }
  .lang { margin: 8px 0 0; padding: 12px 0 0; border-left: 0; border-top: 1px solid var(--line); width: 100%; }
  .brand small { display: none; }
  .steps li { grid-template-columns: 56px 1fr; }
  .btn { min-width: 0; width: 100%; }
  .layer--moon { right: -22vw; top: 12vh; opacity: .8; }
  .install { width: 100%; justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint, .chip-status::before { animation: none; }
}

/* ---------- índice de proyectos (portada) ---------- */
.index-list { margin-top: 40px; border-top: 1px solid var(--line-strong); }
.index-list a {
  display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 20px; padding: 30px 6px;
  border-bottom: 1px solid var(--line); text-decoration: none; transition: background .3s, padding .3s;
}
.index-list a:hover { background: rgba(255, 255, 255, .05); padding-left: 18px; padding-right: 18px; }
.index-list .n { font-size: 12px; letter-spacing: .3em; color: var(--dim); }
.index-list strong { display: block; font-size: clamp(22px, 3vw, 38px); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.index-list small { display: block; color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.index-list .go { font-size: 22px; transition: transform .3s; }
.index-list a:hover .go { transform: translateX(6px); }

.docs-hero .eyebrow { margin-bottom: 26px; }
