/* ══════════════════════════════════════════
   Dr. Joaquim Lopes - Global Stylesheet
   ══════════════════════════════════════════ */

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

/* ── DESIGN TOKENS ── */
:root {
  --p:        #56697a;
  --p-dark:   #3d4f5c;
  --p-mid:    #7a8f9e;
  --p-light:  #c5cfd7;
  --p-muted:  #eef1f4;
  --dark:     #1d2832;
  --text:     #2d3d4a;
  --muted:    #6b7f8c;
  --white:    #ffffff;
  --bg:       #ffffff;
  --bg-alt:   #f8f9fb;
  --border:   #e8ecf0;
  --r:        16px;
  --r-sm:     10px;
  --shadow:   0 4px 24px rgba(86,105,122,.08);
  --shadow-h: 0 12px 48px rgba(86,105,122,.16);
  --nav-h:    96px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.15; font-weight: 700; }
img { display: block; max-width: 100%; }
a { color: inherit; }

/* ── LAYOUT ── */
.wrap { max-width: 1120px; margin: 0 auto; }
section { padding: 100px 48px; }

/* ════════════════════════════════
   NAV
════════════════════════════════ */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  height: var(--nav-h);
  padding: 0 48px;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(86,105,122,.08);
  transition: box-shadow .3s;
}
nav.scrolled { box-shadow: 0 4px 32px rgba(86,105,122,.10); }

.nav-logo {
  font-size: 17px; font-weight: 700; color: var(--dark);
  text-decoration: none; letter-spacing: -.3px; line-height: 1;
}
.nav-logo span { font-weight: 300; color: var(--p); }

.nav-logo img { width: 280px; height: 96px; object-fit: contain; }

.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a {
  font-size: 14px; font-weight: 500; color: var(--muted);
  text-decoration: none; transition: color .2s; position: relative;
}
.nav-links a:hover { color: var(--p); }
.nav-links a.active { color: var(--p); }
.nav-links a.active::after {
  content: ''; position: absolute; bottom: -4px; left: 0; right: 0;
  height: 2px; background: var(--p); border-radius: 2px;
}

.btn-nav {
  background: var(--p) !important;
  color: #fff !important;
  padding: 10px 22px;
  border-radius: 50px;
  font-weight: 600 !important;
  transition: background .2s, transform .2s !important;
}
.btn-nav:hover { background: var(--p-dark) !important; transform: translateY(-1px); }
.btn-nav::after { display: none !important; }

.nav-icons { display: flex; align-items: center; gap: 14px; }
.nav-icons a { color: var(--muted); transition: color .2s; line-height: 0; }
.nav-icons a:hover { color: var(--p); }

/* ── Hamburger (hidden on desktop) ── */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  cursor: pointer; padding: 4px;
  background: none; border: none;
}
.hamburger span { width: 22px; height: 2px; background: var(--p); border-radius: 2px; transition: all .3s ease; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Mobile drawer (hidden on desktop) ── */
.nav-drawer { display: none; }

/* ── Mobile overlay ── */
.nav-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  pointer-events: none;
}
.nav-overlay.open { opacity: 1; visibility: visible; pointer-events: auto; }

/* ════════════════════════════════
   BUTTONS
════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 15px 30px; border-radius: 50px; font-size: 16px;
  font-weight: 600; text-decoration: none; transition: all .3s ease;
  font-family: inherit; cursor: pointer; border: none;
}
.btn-primary {
  background: var(--p); color: #fff;
  box-shadow: 0 4px 20px rgba(86,105,122,.28);
}
.btn-primary:hover { background: var(--p-dark); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(86,105,122,.38); }
.btn-outline {
  background: transparent; color: var(--p);
  border: 2px solid var(--p-light);
}
.btn-outline:hover { border-color: var(--p); background: var(--p-muted); transform: translateY(-2px); }
.btn-sm { padding: 11px 22px; font-size: 14px; }

/* ════════════════════════════════
   TYPOGRAPHY HELPERS
════════════════════════════════ */
.eyebrow {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--p); text-transform: uppercase; letter-spacing: 1.8px;
  margin-bottom: 14px;
}
.section-title {
  font-size: 42px; font-weight: 800; color: var(--dark);
  letter-spacing: -1.5px; line-height: 1.1; margin-bottom: 20px;
}
.section-title em { font-style: normal; color: var(--p); }
.section-sub {
  font-size: 17px; color: var(--muted); line-height: 1.75;
  max-width: 520px; margin-bottom: 36px;
}
.section-head { text-align: center; margin-bottom: 64px; }
.section-head .section-sub { margin-left: auto; margin-right: auto; }

/* ════════════════════════════════
   PAGE HERO (inner pages)
════════════════════════════════ */
.page-hero {
  padding-top: calc(var(--nav-h) + 72px);
  padding-bottom: 72px;
  padding-left: 48px; padding-right: 48px;
  background: linear-gradient(145deg, var(--p-muted) 0%, #dce4ea 100%);
  position: relative; overflow: hidden;
}
.page-hero::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 48px;
  background: var(--bg);
  clip-path: ellipse(60% 100% at 50% 100%);
}
.page-hero-inner { max-width: 1120px; margin: 0 auto; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--p); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; }
.page-hero h1 { font-size: 48px; font-weight: 800; color: var(--dark); letter-spacing: -2px; margin-bottom: 14px; }
.page-hero h1 em { font-style: normal; color: var(--p); }
.page-hero p { font-size: 18px; color: var(--muted); max-width: 560px; line-height: 1.7; }

/* ════════════════════════════════
   TAGS
════════════════════════════════ */
.tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.tag {
  background: var(--white); border: 1px solid var(--border);
  color: var(--p); padding: 7px 16px; border-radius: 50px;
  font-size: 13px; font-weight: 600;
}

/* ════════════════════════════════
   TIMELINE
════════════════════════════════ */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 18px; padding-bottom: 24px; position: relative; }
.tl-item:not(:last-child)::before {
  content: ''; position: absolute; left: 13px; top: 30px; bottom: 0;
  width: 2px; background: var(--border);
}
.tl-dot {
  width: 28px; height: 28px; min-width: 28px; border-radius: 50%;
  background: var(--p-muted); border: 2px solid var(--p-light);
  display: flex; align-items: center; justify-content: center; position: relative; z-index: 1;
}
.tl-dot::after { content: ''; width: 9px; height: 9px; background: var(--p); border-radius: 50%; }
.tl-year { font-size: 12px; font-weight: 600; color: var(--p); letter-spacing: .4px; margin-bottom: 3px; }
.tl-text { font-size: 14px; font-weight: 600; color: var(--dark); line-height: 1.45; }

/* Fellow highlight */
.tl-highlight {
  background: linear-gradient(135deg, #f0f4f8 0%, #dce8f0 100%);
  border: 1.5px solid var(--p-light);
  border-radius: 12px;
  padding: 16px 18px 14px;
  margin-top: 4px;
}
.tl-highlight .tl-dot {
  background: var(--p); border-color: var(--p);
}
.tl-highlight .tl-dot::after {
  background: #fff;
}
.tl-highlight .tl-year {
  font-size: 13px; letter-spacing: .6px; text-transform: uppercase;
}
.tl-highlight .tl-text {
  font-size: 15px;
}
.tl-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  color: var(--p);
  background: rgba(86,105,122,.1);
  border-radius: 20px;
}

/* Fellow photo inside highlight */
.tl-highlight-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.tl-highlight-info { flex: 1; }
.tl-highlight-photo {
  width: 100%;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 4px;
}
.tl-highlight-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
}

/* ════════════════════════════════
   CONTACT ITEMS
════════════════════════════════ */
.contact-list { display: flex; flex-direction: column; gap: 24px; }
.ci { display: flex; align-items: flex-start; gap: 16px; }
.ci-icon {
  width: 48px; height: 48px; min-width: 48px; border-radius: 14px;
  background: var(--p-muted); display: flex; align-items: center; justify-content: center;
}
.ci-icon svg { width: 22px; height: 22px; stroke: var(--p); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ci-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 4px; }
.ci-val { font-size: 15px; font-weight: 600; color: var(--dark); text-decoration: none; line-height: 1.5; display: block; }
a.ci-val:hover { color: var(--p); }

/* ════════════════════════════════
   FORM
════════════════════════════════ */
.form-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--r); padding: 48px;
  box-shadow: var(--shadow);
}
.form-card h3 { font-size: 24px; color: var(--dark); margin-bottom: 6px; }
.form-card > p { font-size: 14px; color: var(--muted); margin-bottom: 32px; }

/* ════════════════════════════════
   FOOTER
════════════════════════════════ */
footer { background: var(--dark); color: rgba(255,255,255,.65); padding: 72px 48px 40px; }
.footer-inner { max-width: 1120px; margin: 0 auto; }
.footer-top {
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 60px;
  padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-logo { font-size: 18px; font-weight: 700; color: #fff; text-decoration: none; display: block; margin-bottom: 14px; }
.footer-logo span { font-weight: 300; color: rgba(255,255,255,.55); }
.footer-logo img { width: 280px; height: 96px; object-fit: contain; filter: brightness(0) invert(1); }
.footer-desc { font-size: 14px; line-height: 1.75; max-width: 280px; margin-bottom: 16px; }
.footer-crm { font-size: 12px; color: rgba(255,255,255,.35); }
.footer-col-h { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 18px; }
.footer-nav { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.footer-nav a { font-size: 14px; color: rgba(255,255,255,.55); text-decoration: none; transition: color .2s; }
.footer-nav a:hover { color: #fff; }
.footer-contact-line { font-size: 14px; color: rgba(255,255,255,.55); margin-bottom: 11px; line-height: 1.5; }
.footer-contact-line a { color: rgba(255,255,255,.55); text-decoration: none; transition: color .2s; }
.footer-contact-line a:hover { color: #fff; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 32px; }
.footer-copy { font-size: 13px; color: rgba(255,255,255,.35); }
.footer-social { display: flex; gap: 16px; }
.footer-social a { color: rgba(255,255,255,.45); line-height: 0; transition: color .2s; }
.footer-social a:hover { color: #fff; }

/* ════════════════════════════════
   REVEAL ANIMATION
════════════════════════════════ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .65s ease, transform .65s ease; }
.reveal.visible { opacity: 1; transform: none; }
.d1 { transition-delay: .1s; }
.d2 { transition-delay: .2s; }
.d3 { transition-delay: .3s; }
.d4 { transition-delay: .4s; }

/* ════════════════════════════════
   CTA STRIP
════════════════════════════════ */
.cta-strip {
  background: var(--p); padding: 80px 48px; text-align: center;
}
.cta-strip h2 { font-size: 36px; font-weight: 800; color: #fff; letter-spacing: -1px; margin-bottom: 14px; }
.cta-strip p { font-size: 17px; color: rgba(255,255,255,.75); margin-bottom: 36px; }
.btn-white { background: #fff; color: var(--p); }
.btn-white:hover { background: var(--p-muted); color: var(--p-dark); transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,.15); }

/* ════════════════════════════════
   RESPONSIVE
════════════════════════════════ */
@media (max-width: 1024px) {
  nav { padding: 0 24px; }
  section { padding: 80px 24px; }
  footer { padding: 64px 24px 40px; }
  .page-hero { padding-left: 24px; padding-right: 24px; }
  .cta-strip { padding: 64px 24px; }
  .section-title { font-size: 36px; }
  .page-hero h1 { font-size: 40px; }
}

@media (max-width: 768px) {

  /* ── Nav bar ── */
  nav { height: 72px; padding: 0 20px; }
  .nav-logo img { width: 180px; height: 72px; }
  .desktop-only { display: none !important; }
  .hamburger { display: flex; }

  /* ── Drawer (outside nav, no stacking-context trap) ── */
  .nav-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 280px; max-width: 82vw;
    background: #fff;
    padding: 88px 28px 32px;
    z-index: 1001;
    list-style: none;
    box-shadow: -4px 0 32px rgba(0,0,0,.15);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .35s cubic-bezier(.4,0,.2,1), visibility .35s;
    overflow-y: auto;
  }
  .nav-drawer.open {
    transform: translateX(0);
    visibility: visible;
  }

  /* ── Drawer links ── */
  .nav-drawer li {
    border-bottom: 1px solid var(--border);
  }
  .nav-drawer a {
    display: block;
    padding: 16px 4px;
    font-size: 16px; font-weight: 600;
    color: var(--dark);
    text-decoration: none;
    transition: color .2s;
  }
  .nav-drawer a:hover { color: var(--p); }
  .nav-drawer a.active { color: var(--p); }

  /* ── CTA button ── */
  .nav-drawer-cta {
    border-bottom: none !important;
    padding-top: 16px;
  }
  .nav-drawer .btn-nav {
    display: block; text-align: center;
    padding: 14px 22px; border-radius: 50px;
    font-size: 15px !important;
  }

  /* ── Social icons at drawer bottom ── */
  .nav-drawer-social {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px 4px 0;
    margin-top: auto;
    border-top: 1px solid var(--border);
    border-bottom: none !important;
  }
  .nav-drawer-social a {
    display: inline-flex;
    padding: 0;
    color: var(--muted);
    line-height: 0;
  }
  .nav-drawer-social a:hover { color: var(--p); }

  /* ── Page layout ── */
  section { padding: 64px 20px; }
  .page-hero {
    padding-left: 20px; padding-right: 20px;
    padding-top: calc(72px + 48px);
    padding-bottom: 56px;
  }
  .page-hero h1 { font-size: 32px; letter-spacing: -1px; }
  .page-hero p { font-size: 16px; }
  .section-title { font-size: 30px; letter-spacing: -1px; }
  .footer-top { grid-template-columns: 1fr; gap: 36px; }
  .footer-bottom { flex-direction: column; gap: 16px; }
  .cta-strip { padding: 56px 20px; }
  .cta-strip h2 { font-size: 28px; }
  .form-card { padding: 28px 20px; }
  .footer-logo img { width: 150px; height: 51px; }
}
