/* ── Typography system (single source of truth for every page) ───────── */
:root {
  --font-sans: Archivo, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-accent: Caveat, cursive;

  --t-display: clamp(38px, 4.6vw, 64px);
  --t-h1: clamp(30px, 3.4vw, 42px);
  --t-h2: clamp(19px, 1.8vw, 22px);
  --t-h3: clamp(17px, 1.6vw, 19px);
  --t-lead: clamp(18px, 1.5vw, 20px);
  --t-body: clamp(16px, 1.15vw, 17px);
  --t-small: 15px;
  --t-nav: 13px;
  --t-label: 12px;
  --t-meta: 11px;
  --t-accent: 24px;

  --lh-display: 1;
  --lh-h2: 1.3;
  --lh-lead: 1.5;
  --lh-body: 1.7;
  --lh-small: 1.6;
  --lh-label: 1.4;

  --ink: #111110;
  --ink-2: #3a3936;
  --muted: #6b6a66;
  --muted-2: #7a7975;
  --paper: #fdfdfc;
  --card: #f5f4f0;
  --rule: #e2e1dc;
  --blue: #1f2ed6;
  --blue-display: #3536d9;
}

/* ── Language toggle: show only the active language ───────────────────── */
html:not([lang="pt-BR"]) .pt,
html[lang="pt-BR"] .en { display: none !important; }

/* ── Base ─────────────────────────────────────────────────────────────── */
html { -webkit-font-smoothing: antialiased; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lh-body);
}
a { color: var(--ink); text-decoration: none; transition: color 0.18s ease, background 0.18s ease; }
a:hover { color: var(--blue); }
::selection { background: var(--blue); color: #fff; }
img { display: block; max-width: 100%; }

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 72px);
  position: relative;
  overflow: hidden;
}

/* ── Header ───────────────────────────────────────────────────────────── */
.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 0;
  flex-wrap: wrap;
}
.brand {
  font-weight: 700;
  font-size: var(--t-nav);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 34px);
  font-family: var(--font-mono);
  font-size: var(--t-nav);
  line-height: var(--lh-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 4px 5px;
}
.lang-toggle button {
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--t-meta);
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] { background: var(--blue); color: #fff; }

/* Mobile nav: larger invisible tap areas, balanced two-row header */
@media (max-width: 767px) {
  .site-header { row-gap: 18px; }
  .brand, .site-nav a, .site-nav button { position: relative; }
  .brand::after, .site-nav a::after { content: ""; position: absolute; inset: -14px -8px; }
  .site-nav button::after { content: ""; position: absolute; inset: -11px -3px; }
  .site-nav { width: 100%; justify-content: space-between; }
}

/* ── Shared labels ────────────────────────────────────────────────────── */
.eyebrow,
.section-label {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--t-label);
  line-height: var(--lh-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
  padding: clamp(24px, 3vw, 40px) 0 44px;
  max-width: 1080px;
  margin-inline: auto;
}
.hero-copy {
  position: relative;
  z-index: 3;
  flex: 1 1 400px;
  max-width: 640px;
  min-width: 0;
}
.eyebrow { margin-bottom: 12px; }
.display {
  margin: 0;
  font-size: var(--t-display);
  line-height: var(--lh-display);
  letter-spacing: -0.035em;
  font-weight: 800;
  text-wrap: balance;
}
.display .accent { color: var(--blue-display); display: inline-block; }
.lead {
  margin: 16px 0 0;
  max-width: 48ch;
  font-size: var(--t-lead);
  line-height: var(--lh-lead);
  letter-spacing: -0.012em;
  color: var(--ink-2);
  text-wrap: pretty;
}
.hero-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--t-label);
  line-height: var(--lh-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.pill-btn:hover { background: var(--blue); border-color: var(--blue); color: var(--paper); }

/* Polaroid photo stack */
.polaroids {
  position: relative;
  flex: 0 1 520px;
  width: min(520px, 88vw);
  z-index: 2;
  padding: 8px 10px 14px;
}
.polaroid { background: #fff; }
.polaroid img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.polaroid--main {
  position: relative;
  width: 60%;
  margin-left: 2%;
  padding: 12px 12px 44px;
  box-shadow: 0 1px 0 #e6e5e1, 0 18px 40px -28px rgba(0, 0, 0, 0.45);
  transform: rotate(-2.4deg);
  z-index: 2;
}
.polaroid--small {
  position: absolute;
  right: 2%;
  bottom: 2%;
  width: 40%;
  padding: 9px;
  box-shadow: 0 1px 0 #e6e5e1, 0 16px 34px -26px rgba(0, 0, 0, 0.5);
  transform: rotate(4deg);
  z-index: 3;
}
.polaroid--small img { position: relative; z-index: 1; object-position: center bottom; }
.tape {
  position: absolute;
  top: -9px;
  left: 50%;
  margin-left: -34px;
  width: 68px;
  height: 20px;
  background: rgba(31, 46, 214, 0.14);
  border-left: 1px dashed rgba(31, 46, 214, 0.45);
  border-right: 1px dashed rgba(31, 46, 214, 0.45);
  transform: rotate(-3deg);
  z-index: 2;
}

/* ── Work ─────────────────────────────────────────────────────────────── */
.work { padding: 26px 0 0; position: relative; }
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(16px, 2vw, 24px);
  padding: 24px 0 48px;
}
.case-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(20px, 2vw, 24px);
  background: var(--card);
  border-radius: 14px;
  box-shadow: 0 2px 4px rgba(17, 17, 16, 0.14);
}
.case-num {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--t-label);
  letter-spacing: 0.12em;
  color: var(--muted-2);
}
.case-title,
.award-title {
  margin: 0;
  font-size: var(--t-h2);
  line-height: var(--lh-h2);
  letter-spacing: -0.014em;
  font-weight: 700;
  text-wrap: balance;
}
.case-desc {
  margin: 0;
  font-size: var(--t-small);
  line-height: var(--lh-small);
  color: var(--ink-2);
  text-wrap: pretty;
}
.case-cta {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--t-label);
  line-height: var(--lh-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Awards ───────────────────────────────────────────────────────────── */
.awards { padding: 48px 0 8px; border-top: 1px solid var(--rule); }
.awards-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.awards-head .section-label:last-child { letter-spacing: 0.12em; }
.awards-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: start;
  padding: 24px 0 0;
}
.award { display: flex; align-items: flex-start; gap: clamp(16px, 2vw, 28px); }
.award > div { min-width: 0; }
.award-logo { flex: 0 0 auto; width: clamp(56px, 6vw, 84px); height: auto; }
.award-sub,
.award-body {
  margin: 10px 0 0;
  color: var(--ink-2);
  text-wrap: pretty;
}
.award-body { margin: 0; padding-top: 6px; }
@media (max-width: 767px) {
  .awards-grid { grid-template-columns: 1fr; }
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer {
  padding: 44px 0 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.contact { text-align: center; }
.contact-intro {
  margin: 0 0 14px;
  font-size: var(--t-small);
  line-height: var(--lh-small);
  color: var(--ink-2);
}
.contact-email {
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 22px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--t-label);
  line-height: var(--lh-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Shared inner-page footer ─────────────────────────────────────────── */
.footer-accent {
  font-family: var(--font-accent);
  font-size: var(--t-accent);
  color: var(--blue);
  display: inline-block;
  transform: rotate(-2deg);
}

/* ── Case study pages ─────────────────────────────────────────────────── */
.case {
  max-width: 680px;
  margin: 0 auto;
  padding: 44px 0 0;
  color: #201f1d;
}
.case .eyebrow { margin-bottom: 14px; }
.case h1 {
  margin: 0;
  font-size: var(--t-h1);
  line-height: var(--lh-h1, 1.12);
  letter-spacing: -0.026em;
  font-weight: 700;
  color: var(--ink);
  text-wrap: balance;
}
.case .case-lead {
  margin: 12px 0 0;
  font-size: var(--t-lead);
  line-height: var(--lh-lead);
  letter-spacing: -0.012em;
  color: var(--ink-2);
  text-wrap: pretty;
}
.case-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 22px 40px;
  margin: 34px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid #e6e5e1;
}
.case .case-meta p { margin: 0; font-size: var(--t-small); line-height: var(--lh-small); }
.case .meta-label,
.case .case-meta .meta-label {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--t-meta);
  line-height: var(--lh-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a8985;
}
.case-meta + p { margin-top: 30px; }

/* Body flow: every block sets its own top margin */
.case p { margin: 18px 0 0; text-wrap: pretty; }
.case h2 {
  margin: 76px 0 0;
  font-size: var(--t-h2);
  line-height: var(--lh-h2);
  letter-spacing: -0.014em;
  font-weight: 700;
  color: var(--ink);
}
.case h2 + * { margin-top: 20px; }
.case h3 {
  margin: 0 0 6px;
  font-size: var(--t-h3);
  line-height: 1.35;
  letter-spacing: -0.012em;
  font-weight: 700;
  color: var(--ink);
}
.case .meta-label + * { margin-top: 0; }
.case p.meta-label { margin-top: 18px; margin-bottom: 14px; }

/* Big highlighted number */
.metric { margin: 24px 0 0; }
.metric .metric-value {
  margin: 0;
  font-size: var(--t-metric, clamp(36px, 4vw, 46px));
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 600;
  color: var(--blue);
}
.metric .metric-value + p { margin-top: 8px; max-width: 38ch; }

/* Workstreams (title + description) */
.workstreams { display: grid; gap: 24px; margin: 30px 0 0; }
.workstreams p { margin: 0; color: var(--ink-2); }

/* Stat rows: value | description */
.stats { display: grid; gap: 24px; margin: 30px 0 0; }
.stats > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.62fr) minmax(0, 1fr);
  gap: 28px;
  align-items: baseline;
}
.stats p { margin: 0; color: var(--ink-2); }
.stats .stat-value {
  font-size: var(--t-stat, clamp(20px, 1.9vw, 22px));
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--ink);
}
.stats + p { margin-top: 26px; }
@media (max-width: 480px) {
  .stats > div { grid-template-columns: 1fr; gap: 2px; }
}

/* Dash list */
.dash-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.dash-list li { position: relative; padding-left: 28px; color: var(--ink-2); }
.dash-list li::before { content: "—"; position: absolute; left: 0; top: 0; color: #c9c8c2; }
.dash-list + p { margin-top: 22px; }

/* Before → after mapping */
.mapping { display: grid; gap: 24px; margin: 22px 0 0; }
.mapping > div {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: baseline;
  line-height: var(--lh-small);
}
.mapping p { margin: 0; }
.mapping .from { font-family: var(--font-mono); color: #8a8985; }
.mapping .arrow { color: #c9c8c2; font-size: var(--t-small); }
.mapping .to { font-weight: 500; color: var(--ink); }
.mapping + p { margin-top: 26px; }

/* Indented questions */
.questions { display: grid; gap: 8px; margin: 22px 0 0; padding-left: 18px; }
.questions p { margin: 0; font-weight: 500; line-height: var(--lh-small); color: var(--ink); }
.questions + p { margin-top: 22px; }

/* Wide figures that break out of the text column */
.case figure {
  margin: 34px 0 0;
  width: min(900px, 92vw);
  margin-left: 50%;
  transform: translateX(-50%);
}
.case figure img { display: block; width: 100%; height: auto; }
.case figcaption {
  margin-top: 12px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--t-caption, 11px);
  line-height: 1.8;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}
.figure-pair { display: flex; gap: 16px; align-items: flex-start; }
.figure-pair img { min-width: 0; }

/* Previous / all / next */
.case-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  gap: 24px;
  margin: 72px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--t-label);
  line-height: var(--lh-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.case-nav > :last-child { text-align: right; }
.case-nav .disabled { color: #c9c8c2; }

.case-footer {
  max-width: 680px;
  margin: 0 auto;
  padding: 36px 0 64px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

/* ── About page ───────────────────────────────────────────────────────── */
.about-top { display: flex; flex-direction: column; min-height: 100svh; }
.about-intro { flex: 1; display: flex; align-items: center; padding: 44px 0 48px; }
.about-content {
  width: 100%;
  max-width: calc(54ch * 1.75 + clamp(24px, 3vw, 44px));
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1fr);
  gap: clamp(24px, 3vw, 44px);
  align-items: center;
}
.about-text { order: 2; min-width: 0; }
.about-text h1 {
  margin: 0;
  max-width: 12ch;
  font-size: var(--t-display);
  line-height: var(--lh-display);
  letter-spacing: -0.035em;
  font-weight: 800;
  color: #3c3b37;
}
.about-body { margin: 18px 0 0; max-width: 54ch; color: var(--ink-2); text-wrap: pretty; }
.about-body p { margin: 0 0 16px; }
.about-photo {
  order: 1;
  align-self: stretch;
  position: relative;
  min-height: 360px;
  container-type: size;
}
.about-photo img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: min(100cqh, 230cqw);
  object-fit: cover;
  object-position: 45% top;
}
@media (max-width: 1023px) {
  .about-content { grid-template-columns: minmax(0, 0.62fr) minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .about-content { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .about-photo { min-height: 0; container-type: normal; align-self: auto; }
  .about-photo img { position: static; width: auto; max-width: 100%; height: auto; max-height: 80svh; object-fit: contain; }
  .about-text h1, .about-body { max-width: none; }
}

.about-section { padding: 40px 0 48px; position: relative; }
.about-section > .section-label { margin-bottom: 20px; }

/* Career timeline: horizontal on desktop, vertical below 1024px */
.timeline-scroll { overflow-x: auto; overflow-y: hidden; margin: 0 -2px; padding: 0 2px 6px; }
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  min-width: 860px;
}
.timeline li {
  position: relative;
  padding: 26px clamp(14px, 1.6vw, 26px) 0 0;
  background-image:
    linear-gradient(to right, var(--ink) 0 100%),
    repeating-linear-gradient(to right, #b9b7b0 0 1px, transparent 1px 16px);
  background-size: 100% 1.5px, 100% 7px;
  background-position: 0 0, 0 1.5px;
  background-repeat: no-repeat, repeat-x;
}
.timeline .dot {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-50%);
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: var(--ink);
}
.timeline .years {
  display: block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--t-label);
  line-height: var(--lh-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.timeline h3 {
  margin: 10px 0 0;
  font-size: var(--t-h3);
  line-height: 1.35;
  letter-spacing: -0.012em;
  font-weight: 700;
}
.timeline .job { margin: 4px 0 0; font-size: var(--t-small); line-height: var(--lh-small); color: var(--ink-2); }
.timeline .company-desc { margin: 10px 0 0; font-size: var(--t-small); line-height: var(--lh-small); color: var(--muted); text-wrap: pretty; }
@media (max-width: 1024px) {
  .timeline-scroll { overflow: visible; margin: 0; padding: 0; }
  .timeline { grid-template-columns: minmax(0, 1fr); min-width: 0; }
  .timeline li {
    padding: 0 0 26px 30px;
    background: linear-gradient(var(--ink), var(--ink)) no-repeat 6px 6px / 1.5px 100%;
  }
  .timeline li:last-child { padding-bottom: 0; background-size: 1.5px 0; }
  .timeline .dot { top: 3px; transform: none; }
}

/* Testimonials */
.testimonials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}
.testimonial {
  margin: 0;
  position: relative;
  background: #fff;
  padding: 26px 24px 22px;
  box-shadow: 0 1px 0 #e6e5e1, 0 16px 34px -30px rgba(0, 0, 0, 0.5);
}
.testimonial:nth-child(1) { transform: rotate(-1.1deg); }
.testimonial:nth-child(2) { transform: rotate(1.4deg); }
.testimonial blockquote { margin: 0; color: var(--ink); text-wrap: pretty; }
.testimonial figcaption {
  margin-top: 14px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--t-meta);
  line-height: var(--lh-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.case strong { font-weight: 600; }
