:root {
  --navy: #17365d;
  --blue: #557eb5;
  --blue-dark: #345f96;
  --yellow: #f2c944;
  --ink: #17212b;
  --muted: #5c6773;
  --surface: #ffffff;
  --soft: #f4f6f8;
  --line: #d8dee6;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(23, 54, 93, .09);
  --shell: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--soft);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
a { color: var(--blue-dark); }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.shell { width: min(var(--shell), calc(100% - 2rem)); margin-inline: auto; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .65rem 1rem;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 700;
}
.skip-link:focus { top: 1rem; }

.hero {
  background: linear-gradient(135deg, #102b4b, var(--navy) 58%, var(--blue-dark));
  color: white;
  border-bottom: 5px solid var(--yellow);
}
.hero__inner { padding-block: clamp(2.8rem, 7vw, 5.5rem); }
.hero__topline { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 2.5rem; }
.brand { font-size: .85rem; font-weight: 800; letter-spacing: .12em; }
.status-badge { padding: .35rem .7rem; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; font-size: .75rem; }
.eyebrow { margin: 0 0 .55rem; color: var(--blue-dark); font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.hero .eyebrow { color: #d9e7f7; }
.hero h1 { max-width: 900px; margin: 0; font-size: clamp(2.15rem, 6vw, 4.8rem); line-height: 1.02; letter-spacing: -.045em; font-weight: 720; }
.hero__lead { max-width: 760px; margin: 1.35rem 0 0; color: rgba(255,255,255,.82); font-size: clamp(1rem, 2vw, 1.2rem); }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: -1.3rem;
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}
.stat { display: flex; min-height: 108px; padding: 1.25rem; background: var(--surface); flex-direction: column; justify-content: center; }
.stat strong { color: var(--navy); font-size: clamp(1.7rem, 3vw, 2.25rem); line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { margin-top: .5rem; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }

.context { display: grid; grid-template-columns: .8fr 1.2fr; gap: clamp(2rem, 6vw, 6rem); padding-block: clamp(3.5rem, 7vw, 6rem); }
.context h2, .section-heading h2 { margin: 0; color: var(--navy); font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.08; letter-spacing: -.03em; }
.context__copy > p { margin-top: 0; font-size: 1.05rem; }
details { margin-top: 1.5rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
summary { padding: 1rem 1.15rem; color: var(--navy); font-weight: 700; cursor: pointer; }
.method { padding: 0 1.15rem 1rem; color: var(--muted); }
.method p:last-child { margin-bottom: 0; }

.experiments { padding-block: clamp(3.5rem, 7vw, 6rem); background: #eaf0f6; border-top: 1px solid var(--line); }
.experiments-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.experiment-card { display: flex; min-height: 245px; padding: 1.35rem; border: 1px solid #cad4e1; border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 3px 14px rgba(23,54,93,.05); flex-direction: column; text-decoration: none; }
.experiment-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.experiment-card__tag { color: var(--blue-dark); font-size: .7rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.experiment-card h3 { margin: .65rem 0 .5rem; color: var(--navy); font-size: 1.25rem; line-height: 1.2; }
.experiment-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.experiment-card__action { margin-top: auto; padding-top: 1.2rem; color: var(--navy); font-size: .8rem; font-weight: 800; }

.brand--link { color: white; text-decoration: none; }
.hero--compact .hero__inner { padding-block: clamp(2.4rem, 5vw, 4rem); }
.hero--compact h1 { font-size: clamp(2.1rem, 5vw, 4rem); }
.analysis-section { padding-block: clamp(3.5rem, 7vw, 6rem); scroll-margin-top: 1rem; }
.analysis-band { background: #eaf0f6; border-block: 1px solid var(--line); scroll-margin-top: 1rem; }
.analysis-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); box-shadow: var(--shadow); }
.analysis-note { margin-top: 1.5rem; padding: 1rem 1.2rem; border-left: 4px solid var(--blue); border-radius: 0 8px 8px 0; background: #fff; color: var(--muted); font-size: .9rem; }
.analysis-note strong { color: var(--navy); }
.analysis-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 3px 14px rgba(23,54,93,.05); }
.analysis-table-wrap table { width: 100%; min-width: 780px; border-collapse: collapse; }
.analysis-table-wrap th, .analysis-table-wrap td { padding: .75rem .85rem; border-bottom: 1px solid var(--line); text-align: left; font-size: .82rem; }
.analysis-table-wrap th { background: var(--navy); color: #fff; font-size: .7rem; letter-spacing: .035em; text-transform: uppercase; }
.analysis-table-wrap tbody tr:nth-child(even) { background: var(--soft); }
.analysis-table-wrap tbody tr:last-child td { border-bottom: 0; }
.analysis-table-wrap .numeric { text-align: right; font-variant-numeric: tabular-nums; }
.analysis-controls { display: flex; align-items: end; gap: 1rem; margin-bottom: 1.25rem; }
.analysis-controls label { color: var(--navy); font-size: .77rem; font-weight: 750; }
.analysis-controls select { min-width: min(100%, 360px); min-height: 44px; padding: .55rem .7rem; border: 1px solid #b8c2cf; border-radius: 8px; background: #fff; }
.analysis-controls span { color: var(--muted); font-size: .82rem; }

.catalog { padding-block: clamp(3.5rem, 7vw, 6rem); background: #fff; border-top: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 2rem; margin-bottom: 2rem; }
.section-heading > p { max-width: 420px; margin: 0; color: var(--muted); }
.filters {
  display: grid;
  grid-template-columns: minmax(260px, 1.5fr) repeat(2, minmax(190px, 1fr)) auto;
  gap: 1rem;
  align-items: end;
  padding: 1.25rem;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.field { display: flex; min-width: 0; flex-direction: column; gap: .35rem; }
.field label { color: var(--navy); font-size: .77rem; font-weight: 750; }
.field input, .field select { width: 100%; min-height: 46px; padding: .65rem .8rem; border: 1px solid #b8c2cf; border-radius: 8px; background: white; color: var(--ink); }
.results-status { margin: 1.4rem 0; color: var(--muted); font-size: .92rem; }

.button { min-height: 44px; padding: .65rem 1rem; border: 1px solid var(--navy); border-radius: 8px; background: var(--navy); color: white; font-weight: 700; }
.button:hover { background: var(--blue-dark); }
.button:disabled { cursor: not-allowed; opacity: .4; }
.button--secondary { min-height: 46px; background: white; color: var(--navy); }
.button--secondary:hover { background: #e9eef5; }

.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.profile-card { display: flex; min-width: 0; min-height: 250px; padding: 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 3px 14px rgba(23,54,93,.05); flex-direction: column; }
.profile-card:hover { border-color: #aabbd0; box-shadow: var(--shadow); }
.profile-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.profile-card__unit { margin: 0 0 .35rem; color: var(--blue-dark); font-size: .72rem; font-weight: 800; line-height: 1.3; text-transform: uppercase; letter-spacing: .04em; }
.profile-card h2 { margin: 0; color: var(--navy); font-size: 1.08rem; line-height: 1.25; }
.lattes-link { flex: 0 0 auto; padding: .4rem .6rem; border: 1px solid #c0cada; border-radius: 7px; color: var(--navy); font-size: .75rem; font-weight: 750; text-decoration: none; }
.lattes-link:hover { background: var(--navy); color: white; }
.profile-card__department { margin: .65rem 0 1rem; color: var(--muted); font-size: .84rem; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; margin: auto 0 0; }
.metrics div { padding: .65rem .3rem; border-radius: 8px; background: var(--soft); text-align: center; }
.metrics dt { color: var(--muted); font-size: .64rem; line-height: 1.1; text-transform: uppercase; }
.metrics dd { margin: .25rem 0 0; color: var(--navy); font-size: 1.18rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.profile-card__updated { margin: .85rem 0 0; color: var(--muted); font-size: .72rem; }
.empty, .error { grid-column: 1 / -1; padding: 2rem; border-radius: 10px; background: #fff7da; color: #5b4807; }

.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem; margin-top: 2rem; }
.pagination span { min-width: 120px; color: var(--muted); text-align: center; font-size: .88rem; }

footer { padding-block: 2.5rem; background: var(--navy); color: rgba(255,255,255,.72); }
.footer__inner { display: flex; justify-content: space-between; gap: 2rem; }
.footer__inner strong { color: white; letter-spacing: .06em; }
.footer__inner p { max-width: 520px; margin: .35rem 0 0; font-size: .82rem; }
.footer__links { display: flex; align-items: flex-start; gap: 1.2rem; }
.footer__links a { color: white; font-size: .82rem; }

@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .analysis-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1fr 1fr; }
  .field--search { grid-column: 1 / -1; }
  .experiments-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 660px) {
  .shell { width: min(var(--shell), calc(100% - 1.2rem)); }
  .hero__topline, .section-heading, .footer__inner { align-items: flex-start; flex-direction: column; }
  .hero__topline { margin-bottom: 2rem; }
  .stats { margin-top: -.8rem; }
  .analysis-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analysis-controls { align-items: stretch; flex-direction: column; }
  .analysis-controls select { width: 100%; }
  .stat { min-height: 88px; padding: .9rem; }
  .context { grid-template-columns: 1fr; }
  .filters, .experiments-grid, .cards { grid-template-columns: 1fr; }
  .field--search { grid-column: auto; }
  .profile-card { min-height: 235px; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .footer__links { flex-direction: column; gap: .5rem; }
}
/* ---- charts ---- */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.chart-container {
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 3px 14px rgba(23,54,93,.05);
}
.chart-container--wide {
  grid-column: 1 / -1;
}
.chart-title {
  margin: 0 0 1rem;
  color: var(--navy);
  font-size: .92rem;
  font-weight: 700;
  letter-spacing: -.01em;
}
.chart-container canvas {
  max-width: 100%;
}

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

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