/* ani-neko: web de presentación. Paleta Catppuccin Mocha, una sola familia (JetBrains Mono). */

@font-face {
  font-family: "JetBrains Mono";
  src: url("../fonts/jetbrains-mono-latin-wght.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --base: #1e1e2e;
  --mantle: #181825;
  --crust: #11111b;
  --surface: #313244;
  --surface2: #45475a;
  --overlay: #585b70;
  --text: #cdd6f4;
  --sub: #a6adc8;
  --pink: #f5c2e7;
  --mauve: #cba6f7;
  --green: #a6e3a1;
  --blue: #89b4fa;
  --red: #f38ba8;
  --yellow: #f9e2af;

  --font: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Cinco tamaños: display, título, entradilla, texto, pequeño */
  --t-display: clamp(3rem, 5.6vw, 5.25rem);
  --t-title: clamp(1.75rem, 2.6vw, 2.375rem);
  --t-lead: clamp(1.125rem, 1.45vw, 1.375rem);
  --t-body: 1.0625rem;
  --t-small: 0.875rem;

  --m: clamp(20px, 3.2vw, 48px);
  --max: 1344px;
  --gap-section: clamp(112px, 13vw, 200px);
  --r: 12px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--base);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.6;
  font-variant-ligatures: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, ol, ul, figure, pre, dl, dd { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
::selection { background: var(--pink); color: var(--crust); }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
code, kbd, pre { font-family: var(--font); font-size: 1em; }
:not(pre) > code { color: var(--green); background: var(--surface); padding: 0.08em 0.36em; border-radius: 6px; font-size: 0.94em; white-space: nowrap; }
h2 { font-size: var(--t-title); line-height: 1.12; letter-spacing: -0.03em; font-weight: 700; text-wrap: balance; }
h3 { font-size: var(--t-lead); line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; text-wrap: balance; }
p { text-wrap: pretty; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--m); top: 12px; z-index: 10;
  background: var(--pink); color: var(--crust); padding: 10px 16px; border-radius: 999px;
  font-weight: 600; text-decoration: none; transform: translateY(-160%);
  transition: transform 200ms var(--ease-out);
}
.skip:focus-visible { transform: none; }

.wrap { width: min(100% - 2 * var(--m), var(--max)); margin-inline: auto; }
.section { padding-top: var(--gap-section); }
.lead { font-size: var(--t-lead); line-height: 1.5; }
.muted { color: var(--sub); }
.small { font-size: var(--t-small); line-height: 1.55; }

/* ---------- Botones y enlaces ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 600 var(--t-body)/1 var(--font); text-decoration: none;
  border: 0; cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}
.btn:active { transform: scale(0.97); }
.btn--main { background: var(--pink); color: var(--crust); }
.btn--plain { background: var(--surface); color: var(--text); }
.btn svg { width: 20px; height: 20px; flex: none; }
@media (hover: hover) and (pointer: fine) {
  .btn--main:hover { background: #f8d6ee; }
  .btn--plain:hover { background: var(--surface2); }
}
.link { color: var(--text); text-decoration: underline; text-decoration-color: var(--overlay); transition: text-decoration-color 200ms ease, color 200ms ease; }
@media (hover: hover) and (pointer: fine) {
  .link:hover { text-decoration-color: var(--pink); color: #fff; }
}

/* ---------- Bloques de código con botón de copiar ---------- */

.code {
  display: flex; align-items: flex-start; gap: 8px;
  min-width: 0; max-width: 100%;
  background: var(--crust);
  border-radius: var(--r);
}
.code pre {
  flex: 1 1 auto; min-width: 0;
  overflow-x: auto;
  padding: 18px 20px;
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text);
  tab-size: 2;
  overscroll-behavior-x: contain;
}
.code .c { color: var(--sub); }
.code pre { white-space: normal; }
.code .ln { display: block; white-space: pre-wrap; overflow-wrap: anywhere; padding-left: 2ch; text-indent: -2ch; }
.copy {
  flex: none; margin: 10px 10px 0 0;
  display: none; align-items: center; gap: 6px;
  width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 999px;
  background: var(--surface); color: var(--text); border: 0; cursor: pointer;
  font: 500 var(--t-small)/1 var(--font);
  transition: transform 140ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}
.js .copy { display: inline-flex; }
.copy:active { transform: scale(0.96); }
.copy svg { width: 17px; height: 17px; }
.copy span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.copy .ok { display: none; }
.copy.is-done { background: var(--green); color: var(--crust); }
.copy.is-done .ok { display: block; }
.copy.is-done .ico { display: none; }
@media (hover: hover) and (pointer: fine) { .copy:hover { background: var(--surface2); } .copy.is-done:hover { background: var(--green); } }
.split__body, .split__head, .uses > li, .steps > li, .distro__body > *, .group, .feat, .hero__install, .hero__intro, .tabs, .panel { min-width: 0; }

/* ---------- Fragmentos de terminal (interfaz real del programa) ---------- */

.term {
  background: var(--crust);
  border-radius: var(--r);
  color: var(--text);
  font-size: 0.9375rem;
  line-height: 1.7;
  overflow: hidden;
}
.term__bar { display: flex; gap: 7px; padding: 12px 14px 0; }
.term__bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--red); }
.term__bar i:nth-child(2) { background: var(--yellow); }
.term__bar i:nth-child(3) { background: var(--green); }
.term__body { padding: 14px 20px 18px; white-space: pre-wrap; overflow-x: auto; }
.term .g { color: var(--green); }
.term .b { color: var(--blue); font-weight: 600; }
.term .r { color: var(--red); }
.term .y { color: var(--yellow); }
.term .d { color: var(--sub); }
.term .m { color: var(--mauve); }
.term--pre .term__body, .code--pre .ln { white-space: pre; overflow-wrap: normal; }
.code--pre pre { overflow-x: auto; }
.term .cursor { display: inline-block; width: 0.6em; height: 1.15em; vertical-align: -0.2em; background: var(--text); }
.fzf {
  display: block; margin: 8px 0 4px; padding: 6px 12px 8px;
  border: 1px solid var(--overlay); border-radius: 6px; white-space: normal; /* taste-skill-ignore: el borde es el de fzf --border */
}
.fzf__p { display: block; color: var(--blue); font-weight: 600; }
.fzf__l { display: block; padding-left: 10px; border-left: 3px solid transparent; white-space: pre; }
.fzf__l.is-sel { background: var(--surface); border-left-color: var(--red); font-weight: 600; }

/* ---------- Cabecera y hero ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "intro   nav"
    "intro   media"
    "install media";
  min-height: min(100svh, 960px);
}
.hero::before {
  content: ""; position: absolute; inset: 0 0 0 45%; background: var(--crust); z-index: -1;
}
.hero__intro {
  grid-area: intro;
  padding: 40px clamp(32px, 4vw, 64px) 0 var(--m);
  padding-left: max(var(--m), calc((100vw - var(--max)) / 2));
  display: flex; flex-direction: column; justify-content: flex-end; gap: 22px;
}
.hero__install {
  grid-area: install;
  padding: 28px clamp(32px, 4vw, 64px) 48px var(--m);
  padding-left: max(var(--m), calc((100vw - var(--max)) / 2));
  display: flex; flex-direction: column; gap: 20px;
}
.nav {
  grid-area: nav;
  display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 6px 26px;
  padding: 28px var(--m) 0 40px;
  padding-right: max(var(--m), calc((100vw - var(--max)) / 2));
  font-size: 0.9375rem;
}
.nav a { text-decoration: none; color: var(--sub); padding: 6px 0; transition: color 200ms ease; }
.nav a[aria-current="page"], .nav .nav__lang { color: var(--text); }
.nav .nav__lang { display: inline-flex; gap: 8px; align-items: center; }
@media (hover: hover) and (pointer: fine) { .nav a:hover { color: var(--text); } }
.hero__media {
  grid-area: media;
  display: flex; flex-direction: column; justify-content: center;
  padding: 24px 0 56px 48px;
  overflow: clip;
}
/* El GIF tiene el mismo fondo que esta mitad: se recorta por la derecha, donde solo hay margen */
.hero__media img { width: max(100%, min(960px, 114%)); max-width: none; border-radius: 12px 0 0 12px; }
.hero__media figcaption { margin: 14px 0 0; }

.brand { display: flex; align-items: flex-end; gap: clamp(14px, 1.6vw, 22px); }
.brand img { width: clamp(64px, 6vw, 96px); height: auto; flex: none; }
.brand h1 {
  font-size: var(--t-display); line-height: 0.86; letter-spacing: -0.045em; font-weight: 800;
  white-space: nowrap;
}
.brand h1 .dash { color: var(--pink); }
.hero .lead { color: var(--sub); max-width: 34ch; }
.hero .lead strong { color: var(--text); font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.chips li { font-size: var(--t-small); padding: 6px 13px; border-radius: 999px; background: var(--surface); color: var(--sub); }
.chips li.on { background: #2b3b33; color: var(--green); }

.tabs__list { display: flex; gap: 6px; margin-bottom: 10px; }
.tab {
  min-height: 40px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: transparent; color: var(--sub); font: 500 0.9375rem/1 var(--font);
  transition: background-color 200ms ease, color 200ms ease, transform 140ms var(--ease-out);
}
.tab:active { transform: scale(0.97); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); }
@media (hover: hover) and (pointer: fine) { .tab:hover { color: var(--text); } }
.panel + .panel { margin-top: 18px; }
.js .panel + .panel { margin-top: 0; }
.panel__title { font-size: var(--t-small); color: var(--sub); font-weight: 500; margin-bottom: 8px; }
.js .panel__title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.panel .small { margin-top: 10px; color: var(--sub); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* Entrada del hero: una sola secuencia al cargar */
@media (prefers-reduced-motion: no-preference) {
  .hero__intro > *, .hero__install > *, .hero__media > * {
    animation: rise 700ms var(--ease-out) both;
  }
  .hero__intro > :nth-child(2) { animation-delay: 70ms; }
  .hero__intro > :nth-child(3) { animation-delay: 140ms; }
  .hero__install > :nth-child(1) { animation-delay: 210ms; }
  .hero__install > :nth-child(2) { animation-delay: 280ms; }
  .hero__media > :nth-child(1) { animation: settle 900ms var(--ease-out) 120ms both; }
  .hero__media > :nth-child(2) { animation-delay: 360ms; }
}
@keyframes rise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { opacity: 0; transform: translateY(18px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------- Entradas al hacer scroll (solo con JS y sin reducir movimiento) ---------- */

@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] > * {
    opacity: 0; transform: translateY(24px);
    transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
    transition-delay: calc(var(--i, 0) * 80ms);
  }
  .js [data-reveal].is-in > * { opacity: 1; transform: none; }
}

/* ---------- Uso: llamada y respuesta ---------- */

.split {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(20px, 2.2vw, 32px);
}
.split__head { grid-column: 1 / span 4; }
.split__body { grid-column: 6 / -1; }
.split__head > * + *, .sticky-head > * + * { margin-top: 20px; }
.split__head .lead { color: var(--text); }
.sticky-head { position: sticky; top: 40px; }

.uses { list-style: none; padding: 0; display: grid; gap: 88px; }
.use > p:first-child { font-size: var(--t-lead); font-weight: 600; line-height: 1.4; margin-bottom: 16px; }
.use .term { margin: 16px 0 0 56px; }
.use--wide .term { margin-right: 0; }
.use .term__body { min-height: 0; }

.live__hint { margin-top: 14px; color: var(--sub); }
.live__menu { list-style: none; padding: 0; margin: 0; }
.live__opt {
  display: block; width: 100%; text-align: left;
  font: inherit; color: inherit; background: transparent; border: 0; padding: 0 0 0 10px; margin: 0;
  cursor: pointer; line-height: 1.7; border-radius: 0; border-left: 3px solid transparent;
}
.live__opt[aria-pressed="true"] { background: var(--surface); border-left-color: var(--red); font-weight: 600; }
.live__opt:focus-visible { outline-offset: 0; }
@media (hover: hover) and (pointer: fine) { .live__opt:hover { background: var(--surface); } }
.live__log > span { display: block; }
@media (prefers-reduced-motion: no-preference) {
  .live__log > .new { animation: line-in 260ms var(--ease-out) both; }
}
@keyframes line-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Qué hace: campo fijo a la izquierda, bloques a la derecha ---------- */

.features { position: relative; }
.features__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.features__stage {
  position: sticky; top: 0; height: 100svh;
  background: var(--mantle);
  display: none; align-items: center; justify-content: center;
  padding: 48px clamp(24px, 4vw, 72px) 48px var(--m);
}
.features__stage .frag {
  position: absolute; width: min(100% - 2 * clamp(24px, 4vw, 72px), 600px);
  opacity: 0; transform: translateY(12px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}
.features__stage .frag.is-on { opacity: 1; transform: none; }
.features__stage .term { font-size: 1rem; }
.features__stage .term__body { white-space: pre; }
.features__list { padding: 0 var(--m) 0 clamp(40px, 6vw, 112px); padding-right: max(var(--m), calc((100vw - var(--max)) / 2)); }
.features__list h2 { padding-top: 16svh; }
.feat:first-of-type { min-height: 52svh; }
.feat { min-height: 62svh; display: flex; flex-direction: column; justify-content: center; gap: 16px; max-width: 46ch; padding: 48px 0; }
.feat:last-child { min-height: 70svh; }
.feat h3 { font-size: var(--t-title); line-height: 1.15; letter-spacing: -0.025em; font-weight: 700; }
.feat .frag { margin-top: 8px; }
.frag figcaption { margin-top: 10px; }
.js .features__stage { display: flex; }
.js .feat > .frag { display: none; }

/* ---------- Instalación completa ---------- */

.install .split__head .lead { color: var(--text); }
.group + .group { margin-top: 72px; }
.group > h3 { margin-bottom: 18px; }
.distros { list-style: none; padding: 0; }
.distro summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 1fr auto 20px; gap: 16px; align-items: baseline;
  padding: 12px 14px; margin: 0 -14px; border-radius: 10px;
  transition: background-color 200ms ease;
}
.distro summary::-webkit-details-marker { display: none; }
.distro summary .pm { color: var(--sub); font-size: var(--t-small); font-variant-numeric: tabular-nums; }
.distro summary .chev { width: 14px; height: 14px; align-self: center; transition: transform 220ms var(--ease-out); color: var(--sub); }
.distro[open] summary .chev { transform: rotate(90deg); }
.distro[open] summary { background: var(--surface); }
@media (hover: hover) and (pointer: fine) { .distro summary:hover { background: var(--mantle); } .distro[open] summary:hover { background: var(--surface); } }
.distro__body { padding: 14px 0 22px; display: grid; gap: 12px; }
.distro__body p { color: var(--text); }
.steps { padding-left: 1.4em; display: grid; gap: 22px; }
.steps li { padding-left: 6px; }
.steps li::marker { color: var(--pink); font-weight: 700; }
.steps li > * + * { margin-top: 12px; }
.group p + p, .group p + .code, .group .code + p { margin-top: 14px; }
.group .steps + p { margin-top: 28px; }

/* ---------- Preguntas y aviso ---------- */

.faq__head { grid-column: 1 / span 3; }
.faq__body { grid-column: 5 / -1; }
.faq__text { columns: 2; column-gap: 56px; }
.faq__text p { break-inside: avoid; margin-bottom: 24px; color: var(--text); }
.faq__text strong { font-weight: 700; color: #fff; }
.notice {
  margin-top: 40px; padding: 28px 32px; border-radius: var(--r);
  background: var(--surface);
}
.notice h3 { margin-bottom: 10px; color: var(--yellow); }
.notice p { max-width: 70ch; }

/* ---------- Cierre: créditos y estrella ---------- */

.closing { margin-top: var(--gap-section); background: var(--mantle); }
.closing__grid {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(20px, 2.2vw, 32px);
  padding-block: clamp(80px, 10vw, 144px);
}
.closing__star { grid-column: 1 / span 7; display: flex; flex-direction: column; gap: 24px; align-items: flex-start; }
.closing__star img { width: clamp(96px, 9vw, 136px); }
.closing__star h2 { font-size: clamp(2.5rem, 4.4vw, 4rem); line-height: 0.95; letter-spacing: -0.045em; font-weight: 800; }
.closing__star p { max-width: 40ch; }
.closing__credits { grid-column: 8 / -1; align-self: end; }
.closing__credits h2 { margin-bottom: 20px; }
.credits { list-style: none; padding: 0; display: grid; gap: 14px; }

.foot {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px 24px; align-items: baseline;
  padding-block: 40px 32px;
  font-size: 0.9375rem; color: var(--sub);
}
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: center; }
.foot nav a { color: var(--text); }
.foot__end { text-align: right; }
.foot__end a { color: var(--text); }

/* ---------- 404 ---------- */

.lost { min-height: 100svh; display: grid; place-content: center; gap: 24px; padding: var(--m); max-width: 640px; margin-inline: auto; }
.lost img { width: 96px; }
.lost h1 { font-size: var(--t-title); line-height: 1.15; letter-spacing: -0.03em; }

/* ---------- Tablet y móvil ---------- */

@media (max-width: 1080px) {
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-areas: "nav" "intro" "media" "install"; grid-template-rows: auto; min-height: 0; }
  .hero::before { display: none; }
  .nav { padding: 20px var(--m) 0; justify-content: flex-start; }
  .hero__intro { padding: 40px var(--m) 40px; }
  .hero__media { padding: 32px var(--m) 32px; overflow: visible; background: var(--crust); }
  .hero__media img { width: 100%; border-radius: 10px; }
  .hero__media figcaption { margin: 8px 0 0; }
  .hero__install { padding: 40px var(--m) 24px; }

  .split__head, .faq__head { grid-column: 1 / -1; margin-bottom: 40px; }
  .split__body, .faq__body { grid-column: 1 / -1; }
  .sticky-head { position: static; }

  .features__grid { grid-template-columns: minmax(0, 1fr); }
  .js .features__stage { display: none; }
  .js .feat > .frag { display: block; }
  .features__list { padding: 0 var(--m); }
  .features__list h2 { padding-top: 0; }
  .feat { min-height: 0; padding: 0; margin-top: 64px; max-width: none; }
  .feat:last-child { min-height: 0; }
  .feat h3, .feat p { max-width: 46ch; }

  .closing__star, .closing__credits { grid-column: 1 / -1; }
  .closing__credits { margin-top: 72px; }
}

@media (max-width: 720px) {
  :root { --t-body: 1rem; --gap-section: 112px; }
  .nav { gap: 4px 18px; font-size: 0.875rem; }
  .nav .nav__sec { display: none; }
  .use .term { margin-left: 0; margin-top: 20px; }
  .uses { gap: 64px; }
  .faq__text { columns: 1; }
  .notice { padding: 24px 20px; }
  .foot { grid-template-columns: 1fr; gap: 10px; }
  .foot nav { justify-content: flex-start; }
  .foot__end { text-align: left; }
  .code pre, .term { font-size: 0.875rem; }
  /* En el móvil se recorta el GIF por la izquierda, donde está el texto de la terminal */
  .hero__media img { aspect-ratio: 1; object-fit: cover; object-position: left center; }
  .copy { margin: 8px 8px 0 0; }
  .code pre { padding: 16px 0 16px 16px; }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---------- Ronda 2: pausa de la demo, prompt de fzf abajo, nota bajo fragmentos ---------- */
.hero__cap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.demo-toggle {
  flex: none; min-height: 36px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--surface); color: var(--text); font: 500 var(--t-small)/1 var(--font);
  transition: transform 140ms var(--ease-out), background-color 200ms ease;
}
.demo-toggle:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) { .demo-toggle:hover { background: var(--surface2); } }
.hero__media picture { display: block; }
.hero__media .hero__cap { margin: 14px max(var(--m), calc((100vw - var(--max)) / 2)) 0 0; }
.fzf__p--end { margin-top: 2px; }
@media (max-width: 1080px) { .hero__media .hero__cap { margin: 8px 0 0; } }
