/* =========================================================================
   João Carlos Verde — light-mode redesign, calmer pass
   White/paper background, burnt-orange accent, all-sans typography
   (Sora for display/headings, Inter for body). No serif, anywhere.
   Full-viewport photo hero with dark overlay for legibility.
   Design note: kept deliberately quiet — one border per card, shadows only
   on hover, accent color used sparingly rather than on every element.
   ========================================================================= */

:root {
  --bg: #ffffff;
  --bg-raised: #ffffff;
  --bg-raised-2: #f4f4f4;
  --ink: #17171a;
  --muted: #64646a;
  --line: #e4e4e4;
  --accent: #d8631f;
  --accent-bright: #e8793a;
  --accent-text: #a34c17;
  --accent-dim: rgba(216, 99, 31, 0.09);
  --black: #0a0a0c;
  --white: #ffffff;
  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(20, 16, 8, 0.05);
  --shadow-md: 0 10px 26px rgba(20, 16, 8, 0.12);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Sora", "Inter", -apple-system, sans-serif;
  --container-w: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--black);
  line-height: 1.15;
  margin: 0 0 0.5em;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 4vw, 2.5rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.08rem; }

p { margin: 0 0 1em; color: var(--ink); }

strong { color: var(--black); font-weight: 600; }

.container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 88px 0; }
.section + .section { border-top: 1px solid var(--line); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-text);
  margin: 0 0 0.7em;
}

.lead { font-size: 1.2rem; color: var(--muted); max-width: 60ch; }

.accent { color: var(--accent); }

hr { border: none; border-top: 1px solid var(--line); margin: 2em 0; }

/* ---------------------------------------------------------------------- */
/* Header / navigation                                                    */
/* ---------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.site-nav a {
  display: inline-block;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  padding: 6px 14px;
  border-radius: var(--radius);
  transition: background 0.15s ease, color 0.15s ease;
}
.site-nav a:hover { background: var(--bg-raised-2); color: var(--black); }
.site-nav a.active { color: var(--accent-text); background: none; font-weight: 700; }

.nav-toggle {
  display: none;
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 15px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--black);
  border-radius: 2px;
}

/* ---------------------------------------------------------------------- */
/* Buttons — quiet by default, one solid accent style for primary CTAs    */
/* ---------------------------------------------------------------------- */

.button, .button:link, .button:visited {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: none;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
  border: 1px solid var(--line);
  margin: 4px 8px 4px 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.button:hover { border-color: var(--accent-text); color: var(--accent-text); }
.button.button-gold {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
  font-weight: 600;
}
.button.button-gold:hover { background: var(--accent-bright); border-color: var(--accent-bright); color: var(--white); }
.button.button-outline {
  background: transparent;
  border-color: rgba(255,255,255,0.55);
  color: var(--white);
}
.button.button-outline:hover { background: rgba(255,255,255,0.12); border-color: var(--white); color: var(--white); }
.button ion-icon { font-size: 1.05em; }

/* ---------------------------------------------------------------------- */
/* Hero (home) — full-viewport photo background                          */
/* ---------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center center;
  background-color: var(--black);
  color: var(--white);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10,10,12,0.12) 0%, rgba(10,10,12,0.05) 28%, rgba(10,10,12,0.55) 62%, rgba(10,10,12,0.93) 100%);
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  padding: 40px 0 88px;
  width: 100%;
}

.hero-text { max-width: 640px; }
.hero-text .eyebrow { color: var(--accent-bright); }
.hero h1 { color: var(--white); }
.hero-role { font-size: 1.1rem; color: var(--accent-bright); font-family: var(--font-display); font-weight: 600; margin-bottom: 1em; }
.hero-text p.lead { color: rgba(255,255,255,0.82); }

.hero-cta { margin-top: 1.6em; }

/* ---------------------------------------------------------------------- */
/* Page hero (about / blog / contact banners)                             */
/* ---------------------------------------------------------------------- */

.page-hero {
  background: var(--bg-raised-2);
  color: var(--black);
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--line);
}
.page-hero h1 { color: var(--black); }
.page-hero .lead { color: var(--muted); }
.page-hero .eyebrow { color: var(--accent-text); }

/* ---------------------------------------------------------------------- */
/* Highlight stat cards (home) — quiet tinted panels, not solid blocks    */
/* ---------------------------------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.stat-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 28px 24px;
}
.stat-card .stat-number {
  font-family: var(--font-display);
  font-size: 2.4rem;
  color: var(--accent-text);
  font-weight: 700;
  display: block;
  margin-bottom: 0.25em;
  letter-spacing: -0.02em;
}
.stat-card p { color: var(--muted); margin: 0; }

/* ---------------------------------------------------------------------- */
/* Generic content cards / boxes (experience, education)                  */
/* ---------------------------------------------------------------------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

.info-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  height: 100%;
}
.info-card .icon-badge {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.info-card .icon-badge img { width: 100%; height: 100%; object-fit: contain; }
.info-card small { color: var(--accent-text); font-weight: 600; font-size: 0.75rem; }
.info-card h4 { margin-top: 0.3em; }

.timeline-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin-bottom: 20px;
}
.timeline-card .timeline-date {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-dim);
  padding: 4px 11px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.timeline-card h4 { margin-bottom: 0.3em; }
.timeline-card .org-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  float: left;
  margin: 2px 14px 8px 0;
}

.doc-links { margin-top: 16px; }
.doc-links strong { display: block; margin-bottom: 8px; font-size: 0.88rem; color: var(--muted); font-weight: 500; }

/* Media-review two-photo layout on About page */
.review-photos {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 20px;
}
.review-photo { padding: 4px 0; }
.review-photo img { border-radius: var(--radius); margin-top: 12px; }
.review-photo .flag { width: 26px; height: 26px; float: left; margin-right: 10px; }

/* ---------------------------------------------------------------------- */
/* Talk / publication cards (About page)                                  */
/* ---------------------------------------------------------------------- */

.talk-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.talk-card:hover { box-shadow: var(--shadow-md); border-color: var(--line); }
.talk-card img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.talk-card .talk-body { padding: 24px 26px 28px; flex: 1; display: flex; flex-direction: column; }
.talk-card .tag-date {
  display: inline-block;
  align-self: flex-start;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0;
  margin-bottom: 10px;
}
.talk-card .talk-actions { margin-top: auto; padding-top: 10px; }

/* ---------------------------------------------------------------------- */
/* Blog: post cards + grid + tag filters                                  */
/* ---------------------------------------------------------------------- */

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.post-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.post-card:hover { box-shadow: var(--shadow-md); border-color: var(--accent); }
.post-card-media { display: block; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-raised-2); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { padding: 22px 24px 26px; display: flex; flex-direction: column; flex: 1; }
.post-card h3 { font-size: 1.15rem; margin-bottom: 0.4em; }
.post-card h3 a { color: var(--black); }
.post-card-link { font-weight: 600; font-size: 0.85rem; margin-top: auto; color: var(--accent-text); }

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.post-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  display: inline-block;
  color: var(--accent-text);
  font-size: 0.75rem;
  font-weight: 600;
}
.tag:not(:last-child)::after { content: "\00b7"; margin-left: 6px; color: var(--muted); }

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 36px;
}
.tag-filter {
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tag-filter:hover { border-color: var(--accent-text); color: var(--ink); }
.tag-filter.active { background: var(--ink); border-color: var(--ink); color: var(--white); }

/* ---------------------------------------------------------------------- */
/* Single blog post page                                                  */
/* ---------------------------------------------------------------------- */

.post { padding-bottom: 72px; }
.post-container { max-width: 720px; }
.back-link { display: inline-block; font-size: 0.85rem; font-weight: 600; margin: 32px 0 20px; color: var(--muted); }
.back-link:hover { color: var(--accent-text); }
.post h1 { margin-top: 0.2em; }
.post-cover { margin: 28px 0; }
.post-cover img { border-radius: var(--radius); width: 100%; aspect-ratio: 16/7; object-fit: cover; }
.post-body { font-size: 1.08rem; }
.post-body h2 { margin-top: 1.5em; }
.post-body h3 { margin-top: 1.3em; }
.post-body img { border-radius: var(--radius); margin: 1.3em 0; }
.post-body blockquote {
  border-left: 2px solid var(--accent);
  margin: 1.5em 0;
  padding: 0.2em 0 0.2em 1.2em;
  color: var(--muted);
  font-style: italic;
}
.post-body code {
  background: var(--bg-raised-2);
  color: var(--accent-text);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.post-body pre {
  background: var(--black);
  color: var(--white);
  padding: 18px;
  border-radius: var(--radius);
  overflow-x: auto;
}
.post-body pre code { background: none; padding: 0; color: inherit; }
.post-body .footnote-ref { font-size: 0.75em; font-weight: 600; margin-left: 1px; }
.post-body .footnote-ref a { color: var(--accent-text); }
.post-body .footnotes { margin-top: 2.5em; font-size: 0.92rem; color: var(--muted); }
.post-body .footnotes hr { margin: 0 0 1.4em; }
.post-body .footnotes ol { padding-left: 1.2em; margin: 0; }
.post-body .footnotes li { margin-bottom: 0.6em; }
.post-body .footnotes p { display: inline; margin: 0; color: var(--muted); }
.post-body .footnote-backref { font-size: 0.85em; margin-left: 4px; }
.post-extras { margin-top: 2em; padding-top: 1.4em; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------------- */
/* Contact page                                                           */
/* ---------------------------------------------------------------------- */

.contact-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
  max-width: 560px;
}
.contact-card .contact-hint {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--black);
  background: var(--bg-raised-2);
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 1em 0;
}
.contact-social { margin-top: 1.6em; }
.contact-social a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--accent-text);
}

/* ---------------------------------------------------------------------- */
/* Footer                                                                 */
/* ---------------------------------------------------------------------- */

.site-footer {
  background: var(--black);
  color: rgba(255,255,255,0.7);
  padding: 48px 0 20px;
  margin-top: 40px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 24px;
}
.footer-brand .brand-name { color: var(--white); font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; letter-spacing: -0.01em; }
.footer-brand p { color: rgba(255,255,255,0.55); font-size: 0.88rem; margin-top: 4px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,0.75); font-size: 0.85rem; font-weight: 500; }
.footer-links a:hover { color: var(--accent-bright); }
.footer-social a { color: var(--white); font-size: 1.1rem; display: inline-flex; align-items: center; }
.footer-social a:hover { color: var(--accent-bright); }
.icon-x svg { display: block; }
.footer-copy { font-size: 0.8rem; color: rgba(255,255,255,0.4); border-top: 1px solid rgba(255,255,255,0.12); padding-top: 16px; }

/* ---------------------------------------------------------------------- */
/* Dark band section (About > Recent experience)                          */
/* Selectors below repeat the :link/:visited/:hover pseudo-classes used by */
/* the base .button rules so they win on specificity, not just source     */
/* order — that's what caused the earlier readability regression.         */
/* ---------------------------------------------------------------------- */

.section.section-dark { background: var(--black); border-top: none; }
.section-dark .eyebrow { color: var(--accent-bright); }
.section-dark h1, .section-dark h2, .section-dark h3, .section-dark h4 { color: var(--white); }
.section-dark p { color: rgba(255, 255, 255, 0.75); }
.section-dark strong { color: var(--white); }
.section-dark a, .section-dark a:link, .section-dark a:visited { color: var(--accent-bright); }
.section-dark a:hover { color: var(--white); }
.section-dark .timeline-card { background: #17171a; border-color: #2c2c2c; }
.section-dark .timeline-card .timeline-date { background: rgba(232, 121, 58, 0.16); color: var(--accent-bright); }
.section-dark .org-logo { background: var(--white); border-radius: 4px; padding: 4px; }
.section-dark .doc-links strong { color: rgba(255, 255, 255, 0.55); }
.section-dark .button,
.section-dark .button:link,
.section-dark .button:visited {
  background: #1f1f22;
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--white);
}
.section-dark .button:hover { border-color: var(--accent-bright); color: var(--accent-bright); }
.section-dark .button.button-gold,
.section-dark .button.button-gold:link,
.section-dark .button.button-gold:visited {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}
.section-dark .button.button-gold:hover { background: var(--accent-bright); border-color: var(--accent-bright); }

/* ---------------------------------------------------------------------- */
/* Responsive                                                             */
/* ---------------------------------------------------------------------- */

@media (max-width: 900px) {
  .hero { min-height: 92vh; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .post-grid { grid-template-columns: 1fr 1fr; }
  .review-photos { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute;
    top: 44px;
    left: 0;
    right: 0;
    background: var(--bg);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }
  .site-nav.open { max-height: 320px; }
  .site-nav ul { flex-direction: column; padding: 8px 24px 20px; gap: 4px; align-items: center; }
  .site-nav a { padding: 12px 8px; }

  .hero { min-height: 88vh; }
  .hero::before {
    background:
      linear-gradient(180deg, rgba(10,10,12,0.08) 0%, rgba(10,10,12,0.04) 20%, rgba(10,10,12,0.68) 48%, rgba(10,10,12,0.97) 100%);
  }
  .hero-inner { padding: 16px 0 32px; }
  .hero-text .eyebrow { font-size: 0.7rem; margin-bottom: 0.4em; }
  .hero h1 { font-size: clamp(1.9rem, 9vw, 2.6rem); margin-bottom: 0.2em; }
  .hero-role { font-size: 0.92rem; margin-bottom: 0.6em; }
  .hero-text .lead { font-size: 0.92rem; margin-bottom: 0.9em; }
  .hero-cta { margin-top: 0.8em; }
  .hero-cta .button { padding: 9px 15px; font-size: 0.75rem; margin: 3px 6px 3px 0; }

  .stat-grid { grid-template-columns: 1fr; }
  .card-grid, .card-grid.cols-2 { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .contact-card { padding: 28px; }
  .footer-inner { flex-direction: column; }
}
