/*!
 * endfield.css — Classless CSS con estética Arknights: Endfield
 * ─────────────────────────────────────────────────────────────
 * Uso: <link rel="stylesheet" href="endfield.css"> y HTML semántico. Ya está.
 *
 * Filosofía "usar y tirar":
 *   - Cero clases obligatorias. Los elementos HTML nativos ya salen estilizados.
 *   - Variantes vía atributos estándar y reproducibles:
 *       <html data-theme="light">        → tema claro (por defecto: oscuro)
 *       <button data-variant="ghost">    → botón secundario
 *       <button data-variant="danger">   → botón destructivo
 *       <span data-badge>ONLINE</span>   → badge / etiqueta HUD
 *       <p data-overline>SECTOR 07</p>   → overline técnica (eyebrow)
 *       <div data-brackets>…</div>       → esquinas HUD en cualquier caja
 *   - Tokens compatibles con ReEnd-Components (mismos nombres --ef-*, --surface-*,
 *     HSL sin wrapper para poder hacer hsl(var(--primary) / 0.4)).
 *
 * Mapa semántico (qué "es" cada elemento):
 *   <main>      contenedor centrado (65rem)      <article>  tarjeta con brackets
 *   <aside>     panel táctico con barra amarilla <section>  bloque con separación
 *   <header>    cabecera sticky con borde        <footer>   pie apagado
 *   <details>   acordeón (+/− rotatorio)         <dialog>   modal con blur
 *   <figure>    marco HUD con caption mono       <blockquote> cita con barra
 *
 * Fuentes: si añades esto en el <head> se activan las display/mono "de verdad";
 * si no, cae a system-ui y sigue funcionando offline:
 *   <link rel="preconnect" href="https://fonts.googleapis.com">
 *   <link href="https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@500;600;700&family=Saira:wght@400;500;600&family=JetBrains+Mono:wght@400;600&display=swap" rel="stylesheet">
 */

/* ═══════════════════════════ 1. TOKENS ═══════════════════════════ */

:root {
  color-scheme: dark;

  /* Paleta Endfield (HSL sin hsl() — permite / alpha) */
  --ef-black: 0 0% 4%;
  --ef-yellow: 48 100% 58%;        /* #FFD429 */
  --ef-yellow-dark: 48 85% 39%;
  --ef-blue: 201 66% 58%;          /* #4DA8DA */
  --ef-cyan: 186 100% 50%;
  --ef-red: 355 100% 64%;
  --ef-green: 145 67% 51%;
  --ef-orange: 39 100% 50%;
  --ef-purple: 270 77% 64%;

  /* Semánticos */
  --background: 0 0% 4%;
  --foreground: 0 0% 94.1%;
  --primary: 48 100% 58%;
  --primary-foreground: 0 0% 4%;
  --destructive: 355 100% 64%;
  --destructive-foreground: 0 0% 100%;
  --muted-foreground: 0 0% 60%;
  --link: 201 66% 58%;

  --surface-0: 0 0% 5.9%;
  --surface-1: 0 0% 7.8%;
  --surface-2: 0 0% 10%;
  --surface-3: 0 0% 13.3%;
  --surface-hover: 0 0% 11.8%;

  --border: 0 0% 100% / 0.08;
  --border-strong: 0 0% 100% / 0.16;
  --border-accent: 48 100% 58% / 0.4;

  /* Geometría: Endfield = radio cero + esquina cortada */
  --radius: 0px;
  --cut: 10px;                                    /* tamaño del corte diagonal */
  --clip-corner: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, 0 100%);

  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .4), 0 2px 4px -2px rgb(0 0 0 / .3);
  --shadow-glow: 0 0 20px hsl(var(--primary) / 0.25);

  --ease: cubic-bezier(0.25, 0.8, 0.25, 1);
  --fast: 150ms;

  /* Tipografía */
  --font-display: "Chakra Petch", "Rajdhani", system-ui, sans-serif;
  --font-body: "Saira", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --grid-color: rgb(255 255 255 / 0.025);
}

/* Tema claro (estilo pantalla de login: blanco roto + amarillo) */
:root[data-theme="light"] {
  color-scheme: light;
  --ef-yellow: 47 100% 52%;
  --background: 0 0% 96.5%;
  --foreground: 0 0% 8%;
  --primary: 47 100% 52%;
  --primary-foreground: 0 0% 6%;
  --destructive: 355 80% 50%;
  --muted-foreground: 0 0% 42%;
  --link: 202 56% 38%;
  --surface-0: 0 0% 94%;
  --surface-1: 0 0% 100%;
  --surface-2: 0 0% 97%;
  --surface-3: 0 0% 92%;
  --surface-hover: 0 0% 91%;
  --border: 0 0% 0% / 0.10;
  --border-strong: 0 0% 0% / 0.20;
  --border-accent: 47 100% 42% / 0.5;
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .08);
  --grid-color: rgb(0 0 0 / 0.035);
}

/* ═══════════════════════════ 2. BASE ═══════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: hsl(var(--foreground));
  background-color: hsl(var(--background));
  /* Rejilla topográfica sutil, marca de la casa */
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 32px 32px;
}

::selection {
  background: hsl(var(--ef-yellow));
  color: hsl(var(--ef-black));
}

:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
}

/* Scrollbar técnica */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: hsl(var(--surface-0)); }
::-webkit-scrollbar-thumb {
  background: hsl(var(--surface-3));
  border: 2px solid hsl(var(--surface-0));
}
::-webkit-scrollbar-thumb:hover { background: hsl(var(--primary)); }

/* ═══════════════════════════ 3. LAYOUT SEMÁNTICO ═══════════════════════════ */

main {
  max-width: 65rem;
  margin-inline: auto;
  padding: 2rem 1.25rem 4rem;
}

section + section {
  margin-top: 3rem;
  border-top: 1px solid hsl(var(--border));
  padding-top: 2.5rem;
}

body > header {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.5rem;
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border-strong));
}

/* El primer elemento del header actúa de "logo": display + barra amarilla */
body > header > :first-child {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
body > header > :first-child::before {
  content: "";
  width: 0.85em;
  height: 0.85em;
  background: hsl(var(--primary));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); /* rombo Endfield */
}

body > header nav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
  flex-wrap: wrap;
}
body > header nav a {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: hsl(var(--muted-foreground));
  padding: 0.45rem 0.9rem;
  border-bottom: 2px solid transparent;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
body > header nav a:hover,
body > header nav a[aria-current] {
  color: hsl(var(--foreground));
  border-bottom-color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.06);
}

body > footer {
  margin-top: 4rem;
  padding: 2rem 1.5rem;
  border-top: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

/* <article> = tarjeta HUD con esquinas bracket */
article, [data-brackets] {
  position: relative;
  background: hsl(var(--surface-1));
  border: 1px solid hsl(var(--border));
  padding: 1.5rem;
  margin-block: 1.5rem;
  box-shadow: var(--shadow-md);
}
article::before, article::after,
[data-brackets]::before, [data-brackets]::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
  border: 2px solid hsl(var(--primary) / 0.9);
}
article::before, [data-brackets]::before {
  top: -1px; left: -1px;
  border-right: none; border-bottom: none;
}
article::after, [data-brackets]::after {
  bottom: -1px; right: -1px;
  border-left: none; border-top: none;
}
article > h2:first-child, article > h3:first-child { margin-top: 0; }
article > :last-child { margin-bottom: 0; }

/* <aside> = panel táctico con barra lateral amarilla */
aside {
  background: hsl(var(--surface-2));
  border-left: 3px solid hsl(var(--primary));
  padding: 1rem 1.25rem;
  margin-block: 1.5rem;
  font-size: 0.95rem;
}
aside > :first-child { margin-top: 0; }
aside > :last-child { margin-bottom: 0; }

/* ═══════════════════════════ 4. TIPOGRAFÍA ═══════════════════════════ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 2rem 0 0.85rem;
  text-wrap: balance;
}

/* h1 estilo logo ENDFIELD: bloque con barra amarilla inferior */
h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.04em;
  padding-bottom: 0.35em;
  border-bottom: 4px solid hsl(var(--primary));
  display: inline-block;
}

/* h2 con marcador de rombo */
h2 {
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
h2::before {
  content: "";
  flex: none;
  width: 0.55em;
  height: 0.55em;
  background: hsl(var(--primary));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

h3 { font-size: 1.2rem; color: hsl(var(--foreground) / 0.92); }
h4, h5, h6 {
  font-size: 0.95rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.12em;
  color: hsl(var(--muted-foreground));
}

/* <hgroup>: h1 + subtítulo overline automáticos */
hgroup p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: hsl(var(--primary));
  margin: 0.4rem 0 0;
}

[data-overline] {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: hsl(var(--primary));
  margin-bottom: 0.25rem;
}
[data-overline]::before { content: "// "; opacity: 0.6; }

p { margin: 0 0 1rem; }

a {
  color: hsl(var(--link));
  text-decoration: underline;
  text-decoration-color: hsl(var(--link) / 0.35);
  text-underline-offset: 3px;
  transition: color var(--fast) var(--ease);
}
a:hover {
  color: hsl(var(--primary));
  text-decoration-color: hsl(var(--primary));
}

strong, b { font-weight: 600; color: hsl(var(--foreground)); }
em { color: hsl(var(--foreground) / 0.9); }
small { font-size: 0.82em; color: hsl(var(--muted-foreground)); }

mark {
  background: hsl(var(--ef-yellow));
  color: hsl(var(--ef-black));
  padding: 0.05em 0.3em;
  font-weight: 500;
}

abbr[title] {
  text-decoration: underline dotted hsl(var(--primary) / 0.6);
  cursor: help;
}

/* Listas con rombos */
ul { padding-left: 1.4rem; }
ul li::marker { content: "◆  "; color: hsl(var(--primary)); font-size: 0.7em; }
ul ul li::marker { content: "◇  "; }
ol { padding-left: 1.6rem; }
ol li::marker {
  font-family: var(--font-mono);
  font-weight: 600;
  color: hsl(var(--primary));
}
li { margin-block: 0.3rem; }

dl dt {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--primary));
  margin-top: 0.75rem;
}
dl dd { margin: 0.15rem 0 0 0; padding-left: 1rem; border-left: 1px solid hsl(var(--border-strong)); }

blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: hsl(var(--surface-1));
  border-left: 3px solid hsl(var(--primary));
  font-style: italic;
  color: hsl(var(--foreground) / 0.88);
}
blockquote > :last-child { margin-bottom: 0; }
blockquote footer, blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--muted-foreground));
  border: none;
  padding: 0;
  text-align: left;
}
blockquote cite::before { content: "— "; color: hsl(var(--primary)); }

/* <hr> = línea de escaneo con rombo central */
hr {
  border: none;
  height: 1px;
  margin: 2.5rem auto;
  background: linear-gradient(90deg, transparent, hsl(var(--border-strong)) 20%, hsl(var(--border-strong)) 80%, transparent);
  position: relative;
  overflow: visible;
}
hr::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  translate: -50% -50%;
  width: 8px; height: 8px;
  background: hsl(var(--primary));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

/* ═══════════════════════════ 5. CÓDIGO ═══════════════════════════ */

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

code {
  background: hsl(var(--surface-3));
  color: hsl(var(--ef-orange));
  padding: 0.15em 0.4em;
  border: 1px solid hsl(var(--border));
}

pre {
  background: hsl(var(--surface-0));
  border: 1px solid hsl(var(--border-strong));
  border-top: 2px solid hsl(var(--primary));
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.55;
  position: relative;
}
pre::before {
  /* etiqueta HUD del bloque; personalizable con <pre data-label="PS1"> */
  content: attr(data-label);
  position: absolute;
  top: 0; right: 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
  padding: 0.1rem 0.55rem;
}
pre:not([data-label])::before { content: "OUTPUT"; opacity: 0.85; }
pre code {
  background: none;
  border: none;
  padding: 0;
  color: hsl(var(--foreground) / 0.92);
  font-size: 0.85rem;
}

kbd {
  background: hsl(var(--surface-3));
  border: 1px solid hsl(var(--border-strong));
  border-bottom-width: 3px;
  padding: 0.1em 0.5em;
  font-size: 0.8em;
  font-weight: 600;
}

/* ═══════════════════════════ 6. TABLAS ═══════════════════════════ */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
  background: hsl(var(--surface-1));
  border: 1px solid hsl(var(--border));
  border-top: 2px solid hsl(var(--primary));
}
caption {
  caption-side: top;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: hsl(var(--muted-foreground));
  padding-bottom: 0.5rem;
}
caption::before { content: "▸ "; color: hsl(var(--primary)); }
th {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: left;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--surface-2));
}
th, td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid hsl(var(--border));
}
tbody tr:nth-child(even) { background: hsl(var(--surface-2) / 0.5); }
tbody tr:hover { background: hsl(var(--primary) / 0.06); }
tfoot td {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  border-bottom: none;
}

/* ═══════════════════════════ 7. FORMULARIOS ═══════════════════════════ */

form { margin-block: 1.5rem; }

fieldset {
  border: 1px solid hsl(var(--border-strong));
  padding: 1.25rem;
  margin-block: 1.5rem;
}
legend {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: hsl(var(--primary));
  padding: 0 0.6rem;
}

label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: hsl(var(--muted-foreground));
  margin: 1rem 0 0.35rem;
}

input, select, textarea {
  font: inherit;
  width: 100%;
  max-width: 32rem;
  color: hsl(var(--foreground));
  background: hsl(var(--surface-2));
  border: 1px solid hsl(var(--border-strong));
  border-radius: var(--radius);
  padding: 0.55rem 0.8rem;
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
input::placeholder, textarea::placeholder { color: hsl(var(--muted-foreground) / 0.7); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 1px hsl(var(--primary)), var(--shadow-glow);
}
input:disabled, select:disabled, textarea:disabled, button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
input:user-invalid, textarea:user-invalid {
  border-color: hsl(var(--destructive));
  box-shadow: 0 0 0 1px hsl(var(--destructive));
}

textarea { min-height: 7rem; resize: vertical; }

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, hsl(var(--primary)) 50%),
                    linear-gradient(135deg, hsl(var(--primary)) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 12px) 55%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}

/* Checkbox y radio = rombos ◇→◆ */
input[type="checkbox"], input[type="radio"] {
  appearance: none;
  width: 1.05rem;
  height: 1.05rem;
  padding: 0;
  margin: 0 0.5rem 0 0;
  vertical-align: -0.15em;
  display: inline-block;
  background: transparent;
  border: 2px solid hsl(var(--muted-foreground));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease);
}
input[type="checkbox"]:checked, input[type="radio"]:checked {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
}
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 3px;
  box-shadow: none;
}
/* Labels inline junto a checks: <label><input type=checkbox> Texto</label> */
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) {
  display: flex;
  align-items: center;
  text-transform: none;
  letter-spacing: normal;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.95rem;
  color: hsl(var(--foreground));
  cursor: pointer;
}

input[type="range"] {
  appearance: none;
  height: 3px;
  padding: 0;
  background: hsl(var(--surface-3));
  border: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px; height: 16px;
  background: hsl(var(--primary));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  border: none;
  background: hsl(var(--primary));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}

/* Botones: por defecto = primario amarillo con esquina cortada */
button, input[type="submit"], input[type="button"], input[type="reset"] {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  width: auto;
  cursor: pointer;
  color: hsl(var(--primary-foreground));
  background: hsl(var(--primary));
  border: none;
  padding: 0.65rem 1.5rem;
  clip-path: var(--clip-corner);
  transition: filter var(--fast) var(--ease), translate var(--fast) var(--ease), background var(--fast) var(--ease);
}
button:hover:not(:disabled), input[type="submit"]:hover:not(:disabled) {
  filter: brightness(1.1);
  translate: 0 -1px;
}
button:active:not(:disabled) { translate: 0 1px; filter: brightness(0.95); }

/* Variantes por atributo (y reset nativo = ghost) */
button[data-variant="ghost"], input[type="reset"] {
  background: transparent;
  color: hsl(var(--foreground));
  box-shadow: inset 0 0 0 1px hsl(var(--border-strong));
  clip-path: var(--clip-corner);
}
button[data-variant="ghost"]:hover:not(:disabled), input[type="reset"]:hover:not(:disabled) {
  box-shadow: inset 0 0 0 1px hsl(var(--primary));
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.08);
}
button[data-variant="danger"] {
  background: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
}

progress {
  appearance: none;
  width: 100%;
  height: 8px;
  border: 1px solid hsl(var(--border-strong));
  background: hsl(var(--surface-2));
}
progress::-webkit-progress-bar { background: hsl(var(--surface-2)); }
progress::-webkit-progress-value {
  background: repeating-linear-gradient(-45deg, hsl(var(--primary)) 0 8px, hsl(var(--primary) / 0.75) 8px 16px);
}
progress::-moz-progress-bar {
  background: repeating-linear-gradient(-45deg, hsl(var(--primary)) 0 8px, hsl(var(--primary) / 0.75) 8px 16px);
}

meter { width: 100%; height: 10px; }

output {
  font-family: var(--font-mono);
  color: hsl(var(--primary));
  font-weight: 600;
}

/* ═══════════════════════════ 8. INTERACTIVOS ═══════════════════════════ */

/* <details> = acordeón */
details {
  background: hsl(var(--surface-1));
  border: 1px solid hsl(var(--border));
  margin-block: 0.75rem;
}
summary {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 1.1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: background var(--fast) var(--ease);
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: "+";
  color: hsl(var(--primary));
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
  transition: rotate var(--fast) var(--ease);
}
details[open] > summary::before { rotate: 45deg; }
summary:hover { background: hsl(var(--surface-hover)); }
details[open] > summary { border-bottom: 1px solid hsl(var(--border)); }
details > :not(summary) { margin-inline: 1.1rem; }
details > p:last-child { padding-bottom: 0.5rem; }

/* <dialog> = modal HUD */
dialog {
  color: hsl(var(--foreground));
  background: hsl(var(--surface-1));
  border: 1px solid hsl(var(--border-strong));
  border-top: 3px solid hsl(var(--primary));
  box-shadow: var(--shadow-md), var(--shadow-glow);
  padding: 1.75rem;
  max-width: min(90vw, 34rem);
}
dialog::backdrop {
  background: rgb(0 0 0 / 0.6);
  backdrop-filter: blur(4px);
}
dialog > h2:first-child, dialog > h3:first-child { margin-top: 0; }

/* Badges: <span data-badge> / colores con data-badge="ok|warn|error|info" */
[data-badge] {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1;
  padding: 0.3em 0.7em;
  color: hsl(var(--primary));
  background: hsl(var(--primary) / 0.12);
  border: 1px solid hsl(var(--primary) / 0.45);
}
[data-badge="ok"]    { color: hsl(var(--ef-green));  background: hsl(var(--ef-green) / 0.12);  border-color: hsl(var(--ef-green) / 0.45); }
[data-badge="warn"]  { color: hsl(var(--ef-orange)); background: hsl(var(--ef-orange) / 0.12); border-color: hsl(var(--ef-orange) / 0.45); }
[data-badge="error"] { color: hsl(var(--ef-red));    background: hsl(var(--ef-red) / 0.12);    border-color: hsl(var(--ef-red) / 0.45); }
[data-badge="info"]  { color: hsl(var(--ef-blue));   background: hsl(var(--ef-blue) / 0.12);   border-color: hsl(var(--ef-blue) / 0.45); }

/* ═══════════════════════════ 9. MEDIA Y FIGURAS ═══════════════════════════ */

img, video, svg, canvas { max-width: 100%; height: auto; }

figure {
  margin: 1.75rem 0;
  padding: 0.75rem;
  background: hsl(var(--surface-1));
  border: 1px solid hsl(var(--border));
  position: relative;
}
figure::before, figure::after {
  content: "";
  position: absolute;
  width: 12px; height: 12px;
  border: 2px solid hsl(var(--primary) / 0.8);
}
figure::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
figure::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }
figcaption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: hsl(var(--muted-foreground));
  padding-top: 0.6rem;
}
figcaption::before { content: "FIG // "; color: hsl(var(--primary)); }

/* ═══════════════════════════ 10. ACCESIBILIDAD ═══════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  body { background: white; color: black; }
  body > header, body > footer { display: none; }
}
