/* The API's test page, in the look of tomrhodes.it.
   Palette taken from a photo of rock and lichen in Norway. */

@font-face { font-family: "Fira Sans"; font-weight: 300; font-display: swap; src: url("/fonts/fira-sans-latin-300-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-weight: 400; font-display: swap; src: url("/fonts/fira-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-weight: 500; font-display: swap; src: url("/fonts/fira-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans"; font-weight: 600; font-display: swap; src: url("/fonts/fira-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans Condensed"; font-weight: 400; font-display: swap; src: url("/fonts/fira-sans-condensed-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans Condensed"; font-weight: 500; font-display: swap; src: url("/fonts/fira-sans-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fira Sans Condensed"; font-weight: 600; font-display: swap; src: url("/fonts/fira-sans-condensed-latin-600-normal.woff2") format("woff2"); }

:root {
  --crevice: #151a2b;  /* shadow between the rocks */
  --rock: #1b2848;     /* rock navy */
  --rock-2: #293b5f;
  --slate: #3a5382;    /* slate blue */
  --lichen: #e9c93a;   /* lichen yellow */
  --sun: #f8e825;      /* brightest lichen */
  --ochre: #d9a21b;
  --rust: #d9730f;     /* lichen orange */
  --ember: #c54b12;    /* red-orange lichen */
  --ink: #23283a;
  --mute: #646b80;
  --line: #dfe2ea;
  --paper: #ffffff;
  --mist: #f6f2e8;     /* pale stone */
  --sans: "Fira Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cond: "Fira Sans Condensed", "Fira Sans", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --wrap: 1180px;
  --gutter: clamp(20px, 5vw, 40px);
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; font-family: var(--sans); font-weight: 300; font-size: 1.0625rem; line-height: 1.6; color: var(--ink); background: var(--paper); }
a { color: var(--slate); text-underline-offset: 3px; }
a:hover { color: var(--rust); }
h1, h2, h3 { font-family: var(--cond); font-weight: 400; line-height: 1.12; margin: 0; }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- header and band, as on tomrhodes.it ---------- */
.site-head { background: var(--rock); }
.site-head .wrap { display: flex; align-items: center; min-height: 64px; }
.brand { font-family: var(--cond); font-size: 1.35rem; letter-spacing: .06em; text-transform: uppercase; color: #fff; text-decoration: none; }
.brand b { font-weight: 600; color: var(--lichen); }
.brand:hover { color: #fff; }
.band { background: linear-gradient(135deg, var(--crevice), var(--rock) 50%, var(--rock-2)); color: #fff; }
.band .wrap { padding-top: clamp(36px, 6vw, 64px); padding-bottom: clamp(36px, 6vw, 64px); }
.band h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); }
.kicker, .label, .group-title small, .method { font-family: var(--cond); font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.kicker { font-size: .86rem; color: var(--lichen); margin: 0 0 14px; }
.intro { max-width: 62ch; color: #e6e9f2; margin: 18px 0 24px; }
.links { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }

/* ---------- buttons, like the site's ---------- */
.button { display: inline-block; font: 600 .92rem var(--cond); letter-spacing: .12em; text-transform: uppercase; text-decoration: none; padding: 11px 20px; border-radius: var(--radius); border: 2px solid var(--lichen); background: var(--lichen); color: var(--rock); cursor: pointer; transition: transform .15s ease, background-color .15s ease, color .15s ease; }
.button:hover { transform: translateY(-2px); background: transparent; color: var(--lichen); }
.button.ghost { background: transparent; color: var(--lichen); }
.button.ghost:hover { background: var(--lichen); color: var(--rock); }
.endpoint .button { padding: 8px 18px; }
.endpoint .button:hover { color: var(--rock); background: var(--sun); border-color: var(--sun); }

/* ---------- the two columns: forms, and the request/response ---------- */
.workbench { display: grid; gap: 32px; padding-top: 32px; padding-bottom: 48px; }
@media (min-width: 960px) {
  .workbench { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .exchange { position: sticky; top: 16px; }
}
.group-title { font-size: 1.6rem; color: var(--rock); margin: 28px 0 12px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.group-title small { font-size: .78rem; color: var(--mute); }
.exchange .group-title:first-child { margin-top: 0; }

/* ---------- settings and fields ---------- */
.settings { background: var(--mist); border-left: 4px solid var(--lichen); padding: 18px 20px; display: grid; gap: 14px; }
.field { display: grid; gap: 4px; }
.label { font-size: .74rem; color: var(--ember); }
input, select, textarea { font: 400 1rem var(--sans); color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; width: 100%; }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--lichen); box-shadow: 0 0 0 2px rgba(233, 201, 58, .35); }
.toggle { display: flex; gap: 10px; align-items: center; font-size: .95rem; color: var(--mute); }
.toggle input { width: auto; accent-color: var(--ochre); }

/* ---------- one card per endpoint ---------- */
.endpoint { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.endpoint:hover { border-color: #cfd3dd; }
.endpoint-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.endpoint h3 { font-size: 1.25rem; color: var(--rock); }
.endpoint .path { font-family: var(--mono); font-size: .85rem; color: var(--slate); }
.endpoint .describe { margin: 4px 0 12px; color: var(--mute); font-size: .95rem; }
.endpoint .fields { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 12px; }
.endpoint .fields .wide { grid-column: 1 / -1; }
.method { font-size: .72rem; padding: 2px 8px; border-radius: 999px; color: #fff; }
.method.GET { background: var(--slate); }
.method.POST { background: var(--ochre); color: var(--rock); }
.method.PATCH { background: var(--rust); }
.method.DELETE { background: var(--ember); }

/* ---------- request and response ---------- */
.code { font: .86rem/1.55 var(--mono); background: var(--crevice); color: #e6e9f2; border-radius: var(--radius); padding: 14px 16px; margin: 0 0 20px; white-space: pre-wrap; word-break: break-word; max-height: 60vh; overflow: auto; }
.code .key { color: #9fb3dc; }
.code .text { color: var(--lichen); }
.code .number, .code .literal { color: var(--rust); }
.code .post-id { color: var(--sun); background: none; border: 0; padding: 0; font: inherit; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.code .post-id:hover { color: #fff; }
.status { font: 500 .8rem var(--cond); letter-spacing: .1em; padding: 2px 10px; border-radius: 999px; color: #fff; }
.status.ok { background: #2f7d4f; }
.status.problem { background: var(--ember); }
.status.waiting { background: var(--slate); }
.flash { animation: flash .9s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 3px var(--lichen); } to { box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; } .button { transition: none; } }

.site-foot { background: var(--crevice); color: #c9cfdd; font-size: .9rem; }
.site-foot .wrap { padding-top: 20px; padding-bottom: 20px; }
.site-foot a { color: var(--lichen); }
