:root {
  --bg: #0e1116;
  --bg-2: #151a21;
  --card: #1a2029;
  --line: #262e3a;
  --text: #e9edf2;
  --muted: #9aa5b4;
  --accent: #f5c443;
  --accent-ink: #1b1600;
  --radius: 18px;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f5f0;
    --bg-2: #efece4;
    --card: #ffffff;
    --line: #e2ddd1;
    --text: #15181d;
    --muted: #5d6573;
    --accent: #e3a812;
    --accent-ink: #1b1600;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--accent); }

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

/* Barra superior */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__in { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { font-weight: 700; font-size: 20px; text-decoration: none; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 6px; align-items: center; }
.nav a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 999px; font-size: 15px; }
.nav a:hover { color: var(--text); background: var(--bg-2); }
.nav .nav__cta { color: var(--accent-ink); background: var(--accent); font-weight: 500; }
.nav .nav__cta:hover { color: var(--accent-ink); background: var(--accent); filter: brightness(1.05); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-2);
  text-decoration: none; font-weight: 500; font-size: 16px;
  transition: transform .15s ease, border-color .15s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--muted); }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--primary:hover { border-color: var(--accent); }

/* Inicio */
.hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: center;
  padding: 72px 0 88px;
}
.eyebrow {
  margin: 0 0 14px; font-size: 13px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent);
}
.hero h1 { font-size: clamp(36px, 5.4vw, 64px); font-weight: 700; }
.hero h1 em { font-size: 1.08em; }
.lead { font-size: 19px; color: var(--muted); max-width: 58ch; margin: 22px 0 30px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.socials { list-style: none; padding: 0; margin: 28px 0 0; display: flex; gap: 20px; }
.socials a { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-size: 15px; }
.socials a:hover { color: var(--text); }
.socials svg { width: 18px; height: 18px; fill: currentColor; }
.hero__photo { margin: 0; position: relative; width: 100%; max-width: 380px; justify-self: end; }
.hero__photo::before {
  content: ""; position: absolute; inset: 24px -18px -18px 24px;
  border: 2px solid var(--accent); border-radius: var(--radius);
}
.hero__photo img {
  position: relative; border-radius: var(--radius);
  aspect-ratio: 4 / 5; object-fit: cover; object-position: center 20%;
  width: 100%;
}

/* Secciones */
.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section__head { margin-bottom: 36px; }
.section h2 { font-size: clamp(28px, 3.4vw, 40px); }

/* Proyectos */
.project {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 44px; align-items: center;
  margin-bottom: 72px;
}
.project:last-child { margin-bottom: 0; }
.project--flip .project__shot { order: 2; }
.project__shot {
  display: block; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--bg-2);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / .55);
  transition: transform .25s ease;
}
.project__shot:hover { transform: translateY(-4px); }
.project__tag { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.project h3 { font-size: 30px; margin-bottom: 14px; }
.project h3 span { font-weight: 400; color: var(--muted); font-size: 20px; }
.project__body > p { margin: 0 0 16px; color: var(--muted); }
.bullets { margin: 0 0 20px; padding-left: 20px; }
.bullets li { margin-bottom: 6px; }
.bullets li::marker { color: var(--accent); }

.chips { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  font-size: 14px; padding: 5px 12px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line);
}

/* Experiencia */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid; grid-template-columns: 170px 1fr; gap: 24px;
  padding: 24px 0; border-bottom: 1px dashed var(--line);
}
.timeline li:last-child { border-bottom: 0; }
.timeline__date { margin: 2px 0 0; color: var(--accent); font-weight: 500; font-size: 15px; }
.timeline h3 { font-size: 21px; margin-bottom: 8px; }
.timeline h3 span, .edu p { color: var(--muted); font-weight: 400; }
.timeline p { margin: 0; color: var(--muted); }

/* Habilidades y educación */
.split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; }
.skills h3, .edu h3 { font-size: 17px; margin-bottom: 10px; }
.skills .chips { margin-bottom: 22px; }
.skills__note {
  margin-left: 6px; padding: 2px 8px; border-radius: 999px; vertical-align: 2px;
  font-size: 12px; font-weight: 500; background: var(--accent); color: var(--accent-ink);
}
.chips--strong li { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.edu { list-style: none; margin: 0; padding: 0; }
.edu li { padding: 0 0 18px 18px; margin-bottom: 18px; border-left: 2px solid var(--accent); }
.edu p { margin: 0; font-size: 15px; }

/* Archivo */
.archive { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 24px; }
.archive summary { cursor: pointer; font-weight: 500; }
.archive__list { list-style: none; padding: 0; margin: 16px 0 4px; }
.archive__list li { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.archive__list a { font-weight: 500; }
.archive__list span { color: var(--muted); font-size: 15px; }

/* Contacto */
.contact {
  margin-top: 32px; margin-bottom: 48px; padding: 56px 48px; border-radius: 28px;
  background: var(--card); border: 1px solid var(--line); text-align: center;
}
.contact h2 { font-size: clamp(28px, 4vw, 44px); max-width: 22ch; margin-inline: auto; }
.contact p { color: var(--muted); margin: 14px 0 26px; }
.contact .hero__actions { justify-content: center; }

.footer {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 24px 0 40px; color: var(--muted); font-size: 14px;
}
.footer p { margin: 0; }

/* Aparición al hacer scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Tablet y celular */
@media (max-width: 860px) {
  .hero, .project, .split { grid-template-columns: 1fr; gap: 32px; }
  .hero { padding: 40px 0 56px; }
  .hero__photo { max-width: 260px; order: -1; justify-self: start; }
  .project--flip .project__shot { order: 0; }
  .timeline li { grid-template-columns: 1fr; gap: 6px; }
  .contact { padding: 40px 20px; }
}
@media (max-width: 560px) {
  .nav a:not(.nav__cta) { display: none; }
  .hero__photo { max-width: 150px; }
  .hero__photo img { aspect-ratio: 1; }
  .hero__photo::before { inset: 10px -8px -8px 10px; }
  .lead { font-size: 17px; }
  .btn { padding: 11px 16px; font-size: 15px; }
}
