/* serveproxy.com — one stylesheet, no framework. */

@font-face { font-family: "Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --paper: #f4f6f7;
  --surface: #ffffff;
  --ink: #15232d;
  --steel: #566874;
  --rule: #d3dbe0;
  --fjord: #0f5f78;
  --fjord-strong: #0a4659;
  --fjord-wash: #e3eef2;
  --code-bg: #15232d;
  --code-ink: #dce6eb;
  --warn-wash: #fbf3e2;
  --warn-rule: #e2c98f;

  --sans: "Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  /* Scale: 17px base, ratio 1.25 */
  --t-sm: 0.875rem;
  --t-base: 1.0625rem;
  --t-md: 1.3125rem;
  --t-lg: 1.625rem;
  --t-xl: 2.0625rem;
  --t-2xl: 2.5625rem;

  --gutter: clamp(16px, 4vw, 40px);
  --wide: 1120px;
  --measure: 68ch;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1a21;
    --surface: #15232d;
    --ink: #e4eaee;
    --steel: #9aabb6;
    --rule: #2a3a45;
    --fjord: #6fb9d1;
    --fjord-strong: #9fd2e3;
    --fjord-wash: #16303b;
    --code-bg: #0a1318;
    --code-ink: #d3dee4;
    --warn-wash: #2b2516;
    --warn-rule: #6b5a2c;
    color-scheme: dark;
  }
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-base);
  line-height: 1.6;
  font-kerning: normal;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--fjord); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--fjord-strong); text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--fjord); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-weight: 600; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.875rem, 1.2rem + 3vw, var(--t-2xl)); letter-spacing: -0.02em; overflow-wrap: break-word; }
h2 { font-size: var(--t-lg); }
h3 { font-size: var(--t-md); }

p, ul, ol, table, pre, dl, details, figure { margin: 0 0 1rem; }
p, li { max-width: var(--measure); }
ul, ol { padding-left: 1.25rem; }
li + li { margin-top: 0.35rem; }
strong { font-weight: 600; }

code, pre, kbd { font-family: var(--mono); font-size: 0.92em; }
:not(pre) > code {
  background: var(--fjord-wash);
  padding: 0.08em 0.35em;
  border-radius: 3px;
  overflow-wrap: anywhere;
}
pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 1rem 1.15rem;
  border-radius: 6px;
  overflow-x: auto;
  line-height: 1.55;
  font-size: var(--t-sm);
  max-width: 100%;
}
pre code { background: none; padding: 0; font-size: inherit; }

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

/* ---------- Frame ---------- */

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }

.site-head { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--ink); text-decoration: none; font-weight: 600; font-size: var(--t-md); letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); }
.brand svg { width: 30px; height: 20px; fill: var(--fjord); flex: none; }
.brand small { font-weight: 400; color: var(--steel); font-size: var(--t-base); }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-nav a { color: var(--steel); text-decoration: none; font-size: var(--t-sm); padding: 0.4rem 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--fjord); }

.site-foot { border-top: 1px solid var(--rule); margin-top: 5rem; padding: 3rem 0 2.5rem; font-size: var(--t-sm); color: var(--steel); }
.foot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 2rem; margin-bottom: 2.5rem; }
.foot-grid h2 { font-size: var(--t-sm); color: var(--ink); margin-bottom: 0.6rem; letter-spacing: 0; }
.foot-grid ul { list-style: none; padding: 0; margin: 0; }
.foot-grid li + li { margin-top: 0.3rem; }
.foot-grid a { color: var(--steel); text-decoration: none; }
.foot-grid a:hover { color: var(--ink); text-decoration: underline; }
.site-foot p { margin: 0; }

/* ---------- Hero: the URL is the product ---------- */

.hero { padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem); border-bottom: 1px solid var(--rule); }
.hero h1 { max-width: 20ch; margin-bottom: 1rem; }
.hero .lede { font-size: var(--t-md); color: var(--steel); max-width: 46ch; margin-bottom: 2.5rem; line-height: 1.5; }

.url-bar {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: clamp(0.95rem, 2.1vw, 1.375rem);
  box-shadow: 0 1px 0 var(--rule);
  max-width: 980px;
}
.url-bar:focus-within { border-color: var(--fjord); box-shadow: 0 0 0 3px var(--fjord-wash); }
.url-fixed { padding: 1rem 0 1rem 1.15rem; white-space: nowrap; color: var(--ink); align-self: center; }
.url-bar input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--fjord);
  padding: 1rem 0.5rem 1rem 0.1rem;
}
.url-bar input::placeholder { color: var(--steel); opacity: 0.7; }
.url-bar input:focus { outline: none; }
.url-bar button {
  flex: none;
  margin: 0.4rem;
  border: 0;
  border-radius: 5px;
  background: var(--fjord);
  color: #fff;
  font-family: var(--sans);
  font-size: var(--t-sm);
  font-weight: 600;
  padding: 0 1.15rem;
  cursor: pointer;
}
.url-bar button:hover { background: var(--fjord-strong); }
@media (prefers-color-scheme: dark) { .url-bar button { color: #0f1a21; } }
.url-hint { margin-top: 0.85rem; font-size: var(--t-sm); color: var(--steel); min-height: 1.6em; }
.url-hint[data-state="error"] { color: #b3412e; }
@media (prefers-color-scheme: dark) { .url-hint[data-state="error"] { color: #f0937f; } }

@media (max-width: 640px) {
  .url-bar { flex-wrap: wrap; }
  .url-fixed { padding: 0.85rem 1rem 0; width: 100%; font-size: 0.95rem; white-space: normal; overflow-wrap: anywhere; }
  .url-bar input { padding: 0.35rem 1rem 0.85rem; width: 100%; flex-basis: 100%; }
  .url-bar button { width: calc(100% - 0.8rem); padding: 0.75rem; }
}


/* ---------- Page heads for inner pages ---------- */

.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 2rem; border-bottom: 1px solid var(--rule); }
.page-head h1 { max-width: 24ch; margin-bottom: 0.75rem; }
.page-head p { color: var(--steel); font-size: var(--t-md); line-height: 1.5; max-width: 52ch; margin: 0; }
.page-head .meta { font-size: var(--t-sm); margin-top: 0.75rem; }

/* ---------- Datasheet sections: heading column + body ---------- */

.sheet { padding: clamp(2.5rem, 6vw, 4rem) 0; border-bottom: 1px solid var(--rule); }
.sheet:last-of-type { border-bottom: 0; }
.sheet > .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 900px) {
  .sheet > .wrap { grid-template-columns: 260px minmax(0, 1fr); gap: 3rem; }
  .sheet-head { position: sticky; top: 1.5rem; align-self: start; }
}
.sheet-head h2 { margin-bottom: 0.5rem; }
.sheet-head p { color: var(--steel); font-size: var(--t-sm); margin: 0; }
/* Grid children default to min-width: auto and would grow to fit long code lines. */
.sheet-head, .sheet-body, .steps li { min-width: 0; }
.sheet-body > :last-child { margin-bottom: 0; }
.sheet-body h3 { margin: 2rem 0 0.6rem; }
.sheet-body h3:first-child { margin-top: 0; }

/* Plain prose pages (legal) */
.prose { padding: 2.5rem 0 0; }
.prose .wrap { max-width: calc(var(--measure) + 2 * var(--gutter)); }
.prose h2 { font-size: var(--t-md); margin: 2.5rem 0 0.75rem; }
.prose h3 { font-size: var(--t-base); margin: 1.5rem 0 0.5rem; }

/* ---------- Tables ---------- */

.table-scroll { overflow-x: auto; margin: 0 0 1.25rem; }
table { border-collapse: collapse; width: 100%; font-size: var(--t-sm); font-variant-numeric: tabular-nums; }
.table-scroll table { margin: 0; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 1rem 0.6rem 0; border-bottom: 1px solid var(--rule); }
th { font-weight: 600; color: var(--ink); }
thead th { border-bottom: 2px solid var(--ink); }
td.num, th.num { text-align: right; padding-right: 0; }
tbody th { font-weight: 400; color: var(--steel); width: 38%; }

/* ---------- Sequence (real steps only) ---------- */

.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 1.25rem; }
@media (min-width: 700px) { .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; } }
.steps li { counter-increment: step; margin: 0; border-top: 2px solid var(--ink); padding-top: 0.75rem; }
.steps li::before { content: counter(step); display: block; font-family: var(--mono); color: var(--fjord); margin-bottom: 0.35rem; }
.steps h3 { font-size: var(--t-base); margin-bottom: 0.3rem; }
.steps p { color: var(--steel); font-size: var(--t-sm); margin: 0; }

/* ---------- Notes, FAQ, actions ---------- */

.note { border-left: 3px solid var(--fjord); background: var(--fjord-wash); padding: 0.85rem 1.1rem; border-radius: 0 6px 6px 0; font-size: var(--t-sm); max-width: var(--measure); }
.note.warn { border-left-color: var(--warn-rule); background: var(--warn-wash); }
.note p:last-child { margin-bottom: 0; }

.faq details { border-bottom: 1px solid var(--rule); margin: 0; }
.faq details:first-child { border-top: 1px solid var(--rule); }
.faq summary { cursor: pointer; padding: 0.9rem 2rem 0.9rem 0; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.25rem; top: 0.85rem; font-family: var(--mono); color: var(--steel); }
.faq details[open] summary::after { content: "\2212"; }
.faq details > :not(summary) { color: var(--steel); }
.faq > p { margin-top: 1.5rem; }

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 0; }
.btn { display: inline-block; padding: 0.6rem 1.1rem; border-radius: 5px; font-size: var(--t-sm); font-weight: 600; text-decoration: none; border: 1px solid var(--fjord); }
.btn-primary { background: var(--fjord); color: #fff; }
.btn-primary:hover { background: var(--fjord-strong); border-color: var(--fjord-strong); color: #fff; }
@media (prefers-color-scheme: dark) { .btn-primary, .btn-primary:hover { color: #0f1a21; } }
.btn-quiet { color: var(--fjord); }
.btn-quiet:hover { background: var(--fjord-wash); }


.price { font-size: var(--t-xl); font-weight: 600; letter-spacing: -0.02em; margin: 0 0 0.25rem; }
.price span { font-size: var(--t-base); font-weight: 400; color: var(--steel); letter-spacing: 0; }

.places { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.5rem 1.5rem; }
.places li { margin: 0; padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
.places span { color: var(--steel); font-family: var(--mono); font-size: var(--t-sm); margin-left: 0.4rem; }

.toc { list-style: none; padding: 0; font-size: var(--t-sm); }
.toc li + li { margin-top: 0.25rem; }

.notfound { padding: clamp(4rem, 12vw, 8rem) 0; }
.notfound h1 { margin-bottom: 0.75rem; }
.notfound p { color: var(--steel); }

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

@media print {
  .site-head nav, .site-foot .foot-grid, .url-bar button { display: none; }
  body { background: #fff; color: #000; }
}

/* Homepage usage line, filled by stats.js from /stats.json */
.usage { margin: 2.25rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--rule); color: var(--steel); max-width: 62ch; }
.usage strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.usage[hidden] { display: none; }

.example { margin: 1.75rem 0 0; color: var(--steel); }
.example a { text-decoration: none; }
.example a code { color: var(--fjord); }
.example a:hover code { text-decoration: underline; }

/* Short "label: explanation" lists used instead of tables on the homepage */
.outcomes { list-style: none; padding: 0; }
.outcomes li { padding: 0.7rem 0; border-bottom: 1px solid var(--rule); margin: 0; }
.outcomes li:first-child { border-top: 1px solid var(--rule); }
.outcomes strong { color: var(--ink); }
.prose table { display: block; overflow-x: auto; }
