:root {
  --bg: #000;
  --blue: #0462fd;
  --blue-soft: #3b82ff;
  --ink: #f3f4f6;
  --muted: #6b7180;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ---------- cielo ---------- */
#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.nebula {
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 35% at 38% 52%, rgba(4, 98, 253, .16), transparent 70%),
    radial-gradient(30% 28% at 66% 44%, rgba(90, 60, 220, .08), transparent 70%);
  opacity: 0;
  transition: opacity 4s ease;
  animation: drift 60s linear infinite alternate;
}
.is-ready .nebula { opacity: 1; }

@keyframes drift {
  from { transform: rotate(0deg) scale(1); }
  to   { transform: rotate(8deg) scale(1.08); }
}

/* ---------- destello ---------- */
.flare {
  position: fixed;
  left: 0; top: 0;
  width: 0; height: 0;
  z-index: 2;
  pointer-events: none;
}
.flare span {
  position: absolute;
  left: 0; top: 0;
  opacity: 0;
  mix-blend-mode: screen;
}
.flare-core {
  width: 360px; height: 360px;
  margin: -180px 0 0 -180px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(160, 196, 255, .9) 6%, rgba(4, 98, 253, .45) 22%, transparent 62%);
  transform: scale(0);
}
.flare-streak {
  width: 900px; height: 2px;
  margin: -1px 0 0 -450px;
  background: linear-gradient(90deg, transparent, rgba(120, 170, 255, .9) 45%, #fff 50%, rgba(120, 170, 255, .9) 55%, transparent);
  transform: scaleX(0);
}
.flare.go .flare-core   { animation: core 1.5s var(--ease-out) forwards; }
.flare.go .flare-streak { animation: streak 1.4s var(--ease-out) forwards; }

@keyframes core {
  0%   { opacity: 0; transform: scale(0); }
  18%  { opacity: 1; transform: scale(.55); }
  100% { opacity: 0; transform: scale(1.25); }
}
@keyframes streak {
  0%   { opacity: 0; transform: scaleX(0); }
  20%  { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(.4); }
}

/* ---------- logo ---------- */
main {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 16px 12vh;
}

/* slogan + cierre */
.slogan {
  margin: clamp(30px, 4.2vw, 56px) 0 0;
  font-size: clamp(19px, 2.3vw, 32px);
  font-weight: 300;
  letter-spacing: .01em;
  line-height: 1.25;
  color: var(--ink);
}
.slogan span {
  display: inline-block;
  opacity: 0;
  filter: blur(8px);
  transform: translateY(.35em);
}
.show-copy .slogan span {
  opacity: 1;
  filter: none;
  transform: none;
  transition: opacity 1s ease, filter 1.1s ease, transform 1.2s var(--ease-out);
}
.show-copy .slogan span:nth-child(2) { transition-delay: .14s; }
.show-copy .slogan span:nth-child(3) { transition-delay: .28s; }
.show-copy .slogan span:nth-child(4) { transition-delay: .42s; }
.show-copy .slogan span:nth-child(5) { transition-delay: .56s; }

.claim {
  margin: clamp(14px, 1.6vw, 20px) 0 0;
  max-width: 34em;
  font-size: clamp(13px, 1.05vw, 15px);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: .02em;
  color: #8d93a0;
  opacity: 0;
  transform: translateY(6px);
}
.show-copy .claim {
  opacity: 1;
  transform: none;
  transition: opacity 1.6s ease 1.3s, transform 1.6s var(--ease-out) 1.3s;
}

.logo {
  margin: 0;
  width: clamp(260px, 62vw, 780px);
  line-height: 0;
}
.logo svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* numeral */
.hash {
  fill: var(--blue);
  fill-opacity: 0;
  stroke: var(--blue-soft);
  stroke-width: 2.6;
  stroke-linejoin: round;
  stroke-opacity: 0;
}
.hash.draw {
  stroke-opacity: 1;
  stroke-dashoffset: 0 !important;
  transition: stroke-dashoffset 1.5s cubic-bezier(.65, 0, .35, 1);
}
.hash.fill {
  fill-opacity: 1;
  stroke-opacity: 0;
  transition: fill-opacity 1s ease, stroke-opacity 1.4s ease;
}

.hash-glow {
  fill: var(--blue);
  opacity: 0;
}
.hash-glow.on {
  animation: breathe 6s ease-in-out 1s infinite;
  opacity: .35;
  transition: opacity 1.2s ease;
}
@keyframes breathe {
  0%, 100% { opacity: .35; }
  50%      { opacity: .6; }
}

/* letras */
.letter {
  fill: var(--ink);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 60%;
  transform: scale(.94);
}
.letter.on {
  opacity: 1;
  transform: none;
  transition: opacity .9s ease, transform 1.2s var(--ease-out);
}

/* puntos de la i / j: estrellas que caen */
.dot {
  fill: var(--ink);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.dot.on { animation: land 1.1s var(--ease-out) forwards; }

@keyframes land {
  0%   { opacity: 0; transform: translateY(-260px) scale(.25); fill: #9cc0ff; }
  35%  { opacity: 1; }
  70%  { transform: translateY(6px) scale(1.06); fill: #fff; }
  100% { opacity: 1; transform: none; fill: var(--ink); }
}

.dot.landed { opacity: 1; animation: none; transform: none; }

/* ---------- las "i" como botón de información ---------- */
.info { cursor: pointer; outline: none; }
.info .hit { fill: transparent; pointer-events: all; }
.info .dot.landed {
  transition: fill .35s ease, transform .6s var(--ease-out);
}
.info:hover .dot.landed,
.info:focus-visible .dot.landed {
  fill: var(--blue);
  transform: scale(1.2);
}

.ring {
  fill: none;
  stroke: var(--blue-soft);
  stroke-width: 2;
  opacity: 0;
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
}
.is-ready .ring        { animation: ping 4.8s ease-out 1s infinite; }
.is-ready .ring-2      { animation-delay: 1.5s; }
.is-ready .info:last-of-type .ring   { animation-delay: 3.4s; }
.is-ready .info:last-of-type .ring-2 { animation-delay: 3.9s; }
.info:hover .ring, .info:focus-visible .ring { stroke: #7fb0ff; }

@keyframes ping {
  0%   { opacity: 0;  transform: scale(1); }
  8%   { opacity: .7; }
  45%  { opacity: 0;  transform: scale(2.7); }
  100% { opacity: 0;  transform: scale(2.7); }
}

.tip {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 21px;
  letter-spacing: .18em;
  text-anchor: middle;
  fill: #9fbcff;
  opacity: 0;
  pointer-events: none;
  transform-box: fill-box;
  transform: translateY(10px);
  transition: opacity .4s ease, transform .5s var(--ease-out);
}
.info:hover .tip,
.info:focus-visible .tip,
.hint .info:first-of-type .tip {
  opacity: 1;
  transform: none;
}

/* ---------- panel "acerca de mí" ---------- */
.about {
  position: fixed;
  inset: 0;
  z-index: 10;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  clip-path: circle(0px at var(--ox, 50%) var(--oy, 50%));
  transition: clip-path .9s cubic-bezier(.7, 0, .2, 1);
}
.about[hidden] { display: none; }
.about.open { clip-path: circle(150vmax at var(--ox, 50%) var(--oy, 50%)); }
.about::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(4, 98, 253, .10), transparent 70%),
    rgba(1, 3, 9, .9);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.about-close {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: 18px;
  z-index: 2;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  color: var(--ink);
  cursor: pointer;
  opacity: 0;
  transition: opacity .5s ease, transform .5s var(--ease-out), border-color .3s ease;
}
.about.open .about-close { opacity: 1; transition-delay: .5s, 0s, 0s; }
.about-close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; }
.about-close:hover, .about-close:focus-visible { transform: rotate(90deg); border-color: var(--blue); outline: none; }

.about-body {
  position: relative;
  max-width: 36em;
  margin: 0 auto;
  padding: clamp(84px, 15vh, 150px) 24px 16vh;
  font-size: clamp(16px, 1.15vw, 18px);
  line-height: 1.8;
  color: #b4b9c4;
  text-align: left;
}
.about-body > p {
  margin: 0 0 1.45em;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 1s ease, transform 1.2s var(--ease-out);
}
.about-body > p.seen { opacity: 1; transform: none; }

.about-eyebrow {
  display: flex;
  align-items: center;
  gap: .9em;
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2.6em !important;
}
.i-mark {
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--blue);
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: 0 0 18px rgba(4, 98, 253, .45);
}

.about-body .lead {
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 300;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 1.6em;
}
.about-body em { font-style: normal; color: var(--ink); }
.about-body .mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .86em;
  color: var(--blue-soft);
  white-space: nowrap;
}
.about-body .y { color: var(--blue-soft); font-variant-numeric: tabular-nums; }

.about-body .outro {
  margin-top: 2.4em;
  font-size: clamp(24px, 2.6vw, 36px);
  font-weight: 300;
  line-height: 1.3;
  color: var(--ink);
}
.outro strong { font-weight: 600; white-space: nowrap; }
.outro b { color: var(--blue); font-weight: 700; }

.about-mail { margin-top: 3em !important; }
.about-mail a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: .14em;
  border-bottom: 1px solid rgba(4, 98, 253, .6);
  padding-bottom: 3px;
  transition: color .3s ease;
}
.about-mail a:hover, .about-mail a:focus-visible { color: var(--ink); outline: none; }

/* lo de detrás se apaga un poco */
main, footer { transition: opacity .8s ease; }
.about-open main { opacity: .25; }

/* ---------- pie ---------- */
footer {
  position: fixed;
  left: 0; right: 0;
  bottom: max(28px, env(safe-area-inset-bottom));
  z-index: 3;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.6s ease, transform 1.6s var(--ease-out);
}
.is-ready footer { opacity: 1; transform: none; }

footer a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: .14em;
  padding: 8px 2px;
  transition: color .4s ease;
}
footer a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 1px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .5s var(--ease-out);
}
footer a:hover, footer a:focus-visible { color: var(--ink); outline: none; }
footer a:hover::after, footer a:focus-visible::after { transform: scaleX(1); transform-origin: left; }

/* ---------- sin movimiento ---------- */
.static .hash { fill-opacity: 1; stroke-opacity: 0; }
.static .hash-glow { opacity: .35; }
.static .letter, .static .dot { opacity: 1; transform: none; animation: none; }
.static .nebula { animation: none; }
.static .slogan span, .static .claim { opacity: 1; filter: none; transform: none; transition: none; }
.static .about, .static .about-body > p { transition: none; }

@media (max-width: 600px) {
  .tip { font-size: 40px; letter-spacing: .1em; }
}

@media (max-width: 600px) {
  .logo { width: 84vw; }
  footer a { font-size: 12px; letter-spacing: .1em; }
}
