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

:root {
  --primary:      #667eea;
  --primary-dark: #764ba2;
  --accent:       #06b6d4;
  --bg:           #f8fafc;
  --surface:      #ffffff;
  --text:         #2d3748;
  --muted:        #718096;
  --border:       #e2e8f0;
  --radius:       16px;
  --shadow:       0 4px 24px rgba(102, 126, 234, 0.10);
  --shadow-hover: 0 8px 32px rgba(102, 126, 234, 0.18);
  --transition:   0.3s ease;
  --header-bg:    linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

[data-theme="dark"] {
  --bg:           #0f172a;
  --surface:      #1e293b;
  --text:         #f1f5f9;
  --muted:        #94a3b8;
  --border:       #334155;
  --shadow:       0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.4);
  --header-bg:    linear-gradient(135deg, #1e40af 0%, #4c1d95 100%);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover {
  color: var(--primary-dark);
}

img {
  max-width: 100%;
  display: block;
}

/* ===== HEADER ===== */
.site-header {
  background: var(--header-bg);
  color: #fff;
  text-align: center;
  padding: 56px 24px 48px;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: padding 0.3s ease, backdrop-filter 0.3s ease;
}

.site-header.scrolled {
  padding: 16px 24px;
  backdrop-filter: blur(12px);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] .site-header.scrolled {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.95) 0%, rgba(76, 29, 149, 0.95) 100%);
}

.site-header .logo {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.site-header .tagline {
  font-size: 1.05rem;
  font-weight: 400;
  opacity: 0.88;
  max-width: 480px;
  margin: 0 auto;
}

/* ===== MOBILE MENU ===== */
.mobile-menu-btn {
  display: none;
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background var(--transition);
  z-index: 110;
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.95);
  padding: 16px;
  flex-direction: column;
  gap: 4px;
  z-index: 105;
}

.mobile-nav.open {
  display: flex;
}

.mobile-nav-link {
  color: #fff;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 500;
  transition: background var(--transition);
}

.mobile-nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }
}

/* ===== MAIN ===== */
main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 24px;
}

/* ===== SECTION TITLES ===== */
.section-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
}

section + section {
  margin-top: 56px;
}

/* ===== AUTHOR CARD ===== */
.author-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  display: flex;
  align-items: center;
  gap: 28px;
  transition: box-shadow var(--transition);
  max-width: 640px;
}

.author-card:hover {
  box-shadow: var(--shadow-hover);
}

.author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
  color: #fff;
  font-weight: 700;
}

.author-info .name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.author-info .role {
  font-size: 0.92rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 999px;
  transition: opacity var(--transition), transform var(--transition);
}

.btn-link:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  color: #fff;
}

/* ===== APPS GRID ===== */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  opacity: 0.72;
}

.app-card .app-icon {
  font-size: 2rem;
  line-height: 1;
}

.app-card .app-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.app-card .app-desc {
  font-size: 0.88rem;
  color: var(--muted);
  flex: 1;
}

.badge-live {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  align-self: flex-start;
  margin-top: 4px;
}

.app-card--live {
  opacity: 1;
  text-decoration: none;
  color: var(--text);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.app-card--live:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
  color: var(--text);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--primary);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50% !important;
  border: none;
  background: var(--surface, #ffffff);
  box-shadow: var(--shadow, 0 4px 24px rgba(102, 126, 234, 0.10));
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition, 0.3s ease);
  z-index: 200;
  padding: 0;
  margin: 0;
}

.theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

[data-theme="dark"] .theme-toggle {
  background: var(--surface);
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-hover);
}

.theme-toggle:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== ANIMAÇÕES FADE-IN ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-fade-in {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }
.animate-delay-6 { animation-delay: 0.6s; }
.animate-delay-7 { animation-delay: 0.7s; }
.animate-delay-8 { animation-delay: 0.8s; }

/* ===== CARD GLOW HOVER ===== */
.app-card--live:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover), 0 0 30px rgba(102, 126, 234, 0.15);
  border-color: var(--primary);
  color: var(--text);
}

/* ===== ACCESSIBILITY: FOCUS STATES ===== */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== SKIP LINK ===== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 1000;
  transition: top 0.3s ease;
}

.skip-link:focus {
  top: 0;
}

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition);
  z-index: 150;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* ===== ABOUT PAGE ===== */
.about-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 32px;
  transition: gap var(--transition);
}
.about-back:hover {
  gap: 10px;
  color: var(--primary-dark);
}

.about-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 36px;
  align-items: start;
}

/* SIDEBAR */
.about-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

.about-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  color: #fff;
  font-weight: 700;
  margin: 0 auto 16px;
}

.about-name {
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin-bottom: 4px;
}

.about-role {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 6px;
}

.about-inst {
  font-size: 0.85rem;
  color: var(--primary-dark);
  text-align: center;
  font-weight: 600;
}

.sidebar-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.about-avatar-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  display: block;
}

.index-avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-list li {
  font-size: 0.84rem;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.contact-list .label {
  font-weight: 600;
  color: var(--text);
  min-width: 50px;
  flex-shrink: 0;
}

.links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.links-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  color: var(--text);
}

.links-list a:hover {
  background: #f0f4ff;
  border-color: var(--primary);
  transform: translateX(3px);
  color: var(--primary-dark);
}

.link-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

/* ABOUT CONTENT */
.about-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.content-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.content-card h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f4ff;
}

.bio-text {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.7;
}

.bio-text--spaced {
  margin-top: 1em;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  background: #f0f4ff;
  color: var(--primary-dark);
  border: 1px solid #d0d8ff;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 4px 12px;
}

.courses-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.courses-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--muted);
}

.courses-list li::before {
  content: '▸';
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 1px;
}

.pub-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pub-list li {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.55;
  padding-left: 16px;
  border-left: 3px solid var(--primary);
}

.pub-year {
  font-weight: 700;
  color: var(--primary-dark);
  margin-right: 6px;
}

.pub-venue {
  font-style: italic;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .site-header {
    padding: 40px 20px 32px;
  }

  .site-header.scrolled {
    padding: 12px 20px;
  }

  .site-header .logo {
    font-size: 1.8rem;
  }

  .theme-toggle {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  main {
    padding: 32px 16px;
  }

  .author-card {
    flex-direction: column;
    text-align: center;
    max-width: 100%;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }

  .about-layout {
    grid-template-columns: 1fr;
  }

  .about-avatar {
    width: 80px;
    height: 80px;
    font-size: 2rem;
  }
}
