/*
 * AgentObs landing page.
 *
 * Shares the dashboard's design tokens (src/server/public/app.css) so the
 * marketing page and the product look like one thing. Colors come from the
 * same validated palette; light values on bare :root, dark redefined under
 * both the OS media query and an explicit [data-theme] scope.
 */

:root {
  color-scheme: light;

  --page: #f9f9f7;
  --surface: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --border: rgba(11, 11, 11, 0.1);
  --raised: rgba(11, 11, 11, 0.04);

  --series-1: #2a78d6;
  --series-3: #1baf7a;
  --status-critical: #d03b3b;

  --radius: 12px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.05), 0 12px 32px -16px rgba(11, 11, 11, 0.16);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --border: rgba(255, 255, 255, 0.1);
    --raised: rgba(255, 255, 255, 0.05);
    --series-1: #3987e5;
    --series-3: #199e70;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 32px -16px rgba(0, 0, 0, 0.7);
  }
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--series-1);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

code {
  font-family: var(--mono);
  font-size: 0.9em;
}

.skip-link {
  position: absolute;
  left: -9999px;
  background: var(--surface);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  z-index: 10;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--series-1);
  outline-offset: 2px;
}

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

.nav {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--series-1), var(--series-3));
}

.brand-name {
  font-weight: 660;
  letter-spacing: -0.01em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
}

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

.nav-cta {
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface);
}

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

.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 24px 40px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 3.9rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 690;
}

.lede {
  margin: 20px auto 0;
  max-width: 620px;
  font-size: clamp(1rem, 2.2vw, 1.16rem);
  color: var(--text-secondary);
}

.install {
  margin: 34px auto 0;
  max-width: 480px;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.install code {
  flex: 1;
  padding: 13px 16px;
  text-align: left;
  font-size: 14px;
  overflow-x: auto;
  white-space: nowrap;
}

.install button {
  appearance: none;
  border: 0;
  border-left: 1px solid var(--border);
  background: var(--raised);
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 0 18px;
  cursor: pointer;
  min-width: 92px;
}
.install button:hover {
  color: var(--text-primary);
}

.install-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- strip ---------- */

.strip {
  max-width: 1080px;
  margin: 26px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  text-align: center;
}

.strip div {
  padding: 18px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.strip strong {
  display: block;
  font-size: 15px;
}

.strip span {
  font-size: 13px;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .strip {
    grid-template-columns: 1fr;
  }
}

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

.section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 64px 24px 0;
}

.section h2 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  letter-spacing: -0.02em;
  font-weight: 670;
}

.section-lede {
  margin: 0 0 28px;
  max-width: 660px;
  color: var(--text-secondary);
}

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

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}

.steps li {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.step-n {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--series-1);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 660;
}

.steps h3 {
  margin: 2px 0 10px;
  font-size: 16px;
  font-weight: 640;
}

.steps p {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.steps > li > div {
  min-width: 0;
  flex: 1;
}

pre {
  margin: 0;
  padding: 14px 16px;
  background: var(--raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.55;
}

pre code {
  font-size: inherit;
}

.terminal {
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-bottom: 34px;
}

.terminal .prompt {
  color: var(--text-muted);
}

.terminal .bad {
  color: var(--status-critical);
  font-weight: 660;
}

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

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

.cards article {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.cards h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 640;
}

.cards p {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
}

@media (max-width: 860px) {
  .cards {
    grid-template-columns: 1fr;
  }
}

/* ---------- checks ---------- */

.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.checks li {
  position: relative;
  padding-left: 30px;
  font-size: 15px;
  color: var(--text-secondary);
}

.checks li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: -1px;
  color: var(--series-3);
  font-weight: 700;
}

.checks strong {
  color: var(--text-primary);
  font-weight: 620;
}

.cta-row {
  margin: 34px 0 0;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  background: var(--series-1);
  color: #fff;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 620;
  border: 1px solid transparent;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn-ghost {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
}

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

.footer {
  max-width: 1080px;
  margin: 72px auto 0;
  padding: 26px 24px 44px;
  border-top: 1px solid var(--grid);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--text-muted);
}

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

/* ---------- product screenshot ---------- */

.shot {
  margin: 54px auto 0;
  max-width: 1000px;
}

/*
 * A browser-chrome frame around the screenshot. It reads as "this is a real
 * running app" rather than a marketing illustration, which is the whole
 * reason the image is here.
 */
.shot-frame {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow:
    0 2px 4px rgba(11, 11, 11, 0.04),
    0 24px 64px -24px rgba(11, 11, 11, 0.28);
  overflow: hidden;
}

.shot-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--raised);
}

.shot-bar span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--grid);
}

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

.shot figcaption {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .shot-frame {
    box-shadow:
      0 2px 4px rgba(0, 0, 0, 0.4),
      0 24px 64px -24px rgba(0, 0, 0, 0.8);
  }
}

/* ---------- narrow screens ---------- */

/*
 * The page must never scroll horizontally. The nav's link row and the
 * install command are the two things that push past the viewport on a
 * phone, so both are given explicit narrow-screen behaviour rather than
 * relying on flex-wrap alone.
 */
@media (max-width: 760px) {
  .nav {
    padding: 16px 18px;
    justify-content: center;
    gap: 12px;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    gap: 16px;
    font-size: 13.5px;
    flex-wrap: wrap;
  }

  .hero {
    padding: 36px 18px 28px;
  }

  h1 {
    /* The hard <br> is a desktop line break; let it reflow naturally here. */
    font-size: clamp(1.9rem, 8.5vw, 2.6rem);
  }

  .desktop-break {
    display: none;
  }

  .install {
    max-width: 100%;
  }

  .install code {
    font-size: 12.5px;
    padding: 12px;
  }

  .install button {
    min-width: 74px;
    padding: 0 12px;
  }

  .section,
  .strip {
    padding-left: 18px;
    padding-right: 18px;
  }

  .section {
    padding-top: 44px;
  }

  .shot {
    margin-top: 34px;
  }

  .steps li {
    padding: 16px 16px;
    gap: 14px;
  }

  .footer {
    padding-left: 18px;
    padding-right: 18px;
  }
}

/* Belt and braces: no element may create a horizontal scrollbar. */
body {
  overflow-x: hidden;
}

img,
pre,
table {
  max-width: 100%;
}

/* ---------- demo animation ---------- */

.demo {
  margin: 0 0 34px;
}

.demo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

/* The logo replaces the old gradient square, so drop the square's styling. */
img.brand-mark {
  background: none;
  border-radius: 7px;
}

/* ---------- comparison table ---------- */

.compare {
  font-size: 14px;
}

.compare th,
.compare td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--grid);
  text-align: left;
}

.compare thead th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 650;
  border-bottom: 1px solid var(--border);
}

/* The last column is ours, so give it a quiet tint rather than a loud one -
   a comparison table that shouts loses the credibility it is there to build. */
.compare th:last-child,
.compare td:last-child {
  background: color-mix(in srgb, var(--series-1) 6%, transparent);
  font-weight: 600;
}

/* Visually hidden, still announced.
   The answer cells show a mark drawn in CSS, which a screen reader cannot see
   and in-page search cannot find - so the word itself ships in the markup and
   is clipped rather than removed. display:none would hide it from both. */
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Answer cells
   Icon-only, centred, with the word carried in a tooltip and for screen
   readers. Reading eighteen rows of "Yes"/"No" as text is slow; a column of
   marks can be scanned in one pass. The mark is a shape as well as a colour,
   so the table survives grayscale printing and colour-vision deficiency -
   never colour alone. */
.compare td.y,
.compare td.n,
.compare td.p {
  text-align: center;
  font-size: 0;               /* hide the text node; ::before carries the mark */
  line-height: 1;
  white-space: nowrap;
}

.compare td.y::before,
.compare td.n::before,
.compare td.p::before {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  font-family: var(--font);
  line-height: 1;
}

/* Yes: a filled tick on a tinted disc. */
.compare td.y::before {
  content: '✓';
  color: var(--series-3);
  background: color-mix(in srgb, var(--series-3) 14%, transparent);
}

/* No: a hollow ring rather than a cross. A cross reads as an error, and a
   competitor lacking a feature is not an error. */
.compare td.n::before {
  content: '';
  border: 1.5px solid var(--grid);
  background: transparent;
}

/* Partial: a half-filled disc for a qualified answer. */
.compare td.p::before {
  content: '';
  border: 1.5px solid color-mix(in srgb, var(--series-2, var(--text-muted)) 55%, transparent);
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--series-2, var(--text-muted)) 30%, transparent) 50%,
    transparent 50%
  );
}

/* Cells carrying a real value - a count, or a word like "Some" - stay textual
   and centred alongside the marks. */
.compare tbody td:not(:first-child) {
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

/* The qualifier under a partial mark: what "partly" actually means, so the
   reader never has to guess. */
.compare .qual {
  display: block;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  margin-top: 5px;
  color: var(--text-muted);
  white-space: normal;
}

.compare td.p .qual {
  font-size: 11px;            /* re-assert: parent sets font-size 0 */
}

.compare-caption {
  caption-side: top;
  text-align: left;
  padding: 0 0 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 74ch;
}

/* A legend, because an icon table without one asks the reader to infer. */
.compare-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
  color: var(--text-muted);
}

.compare-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compare-legend i {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  font-style: normal;
  flex: none;
}

.compare-legend .lg-y {
  content: '✓';
  color: var(--series-3);
  background: color-mix(in srgb, var(--series-3) 14%, transparent);
}
.compare-legend .lg-y::before { content: '✓'; }
.compare-legend .lg-n { border: 1.5px solid var(--grid); }
.compare-legend .lg-p {
  border: 1.5px solid color-mix(in srgb, var(--series-2, var(--text-muted)) 55%, transparent);
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--series-2, var(--text-muted)) 30%, transparent) 50%,
    transparent 50%
  );
}

/* Grouping rows by the question they answer - seeing, stopping, knowing -
   turns eighteen flat rows into four readable ideas, and stops the eye from
   reading a long column of marks as a rigged table. */
.compare tr.group th {
  padding: 22px 14px 9px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 650;
  color: var(--text-primary);
  background: var(--raised);
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.compare tbody tr.group:first-child th {
  padding-top: 12px;
}

/* FAQ
   Native <details> rather than JS: it is keyboard accessible, findable with
   the browser's own in-page search when open, and degrades to plain visible
   text with styles off - which matters because a crawler reading this page
   should see the answers, not an empty shell. */
.faq {
  display: grid;
  gap: 0;
  margin-top: 32px;
  border-top: 1px solid var(--border);
}

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

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 20px 44px 20px 0;
  position: relative;
  font-size: 1.02rem;
  font-weight: 560;
  letter-spacing: -0.011em;
  color: var(--text-primary);
  transition: color 0.15s ease;
}

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

.faq summary:hover {
  color: var(--accent, var(--text-primary));
}

.faq summary:focus-visible {
  outline: 2px solid var(--accent, #2a78d6);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* A rotating chevron drawn in CSS - no icon font, no extra request. */
.faq summary::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 1.8px solid var(--text-muted);
  border-bottom: 1.8px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg);
  transition: transform 0.2s ease;
}

.faq details[open] summary::after {
  transform: translateY(-30%) rotate(-135deg);
}

.faq details p {
  margin: 0;
  padding: 0 clamp(0px, 6vw, 72px) 24px 0;
  color: var(--text-secondary);
  line-height: 1.62;
  max-width: 68ch;
}

@media (prefers-reduced-motion: reduce) {
  .faq summary,
  .faq summary::after {
    transition: none;
  }
}

/* Footer legal
   Small and quiet, but present on every page view - the disclaimer is worth
   nothing if it only exists in a file nobody opens. */
.footer-legal {
  flex-basis: 100%;
  margin: 18px 0 0;
  max-width: 78ch;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.footer-legal a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-legal a:hover {
  color: var(--text-secondary);
}

/* ==========================================================================
   Guardrail additions
   Extends the shared AgentObs tokens above so the two product pages read as
   one system. Only what Guardrail's page needs beyond the base sheet.
   ========================================================================== */

/* Verdict colouring in terminal transcripts. Colour is never the only signal -
   the words BLOCK / ASK / allow carry the meaning on their own, so the page
   stays readable in monochrome and to colour-blind readers. */
.terminal .t-block {
  color: var(--status-critical);
  font-weight: 680;
}

.terminal .t-ask {
  /* Amber reads as "attention" in both themes without competing with the
     critical red; defined inline rather than as a token because this is the
     only place a caution colour appears. */
  color: #b26a00;
  font-weight: 680;
}

.terminal .t-allow {
  color: var(--series-3);
  font-weight: 620;
}

.terminal .t-add {
  color: var(--series-1);
  font-weight: 660;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .terminal .t-ask {
    color: #e2a03f;
  }
}

:root[data-theme='dark'] .terminal .t-ask {
  color: #e2a03f;
}

/* The base sheet styles `.cards article`; Guardrail's cards are plain divs so
   the same treatment is extended to them, and the grid is allowed to reflow to
   two columns rather than being locked at three - these cards hold more text. */
.cards > div {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.cards > div > h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 640;
}

.cards ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.65;
}

.cards li {
  margin-bottom: 4px;
}

/* A terminal nested inside a card is an illustration, not the page's main
   exhibit: it drops the shadow and the large bottom margin so it sits as part
   of the card rather than floating over it. */
.cards .terminal {
  box-shadow: none;
  margin: 12px 0 0;
  font-size: 12.5px;
  border: 1px solid var(--border);
}

/* Wide content must scroll inside its own box; the page body never scrolls
   sideways. */
.terminal {
  overflow-x: auto;
}

/* The hero centres its text, which a nested <pre> would otherwise inherit -
   centred code is unreadable. AgentObs's hero holds a screenshot, so this only
   arises on Guardrail's page, where the exhibit is a terminal transcript. */
.terminal,
.terminal code {
  text-align: left;
}

/* The install command sits alone in the hero on this page rather than beside a
   Copy button in a bordered row, so it needs its own centring. */
.hero .install {
  justify-content: center;
}

/* Four cards in an auto-fit grid wrap 3 + 1, leaving an orphan on its own
   row. Capping this group at two columns balances it 2x2 at desktop width
   while still collapsing to one column on a phone. */
#poisoning .cards {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  max-width: 860px;
}
