:root {
  --bg: #ECECEE;
  --bg-top: #F8F8F9;
  --text: #1A1824;
  --muted: #6E6C78;
  --line: rgba(26, 24, 36, 0.12);
  --pill-bg: rgba(255, 255, 255, 0.55);
  --tip-bg: rgba(28, 28, 30, 0.92);
  --tile: 52px;
  --font: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg) radial-gradient(ellipse 90% 55% at 50% 0%, var(--bg-top), var(--bg) 70%) no-repeat;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

/* Idioma: solo se ve el bloque del idioma activo */
html[lang="es"] [lang="en"],
html[lang="en"] [lang="es"] { display: none; }

/* ---------- Píldora de navegación ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 12px;
  color: var(--muted);
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: #B9B8BF; }
.pill-sep { width: 1px; height: 12px; background: var(--line); }
.pill-link {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.pill-link:hover span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.pill-play { width: 9px; height: 9px; fill: var(--text); }
.pill-back { transform: rotate(-90deg); }
.pill-lang {
  font: inherit; border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--muted); display: inline-flex; gap: 6px;
}
.pill-lang span { transition: color .15s; }
html[lang="es"] .pill-lang [data-l="es"],
html[lang="en"] .pill-lang [data-l="en"] { color: var(--text); font-weight: 600; }

/* ---------- Portada ---------- */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  padding: 20px 16px 56px;
}
.intro { align-self: center; text-align: center; padding: 48px 0; }
.avatar {
  width: 88px; height: 88px; border-radius: 50%;
  object-fit: cover; filter: grayscale(1) contrast(1.05);
  display: block; margin: 0 auto;
}
.name { margin: 14px 0 0; font-size: 15px; font-weight: 500; }
.tagline {
  margin: 28px 0 0;
  font-size: clamp(38px, 6.2vw, 64px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.025em;
}

/* ---------- Dock ---------- */
.dock-wrap { align-self: end; max-width: 100%; }
.dock {
  list-style: none; margin: 0;
  display: flex; align-items: flex-end; gap: 6px;
  height: calc(var(--tile) + 20px);
  padding: 8px 10px 12px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
}
.dock-item { position: relative; --s: 1; }
.dock-item a {
  position: relative; display: block;
  width: calc(var(--tile) * var(--s));
  height: calc(var(--tile) * var(--s));
  transition: width .18s ease-out, height .18s ease-out;
  outline: none;
}
.dock.is-tracking .dock-item a { transition-duration: .06s; }
/* Punto bajo el icono, como las apps abiertas del Mac */
.dock-item a::after {
  content: ""; position: absolute; left: 50%; bottom: -8px;
  width: 4px; height: 4px; margin-left: -2px; border-radius: 50%;
  background: rgba(26, 24, 36, 0.45);
}
.tile {
  display: grid; place-items: center;
  width: 100%; height: 100%;
  border-radius: 23%;
  overflow: hidden;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.12);
}
.tile svg { width: 54%; height: 54%; fill: #fff; }
.tile-linkedin { background: linear-gradient(180deg, #1C7AD8, #0A66C2); }
.tile-x { background: linear-gradient(180deg, #2A2A2A, #000); }
.tile-x svg { width: 48%; height: 48%; }
.tile-substack { background: linear-gradient(180deg, #FF7D3A, #FF6719); }
.tile-substack svg { width: 46%; height: 46%; }
.tile-github { background: linear-gradient(180deg, #333A42, #1F2328); }
.tile-github svg { width: 60%; height: 60%; }
.tile-img img { width: 100%; height: 100%; display: block; }
.dock-sep {
  align-self: center; width: 1px; height: calc(var(--tile) * 0.8);
  margin: 0 6px; background: rgba(26, 24, 36, 0.18);
}

/* Tooltip con el nombre de la app */
.tip {
  position: absolute; left: 50%; bottom: calc(100% + 14px);
  transform: translate(-50%, 4px);
  padding: 6px 12px;
  border-radius: 9px;
  background: var(--tip-bg);
  color: #F2F2F4;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  opacity: 0; pointer-events: none;
  transition: opacity .12s, transform .12s;
}
.tip::after {
  content: ""; position: absolute; left: 50%; top: 100%;
  margin-left: -6px;
  border: 6px solid transparent; border-top-color: var(--tip-bg);
}
.dock-item a:hover .tip,
.dock-item a:focus-visible .tip { opacity: 1; transform: translate(-50%, 0); }
.dock-item a:focus-visible .tile { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #5B4FE0; }

/* En pantallas táctiles no hay hover: sin zoom ni tooltip */
@media (hover: none) {
  .tip { display: none; }
}

/* ---------- Carta ---------- */
.about {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 16px 96px;
}
.letter {
  max-width: 520px; width: 100%;
  margin-top: 32px;
  font-size: 15px; line-height: 1.6;
}
.letter p { margin: 0 0 16px; }
.letter .sign { margin-top: 24px; }
.connect { max-width: 520px; width: 100%; margin-top: 8px; font-size: 15px; }
.connect p { margin: 0 0 10px; }
.connect ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; }
.connect a {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none; font-size: 13px;
}
.connect a:hover { color: var(--text); }
.connect svg { width: 12px; height: 12px; fill: currentColor; }
.connect svg[fill="none"] { fill: none; }

/* ---------- Móvil ---------- */
@media (max-width: 480px) {
  :root { --tile: 46px; }
  .dock { gap: 5px; padding: 7px 8px 11px; border-radius: 20px; }
  .dock-sep { margin: 0 3px; }
  .intro { padding: 32px 0; }
}
