:root {
  --bg-main: #0b0f1d;
  --bg-alt: #141b31;
  --bg-deep: #070a14;
  --ink-main: #eef2ff;
  --ink-soft: #b7c4de;
  --accent-main: #4fd1c5;
  --accent-strong: #0f766e;
  --accent-mint: #f6c453;
  --accent-sky: #5eead4;
  --accent-rose: #fb7185;
  --card-bg: rgba(10, 16, 32, 0.82);
  --card-soft: #10182e;
  --line: rgba(148, 163, 184, 0.22);
  --shadow: 0 26px 60px rgba(5, 7, 18, 0.55);
  --shadow-strong: 0 45px 110px rgba(3, 5, 12, 0.8);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --profile-image: url("perfil.jpg");
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Noto Sans", sans-serif;
  color: var(--ink-main);
  background:
    radial-gradient(circle at 12% 12%, rgba(79, 209, 197, 0.16), transparent 46%),
    radial-gradient(circle at 88% 10%, rgba(246, 196, 83, 0.16), transparent 42%),
    radial-gradient(circle at 78% 82%, rgba(251, 113, 133, 0.12), transparent 48%),
    linear-gradient(165deg, var(--bg-main) 0%, var(--bg-alt) 55%, var(--bg-deep) 100%);
  min-height: 100vh;
  line-height: 1.6;
  position: relative;
  z-index: 0;
  isolation: isolate;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  width: 520px;
  height: 520px;
  top: -220px;
  left: -180px;
  background: radial-gradient(circle, rgba(79, 209, 197, 0.3), transparent 70%);
  filter: blur(8px);
  opacity: 0.8;
  z-index: -1;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.3;
  z-index: -2;
  pointer-events: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
  padding: 2rem 2.5rem 3rem;
  max-width: 1520px;
  margin: 0 auto;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.4rem;
  background: rgba(10, 16, 32, 0.76);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.5rem;
  backdrop-filter: blur(12px);
  position: sticky;
  top: 1.5rem;
  z-index: 8;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 700;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.05rem;
  color: #d7e2ff;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.45);
}

.brand-meta {
  display: grid;
  gap: 0.1rem;
}

.brand-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.96rem;
}

.brand-subtitle {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.top-nav a {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #d2def4;
  border: 1px solid transparent;
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.top-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.top-nav .active {
  background: linear-gradient(120deg, rgba(79, 209, 197, 0.25), rgba(246, 196, 83, 0.25));
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.4);
}

.top-actions {
  display: flex;
  gap: 0.6rem;
}

.card {
  background:
    radial-gradient(circle at 0% 0%, rgba(79, 209, 197, 0.12), transparent 45%),
    radial-gradient(circle at 100% 0%, rgba(246, 196, 83, 0.12), transparent 50%),
    var(--card-bg);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  padding: 1.6rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  position: relative;
  transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

@media (hover: hover) {
  .card:hover,
  .card.about:hover,
  .card.experience:hover,
  .cta.card:hover,
  .hero.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 30px 70px rgba(10, 14, 30, 0.16);
  }
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  line-height: 1;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  border: 1px solid transparent;
  font-size: 0.9rem;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button-solid {
  background: linear-gradient(120deg, var(--accent-main), var(--accent-mint), var(--accent-rose));
  background-size: 180% 180%;
  color: #f8fafc;
  box-shadow: 0 16px 30px rgba(79, 209, 197, 0.24);
}

.button-solid:hover {
  transform: translateY(-2px);
  background-position: 100% 0;
}

.button-ghost {
  background: rgba(12, 18, 35, 0.62);
  border-color: rgba(148, 163, 184, 0.24);
  color: #e2e8f0;
  box-shadow: 0 14px 26px rgba(4, 6, 16, 0.35);
}

.button-ghost:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px rgba(4, 6, 16, 0.4);
}

.section-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  padding: 0.01rem ;

}

.project-grid .project-card.hidden {
  display: none;
}

.button:active {
  transform: translateY(0);
}

.eyebrow {
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-sky);
}

.meta {
  margin: 0.3rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
  overflow: hidden;
  
}

.hero-copy h1 {
  margin: 0.2rem 0 0.5rem;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(2.6rem, 5vw, 3.6rem);
  line-height: 1.05;
}

.hero-copy h1 span {
  background: linear-gradient(120deg, var(--accent-main), var(--accent-mint));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.role {
  margin: 0 0 1rem;
  font-weight: 600;
  color: #d6e2fb;
}

.intro {
  margin: 0;
  color: var(--ink-soft);
  max-width: 80ch;
}

.hero-actions {
  margin-top: 1.3rem;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.hero-social {
  margin-top: 1.4rem;
  display: grid;
  gap: 0.6rem;
}

.social-links {
  display: flex;
  gap: 0.6rem;
}

.social-links a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  line-height: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.social-links a svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.social-links a:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.45);
}

.hero-visual {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
}

.ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(34, 211, 238, 0.2);
  box-shadow: 0 0 40px rgba(34, 211, 238, 0.15);
  animation: pulse 6s ease-in-out infinite;
}

.ring-1 {
  width: 280px;
  height: 280px;
  border-color: rgba(34, 211, 238, 0.25);
}

.ring-2 {
  width: 340px;
  height: 340px;
  border-color: rgba(56, 189, 248, 0.2);
  animation-delay: 1s;
}

.ring-3 {
  width: 420px;
  height: 420px;
  border-color: rgba(249, 115, 22, 0.16);
  animation-delay: 2s;
}

.portrait {
  width: clamp(220px, 30vw, 320px);
  height: clamp(280px, 38vw, 380px);
  border-radius: 160px 160px 210px 210px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.45), rgba(2, 6, 23, 0.85)),
    var(--profile-image) center/cover no-repeat,
    #0b132a;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-strong);
  position: relative;
  z-index: 2;
}

.portrait::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 10px rgba(79, 209, 197, 0.14);
  opacity: 0.9;
}

/* Imagen de perfil dentro de .portrait */
.portrait img,
.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  display: block;
}

.float-badge {
  position: absolute;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 14px 26px rgba(4, 6, 16, 0.35);
  animation: float 6s ease-in-out infinite;
  z-index: 3;
}

.badge-code {
  top: 18%;
  right: 12%;
}

.badge-ui {
  bottom: 22%;
  left: 10%;
  animation-delay: 1.2s;
}

.badge-api {
  top: 55%;
  right: 2%;
  animation-delay: 2s;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.info-card h3 {
  margin: 0.35rem 0 0;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.05rem;
}

.about {
  padding: 2rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
}

.about-text h2 {
  margin: 0 0 0.6rem;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.8rem;
}

/* Limit skills grid to 8 items when collapsed */
.skills-grid.collapsed > article:nth-child(n+9) {
  display: none;
}

.about-text p {
  margin: 0;
  color: var(--ink-soft);
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 1.2rem;
}

.about-tags span {
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.8rem;
}

.about-cards {
  display: grid;
  gap: 0.9rem;
}

.mini-card {
  padding: 1rem 1.2rem;
  border-radius: var(--radius-lg);
  background: rgba(12, 18, 35, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.mini-card h3 {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  color: #f8fafc;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
}

.section-head h2 {
  margin: 0.2rem 0 0;
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: 1.6rem;
}

.timeline {
  display: grid;
  gap: 1.1rem;
}

.timeline.collapsed > article:nth-child(n+4) {
  display: none;
}

.timeline-item {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 0.75rem;
  align-items: flex-start;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--accent-main), var(--accent-mint));
  margin-top: 0.35rem;
  box-shadow: 0 0 0 6px rgba(246, 196, 83, 0.16);
}

.timeline-item h4 {
  margin: 0;
}

.timeline-item p {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.skill-card {
  display: grid;
  gap: 1rem;
}

.skill-top {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.skill-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(79, 209, 197, 0.15);
  border: 1px solid rgba(79, 209, 197, 0.3);
  color: #e2e8f0;
  font-weight: 700;
}

.skill-card h3 {
  margin: 0;
}

.skill-card p {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.skill-meter {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.skill-meter span {
  display: block;
  height: 100%;
  width: var(--level, 0%);
  background: linear-gradient(90deg, var(--accent-main), var(--accent-mint));
  box-shadow: 0 0 12px rgba(79, 209, 197, 0.35);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.project-card {
  display: grid;
  gap: 0.7rem;
}

.project-thumb {
  height: 156px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.18);
  position: relative;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.project-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 10, 20, 0.08), rgba(7, 10, 20, 0.26));
  pointer-events: none;
}

.project-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.01);
  transition: transform 260ms ease, filter 260ms ease;
}

@media (hover: hover) {
  .project-card:hover .project-thumb img {
    transform: scale(1.05);
    filter: saturate(1.08) contrast(1.02);
  }
}


.project-card h3 {
  margin: 0;
}

.project-card p {
  margin: 0;
  color: var(--ink-soft);
}

.project-link {
  font-weight: 600;
  color: var(--accent-sky);
  font-size: 0.85rem;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(12, 18, 35, 0.62);
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.chip-row.small span {
  font-size: 0.75rem;
}

.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background:
    radial-gradient(circle at 0% 0%, rgba(79, 209, 197, 0.2), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(246, 196, 83, 0.18), transparent 55%),
    var(--card-bg);
}

.cta h2 {
  margin: 0 0 0.4rem;
  font-family: "Fraunces", "Times New Roman", serif;
}

.cta p {
  margin: 0;
  color: var(--ink-soft);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.contact-card h2 {
  margin: 0.2rem 0 0.6rem;
  font-family: "Fraunces", "Times New Roman", serif;
}

.contact-card p {
  margin: 0;
  color: var(--ink-soft);
}

.contact-list {
  display: grid;
  gap: 0.8rem;
  margin: 1.2rem 0 0;
}

.contact-list p {
  margin: 0.2rem 0 0;
  color: var(--ink-soft);
}

.contact-actions {
  margin-top: 1.4rem;
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.footer {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr;
  gap: 2rem;
  padding: 2rem 0 0;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.footer-brand p {
  margin: 1rem 0 0;
  color: var(--ink-soft);
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.footer-social {
  text-align: center;
  justify-self: center;
}

.footer-social .social-links {
  justify-content: center;
}

.footer-links h4 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
}

.footer-links > div:not(.footer-social) a {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.footer-copy {
  grid-column: 1 / -1;
  margin: 1.5rem 0 0;
  color: #8fa4d5;
  font-size: 0.8rem;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 680ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 680ms cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: var(--delay, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

body:not(.is-ready) .hero {
  opacity: 0;
  transform: translateY(18px) scale(0.99);
}

body.is-ready .hero {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 520ms ease, transform 520ms ease;
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(0.98);
    opacity: 0.7;
  }
  50% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.98);
    opacity: 0.7;
  }
}

@media (max-width: 1080px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .top-nav {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .page {
    padding: 1.2rem;
  }

  .top-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .info-grid,
  .skills-grid,
  .project-grid {
    grid-template-columns: 1fr;
  }

  .cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    grid-template-columns: 1fr;
  }
}
