:root {
  --bg: #10151f;
  --bg-2: #171d2b;
  --card: #1a2130;
  --card-2: #202838;
  --card-soft: #262f42;
  --text: #eef2f8;
  --muted: #9aa6b8;
  --muted-soft: #c4cddb;
  --accent: #f4a01f;
  --accent-ink: #10151f;
  --accent-2: #4fb286;
  --border: #2b3346;
  --border-strong: #3a445a;
  --radius: 24px;
  --radius-sm: 16px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  --font-display: "Sora", "Inter", Arial, sans-serif;
  --font-body: "Inter", Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 16px;
  border-radius: 0 0 12px 0;
  z-index: 200;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

.container {
  width: min(1180px, 92%);
  margin: 0 auto;
  padding-bottom: 40px;
}

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  background: rgba(16, 21, 31, 0.7);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}
.site-header.scrolled {
  border-color: var(--border);
  background: rgba(16, 21, 31, 0.95);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 0.85rem;
  background: var(--accent);
  color: var(--accent-ink);
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}
.nav a {
  position: relative;
  transition: color 0.2s ease;
}
.nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.nav a:not(.nav-cta):hover {
  color: var(--text);
}
.nav a:not(.nav-cta):hover::after {
  width: 100%;
}
.nav-cta {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text);
  transition: background 0.2s ease, border-color 0.2s ease;
}
.nav-cta:hover {
  background: var(--card-2);
  border-color: var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  margin-bottom: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.mobile-nav.open {
  display: flex;
  animation: fadeDown 0.25s ease;
}
.mobile-nav a {
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--muted-soft);
  font-weight: 500;
}
.mobile-nav a:hover {
  background: var(--card-2);
  color: var(--text);
}

/* HERO */
.hero {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 22px;
  align-items: stretch;
  margin-top: 12px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
}

.hero-main {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 15px;
  border-radius: 999px;
  background: var(--card-2);
  color: var(--accent-2);
  border: 1px solid var(--border-strong);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 26px;
}
.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(79, 178, 134, 0.6);
  animation: pulse 2s infinite;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 5.2vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  margin-bottom: 22px;
  max-width: 15ch;
}

.hero-lead {
  color: var(--muted-soft);
  font-size: 1.08rem;
  max-width: 60ch;
}
.hero-lead strong {
  color: var(--text);
}

.hero-stack {
  margin-top: 16px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  transform: translateY(-2px);
  background: #ffb43a;
}
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--accent);
  background: var(--card-2);
  transform: translateY(-2px);
}
.btn-link {
  color: var(--muted-soft);
  padding: 13px 8px;
}
.btn-link:hover {
  color: var(--text);
}

.profile-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}
.metric {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.metric:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
}
.metric-accent {
  background: var(--accent);
  border-color: var(--accent);
}
.metric-accent .metric-label { color: rgba(16, 21, 31, 0.75); }
.metric-accent strong,
.metric-accent strong span { color: var(--accent-ink); }
.metric strong {
  font-family: var(--font-display);
  font-size: 2.1rem;
  line-height: 1;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
}
.metric strong span {
  color: var(--accent);
}
.metric-label {
  color: var(--muted);
  font-size: 0.92rem;
}

/* SECTION TITLES */
.section-title {
  margin: 84px 0 30px;
  max-width: 760px;
}
.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.section-title h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
}
.section-title p {
  color: var(--muted);
  margin-top: 14px;
  font-size: 1.02rem;
}

/* BENTO */
.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.box {
  min-height: 210px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.28s ease, border-color 0.28s ease, background 0.28s ease;
}
.box:hover {
  transform: translateY(-5px);
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(255, 255, 255, 0.06);
}
.box.large { grid-column: span 2; }
.box.tall { grid-row: span 2; min-height: 436px; }
.box.highlight {
  background: rgba(56, 189, 248, 0.12);
}
.box.accent {
  background: rgba(34, 197, 94, 0.12);
}
.box-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.box-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  font-size: 1rem;
  color: var(--accent);
  flex-shrink: 0;
}
.box h3 {
  font-family: var(--font-display);
  font-size: 1.22rem;
  letter-spacing: -0.02em;
}
.box p {
  color: var(--muted);
  font-size: 0.96rem;
  flex: 1;
}

.tag-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}
.tag {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  color: var(--muted-soft);
  font-size: 0.78rem;
  font-weight: 500;
}

/* PROJECTS */
.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.project-card {
  position: relative;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  transition: transform 0.28s ease, border-color 0.28s ease;
}
.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(56, 189, 248, 0.06);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: rgba(56, 189, 248, 0.4);
}
.project-card:hover::before {
  opacity: 1;
}
.project-index {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.project-card h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}
.project-card p {
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}
.project-card .tag-list { position: relative; }

/* DIFERENCIAL */
.differential {
  margin-top: 84px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 56px;
  position: relative;
  overflow: hidden;
}
.differential::before {
  content: "";
  position: absolute;
  bottom: -80px;
  left: -40px;
  width: 260px;
  height: 260px;
  background: rgba(34, 197, 94, 0.08);
  pointer-events: none;
}
.differential blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
  max-width: 24ch;
  position: relative;
}
.differential blockquote::before {
  content: "“";
  position: absolute;
  top: -0.4em;
  left: -0.5em;
  font-size: 3em;
  color: var(--accent);
  opacity: 0.3;
}
.differential-sub {
  color: var(--muted);
  margin-top: 24px;
  max-width: 68ch;
  font-size: 1.02rem;
}

/* CONTACTO */
.footer-cta {
  margin-top: 84px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid var(--border-strong);
  border-radius: 32px;
  padding: 52px;
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 40px;
  align-items: center;
}
.footer-cta-copy h2 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 14px;
}
.footer-cta-copy p {
  color: var(--muted-soft);
  max-width: 60ch;
}
.contact-list {
  list-style: none;
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}
.contact-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.contact-list span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.contact-list a {
  font-weight: 600;
  color: var(--text);
  transition: color 0.2s ease;
}
.contact-list a:hover {
  color: var(--accent);
}
.footer-cta-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.footer-cta-actions .btn {
  width: 100%;
}

/* FOOTER */
.site-footer {
  margin-top: 60px;
  padding: 36px 0 10px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.footer-year {
  color: rgba(148, 163, 184, 0.7);
}

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


@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* RESPONSIVE */
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .profile-side { flex-direction: row; }
  .metric { min-height: 130px; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .box.large { grid-column: span 2; }
  .box.tall { grid-row: span 1; min-height: 210px; }
  .projects { grid-template-columns: repeat(2, 1fr); }
  .footer-cta { grid-template-columns: 1fr; }
  .nav { display: none; }
  .nav-toggle { display: flex; }
}

@media (max-width: 620px) {
  .card { padding: 28px; }
  .profile-side { flex-direction: column; }
  .bento { grid-template-columns: 1fr; }
  .box.large { grid-column: span 1; }
  .projects { grid-template-columns: 1fr; }
  .differential { padding: 34px; }
  .footer-cta { padding: 32px; }
  .contact-list { grid-template-columns: 1fr; }
  .section-title { margin-top: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
