/* ─── Design tokens ───────────────────────────────── */
:root {
  --background: 0 0% 100%;
  --foreground: 0 0% 3.9%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 3.9%;
  --primary: 0 0% 9%;
  --primary-foreground: 0 0% 98%;
  --secondary: 0 0% 96.1%;
  --secondary-foreground: 0 0% 9%;
  --muted: 0 0% 96.1%;
  --muted-foreground: 0 0% 45.1%;
  --border: 0 0% 89.8%;
  --ring: 0 0% 3.9%;
  --radius: 0.5rem;
}

.dark {
  --background: 0 0% 3.9%;
  --foreground: 0 0% 98%;
  --card: 0 0% 5.5%;
  --card-foreground: 0 0% 98%;
  --primary: 0 0% 98%;
  --primary-foreground: 0 0% 9%;
  --secondary: 0 0% 14.9%;
  --secondary-foreground: 0 0% 98%;
  --muted: 0 0% 14.9%;
  --muted-foreground: 0 0% 63.9%;
  --border: 0 0% 18%;
  --ring: 0 0% 83.1%;
}

/* ─── Reset ───────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial,
    sans-serif;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

/* ─── Layout ───────────────────────────────── */
.container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

/* ─── Header ───────────────────────────────── */
.topbar {
  height: 3.75rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  border-bottom: 1px solid hsl(var(--border));
  position: sticky;
  top: 0;
  background: hsl(var(--background) / 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.brand small {
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.brand-dot {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.4rem;
  display: grid;
  place-items: center;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 0.82rem;
  font-weight: 800;
}

.nav-links {
  display: inline-flex;
  gap: 1.5rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

.nav-links a {
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: hsl(var(--foreground));
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

/* ─── Theme toggle ───────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 0.1rem);
  padding: 0 0.55rem;
  height: 2.25rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.theme-toggle:hover {
  border-color: hsl(var(--ring) / 0.4);
}

.theme-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-switch {
  width: 2.2rem;
  height: 1.2rem;
  background: hsl(var(--secondary));
  border: 1px solid hsl(var(--border));
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}

.theme-switch::after {
  content: "";
  position: absolute;
  width: 0.86rem;
  height: 0.86rem;
  border-radius: 999px;
  top: 0.1rem;
  left: 0.12rem;
  background: hsl(var(--foreground));
  transition: transform 0.2s ease;
}

.theme-toggle input:checked + .theme-switch::after {
  transform: translateX(0.98rem);
}

/* ─── Buttons ───────────────────────────────── */
.btn {
  border: 1px solid hsl(var(--border));
  background: transparent;
  color: hsl(var(--foreground));
  border-radius: calc(var(--radius) - 0.1rem);
  padding: 0 0.9rem;
  height: 2.25rem;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:hover {
  opacity: 0.82;
}

.btn-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.btn-outline {
  background: hsl(var(--background));
}

.btn-lg {
  padding: 0.7rem 1.4rem;
  font-size: 0.93rem;
}

/* CTA section buttons (inverted) */
.btn-cta-primary {
  background: hsl(var(--primary-foreground));
  color: hsl(var(--primary));
  border-color: hsl(var(--primary-foreground));
}

.btn-cta-outline {
  background: transparent;
  border-color: hsl(var(--primary-foreground) / 0.35);
  color: hsl(var(--primary-foreground));
}

.btn-cta-outline:hover {
  border-color: hsl(var(--primary-foreground));
  opacity: 1;
}

/* ─── Hero ───────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  padding: 4.5rem 0 3.5rem;
  align-items: center;
}

.eyebrow {
  margin: 0;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 700;
}

.hero h1 {
  margin: 0.65rem 0 0;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.subtitle {
  margin: 1rem 0 0;
  color: hsl(var(--muted-foreground));
  max-width: 60ch;
  font-size: 0.97rem;
}

.hero-cta {
  margin-top: 1.75rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-proof {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: hsl(var(--muted-foreground));
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hero-proof::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: hsl(var(--border));
  flex-shrink: 0;
}

.hero-panel {
  border: 0;
  background: transparent;
  padding: 0;
}

.hero-panel .subtitle {
  margin-top: 0.3rem;
  max-width: none;
  font-size: 0.85rem;
}

/* ─── Logo bar ───────────────────────────────── */
.logos-bar {
  border-top: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
  padding: 1.5rem 0;
}

.logo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.logo-row span {
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  border-radius: 999px;
  padding: 0.32rem 0.7rem 0.32rem 0.45rem;
  font-size: 0.78rem;
  color: hsl(var(--muted-foreground));
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.logo-row span img {
  width: 1rem;
  height: 1rem;
  border-radius: 0.2rem;
}

/* ─── Sections ───────────────────────────────── */
.section {
  padding: 2.6rem 0;
}

.section-header {
  margin-bottom: 1rem;
}

.section-header h2 {
  margin: 0 0 0.4rem;
}

.section-header .subtitle {
  margin: 0;
}

.section h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.55rem, 2.8vw, 2.1rem);
  letter-spacing: -0.02em;
}

/* ─── Grid ───────────────────────────────── */
.grid {
  display: grid;
  gap: 1rem;
}

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

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

/* ─── Cards ───────────────────────────────── */
.card {
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  border-color: hsl(var(--ring) / 0.25);
  box-shadow: 0 2px 16px hsl(var(--foreground) / 0.06);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.card p {
  margin: 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
}

/* ─── Feature cards ───────────────────────────────── */
.feature-card {
  display: flex;
  flex-direction: column;
}

.feature-icon {
  width: 2.25rem;
  height: 2.25rem;
  background: hsl(var(--muted));
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  margin-bottom: 0.9rem;
  flex-shrink: 0;
}

.feature-icon svg {
  width: 1.1rem;
  height: 1.1rem;
  color: hsl(var(--foreground));
}

/* ─── Flow graph ───────────────────────────────── */
.flow-graph {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  padding: 2.5rem 2rem;
  position: relative;
  /* Disable card hover for this element */
  transition: none;
}

.hero-panel .flow-graph {
  margin-top: 0;
  padding: 1.5rem 1rem;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.flow-graph:hover {
  border-color: hsl(var(--border));
  box-shadow: none;
}

.flow-col {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.flow-sources {
  align-items: flex-end;
}

.flow-destinations {
  align-items: flex-start;
}

/* SVG overlay — drawn by JS */
.flow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 1;
}

.graph-node {
  border: 1px solid hsl(var(--border));
  background: hsl(var(--background));
  border-radius: var(--radius);
  padding: 0.6rem 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.84rem;
  font-weight: 500;
  position: relative;
  z-index: 2;
  white-space: nowrap;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.graph-node:hover {
  border-color: hsl(var(--ring) / 0.4);
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.08);
}

.graph-node img {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 0.2rem;
}

.graph-node.flow-core {
  width: 130px;
  height: 130px;
  border-radius: 1.25rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  display: grid;
  place-items: center;
  text-align: center;
  border-color: hsl(var(--primary));
  box-shadow: 0 4px 24px hsl(var(--foreground) / 0.14);
  transition: box-shadow 0.2s ease;
}

.graph-node.flow-core:hover {
  box-shadow: 0 6px 32px hsl(var(--foreground) / 0.22);
  border-color: hsl(var(--primary));
}

.graph-node.flow-core strong {
  font-size: 1.3rem;
  line-height: 1;
  display: block;
}

.graph-node.flow-core small {
  opacity: 0.7;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-top: 0.3rem;
}

/* ─── Stats ───────────────────────────────── */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid hsl(var(--border));
  border-bottom: 1px solid hsl(var(--border));
}

.metric-item {
  padding: 1.2rem 1rem;
}

.metric-item + .metric-item {
  border-left: 1px solid hsl(var(--border));
}

.metric-item h3 {
  margin: 0;
  font-size: 2.25rem;
  line-height: 1;
  letter-spacing: -0.03em;
}

.metric-item p {
  margin-top: 0.4rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
}

/* ─── Quotes ───────────────────────────────── */
.outcomes-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 1rem;
}

.outcome-featured {
  border-left: 3px solid hsl(var(--foreground));
  padding: 0.6rem 1rem;
  background: hsl(var(--muted) / 0.4);
  border-radius: calc(var(--radius) - 0.1rem);
}

.outcome-note {
  border-top: 1px solid hsl(var(--border));
  padding-top: 1rem;
}

.quote-mark {
  font-size: 3.5rem;
  line-height: 0.55;
  color: hsl(var(--border));
  font-family: Georgia, "Times New Roman", serif;
  user-select: none;
  display: block;
  margin-bottom: 0.5rem;
}

.quote-card p {
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.65;
}

.outcome-featured p,
.outcome-note p {
  font-size: 0.92rem;
  font-style: italic;
  line-height: 1.65;
}

.outcome-featured strong,
.outcome-note strong {
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.81rem;
  font-style: normal;
  color: hsl(var(--foreground));
}

/* ─── Security ───────────────────────────────── */
.security-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.security-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

.security-list li {
  padding: 1rem;
  border-top: 1px solid hsl(var(--border));
}

.security-list li:first-child {
  border-top: 0;
}

.security-list h3 {
  margin: 0;
  font-size: 1rem;
}

.security-list p {
  margin-top: 0.45rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
}

.security-aside {
  border: 1px dashed hsl(var(--border));
  border-radius: var(--radius);
  padding: 1rem;
}

.security-aside h3 {
  margin: 0.45rem 0 0;
}

.security-aside p {
  margin-top: 0.5rem;
  color: hsl(var(--muted-foreground));
}

/* ─── Screenshots ───────────────────────────────── */
.product-mosaic {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 1rem;
}

.screenshot-card {
  padding: 0;
}

.screenshot-card img {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  display: block;
}

.screenshot-card h3,
.screenshot-card p {
  padding-left: 0.95rem;
  padding-right: 0.95rem;
}

.screenshot-card p {
  padding-bottom: 1rem;
}

/* ─── FAQ ───────────────────────────────── */
.faq-list {
  display: grid;
  gap: 0.7rem;
}

.faq-list details {
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  background: hsl(var(--card));
}

.faq-list details h3 {
  margin: 0;
  font-size: 0.97rem;
}

.faq-list details summary {
  margin: 0;
  font-size: 0.97rem;
  font-weight: 600;
  cursor: pointer;
}

.faq-list details p {
  margin-top: 0.55rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.9rem;
}

/* ─── CTA section ───────────────────────────────── */
.cta-section {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  padding: 5.5rem 0;
  margin-top: 1rem;
}

.cta-inner {
  text-align: center;
}

.cta-section h2 {
  color: hsl(var(--primary-foreground));
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.cta-section .subtitle {
  color: hsl(var(--primary-foreground) / 0.7);
  max-width: 52ch;
  margin-inline: auto;
}

.cta-section .hero-cta {
  justify-content: center;
}

/* ─── Footer ───────────────────────────────── */
.footer {
  border-top: 1px solid hsl(var(--border));
  padding: 1.5rem 0 2.25rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.83rem;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-links {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
}

.footer-links a {
  color: hsl(var(--muted-foreground));
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: hsl(var(--foreground));
}

.footer-copy {
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

/* ─── Legal pages ───────────────────────────────── */
.legal-page {
  max-width: 860px;
}

.legal-page h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
  letter-spacing: -0.02em;
}

.legal-content h2 {
  margin: 1.25rem 0 0.45rem;
  font-size: 1.05rem;
}

.legal-content p,
.legal-content li {
  color: hsl(var(--muted-foreground));
  font-size: 0.92rem;
}

.legal-content ul {
  margin: 0.35rem 0 0;
  padding-left: 1rem;
}

.legal-content a {
  text-decoration: underline;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.legal-table th,
.legal-table td {
  text-align: left;
  padding: 0.65rem 0.7rem;
  border-top: 1px solid hsl(var(--border));
  font-size: 0.9rem;
}

.legal-table thead th {
  border-top: 0;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
}

/* ─── Responsive: tablet ───────────────────────────────── */
@media (max-width: 980px) {
  .hero,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .metric-strip {
    grid-template-columns: 1fr;
  }

  .metric-item + .metric-item {
    border-left: 0;
    border-top: 1px solid hsl(var(--border));
  }

  .outcomes-layout,
  .security-layout,
  .product-mosaic {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 3rem 0 2.5rem;
  }

  .hero-panel .flow-graph {
    padding: 1.25rem 0.9rem;
  }

  .nav-links {
    display: none;
  }
}

/* ─── Responsive: mobile ───────────────────────────────── */
@media (max-width: 640px) {
  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 0.6rem 0;
  }

  .topbar-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .topbar-actions .btn {
    flex: 1;
  }

  /* Stack flow graph vertically on mobile */
  .flow-graph {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 1.25rem;
    padding: 1.75rem 1.25rem;
    justify-items: center;
  }

  .flow-sources,
  .flow-destinations {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
  }

  .section {
    padding: 2rem 0;
  }

  .cta-section {
    padding: 3.75rem 0;
  }

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

  .footer-copy {
    text-align: left;
  }
}
