  :root {
    --bg: #faf9f6;
    --surface: #f1efe9;
    --surface-2: #e9e6de;
    --ink: #1b1c19;
    --muted: #6b6c62;
    --accent: #2f6f5e;
    --accent-warm: #b97a3d;
    --accent-ink: #f4f8f6;
    --line: #ddd9cf;
    --font-display: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    scroll-behavior: smooth;
  }

  @media (prefers-reduced-motion: reduce) {
    :root { scroll-behavior: auto; }
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #14161a;
      --surface: #1b1e22;
      --surface-2: #24272c;
      --ink: #f1efe9;
      --muted: #9a9d95;
      --accent: #59b39a;
      --accent-warm: #e0a868;
      --accent-ink: #0d1613;
      --line: #2b2e32;
    }
  }

  :root[data-theme="dark"] {
    --bg: #14161a;
    --surface: #1b1e22;
    --surface-2: #24272c;
    --ink: #f1efe9;
    --muted: #9a9d95;
    --accent: #59b39a;
    --accent-warm: #e0a868;
    --accent-ink: #0d1613;
    --line: #2b2e32;
  }

  * { box-sizing: border-box; }

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

  .bg-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
  }

  a { color: inherit; }

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

  .wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 clamp(1.25rem, 5vw, 2.5rem);
  }

  h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 300;
    letter-spacing: -0.01em;
    text-wrap: balance;
    margin: 0;
  }

  .eyebrow {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
  }

  .eyebrow::before {
    content: "";
    width: 1.5em;
    height: 1px;
    background: var(--accent);
  }

  p { color: var(--muted); max-width: 62ch; }

  :focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
  }

  /* ---------- Nav ---------- */

  .nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 1.25rem 0;
    transition: background-color 0.4s ease, padding 0.4s ease, border-color 0.4s ease;
    border-bottom: 1px solid transparent;
  }

  .nav.is-scrolled {
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px);
    padding: 0.85rem 0;
    border-bottom-color: var(--line);
  }

  .nav .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .nav-mark {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.15rem;
    letter-spacing: 0.02em;
    text-decoration: none;
  }

  .nav-links {
    display: flex;
    gap: clamp(1rem, 2.5vw, 2rem);
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .nav-links a {
    font-size: 0.86rem;
    text-decoration: none;
    color: var(--muted);
    transition: color 0.2s ease;
    position: relative;
  }

  .nav-links a:hover, .nav-links a.is-active { color: var(--ink); }

  .nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    color: var(--ink);
    cursor: pointer;
  }

  @media (max-width: 760px) {
    .nav-links {
      position: fixed;
      top: 64px;
      right: 1.25rem;
      left: 1.25rem;
      background: var(--surface);
      border: 1px solid var(--line);
      border-radius: 14px;
      flex-direction: column;
      padding: 1rem 1.25rem;
      gap: 0.9rem;
      transform: translateY(-8px);
      opacity: 0;
      pointer-events: none;
      transition: all 0.25s ease;
    }
    .nav-links.is-open {
      transform: translateY(0);
      opacity: 1;
      pointer-events: auto;
    }
    .nav-toggle { display: block; }
  }

  /* ---------- Sections ---------- */

  section { padding: clamp(4.5rem, 12vh, 8rem) 0; position: relative; scroll-margin-top: 5rem; }

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

  .section-head { margin-bottom: clamp(2.25rem, 6vh, 3.5rem); max-width: 46rem; }

  .section-head h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); margin-top: 0.6rem; }

  /* ---------- Reveal ---------- */

  .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 0.7s ease, transform 0.7s ease;
  }

  .reveal.is-visible { opacity: 1; transform: translateY(0); }

  @media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
  }

  /* ---------- Hero ---------- */

  .hero {
    min-height: 100svh;
    display: flex;
    align-items: center;
    padding-top: 6rem;
    overflow: hidden;
  }

  .hero .wrap { position: relative; z-index: 1; }

  .hero h1 {
    font-size: clamp(2.5rem, 6.4vw, 4.6rem);
    line-height: 1.06;
    margin: 0.9rem 0 1.4rem;
    max-width: 18ch;
  }

  .hero h1 em {
    font-style: normal;
    font-weight: 500;
    color: var(--accent);
  }

  .hero p.lede {
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    max-width: 46ch;
  }

  .stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: clamp(1.5rem, 4vw, 3rem);
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
  }

  .stat-row dt {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
  }

  .stat-row dd {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: var(--muted);
  }

  .scroll-cue {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--muted);
    letter-spacing: 0.1em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .scroll-cue span {
    width: 1px;
    height: 28px;
    background: var(--muted);
    animation: cue 1.8s ease-in-out infinite;
  }

  @keyframes cue {
    0%, 100% { transform: scaleY(0.4); opacity: 0.4; }
    50% { transform: scaleY(1); opacity: 1; }
  }

  @media (prefers-reduced-motion: reduce) {
    .scroll-cue span { animation: none; }
  }

  /* ---------- Sobre ---------- */

  .about-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
  }

  .about-grid p { max-width: 60ch; margin-bottom: 1.1rem; }

  .about-aside {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
  }

  .fact-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.75rem;
  }

  .linkedin-badge-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    justify-content: center;
  }

  .linkedin-badge-card iframe { border-radius: 8px; }

  .linkedin-fallback-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 0;
  }

  .linkedin-fallback-link:hover { text-decoration: underline; }

  .fact-card dl { margin: 0; display: grid; gap: 1rem; }

  .fact-card dt {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .fact-card dd { margin: 0.2rem 0 0; font-size: 0.95rem; }

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

  /* ---------- Pilares ---------- */

  .pillar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: 18px;
    overflow: hidden;
  }

  .pillar {
    background: var(--bg);
    padding: clamp(1.75rem, 3vw, 2.5rem);
  }

  .pillar svg { color: var(--accent); margin-bottom: 1.25rem; }

  .pillar h3 { font-size: 1.15rem; margin-bottom: 0.6rem; }

  .pillar p { font-size: 0.92rem; margin: 0; }

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

  /* ---------- Timeline ---------- */

  .timeline { position: relative; padding-left: clamp(1.5rem, 4vw, 2.75rem); }

  .timeline-rail {
    position: absolute;
    top: 0.4rem;
    bottom: 0.4rem;
    left: clamp(1.5rem, 4vw, 2.75rem);
    width: 1px;
    background: var(--line);
  }

  .timeline-rail-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--accent);
    transition: height 0.15s linear;
  }

  .t-item {
    position: relative;
    padding: 1.1rem 0 1.1rem clamp(2rem, 5vw, 3rem);
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: 1rem 1.5rem;
  }

  .t-item::before {
    content: "";
    position: absolute;
    left: -0.3125rem;
    top: 1.5rem;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--muted);
    transition: border-color 0.4s ease, background 0.4s ease, transform 0.4s ease;
  }

  .t-item.is-visible::before {
    border-color: var(--accent);
    background: var(--accent);
    transform: scale(1.15);
  }

  .t-item + .t-item { border-top: 1px solid var(--line); }

  .t-when {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--muted);
    padding-top: 0.15rem;
    font-variant-numeric: tabular-nums;
  }

  .t-role { font-weight: 500; font-size: 1.02rem; }

  .t-org { color: var(--accent); font-weight: 500; }

  .t-desc { margin: 0.35rem 0 0; font-size: 0.9rem; }

  @media (max-width: 620px) {
    .t-item { grid-template-columns: 1fr; gap: 0.3rem; }
  }

  /* ---------- Career chart ---------- */

  .career-chart {
    width: 100%;
    overflow-x: auto;
    margin-bottom: clamp(2rem, 5vw, 3rem);
    -webkit-overflow-scrolling: touch;
  }

  .career-chart svg {
    display: block;
    width: 100%;
    min-width: 760px;
    height: auto;
  }

  .career-bar {
    fill: var(--accent);
    opacity: 0.5;
    transition: opacity 0.15s ease;
  }

  .career-bar:hover { opacity: 0.85; }

  .career-bar.is-current { opacity: 1; }

  .career-leader { stroke: var(--line); stroke-width: 1; }

  .career-dot { fill: var(--muted); }

  .career-label {
    font-family: var(--font-body);
    font-size: 11px;
    fill: var(--muted);
    font-weight: 500;
  }

  .career-label.is-current { fill: var(--accent); font-weight: 700; }

  .career-axis-line { stroke: var(--line); stroke-width: 1; }

  .career-axis-text {
    font-family: var(--font-mono);
    font-size: 11px;
    fill: var(--muted);
    font-variant-numeric: tabular-nums;
  }

  .career-tooltip {
    position: fixed;
    pointer-events: none;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
    line-height: 1.4;
    max-width: 240px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
    opacity: 0;
    transform: translate(-50%, -100%);
    transition: opacity 0.12s ease;
    z-index: 50;
  }

  .career-tooltip.is-visible { opacity: 1; }

  .career-tooltip strong { display: block; color: var(--ink); font-weight: 600; }

  .career-tooltip .ct-org { color: var(--accent); font-weight: 500; }

  .career-tooltip .ct-when {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
  }

  /* ---------- Destaques ---------- */

  .highlight-list { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }

  .highlight {
    background: var(--bg);
    padding: clamp(1.5rem, 3vw, 2.25rem);
    display: grid;
    grid-template-columns: 5rem 1fr;
    gap: 1.5rem;
    align-items: baseline;
  }

  .highlight .metric {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 1.05rem;
    font-variant-numeric: tabular-nums;
  }

  .highlight h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }

  .highlight p { margin: 0; font-size: 0.92rem; }

  @media (max-width: 560px) {
    .highlight { grid-template-columns: 1fr; gap: 0.4rem; }
  }

  /* ---------- Artigos ---------- */

  .carousel { display: flex; align-items: center; gap: 0.85rem; }

  .carousel-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 0.25rem 0.25rem 0.75rem;
    scrollbar-width: none;
  }

  .carousel-track::-webkit-scrollbar { display: none; }

  .article-card {
    flex: 0 0 clamp(260px, 80vw, 340px);
    scroll-snap-align: start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: border-color 0.25s ease, transform 0.25s ease;
  }

  .article-card:hover, .article-card:focus-visible {
    border-color: var(--accent);
    transform: translateY(-4px);
  }

  .article-cover {
    aspect-ratio: 7 / 3;
    background-color: var(--surface-2);
    background-size: cover;
    background-position: center;
  }

  .article-body {
    padding: 1.25rem 1.4rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    flex: 1;
  }

  .article-meta {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
  }

  .article-card h3 { font-size: 1.05rem; line-height: 1.32; font-weight: 400; }

  .article-card p {
    font-size: 0.86rem;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .article-cta {
    margin-top: auto;
    padding-top: 0.4rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
  }

  .article-cta svg { transition: transform 0.25s ease; }

  .article-card:hover .article-cta svg, .article-card:focus-visible .article-cta svg {
    transform: translateX(3px);
  }

  .carousel-btn {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
  }

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

  .carousel-btn:disabled { opacity: 0.3; cursor: default; }

  .carousel.no-scroll .carousel-btn { display: none; }

  .article-placeholder {
    flex: 1;
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.88rem;
  }

  @media (prefers-reduced-motion: reduce) {
    .carousel-track { scroll-behavior: auto; }
  }

  /* ---------- Formação ---------- */

  .edu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }

  .edu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.4rem; }

  .edu-list li { border-left: 2px solid var(--line); padding-left: 1rem; }

  .edu-when { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }

  .edu-what { font-weight: 500; margin: 0.15rem 0; }

  .edu-where { font-size: 0.88rem; color: var(--muted); }

  .cert-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.5rem 1rem;
    font-size: 0.82rem;
    margin-bottom: 1rem;
  }

  .word-cloud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem 1.1rem;
    margin-top: 1.5rem;
    text-align: center;
  }

  .tag {
    font-family: var(--font-display);
    line-height: 1.3;
    white-space: nowrap;
    display: inline-block;
    transform-origin: center;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease, opacity 0.3s ease;
  }

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

  .tag--xl { font-size: 1.7rem; font-weight: 500; color: var(--ink); }
  .tag--lg { font-size: 1.3rem; font-weight: 400; color: var(--ink); }
  .tag--md { font-size: 1rem; font-weight: 400; color: var(--muted); }
  .tag--sm { font-size: 0.82rem; font-weight: 300; color: var(--muted); }

  .tag:hover, .tag:focus-visible {
    color: var(--accent);
    transform: scale(1.16);
  }

  .word-cloud:has(.tag:hover) .tag:not(:hover),
  .word-cloud:has(.tag:focus-visible) .tag:not(:focus-visible) {
    opacity: 0.35;
    transform: scale(0.96);
  }

  @media (prefers-reduced-motion: reduce) {
    .tag { transition: color 0.3s ease; }
    .tag:hover, .tag:focus-visible { transform: none; }
    .word-cloud:has(.tag:hover) .tag:not(:hover),
    .word-cloud:has(.tag:focus-visible) .tag:not(:focus-visible) { transform: none; }
  }

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

  /* ---------- Contato ---------- */

  .contact-section { text-align: center; }

  .contact-section h2 { font-size: clamp(2rem, 4.5vw, 3.2rem); max-width: 20ch; margin: 0.75rem auto 1.5rem; }

  .contact-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2.25rem;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.5rem;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border: 1px solid var(--line);
    color: var(--ink);
    transition: border-color 0.2s ease, background 0.2s ease;
  }

  .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

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

  footer {
    padding: 2.5rem 0;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
  }
