:root {
  --bg: #eef1ea;
  --text: #1d2a24;
  --muted: #8ecfaa;
  --accent: #2f6f55;
  --accent-text: #ffffff;
  --card: #ffffff;
  --border: #cfd8cf;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131a16; --text: #e8efe9; --muted: #8ecfaa;
    --accent: #6fcf9f; --accent-text: #0e1f17; --card: #1b2520; --border: #2c3a32;
  }
}
* { box-sizing: border-box; margin: 0; }
html, body { min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  display: flex;
  justify-content: center;
  padding: 3rem 1.25rem;
  margin: 0;
  min-height: 100vh;
  position: relative;
  isolation: isolate;
}

/* Fondo desenfocado y oscurecido */
body::before {
  content: "";
  position: fixed;
  inset: -10px;
  z-index: -1;

  background: url("img/fondo.png") center / cover no-repeat;

  filter: blur(6px) brightness(40%);
}

main { width: 100%; max-width: 50rem; position: relative; }

/* Selector de idioma */
.lang {
  position: absolute; top: -1.5rem; right: 0;
  display: flex; gap: .5rem;
}
.lang button {
  width: 1.75rem; height: 1.75rem; padding: 0;
  border: 2px solid transparent; border-radius: 50%;
  background: none; cursor: pointer; overflow: hidden;
  opacity: .55; transition: opacity .15s, border-color .15s;
}
.lang button:hover { opacity: .85; }
.lang button[aria-pressed="true"] { opacity: 1; border-color: var(--accent); }
.lang svg { width: 100%; height: 100%; display: block; border-radius: 50%; }
.lang button:focus-visible, .links a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Cabecera */
h1 { font-size: clamp(2.2rem, 9vw, 3.2rem); line-height: 1.05; font-weight: 800; letter-spacing: -.02em; color: #2ad841}
.role { color: var(--accent); font-weight: 700; margin-top: .5rem; }
.intro { color: var(--muted); margin: 1rem 0 2rem; font-size: 1.05rem; }
.quote {
  color: var(--muted);
  margin: 1rem 0 2rem;
  padding-left: 20rem;
  font-size: 0.8rem;
  text-align: right;
  font-style: italic;
}

/* Avatar + botones de redes */
.social { display: flex; align-items: center; gap: .75rem; }
.avatar-box { flex: none; display: none; }   /* tamaño lo calcula el JS */
.avatar-box.ready { display: block; }
.avatar {
  display: block; width: 100%; height: 100%;
  object-fit: cover; border-radius: 14px;
  border: 1px solid var(--border); background: var(--card);
}
.links { flex: 1; min-width: 0; list-style: none; padding: 0; display: grid; gap: .75rem; }
.links a {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .9rem 1.2rem; border-radius: 14px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border);
  text-decoration: none; font-weight: 700;
  transition: background .15s, color .15s, transform .15s;
}
.links a:hover { background: var(--accent); color: var(--accent-text); transform: translateY(-2px); }
.links svg { width: 1.2rem; height: 1.2rem; fill: currentColor; }
footer { margin-top: 2.5rem; font-size: .8rem; color: var(--muted); }
#email {
  font-size: larger;
}

#mailto {
  color: #00be23;
}
@media (prefers-reduced-motion: reduce) { .links a { transition: none; } .links a:hover { transform: none; } }
