:root {
  --navy: #071322;
  --navy-2: #0b1b2e;
  --navy-3: #102842;
  --gold: #d8b76f;
  --gold-soft: #f0dba9;
  --paper: #f7f4ed;
  --ink: #071322;
  --muted: #8fa0af;
  --line: rgba(255,255,255,.14);
  --shadow: 0 30px 90px rgba(0,0,0,.32);
  --z-page: 1;
  --z-carousel: 2;
  --z-chat: 10;
  --z-dropdown: 100;
  --z-overlay: 900;
  --z-sheet: 1000;
  --z-chat-max: 2000;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--navy);
  color: white;
  font-family: "DM Sans", Arial, sans-serif;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.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;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 30;
  height: 86px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 clamp(20px, 6vw, 96px);
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
}

.header-logo {
  width: 180px;
  height: 66px;
  flex: 0 0 180px;
  background-image: url("../images/header-reference.png");
  background-repeat: no-repeat;
  background-size: 1440px 900px;
  background-position: -128px -125px;
}

.desktop-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 34px;
}

.desktop-nav a {
  color: #082247;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}

.header-cta {
  min-width: 150px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #1ebe5d;
  background: #25d366;
  color: #fff;
  padding: 0 20px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(37, 211, 102, .22);
  font-weight: 800;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.header-cta svg {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
}

.header-cta:hover {
  background: #1ebe5d;
  color: white;
  box-shadow: 0 14px 30px rgba(37, 211, 102, .3);
  transform: translateY(-1px);
}

.header-cta:focus-visible {
  outline: 3px solid rgba(37, 211, 102, .34);
  outline-offset: 3px;
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 0;
  background: transparent;
}

.menu-button span {
  display: block;
  height: 2px;
  margin: 7px 5px;
  background: #082247;
}

.mobile-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 50;
  width: min(88vw, 390px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 92px 28px 32px;
  background: linear-gradient(160deg, #071322, #0f2b47);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform .25s ease;
}

.mobile-panel.open {
  transform: none;
}

.mobile-panel a {
  padding: 17px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  font: 700 24px "Manrope", sans-serif;
}

.panel-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: white;
  font-size: 30px;
}

.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 520px);
  align-items: center;
  gap: clamp(28px, 6vw, 88px);
  padding: 136px clamp(20px, 6vw, 96px) 72px;
  background:
    radial-gradient(circle at 78% 32%, rgba(58,103,136,.34), transparent 34%),
    linear-gradient(135deg, #071322, #0b1b2e 58%, #102944);
}

.microcopy {
  margin: 0 0 18px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .14em;
  font: 800 11px "Manrope", sans-serif;
}

.hero h1 {
  max-width: 790px;
  margin: 0;
  font: 700 clamp(44px, 5.2vw, 76px)/1.02 "Manrope", sans-serif;
  letter-spacing: 0;
}

.mobile-title,
.mobile-lead {
  display: none;
}

.desktop-lead,
.mobile-lead {
  max-width: 650px;
  margin: 28px 0 30px;
  color: #bdc8d2;
  font-size: 18px;
  line-height: 1.65;
}

.hero-cta {
  min-height: 50px;
  border: 0;
  border-radius: 6px;
  background: var(--gold);
  color: var(--ink);
  padding: 0 24px;
  font-weight: 900;
}

.chat-shell {
  position: relative;
  z-index: var(--z-chat);
  height: min(760px, calc(100svh - 160px));
  min-height: 650px;
  max-height: calc(100svh - 160px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(216,183,111,.32);
  border-radius: 18px;
  background: rgba(10,28,47,.88);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.chat-shell.maximized {
  position: fixed;
  inset: 0;
  z-index: var(--z-chat-max);
  height: 100dvh;
  max-height: none;
  border-radius: 0;
}

body.chat-is-maximized {
  overflow: hidden;
}

.chat-toolbar {
  flex: 0 0 auto;
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 18px 18px, rgba(216,183,111,.13), transparent 32px),
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.025));
}

.agent-meta {
  position: relative;
  min-width: 0;
  padding-left: 16px;
}

.agent-meta::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #61d394;
  box-shadow: 0 0 0 4px rgba(97,211,148,.12), 0 0 18px rgba(97,211,148,.4);
}

.agent-meta strong,
.agent-meta small,
.agent-meta span {
  display: block;
}

.agent-meta strong {
  color: #fff;
  font: 900 18px "Manrope", sans-serif;
  letter-spacing: -.02em;
}

.agent-meta small {
  color: #d2dce6;
  font-size: 12px;
  margin-top: 2px;
}

.status {
  color: #77d59b;
  font-size: 11px;
  margin-top: 4px;
  line-height: 1;
}

.icon-button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  color: white;
  display: inline-grid;
  place-items: center;
}

.ai-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(216,183,111,.36);
  border-radius: 999px;
  background: rgba(216,183,111,.08);
  color: #f4dfad;
  padding: 0 11px;
  font-size: 11px;
  white-space: nowrap;
}

.menu-dot {
  margin-left: auto;
}

.chat-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: transparent;
}

.chat-menu {
  position: absolute;
  top: 62px;
  right: 14px;
  z-index: var(--z-dropdown);
  width: min(270px, calc(100% - 28px));
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(216,183,111,.18);
  border-radius: 16px;
  background: #0b1b2e;
  box-shadow: 0 20px 60px rgba(0,0,0,.38);
}

.chat-menu-title {
  display: none;
}

.chat-menu p {
  margin: 8px 4px 2px;
  color: var(--gold-soft);
  font: 900 10px "Manrope", sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.chat-menu button {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  color: white;
  min-height: 38px;
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
}

.chat-state {
  flex: 0 0 auto;
  min-height: 0;
  color: #f1d496;
  padding: 0 18px;
  font-size: 12px;
}

.memory-note {
  flex: 0 0 auto;
  display: none;
  margin: 7px 18px 0;
  color: #9fb0bf;
  font-size: 11px;
  line-height: 1.4;
}

.project-panel {
  flex: 0 0 auto;
  display: none;
  margin: 10px 18px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.035);
  padding: 12px;
}

.project-panel strong,
.project-panel span {
  display: block;
}

.project-panel strong {
  color: var(--gold-soft);
  font-size: 12px;
}

.project-panel span {
  color: #b5c2ce;
  font-size: 12px;
  margin-top: 5px;
  line-height: 1.35;
}

.chat-state:not(:empty) {
  padding-top: 12px;
}

.messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px;
  overscroll-behavior: contain;
}

.day-label {
  margin: 2px 0 16px;
  text-align: center;
  color: #7f91a2;
  font-size: 12px;
}

.message {
  max-width: 86%;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 16px;
  line-height: 1.55;
  font-size: 14.5px;
}

.message p {
  margin: 0;
}

.message.bot {
  background: #17314a;
  color: #f4f8fb;
  border-bottom-left-radius: 5px;
}

.message.user {
  max-width: 80%;
  margin-left: auto;
  background: var(--gold);
  color: var(--ink);
  border-bottom-right-radius: 5px;
}

.typing-indicator {
  flex: 0 0 auto;
  width: 62px;
  margin: 0 18px 10px;
  padding: 11px 13px;
  border-radius: 16px 16px 16px 5px;
  background: #17314a;
}

.typing-indicator span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 0 2px;
  border-radius: 50%;
  background: var(--gold);
  animation: typing 1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) { animation-delay: .12s; }
.typing-indicator span:nth-child(3) { animation-delay: .24s; }

@keyframes typing {
  50% { opacity: .35; transform: translateY(3px); }
}

.quick-replies {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  min-height: 42px;
  max-height: 42px;
  padding: 7px 18px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  border-top: 1px solid var(--line);
}

.quick-replies button {
  flex: 0 0 auto;
  max-width: 170px;
  min-height: 30px;
  max-height: 30px;
  border: 1px solid rgba(216,183,111,.5);
  border-radius: 999px;
  background: rgba(216,183,111,.06);
  color: #eedaa8;
  padding: 7px 11px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-replies::-webkit-scrollbar {
  display: none;
}

.composer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 48px;
  align-items: end;
  gap: 8px;
  margin: 0 18px 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  min-height: 56px;
  max-height: 118px;
}

.composer textarea {
  width: 100%;
  max-height: 92px;
  min-height: 38px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: white;
  padding: 9px;
  line-height: 1.4;
}

.composer button {
  width: 48px;
  min-height: 38px;
  border: 0;
  border-radius: 11px;
  background: var(--gold);
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.composer-meta {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 24px;
  max-height: 26px;
  padding: 0 18px max(9px, env(safe-area-inset-bottom));
  color: #8fa0af;
  font-size: 11px;
  overflow: hidden;
}

.composer-meta button,
.composer-meta a {
  border: 0;
  background: transparent;
  color: #aebdcc;
  text-decoration: none;
  font-size: 11px;
  padding: 0;
}

.composer-meta button::after,
.composer-meta a::after {
  content: "·";
  margin-left: 7px;
  color: #647689;
}

.composer-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer button:disabled,
.quick-replies button:disabled {
  opacity: .55;
  cursor: wait;
}

.composer-meta .primary-whatsapp {
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  padding: 6px 10px;
  font-weight: 900;
}

.composer-meta .primary-whatsapp::after {
  content: "";
  margin: 0;
}

.client-projects {
  position: relative;
  z-index: var(--z-carousel);
  clear: both;
  padding: 34px clamp(20px, 6vw, 96px) 52px;
  background: linear-gradient(180deg, #071322, #081726 68%, #050d17);
  color: white;
  overflow: hidden;
}

.client-carousel {
  position: relative;
}

.client-carousel-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  cursor: grab;
}

.client-carousel-viewport::-webkit-scrollbar {
  display: none;
}

.client-carousel-viewport.dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.client-carousel-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(210px, 18vw, 270px);
  gap: 14px;
  padding: 6px 2px 12px;
}

.client-card {
  min-height: 238px;
  display: grid;
  grid-template-rows: 132px auto auto;
  align-items: center;
  gap: 9px;
  scroll-snap-align: start;
  border: 1px solid rgba(216,183,111,.18);
  border-radius: 18px;
  background: rgba(255,255,255,.055);
  box-shadow: 0 18px 50px rgba(0,0,0,.22);
  padding: 16px;
  text-align: center;
  text-decoration: none;
  transition: transform .25s ease, border-color .25s ease, background .25s ease;
}

.client-card:hover,
.client-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(216,183,111,.46);
  background: rgba(255,255,255,.085);
  outline: none;
}

.client-logo-wrap {
  width: 100%;
  height: 132px;
  min-height: 0;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255,255,255,.95);
  padding: 18px;
  overflow: hidden;
}

.client-logo-wrap img {
  width: auto;
  max-width: 100%;
  max-height: 96px;
  height: auto;
  object-fit: contain;
  display: block;
}

.client-card strong {
  color: #f7f4ed;
  font: 900 15px "Manrope", sans-serif;
}

.client-card small {
  min-width: 0;
  color: #aebdcc;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.client-carousel-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(216,183,111,.35);
  border-radius: 50%;
  background: rgba(7,19,34,.88);
  color: var(--gold-soft);
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
  font-size: 28px;
  transform: translateY(-50%);
}

.client-carousel-arrow:hover,
.client-carousel-arrow:focus-visible {
  background: var(--gold);
  color: var(--ink);
  outline: none;
}

.client-carousel-arrow.prev {
  left: -18px;
}

.client-carousel-arrow.next {
  right: -18px;
}

.portfolio-note {
  margin: 14px 0 0;
  color: #7f91a2;
  font-size: 12px;
  text-align: center;
}

footer {
  display: grid;
  place-items: center;
  padding: 18px clamp(20px, 6vw, 96px);
  background: #050d17;
  color: #95a5b5;
}

footer small {
  color: #95a5b5;
  font-size: 12px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 118px;
  }

  .chat-shell {
    max-height: none;
  }
}

@media (max-width: 820px) {
  .site-header {
    height: 74px;
    padding: 0 20px;
  }

  .header-logo {
    width: 154px;
    height: 58px;
    flex-basis: 154px;
    background-size: 1240px 775px;
    background-position: -110px -107px;
  }

  .desktop-nav,
  .header-cta {
    display: none;
  }

  .menu-button {
    display: block;
  }

  .hero {
    min-height: auto;
    padding: 92px 16px 32px;
    gap: 18px;
  }

  .hero-copy {
    padding: 0 4px;
  }

  .desktop-title,
  .desktop-lead,
  .hero-cta {
    display: none;
  }

  .mobile-title,
  .mobile-lead {
    display: inline;
  }

  .microcopy {
    margin-bottom: 10px;
    font-size: 10px;
  }

  .hero h1 {
    font-size: clamp(30px, 8.2vw, 38px);
    line-height: 1.08;
  }

  .mobile-lead {
    display: block;
    margin: 14px 0 16px;
    font-size: 15px;
    line-height: 1.48;
  }

  .chat-shell {
    height: min(720px, calc(100dvh - 92px));
    min-height: 0;
    max-height: none;
    border-radius: 16px;
    backdrop-filter: none;
  }

  .chat-shell.maximized {
    height: 100dvh;
    border-radius: 0;
  }

  .chat-toolbar {
    min-height: 66px;
    padding: 10px 12px;
  }

  .chat-menu-backdrop {
    z-index: var(--z-overlay);
    background: rgba(1,7,14,.46);
  }

  .chat-menu {
    position: fixed;
    inset: auto 10px 10px;
    z-index: var(--z-sheet);
    width: auto;
    max-height: 65dvh;
    overflow-y: auto;
    border-radius: 22px 22px 16px 16px;
    padding: 14px;
  }

  .chat-menu-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
  }

  .chat-menu-title strong {
    color: white;
    font: 900 14px "Manrope", sans-serif;
  }

  .chat-menu-title button {
    width: 34px;
    min-height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    text-align: center;
    font-size: 20px;
  }

  .agent-meta strong {
    font-size: 15px;
  }

  .agent-meta small {
    font-size: 11px;
  }

  .ai-chip {
    display: none;
  }

  .messages {
    padding: 14px 16px;
  }

  .memory-note,
  .project-panel {
    display: none;
  }

  .message {
    max-width: 88%;
    font-size: 14px;
  }

  .quick-replies {
    min-height: 40px;
    padding: 6px 14px;
  }

  .quick-replies button {
    min-height: 30px;
    max-width: 145px;
  }

  .composer {
    margin: 0 14px 5px;
    min-height: 56px;
  }

  .composer-meta {
    padding-left: 14px;
    padding-right: 14px;
  }

  .client-projects {
    padding: 30px 20px 44px;
  }

  .client-carousel-track {
    grid-auto-columns: minmax(220px, 42vw);
  }

  .client-carousel-arrow {
    display: none;
  }

  footer {
    padding: 16px 20px;
  }
}

@media (max-width: 380px) {
  .hero {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero h1 {
    font-size: 29px;
  }

  .icon-button {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .quick-replies button {
    max-width: 220px;
  }

  .chat-shell {
    height: min(700px, calc(100dvh - 82px));
    min-height: 0;
  }

  .chat-toolbar {
    padding: 10px;
  }

  .messages {
    padding: 10px;
  }

  .message {
    margin-bottom: 8px;
    padding: 10px 12px;
  }

  .client-projects {
    padding-left: 16px;
    padding-right: 16px;
  }

  .client-carousel-track {
    grid-auto-columns: minmax(218px, 78vw);
  }

  .client-card {
    min-height: 220px;
    grid-template-rows: 116px auto auto;
  }

  .client-logo-wrap {
    height: 116px;
    padding: 14px;
  }

  .client-logo-wrap img {
    max-height: 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .client-carousel-viewport {
    scroll-behavior: auto;
  }

  .client-card {
    transition: none;
  }
}
