/* ==========================================================================
   Carlos Quijano-Chavez — Academic & Developer Portfolio
   Clean, lightweight, zero-dependency stylesheet
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --text-light: #64748b;
  --border: #e2e8f0;
  --accent: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-hover: #1e40af;
  --edu-dot: #1d4ed8;
  --work-dot: #64748b;
  --radius: 12px;
  --max-width: 960px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Header / Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  min-height: 64px;
  padding: 0.75rem 0;
  gap: 0.5rem 1rem;
}

.site-brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.site-brand span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* ---------- Hero / Bio Section ---------- */
.hero {
  padding: 4rem 0 2.75rem;
  border-bottom: 1px solid var(--border);
}

.hero-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 2.25rem;
  align-items: start;
}

.hero-avatar {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--bg-subtle);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  background: var(--bg-subtle);
}

.hero-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  margin: 0 0 1.1rem;
  font-size: 1.02rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hero-bio {
  margin: 0 0 1.4rem;
  color: var(--text);
  max-width: 68ch;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* ---------- Buttons & Pills ---------- */
.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: 999px;
}

.pill-link:hover {
  background: var(--accent);
  color: #ffffff;
}

.pill-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.pill-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: #cbd5e1;
}

/* ---------- Generic Sections ---------- */
.section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.section-title {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.section-action {
  font-size: 0.92rem;
  font-weight: 500;
}

/* ---------- Career Timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.25rem;
  border-left: 2px solid var(--border);
}

.timeline-item {
  position: relative;
  padding: 0 0 1.65rem 1.25rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -1.68rem;
  top: 0.42rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--work-dot);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px var(--border);
}

.timeline-dot.is-edu {
  background: var(--edu-dot);
  box-shadow: 0 0 0 2px #bfdbfe;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  font-size: 0.84rem;
  color: var(--text-light);
  margin-bottom: 0.2rem;
}

.timeline-period {
  font-weight: 600;
  color: var(--text-muted);
}

.timeline-role {
  margin: 0 0 0.25rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
}

.timeline-org {
  font-weight: 400;
  color: var(--text-muted);
}

.timeline-summary {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-muted);
  max-width: 72ch;
}

/* ---------- Home Compact Publications ---------- */
.pub-compact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.pub-compact-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1rem;
  padding-bottom: 1.35rem;
  border-bottom: 1px solid var(--border);
}

.pub-compact-item:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.pub-compact-year {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-light);
  padding-top: 0.15rem;
}

.pub-compact-title {
  display: inline-block;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.pub-compact-title:hover {
  color: var(--accent);
}

.pub-compact-authors,
.pub-compact-venue {
  margin: 0 0 0.2rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.pub-compact-venue {
  font-style: italic;
  color: var(--text-light);
  margin-bottom: 0.55rem;
}

.author-self {
  color: var(--text);
  font-weight: 600;
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* ---------- Publications Page (Visual Cards + GIFs) ---------- */
.page-intro {
  padding: 3rem 0 1.75rem;
}

.page-intro h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.page-intro p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
  max-width: 65ch;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-btn:hover {
  border-color: #cbd5e1;
  color: var(--text);
}

.filter-btn.is-active {
  background: var(--text);
  border-color: var(--text);
  color: #ffffff;
}

.publications-grid {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding-bottom: 4rem;
}

.pub-card {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.75rem;
  padding: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  scroll-margin-top: 84px;
}

.pub-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.pub-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  align-self: start;
}

.pub-media-el {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pub-media-placeholder {
  width: 100%;
  height: 100%;
  padding: 1rem;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-light);
}

.pub-media-placeholder code {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
  background: #e2e8f0;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  word-break: break-all;
}

.pub-badges {
  display: flex;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
}

.badge-year {
  background: var(--text);
  color: #ffffff;
}

.badge-type {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.pub-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.pub-authors {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.pub-venue {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-light);
}

.pub-desc {
  margin: 0 0 0.9rem;
  font-size: 0.94rem;
  color: var(--text);
}

.pub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.95rem;
}

.tag {
  font-size: 0.76rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  font-size: 0.88rem;
  color: var(--text-light);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    justify-items: center; 
    text-align: center;    
  }

  .hero-avatar {
    width: 160px;
    height: 160px;
    margin: 0 auto;
  }

  .social-links {
    justify-content: center; 
  }

  .pub-card {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

@media (max-width: 540px) {
  .pub-compact-item {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .nav-links {
    gap: 1rem;
  }
}
