/* ===================================================================
   familia.css — la estética de gioser.net para sus páginas hermanas
   (hifas.gioser.net, gioser.net/humanoid). Oscura de fábrica, clara si
   el navegador lo pide; la franja de arriba es la misma de la portada.
   Se pide por URL absoluta: https://gioser.net/familia.css
   =================================================================== */

:root {
  --f-bg: #0b0b10;
  --f-raised: #13131a;
  --f-fg: #ece8e1;
  --f-soft: #b7b2ab;
  --f-mute: #847f7a;
  --f-line: #24232b;
  --f-accent: #f2a24e;
  --f-accent-2: #a487ff;
  --f-glass: rgba(11, 11, 16, 0.72);
  --lz1: #8a63ff; --lz2: #f2a24e; --lz3: #4f86ff; --lz-op: 0.22;
  --f-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --f-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --f-bg: #f7f5f0; --f-raised: #ffffff; --f-fg: #1a1a24; --f-soft: #4c4b57; --f-mute: #7c7a85;
    --f-line: #e3dfd6; --f-accent: #b4561c; --f-accent-2: #6b4fd8; --f-glass: rgba(247, 245, 240, 0.78);
    --lz1: #9b7bff; --lz2: #f0a050; --lz3: #5b8ef0; --lz-op: 0.30;
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--f-bg);
  color: var(--f-fg);
  font: 400 1.0rem/1.65 var(--f-sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}
a { color: inherit; }
::selection { background: var(--f-accent); color: var(--f-bg); }

/* ---------- Luces de fondo ---------- */
.f-luces { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; transition: opacity .6s, filter 1.4s; }
.f-luces i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(70px); opacity: var(--lz-op); will-change: transform; }
.f-luces i:nth-child(1) { background: radial-gradient(circle, var(--lz1), transparent 65%); left: -20vmax; top: -15vmax; }
.f-luces i:nth-child(2) { background: radial-gradient(circle, var(--lz2), transparent 65%); right: -25vmax; top: 20vh; }
.f-luces i:nth-child(3) { background: radial-gradient(circle, var(--lz3), transparent 65%); left: 10vw; bottom: -30vmax; }
:root:not([data-fondo="vidrio"]) .f-luces i:nth-child(1) { animation: flz1 38s ease-in-out infinite alternate; }
:root:not([data-fondo="vidrio"]) .f-luces i:nth-child(2) { animation: flz2 46s ease-in-out infinite alternate; }
:root:not([data-fondo="vidrio"]) .f-luces i:nth-child(3) { animation: flz3 52s ease-in-out infinite alternate; }
@keyframes flz1 { to { transform: translate(30vw, 25vh) scale(1.15); } }
@keyframes flz2 { to { transform: translate(-35vw, 15vh) scale(.9); } }
@keyframes flz3 { to { transform: translate(25vw, -35vh) scale(1.2); } }
[data-fondo="vidrio"] .f-luces i { transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
[data-fondo="vidrio"] .f-luces i:nth-child(1) { transform: translate(calc(var(--px, .5) * 40vw), calc(var(--py, .5) * 30vh)); }
[data-fondo="vidrio"] .f-luces i:nth-child(2) { transform: translate(calc(var(--px, .5) * -30vw), calc(var(--py, .5) * 20vh)); }
[data-fondo="vidrio"] .f-luces i:nth-child(3) { transform: translate(calc(var(--px, .5) * 20vw), calc(var(--py, .5) * -25vh)); }
[data-fondo="ninguno"] .f-luces { opacity: 0; }

/* ---------- La franja ---------- */
.f-franja {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1rem;
  height: 64px; padding-inline: clamp(1rem, 4vw, 2.5rem);
  background: var(--f-glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.3); backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--f-line);
}
.f-marca { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-weight: 600; letter-spacing: -.01em; font-size: 1.05rem; }
.f-marca svg { width: 30px; height: 30px; flex: none; }
.f-menu { flex: 1; min-width: 0; display: flex; justify-content: center; gap: .25rem; overflow-x: auto; scrollbar-width: none; }
.f-menu::-webkit-scrollbar { display: none; }
.f-menu a { flex: none; padding: .45rem .85rem; border-radius: 999px; color: var(--f-soft); text-decoration: none; font: 500 1.02rem/1 var(--f-serif); }
.f-menu a:hover { color: var(--f-fg); }
.f-menu a.activo { color: var(--f-fg); background: color-mix(in srgb, var(--f-accent) 20%, transparent); }
.f-glifos { display: flex; align-items: center; gap: .5rem; }
.f-glifo {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 999px;
  border: 1px solid currentColor; color: var(--f-fg); opacity: .85; text-decoration: none;
  background: none; cursor: pointer; font: 500 .78rem/1 var(--f-mono); letter-spacing: .08em;
  transition: opacity .2s, color .2s;
}
.f-glifo svg { width: 17px; height: 17px; }
.f-glifo:hover { opacity: 1; color: var(--f-accent); }
.f-glifo.f-idioma { width: auto; padding-inline: .75rem; }
@media (max-width: 40rem) {
  .f-marca span { display: none; }
  .f-franja { gap: .5rem; }
  .f-menu { justify-content: flex-start; gap: 0; }
  .f-menu a { padding: .3rem .3rem; font-size: .8rem; }
  .f-glifo { width: 28px; height: 28px; }
  .f-glifo svg { width: 15px; height: 15px; }
  .f-glifos { gap: .3rem; }
  .f-glifo.f-idioma { padding-inline: .5rem; }
}

/* ---------- Columna, encabezado y bloques ---------- */
.f-columna { max-width: 52rem; margin: 0 auto; padding: clamp(2rem, 6vh, 3.5rem) clamp(1rem, 4vw, 2rem) 4rem; }
.f-cabeza { margin-bottom: 2.5rem; }
.f-cabeza .f-imagen { aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; margin-bottom: 2rem; background: #0b0b10; border: 1px solid var(--f-line); }
.f-cabeza .f-imagen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.f-ante { font: 500 .74rem/1.4 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--f-accent); margin-bottom: .9rem; }
.f-cabeza h1 { font: 500 clamp(2.4rem, 6vw, 3.8rem)/1.04 var(--f-serif); letter-spacing: -.01em; text-wrap: balance; }
.f-lema { margin-top: 1rem; font: italic 500 clamp(1.15rem, 2.2vw, 1.45rem)/1.45 var(--f-serif); color: var(--f-soft); text-wrap: pretty; max-width: 42rem; }

.f-bloque {
  margin-top: 1.25rem; padding: clamp(1.25rem, 3vw, 2rem);
  border-radius: 18px; border: 1px solid var(--f-line);
  background: color-mix(in srgb, var(--f-raised) 80%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.f-bloque h2 { font: 600 clamp(1.5rem, 3vw, 1.95rem)/1.15 var(--f-serif); margin-bottom: .8rem; text-wrap: balance; }
.f-bloque h3 { font: 600 1.2rem/1.3 var(--f-serif); margin: 1.4rem 0 .5rem; }
.f-bloque p { color: var(--f-soft); text-wrap: pretty; }
.f-bloque p + p { margin-top: .9rem; }
.f-bloque strong { color: var(--f-fg); font-weight: 600; }
.f-bloque code, .f-meta, .f-mono { font-family: var(--f-mono); font-size: .86em; }
.f-bloque ul { margin-top: .4rem; padding-left: 1.1rem; color: var(--f-soft); }
.f-bloque li + li { margin-top: .4rem; }
.f-bloque blockquote {
  margin: 1.2rem 0; padding: .9rem 1.2rem; border-left: 2px solid var(--f-accent);
  background: color-mix(in srgb, var(--f-accent) 8%, transparent); border-radius: 0 12px 12px 0;
  font: italic 500 1.15rem/1.5 var(--f-serif); color: var(--f-fg);
}
.f-bloque table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: .92rem; }
.f-bloque th, .f-bloque td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--f-line); vertical-align: top; }
.f-bloque th { font: 500 .7rem/1.2 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--f-mute); }
.f-bloque td { color: var(--f-soft); }
.f-bloque td:first-child { color: var(--f-fg); white-space: nowrap; }
.f-tabla { overflow-x: auto; }

/* ---------- Listas: la misma tarjeta de la portada ---------- */
.f-lista { list-style: none; display: flex; flex-direction: column; gap: 1.25rem; margin-top: 1.25rem; }
.f-item {
  display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.25fr); gap: clamp(1rem, 3vw, 2rem); align-items: center;
  padding: 1rem; border-radius: 18px; border: 1px solid var(--f-line);
  background: color-mix(in srgb, var(--f-raised) 80%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: border-color .3s, transform .35s cubic-bezier(.2, .8, .2, 1);
}
.f-item:hover { border-color: color-mix(in srgb, var(--f-accent) 45%, var(--f-line)); transform: translateY(-2px); }
.f-medio { aspect-ratio: 16 / 10; border-radius: 12px; overflow: hidden; background: #0b0b10; position: relative; display: grid; place-items: center; }
.f-medio img { width: 100%; height: 100%; object-fit: cover; display: block; }
.f-medio .f-sello { position: absolute; width: 34%; color: #ffc27e; filter: drop-shadow(0 0 10px rgba(242, 162, 78, .8)) drop-shadow(0 0 28px rgba(242, 162, 78, .45)); }
.f-medio .f-sello svg { width: 100%; height: auto; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.f-item-texto { min-width: 0; padding: .25rem .5rem .25rem 0; }
.f-item h2, .f-item h3 { font: 600 clamp(1.3rem, 2.3vw, 1.6rem)/1.15 var(--f-serif); margin-bottom: .5rem; }
.f-item p { color: var(--f-soft); font-size: .96rem; text-wrap: pretty; }
.f-meta { margin-top: .7rem; color: var(--f-mute); font-size: .74rem; line-height: 1.55; }
.f-enlace { display: inline-block; margin-top: .8rem; font-size: .9rem; color: var(--f-fg); text-decoration: none; border-bottom: 1px solid var(--f-accent); padding-bottom: 1px; }
.f-enlace:hover { color: var(--f-accent); }
@media (max-width: 720px) {
  .f-item { grid-template-columns: 1fr; padding: .75rem; }
  .f-item-texto { padding: .25rem .35rem .5rem; }
}

/* ---------- Pie ---------- */
.f-pie { max-width: 52rem; margin: 0 auto; padding: 2.5rem clamp(1rem, 4vw, 2rem) 4rem; border-top: 1px solid var(--f-line); color: var(--f-mute); font-size: .88rem; }
.f-pie a { color: var(--f-soft); }
.f-pie a:hover { color: var(--f-accent); }

/* ---------- Animación de entrada ---------- */
.f-entra { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.f-entra.visto { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .f-entra { opacity: 1; transform: none; transition: none; }
  .f-luces i { animation: none !important; transition: none !important; }
}

/* ---------- Páginas largas: índice, resumen, fórmulas, figuras, referencias ---------- */
.f-bloque { scroll-margin-top: 76px; }
.f-indice { columns: 2 16rem; column-gap: 2rem; margin-top: .4rem; padding-left: 1.2rem; color: var(--f-soft); }
.f-indice li { break-inside: avoid; margin-bottom: .3rem; }
.f-indice a { text-decoration: none; color: var(--f-soft); }
.f-indice a:hover { color: var(--f-accent); }
.f-resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .75rem; margin-top: 1rem; }
.f-resumen div { padding: .8rem .9rem; border-radius: 12px; border: 1px solid var(--f-line); background: color-mix(in srgb, var(--f-bg) 50%, transparent); }
.f-resumen b { display: block; font: 600 1.5rem/1.1 var(--f-serif); color: var(--f-fg); }
.f-resumen span { font-size: .82rem; color: var(--f-mute); }
.f-formula {
  margin: 1rem 0; padding: .85rem 1.1rem; border-radius: 12px; overflow-x: auto;
  font: 500 .92rem/1.7 var(--f-mono); color: var(--f-fg); white-space: pre;
  background: color-mix(in srgb, var(--f-bg) 60%, transparent); border: 1px solid var(--f-line);
}
.f-figura { margin: 1.4rem 0 .4rem; }
.f-figura .f-lienzo { overflow-x: auto; border-radius: 14px; border: 1px solid var(--f-line); background: color-mix(in srgb, var(--f-bg) 55%, transparent); }
.f-figura svg { display: block; width: 100%; min-width: 540px; height: auto; font-family: var(--f-sans); }
.f-figura figcaption { margin-top: .6rem; font-size: .84rem; color: var(--f-mute); line-height: 1.55; }
.f-figura figcaption b { color: var(--f-soft); font-weight: 600; }
/* el vocabulario de los dibujos */
.g-t { fill: var(--f-soft); font-size: 14px; }
.g-tt { fill: var(--f-fg); font-size: 15px; font-weight: 600; }
.g-m { fill: var(--f-mute); font-size: 12px; font-family: var(--f-mono); }
.g-a { fill: var(--f-accent); }
.g-ta { fill: var(--f-accent); font-size: 14px; font-weight: 600; }
.g-tv { fill: var(--f-accent-2); font-size: 14px; font-weight: 600; }
.g-l { stroke: var(--f-mute); stroke-width: 1.5; fill: none; }
.g-la { stroke: var(--f-accent); stroke-width: 2; fill: none; }
.g-lv { stroke: var(--f-accent-2); stroke-width: 2; fill: none; }
.g-ld { stroke: var(--f-mute); stroke-width: 1.5; fill: none; stroke-dasharray: 5 5; }
.g-n { fill: var(--f-raised); stroke: var(--f-fg); stroke-width: 1.5; }
.g-na { fill: color-mix(in srgb, var(--f-accent) 25%, var(--f-raised)); stroke: var(--f-accent); stroke-width: 2; }
.g-nv { fill: color-mix(in srgb, var(--f-accent-2) 25%, var(--f-raised)); stroke: var(--f-accent-2); stroke-width: 2; }
.g-caja { fill: color-mix(in srgb, var(--f-fg) 6%, transparent); stroke: var(--f-line); stroke-width: 1; }
.g-fa { fill: color-mix(in srgb, var(--f-accent) 55%, transparent); }
.g-fv { fill: color-mix(in srgb, var(--f-accent-2) 45%, transparent); }
.g-fm { fill: color-mix(in srgb, var(--f-mute) 30%, transparent); }
.f-refs { padding-left: 1.3rem; color: var(--f-soft); font-size: .9rem; }
.f-refs li + li { margin-top: .5rem; }
.f-refs em { color: var(--f-fg); }
