.automation-page {
  overflow-x: hidden;
}

.automation-page .site-header {
  position: sticky;
}

.automation-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4.5rem, 9vw, 7.5rem) 0;
  background:
    radial-gradient(ellipse at 82% 25%, rgba(197, 166, 106, .14), transparent 34%),
    var(--navy);
  color: var(--ivory);
}

.automation-hero::after {
  position: absolute;
  top: -15rem;
  right: -9rem;
  width: 38rem;
  height: 38rem;
  border: 1px solid rgba(212, 185, 127, .17);
  border-radius: 50%;
  box-shadow: 0 0 0 2.5rem rgba(197, 166, 106, .025), 0 0 0 5rem rgba(197, 166, 106, .02);
  content: "";
  pointer-events: none;
}

.automation-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 860px;
}

.automation-hero .eyebrow {
  color: var(--gold-soft);
}

.demo-ribbon {
  display: inline-block;
  margin-top: .5rem;
  padding: .45rem .65rem;
  border: 1px solid rgba(212, 185, 127, .5);
  color: #f0dfb9;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.automation-hero h1 {
  max-width: 12ch;
  margin: 1.4rem 0 1rem;
  color: var(--ivory);
  font-size: clamp(3rem, 7.4vw, 6rem);
  letter-spacing: -.04em;
}

.automation-hero h1 em {
  color: var(--gold-soft);
  font-weight: 500;
}

.automation-hero-client {
  color: var(--white);
  font: 600 1.35rem/1.35 var(--serif);
}

.automation-hero-client span {
  display: block;
  margin-top: .15rem;
  color: #c0c6cc;
  font: 400 .9rem/1.5 var(--sans);
}

.automation-hero-copy {
  max-width: 42rem;
  margin-top: 1.2rem;
  color: #c3cbd2;
  font-size: 1.05rem;
}

.automation-hero .btn {
  margin-top: 1.65rem;
}

.automation-disclaimer {
  max-width: 48rem;
  margin-top: 1.1rem;
  color: #c0c6cc;
  font-size: .8rem;
}

.demo-section {
  background: #fbfaf7;
}

.automation-page .section-heading {
  max-width: 54rem;
  margin-bottom: 2.25rem;
}

.automation-page .section-heading h2,
.value-layout h2 {
  font-size: clamp(2.1rem, 4vw, 3.2rem);
}

.automation-page .section-heading > p:not(.eyebrow) {
  margin-top: .8rem;
}

.demo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, .65fr);
  align-items: start;
  gap: clamp(1.25rem, 3vw, 2rem);
}

.chat-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: 1rem 1.2rem;
  background: var(--navy);
  color: var(--ivory);
}

.chat-avatar {
  display: grid;
  width: 2.7rem;
  height: 2.7rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(212, 185, 127, .5);
  border-radius: 50%;
  color: var(--gold-soft);
  font: 600 .9rem var(--serif);
}

.chat-header h3 {
  color: var(--ivory);
  font: 600 1.05rem/1.25 var(--sans);
}

.chat-header p {
  margin-top: .15rem;
  color: #c0c6cc;
  font-size: .75rem;
}

.demo-status {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
  padding: .28rem .45rem;
  border: 1px solid rgba(212, 185, 127, .38);
  border-radius: 99px;
  color: var(--gold-soft);
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .1em;
}

.demo-status span {
  width: .42rem;
  height: .42rem;
  border-radius: 50%;
  background: var(--gold-soft);
}

.chat-disclaimer {
  padding: .55rem 1rem;
  border-bottom: 1px solid #e8e4dc;
  background: #f4f1ea;
  color: #515d68;
  font-size: .72rem;
  text-align: center;
}

.chat-log {
  display: flex;
  min-height: 410px;
  max-height: 620px;
  flex-direction: column;
  gap: .8rem;
  overflow-y: auto;
  padding: 1.1rem;
  background:
    radial-gradient(circle at 1px 1px, rgba(16, 24, 32, .045) 1px, transparent 0) 0 0 / 18px 18px,
    #f7f5f0;
  scroll-behavior: smooth;
}

.chat-message {
  width: fit-content;
  max-width: min(94%, 38rem);
  padding: .8rem .9rem;
  border: 1px solid #e3ded4;
  border-radius: 4px 12px 12px 12px;
  background: var(--white);
  box-shadow: 0 2px 6px rgba(16, 24, 32, .04);
}

.chat-message--user {
  align-self: flex-end;
  border-color: #e3d8bf;
  border-radius: 12px 4px 12px 12px;
  background: #f4eddd;
}

.chat-message > p {
  color: var(--navy);
  font-size: .9rem;
  line-height: 1.6;
  white-space: pre-line;
}

.chat-message .message-kicker {
  display: block;
  margin-bottom: .35rem;
  color: #78602f;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.chat-options {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .75rem;
}

.chat-choice,
.chat-form button,
.chat-message .secondary-action {
  min-height: 40px;
  padding: .55rem .75rem;
  border: 1px solid #b8a678;
  border-radius: 4px;
  background: var(--white);
  color: var(--navy);
  font: 600 .78rem/1.35 var(--sans);
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.chat-choice:hover,
.chat-form button:hover,
.chat-message .secondary-action:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: #f8f5ee;
}

.chat-form {
  display: grid;
  gap: .8rem;
  margin-top: .85rem;
}

.chat-form label {
  display: grid;
  gap: .3rem;
  color: #263440;
  font-size: .75rem;
  font-weight: 600;
}

.chat-form input,
.chat-form select,
.chat-form textarea {
  width: 100%;
  min-height: 42px;
  padding: .6rem .65rem;
  border: 1px solid #8a939d;
  border-radius: 4px;
  background: var(--white);
  color: var(--navy);
  font: 400 .85rem/1.4 var(--sans);
}

.chat-form textarea {
  min-height: 88px;
  resize: vertical;
}

.chat-form input:focus-visible,
.chat-form select:focus-visible,
.chat-form textarea:focus-visible,
.chat-form button:focus-visible,
.chat-choice:focus-visible,
.chat-message .secondary-action:focus-visible {
  outline: 2px solid #705a2c;
  outline-offset: 2px;
}

.field-note {
  color: #596573;
  font-size: .7rem;
  font-weight: 400;
}

.chat-form button {
  justify-self: start;
  background: var(--navy);
  color: var(--ivory);
}

.chat-form button:hover {
  background: #1a2531;
  color: var(--white);
}

.lead-summary {
  display: grid;
  gap: .5rem;
  margin-top: .75rem;
  padding: .85rem;
  border: 1px solid #ded5c2;
  border-radius: 5px;
  background: #fbfaf6;
}

.lead-summary h4 {
  color: var(--navy);
  font: 600 1.15rem var(--serif);
}

.lead-summary dl {
  display: grid;
  grid-template-columns: minmax(90px, .7fr) minmax(0, 1.3fr);
  gap: .35rem .7rem;
  margin: 0;
  font-size: .77rem;
}

.lead-summary dt {
  color: #596573;
}

.lead-summary dd {
  margin: 0;
  color: var(--navy);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.handoff-card {
  margin-top: .75rem;
  padding: .85rem;
  border-left: 3px solid #8a6d32;
  background: #f8f3e7;
}

.handoff-card strong {
  display: block;
  color: var(--navy);
  font-size: .85rem;
}

.handoff-card p {
  margin-top: .35rem;
  font-size: .77rem;
}

.chat-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 1rem;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.chat-footer > span {
  color: #596573;
  font-size: .7rem;
}

.text-button {
  padding: .3rem;
  border: 0;
  background: transparent;
  color: #56431e;
  font: 700 .75rem var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.demo-side {
  display: grid;
  gap: 1rem;
}

.demo-side-card,
.demo-safety {
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
}

.demo-side-card h3 {
  margin: .2rem 0 .65rem;
  font-size: 1.65rem;
}

.demo-side-card > p:not(.eyebrow) {
  font-size: .88rem;
}

.demo-facts {
  display: grid;
  gap: .7rem;
  margin: 1.1rem 0 0;
  padding: .9rem 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.demo-facts li {
  display: grid;
  gap: .08rem;
}

.demo-facts span {
  color: #596573;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.demo-facts strong {
  color: var(--navy);
  font-size: .85rem;
}

.demo-safety {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  background: #f5f1e7;
}

.safety-mark {
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #78602f;
  border-radius: 50%;
  color: #59451f;
  font-weight: 700;
}

.demo-safety p {
  color: #3e4a55;
  font-size: .78rem;
}

.demo-safety strong {
  display: block;
  margin-bottom: .15rem;
  color: var(--navy);
}

.workflow-section {
  background: var(--white);
}

.workflow-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .85rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: workflow;
}

.workflow-map li {
  position: relative;
  display: grid;
  min-height: 118px;
  align-content: center;
  gap: .22rem;
  padding: 1rem 2.3rem 1rem 1rem;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fbfaf7;
}

.workflow-map li::after {
  position: absolute;
  top: 50%;
  right: .75rem;
  color: #94743a;
  content: "→";
  font-size: 1.2rem;
  transform: translateY(-50%);
}

.workflow-map li:nth-child(3n)::after {
  content: "↓";
}

.workflow-map .workflow-handoff {
  border-color: #b7a16e;
  background: #f5f0e3;
}

.workflow-index {
  color: #82672f;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
}

.workflow-map strong {
  color: var(--navy);
  font: 600 1.25rem/1.15 var(--serif);
}

.workflow-map small {
  color: #596573;
  font-size: .72rem;
}

.workflow-note {
  margin-top: .85rem;
  color: #596573;
  font-size: .78rem;
}

.scenarios-section {
  background: #fbfaf7;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.scenario-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}

.scenario-card > span {
  color: #82672f;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
}

.scenario-card h3 {
  margin: .55rem 0;
  color: var(--navy);
  font: 600 1.45rem/1.2 var(--serif);
}

.scenario-card p {
  font-size: .82rem;
}

.scenario-card strong {
  margin-top: auto;
  padding-top: .9rem;
  color: #33424e;
  font-size: .75rem;
  line-height: 1.5;
}

.value-section {
  background: var(--white);
}

.value-layout {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 7vw, 6rem);
  align-items: center;
}

.value-intro {
  margin-top: .9rem;
  font-size: .92rem;
}

.value-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem 1.2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.value-list li {
  position: relative;
  padding: .7rem .2rem .7rem 1.4rem;
  border-bottom: 1px solid var(--line);
  color: #36434e;
  font-size: .85rem;
}

.value-list li::before {
  position: absolute;
  top: .82rem;
  left: .15rem;
  width: .55rem;
  height: .3rem;
  border-bottom: 2px solid #94743a;
  border-left: 2px solid #94743a;
  content: "";
  transform: rotate(-45deg);
}

.automation-cta {
  max-width: 760px;
  margin-inline: auto;
}

.automation-cta h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.automation-cta > p:not(.eyebrow) {
  margin-top: .7rem;
}

.automation-page .footer-aside {
  align-items: flex-end;
}

@media (max-width: 900px) {
  .demo-layout {
    grid-template-columns: 1fr;
  }

  .demo-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-map li:nth-child(3n)::after {
    content: "→";
  }

  .workflow-map li:nth-child(2n)::after {
    content: "↓";
  }

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

@media (max-width: 640px) {
  .automation-hero {
    padding: 4rem 0;
  }

  .automation-hero h1 {
    font-size: clamp(2.8rem, 13vw, 4.2rem);
  }

  .demo-side,
  .workflow-map,
  .scenario-grid,
  .value-layout,
  .value-list {
    grid-template-columns: 1fr;
  }

  .workflow-map li::after,
  .workflow-map li:nth-child(2n)::after,
  .workflow-map li:nth-child(3n)::after {
    content: "↓";
  }

  .workflow-map li:last-child::after {
    content: "";
  }

  .chat-log {
    min-height: 360px;
    max-height: 560px;
    padding: .8rem;
  }

  .chat-message {
    max-width: 98%;
  }

  .chat-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .automation-page .cta-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .automation-page .cta-actions .btn {
    width: 100%;
    text-align: center;
  }
}

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

  .chat-choice,
  .chat-form button,
  .chat-message .secondary-action {
    transition: none;
  }
}
