/* =============================================================
   THEME TOKENS  —  cambia estos colores para reestilizar todo
   ============================================================= */
:root {
  --bg:        #1b2027;
  --bg-soft:   #232a33;
  --card:      #272f3a;
  --card-hover:#303a46;
  --border:    rgba(255,255,255,.09);
  --text:      #eceef3;
  --muted:     #9aa6b4;
  --accent:    #3b82f6;
  --accent-2:  #38bdf8;
  --gradient:  linear-gradient(120deg, #2563eb 0%, #3b82f6 45%, #38bdf8 100%);
  --shadow:    0 20px 60px -20px rgba(37,99,235,.45);
  --radius:    18px;
  --maxw:      1100px;
}

/* ===================== RESET ===================== */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
h1,h2,h3,.nav__brand { font-family: "Sora", sans-serif; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: #fff; }

/* ===================== ANIMATED BACKGROUND ===================== */
.bg-glow {
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(40% 35% at 15% 10%,  rgba(37,99,235,.28),  transparent 70%),
    radial-gradient(35% 40% at 85% 20%,  rgba(56,189,248,.18), transparent 70%),
    radial-gradient(45% 45% at 60% 95%,  rgba(59,130,246,.18), transparent 70%);
  filter: blur(20px);
  animation: drift 18s ease-in-out infinite alternate;
}
@keyframes drift {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(-3%, 2%) scale(1.08); }
}

/* ===================== HELPERS ===================== */
.container { width: min(var(--maxw), 90%); margin-inline: auto; }
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ===================== NAVBAR ===================== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 60px);
  transition: background .3s, padding .3s, box-shadow .3s;
}
.nav.scrolled {
  background: rgba(10,10,20,.75);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--border);
  padding-block: 12px;
}
.nav__brand {
  font-weight: 800; font-size: 1.5rem; letter-spacing: -1px;
}
.nav__brand span { color: var(--accent-2); }
.nav__links { display: flex; gap: 30px; }
.nav__links a {
  color: var(--muted); font-weight: 500; font-size: .95rem;
  position: relative; transition: color .2s;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 2px; background: var(--gradient); transition: width .25s;
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }

.nav__actions { display: flex; align-items: center; gap: 14px; }

/* Language toggle */
.lang-toggle {
  display: flex; align-items: center; gap: 2px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px; cursor: pointer;
}
.lang-toggle__opt {
  font-size: .78rem; font-weight: 700; color: var(--muted);
  padding: 4px 10px; border-radius: 999px; transition: all .25s;
}
.lang-toggle__opt.active { background: var(--gradient); color: #fff; }

/* Burger */
.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; }
.nav__burger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }
.nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===================== HERO ===================== */
.hero {
  min-height: 100vh; display: flex; flex-direction: column;
  justify-content: center; padding-top: 110px; position: relative;
}
.hero__inner {
  flex: 1; width: min(var(--maxw), 90%); margin-inline: auto;
  display: grid; grid-template-columns: 0.85fr 1.45fr; align-items: center;
  gap: clamp(28px, 5vw, 70px); padding-block: 40px;
}

/* Left: photo frame */
.hero__frame { position: relative; width: 100%; max-width: 400px; aspect-ratio: 1 / 1; margin-inline: auto; cursor: pointer; outline: none; }

/* "i" hint indicator (hides when the fact is shown) */
.hero__hint {
  position: absolute; top: 11px; right: 11px; z-index: 3;
  width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center;
  font-family: "Sora"; font-weight: 700; font-size: .9rem; font-style: italic; color: #fff;
  background: rgba(15,20,28,.55); border: 1px solid rgba(255,255,255,.3);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: opacity .25s, transform .25s;
}
.hero__frame:hover .hero__hint, .hero__frame.is-open .hero__hint { opacity: 0; transform: scale(.8); }

/* Fact tooltip overlay (shown on hover / focus / tap) */
.hero__fact {
  position: absolute; inset: 0; z-index: 2; border-radius: 12px;
  display: grid; align-content: center; padding: 26px;
  background: linear-gradient(160deg, rgba(37,99,235,.62) 0%, rgba(15,20,28,.92) 78%);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  color: #fff; font-size: 1rem; line-height: 1.55; text-align: center;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.hero__frame:hover .hero__fact,
.hero__frame:focus-visible .hero__fact,
.hero__frame.is-open .hero__fact { opacity: 1; transform: none; }
.hero__photo {
  position: absolute; inset: 0; border: 1.5px solid var(--accent); border-radius: 12px;
  overflow: hidden; background: var(--bg-soft) center / cover no-repeat;
}
/* Gradient overlay so the photo blends into the dark/blue style */
.hero__photo::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background:
    linear-gradient(155deg, rgba(37,99,235,.30) 0%, rgba(56,189,248,.10) 30%, transparent 52%),
    linear-gradient(0deg, rgba(15,20,28,.78) 0%, rgba(15,20,28,.15) 38%, transparent 62%);
}
.hero__code {
  position: absolute; right: -8px; bottom: -26px; line-height: 1;
  font-family: "Sora"; font-weight: 800; font-size: clamp(2rem, 4vw, 2.8rem);
  color: var(--accent); background: var(--bg); padding: 4px 12px;
}

/* Right: content (centered horizontally) */
.hero__content { text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero__name { font-size: clamp(1.85rem, 3.7vw, 3rem); font-weight: 800; line-height: 1.1; letter-spacing: -1.5px; white-space: nowrap; }
.hero__highlight {
  background: var(--gradient); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero__dot { color: var(--accent); -webkit-text-fill-color: var(--accent); }
.hero__role {
  font-size: clamp(1.05rem, 2.15vw, 1.6rem); font-weight: 800; margin-top: 8px; white-space: nowrap;
  background: linear-gradient(90deg, #7b8696, #aeb8c6);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero__tagline { color: var(--muted); max-width: 480px; margin-top: 16px; margin-inline: auto; font-size: 1.05rem; }
.hero__tech { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; justify-content: center; }
.tech-badge {
  --bc: var(--accent); /* brand color, set inline per badge */
  position: relative;
  width: 48px; height: 48px; display: grid; place-items: center; border-radius: 11px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--bc) 22%, var(--card)) 0%, var(--card) 72%);
  border: 1px solid color-mix(in srgb, var(--bc) 32%, var(--border));
  color: var(--bc);
  transition: transform .25s, border-color .25s, box-shadow .25s; cursor: default; outline: none;
}
.tech-badge svg { width: 24px; height: 24px; }
.tech-badge:hover, .tech-badge:focus-visible {
  border-color: var(--bc); transform: translateY(-3px);
  box-shadow: 0 12px 28px -10px color-mix(in srgb, var(--bc) 65%, transparent);
}

/* Subtle tooltip */
.tech-badge::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 12px); left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--border); border-radius: 9px;
  padding: 7px 12px; font-family: "Inter", sans-serif; font-size: .8rem; font-weight: 500;
  white-space: nowrap; letter-spacing: .2px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  opacity: 0; pointer-events: none; transition: opacity .22s ease, transform .22s ease; z-index: 6;
}
.tech-badge::before {
  content: ""; position: absolute; bottom: calc(100% + 7px); left: 50%;
  transform: translateX(-50%) translateY(6px) rotate(45deg);
  width: 10px; height: 10px; background: var(--bg-soft);
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  opacity: 0; pointer-events: none; transition: opacity .22s ease, transform .22s ease; z-index: 6;
}
.tech-badge:hover::after, .tech-badge:focus-visible::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.tech-badge:hover::before, .tech-badge:focus-visible::before { opacity: 1; transform: translateX(-50%) translateY(0) rotate(45deg); }
.hero__cta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 30px; justify-content: center; }
.hero__socials { display: flex; gap: 14px; margin-top: 26px; justify-content: center; }

/* Bottom marquee */
.hero__marquee {
  width: 100%; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  overflow: hidden; padding: 16px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
.hero__marquee-track { display: inline-flex; align-items: center; white-space: nowrap; will-change: transform; animation: marquee 30s linear infinite; }
.hero__marquee:hover .hero__marquee-track { animation-play-state: paused; }
.hero__marquee-item { font-family: "Sora"; font-weight: 700; font-size: 1rem; letter-spacing: 2px; color: var(--muted); padding: 0 14px; }
.hero__marquee-sep { color: var(--accent); font-weight: 700; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: .95rem; padding: 13px 26px;
  border-radius: 999px; cursor: pointer; border: 1px solid transparent;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s;
}
.btn--primary { background: var(--gradient); color: #fff; box-shadow: var(--shadow); }
.btn--primary:hover { transform: translateY(-3px); box-shadow: 0 26px 70px -18px rgba(37,99,235,.6); }
.btn--ghost { color: var(--text); border-color: var(--border); background: rgba(255,255,255,.02); }
.btn--ghost:hover { border-color: var(--accent); transform: translateY(-3px); }
.btn--lg { padding: 16px 34px; font-size: 1.05rem; }

/* Social icon buttons */
.social-icon {
  width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 50%; background: var(--card); border: 1px solid var(--border);
  color: var(--muted); transition: all .25s;
}
.social-icon:hover { color: #fff; border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow); }
.social-icon svg { width: 20px; height: 20px; }

/* ===================== SECTIONS ===================== */
.section { padding: clamp(70px, 12vw, 130px) 0; }
.section__kicker {
  display: inline-block; font-family: "Sora"; font-weight: 700;
  color: var(--accent); letter-spacing: 3px; font-size: .85rem; margin-bottom: 10px;
}
.section__title { font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 800; letter-spacing: -1px; }
.section__sub { color: var(--muted); margin-top: 8px; font-size: 1.05rem; }

/* ===================== ABOUT ===================== */
.about__card {
  margin-top: 36px; display: flex; gap: 28px; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px; flex-wrap: wrap;
  position: relative; overflow: hidden;
}
.about__card::before {
  content: ""; position: absolute; inset: 0; padding: 1px; border-radius: var(--radius);
  background: var(--gradient); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; opacity: .4; pointer-events: none;
}
.about__avatar {
  flex-shrink: 0; width: 96px; height: 96px; border-radius: 50%;
  background: var(--gradient); display: grid; place-items: center;
  font-family: "Sora"; font-weight: 800; font-size: 2rem; color: #fff;
  background-size: cover; background-position: center;
}
.about__fact { font-size: 1.2rem; flex: 1; min-width: 240px; }

/* ===================== SKILLS ===================== */
.skills__grid {
  margin-top: 40px; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.skill {
  --bc: var(--accent); /* brand color, set inline per skill */
  display: flex; align-items: center; gap: 15px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 15px 18px;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.skill:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--bc) 50%, var(--border));
  box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--bc) 55%, transparent);
}
.skill__icon {
  flex-shrink: 0; width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 11px; color: var(--bc);
  background: linear-gradient(150deg, color-mix(in srgb, var(--bc) 24%, var(--card)) 0%, var(--card) 75%);
  border: 1px solid color-mix(in srgb, var(--bc) 28%, var(--border));
}
.skill__icon svg { width: 24px; height: 24px; }
.skill__name { font-weight: 600; font-size: 1rem; line-height: 1.25; }

/* ===================== WORK ===================== */
.work__filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 34px 0 30px; }
.filter-btn {
  background: var(--card); border: 1px solid var(--border); color: var(--muted);
  padding: 8px 18px; border-radius: 999px; cursor: pointer; font-weight: 600;
  font-size: .9rem; transition: all .25s;
}
.filter-btn:hover { color: var(--text); border-color: var(--accent); }
.filter-btn.active { background: var(--gradient); color: #fff; border-color: transparent; }

.work__grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); }
.project {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .3s, border-color .3s, background .3s, box-shadow .3s;
  display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.project:hover { transform: translateY(-6px); background: var(--card-hover); border-color: var(--accent); box-shadow: var(--shadow); }

/* --- Media / image area --- */
.project__media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--bg-soft);
}
.project__media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .5s ease;
}
.project:hover .project__media img { transform: scale(1.06); }
/* Placeholder shown when a project has no image yet */
.project__media--placeholder {
  display: grid; place-items: center;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(37,99,235,.45), transparent 60%),
    radial-gradient(120% 120% at 100% 100%, rgba(56,189,248,.32), transparent 60%),
    var(--bg-soft);
}
.project__media--placeholder span {
  font-family: "Sora"; font-weight: 800; font-size: 2.6rem; color: #fff; opacity: .85;
  text-shadow: 0 2px 20px rgba(0,0,0,.3);
}
.project__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(27,32,39,.85), transparent 55%);
}

/* --- Body --- */
.project__body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.project__cat { font-size: .75rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--accent-2); }
.project__title { font-size: 1.45rem; font-weight: 700; margin: 8px 0 10px; }
.project__desc { color: var(--muted); font-size: .98rem; flex: 1; }
.project__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.project__tag { font-size: .75rem; padding: 4px 11px; border-radius: 999px; background: rgba(59,130,246,.12); color: #aacbff; border: 1px solid rgba(59,130,246,.25); }
.project__link {
  margin-top: 18px; align-self: flex-start; font-weight: 600; font-size: .9rem;
  color: var(--accent-2); display: inline-flex; align-items: center; gap: 6px;
}
.project__link:hover { gap: 10px; }

/* ===================== CONTACT ===================== */
.contact { text-align: center; }
.contact .section__kicker, .about .section__kicker, .skills .section__kicker, .work .section__kicker { }
.contact .btn { margin-top: 28px; }
.contact__socials { display: flex; gap: 14px; justify-content: center; margin-top: 34px; }

/* ===================== FOOTER ===================== */
.footer { text-align: center; padding: 40px 20px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--border); }

/* ===================== REVEAL ANIMATION ===================== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s ease, transform .7s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ===================== RESPONSIVE: HERO ===================== */
@media (max-width: 860px) {
  .hero { padding-top: 96px; }
  .hero__inner {
    grid-template-columns: 1fr; gap: 38px; text-align: center; padding-block: 30px;
  }
  .hero__frame { order: -1; max-width: 240px; }
  .hero__content { text-align: center; }
  /* On narrow screens the text can't fit one line — allow it to wrap */
  .hero__name, .hero__role { white-space: normal; }
  .hero__name { font-size: clamp(2rem, 8vw, 2.8rem); }
  .hero__role { font-size: clamp(1.15rem, 4.6vw, 1.6rem); }
  .hero__tagline { margin-inline: auto; }
  .hero__tech, .hero__cta, .hero__socials { justify-content: center; }
}
@media (max-width: 420px) {
  .hero__frame { max-width: 190px; }
  .hero__cta { flex-direction: column; align-items: center; }
  .hero__cta .btn { width: 100%; max-width: 280px; justify-content: center; }
}

/* ===================== MOBILE ===================== */
@media (max-width: 760px) {
  .nav__links {
    position: fixed; inset: 0 0 0 auto; width: min(72vw, 300px);
    flex-direction: column; justify-content: center; gap: 28px; padding: 40px;
    background: var(--bg-soft); border-left: 1px solid var(--border);
    transform: translateX(100%); transition: transform .35s ease; box-shadow: -20px 0 60px rgba(0,0,0,.4);
  }
  .nav__links.open { transform: translateX(0); }
  .nav__links a { font-size: 1.2rem; }
  .nav__burger { display: flex; }
  .about__card { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
