/* Carlos Aguirre — personal site
   Modern single-page redesign (2026). Static, GitHub-Pages friendly. */

:root {
  --accent: #7c3aed;      /* violet */
  --accent-2: #f43f5e;    /* coral */
  --accent-soft: rgba(124, 58, 237, 0.12);
  --bg: #ffffff;
  --bg-alt: #f6f5fb;
  --card: #ffffff;
  --text: #1c1b22;
  --text-soft: #55535f;
  --border: #e7e5ee;
  --shadow: 0 1px 2px rgba(20, 14, 40, 0.04), 0 8px 24px rgba(20, 14, 40, 0.06);
  --radius: 16px;
  --maxw: 1080px;
  --nav-h: 64px;
}

[data-theme="dark"] {
  --accent: #a78bfa;
  --accent-2: #fb7185;
  --accent-soft: rgba(167, 139, 250, 0.16);
  --bg: #0f0e13;
  --bg-alt: #16151d;
  --card: #17161f;
  --text: #ececf1;
  --text-soft: #a3a1ad;
  --border: #2a2833;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 {
  font-family: "Space Grotesk", "Inter", system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  letter-spacing: -0.01em;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: var(--accent-2); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700;
  font-family: "Space Grotesk", sans-serif; color: var(--text); }
.brand img { width: 30px; height: 30px; border-radius: 50%; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--text-soft); font-size: 0.92rem; font-weight: 500; }
.nav-links a:hover { color: var(--accent); }
.theme-toggle {
  background: var(--bg-alt); border: 1px solid var(--border); color: var(--text);
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 1rem;
  display: grid; place-items: center; transition: all 0.2s ease;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text);
  font-size: 1.4rem; cursor: pointer; }

/* ---------- Hero ---------- */
.hero { padding: 68px 0 52px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(60rem 30rem at 85% -10%, var(--accent-soft), transparent 60%),
    radial-gradient(50rem 26rem at -5% 0%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 55%);
}
.hero-grid { display: grid; grid-template-columns: 200px 1fr; gap: 40px; align-items: center; }
.hero-photo {
  width: 200px; height: 200px; border-radius: 24px; object-fit: cover;
  box-shadow: var(--shadow); border: 3px solid var(--card);
}
.eyebrow { color: var(--accent); font-weight: 600; font-size: 0.9rem;
  text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 6px; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); margin: 0 0 10px; }
.hero .role { font-size: 1.15rem; color: var(--text-soft); margin: 0 0 18px; }
.hero .role strong { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.chip {
  font-size: 0.82rem; padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 500;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 12px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid transparent; cursor: pointer; transition: all 0.2s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.socials { display: flex; gap: 14px; margin-top: 20px; }
.socials a {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--bg-alt); border: 1px solid var(--border); color: var(--text-soft);
  font-size: 1.05rem; transition: all 0.2s ease;
}
.socials a:hover { color: #fff; background: var(--accent); border-color: var(--accent);
  transform: translateY(-2px); }

/* ---------- Sections ---------- */
section { padding: 56px 0; }
section.alt { background: var(--bg-alt); }
.section-head { margin: 0 0 28px; }
.section-head h2 { font-size: 1.8rem; margin: 0 0 6px; display: flex; align-items: center; gap: 12px; }
.section-head h2::before {
  content: ""; width: 26px; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.section-head p { color: var(--text-soft); margin: 0; }
.lead { font-size: 1.08rem; color: var(--text-soft); max-width: 62ch; }
.lead strong { color: var(--text); }

/* ---------- Focus cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 10px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 1.25rem; margin-bottom: 14px; }
.card h3 { font-size: 1.12rem; margin: 0 0 8px; }
.card p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }

/* ---------- Publications (bibtex-js) ---------- */
#bibtex_display ul { list-style: none; padding: 0; margin: 0; }
#bibtex_display > ul > li,
#bibtex_display li {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow);
}
#bibtex_display .title { font-weight: 600; color: var(--text); }
#bibtex_display .author { color: var(--text-soft); font-size: 0.92rem; }
#bibtex_display em { color: var(--text-soft); }
.bibtex_structure .year > .title {
  font-family: "Space Grotesk", sans-serif; font-size: 1.15rem; color: var(--accent);
  margin: 22px 0 12px; padding-bottom: 4px; border-bottom: 1px solid var(--border);
}
#bibtex_display a[role="button"], #bibtex_display .bibtexVar[role="button"] {
  font-size: 0.8rem; color: var(--accent); font-weight: 500;
}
#bibtex_display pre {
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px;
  padding: 12px; font-size: 0.8rem; overflow-x: auto; color: var(--text-soft);
}

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px;
  background: var(--border);
}
.timeline li { position: relative; padding: 0 0 26px 34px; overflow: hidden; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: 6px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--card); border: 3px solid var(--accent);
}
.timeline .tl-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px; }
.timeline h4 { margin: 0; font-size: 1.05rem; }
.timeline .when { color: var(--text-soft); font-size: 0.88rem; font-weight: 500; white-space: nowrap; }
.timeline p { margin: 4px 0 0; color: var(--text-soft); font-size: 0.94rem; }
.tl-photo {
  float: right; width: 128px; height: 128px; object-fit: cover; border-radius: 12px;
  margin: 0 0 8px 16px; box-shadow: var(--shadow); border: 2px solid var(--card);
}
@media (max-width: 560px) {
  .tl-photo { float: none; display: block; margin: 8px 0; width: 100%; height: auto; max-width: 220px; }
}

/* ---------- Dance ---------- */
.dance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; }
.dance-card {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow);
}
.dance-card h3 { color: #fff; margin: 0 0 10px; font-size: 1.4rem; }
.dance-card p { margin: 0 0 18px; opacity: 0.95; }
.dance-card .btn { background: #fff; color: var(--accent); }
.dance-card .btn:hover { background: rgba(255,255,255,0.9); color: var(--accent-2); }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--border); padding: 34px 0; text-align: center; color: var(--text-soft); }
footer .socials { justify-content: center; margin-bottom: 16px; }
footer p { margin: 0; font-size: 0.88rem; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 24px; justify-items: center; }
  .chips, .cta-row, .socials { justify-content: center; }
  .cards { grid-template-columns: 1fr; }
  .dance-grid { grid-template-columns: 1fr; }
  .nav-links { position: fixed; inset: var(--nav-h) 0 auto 0; flex-direction: column;
    background: var(--bg); border-bottom: 1px solid var(--border); padding: 16px 22px;
    gap: 16px; display: none; }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}
