/* ======================================================================
   PRESENCE.UFABC — sistema visual
   Direção: editorial acadêmico contemporâneo + minimalismo tecnológico.
   Para personalizar, altere as variáveis em :root ou os atributos do body.
   ====================================================================== */

:root {
  color-scheme: light;
  /* Identidade */
  --brand: #006b45;
  --brand-strong: #005238;
  --brand-soft: #e8f3ed;
  --accent: #e0b600;
  --ink: #17231e;
  --muted: #64736b;
  --line: #dce5df;
  --paper: #f5f8f6;
  --surface: #ffffff;
  --surface-soft: #edf3ef;

  /* Forma e escala */
  --content-width: 1120px;
  --reading-width: 760px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --shadow-soft: 0 12px 34px rgb(23 35 30 / 6%);
  --shadow-hover: 0 18px 42px rgb(23 35 30 / 11%);
  --space-section: clamp(3.5rem, 7vw, 6.5rem);

  /* Tipografia: usa fontes locais do sistema; não depende de CDN. */
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }
button, a { -webkit-tap-highlight-color: transparent; }
::selection { color: #fff; background: var(--brand); }

.skip-link {
  position: absolute; z-index: 1000; top: 0.75rem; left: 0.75rem;
  padding: 0.7rem 1rem; transform: translateY(-160%);
  border-radius: 999px; background: var(--ink); color: #fff;
}
.skip-link:focus { transform: translateY(0); }

.container { width: min(var(--content-width), calc(100% - 2.5rem)); margin-inline: auto; }
.reading-width { max-width: var(--reading-width); }
.section { padding-block: var(--space-section); }
.section--compact { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--white { background: var(--surface); }
.section-heading { max-width: 760px; margin-bottom: 2.2rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.65rem;
  margin: 0 0 0.9rem; color: var(--brand); font-size: 0.76rem;
  font-weight: 750; letter-spacing: 0.13em; line-height: 1.4; text-transform: uppercase;
}
.eyebrow::before { width: 25px; height: 2px; content: ""; background: var(--accent); }

h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.16; letter-spacing: -0.035em; }
h1 { margin-bottom: 1.15rem; font-size: clamp(2.65rem, 6vw, 5.1rem); font-weight: 760; }
h2 { margin-bottom: 1rem; font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 730; }
h3 { margin-bottom: 0.65rem; font-size: clamp(1.15rem, 2vw, 1.42rem); font-weight: 700; }
h4 { margin-bottom: 0.5rem; font-size: 1.05rem; }
p { margin-bottom: 1rem; color: var(--muted); }
strong { color: var(--ink); font-weight: 700; }
.lead { max-width: 760px; color: var(--muted); font-size: clamp(1.08rem, 2vw, 1.3rem); line-height: 1.7; }
.small { font-size: 0.9rem; }

/* Cabeçalho e navegação */
.site-header {
  position: sticky; z-index: 50; top: 0;
  border-bottom: 1px solid rgb(220 229 223 / 80%);
  background: rgb(255 255 255 / 90%);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.header-inner { display: flex; min-height: 78px; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.85rem; color: var(--ink); text-decoration: none; }
.brand img { width: 116px; max-height: 48px; object-fit: contain; }
.brand-copy { display: grid; gap: 0.08rem; line-height: 1.2; }
.brand-copy strong { font-size: 0.98rem; letter-spacing: -0.025em; }
.brand-copy span { color: var(--muted); font-size: 0.72rem; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 0.35rem; }
.site-nav a { padding: 0.55rem 0.75rem; border-radius: 999px; color: var(--muted); font-size: 0.88rem; font-weight: 620; text-decoration: none; transition: color .2s ease, background .2s ease; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }

/* Abertura */
.hero { position: relative; overflow: hidden; padding-block: clamp(4.5rem, 10vw, 8.5rem); background: var(--surface); }
.hero::after {
  position: absolute; top: -190px; right: -150px; width: 520px; height: 520px;
  border: 1px solid rgb(0 107 69 / 10%); border-radius: 50%; content: ""; pointer-events: none;
  box-shadow: 0 0 0 48px rgb(0 107 69 / 2%), 0 0 0 96px rgb(0 107 69 / 1.5%);
}
.hero-content { position: relative; z-index: 1; max-width: 900px; }
.hero h1 span { color: var(--brand); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.button {
  display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 0.78rem 1.15rem; border: 1px solid var(--brand); border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 0.92rem; font-weight: 700;
  text-decoration: none; transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.button:hover { transform: translateY(-2px); background: var(--brand-strong); color: #fff; box-shadow: var(--shadow-soft); }
.button--secondary { border-color: var(--line); background: transparent; color: var(--ink); }
.button--secondary:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }

/* Cartões, grades e conteúdo */
.grid { display: grid; gap: 1.15rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  min-width: 0; padding: clamp(1.35rem, 3vw, 2rem); border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-soft);
}
.card--quiet { background: var(--surface-soft); box-shadow: none; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card-kicker { margin-bottom: 0.6rem; color: var(--brand); font-size: 0.76rem; font-weight: 760; letter-spacing: .09em; text-transform: uppercase; }
.card-link { display: inline-flex; align-items: center; gap: .4rem; margin-top: .7rem; font-weight: 700; text-decoration: none; }
.card-link::after { content: "↗"; transition: transform .2s ease; }
.card-link:hover::after { transform: translate(2px, -2px); }

.callout {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1.5rem;
  padding: clamp(1.5rem, 4vw, 2.4rem); border: 1px solid #cddfd3; border-radius: var(--radius-lg);
  background: linear-gradient(120deg, #edf6f0, #fff 72%);
}
.callout p:last-child { margin-bottom: 0; }

/* Listas */
.clean-list, .project-list, .people-list { margin: 0; padding: 0; list-style: none; }
.clean-list li { position: relative; margin: .65rem 0; padding-left: 1.35rem; color: var(--muted); }
.clean-list li::before { position: absolute; top: .78em; left: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); content: ""; }
.project-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .7rem; counter-reset: project; }
.project-list li { display: flex; min-height: 105px; flex-direction: column; justify-content: space-between; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-weight: 680; }
.project-list li::before { counter-increment: project; content: "0" counter(project); color: var(--brand); font-size: .75rem; font-weight: 800; letter-spacing: .08em; }
.people-list { display: grid; gap: .9rem; }
.people-list li { padding-bottom: .85rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.people-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.people-list a { font-weight: 650; }

/* Imagens: moldura e tratamento visual são independentes do arquivo original.
   Mude body[data-image-style] para aplicar um tratamento global; use
   data-image-treatment em uma figura para personalizar uma imagem específica. */
.visual {
  position: relative; overflow: hidden; margin: 0; border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-soft);
}
.visual img { width: 100%; height: auto; transition: filter .35s ease, transform .5s ease; }
.visual--padded { padding: clamp(.65rem, 2vw, 1.25rem); }
.visual--diagram img { object-fit: contain; }
.visual--cover { aspect-ratio: 16 / 9; }
.visual--cover img { width: 100%; height: 100%; object-fit: cover; }
.visual figcaption { padding: .85rem 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.visual--hover:hover img { transform: scale(1.018); }

/* Tratamentos globais opcionais para imagens dentro de .visual */
body[data-image-style="natural"] .visual img { filter: none; }
body[data-image-style="editorial"] .visual img { filter: grayscale(.72) contrast(1.08); }
body[data-image-style="monochrome"] .visual img { filter: grayscale(1) contrast(1.08); }
body[data-image-style="soft"] .visual img { filter: saturate(.72) contrast(.96) brightness(1.035); }
body[data-image-style="cool"] .visual img { filter: saturate(.78) hue-rotate(12deg) contrast(1.04); }
/* Sobrescreve a configuração global apenas nesta imagem. */
.visual[data-image-treatment="natural"] img { filter: none; }
.visual[data-image-treatment="editorial"] img { filter: grayscale(.72) contrast(1.08); }
.visual[data-image-treatment="monochrome"] img { filter: grayscale(1) contrast(1.08); }
.visual[data-image-treatment="soft"] img { filter: saturate(.72) contrast(.96) brightness(1.035); }
.visual[data-image-treatment="cool"] img { filter: saturate(.78) hue-rotate(12deg) contrast(1.04); }

/* Publicações */
.publication-year { margin: 2.5rem 0 1rem; color: var(--brand); font-size: 1.35rem; font-weight: 780; letter-spacing: -.03em; }
.publication-list { display: grid; gap: .8rem; margin: 0; padding: 0; list-style: none; }
.publication-list li { padding: 1.15rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); }
.publication-list strong { display: block; margin-bottom: .28rem; }

/* Rodapé e páginas internas */
.page-hero { padding-block: clamp(3.5rem, 7vw, 5.8rem); background: var(--surface); }
.page-hero h1 { max-width: 920px; font-size: clamp(2.3rem, 5vw, 4rem); }
.breadcrumb { margin-bottom: 1.2rem; color: var(--muted); font-size: .88rem; }
.breadcrumb a { text-decoration: none; }
.site-footer { padding-block: 2.3rem; border-top: 1px solid var(--line); background: #eef3ef; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-inner p { margin: 0; font-size: .84rem; }
.footer-brand { color: var(--ink); font-weight: 700; }
.contact-link { overflow-wrap: anywhere; }

/* Pequenos detalhes e acessibilidade */
hr { height: 1px; margin: 2rem 0; border: 0; background: var(--line); }
:focus-visible { outline: 3px solid rgb(0 107 69 / 45%); outline-offset: 3px; }
@media (hover: hover) {
  .card { transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease; }
  .card:hover { transform: translateY(-3px); border-color: #c8d9ce; box-shadow: var(--shadow-hover); }
}

@media (max-width: 800px) {
  .header-inner { min-height: auto; flex-direction: column; align-items: flex-start; padding-block: .9rem; }
  .site-nav { justify-content: flex-start; margin-inline: -.45rem; }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .callout { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .container { width: min(var(--content-width), calc(100% - 1.35rem)); }
  body { font-size: 15px; }
  .brand img { width: 92px; }
  .brand-copy span { max-width: 205px; }
  .site-nav { gap: .1rem; }
  .site-nav a { padding: .45rem .58rem; font-size: .8rem; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .project-list { grid-template-columns: 1fr 1fr; }
  .hero::after { right: -360px; }
  .hero-actions .button { width: 100%; }
  .footer-inner { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Diagrama de projetos — mapa de ecossistema editável em HTML + SVG. */
.u-mt-md { margin-top: 1.2rem; }
.u-mt-lg { margin-top: 2rem; }
.diagram-section { min-width: 0; }
.project-map {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 250px) minmax(0, 1fr);
  grid-template-rows: 112px 224px 112px;
  align-items: center;
  gap: 16px 28px;
  min-height: 528px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid #d8e5dc;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(ellipse at 50% 49%, rgb(224 239 229 / 76%) 0, rgb(245 249 246 / 62%) 28%, transparent 67%),
    radial-gradient(#d9e7de 0.8px, transparent 0.8px) 0 0 / 19px 19px,
    linear-gradient(145deg, #fbfdfb 0%, #f5f9f6 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 90%);
}
.project-map::before {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  width: min(36%, 350px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border: 1px solid rgb(0 107 69 / 8%);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgb(0 107 69 / 2%), 0 0 0 48px rgb(0 107 69 / 1.6%);
  content: "";
  pointer-events: none;
}
.project-map__connections {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.project-map__paths { opacity: .95; }
.project-map__junctions { filter: drop-shadow(0 2px 3px rgb(0 64 42 / 12%)); }
.project-node {
  position: relative;
  z-index: 1;
  display: flex;
  width: min(100%, 330px);
  justify-self: center;
  min-width: 0;
  min-height: 112px;
  flex-direction: column;
  justify-content: space-between;
  gap: .7rem;
  padding: 1rem 1.15rem;
  border: 1px solid #d6e4db;
  border-radius: 17px;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 9px 26px rgb(22 61 42 / 5%), 0 1px 2px rgb(22 61 42 / 3%);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.project-node__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
}
.project-node__number {
  color: #8aa797;
  font-size: .7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .08em;
}
.project-node__type {
  color: var(--brand);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.project-node__main {
  display: flex;
  align-items: center;
  gap: .85rem;
  min-width: 0;
}
.project-node__icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid #e0ece4;
  border-radius: 13px;
  background: #f0f7f2;
  color: var(--brand);
}
.project-node__icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.project-node strong {
  color: #1b2c23;
  font-size: .98rem;
  font-weight: 720;
  line-height: 1.32;
  letter-spacing: -.025em;
  text-align: left;
}
.project-node--telepresence { grid-area: 1 / 1; }
.project-node--rover { grid-area: 1 / 3; }
/* min-height: 154px; */
.project-node--voicebot { grid-area: 2 / 1 }
.project-node--immersive { grid-area: 2 / 3}

.project-node--modules { grid-area: 3 / 2; }
.project-hub {
  position: relative;
  z-index: 2;
  display: flex;
  grid-area: 2 / 2;
  width: 224px;
  height: 224px;
  justify-self: center;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .48rem;
  padding: 1.2rem;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 50%;
  background: linear-gradient(148deg, #087a50 0%, #006342 58%, #00563b 100%);
  color: #fff;
  text-align: center;
  box-shadow: 0 18px 36px rgb(0 76 51 / 19%), inset 0 1px 0 rgb(255 255 255 / 18%);
}
.project-hub::before {
  position: absolute;
  inset: 8px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}
.project-hub__eyebrow {
  color: #d5eee1;
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .15em;
  text-transform: uppercase;
}
.project-hub__symbol {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 26%);
  border-radius: 50%;
  background: rgb(255 255 255 / 9%);
  color: #fff;
}
.project-hub__symbol svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.35; }
.project-hub strong {
  color: #fff;
  font-size: clamp(1.02rem, 1.8vw, 1.22rem);
  font-weight: 760;
  line-height: 1.22;
  letter-spacing: -.025em;
}
.project-hub__caption {
  color: #c3e2d1;
  font-size: .7rem;
  font-weight: 550;
  letter-spacing: .025em;
}
.project-map__note {
  position: absolute;
  right: 1.25rem;
  bottom: .75rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  color: #7a8b81;
  font-size: .72rem;
  font-weight: 650;
  letter-spacing: .015em;
}
.project-map__note span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgb(0 107 69 / 10%);
}
@media (hover: hover) {
  .project-node:hover {
    transform: translateY(-3px);
    border-color: #a9cbb7;
    box-shadow: 0 16px 32px rgb(22 61 42 / 10%);
  }
  .project-node:hover .project-node__icon {
    border-color: #c6dfd0;
    background: #e6f2ea;
  }
}
.tech-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.tech-card {
  padding: clamp(1.2rem, 2.6vw, 1.8rem); border: 1px solid var(--line);
  border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-soft);
}
.tech-card h3 { min-height: 2.5em; }
.tech-card .clean-list { margin-top: 1rem; }
.tech-card .clean-list li { font-size: .94rem; }
@media (max-width: 900px) {
  .project-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: .85rem;
    min-height: 0;
    padding: 1.1rem;
  }
  .project-map::before { width: 310px; }
  .project-map__connections { display: none; }
  .project-hub {
    grid-area: auto;
    grid-column: 1 / -1;
    grid-row: 1;
    width: 190px;
    height: 190px;
    margin: .4rem auto .6rem;
  }
  .project-node--telepresence, .project-node--rover,
  .project-node--voicebot, .project-node--immersive,
  .project-node--modules { grid-area: auto; min-height: 120px; }
  .project-node--modules { grid-column: 1 / -1; }
  .project-map__note { position: static; grid-column: 1 / -1; justify-content: center; padding-top: .45rem; }
  .tech-grid { grid-template-columns: 1fr; }
  .tech-card h3 { min-height: 0; }
}
@media (max-width: 520px) {
  .project-map { grid-template-columns: 1fr; padding: .85rem; }
  .project-hub { grid-column: 1; width: 176px; height: 176px; }
  .project-node--modules, .project-map__note { grid-column: 1; }
  .project-node { min-height: 104px; }
}
