:root {
  --bg: #f7f8f3;
  --surface: #ffffff;
  --surface-soft: #edf4ef;
  --ink: #121713;
  --muted: #5c665e;
  --line: #d9dfd6;
  --primary: #0f766e;
  --primary-dark: #0a4f49;
  --accent: #d7902f;
  --accent-soft: #fbefd6;
  --warning: #9d3f2e;
  --success: #2d7c55;
  --shadow: 0 24px 80px rgb(18 23 19 / 0.12);
  --radius: 8px;
  --radius-lg: 14px;
  --container: 1180px;
  --font-body: "IBM Plex Sans", sans-serif;
  --font-display: "Newsreader", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgb(18 23 19 / 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgb(18 23 19 / 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

img,
svg {
  display: block;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  transform: translateY(-150%);
  background: var(--ink);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0.75rem clamp(1rem, 3vw, 2rem);
  background: rgb(247 248 243 / 0.86);
  border-bottom: 1px solid rgb(217 223 214 / 0.76);
  backdrop-filter: blur(18px);
}

.nav-shell {
  max-width: var(--container);
  min-height: 54px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand,
.nav-cta,
.button,
.demo-tab {
  min-height: 44px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  color: var(--ink);
}

.brand-mark,
.agent-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
}

.brand-mark svg,
.agent-mark svg {
  width: 22px;
  height: 22px;
  margin: auto;
  color: white;
  stroke: white;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 600;
}

.nav-links a,
.site-footer a {
  transition: color 180ms ease;
}

.nav-links a:hover,
.site-footer a:hover {
  color: var(--primary-dark);
}

.nav-cta,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border-radius: var(--radius);
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease, border-color 180ms ease;
}

.nav-cta {
  padding: 0.65rem 0.95rem;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.92rem;
}

.nav-cta svg,
.button svg,
.demo-tab svg {
  width: 18px;
  height: 18px;
}

.nav-cta:hover,
.button:hover {
  transform: translateY(-2px);
}

.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(4rem, 7vw, 7rem) clamp(1rem, 3vw, 2rem) clamp(3rem, 5vw, 5rem);
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(340px, 1.08fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1,
h2 {
  font-family: var(--font-display);
  letter-spacing: 0;
  line-height: 0.98;
  text-wrap: balance;
}

h1 {
  max-width: 680px;
  margin-bottom: 1.4rem;
  font-size: clamp(3.1rem, 6.2vw, 5.55rem);
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
}

h3 {
  margin-bottom: 0.55rem;
  font-size: 1.12rem;
  line-height: 1.2;
}

.hero-lede,
.section-heading p,
.cta-copy p {
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.hero-lede {
  max-width: 620px;
  margin-bottom: 2rem;
}

.hero-actions,
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.button {
  padding: 0.9rem 1.15rem;
  border: 1px solid transparent;
}

.button-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 14px 30px rgb(15 118 110 / 0.2);
}

.button-primary:hover {
  background: var(--primary-dark);
}

.button-secondary {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: var(--primary);
  box-shadow: 0 12px 28px rgb(18 23 19 / 0.08);
}

.button-secondary.inverse {
  background: transparent;
  border-color: rgb(255 255 255 / 0.28);
  color: white;
}

.hero-visual {
  position: relative;
  min-width: 0;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 24px -18px -18px 38px;
  z-index: -1;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: var(--radius-lg);
}

.chat-window,
.demo-panel,
.evidence-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.chat-window {
  overflow: hidden;
}

.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.chat-agent {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.agent-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: white;
}

.agent-mark svg path {
  stroke: white;
}

.agent-mark svg {
  transform: translateY(6px);
}

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

.chat-agent span {
  color: var(--muted);
  font-size: 0.82rem;
}

.status-chip,
.confidence,
.panel-kicker {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-chip {
  padding: 0.35rem 0.6rem;
  background: var(--accent-soft);
  color: #68420f;
  white-space: nowrap;
}

.chat-stream {
  display: grid;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 1.4rem);
  min-height: 360px;
  background:
    linear-gradient(180deg, rgb(237 244 239 / 0.9), transparent),
    var(--surface);
}

.message {
  width: auto;
  max-width: min(84%, 560px);
}

.message span,
.conversation strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.message p {
  margin: 0;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  overflow-wrap: break-word;
}

.message-user {
  justify-self: end;
}

.message-user p {
  background: var(--primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.message-clara p {
  background: white;
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.gate-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.gate-list div {
  min-height: 86px;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.74);
}

.gate-list strong {
  display: block;
  color: var(--primary);
  font-size: 1.1rem;
}

.gate-list span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.chat-input {
  padding: 1rem;
  border-top: 1px solid var(--line);
}

.chat-input label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.chat-input div {
  display: flex;
  gap: 0.65rem;
}

.chat-input input {
  min-width: 0;
  width: 100%;
  min-height: 44px;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
}

.chat-input button {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: #281700;
}

.chat-input button svg {
  width: 20px;
  height: 20px;
  margin: auto;
}

.proof-strip {
  max-width: var(--container);
  margin: 0 auto clamp(3rem, 7vw, 6rem);
  padding: 0 clamp(1rem, 3vw, 2rem);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.proof-strip div {
  min-height: 104px;
  padding: 1.2rem;
  background: var(--surface);
}

.proof-strip strong,
.proof-strip span {
  display: block;
}

.proof-strip strong {
  margin-bottom: 0.25rem;
}

.proof-strip span {
  color: var(--muted);
}

.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(3.5rem, 7vw, 6rem) clamp(1rem, 3vw, 2rem);
}

.section-heading {
  max-width: 760px;
  margin-bottom: clamp(2rem, 5vw, 3.2rem);
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.method-item {
  min-height: 280px;
  padding: clamp(1.25rem, 3vw, 2rem);
  background: var(--surface);
}

.step-label {
  display: inline-block;
  margin-bottom: 4rem;
  color: var(--primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.method-item p,
.signal p,
.gap-item p {
  margin-bottom: 0;
  color: var(--muted);
}

.demo-section {
  max-width: none;
  background: #10221f;
  color: white;
}

.demo-section .section-heading,
.demo-layout {
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
}

.demo-section .eyebrow,
.demo-section .section-heading p {
  color: #9fd4c9;
}

.demo-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1rem;
}

.demo-controls {
  display: grid;
  align-content: start;
  gap: 0.75rem;
}

.demo-tab {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.06);
  color: rgb(255 255 255 / 0.72);
  font-weight: 700;
  text-align: left;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.demo-tab:hover,
.demo-tab.is-active {
  border-color: rgb(215 144 47 / 0.86);
  background: rgb(215 144 47 / 0.16);
  color: white;
}

.demo-panel {
  min-height: 430px;
  padding: clamp(1.2rem, 3vw, 2rem);
  background: #f9fbf6;
  color: var(--ink);
}

.panel-kicker {
  margin-bottom: 1rem;
  padding: 0.4rem 0.65rem;
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.demo-panel h3 {
  max-width: 760px;
  margin-bottom: 1.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1;
}

.conversation {
  display: grid;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.conversation p {
  max-width: 820px;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.output-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
}

.output-row span {
  color: rgb(255 255 255 / 0.7);
}

.evidence-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: clamp(1.2rem, 4vw, 2.5rem);
  align-items: center;
}

.evidence-card {
  overflow: hidden;
  box-shadow: 0 20px 60px rgb(18 23 19 / 0.1);
}

.evidence-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.evidence-list {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--line);
  overflow: hidden;
}

.signal {
  padding: 1.25rem;
  background: var(--surface);
}

.example {
  padding-top: clamp(2.5rem, 5vw, 4rem);
}

.gap-list {
  display: grid;
  gap: 0.85rem;
}

.gap-item {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  min-height: 126px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.gap-rank {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.confidence {
  padding: 0.45rem 0.75rem;
  background: var(--accent-soft);
  color: #68420f;
  white-space: nowrap;
}

.final-cta {
  margin-top: clamp(2rem, 5vw, 4rem);
  padding: clamp(3rem, 7vw, 5rem) clamp(1rem, 3vw, 2rem);
  background: var(--ink);
  color: white;
}

.final-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 2rem;
}

.cta-copy {
  max-width: 760px;
}

.cta-copy .eyebrow,
.cta-copy p {
  color: #a7d8cd;
}

.cta-actions {
  justify-content: flex-end;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1rem, 3vw, 2rem);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 560ms ease, transform 560ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 960px) {
  .nav-links {
    display: none;
  }

  .hero,
  .evidence-grid,
  .demo-layout,
  .final-cta {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 3rem;
    max-width: 100vw;
    overflow: hidden;
  }

  .hero-visual::before {
    inset: 18px -8px -12px 18px;
  }

  .method-grid,
  .proof-strip {
    grid-template-columns: 1fr;
  }

  .method-item {
    min-height: 220px;
  }

  .step-label {
    margin-bottom: 2rem;
  }

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

  .cta-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding-inline: 0.75rem;
  }

  .nav-shell {
    min-height: 50px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .nav-cta {
    padding: 0.6rem 0.75rem;
  }

  .hero {
    padding-inline: 1rem;
  }

  h1 {
    font-size: clamp(2.35rem, 10.8vw, 3rem);
    line-height: 1.02;
    max-width: 11ch;
    text-wrap: pretty;
  }

  .hero-lede {
    max-width: 32ch;
  }

  .hero-actions,
  .cta-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .nav-cta {
    width: auto;
    padding-inline: 0.75rem;
  }

  .nav-cta span {
    display: none;
  }

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

  .chat-stream {
    min-height: 0;
  }

  .message {
    max-width: 100%;
  }

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

  .demo-controls {
    grid-template-columns: 1fr;
  }

  .output-row,
  .gap-item,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    display: flex;
  }

  .gap-rank {
    width: 48px;
    height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}
