.features {
  position: relative;
  border-radius: 42px 42px 0 0;
  background: #f8f8f6;
  color: #222321;
}

.features-inner {
  width: min(1600px, calc(100% - 48px));
  margin: 0 auto;
  padding-bottom: clamp(88px, 9vw, 152px);
}

.features-intro {
  padding: clamp(92px, 10vw, 160px) 20px clamp(78px, 8vw, 132px);
  text-align: center;
}

.features-intro h2 {
  font-size: clamp(52px, 6vw, 104px);
  font-weight: 600;
  letter-spacing: -.076em;
  line-height: 1.02;
  text-wrap: balance;
}

.features-intro h2 span { color: #8b8e86; }

.features-intro p {
  margin-top: clamp(26px, 3vw, 42px);
  color: #777c74;
  font-size: clamp(18px, 1.4vw, 25px);
  line-height: 1.55;
  letter-spacing: -.025em;
}

.feature-card {
  min-width: 0;
  overflow: hidden;
  border-radius: 30px;
}

.feature-card-heading h3 {
  margin-top: 32px;
  font-size: clamp(41px, 3.7vw, 65px);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -.067em;
  text-wrap: balance;
}

.feature-card-heading > p:not(.feature-kicker) {
  max-width: 680px;
  margin-top: 28px;
  font-size: clamp(18px, 1.35vw, 23px);
  line-height: 1.55;
  letter-spacing: -.027em;
  opacity: .84;
}

.feature-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .115em;
  line-height: 1.3;
}

.feature-kicker svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
  shape-rendering: crispEdges;
}

.feature-card--agents {
  padding: clamp(30px, 3.6vw, 62px);
  background: #090c12;
  color: #f7f8f4;
}

.feature-card-heading--split {
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  align-items: end;
  gap: 56px;
}

.feature-card-heading--split h3 { margin-top: 35px; }
.feature-card-heading--split > p { max-width: 560px; margin-bottom: 4px; }

.agents-demo {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(45px, 7vw, 130px);
  min-height: 510px;
  margin-top: 64px;
  padding: 60px clamp(24px, 4vw, 74px) 55px;
  border: 1px solid #2e3035;
  border-radius: 23px;
  background-color: #151618;
  background-image: radial-gradient(#45484d 1px, transparent 1px);
  background-size: 29px 29px;
  box-shadow: inset 0 0 0 1px #ffffff08;
}

.agents-demo-connection {
  position: absolute;
  top: 50%;
  right: 25%;
  left: 25%;
  height: 2px;
  background: #707782;
}

.agents-demo-connection span {
  position: absolute;
  top: -6px;
  width: 14px;
  height: 14px;
  border: 3px solid #9fc7ff;
  border-radius: 50%;
  background: #151618;
}
.agents-demo-connection span:first-child { left: 0; }
.agents-demo-connection span:last-child { right: 0; }
.agent-signal { position: absolute; top: -4px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: #f6c945; box-shadow: 0 0 14px #f6c945; opacity: 0; }
.agents-demo.is-handoff .agent-signal { opacity: 1; animation: agent-signal-forward 1.5s ease-in-out infinite; }
.agents-demo.is-reply .agent-signal { opacity: 1; animation: agent-signal-reverse 1.5s ease-in-out infinite; }
.agents-demo.is-handoff .agents-demo-connection, .agents-demo.is-reply .agents-demo-connection { box-shadow: 0 0 12px #f6c94570; }
@keyframes agent-signal-forward { from { left: 0; } to { left: calc(100% - 10px); } }
@keyframes agent-signal-reverse { from { left: calc(100% - 10px); } to { left: 0; } }

.agent-window {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 385px;
  overflow: hidden;
  border: 1px solid #37383b;
  border-radius: 13px;
  background: #1e1f21;
  box-shadow: 0 24px 35px #0008;
}

.agent-window--lead {
  border: 2px solid #65a2fa;
  box-shadow: 0 0 0 5px #65a2fa18, 0 24px 35px #0008;
}
.agents-demo.is-claude-active .agent-window--lead { border-color: #37383b; box-shadow: 0 24px 35px #0008; }
.agents-demo.is-claude-active .agent-window--designer { border-color: #d97757; box-shadow: 0 0 0 5px #d9775725, 0 24px 35px #0008; }
.agents-demo.is-complete .agent-window--lead { border-color: #90c69b; box-shadow: 0 0 0 5px #90c69b22, 0 24px 35px #0008; }
.agents-demo.is-complete .agent-window--designer { border-color: #d97757; }

.agent-window-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid #343537;
  color: #e5e5e3;
  font-size: 14px;
}

.agent-window-bar strong { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.agent-window-model { margin-left: 8px; color: #a9afb3; font: 11px "DM Mono", monospace; }
.agent-window-menu { margin-left: auto; color: #9a9da1; font-size: 20px; letter-spacing: .08em; }
.agent-status { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 2px; background: #ef706f; }
.agent-status--codex { background: #10a37f; }
.agent-status--claude { background: #d97757; }

.agent-window-body {
  flex: 1;
  min-height: 0;
  padding: 19px 19px 10px;
  overflow: hidden;
  color: #cfd2d4;
  font: 13px/1.45 "DM Mono", monospace;
}
.agent-window-body p { margin: 0 0 12px; overflow-wrap: anywhere; }
.agent-line { display: none; }
.agent-line[data-final] { display: block; }
.agents-demo.is-animated .agent-line { display: block; max-height: 0; margin-bottom: 0; overflow: hidden; opacity: 0; transform: translateY(5px); transition: max-height .4s ease, margin-bottom .4s ease, opacity .3s ease, transform .3s ease; }
.agents-demo.is-animated .agent-line.is-visible { max-height: 120px; margin-bottom: 12px; opacity: 1; transform: translateY(0); }
.agents-demo.is-animated .agent-line.is-typing::after { content: '▍'; margin-left: 3px; color: #f6c945; animation: agent-cursor-blink .8s steps(1, end) infinite; }
.terminal-muted { color: #81878e; }
.terminal-muted span { padding: 0 5px; }
.terminal-prompt { color: #f6c945; }
.terminal-success { color: #9bce9b; }
.terminal-accent { color: #8fc2f0; }
.terminal-file { color: #b3c8e6; }
.agent-window-composer { display: flex; align-items: center; flex: none; height: 39px; min-width: 0; padding: 0 14px; border-top: 1px solid #424347; background: #303134; color: #a0a2a8; font: 12px "DM Mono", monospace; }
.agent-composer-prompt { flex: none; margin-right: 7px; color: #dedfdf; font-size: 16px; }
.agent-composer-cursor { flex: none; margin-right: 2px; color: #d3d5d5; animation: agent-cursor-blink .8s steps(1, end) infinite; }
.agent-composer-placeholder { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-window-footer { display: flex; align-items: center; gap: 8px; flex: none; height: 25px; min-width: 0; overflow: hidden; padding: 0 15px; background: #1b1c1e; color: #8b8e95; font: 11px "DM Mono", monospace; white-space: nowrap; }
.agent-footer-model { flex: none; color: #d4c298; }
.agent-footer-divider { flex: none; color: #74777b; }
.agent-footer-path { flex: none; color: #9abf9e; }
.agent-footer-activity { min-width: 0; overflow: hidden; color: #91c9c6; text-overflow: ellipsis; }
@keyframes agent-cursor-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.agents-demo-label { position: absolute; z-index: 2; bottom: 16px; left: 18px; color: #92979d; font: 10px "DM Mono", monospace; letter-spacing: .12em; }

.feature-grid {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}
.feature-grid--wide-left { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }

.feature-grid .feature-card {
  display: flex;
  flex-direction: column;
  min-height: 710px;
  padding: clamp(30px, 3vw, 52px);
}
.feature-grid .feature-card-heading { position: relative; z-index: 1; }
.feature-grid .feature-card-heading h3 { margin-top: 34px; }
.feature-grid .feature-card-heading > p:not(.feature-kicker) { max-width: 660px; }
.feature-grid--wide-left .feature-card:nth-child(2) .feature-card-heading h3 { font-size: clamp(38px, 3.1vw, 55px); }

.feature-grid .feature-card--portal,
.feature-grid .feature-card--flow {
  position: relative;
  border: 4px solid;
  border-radius: 0;
  background-size: 24px 24px, 24px 24px, auto;
  box-shadow: 8px 8px 0;
}

.feature-grid .feature-card--portal {
  border-color: #526b32;
  background-color: #d2e39f;
  background-image: linear-gradient(90deg, #617b2718 1px, transparent 1px), linear-gradient(#617b2718 1px, transparent 1px), linear-gradient(#e8f3be66, #bdd78966);
  color: #2b3a1c;
  box-shadow: 8px 8px 0 #8da95c;
}

.feature-grid .feature-card--flow {
  border-color: #51748b;
  background-color: #c7dfeb;
  background-image: linear-gradient(90deg, #3a69871a 1px, transparent 1px), linear-gradient(#3a69871a 1px, transparent 1px), linear-gradient(#e5f2f866, #b4d3e566);
  color: #254052;
  box-shadow: 8px 8px 0 #88afc4;
}

.feature-grid .feature-card--portal::before,
.feature-grid .feature-card--flow::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 10px;
  background: repeating-linear-gradient(90deg, currentColor 0 12px, transparent 12px 24px);
  opacity: .34;
  pointer-events: none;
}

.feature-grid .feature-card--portal .feature-kicker,
.feature-grid .feature-card--flow .feature-kicker {
  width: fit-content;
  padding: 7px 10px;
  border: 2px solid currentColor;
  background: #ffffff63;
  box-shadow: 4px 4px 0 currentColor;
  font-family: "DM Mono", monospace;
}

.feature-grid .feature-card--portal .feature-card-heading h3 { text-shadow: 3px 3px 0 #aec673; }
.feature-grid .feature-card--flow .feature-card-heading h3 { text-shadow: 3px 3px 0 #9cc4d8; }

.portal-demo,
.flow-demo { position: relative; flex: none; height: 325px; margin-top: auto; }

.portal-demo {
  overflow: hidden;
  border: 3px solid #292d2c;
  border-radius: 0;
  background-color: #121617;
  background-image: linear-gradient(90deg, #3c464642 1px, transparent 1px), linear-gradient(#3c464642 1px, transparent 1px);
  background-size: 20px 20px;
  box-shadow: 8px 8px 0 #526b32;
}
.portal-demo-note { position: absolute; top: 31%; left: 4%; z-index: 1; display: flex; flex-direction: column; gap: 16px; width: 35%; padding: 19px; border: 2px solid #9bbf8c; border-radius: 0; background: #222629; box-shadow: 6px 6px 0 #000a; color: #e4e9e4; }
.portal-demo-note span { color: #9fcf90; font: 10px "DM Mono", monospace; letter-spacing: .1em; }
.portal-demo-note strong { font-size: clamp(16px, 1.4vw, 23px); line-height: 1.15; }
.portal-demo-note small { color: #aab4b3; font-size: 12px; line-height: 1.4; }
.portal-browser { position: absolute; top: 10%; right: 4%; width: 61%; height: 82%; overflow: hidden; border: 3px solid #6c8490; border-radius: 0; background: #080a0f; box-shadow: 8px 8px 0 #0009; }
.portal-browser-bar { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 12px; border-bottom: 3px solid #52626b; color: #b4babe; font: 15px "DM Mono", monospace; }
.portal-browser-bar div { flex: 1; overflow: hidden; padding: 5px 9px; border-radius: 0; background: #202428; color: #b8c1c3; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.portal-browser-view { position: relative; height: calc(100% - 36px); overflow: hidden; }
.portal-browser-view::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 25%, #080a0fcc 100%); }
.portal-browser-view img { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.portal-browser-view strong, .portal-browser-view span { position: absolute; z-index: 1; left: 0; width: 100%; color: #fff; text-align: center; }
.portal-browser-view strong { top: 40%; font: 800 clamp(25px, 3.3vw, 56px)/1 "DM Mono", monospace; letter-spacing: -.075em; text-shadow: 3px 3px 0 #de2d83, -3px -3px 0 #1588ba; }
.portal-browser-view span { top: 68%; font: 11px "DM Mono", monospace; letter-spacing: .18em; }

.flow-demo {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 3px solid #51748b;
  border-radius: 0;
  background-color: #f5fbff;
  background-image: linear-gradient(90deg, #cbdde69c 1px, transparent 1px), linear-gradient(#cbdde69c 1px, transparent 1px);
  background-size: 20px 20px;
  box-shadow: 8px 8px 0 #7fa6bb;
}
.flow-demo svg { width: 100%; height: 100%; max-width: 500px; shape-rendering: crispEdges; }
.flow-demo svg > path { fill: #fff; stroke: #9472b3; stroke-width: 3; filter: drop-shadow(4px 4px 0 #ad9ac0); }
.flow-demo svg > .flow-done { fill: #e8f2cf; stroke: #759d42; filter: drop-shadow(4px 4px 0 #a6c76c); }
.flow-demo text { fill: #40374c; font: 700 21px "DM Mono", monospace; text-anchor: middle; }
.flow-demo .flow-caption { fill: #806da0; font-size: 17px; }

@media (max-width: 1120px) {
  .feature-grid .feature-card { min-height: 670px; }
  .feature-card-heading--split { gap: 32px; }
  .agents-demo { gap: 38px; padding-right: 25px; padding-left: 25px; }
  .agent-window-body { font-size: 11px; }
  .feature-grid--wide-left { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
  .feature-grid .feature-card { padding: 32px; }
  .feature-grid .feature-card-heading > p:not(.feature-kicker) { font-size: 18px; }
}

@media (max-width: 760px) {
  .features { border-radius: 26px 26px 0 0; }
  .features-inner { width: calc(100% - 32px); padding-bottom: 80px; }
  .features-intro { padding: 90px 8px 72px; }
  .features-intro h2 { font-size: clamp(42px, 9.8vw, 65px); letter-spacing: -.065em; }
  .features-intro p { font-size: 17px; line-height: 1.5; }
  .features-intro p br { display: none; }
  .feature-card { border-radius: 24px; }
  .feature-card--agents { padding: 26px; }
  .feature-card-heading--split { display: block; }
  .feature-card-heading h3, .feature-grid .feature-card-heading h3 { margin-top: 26px; font-size: clamp(37px, 7.8vw, 52px); }
  .feature-card-heading--split > p { margin-top: 22px; }
  .feature-card-heading > p:not(.feature-kicker) { font-size: 17px; line-height: 1.5; }
  .agents-demo { display: flex; flex-direction: column; gap: 32px; min-height: 0; margin-top: 34px; padding: 25px 18px 55px; }
  .agents-demo-connection { top: 25%; right: auto; bottom: 25%; left: 50%; width: 2px; height: auto; }
  .agents-demo-connection span { top: auto; left: -6px !important; }
  .agents-demo-connection span:first-child { top: 0; }
  .agents-demo-connection span:last-child { right: auto; bottom: 0; }
  .agent-signal { top: 0; left: -4px; }
  .agents-demo.is-handoff .agent-signal { animation-name: agent-signal-down; }
  .agents-demo.is-reply .agent-signal { animation-name: agent-signal-up; }
  @keyframes agent-signal-down { from { top: 0; } to { top: calc(100% - 10px); } }
  @keyframes agent-signal-up { from { top: calc(100% - 10px); } to { top: 0; } }
  .agent-window { width: 100%; height: 300px; }
  .agent-window-body { font-size: 11px; }
  .feature-grid { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
  .feature-grid .feature-card { min-height: 650px; padding: 28px; }
  .feature-grid .feature-card-heading > p:not(.feature-kicker) { font-size: 17px; }
  .feature-grid--wide-left .feature-card:nth-child(2) .feature-card-heading h3 { font-size: clamp(37px, 7.8vw, 52px); }
  .feature-kicker { font-size: 10px; }
  .portal-demo, .flow-demo { height: 290px; }
}

@media (max-width: 440px) {
  .features-intro { padding-top: 78px; }
  .features-intro h2 { font-size: clamp(39px, 10vw, 45px); }
  .feature-card--agents { padding: 22px; }
  .feature-grid .feature-card { min-height: 630px; padding: 23px; }
  .feature-card-heading h3, .feature-grid .feature-card-heading h3, .feature-grid--wide-left .feature-card:nth-child(2) .feature-card-heading h3 { font-size: 37px; }
  .agents-demo { margin-right: -5px; margin-left: -5px; padding: 18px 12px 55px; }
  .agent-window { height: 280px; }
  .agent-window-bar { height: 39px; padding: 0 10px; font-size: 11px; }
  .agent-window-body { padding: 12px; font-size: 10px; }
  .agent-window-body p { margin-bottom: 8px; }
  .agent-window-model { display: block; margin: 2px 0 0; font-size: 9px; }
  .agents-demo.is-animated .agent-line.is-visible { margin-bottom: 8px; }
  .agent-window-composer { height: 33px; padding: 0 10px; font-size: 10px; }
  .agent-window-footer { height: 22px; gap: 5px; padding: 0 10px; font-size: 9px; }
  .agents-demo-label { bottom: 11px; left: 11px; max-width: 148px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
  .portal-demo, .flow-demo { height: 260px; }
  .portal-demo-note { top: 5%; left: 5%; width: 50%; padding: 11px; }
  .portal-demo-note small { display: none; }
  .portal-browser { top: 24%; right: 4%; width: 80%; height: 72%; }
  .portal-browser-view strong { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .agent-composer-cursor { animation: none !important; opacity: 1; }
}

/* demonstração ao vivo (promo/orpheus-promo.html), depois dos cards de portal e fluxograma */
.promo-live { margin-top: clamp(96px, 9vw, 150px); }
.promo-live-heading { text-align: center; padding: 0 20px; }
.promo-live-heading h3 {
  font-size: clamp(46px, 5vw, 88px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -.076em;
  text-wrap: balance;
}
.promo-live-heading h3 span { color: #8b8e86; }
.promo-live-heading p {
  margin-top: clamp(22px, 2.4vw, 36px);
  color: #777c74;
  font-size: clamp(18px, 1.4vw, 25px);
  line-height: 1.55;
  letter-spacing: -.025em;
}
.promo-live-sky {
  margin-top: clamp(44px, 5vw, 80px);
  padding: clamp(28px, 5vw, 96px) clamp(16px, 6vw, 130px);
  border-radius: clamp(22px, 2.2vw, 44px);
  background: #6b7fc4 url('./promo/westworld/paisagem-fundo.png') center / cover no-repeat;
  image-rendering: pixelated;
  overflow: hidden;
}
.promo-live-window {
  overflow: hidden;
  border: 1px solid #33363c;
  border-radius: clamp(12px, 1.4vw, 24px);
  aspect-ratio: 16 / 9;
  background: #111214;
  box-shadow: 0 34px 60px #06091099, 0 7px 18px #06091077;
  image-rendering: auto;
}
.promo-live-window iframe { display: block; width: 100%; height: 100%; border: 0; pointer-events: none; }
@media (max-width: 760px) {
  .promo-live-break { display: none; }
}
