@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&display=swap');

/* ══════════════════════════════════════════════════════
   DESIGN TOKENS  — Dark-mode professional palette
══════════════════════════════════════════════════════ */
:root {
  /* Backgrounds — light, matching reference site */
  --bg-base:        #ffffff;   /* page background */
  --bg-surface:     #ffffff;   /* cards, panels */
  --bg-surface-2:   #f4f4f5;   /* slightly lifted surface */
  --bg-surface-3:   #e9e9eb;   /* hover / sidebar */

  /* Borders */
  --border:         rgba(11,77,61,0.12);
  --border-mid:     rgba(11,77,61,0.22);

  /* Text */
  --text-primary:   #16302a;
  --text-secondary: #33504a;
  --text-muted:     #5c746d;

  /* Brand colours — deep teal/green, as in the navbar reference */
  --sky:            #0b6e57;
  --sky-light:      #14b58e;
  --sky-pale:       rgba(11,110,87,0.10);
  --accent:         #0b4d3d;
  --accent-soft:    rgba(11,77,61,0.10);
  --accent2:        #8b3a2a;
  --accent2-soft:   rgba(139,58,42,0.12);
  --navy:           #0b4d3d;   /* kept for footer compat */

  /* Typography */
--font-display: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--font-body:    ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--font-mono:    'Fira Code', monospace;

  /* Shape */
  --radius-sm:  6px;
  --radius-md:  12px;
  --radius-lg:  20px;

  /* Shadows */
  --shadow-sm: 0 1px 4px rgba(15,45,38,0.06);
  --shadow-md: 0 6px 20px rgba(15,45,38,0.09);
  --shadow-lg: 0 16px 48px rgba(15,45,38,0.14);

  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

.amp {
  font-family: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  font-weight: 400;
  font-style: normal;
}


.nav-toggle { display: none; }


.pub-link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--sky);
  text-decoration: none;
  font-weight: 700;
}
.pub-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════
   RESET & BASE
══════════════════════════════════════════════════════ */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0;
}

h1, h2, h3, .font-display {
  font-optical-sizing: auto;
}

/* ══════════════════════════════════════════════════════
   PROSE — links & inline code inside body text
══════════════════════════════════════════════════════ */
p a,
li a,
.card a:not(.pub-link),
.item-card p a {
  color: var(--accent2);
  text-decoration: underline;
  text-decoration-color: rgba(139,58,42,0.4);
  text-underline-offset: 3px;
  font-weight: 700;
  transition: color var(--transition), text-decoration-color var(--transition);
}
p a:hover,
li a:hover,
.card a:not(.pub-link):hover,
.item-card p a:hover {
  color: #6b2c1f;
  text-decoration-color: currentColor;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--accent2);
  background: var(--accent2-soft);
  padding: 0.15em 0.45em;
  border-radius: 5px;
}

strong, b {
  color: var(--text-primary);
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════
   HEADER / NAV
══════════════════════════════════════════════════════ */
header {
  background: var(--accent);
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 14px rgba(11,77,61,0.18);
  animation: slideDown 0.5s ease both;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

nav {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 68px;
}

.nav-brand h1 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.nav-brand p {
  font-size: 0.82rem;
  font-weight: 400;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0;
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

nav ul li a {
  display: block;
  text-decoration: none;
  color: rgba(255,255,255,0.9);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

nav ul li a:hover {
  color: #fff;
  background: rgba(255,255,255,0.14);
}

nav ul li a.active-page {
  color: var(--accent);
  background: #ffffff;
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

nav ul li a.active-page:hover {
  color: var(--accent);
  background: #ffffff;
}

/* Language switcher */
.language-switcher {
  display: flex;
  gap: 0.2rem;
  align-items: center;
  margin-left: 1.25rem;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.language-switcher button {
  background: none;
  border: none;
  padding: 0.25rem 0.65rem;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
  color: rgba(255,255,255,0.75);
  border-radius: 4px;
  letter-spacing: 0.05em;
  transition: all var(--transition);
}

.language-switcher button:hover { color: #fff; }

.language-switcher button.active {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* ══════════════════════════════════════════════════════
   LANGUAGE VISIBILITY
══════════════════════════════════════════════════════ */
.lang-en, .lang-pt { display: none; }
body[data-lang="en"] .lang-en { display: block; }
body[data-lang="pt"] .lang-pt { display: block; }
body[data-lang="en"] nav .lang-en { display: inline; }
body[data-lang="pt"] nav .lang-pt { display: inline; }
nav .lang-en, nav .lang-pt { display: none; }

/* ══════════════════════════════════════════════════════
   LAYOUT
══════════════════════════════════════════════════════ */
main {
  max-width: 1140px;
  margin: 2.5rem auto;
  padding: 0 2rem;
  min-height: calc(100vh - 180px);
}

/* Page entry animations */
main > * {
  animation: fadeUp 0.55s ease both;
}
main > *:nth-child(1) { animation-delay: 0.05s; }
main > *:nth-child(2) { animation-delay: 0.12s; }
main > *:nth-child(3) { animation-delay: 0.19s; }
main > *:nth-child(4) { animation-delay: 0.26s; }

@keyframes fadeUp {
  from { opacity:0; transform: translateY(18px); }
  to   { opacity:1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════
   PAGE BANNER (inner pages top header)
══════════════════════════════════════════════════════ */
.page-banner {
  background: linear-gradient(130deg, var(--accent) 0%, #0e5c48 100%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.page-banner::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 32px 32px;
}

.page-banner::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, transparent 65%);
  pointer-events: none;
}

.page-banner .eyebrow {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-bottom: 0.4rem;
  position: relative; z-index: 1;
}

.page-banner h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.15;
  border: none;
  margin-bottom: 0;
  position: relative; z-index: 1;
}
.page-banner h2::after { display: none; }

/* ══════════════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════════════ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-mid);
  transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════
   SECTIONS (inner page content)
══════════════════════════════════════════════════════ */
section { margin-bottom: 2rem; }

section h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

section h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

section p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 0.975rem;
  line-height: 1.8;
}

section ul { margin-left: 1.5rem; margin-bottom: 1rem; }
section ul li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.975rem;
}

/* ══════════════════════════════════════════════════════
   TAGS
══════════════════════════════════════════════════════ */
.tag {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sky);
  background: var(--sky-pale);
  border: 1px solid rgba(11,110,87,0.22);
  padding: 0.22rem 0.7rem;
  border-radius: 99px;
  letter-spacing: 0.02em;
  transition: background var(--transition), transform var(--transition);
}
.tag:hover { background: rgba(11,110,87,0.18); transform: translateY(-1px); }

.tag.accent {
  color: var(--accent2);
  background: var(--accent2-soft);
  border-color: rgba(139,58,42,0.25);
}
.tag.accent:hover { background: rgba(139,58,42,0.2); }

.tag-group { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }

/* ══════════════════════════════════════════════════════
   SIDEBAR CARDS
══════════════════════════════════════════════════════ */
.sidebar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1rem;
  transition: border-color var(--transition);
}
.sidebar-card:hover { border-color: var(--border-mid); }

.sidebar-card h3 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

/* ══════════════════════════════════════════════════════
   ABOUT GRID
══════════════════════════════════════════════════════ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}

/* ══════════════════════════════════════════════════════
   TIMELINE
══════════════════════════════════════════════════════ */
.timeline { position: relative; padding-left: 1.5rem; margin-top: 0.5rem; }

.timeline::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item { position: relative; margin-bottom: 1.25rem; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.5rem; top: 7px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--sky);
  border: 2px solid var(--bg-surface);
  box-shadow: 0 0 0 2px var(--sky-light);
  transition: transform var(--transition);
}
.timeline-item:hover::before { transform: scale(1.4); }

.timeline-item .year {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
  letter-spacing: 0.04em;
}
.timeline-item .title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}
.timeline-item .sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════
   STAT PILLS
══════════════════════════════════════════════════════ */
.stat-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.25rem; }

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, #eef6f2, #e1ece7);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.25rem;
  min-width: 90px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.stat-pill:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-mid);
}
.stat-pill .num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.2rem;
  color: var(--sky);
}
.stat-pill .label {
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

/* ══════════════════════════════════════════════════════
   ITEM CARDS (Research / Teaching / Projects)
══════════════════════════════════════════════════════ */
.item-list { display: flex; flex-direction: column; gap: 1rem; }

.item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem 1.6rem;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  position: relative;
  overflow: hidden;
}

.item-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--sky);
  border-radius: 5px 0 0 5px;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform var(--transition);
}

.item-card:hover {
  border-color: var(--border-mid);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}
.item-card:hover::before { transform: scaleY(1); }

.item-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.item-card p {
  margin-bottom: 0.5rem;
  font-size: 0.98rem;
  color: var(--text-secondary);
}

.item-card .meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.6rem; }

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.6rem;
}

.item-role {
  font-size: 0.83rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ══════════════════════════════════════════════════════
   CONTACT GRID
══════════════════════════════════════════════════════ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.contact-item:hover {
  border-color: rgba(11,110,87,0.4);
  box-shadow: 0 0 0 3px rgba(11,110,87,0.08);
  transform: translateY(-2px);
}

.contact-item .icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: var(--sky-pale);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.contact-item .label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.1rem;
}
.contact-item .value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════════════ */
.empty-state {
  background: var(--bg-surface-2);
  border: 1px dashed var(--border-mid);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  text-align: center;
}
.empty-icon { font-size: 2.2rem; display: block; margin-bottom: 0.75rem; }
.empty-state p {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
  margin: 0;
}

/* ══════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════ */
footer {
  background: var(--accent);
  border-top: none;
  color: rgba(255,255,255,0.6);
  margin-top: 4rem;
  padding: 2rem 0;
  font-size: 0.82rem;
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  letter-spacing: -0.01em;
  margin-bottom: 0.25rem;
}

.footer-copy { color: rgba(255,255,255,0.6); font-size: 0.82rem; }

.footer-socials { display: flex; align-items: center; gap: 0.45rem; }

.footer-social-link {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}
.footer-social-link:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
  transform: translateY(-2px);
}
.footer-social-link svg { width: 13px; height: 13px; fill: currentColor; }

/* ══════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════ */
@media (max-width: 800px) {
  nav { padding: 0 1.25rem; }
  nav ul { gap: 0; }
  nav ul li a { padding: 0.35rem 0.55rem; font-size: 0.82rem; }
  main { padding: 0 1.25rem; margin: 1.5rem auto; }
  .about-grid { grid-template-columns: 1fr; }
  .page-banner { padding: 1.75rem 1.5rem; }
  .page-banner h2 { font-size: 1.5rem; }
}

@media (max-width: 560px) {
  nav { flex-direction: column; align-items: flex-start; height: auto; padding: 1rem 1.25rem; gap: 0.75rem; }
  .nav-right { width: 100%; justify-content: space-between; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

.hero-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.hero-social-btn:hover {
  color: var(--sky);
  border-color: rgba(11,110,87,0.4);
  transform: translateY(-2px);
}

.hero-social-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* ── Scroll animations ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }


.nav-toggle { display: none; }

@media (max-width: 700px) {
  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
  }
  .nav-toggle span {
    width: 22px; height: 2px;
    background: #fff;
    border-radius: 2px;
  }
  .nav-right { display: none; flex-direction: column; align-items: flex-start; width: 100%; gap: 1rem; }
  .nav-right.open { display: flex; }
  nav { flex-wrap: wrap; height: auto; padding: 0.85rem 1.25rem; }
  nav ul { flex-direction: column; align-items: flex-start; width: 100%; gap: 0.25rem; }
  nav ul li a { display: block; width: 100%; padding: 0.6rem 0.5rem; }
}

.news-card-flex { display: flex; gap: 1.25rem; align-items: flex-start; }

@media (max-width: 560px) {
  .news-card-flex { flex-direction: column; }
  .news-card-flex img { width: 100%; height: 160px; }
  .item-header { flex-wrap: wrap; gap: 0.5rem; }
}