/* ── Layout geral de secções ────────────────────────────────────── */
.section {
  position: relative;
  padding: clamp(3.1rem, 7vw, 6rem) clamp(1rem, 5vw, 4rem);
  overflow: hidden;
  scroll-margin-top: 5rem;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, .78fr) minmax(20rem, 1.22fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.centered {
  justify-items: center;
  text-align: center;
  margin-inline: auto;
}

.section-copy { gap: 1.1rem; max-width: 44rem; }
.section-copy.centered { text-align: center; margin: 0 auto; max-width: 52rem; }
.section-copy.centered h2 { max-width: 100%; }

/* ── Logo band ──────────────────────────────────────────────────── */
.logo-band {
  background: var(--soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 2.5rem clamp(1.25rem, 5%, 4rem);
  display: grid;
  gap: 1.4rem;
}

.logo-band p { color: var(--muted-soft); font-size: .88rem; text-align: center; }

.logo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem;
  max-width: 1280px;
  margin: auto;
}

.logo-grid img {
  width: 100%;
  min-height: 3rem;
  aspect-ratio: 3.2 / 1.1;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  padding: .5rem;
  box-shadow: none;
  filter: grayscale(1) opacity(.6);
  transition: filter .22s, transform .22s;
}

.logo-grid img:hover { filter: grayscale(0) opacity(1); transform: translateY(-2px); }

/* ── Capability grid ────────────────────────────────────────────── */
.capability-grid {
  gap: 0;
  grid-template-columns: 1fr;
}

.capability-grid article {
  min-height: auto;
  padding: 1.4rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  border-radius: 0;
  align-content: start;
  gap: .45rem;
  background: transparent;
  display: grid;
}

.capability-grid article span { font-size: .7rem; color: var(--muted-soft); font-weight: 700; }
.capability-grid article h3   { color: var(--ink); }
.capability-grid article p    { font-size: .93rem; }

/* ── Production preview ─────────────────────────────────────────── */
.production-preview { background: var(--soft); }

.preview-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.preview-heading h2 { margin-top: .4rem; }

.production-board {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.board-heading {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: space-between;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.2rem;
}

.board-heading strong { font-weight: 600; font-size: .95rem; }
.board-heading span   { font-size: .75rem; color: var(--muted); }

.line-picker {
  display: flex;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.line-picker button {
  min-height: 36px;
  flex: 1;
  background: none;
  color: var(--muted);
  border: 0;
  cursor: pointer;
  font-size: .84rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}

.line-picker button.active { background: var(--ink); color: #fff; font-weight: 600; }

.board-metrics { display: grid; grid-template-columns: 1fr; }

.board-metrics > div {
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: .35rem;
}

.board-metrics span    { font-size: .76rem; color: var(--muted); font-weight: 500; }
.board-metrics strong  { font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.board-metrics small   { color: var(--muted-soft); font-size: .72rem; }

.timeline-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 1.5rem 0 .75rem;
  font-size: .78rem;
  font-weight: 600;
}

.timeline-heading span { color: var(--muted); font-weight: 400; }

.production-timeline {
  display: flex;
  gap: 3px;
  height: 26px;
  border-radius: 6px;
  overflow: hidden;
}

.production-timeline i { background: var(--purple); flex: 5; }
.production-timeline i:nth-child(3), .production-timeline i:nth-child(7) { flex: 1; background: #f59e0b; }
.production-timeline i:nth-child(5) { flex: .6; background: #ef4444; }
.production-timeline[data-line="1"] i:nth-child(7) { flex: .4; }
.production-timeline[data-line="2"] i:nth-child(5) { flex: 4; }

.timeline-legend { display: flex; gap: 1.2rem; font-size: .72rem; margin-top: .65rem; color: var(--muted); }

.timeline-legend span::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--purple);
  margin-right: 5px;
  vertical-align: middle;
}

.timeline-legend span:nth-child(2)::before { background: #f59e0b; }
.timeline-legend span:nth-child(3)::before { background: #ef4444; }

.outcome-row { display: grid; gap: .75rem; margin-top: 2rem; }

.outcome-row article {
  padding: 1.25rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.outcome-row h3 { margin-bottom: .4rem; }
.outcome-row p  { font-size: .9rem; margin-top: 0; }

/* ── Tech flow / Flow map ───────────────────────────────────────── */
.tech-flow { background: var(--paper); }

.flow-map {
  min-height: 27rem;
  margin-top: clamp(1.8rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  box-shadow: var(--shadow-sm);
}

.flow-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }

.flow-line {
  fill: none;
  stroke: url(#flowGradient);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 14 14;
  animation: dashFlow 12s linear infinite;
}

.flow-node {
  position: absolute;
  width: 9rem;
  min-height: 5.7rem;
  display: grid;
  place-items: center;
  text-align: center;
  padding: .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.flow-node b     { font-size: .92rem; color: var(--ink); }
.flow-node small { color: var(--muted-soft); font-size: .78rem; font-weight: 750; }
.flow-node.image img { max-height: 3.5rem; margin: 0 auto .2rem; }

.n1 { left: 7%;   top: 38%; }
.n2 { left: 26%;  top: 13%; }
.n3 { left: 48%;  top: 37%; }
.n4 { right: 22%; bottom: 12%; }
.n5 { right: 7%;  top: 20%; }

/* ── Before / After ─────────────────────────────────────────────── */
.before-after { background: var(--soft); }

.toggle-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  padding: .35rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.toggle-group button {
  min-height: 2.9rem;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
  cursor: pointer;
}

.toggle-group button.active { color: #fff; background: var(--purple); }

.comparison-panel {
  min-height: 20rem;
  border-radius: var(--radius);
  box-shadow: none;
  overflow: hidden;
}

.comparison-layer {
  display: none;
  min-height: inherit;
  align-content: center;
  gap: 1.2rem;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  background: var(--dark-card);
}

.comparison-layer.active { display: grid; }
.comparison-layer h3     { font-size: clamp(1.6rem, 3vw, 2.3rem); color: #fff; }

.comparison-layer ul {
  display: grid;
  gap: .8rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgba(255,255,255,.68);
  font-size: 1rem;
  line-height: 1.4;
}

/* ── AI console ─────────────────────────────────────────────────── */
.ai-console {
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--soft);
  box-shadow: none;
  display: grid;
  gap: .8rem;
}

.console-line {
  padding: 1rem;
  border-radius: 8px;
  font-size: .98rem;
  line-height: 1.45;
  font-weight: 400;
}

.console-line.question {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: transform .2s ease, border-color .2s ease;
}

.console-line.question:hover {
  transform: translateX(4px);
  border-color: var(--purple-light);
}

.console-line.answer {
  color: #fff;
  background: linear-gradient(135deg, var(--purple), #3b82f6);
}

.console-tags { display: flex; flex-wrap: wrap; gap: .45rem; }

.console-tags span {
  padding: .5rem .65rem;
  border-radius: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
  transition: background .15s ease, color .15s ease, transform .15s ease;
  cursor: default;
}

.console-tags span:hover {
  background: var(--purple-soft);
  color: var(--purple);
  transform: translateY(-1px);
}

/* ── AI section ─────────────────────────────────────────────────── */
.ai-section { background: var(--paper); display: grid; gap: 3rem; }

.ai-features { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }

.ai-features span {
  padding: .3rem .75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--soft);
}

/* ── Responsivo: secções ────────────────────────────────────────── */
@media (max-width: 920px) {
  .split, .before-after, .ai-section { grid-template-columns: 1fr; }

  .logo-grid { grid-template-columns: repeat(2, 1fr); }

  .flow-map { min-height: 34rem; }
  .flow-node { width: 8.1rem; }

  .n1 { left: 5%; top: 7%; }
  .n2 { right: 5%; left: auto; top: 20%; }
  .n3 { left: 6%; top: 41%; }
  .n4 { right: 5%; bottom: 20%; }
  .n5 { left: 7%; right: auto; bottom: 6%; top: auto; }
}

@media (min-width: 700px) {
  .section { padding: 6rem clamp(1.25rem, 5%, 4rem); }
  h2 { font-size: 2.6rem; }
  .capability-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 3rem; }
  .board-metrics { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .board-metrics > div { padding: 1.4rem 1.5rem; }
  .production-board { padding: 2rem; }
  .line-picker button { flex: 0 0 120px; }
  .preview-heading { flex-direction: row; justify-content: space-between; align-items: flex-end; }
  .outcome-row { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1rem; }
  .logo-grid { grid-template-columns: repeat(6, minmax(0,1fr)); }
  .ai-section { grid-template-columns: 1fr 1fr; align-items: start; }
}

@media (min-width: 1000px) {
  .section { padding-inline: max(5%, calc((100% - 1280px) / 2)); }
  .flow-map { min-height: 24rem; }
}
