/* Fonara Search MCP — product surface stylesheet.
 *
 * Palette and theme: literal token values from
 * spec/decision-record-2026-11-30-d7-product-visual-system.md (D7), which
 * inherits them from the live www.fonaralabs.com build. They are copied as
 * literals on purpose: this surface is static on Cloudflare Pages, the parent
 * site is Next.js on Vercel, and an @import would couple the two releases.
 *
 * Type, layout, components: product-specific, per D7 and copy v4 §6.
 * No other brand hue appears anywhere in this file.
 */

:root {
  --background: #010813;
  --surface: #06101c;
  --foreground: #f4f2ed;
  --muted: #aaa9a5;
  --gold: #e9a32b;
  --gold-soft: #f4c86d;
  --border: rgba(255, 255, 255, 0.16);

  --hair: rgba(255, 255, 255, 0.08);
  --raise: rgba(255, 255, 255, 0.03);
  --raise-2: rgba(255, 255, 255, 0.06);

  --container: 1400px;
  --width-prose: 68ch;
  --nav-h: 70px;

  --sans:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (min-width: 1100px) {
  :root {
    --nav-h: 80px;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 24px);
}

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-feature-settings:
    "kern" 1,
    "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* A single, quiet warm-light wash behind the hero. It is atmosphere, not
 * ornament: no gradient stops that could read as a second brand colour. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 620px;
  pointer-events: none;
  background: radial-gradient(
    120% 90% at 50% -30%,
    rgba(233, 163, 43, 0.06) 0%,
    rgba(233, 163, 43, 0) 62%
  );
  z-index: 0;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--gold);
  text-decoration: none;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  transition: color 0.16s var(--ease);
}

a:hover {
  color: var(--gold-soft);
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 3px;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  text-wrap: balance;
}

p {
  margin: 0 0 1.1em;
}

p:last-child {
  margin-bottom: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

code {
  font-family: var(--mono);
  font-size: 0.86em;
  padding: 0.12em 0.36em;
  border-radius: 4px;
  background: var(--raise-2);
  color: var(--foreground);
  /* Endpoint URLs are long; they wrap rather than push the page sideways. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border: 1px solid var(--gold);
  padding: 10px 16px;
  border-radius: 8px;
}

.skip:focus {
  left: 16px;
  top: 16px;
}

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

.wrap {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}

/* ---------------------------------------------------------------- nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(1, 8, 19, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hair);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  color: var(--foreground);
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
}

.brand:hover {
  color: var(--foreground);
  text-decoration: none;
}

.brand .brand-product {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.86rem;
  letter-spacing: 0;
  padding-left: 10px;
  border-left: 1px solid var(--border);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 30px);
  font-size: 0.92rem;
}

.nav-links a {
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--foreground);
  text-decoration: none;
}

.nav-links a[aria-current="page"] {
  color: var(--gold);
}

/* --------------------------------------------------------------- hero */

.hero {
  position: relative;
  z-index: 1;
  padding: clamp(48px, 7vw, 96px) 0 clamp(40px, 5vw, 72px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  font-size: clamp(1.95rem, 3.9vw, 3rem);
  letter-spacing: -0.035em;
  line-height: 1.06;
  max-width: 22ch;
}

.hero .subhead {
  margin: 22px 0 0;
  max-width: 52ch;
  font-size: clamp(1.03rem, 1.35vw, 1.15rem);
  color: var(--muted);
  line-height: 1.6;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 14px;
  margin: 30px 0 0;
}

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--foreground);
  --btn-border: var(--border);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.72em 1.15em;
  border-radius: 8px;
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 0.95rem;
  font-weight: 550;
  line-height: 1.2;
  transition:
    background 0.16s var(--ease),
    border-color 0.16s var(--ease),
    color 0.16s var(--ease),
    transform 0.16s var(--ease);
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  --btn-bg: var(--gold);
  --btn-fg: var(--background);
  --btn-border: var(--gold);
  font-weight: 600;
}

.btn-primary:hover {
  --btn-bg: var(--gold-soft);
  --btn-border: var(--gold-soft);
  --btn-fg: var(--background);
}

.btn-secondary:hover {
  --btn-border: rgba(255, 255, 255, 0.4);
  --btn-bg: var(--raise);
}

.btn-quiet {
  --btn-border: transparent;
  --btn-fg: var(--gold);
  padding-left: 0.35em;
  padding-right: 0.35em;
}

.btn-quiet:hover {
  --btn-fg: var(--gold-soft);
  --btn-bg: transparent;
}

.micro {
  margin: 24px 0 0;
  max-width: 54ch;
  font-size: 0.86rem;
  line-height: 1.62;
  color: var(--muted);
}

.micro span {
  display: block;
}

.micro .micro-line + .micro-line {
  margin-top: 6px;
}

.provider-line {
  margin: 26px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--hair);
  font-size: 0.84rem;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.provider-line strong {
  display: block;
  margin-bottom: 4px;
  color: var(--foreground);
  font-weight: 550;
  letter-spacing: 0.04em;
}

/* -------------------------------------------------------- merge visual */

.merge {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surface), rgba(6, 16, 28, 0.72));
  padding: 18px;
  box-shadow: 0 22px 60px -30px rgba(0, 0, 0, 0.9);
}

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

.src {
  border: 1px solid var(--hair);
  border-radius: 9px;
  background: var(--raise);
  padding: 10px 9px;
  min-width: 0;
}

.src h3 {
  margin: 0 0 9px;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.src ol {
  list-style: none;
  display: grid;
  gap: 7px;
}

.src li {
  font-family: var(--mono);
  font-size: 0.64rem;
  line-height: 1.25;
  color: var(--muted);
  padding-bottom: 7px;
  border-bottom: 1px solid var(--hair);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.src li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.converge {
  margin: 2px 0 0;
  height: 30px;
  width: 100%;
}

.converge path {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
}

.merge-field {
  border: 1px solid var(--hair);
  border-radius: 9px;
  background: rgba(1, 8, 19, 0.55);
  padding: 4px 10px 8px;
}

.mrow {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--hair);
}

.mrow:first-child {
  border-top: 0;
}

.badge {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--raise-2);
  color: var(--foreground);
  font-family: var(--mono);
  font-size: 0.66rem;
  line-height: 1;
}

.murl {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--foreground);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.murl em {
  font-style: normal;
  color: var(--muted);
}

.mby {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.01em;
  color: var(--muted);
  white-space: nowrap;
}

/* The provenance column is the first thing to go when the panel narrows:
 * the counts and the URLs carry the diagram, the engine-ranks detail is
 * decoration at small widths. */
@media (max-width: 1240px) {
  .mby {
    display: none;
  }
}

.mrow.is-overlap {
  background: linear-gradient(90deg, var(--raise-2), rgba(255, 255, 255, 0) 78%);
  border-radius: 6px;
  margin-inline: -6px;
  padding-inline: 6px;
}

.mrow.is-overlap .murl {
  font-weight: 550;
}

.legend {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--hair);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  .mrow.is-overlap {
    animation: settle 0.5s var(--ease) both;
  }

  .merge-field .mrow:nth-child(2) {
    animation-delay: 0.06s;
  }

  .merge-field .mrow:nth-child(3) {
    animation-delay: 0.12s;
  }

  .merge-field .mrow:nth-child(4) {
    animation-delay: 0.18s;
  }

  .merge-field .mrow:nth-child(5) {
    animation-delay: 0.24s;
  }

  .merge-field .mrow:nth-child(6) {
    animation-delay: 0.3s;
  }

  .merge-field .mrow:nth-child(7) {
    animation-delay: 0.36s;
  }
}

@keyframes settle {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ----------------------------------------------------------- sections */

.section {
  position: relative;
  z-index: 1;
  padding: clamp(48px, 6vw, 88px) 0;
  border-top: 1px solid var(--hair);
}

.section-head {
  max-width: 44ch;
  margin-bottom: clamp(26px, 3vw, 40px);
}

.section-head h2 {
  font-size: clamp(1.65rem, 2.9vw, 2.35rem);
  letter-spacing: -0.03em;
  max-width: 22ch;
}

.label {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.prose {
  max-width: var(--width-prose);
  color: var(--muted);
}

.prose strong {
  color: var(--foreground);
  font-weight: 600;
}

.prose p + p {
  margin-top: 1.05em;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: start;
}

.split .prose {
  max-width: 60ch;
}

/* -------------------------------------------------------------- cards */

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--hair);
  border: 1px solid var(--hair);
  border-radius: 12px;
  overflow: hidden;
}

.card {
  background: var(--background);
  padding: clamp(20px, 2.4vw, 30px);
}

.card h3 {
  font-size: 1.02rem;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}

.card p {
  font-size: 0.94rem;
  color: var(--muted);
  line-height: 1.62;
}

.card p + p {
  margin-top: 0.9em;
}

.card .qualifier {
  font-size: 0.85rem;
  color: rgba(170, 169, 165, 0.82);
  border-left: 1px solid var(--border);
  padding-left: 12px;
}

.card .badge-inline {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  margin: 0 2px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--raise-2);
  color: var(--foreground);
  font-family: var(--mono);
  font-size: 0.68rem;
  vertical-align: 1px;
}

/* -------------------------------------------------------------- steps */

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  margin: 0 0 clamp(30px, 4vw, 48px);
  list-style: none;
  counter-reset: step;
}

.steps li {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.steps .step-n {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
}

.steps h3 {
  margin: 8px 0 10px;
  font-size: 1.02rem;
}

.steps p {
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.62;
}

/* ---------------------------------------------------------- code blocks */

.tech {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.6vw, 32px);
}

.code-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
  min-width: 0;
}

.code-block > h3 {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hair);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--foreground);
  tab-size: 2;
}

pre code {
  padding: 0;
  background: none;
  font-size: inherit;
  white-space: pre;
}

pre.tall {
  max-height: 420px;
  overflow-y: auto;
}

.caption {
  margin: 12px 0 0;
  font-size: 0.83rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 78ch;
}

.mt-md {
  margin-top: 22px;
}

.mt-lg {
  margin-top: 28px;
}

/* Section headings that carry v4's section label rather than a headline
 * (the FOR AGENTS and FAQ blocks have no headline in the approved copy). */
.section-head h2.label {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: none;
  line-height: 1.6;
}

.bridge {
  margin: 26px 0 0;
  max-width: 56ch;
  padding-left: 16px;
  border-left: 1px solid var(--border);
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--foreground);
}

/* -------------------------------------------------------------- lists */

.fit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 5vw, 64px);
}

.fit-col h3 {
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.fit-col ul {
  list-style: none;
  display: grid;
  gap: 14px;
}

.fit-col li {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
  padding-left: 16px;
  position: relative;
}

.fit-col li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 1px;
  background: var(--border);
}

.fit-col li strong {
  color: var(--foreground);
  font-weight: 600;
}

/* ------------------------------------------------------------- tables */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 640px;
}

caption {
  caption-side: top;
  text-align: left;
  padding: 12px 16px 0;
  font-size: 0.8rem;
  color: var(--muted);
}

th,
td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hair);
  vertical-align: top;
  line-height: 1.5;
}

thead th {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody th {
  font-weight: 550;
  color: var(--foreground);
  white-space: nowrap;
}

tbody td {
  color: var(--muted);
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody td strong {
  color: var(--foreground);
  font-weight: 600;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* ---------------------------------------------------------------- faq */

.faq {
  max-width: 78ch;
  border-top: 1px solid var(--hair);
}

.faq details {
  border-bottom: 1px solid var(--hair);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 30px 18px 0;
  position: relative;
  font-size: 1rem;
  font-weight: 550;
  color: var(--foreground);
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--muted);
}

.faq details[open] summary::after {
  content: "–";
}

.faq .answer {
  padding: 0 0 20px;
  max-width: 70ch;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--muted);
}

.faq .answer p + p {
  margin-top: 0.9em;
}

/* ------------------------------------------------------------- invite */

.invite {
  padding: clamp(56px, 7vw, 100px) 0;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), var(--background));
}

.invite h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.9rem);
  max-width: 24ch;
  letter-spacing: -0.03em;
}

.invite p {
  margin: 18px 0 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ------------------------------------------------------------- footer */

.footer {
  padding: 40px 0 56px;
  border-top: 1px solid var(--hair);
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 40px;
  justify-content: space-between;
  align-items: flex-start;
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.footer a {
  color: var(--muted);
}

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

.footer .entity {
  max-width: 46ch;
  line-height: 1.6;
}

/* -------------------------------------------------------- page header */

.page-head {
  padding: clamp(44px, 6vw, 84px) 0 clamp(30px, 4vw, 52px);
  position: relative;
  z-index: 1;
}

.page-head h1 {
  font-size: clamp(2.15rem, 4.4vw, 3.4rem);
  letter-spacing: -0.035em;
  max-width: 20ch;
}

.page-head .subhead {
  margin: 20px 0 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.62;
}

.section-tight {
  padding-top: 0;
  border-top: 0;
}

.note {
  margin-top: 14px;
  max-width: 78ch;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--muted);
  padding: 14px 16px;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: var(--raise);
}

.note strong {
  color: var(--foreground);
  font-weight: 600;
}

/* ----------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .merge {
    max-width: 660px;
  }

  .hero h1 {
    max-width: 24ch;
  }
}

@media (max-width: 980px) {
  .split,
  .tech,
  .fit-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero h1 {
    max-width: 18ch;
  }

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

@media (max-width: 720px) {
  body {
    font-size: 1rem;
  }

  .steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

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

  .src {
    padding: 8px 6px;
  }

  .src li {
    font-size: 0.58rem;
  }

  .mrow {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .mby {
    grid-column: 2;
    white-space: normal;
  }

  .footer-grid {
    flex-direction: column;
    gap: 24px;
  }
}

@media print {
  body::before,
  .nav {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
