/*
  OpenRouter concept: shared tokens and the grid.

  Colors are OpenRouter's own, read from openrouter.ai's dark theme CSS,
  except --surface: theirs (#080d0f) sat so close to the page that cards
  and tiles did not read as shapes, so it is lifted to #10171a.
  The page is framed by two rails, left and right, with content a step
  inside them. A 12 column grid places things but is never drawn.
*/

:root {
  --bg: #03080a;
  --surface: #10171a;
  --fg: #fcfcfe;
  --muted: rgb(252 252 254 / 0.63);
  --faint: rgb(252 252 254 / 0.5);
  --hairline: rgb(252 252 254 / 0.08);
  /* Frame lines are opaque, like Mintlify's, so they stay one even tone over the
     glow and don't double up where two lines cross. Two weights: the frame
     (rails, full-width lines) and softer dividers inside a section. */
  --line: #1b2124;
  --line-soft: #12181b;
  --mark: #3b4346;
  --band: #05090b;

  --lime: #c8ff00;
  --violet: #7624f4;
  --blue: #4d8dff;
  --green: #00bf6f;
  --amber: #ffab00;
  --red: #ff2d55;

  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Grid */
  /* Stripe's container: 1266px rail to rail at desktop, content 16px inside the rails. */
  --max: 1266px;
  --cols: 12;
  --gutter: 24px;
  --pad: var(--s2);
  /* Distance from a rail to the edge of the window. The hero art uses it to bleed. */
  --bleed: calc((100vw - min(var(--max), 100vw - 32px)) / 2);

  /* Rhythm: one scale for the whole concept */
  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 40px;
  --s5: 64px;
  --s6: 96px;

  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The frame, as on stripe.com: one container with a hairline rail on each
   side and nothing in between. Content sits 16px inside the rails on a
   12 column grid. The columns are invisible; they only place things. */
.frame {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  column-gap: var(--gutter);
  width: min(var(--max), 100% - 32px);
  margin-inline: auto;
  padding-inline: var(--pad);
}

/* Column markers for measuring only, fixed and never drawn. */
.guides {
  position: fixed;
  inset: 0;
  pointer-events: none;
  visibility: hidden;
}
.guides .frame { height: 100%; }

/* No visible grid: the columns only place things. */

/* Nav */
/* Stays at the top on a long page; a plain fill so nothing shows through. */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.nav .frame {
  height: 64px;
  align-items: center;
}
.brand {
  grid-column: 1 / span 3;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.brand svg { width: 22px; height: 22px; }
/* Centred between the brand and the buttons. */
.nav-links {
  grid-column: 4 / span 6;
  display: flex;
  justify-content: center;
  gap: 20px;
  white-space: nowrap;
  font-size: 14px;
  color: var(--muted);
}
.nav-links a:hover { color: var(--fg); }
.nav-cta {
  grid-column: 10 / span 3;
  justify-self: end;
  display: flex;
  gap: var(--s1);
}

/* Footer: openrouter.ai's own groups on the page grid, with no lines but
   the one along its top. Brand on 4 columns, each group on 2; the
   newsletter's text and form on 6 each. */
.foot { position: relative; z-index: 2; border-top: 1px solid var(--line); }
.foot-cells > * { padding-block: var(--s4); }
.foot-cells:first-child > * { padding-top: var(--s5); }
.foot-news > * { padding-bottom: var(--s5); }
.foot-brand { grid-column: span 4; display: grid; align-content: start; gap: var(--s2); }
.foot-brand p { font-size: 13px; line-height: 18px; color: var(--muted); }
.foot-col { grid-column: span 2; display: grid; align-content: start; gap: var(--s2); }
.foot h2 { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--fg); }
.foot-col ul { list-style: none; display: grid; gap: 10px; }
.foot-col li { display: flex; align-items: center; gap: 8px; }
.foot-col a { font-size: 14px; line-height: 20px; color: var(--muted); transition: color 150ms ease; }
.foot-col a:hover { color: var(--fg); }
.foot-col li span { padding: 1px 6px; border-radius: 6px; background: rgb(77 141 255 / 0.16); color: var(--blue); font-size: 12px; line-height: 16px; }
.foot-news > div { grid-column: span 6; display: grid; align-content: start; gap: 6px; }
.foot-news > div p { font-size: 14px; line-height: 20px; color: var(--muted); max-width: 40ch; }
.foot-form { grid-column: span 6; display: grid; gap: 12px; }
.foot-form > div { display: flex; gap: var(--s1); }
.foot-form input { flex: 1; min-width: 0; height: 36px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--hairline); background: var(--surface); color: var(--fg); font: inherit; font-size: 14px; }
.foot-form input::placeholder { color: var(--faint); }
.foot-form input:focus-visible { outline: 2px solid var(--lime); outline-offset: 0; }
.foot-form p { font-size: 13px; line-height: 18px; color: var(--muted); }
.foot-form p a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgb(252 252 254 / 0.3); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--hairline);
  color: var(--fg);
  background: rgb(252 252 254 / 0.03);
  transition: background-color 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.btn:hover { background: rgb(252 252 254 / 0.07); }
.btn.primary {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--bg);
}
.btn.primary:hover { background: #d4ff3d; }
.btn:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
/* Press feedback: a slight give, on buttons only. */
.btn:active, .b-picker button:active { transform: scale(0.97); }
/* One focus ring for every link and card, the same as the buttons'. */
a:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; border-radius: 6px; }

/* Type */
.h1 {
  font-size: clamp(40px, 5.2vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
  text-wrap: balance;
}
.h1 em { font-style: normal; color: var(--lime); }
.lede {
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 34ch;
  text-wrap: pretty;
}
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
/* Mono is only for what a person would copy: model ids, paths, code. */
code, [data-code] { font-family: var(--mono); font-size: 12px; }

/* Phones: brand on its own row, then the groups two to a row. */
@media (max-width: 860px) {
  .foot-cells > *, .foot-cells:first-child > * { padding-block: var(--s3); }
  .foot-cells:first-child > .foot-brand { padding-top: var(--s5); }
  .foot-brand { grid-column: 1 / -1; }
  .foot-col { grid-column: span 6; }
  .foot-news > div, .foot-form { grid-column: 1 / -1; }
  .foot-news > div { padding-bottom: 0; }
  .foot-news > .foot-form { padding-top: 0; }
}}

/* Narrow desktops keep the five main pages. */
@media (max-width: 1180px) {
  .nav-links .extra { display: none; }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-cta { grid-column: 7 / span 6; }
  .nav-cta .btn:not(.primary) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
