:root {
  --navy: #1d3557;
  --coral: #c95f4c;
  --cream: #fafaf7;
  --slate: #515b66;
  --ink: #172337;
  --line: #d8ddd8;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Avenir Next, Segoe UI, Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 78px;
  padding: 10px clamp(18px, 5vw, 56px);
  background: rgba(250, 250, 247, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: min(240px, 58vw);
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
}

nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

nav a {
  min-height: 40px;
  padding: 10px 12px;
  color: var(--navy);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(84svh - 78px);
  padding: clamp(42px, 6vw, 70px) clamp(20px, 6vw, 72px) clamp(34px, 5vw, 54px);
  background:
    linear-gradient(90deg, rgba(250, 250, 247, 0.98) 0%, rgba(250, 250, 247, 0.92) 38%, rgba(250, 250, 247, 0.26) 70%),
    url("assets/smartflow-hero-workflow.png") center right / cover no-repeat;
  overflow: hidden;
}

.hero-copy {
  position: relative;
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--coral);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 22px;
  color: var(--navy);
  font-family: Georgia, Times New Roman, serif;
  font-size: clamp(2.65rem, 5.5vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.lede {
  max-width: 680px;
  margin-bottom: 30px;
  color: var(--slate);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--navy);
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  background: var(--navy);
  color: var(--white);
}

.button.secondary {
  background: transparent;
  color: var(--navy);
}

.service,
.contact-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 48px rgba(29, 53, 87, 0.08);
}

.service p,
.contact-band p {
  margin-bottom: 0;
  color: var(--slate);
}

.section,
.contact-band {
  padding: clamp(52px, 8vw, 86px) clamp(20px, 6vw, 72px);
}

.section-heading {
  max-width: 740px;
  margin-bottom: 28px;
}

h2 {
  margin-bottom: 14px;
  color: var(--navy);
  font-family: Georgia, Times New Roman, serif;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.05;
  letter-spacing: 0;
}

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

.service {
  padding: 24px;
}

.service h3 {
  margin-bottom: 10px;
  color: var(--navy);
  font-size: 1.14rem;
}

.contact-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
  gap: clamp(24px, 5vw, 56px);
  align-items: center;
  background: var(--navy);
  color: var(--white);
}

.contact-band h2,
.contact-band .eyebrow {
  color: var(--white);
}

.contact-band p {
  max-width: 660px;
  color: rgba(255, 255, 255, 0.78);
}

.contact-card {
  display: grid;
  gap: 12px;
  padding: 24px;
  background: var(--white);
  color: var(--navy);
}

.contact-card a {
  color: var(--coral);
  font-size: 1.16rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.contact-card span {
  color: var(--slate);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(20px, 6vw, 72px);
  color: var(--slate);
  border-top: 1px solid var(--line);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.chat-widget {
  position: fixed;
  right: clamp(14px, 3vw, 28px);
  bottom: clamp(14px, 3vw, 28px);
  z-index: 20;
  font-family: Avenir Next, Segoe UI, Arial, sans-serif;
}

.chat-toggle,
.chat-form button {
  border: 0;
  border-radius: 6px;
  background: var(--coral);
  color: var(--white);
  font-weight: 800;
  cursor: pointer;
}

.chat-toggle {
  min-width: 82px;
  min-height: 50px;
  padding: 12px 18px;
  box-shadow: 0 16px 34px rgba(29, 53, 87, 0.2);
}

.chat-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  display: grid;
  width: min(380px, calc(100vw - 28px));
  max-height: min(620px, calc(100vh - 110px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: 0 24px 70px rgba(23, 35, 55, 0.28);
  overflow: hidden;
}

.chat-panel[hidden] {
  display: none;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: var(--navy);
  color: var(--white);
}

.chat-header strong,
.chat-header span {
  display: block;
}

.chat-header span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.86rem;
}

.chat-close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  background: transparent;
  color: var(--white);
  cursor: pointer;
}

.chat-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 240px;
  max-height: 360px;
  padding: 16px;
  overflow-y: auto;
  background: var(--cream);
}

.bot-message,
.user-message {
  max-width: 88%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.94rem;
}

.bot-message {
  justify-self: start;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
}

.user-message {
  justify-self: end;
  background: var(--navy);
  color: var(--white);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.chat-form input {
  min-width: 0;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

.chat-form button {
  min-height: 42px;
  padding: 0 14px;
}

.chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 12px;
  background: var(--white);
}

.chat-actions a {
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 800;
}

@media (max-width: 860px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .contact-band {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
    background:
      linear-gradient(180deg, rgba(250, 250, 247, 0.98) 0%, rgba(250, 250, 247, 0.88) 54%, rgba(250, 250, 247, 0.18) 100%),
      url("assets/smartflow-hero-workflow.png") center bottom / cover no-repeat;
    padding-bottom: 220px;
  }

  .service-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .site-header {
    min-height: 76px;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  nav a {
    padding-left: 0;
  }

  .button {
    width: 100%;
  }

  .chat-widget {
    right: 12px;
    bottom: 12px;
  }
}
