:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #5a5a5a;
  --color-border: #e5e5e5;
  --color-accent: #2563eb;
  --color-accent-contrast: #ffffff;
  --color-surface: #f7f7f8;
  --max-width: 960px;
  --radius: 10px;
  font-size: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #12131a;
    --color-text: #f0f0f2;
    --color-muted: #a0a0ab;
    --color-border: #2a2b35;
    --color-accent: #60a5fa;
    --color-accent-contrast: #0b0c12;
    --color-surface: #1a1b24;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

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

a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

h1, h2, h3 {
  line-height: 1.2;
  margin-top: 0;
}

/* Header / Nav */
.site-header {
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  background: var(--color-bg);
  z-index: 10;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
}
.logo:hover { text-decoration: none; }

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

.nav-links a {
  color: var(--color-text);
}

.lang-switch {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2px;
  gap: 2px;
}
.lang-option {
  background: none;
  border: none;
  border-radius: calc(var(--radius) - 4px);
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  color: var(--color-muted);
}
.lang-option.active {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  font-weight: 700;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--color-text);
}

/* Hero */
.hero {
  padding: 5rem 1.5rem 3rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 2.5rem;
}
.hero-photo {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--color-border);
}
.hero-text { min-width: 0; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}
.lead {
  color: var(--color-muted);
  font-size: 1.15rem;
  max-width: 40ch;
}
.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-accent-contrast);
}
.btn-primary:hover { opacity: 0.9; }
.btn-secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

/* Sections */
.section {
  padding: 3rem 1.5rem;
  border-top: 1px solid var(--color-border);
}
.section h3 {
  margin-top: 2rem;
}

/* Project grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--color-muted); margin-bottom: 1rem; }
.card-link { font-weight: 600; }

/* Tag list (core competencies) */
.tag-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.tag-list li {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
  color: var(--color-muted);
}

/* Timeline (trajetória) */
.timeline {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}
.timeline li {
  border-left: 2px solid var(--color-border);
  padding-left: 1.25rem;
}
.timeline-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}
.timeline-header strong { font-size: 1.05rem; }
.timeline-header span {
  color: var(--color-muted);
  font-size: 0.9rem;
}
.company-logo {
  width: 22px;
  height: 22px;
  color: var(--color-muted);
  flex-shrink: 0;
}
.timeline-role {
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.timeline p:not(.timeline-role) {
  color: var(--color-muted);
  margin: 0;
}
.timeline-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}
.timeline-photos img {
  height: 100px;
  width: auto;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--color-border);
  object-fit: cover;
}

.plain-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Milestone (Harvard PLD) */
.milestone {
  display: flex;
  gap: 2rem;
  align-items: center;
  margin: 2.5rem 0;
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.milestone-photo {
  width: 45%;
  max-width: 420px;
  flex-shrink: 0;
  border-radius: calc(var(--radius) - 4px);
}

/* Zoomable images (timeline + milestone) */
.zoomable {
  cursor: zoom-in;
  transition: opacity 0.15s ease;
}
.zoomable:hover {
  opacity: 0.85;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 100;
  cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.milestone-text { min-width: 0; }
.milestone-eyebrow {
  display: block;
  color: var(--color-accent);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}
.milestone-text h3 { margin: 0 0 0.25rem; }
.milestone-meta {
  color: var(--color-muted);
  font-size: 0.9rem;
  margin: 0 0 1rem;
}
.milestone-footnote {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin: 1rem 0 0;
}

/* Book section */
.book-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-top: 1.5rem;
}
.book-cover {
  width: 200px;
  flex-shrink: 0;
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}
.book-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  flex: 1;
  min-width: 0;
}
.book-card h3 { margin-bottom: 0.25rem; }
.book-subtitle {
  color: var(--color-muted);
  font-style: italic;
  margin: 0 0 1rem;
}

.book-portrait {
  margin: 2.5rem 0 0;
  max-width: 320px;
}
.book-portrait img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
}
.book-portrait figcaption {
  color: var(--color-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.book-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.book-gallery figure {
  margin: 0;
}
.book-gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
}
.book-gallery figcaption {
  color: var(--color-muted);
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

/* Contact */
.contact-list {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

/* Blog */
.post-list {
  list-style: none;
  padding: 0;
  margin-top: 1.5rem;
}
.post-list li {
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}
.post-list time {
  display: block;
  color: var(--color-muted);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.post-list a {
  color: var(--color-text);
  font-weight: 600;
  font-size: 1.1rem;
}

article.post {
  padding: 3rem 1.5rem;
  max-width: 70ch;
  margin: 0 auto;
}
article.post time {
  color: var(--color-muted);
  display: block;
  margin-bottom: 1.5rem;
}
article.post h1 { margin-bottom: 0.25rem; }

/* Responsive nav */
@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .hero {
    text-align: center;
    flex-direction: column;
  }
  .hero-actions { justify-content: center; }
  .lead { max-width: none; }
  .book-layout { flex-direction: column; align-items: center; }
  .book-cover { width: 160px; }
  .milestone { flex-direction: column; }
  .milestone-photo { width: 100%; max-width: none; }
}
