/*
 * The public storefront. Plain CSS on purpose: these pages load no script and no component library,
 * so everything they look like is in this file. The palette, the face and the pill buttons are
 * nuvtools.com's, which the portal (BuildTheme in the WebAssembly project) and the Nuv Tools Account
 * wear too, so a visitor moving between the site, the catalogue and the sign-in stays in one family.
 * No inline styles anywhere — the storefront's Content-Security-Policy refuses them. The font is
 * served from this origin, the only source the policy's font-src allows.
 *
 * One idea carries the design: what is sold here is an address. Each page opens on the site's navy
 * band, and the request a subscriber will write is set there in the page's largest monospace line.
 * Monospace appears nowhere else but on addresses and code; amber appears nowhere else but on the
 * verb of that request and on focus inside the dark areas.
 */

@font-face {
    font-family: "Plus Jakarta Sans";
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations");
}

:root {
    --sf-primary: #056b95;
    --sf-primary-dark: #04425b;
    --sf-navy: #04425b;
    --sf-blue: #0090c6;
    --sf-action: #e96b20;
    --sf-action-dark: #cf5a14;
    --sf-ink: #04425b;
    --sf-ink-text: #e6f1f6;
    --sf-ink-muted: #a8c6d4;
    --sf-ink-line: #1d5a72;
    --sf-signal: #faa749;
    --sf-background: #f2f6f8;
    --sf-surface: #ffffff;
    --sf-text: #10242e;
    --sf-muted: #536772;
    --sf-border: #dbe4e9;
    --sf-warning-background: #fff6e0;
    --sf-warning-border: #faa749;
    --sf-radius: 10px;
    --sf-radius-panel: 14px;
    --sf-shadow: 0 10px 30px -12px rgb(4 66 91 / .25);
    --sf-width: 72rem;
    --sf-measure: 68ch;
    --sf-mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--sf-text);
    background: var(--sf-background);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--sf-primary);
    text-underline-offset: .15em;
}

a:hover {
    color: var(--sf-primary-dark);
}

:focus-visible {
    outline: 3px solid var(--sf-primary);
    outline-offset: 2px;
}

h1,
h2,
h3 {
    line-height: 1.2;
    margin: 0 0 .5rem;
    color: var(--sf-navy);
}

h1 {
    font-size: clamp(2rem, 4.5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -.015em;
}

h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

code,
pre {
    font-family: var(--sf-mono);
}

.sf-container {
    width: 100%;
    max-width: var(--sf-width);
    margin: 0 auto;
    padding: 0 1.25rem;
}

.sf-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.sf-skip {
    position: absolute;
    left: -999px;
    top: .5rem;
    padding: .5rem 1rem;
    background: var(--sf-surface);
    z-index: 10;
}

.sf-skip:focus {
    left: .5rem;
}

.sf-muted,
.sf-count,
.sf-empty {
    color: var(--sf-muted);
}

/* ----- header and footer ----- */

/* White, with the company's logo, as nuvtools.com's header. */
.sf-header {
    background: var(--sf-surface);
    color: var(--sf-navy);
    box-shadow: inset 0 -1px 0 var(--sf-border);
}

.sf-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1.5rem;
    min-height: 4rem;
    padding-top: .625rem;
    padding-bottom: .625rem;
}

.sf-header a {
    color: var(--sf-navy);
}

.sf-band :focus-visible {
    outline-color: var(--sf-signal);
}

.sf-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-size: 1.0625rem;
    font-weight: 700;
    text-decoration: none;
    margin-right: auto;
    white-space: nowrap;
}

.sf-brand img {
    display: block;
    height: 44px;
    width: auto;
}

/* The product's name beside the company's, split by the site's orange rule. */
.sf-brand__product {
    padding-left: .65rem;
    border-left: 2px solid var(--sf-action);
    line-height: 1.2;
}

.sf-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.sf-nav a:not(.sf-button) {
    padding: .25rem 0;
    border-bottom: 2px solid transparent;
    font-size: .9375rem;
    font-weight: 600;
    text-decoration: none;
}

.sf-nav a:not(.sf-button):hover {
    border-bottom-color: var(--sf-action);
}

/* The language switch sits in the footer, as quiet as the line it shares: the current language is
   plain text, the others are links. */
.sf-languages {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

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

.sf-languages a:hover {
    color: var(--sf-text);
}

.sf-languages a[aria-current="true"] {
    color: var(--sf-text);
    text-decoration: none;
}

.sf-main {
    flex: 1;
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.sf-footer {
    border-top: 1px solid var(--sf-border);
    color: var(--sf-muted);
    font-size: .875rem;
    padding: 1.25rem 0;
}

.sf-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem 1.5rem;
}

/* ----- the band a page opens on ----- */

/* Painted edge to edge without leaving the container: the shadow carries the colour sideways and the
   clip keeps it from spilling up or down, so nothing overflows and no wrapper is needed. The negative
   margin closes the gap .sf-main leaves under the header, which the pages without a band still want. */
.sf-band {
    margin-top: -2rem;
    margin-bottom: 2.5rem;
    padding: 2.5rem 0 2.75rem;
    background: var(--sf-ink);
    color: var(--sf-ink-text);
    box-shadow: 0 0 0 100vmax var(--sf-ink);
    clip-path: inset(0 -100vmax);
}

.sf-band a,
.sf-band h1,
.sf-band h2 {
    color: #fff;
}

.sf-band .sf-lead {
    color: var(--sf-ink-muted);
}

.sf-lead {
    font-size: 1.25rem;
    line-height: 1.4;
    color: var(--sf-muted);
    max-width: 44rem;
    margin: 0 0 .5rem;
}

/* ----- controls ----- */

/* The site's pill: orange is the call to action wherever it appears, dark band included. */
.sf-button {
    display: inline-block;
    border: 2px solid var(--sf-action);
    border-radius: 999px;
    background: var(--sf-action);
    color: #fff;
    font: inherit;
    font-weight: 700;
    padding: .55rem 1.35rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.sf-button:hover,
.sf-header .sf-button,
.sf-band .sf-button {
    color: #fff;
}

.sf-button:hover {
    background: var(--sf-action-dark);
    border-color: var(--sf-action-dark);
}

.sf-button--small {
    padding: .4rem 1.1rem;
    font-size: .875rem;
}

.sf-search {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: 1.5rem;
    max-width: 44rem;
}

.sf-search input,
.sf-search select {
    font: inherit;
    padding: .6rem 1rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--sf-surface);
    color: var(--sf-text);
}

.sf-search input {
    flex: 1 1 16rem;
}

/* ----- the catalogue: a directory, one API per row ----- */

.sf-directory {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    border-top: 1px solid var(--sf-border);
}

.sf-entry {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-areas:
        "logo text"
        ". address";
    gap: .5rem 1.25rem;
    align-items: start;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--sf-border);
}

.sf-entry .sf-logo {
    grid-area: logo;
}

.sf-entry__text {
    grid-area: text;
}

.sf-entry h2 {
    font-size: 1.25rem;
    margin: 0;
}

.sf-entry h2 a {
    text-decoration: none;
}

.sf-entry h2 a:hover {
    text-decoration: underline;
}

.sf-entry__tagline {
    margin: .15rem 0 0;
    max-width: var(--sf-measure);
}

.sf-entry__provider {
    margin: .35rem 0 0;
    font-size: .875rem;
    color: var(--sf-muted);
}

.sf-entry__address {
    grid-area: address;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin: 0;
    color: var(--sf-muted);
}

.sf-entry__address code {
    font-size: .9375rem;
    color: var(--sf-text);
    overflow-wrap: anywhere;
}

@media (min-width: 48rem) {
    .sf-entry {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        grid-template-areas: "logo text address";
        align-items: center;
    }

    .sf-entry__address {
        justify-content: flex-end;
        max-width: 22rem;
    }
}

.sf-tag {
    border: 1px solid var(--sf-border);
    border-radius: 999px;
    padding: 0 .5rem;
    font-size: .8125rem;
    color: var(--sf-muted);
}

.sf-logo {
    flex: none;
    object-fit: contain;
    border-radius: var(--sf-radius);
    background: var(--sf-surface);
}

/* Keeps the names in a column when an API has no logo, rather than letting one row start earlier. */
.sf-logo--blank {
    display: block;
    width: 40px;
    height: 40px;
    background: var(--sf-border);
}

.sf-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

/* ----- an API's page ----- */

.sf-api__identity {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.sf-api__identity h1 {
    margin-bottom: .35rem;
}

.sf-api__provider {
    margin: .5rem 0 0;
    color: var(--sf-ink-muted);
}

/* The request, as the page's second headline. */
.sf-request {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--sf-ink-line);
}

.sf-request h2 {
    font-size: 1rem;
    margin: 0;
}

.sf-request p {
    margin: .25rem 0 0;
    max-width: var(--sf-measure);
    color: var(--sf-ink-muted);
}

.sf-code {
    margin: 1rem 0 0;
    overflow-x: auto;
    font-size: clamp(.9375rem, 2.2vw, 1.375rem);
    line-height: 1.6;
    color: #fff;
}

.sf-code__verb {
    color: var(--sf-signal);
    font-weight: 600;
}

.sf-api__body {
    display: grid;
    gap: 2.5rem;
}

@media (min-width: 60rem) {
    .sf-api__body {
        grid-template-columns: minmax(0, 1fr) 22rem;
        grid-template-areas: "about pricing";
        gap: 3.5rem;
        align-items: start;
    }

    .sf-api__about {
        grid-area: about;
    }

    /* Stays in view while the description is read, so the button is never a scroll away. */
    .sf-pricing {
        grid-area: pricing;
        position: sticky;
        top: 1.5rem;
    }
}

.sf-description {
    white-space: pre-line;
    max-width: var(--sf-measure);
    font-size: 1.0625rem;
}

.sf-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: 1.25rem 2rem;
    margin: 2rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid var(--sf-border);
}

.sf-facts dt {
    font-size: .875rem;
    color: var(--sf-muted);
}

.sf-facts dd {
    margin: .1rem 0 0;
    overflow-wrap: anywhere;
}

.sf-cta {
    margin: 2rem 0 0;
}

.sf-notice {
    background: var(--sf-surface);
    border: 1px solid var(--sf-border);
    border-left: 4px solid var(--sf-blue);
    border-radius: var(--sf-radius);
    padding: .75rem 1rem;
}

.sf-notice--warning {
    background: var(--sf-warning-background);
    border-left-color: var(--sf-warning-border);
}

/* ----- pricing: one panel, one row per plan ----- */

.sf-plans {
    list-style: none;
    padding: 0;
    margin: .75rem 0 0;
    border: 1px solid var(--sf-border);
    border-top: 4px solid var(--sf-action);
    border-radius: var(--sf-radius-panel);
    background: var(--sf-surface);
    box-shadow: var(--sf-shadow);
    overflow: hidden;
}

.sf-plan {
    padding: 1.25rem;
}

.sf-plan + .sf-plan {
    border-top: 1px solid var(--sf-border);
}

.sf-plan__heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: .25rem 1rem;
}

.sf-plan h3 {
    margin: 0;
    font-size: 1.0625rem;
}

.sf-plan__fee {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.sf-plan__period,
.sf-plan__limit {
    font-size: .875rem;
    font-weight: 400;
    color: var(--sf-muted);
}

.sf-plan__description {
    margin: .5rem 0 0;
    font-size: .9375rem;
}

.sf-plan__limit {
    margin: .5rem 0 0;
}

.sf-plan__tiers {
    margin: .75rem 0 0;
    font-size: .875rem;
    font-variant-numeric: tabular-nums;
}

.sf-plan__tiers div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.sf-plan__tiers dd {
    margin: 0;
}

.sf-plan__action {
    display: block;
    margin-top: 1rem;
}

.sf-pricing__newcomer {
    margin: 1rem 0 0;
    font-size: .9375rem;
    color: var(--sf-muted);
}
