:root {
  --bg: #F3F0EA;
  --surface: #FFFFFF;
  --text: #171512;
  --text-muted: #6B655E;
  --border: #E7E2D9;
  --accent: #FF5A1F;
  --nav-bg: rgba(243,240,234,0.55);
  --nav-border: rgba(23,21,18,0.08);
  --nav-pill-bg: rgba(255,255,255,0.55);
}
[data-theme="dark"] {
  --bg: #141311;
  --surface: #1D1B18;
  --text: #F4F1EA;
  --text-muted: #A39C90;
  --border: #2C2924;
  --nav-bg: rgba(20,19,17,0.55);
  --nav-border: rgba(244,241,234,0.10);
  --nav-pill-bg: rgba(244,241,234,0.06);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 200ms ease, color 200ms ease;
}
a { text-decoration: none; color: inherit; }
h1, h2, h3 { font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* NAV */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--nav-border);
}
.logo { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; flex-shrink: 0; }
.logo span { color: var(--accent); }
.nav-pill {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: var(--nav-pill-bg); border: 1px solid var(--nav-border);
  border-radius: 999px; padding: 6px;
}
.nav-pill a { padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; transition: opacity 150ms; }
.nav-pill a:hover { opacity: 0.65; }
.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.theme-toggle {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer;
  flex-shrink: 0;
}
.theme-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }

/* LANGUAGE SWITCH */
.lang-switch { display: flex; align-items: center; gap: 2px; background: var(--nav-pill-bg); border: 1px solid var(--nav-border); border-radius: 999px; padding: 4px; flex-shrink: 0; }
.lang-btn {
  border: none; background: transparent; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 12.5px; font-weight: 600; color: var(--text-muted);
  padding: 6px 11px; border-radius: 999px; transition: background 150ms, color 150ms;
}
.lang-btn.active { background: var(--surface); color: var(--text); }

/* MOBILE NAV TOGGLE (hamburger) */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
  width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; padding: 0; flex-shrink: 0;
}
.nav-toggle span { display: block; width: 16px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 150ms ease, opacity 150ms ease; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 700px) {
  .nav { flex-wrap: wrap; row-gap: 10px; }
  .nav-pill {
    order: 3; width: 100%;
    flex-direction: column; align-items: stretch; gap: 4px;
    display: none;
    border-radius: 16px;
  }
  .nav-pill.open { display: flex; }
  .nav-pill a { text-align: center; padding: 12px 14px; }
  .nav-toggle { display: flex; }
  .theme-toggle .theme-label { display: none; }
  .theme-toggle { width: 40px; padding: 0; justify-content: center; }
}

/* HERO */
.hero { max-width: 720px; margin: 0 auto; padding: 76px 20px 40px; display: flex; flex-direction: column; align-items: center; text-align: center; }

.avatar-wrap { perspective: 700px; display: inline-block; margin-bottom: 28px; }
.avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; border: 2px solid var(--accent); display: block; transition: transform 500ms cubic-bezier(0.22, 1, 0.36, 1); will-change: transform; }

.eyebrow { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: 18px; }
.hero h1 { font-weight: 700; letter-spacing: -0.04em; line-height: 1.04; font-size: clamp(38px, 7vw, 64px); margin-bottom: 22px; }

@property --mx { syntax: '<length>'; inherits: true; initial-value: -9999px; }
@property --my { syntax: '<length>'; inherits: true; initial-value: -9999px; }
.hero-title { position: relative; transition: --mx 150ms ease, --my 150ms ease; }
.hero-title .title-base { display: block; }
.hero-title .title-glow {
  position: absolute; inset: 0; display: block; color: var(--accent); pointer-events: none;
  -webkit-mask-image: radial-gradient(circle 90px at var(--mx) var(--my), black 0%, transparent 100%);
  mask-image: radial-gradient(circle 90px at var(--mx) var(--my), black 0%, transparent 100%);
}
@media (prefers-reduced-motion: reduce) {
  .avatar { transition: none; }
  .hero-title { transition: none; }
}
.hero p.lead { font-size: 17px; line-height: 1.6; color: var(--text-muted); max-width: 520px; margin: 0 0 32px; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn { display: inline-flex; align-items: center; height: 46px; padding: 0 22px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-secondary { border: 1px solid var(--border); color: var(--text); }

.tools { margin-top: 52px; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; padding-top: 32px; border-top: 1px solid var(--border); width: 100%; }
.chip { font-size: 13px; font-weight: 500; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); }

/* WORK */
.section { padding: 24px 20px 20px; }
.section-title { font-size: 28px; margin-bottom: 20px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.filter-btn {
  height: 38px; padding: 0 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; cursor: pointer;
  background: var(--surface); color: var(--text-muted); border: 1px solid var(--border);
  font-family: 'Inter', sans-serif;
}
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-btn:hover { opacity: 0.85; }

.cards { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 720px) { .cards { grid-template-columns: repeat(2, minmax(0,1fr)); } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 26px;
  display: flex; flex-direction: column; gap: 14px; transition: transform 160ms ease, border-color 160ms ease;
}
.card:hover { transform: translateY(-2px); }
.card.hidden { display: none; }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mark { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.mark img { width: 24px; height: 24px; object-fit: contain; display: block; }
.badge { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); border-radius: 999px; padding: 4px 10px; }
.eyebrow-small { font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 6px; }
.card h3 { font-size: 21px; margin-bottom: 8px; }
.card p.desc { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--text-muted); }
.card .tags { font-size: 12.5px; color: var(--text-muted); padding-top: 10px; border-top: 1px solid var(--border); }
.card .link { font-size: 13.5px; font-weight: 600; color: var(--accent); }
.card .card-links { display: flex; flex-direction: column; gap: 4px; }

/* SOBRE MI */
.about-box { background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 40px 28px; display: flex; flex-direction: column; gap: 32px; }
.about-box p { font-size: 15.5px; line-height: 1.65; color: var(--text-muted); max-width: 720px; margin: 0; }
.stats { display: flex; gap: 28px; flex-wrap: wrap; padding-top: 4px; }
.stat-num { font-size: 24px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 13px; color: var(--text-muted); }
.timeline-title { font-size: 13px; font-weight: 600; color: var(--accent); margin: 24px 0 4px; }
.timeline { display: flex; flex-direction: column; padding-top: 8px; border-top: 1px solid var(--border); }
.tl-item { display: flex; gap: 16px; align-items: stretch; }
.tl-marker { display: flex; flex-direction: column; align-items: center; width: 12px; flex-shrink: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-muted); margin-top: 6px; flex-shrink: 0; }
.tl-item:last-child .tl-dot { background: var(--accent); }
.tl-line { flex: 1; width: 1px; background: var(--border); margin-top: 4px; }
.tl-item:last-child .tl-line { background: transparent; }
.tl-content { padding-bottom: 26px; flex: 1; }
.tl-period { font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.tl-heading { font-weight: 700; letter-spacing: -0.01em; font-size: 15.5px; margin-bottom: 4px; }
.tl-desc { font-size: 13.5px; line-height: 1.55; color: var(--text-muted); max-width: 560px; }

/* SKILLS */
.skills { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 720px) { .skills { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.skill-group { border-top: 1px solid var(--border); padding-top: 16px; }
.skill-title { font-size: 13px; font-weight: 600; color: var(--accent); margin-bottom: 10px; }
.skill-items { font-size: 14.5px; line-height: 1.7; color: var(--text-muted); }

/* CONTACT */
.contact-box { background: var(--text); color: var(--bg); border-radius: 24px; padding: 44px 28px; display: flex; flex-direction: column; gap: 20px; }
.contact-box h2 { font-size: 30px; max-width: 480px; line-height: 1.2; }
.contact-links { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.contact-links a:nth-child(2) { opacity: 0.75; }
.social-links { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 8px; }
.social-links a { font-size: 13px; font-weight: 500; padding: 9px 16px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.25); }
.footer-note { text-align: center; margin-top: 28px; font-size: 12.5px; color: var(--text-muted); padding-bottom: 90px; }
