:root {
  --bg: #000;
  --surface: #111;
  --surface-2: #1a1a1a;
  --border: #262626;
  --text: #f5f5f5;
  --muted: #9a9a9a;
  --accent: #1a73ff;
  --accent-2: #4d94ff;
  --radius: 18px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- Navegación tipo píldora ---------- */
.nav {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 10; display: flex; align-items: center; gap: 4px;
  padding: 6px; border-radius: 999px;
  background: rgba(30, 30, 30, .7); border: 1px solid var(--border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  max-width: calc(100% - 32px);
}
.nav a { padding: 8px 14px; border-radius: 999px; font-size: 14px; color: var(--muted); white-space: nowrap; transition: color .2s, background .2s; }
.nav a:hover { color: var(--text); }
.nav .logo { color: var(--text); font-weight: 800; }
.nav .cta { background: var(--text); color: #000; font-weight: 600; }
.nav .cta:hover { background: #fff; color: #000; }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 40px;
  padding-top: 100px; padding-bottom: 60px;
}
.eyebrow { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.hero h1 { font-size: clamp(40px, 7vw, 84px); line-height: 1.02; font-weight: 800; letter-spacing: -.03em; }
.hero h1 .soft { color: var(--muted); }
.hero p { margin-top: 22px; font-size: clamp(16px, 1.6vw, 19px); color: var(--muted); max-width: 520px; }
.hero p strong { color: var(--text); font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 22px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: transform .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 30px rgba(26, 115, 255, .35); }
.btn-primary:hover { background: var(--accent-2); }
.btn-ghost { color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }

/* Carpeta 3D animada */
.folder-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.folder {
  position: relative; width: min(300px, 70vw); aspect-ratio: 4 / 3;
  animation: float 5s ease-in-out infinite; cursor: pointer;
}
.folder .back, .folder .front { position: absolute; inset: 0; border-radius: 16px; }
.folder .back { background: #0f5ad6; }
.folder .back::before {
  content: ""; position: absolute; top: -14px; left: 0; width: 40%; height: 30px;
  background: #0f5ad6; border-radius: 12px 12px 0 0;
}
.folder .paper {
  position: absolute; left: 8%; right: 8%; top: 8%; height: 70%;
  background: #fff; border-radius: 8px; transition: transform .4s ease;
}
.folder .paper.p2 { background: #dcdcdc; transform: rotate(-4deg); }
.folder .front {
  top: 22%; background: linear-gradient(180deg, #3d8bff, #1a73ff);
  box-shadow: 0 30px 80px rgba(26, 115, 255, .45);
  transform-origin: bottom; transition: transform .4s ease;
}
.folder:hover .front { transform: perspective(800px) rotateX(-22deg); }
.folder:hover .paper { transform: translateY(-22px); }
.folder:hover .paper.p2 { transform: translateY(-12px) rotate(-6deg); }
.folder-label { font-size: 13px; color: var(--muted); }
@keyframes float { 50% { transform: translateY(-12px); } }

/* ---------- Proyectos ---------- */
.projects { padding: 80px 0 120px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 40px; }
.section-head h2 { font-size: clamp(32px, 5vw, 56px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.section-head p { color: var(--muted); max-width: 380px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .3s, border-color .3s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-4px); border-color: #3a3a3a; }
.card.featured { grid-column: span 2; }
.thumb { aspect-ratio: 16 / 9; background: var(--surface-2); position: relative; overflow: hidden; }
.card.featured .thumb { aspect-ratio: 16 / 7.6; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .thumb img { transform: scale(1.05); }
.thumb .placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 40px; font-weight: 800; color: rgba(255, 255, 255, .9);
}
.card-body { padding: 18px 20px 22px; }
.client { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent-2); font-weight: 600; }
.card h3 { font-size: 20px; margin-top: 6px; letter-spacing: -.01em; }
.card p { color: var(--muted); font-size: 14px; margin-top: 4px; }

.stats { display: flex; gap: 32px; margin-top: 14px; flex-wrap: wrap; }
.stat b { display: block; font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.stat span { font-size: 13px; color: var(--muted); }

/* ---------- Sobre mí ---------- */
.about { padding: 0 0 120px; }
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; }
.about-text p { font-size: clamp(17px, 1.8vw, 21px); color: var(--muted); margin-bottom: 18px; max-width: 620px; }
.about-text strong { color: var(--text); font-weight: 500; }
.about-block { margin-bottom: 28px; }
.about-block h3 { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 14px; }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 60px 0 40px; text-align: center; }
footer h2 { font-size: clamp(28px, 4vw, 44px); font-weight: 800; letter-spacing: -.03em; margin-bottom: 20px; }
footer .small { margin-top: 40px; font-size: 13px; color: var(--muted); }

/* Animación al hacer scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: left; padding-top: 120px; }
  .folder-wrap { order: -1; }
  .folder { width: 200px; }
  .grid { grid-template-columns: 1fr 1fr; }
  .card.featured { grid-column: span 2; }
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 600px) {
  .nav .hide-sm { display: none; }
  .grid { grid-template-columns: 1fr; }
  .card.featured { grid-column: auto; }
  .card.featured .thumb { aspect-ratio: 16 / 9; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
