/* ============================================
   Marcos Costa — Portfolio Stylesheet
   To add styles: edit sections below.
   ============================================ */

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

:root {
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e2e8f0;
  --card-shadow: 0 1px 3px rgba(0,0,0,.07), 0 6px 16px rgba(0,0,0,.05);
  --nav-bg: rgba(255, 255, 255, 0.92);
  --radius: 10px;
  --nav-height: 64px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Dark mode */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --border: #334155;
  --card-shadow: 0 1px 3px rgba(0,0,0,.3), 0 6px 16px rgba(0,0,0,.2);
  --nav-bg: rgba(15, 23, 42, 0.92);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ---- Layout ---- */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---- Navigation ---- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  letter-spacing: -0.5px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 28px;
}

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

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: .25s;
}

/* ---- Theme toggle button ---- */
.theme-toggle {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  padding: 6px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .2s, border-color .2s, background .2s;
  margin-right: 8px;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.theme-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* Show moon in light mode, sun in dark mode */
.icon-sun { display: none; }
.icon-moon { display: block; }

[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

/* ---- Sections ---- */
.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 14px;
  letter-spacing: -0.5px;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 36px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ---- Hero ---- */
.hero {
  padding: 72px 0 64px;
}

.hero-content {
  display: flex;
  align-items: center;
  gap: 52px;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-text h1 {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 6px;
  color: var(--text);
}

.hero-title {
  font-size: 1.15rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}

.hero-tags {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 22px;
  letter-spacing: 0.2px;
}

.hero-bio {
  color: var(--text-muted);
  font-size: 0.975rem;
  line-height: 1.75;
  max-width: 520px;
  margin-bottom: 28px;
}

.hero-links {
  display: flex;
  gap: 18px;
  align-items: center;
}

.link-icon {
  color: var(--text-muted);
  transition: color .2s, transform .2s;
  display: flex;
  align-items: center;
}

.link-icon:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

.link-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.hero-photo {
  flex-shrink: 0;
}

.hero-photo img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,.08);
}

/* ---- Experience Timeline ---- */
.timeline {
  border-left: 2px solid var(--border);
  margin-left: 8px;
}

.timeline-item {
  position: relative;
  padding: 0 0 36px 32px;
}

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

.timeline-item::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-alt);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.timeline-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.timeline-role {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.timeline-company {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 8px;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* ---- Filter Bar ---- */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 18px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font);
}

.filter-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---- Project Cards ---- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow .25s, transform .25s;
  position: relative;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  box-shadow: var(--card-shadow);
  transform: translateY(-3px);
}

.project-card.featured {
  border-color: var(--accent);
  grid-column: 1 / -1;
  flex-direction: row;
}

.project-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: 12px;
  z-index: 1;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.project-img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.project-card.featured .project-img {
  width: 320px;
  height: auto;
  min-height: 220px;
}

.project-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.2px;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 16px;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.tag {
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.2px;
}

.project-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: auto;
}

.btn-project {
  display: inline-block;
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition: background .2s, border-color .2s;
  border: 1.5px solid var(--accent);
  font-family: var(--font);
}

.btn-project:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.btn-project.btn-outline {
  background: none;
  color: var(--accent);
}

.btn-project.btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

/* ---- Publications ---- */
.publications-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.pub-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow .2s;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

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

.pub-thumb {
  flex-shrink: 0;
  width: 100px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.pub-body {
  flex: 1;
}

.pub-title {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
  line-height: 1.4;
}

.pub-authors {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.pub-venue {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 12px;
}

.pub-links {
  display: flex;
  gap: 10px;
}

.empty-note {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 40px 0;
  text-align: center;
  font-style: italic;
}

/* ---- Education ---- */
.edu-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.edu-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: box-shadow .2s;
}

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

.edu-logo {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.edu-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.edu-body {
  flex: 1;
}

.edu-degree {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.edu-institution {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 3px;
}

.edu-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.edu-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---- Contact ---- */
.contact-intro {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 480px;
  margin-bottom: 32px;
}

.contact-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.contact-btn {
  display: inline-block;
  padding: 11px 28px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transition: background .2s;
  border: 2px solid var(--accent);
  font-family: var(--font);
}

.contact-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.contact-btn-outline {
  background: none;
  color: var(--accent);
}

.contact-btn-outline:hover {
  background: var(--accent);
  color: #fff;
}

/* ---- Awards ---- */
.awards-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.award-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: 3px solid #f59e0b;
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: box-shadow .2s;
}

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

.award-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 2px;
}

.award-body {
  flex: 1;
}

.award-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.award-event {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 3px;
}

.award-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.award-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ---- Beyond the Code ---- */
.athlete-card {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  transition: box-shadow 0.2s, transform 0.2s;
}

.athlete-card:hover {
  box-shadow: var(--card-shadow);
  transform: translateY(-3px);
}

.athlete-img {
  width: 420px;
  min-height: 280px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.athlete-body {
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.athlete-body h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

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

/* ---- Footer ---- */
.footer {
  background: var(--text);
  color: rgba(255, 255, 255, 0.4);
  padding: 28px 0;
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.3px;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 20px 28px;
    gap: 18px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
  }

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

  .hero {
    padding: 52px 0 48px;
  }

  .hero-content {
    flex-direction: column-reverse;
    gap: 32px;
    text-align: center;
  }

  .hero-text h1 {
    font-size: 2.1rem;
  }

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

  .hero-bio {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-photo img {
    width: 150px;
    height: 150px;
  }

  .project-card.featured {
    flex-direction: column;
  }

  .project-card.featured .project-img {
    width: 100%;
    height: 190px;
  }

  .athlete-card {
    flex-direction: column;
  }

  .athlete-img {
    width: 100%;
    min-height: 220px;
  }

  .section {
    padding: 56px 0;
  }

  .pub-item {
    flex-direction: column;
  }

  .pub-thumb {
    width: 100%;
    height: 160px;
  }
}

@media (max-width: 480px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
}
