@charset "UTF-8";

/*
  redKAOS.net man indexes — index.css

  Used only by src/templates/getIndex.php for the home (/) and the
  section indexes (/man1/ … /man8/). Individual modern man pages keep
  using man.css (the "Modern chrome" terminal-fidelity stylesheet);
  LuCAS legacy .html pages keep oldman.css. This file lives outside
  the "terminal fidelity" doctrine of IDENTITY.md because the indexes
  are navigation pages, not man-page content.

  Palette and typography mirror redkaos.net + redkaos.tools so the
  three ecosystems share the same visual language.

  Fonts autohosted under /style/fonts/ (subsetted Spanish + English):
  - Nimbus Mono (TeX Gyre Cursor) — h1 marquee
  - Ubuntu                         — body prose, comment text
  - Ubuntu Mono                    — command names, h2, code
*/

@font-face {
  font-family: "Ubuntu";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/style/fonts/ubuntu-regular.woff2") format("woff2");
}

@font-face {
  font-family: "Ubuntu Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/style/fonts/ubuntu-mono-400-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Nimbus Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/style/fonts/nimbus-mono-regular.woff2") format("woff2");
}

/* Kubuntu Breeze palette — same as redkaos.net IDENTITY.md. */
:root {
  --bg:     #232627;
  --text:   #fcfcfc;
  --accent: #11D116;
  --muted:  #a1a9b1;
  --rule:   #3a3e40;
  --panel:  #1a1d1e;

  --font-title: "Nimbus Mono", monospace;
  --font-body:  "Ubuntu", sans-serif;
  --font-mono:  "Ubuntu Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100vh;
  min-height: 100dvh;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ─── Page wrapper (sticky footer via flex) ───────────────────── */

.page {
  box-sizing: border-box;
  max-width: 84ch;
  margin: 0 auto;
  width: 100%;
  padding: 3em max(1.5em, env(safe-area-inset-left)) 0
                max(1.5em, env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

/* ─── Header ──────────────────────────────────────────────────── */

header {
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1.5em;
  margin-bottom: 2em;
}

/* Marquee h1: same Nimbus Mono treatment as redkaos.net. Fixed 5em
   because the only h1 texts are "man" and "man 1".."man 8" — short
   enough to never wrap. word-spacing: -1ch collapses the space so
   "man 1" renders compact as "man1", matching the redKAOS shell
   aesthetic. */
h1 {
  color: var(--accent);
  font-family: var(--font-title);
  font-size: 5em;
  font-weight: 400;
  letter-spacing: -0.1em;
  margin: 0 0 0.2em;
  line-height: 1;
  word-spacing: -1ch;
}

.lema {
  margin: 0;
}

/* Breadcrumb — only rendered on section indexes (not the home).
   Sits above the header, mirroring the redkaos.net pattern on inner
   pages like /licencia/. */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--muted);
  margin: 0 0 2em;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--accent); }

.breadcrumb .sep {
  color: var(--rule);
  margin: 0 0.5em;
}

/* ─── Main ────────────────────────────────────────────────────── */

main {
  flex: 1 0 auto;
}

main > section {
  margin: 0 0 2.5em;
}

h2 {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1em;
  font-weight: normal;
  text-transform: lowercase;
  letter-spacing: 0.05em;
  margin: 2.5em 0 0.8em;
}

h2::before {
  content: "// ";
  color: var(--muted);
}

h2 a {
  color: inherit;
  text-decoration: none;
}

h2 a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

/* ─── Commands list (per section) ─────────────────────────────── */

.commands ul {
  list-style: none;
  margin: 0.8em 0;
  padding: 0;
}

.commands li {
  padding: 0.25em 0;
  display: flex;
  gap: 1em;
  align-items: baseline;
}

/* Command link: accent green, mono, fixed min-width so descriptions
   align. No underline at rest, underline on hover — matches redkaos.net
   nav-list pattern (ul a in base.css). Scoped to li so the section
   <h2>'s own anchor (which lives in the same .commands section) is
   not styled as a nav link. */
.commands li a {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-mono);
  min-width: 22ch;
  flex-shrink: 0;
}

.commands li a:hover { text-decoration: underline; }

.commands .desc {
  color: var(--muted);
  font-size: 0.9em;
}

/* ─── Footer (shell prompt + π + CC BY-SA badge) ──────────────── */

@keyframes blink { 50% { opacity: 0; } }

.prompt { color: var(--accent); }

.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

@media (prefers-reduced-motion: reduce) {
  .cursor { animation: none; }
}

footer.copy {
  display: flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-top: 2em;
  padding-left: max(1.5em, env(safe-area-inset-left));
  padding-right: max(1.5em, env(safe-area-inset-right));
  padding-bottom: max(0.5em, env(safe-area-inset-bottom));
}

footer.copy > p {
  flex: 1;
  text-align: center;
  margin: 0.4em 0;
}

a.license {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 1em;
  line-height: 1;
}

a.license:hover { color: var(--accent); }

a.pi {
  color: var(--muted);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 1em;
  line-height: 1;
}

a.pi:hover { color: var(--accent); }

/* ─── Responsive ──────────────────────────────────────────────── */

@media (max-width: 600px) {
  .commands li {
    flex-direction: column;
    gap: 0;
  }
  .commands li a { min-width: 0; }
}
