/* IT Simplificado: estilos del sitio.
   Paleta = colores exactos de los logos. El tema sigue al navegador:
   claro  -> logo horizontal fondo blanco (texto azul marino, puntos azules)
   oscuro -> logo horizontal fondo azul   (texto blanco, punto cian)
   Layout: banner arriba, panel del autor a la izquierda, cuerpo al centro. */

@font-face {
  font-family: "Space Grotesk";
  src: url("fonts/SpaceGrotesk.ttf") format("truetype");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  /* colores de marca */
  --navy: #0A1630;
  --blue: #1E6BFF;
  --cyan: #3FD0FF;
  --snow: #F4F7FB;
  --white: #FFFFFF;

  /* tokens de tema (claro) */
  --bg: var(--snow);
  --surface: var(--white);
  --banner-bg: var(--white);
  --ink: var(--navy);
  --muted: #46536E;
  --accent: var(--blue);
  --rule: #DCE3EE;
  --logo-top: var(--blue);
  --logo-node: var(--navy);

  --font-brand: "Space Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #07101F;
    --surface: #0F1E3D;
    --banner-bg: var(--navy);
    --ink: var(--snow);
    --muted: #A9B6CF;
    --accent: var(--cyan);
    --rule: #1D2D52;
    --logo-top: var(--cyan);
    --logo-node: var(--snow);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #07101F;
  --surface: #0F1E3D;
  --banner-bg: var(--navy);
  --ink: var(--snow);
  --muted: #A9B6CF;
  --accent: var(--cyan);
  --rule: #1D2D52;
  --logo-top: var(--cyan);
  --logo-node: var(--snow);
  color-scheme: dark;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

a { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

h1, h2 {
  font-family: var(--font-brand);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
  margin: 0;
}

/* ---------- Banner con logo horizontal ---------- */
.banner {
  position: relative;
  background: var(--banner-bg);
  border-bottom: 1px solid var(--rule);
  display: flex;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 2.75rem) 16px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.37em;
  font-family: var(--font-brand);
  font-size: clamp(1.75rem, 6vw, 3.5rem);
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
.logo-icon { width: 1.42em; height: 1.42em; flex: none; }
.logo-top { fill: var(--logo-top); }
.logo-node { fill: var(--logo-node); }

.logo-word {
  display: inline-flex;
  align-items: baseline;
  font-weight: 300;
  letter-spacing: -0.025em;
}
.logo-word b { font-weight: 700; }
.logo-s { margin-left: 0.233em; }
.logo-i { position: relative; display: inline-block; }
.logo-dot {
  position: absolute;
  left: 50%;
  top: 0.025em;
  width: 0.217em;
  height: 0.217em;
  margin-left: -0.108em;
  border-radius: 50%;
  background: var(--logo-top);
}

/* Botón de modo claro/oscuro, arriba a la derecha del banner */
.theme-toggle {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle [hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .theme-toggle { transition: none; } }
@media (max-width: 480px) { .theme-toggle { top: 8px; right: 8px; } }

/* ---------- Layout: panel izquierdo + cuerpo ---------- */
.layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) 16px;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

/* ---------- Panel del autor ---------- */
.author {
  position: sticky;
  top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.author-photo { margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.author-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 20%;
  border-radius: 10px;
  background: var(--bg);
}
.author-photo figcaption {
  font-family: var(--font-brand);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.author-bio h2 {
  font-size: 1.15rem;
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.author-bio p { margin: 0 0 0.75rem; font-size: 0.95rem; color: var(--ink); }
.author-bio p:last-child { margin-bottom: 0; }

/* ---------- Cuerpo ---------- */
.content { display: flex; flex-direction: column; gap: clamp(2.5rem, 5vw, 3.5rem); min-width: 0; }

.qa { max-width: 65ch; }
.qa h1, .qa h2 { font-size: clamp(1.75rem, 3.6vw, 2.5rem); margin-bottom: 1rem; }
.qa h1::after, .qa h2::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 4px;
  margin-top: 0.85rem;
  border-radius: 2px;
  background: var(--accent);
}
.qa p { margin: 0 0 1rem; font-size: 1.125rem; }

/* ---------- Pie ---------- */
.footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 16px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer p { margin: 0; }

/* ---------- Móvil: el panel pasa arriba del cuerpo ---------- */
@media (max-width: 800px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .author { position: static; }
  .author-photo { flex-direction: row; align-items: center; gap: 1rem; }
  .author-photo img { width: 96px; flex: none; aspect-ratio: 1 / 1; border-radius: 50%; }
}
