:root {
  --bg: #0b0a08;
  --card: rgba(18, 16, 12, 0.72);
  --edge: rgba(255, 226, 150, 0.14);
  --text: #e9e4d8;
  --muted: #9b9484;
  --gold: #e9b82e;
  --gold-hi: #fff0b3;
  --gold-lo: #b9801a;
  --display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --body: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--gold); color: #1a1405; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* fondo: la propia imagen, desenfocada y con zoom lento */
.bg {
  position: fixed; inset: -6%;
  z-index: -3;
  background: url("avatar.jpg") center/cover no-repeat;
  filter: blur(46px) saturate(1.15) brightness(0.45);
  animation: kenburns 28s ease-in-out infinite alternate;
}
@keyframes kenburns { to { transform: scale(1.12) translate(-1.5%, 1%); } }
.vignette {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(5, 4, 3, 0.75) 100%),
    linear-gradient(rgba(5, 4, 3, 0.35), rgba(5, 4, 3, 0.35));
}
#coins { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* pantalla de entrada */
.enter {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: var(--bg);
  border: 0; cursor: pointer; color: var(--muted);
  font-family: var(--display); font-weight: 500; font-size: 15px; letter-spacing: 6px; text-transform: uppercase;
  transition: opacity 0.8s ease, visibility 0.8s, transform 0.8s ease;
}
.enter img {
  width: 120px; height: 120px; border-radius: 50%; object-fit: cover; object-position: 50% 30%;
  border: 2px solid var(--gold);
  transition: transform 0.5s cubic-bezier(.2, .8, .2, 1);
}
.enter:hover img { transform: scale(1.1) rotate(-4deg); }
.enter:hover { color: var(--gold); }
body.entered .enter { opacity: 0; visibility: hidden; transform: scale(1.04); pointer-events: none; }

/* escenario */
.stage {
  min-height: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 18px;
  perspective: 1100px;
}
.card {
  width: 100%; max-width: 470px;
  padding: 0 30px 28px;
  background: var(--card);
  border: 1px solid var(--edge);
  border-radius: 26px;
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9);
  text-align: center;
  transition: transform 0.45s cubic-bezier(.2, .8, .2, 1);
  will-change: transform;
}
.card.tilting { transition: none; }

/* entrada escalonada */
body:not(.entered) .card > *, body:not(.entered) .top > * { opacity: 0; }
body.entered .card > *, body.entered .top > * {
  animation: rise 0.8s cubic-bezier(.2, .8, .2, 1) backwards;
}
body.entered .top { animation: none; }
body.entered .top > :nth-child(1) { animation-delay: 0.05s; }
body.entered .top > :nth-child(2) { animation-delay: 0.18s; }
body.entered .top > :nth-child(3) { animation-delay: 0.28s; }
body.entered .card > .tags { animation-delay: 0.38s; }
body.entered .card > .bio { animation-delay: 0.48s; }
body.entered .card > .project { animation-delay: 0.58s; }
body.entered .card > .copy { animation-delay: 0.7s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
/* avatar que sobresale de la tarjeta */
.avatar {
  width: 168px; height: 168px;
  margin: -64px auto 18px;
  border-radius: 50%;
  padding: 4px;
  background: conic-gradient(from 210deg, var(--gold-lo), var(--gold-hi), var(--gold), var(--gold-lo));
  box-shadow: 0 18px 40px -10px rgba(0, 0, 0, 0.8);
  transition: transform 0.5s cubic-bezier(.2, .8, .2, 1);
}
.avatar:hover { transform: scale(1.05) rotate(-3deg); }
.avatar img {
  display: block; width: 100%; height: 100%;
  border-radius: 50%; object-fit: cover; object-position: 50% 28%;
  border: 3px solid #14110b;
}
body.entered .avatar { animation: rise 0.8s cubic-bezier(.2, .8, .2, 1) 0.05s backwards, float 6s ease-in-out 1.2s infinite; }
@keyframes float { 50% { translate: 0 -6px; } }

/* nombre en oro con brillo que pasa */
.name {
  position: relative;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 9vw, 44px);
  letter-spacing: -1.5px;
  line-height: 1.05;
  background: linear-gradient(100deg, var(--gold-lo) 20%, var(--gold-hi) 42%, var(--gold) 50%, var(--gold-lo) 80%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: shine 5s ease-in-out infinite;
}
@keyframes shine { 0%, 15% { background-position: 120% 0; } 70%, 100% { background-position: -40% 0; } }

.role { margin-top: 8px; min-height: 24px; color: var(--muted); font-size: 14px; letter-spacing: 0.3px; }
.caret { display: inline-block; width: 2px; height: 15px; margin-left: 3px; vertical-align: -2px; background: var(--gold); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* etiquetas */
.tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 20px; }
.tags li {
  padding: 5px 15px;
  font-size: 12.5px; font-weight: 600; color: #d8cfb8;
  border: 1px solid var(--edge);
  border-radius: 99px;
  transition: all 0.25s;
}
.tags li:hover { background: var(--gold); border-color: var(--gold); color: #1a1405; transform: translateY(-2px); }

.bio { margin: 22px auto 0; max-width: 380px; color: var(--muted); }

/* proyecto */
.project {
  position: relative; display: block; overflow: hidden;
  margin-top: 26px;
  padding: 22px 22px 20px;
  text-align: left;
  background: linear-gradient(160deg, rgba(233, 184, 46, 0.1), rgba(233, 184, 46, 0.02));
  border: 1px solid var(--edge);
  border-radius: 18px;
  transition: transform 0.35s cubic-bezier(.2, .8, .2, 1), border-color 0.3s;
}
.project::after {
  content: ""; position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 240, 179, 0.16), transparent);
  transform: skewX(-18deg);
  transition: left 0.8s ease;
}
.project:hover { transform: translateY(-4px); border-color: rgba(233, 184, 46, 0.55); }
.project:hover::after { left: 130%; }
.kicker { font-size: 11px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); }
.project h2 { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.5px; color: #fff; margin: 4px 0 6px; }
.project p { color: var(--muted); font-size: 14px; }
.visit { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 600; font-size: 13px; color: var(--gold); }
.visit i { font-style: normal; transition: transform 0.3s; }
.project:hover .visit i { transform: translate(3px, -3px); }

.copy { margin-top: 24px; font-size: 12px; color: #5f5a4d; }

@media (max-width: 460px) { .card { padding: 0 20px 24px; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: 0.01s !important; }
}
