/* Section 3: OpenRouter's four cards as a bento, in five visions. One sans,
   mono only in code, one plain fill for cards. Colour comes from the labs'
   and providers' own marks; lime marks one thing per card. */

.features { position: relative; z-index: 2; }
.features .frame { padding-block: var(--s6); row-gap: var(--s4); }
.features-head { grid-column: 1 / -1; display: grid; gap: var(--s2); justify-items: center; text-align: center; }
.features-head h2 { font-size: 32px; line-height: 36px; font-weight: 500; letter-spacing: -0.02em; }
.features-head p { max-width: 52ch; font-size: 15px; line-height: 1.55; color: var(--muted); }
.fx-host { grid-column: 1 / -1; min-width: 0; display: grid; gap: var(--s3); }
.b-source { text-align: center; font-size: 13px; line-height: 18px; color: var(--muted); }

/* The model picker. */
.b-picker { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.b-picker > span { font-size: 14px; line-height: 20px; color: var(--muted); margin-right: 6px; }
.b-picker button {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 0; border-radius: 6px;
  font: inherit; font-size: 14px; line-height: 20px; background: transparent; color: var(--muted); cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
}
.b-picker button:hover { color: var(--fg); }
.b-picker button[aria-pressed="true"] { background: var(--surface); color: var(--fg); }
.b-picker button:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.b-picker .b-glyph { width: 14px; height: 14px; }

/* Shared card frame: visual on top, title and a line under. Picking a model
   rebuilds the cards; they fade in over 150ms so the swap is not a jump. */
.b-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s2); }
.b-card { transition: opacity 150ms ease; }
@starting-style { .b-card { opacity: 0; } }
.b-grid.still .b-card { transition: none; }
.b-card { display: grid; grid-template-rows: 1fr auto; gap: var(--s3); padding: var(--s3); border-radius: 6px; background: var(--surface); min-width: 0; overflow: hidden; }
.b-modal, .b-policy { grid-column: span 7; }
.b-avail, .b-price { grid-column: span 5; }
.b-vis { display: grid; align-content: center; gap: var(--s2); min-height: 248px; min-width: 0; position: relative; }
.b-cap { display: grid; gap: 4px; }
.b-cap h3 { font-size: 16px; line-height: 20px; font-weight: 500; color: var(--fg); }
.b-cap p { font-size: 14px; line-height: 20px; color: var(--muted); }
.b-note { font-size: 13px; line-height: 18px; color: var(--muted); text-align: center; }
.b-note b { font-weight: 500; color: var(--fg); }
.b-card .lo, .b-note .lo { color: var(--lime); }
.b-ends { display: flex; justify-content: space-between; font-size: 13px; line-height: 18px; color: var(--muted); }
.b-ends b { font-weight: 500; color: var(--fg); font-variant-numeric: tabular-nums; }

/* Marks. */
.b-glyph { display: block; width: 18px; height: 18px; background: currentColor; -webkit-mask-position: center; mask-position: center; -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; flex: none; }
.b-tile { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--bg); flex: none; }
.b-tile img { width: 22px; height: 22px; object-fit: contain; border-radius: 4px; }
.b-tile.sm img { width: 16px; height: 16px; }
.b-tile em { font-style: normal; font-weight: 600; font-size: 13px; line-height: 1; color: var(--fg); letter-spacing: 0.02em; }
.b-tile.sm { width: 28px; height: 28px; border-radius: 7px; }
.b-tile.sm .b-glyph { width: 14px; height: 14px; }
.b-tile.sm em { font-size: 12px; }

/* 1. Routes. */
.r-hub { position: relative; width: min(100%, 260px); aspect-ratio: 1; justify-self: center; }
.r-hub svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.r-hub line { stroke: rgb(252 252 254 / 0.12); stroke-width: 0.4; stroke-dasharray: 1.2 1.6; }
.r-spot { position: absolute; transform: translate(-50%, -50%); }
.r-core { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 8px 12px; border-radius: 999px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--lime); font-size: 13px; line-height: 18px; font-weight: 500; white-space: nowrap; }
.r-chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.r-chips li { padding: 4px 10px; border-radius: 6px; background: var(--bg); font-size: 13px; line-height: 18px; color: var(--muted); }
.r-chips b { font-weight: 500; color: var(--fg); }
.r-route { display: grid; gap: 0; justify-items: stretch; }
.r-model { justify-self: center; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 6px; background: var(--bg); }
.r-model code { color: var(--fg); }
.r-wires { position: relative; height: 60px; }
.r-wires svg { width: 100%; height: 100%; display: block; }
.r-wires path { fill: none; stroke: rgb(252 252 254 / 0.16); stroke-width: 1; vector-effect: non-scaling-stroke; transition: stroke 300ms ease; }
.r-wires path.on { stroke: var(--lime); }
.r-packet { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--lime); transition: left 500ms ease, top 500ms ease; }
.r-providers { list-style: none; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; }
.r-providers li { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 10px 4px; border-radius: 8px; background: var(--bg); font-size: 12px; line-height: 16px; color: var(--muted); transition: opacity 300ms ease, box-shadow 300ms ease; }
.r-providers li b { font-size: 13px; font-weight: 500; color: var(--fg); font-variant-numeric: tabular-nums; }
.r-providers li.on { box-shadow: inset 0 0 0 1px var(--lime); }
.r-providers li.down { opacity: 0.35; }
.r-route .b-note { margin-top: var(--s2); }

/* The two lower cards: line art at the card's width. Grey hairlines for the
   field, white for the one to compare against, lime for the one that matters. */
.lw { min-width: 0; }
.lw svg { display: block; overflow: visible; }
.lw text { font-size: 12px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.lw .lw-n { font-size: 13px; fill: var(--fg); }
.lw .lw-v { font-size: 13px; font-weight: 500; fill: var(--fg); }
.lw .lw-v.lime { fill: var(--lime); }
.lw line { fill: none; stroke-width: 1; }
.lw-axis { stroke: rgb(252 252 254 / 0.24); }
.lw-grid { stroke: rgb(252 252 254 / 0.08); }
.lw-fill { fill: rgb(252 252 254 / 0.2); }
.lw-fill-w { fill: var(--fg); }
.lw-gate { stroke: rgb(252 252 254 / 0.16); stroke-dasharray: 2 3; }
.lw-l { stroke: rgb(252 252 254 / 0.22); }
.lw-w { stroke: var(--fg); }
.lw-lime { stroke: var(--lime); stroke-width: 1.5; }
.lw-stop { stroke: rgb(252 252 254 / 0.5); }
.lw-dot { fill: rgb(252 252 254 / 0.4); }
.lw-fill-lime { fill: var(--lime); }
.lw .lw-halo { paint-order: stroke; stroke: var(--surface); stroke-width: 8px; stroke-linejoin: round; }

/* Data policies: a prompt wired to the servers that delete it, and blocked
   from the ones that keep a copy. */
.pv { display: grid; grid-template-columns: auto minmax(40px, 120px) minmax(0, 1fr); align-items: center; }
.pv-msg span { display: block; padding: 12px 16px; border-radius: 14px 14px 14px 4px; background: var(--fg); color: var(--bg); font-size: 15px; line-height: 20px; font-weight: 500; white-space: nowrap; }
.pv-wire { width: 100%; height: 100%; display: block; }
.pv-wire.down { display: none; }
.pv-wire path { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.pv-wire .on { stroke: var(--lime); }
.pv-wire .off { stroke: rgb(252 252 254 / 0.24); stroke-dasharray: 3 4; }
.pv-groups { display: grid; grid-auto-rows: 1fr; gap: var(--s2); }
.pv-wire { align-self: stretch; }
.pv-g { position: relative; display: grid; align-content: center; gap: var(--s1); padding: 14px 16px; max-width: 400px; border-radius: 6px; background: var(--bg); }
.pv-servers { display: flex; flex-wrap: wrap; gap: 6px; }
.pv-servers i { display: block; width: 20px; height: 22px; }
.pv-servers svg { display: block; width: 100%; height: 100%; }
.pv-servers rect { fill: none; stroke-width: 1.2; }
.pv-g.ok rect { stroke: var(--lime); }
.pv-g.ok circle { fill: var(--lime); }
.pv-g.no rect { stroke: rgb(252 252 254 / 0.3); }
.pv-g.no circle { fill: rgb(252 252 254 / 0.3); }
.pv-g p { font-size: 13px; line-height: 18px; color: var(--muted); }
.pv-g p b { font-weight: 500; color: var(--fg); font-variant-numeric: tabular-nums; }
.pv-g.ok p b { color: var(--lime); }
/* Where the grey wire meets the blocked group: a small cross. */
.pv-x { position: absolute; left: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--surface); }
.pv-x::before, .pv-x::after { content: ""; position: absolute; left: 2px; top: 5.5px; width: 8px; height: 1.5px; background: rgb(252 252 254 / 0.6); transform: rotate(45deg); }
.pv-x::after { transform: rotate(-45deg); }

@media (max-width: 860px) {
  .features .frame { padding-block: var(--s5); }
  .b-grid { grid-template-columns: 1fr; }
  .b-modal, .b-policy, .b-avail, .b-price { grid-column: auto; }
  .b-picker { justify-content: flex-start; }
  .b-picker > span { width: 100%; }
  .r-providers { gap: 4px; }
  /* On a phone the prompt sits on top and wires down to the two groups, side by side. */
  .pv { grid-template-columns: 1fr; justify-items: center; }
  .pv-wire { display: none; }
  .pv-wire.down { display: block; height: 40px; }
  .pv-groups { grid-template-columns: 1fr 1fr; grid-auto-rows: auto; align-items: start; gap: var(--s1); width: 100%; }
  .pv-g { padding: 10px 12px; align-content: start; }
  .pv-servers { gap: 4px; }
  .pv-servers i { width: 14px; height: 16px; }
  .pv-x { left: 50%; top: -6px; margin: 0 0 0 -6px; }
  .r-providers li { padding: 10px 2px; }
  .r-providers li span { font-size: 12px; hyphens: auto; overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  .b-picker button, .r-wires path, .r-packet, .r-providers li { transition: none; }
}
