/* remotehost design system: every page (base.html) and the home page (home.html + home.css on top).
   Rules from the landing-page-design skill (~/.claude/skills): Geist only (Geist Mono for code, terminals, data), no
   italics, weights 400..700; font sizes on the Tailwind type scale with their paired line heights; spacing only
   0 2 4 8 12 16 24 32 40 48 64 80 96; Tailwind radii; flat backgrounds (gradients only on hero heading text); dark
   backgrounds only #000000 #181818 #1F1F1F #272727 #313131 #131209; motion on custom cubic beziers. */

@font-face { font-family: "Geist"; src: url("/static/fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/static/fonts/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #FAFAF8; --surface: #FFFFFF; --raised: #F3F2EE; --line: #E4E2DC; --fg: #111111; --muted: #5C6058; --faint: #8C9088;
  --accent: #1F6F50; --accent-fg: #FFFFFF; --ok: #1F6F50; --warn: #9A5A00; --bad: #B3261E; --res: #2F62B8;
  --glass: rgba(255, 255, 255, 0.72); --overlay: rgba(255, 255, 255, 0.86);
  --h1-from: #000000; --h1-to: #666666;
  --code: #F3F2EE;
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
  --e: cubic-bezier(0.16, 1, 0.3, 1); --e2: cubic-bezier(0.33, 1, 0.68, 1); --io: cubic-bezier(0.65, 0, 0.35, 1);
  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  /* legacy names still used by a few templates and the flow styles */
  --card: var(--surface); --flow-res: var(--res); --flow-open: var(--warn);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #181818; --surface: #1F1F1F; --raised: #272727; --line: #313131; --fg: #F2F2F0; --muted: #A3A3A0; --faint: #7A7A77;
    --accent: #5CC496; --accent-fg: #0B1A12; --ok: #5CC496; --warn: #F0A24E; --bad: #F07A7D; --res: #7FB2FF;
    --glass: rgba(31, 31, 31, 0.72); --overlay: rgba(0, 0, 0, 0.8);
    --h1-from: #FFFFFF; --h1-to: #9B9B9B; --code: #272727;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/24px var(--sans); font-synthesis: none; }
h1, h2, h3 { text-wrap: balance; font-weight: 600; letter-spacing: -0.02em; }
p, li, dd, td { text-wrap: pretty; }
a { color: var(--accent); text-underline-offset: 4px; text-decoration-thickness: 1px; }
img, svg { display: block; }
.ic { width: 20px; height: 20px; flex: none; }
.ic-sm { width: 16px; height: 16px; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
main.page { padding: 96px 0 96px; }
main.page > .wrap { padding-top: 64px; }
@media (max-width: 640px) { main.page { padding: 96px 0 64px; } main.page > .wrap { padding-top: 32px; } }

.skip { position: absolute; left: 16px; top: -48px; z-index: 100; background: var(--fg); color: var(--bg); padding: 8px 12px; border-radius: 8px;
  font-size: 14px; line-height: 20px; font-weight: 600; text-decoration: none; transition: top 0.4s var(--spring); }
.skip:focus { top: 16px; }

/* ---------- type ---------- */
h1 { font-size: 48px; line-height: 1; margin: 0 0 16px; letter-spacing: -0.03em; max-width: 680px; }
h2 { font-size: 30px; line-height: 36px; margin: 64px 0 16px; max-width: 760px; }
h3 { font-size: 20px; line-height: 28px; margin: 32px 0 8px; }
@media (max-width: 640px) { h1 { font-size: 36px; line-height: 40px; } h2 { font-size: 24px; line-height: 32px; margin-top: 48px; } }
p { margin: 0 0 16px; }
.lede { font-size: 18px; line-height: 28px; color: var(--muted); max-width: 680px; margin-bottom: 32px; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 20px; }
.err { color: var(--bad); }
.ok { color: var(--ok); }
ul, ol { padding-left: 24px; margin: 0 0 16px; }
li { margin: 4px 0; }
code, pre, .mono { font-family: var(--mono); }
code { font-size: 14px; line-height: 20px; background: var(--code); border-radius: 4px; padding: 2px 4px; }
pre { font-size: 14px; line-height: 20px; background: var(--code); border-radius: 12px; padding: 16px; overflow-x: auto; margin: 0 0 16px; }
pre code { background: none; padding: 0; }
.eyebrow { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--accent); margin: 0 0 12px; display: flex; gap: 8px; align-items: center; }

/* ---------- buttons, inputs ---------- */
.btn, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 16px/24px var(--sans); padding: 8px 12px;
  border-radius: 12px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-fg); text-decoration: none; cursor: pointer;
  transition: transform 0.7s var(--spring), background-color 0.7s var(--spring), box-shadow 0.7s var(--spring), border-color 0.7s var(--spring); }
.btn:hover, button:hover { transform: translateY(-2px); box-shadow: 0 8px 24px -12px var(--accent); }
.btn:active, button:active { transform: translateY(1px) scale(0.98); }
.btn.secondary, button.secondary, .btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.secondary:hover, button.secondary:hover, .btn.ghost:hover { background: var(--raised); box-shadow: none; }
button.danger { background: transparent; color: var(--bad); border-color: var(--line); }
button.danger:hover { border-color: var(--bad); box-shadow: none; }
.btn.sm, button.sm { font-size: 14px; line-height: 20px; padding: 4px 12px; border-radius: 9999px; }
button:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }
.btn .ic { transition: transform 0.7s var(--spring); }
.btn:hover .ic { transform: translateX(2px); }
.btn:focus-visible, button:focus-visible { outline-offset: 4px; }
label { display: block; font-size: 14px; line-height: 20px; font-weight: 600; margin: 16px 0 4px; }
input, select, textarea { font: 400 16px/24px var(--sans); width: 100%; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); transition: border-color 0.7s var(--spring), box-shadow 0.7s var(--spring); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
input[aria-invalid="true"] { border-color: var(--bad); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.card > h3:first-child { margin-top: 0; }
.card > p:last-child { margin-bottom: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid .card h3 { margin: 0 0 8px; }
.grid .card p { color: var(--muted); font-size: 14px; line-height: 20px; margin: 0; }
.pill { display: inline-block; font-size: 12px; line-height: 16px; font-weight: 600; padding: 2px 8px; border-radius: 9999px; border: 1px solid var(--line); color: var(--muted); }
.pill.on { color: var(--ok); border-color: var(--ok); }
.pill.bad { color: var(--bad); border-color: var(--bad); }
.meter { height: 8px; background: var(--raised); border-radius: 9999px; overflow: hidden; margin-top: 8px; }
.meter > div { height: 100%; background: var(--accent); border-radius: inherit; transition: width 1.1s var(--io); }
.banner { margin: 16px 0; display: grid; gap: 12px; }
.banner.upgrade { border-color: var(--accent); }
.banner.ok-banner { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.secret { word-break: break-all; }
.price { font-size: 30px; line-height: 36px; font-weight: 600; }
.demo-note { margin: -8px 0 12px; color: var(--muted); }
.diagram { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); margin: 12px 0; }
.diagram img { display: block; max-width: none; width: 100%; min-width: 736px; height: auto; }
.diagram.wide img { min-width: 1344px; }
dialog { border: 1px solid var(--line); border-radius: 24px; padding: 32px; background: var(--surface); color: var(--fg); }
dialog::backdrop { background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(8px); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); margin: 0 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
th { font-size: 12px; line-height: 16px; color: var(--muted); font-weight: 600; background: var(--raised); }
.card .table-wrap { border: 0; border-radius: 12px; margin: 16px -8px 0; }
.card > .table-wrap:first-child { margin-top: 0; }

/* ---------- island nav (shared with the home page) ---------- */
.island { position: fixed; top: 24px; left: 0; right: 0; z-index: 50; display: flex; justify-content: center; pointer-events: none; }
.island-in { pointer-events: auto; display: flex; align-items: center; gap: 24px; width: max-content; margin: 0 auto; padding: 8px 8px 8px 16px;
  border-radius: 9999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4); box-shadow: 0 12px 32px -24px rgba(0, 0, 0, 0.5); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 16px; line-height: 24px;
  letter-spacing: -0.01em; color: var(--fg); }
.brand img { width: 24px; height: 24px; border-radius: 6px; }
.brand .host { color: var(--accent); }
.island nav { display: flex; gap: 4px; align-items: center; }
.island nav a.lk { font-size: 14px; line-height: 20px; color: var(--muted); text-decoration: none; padding: 4px 12px; border-radius: 9999px;
  transition: color 0.7s var(--spring), background-color 0.7s var(--spring); }
.island nav a.lk:hover, .island nav a.lk[aria-current="page"] { color: var(--fg); background: var(--raised); }
.burger { display: none; position: relative; width: 40px; height: 40px; padding: 0; border: 0; background: transparent; border-radius: 9999px;
  cursor: pointer; color: var(--fg); box-shadow: none; }
.burger:hover { transform: none; box-shadow: none; background: var(--raised); }
.burger span { position: absolute; left: 12px; width: 16px; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform 0.7s var(--spring), top 0.7s var(--spring); }
.burger span:nth-child(1) { top: 15px; } .burger span:nth-child(2) { top: 23px; }
.menu-open .burger span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.menu-open .burger span:nth-child(2) { top: 19px; transform: rotate(-45deg); }
.sheet { position: fixed; inset: 0; z-index: 40; background: var(--overlay); backdrop-filter: blur(64px); -webkit-backdrop-filter: blur(64px);
  display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 96px 24px 48px; opacity: 0; pointer-events: none;
  transition: opacity 0.7s var(--spring); }
.menu-open .sheet { opacity: 1; pointer-events: auto; }
.sheet a { font-size: 36px; line-height: 40px; font-weight: 600; text-decoration: none; letter-spacing: -0.02em; padding: 8px 0; color: var(--fg);
  transform: translateY(48px); opacity: 0; transition: transform 0.7s var(--spring), opacity 0.7s var(--spring); }
.menu-open .sheet a { transform: translateY(0); opacity: 1; }
.sheet a:nth-child(1) { transition-delay: 100ms; } .sheet a:nth-child(2) { transition-delay: 150ms; }
.sheet a:nth-child(3) { transition-delay: 200ms; } .sheet a:nth-child(4) { transition-delay: 250ms; } .sheet a:nth-child(5) { transition-delay: 300ms; }
@media (max-width: 720px) { .island nav { display: none; } .burger { display: block; } .island-in { gap: 16px; } }

/* ---------- footer ---------- */
footer.site { border-top: 1px solid var(--line); padding: 48px 0 64px; }
.foot { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; font-size: 14px; line-height: 20px; color: var(--muted); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.foot a { color: var(--muted); text-decoration: none; transition: color 0.7s var(--spring); }
.foot a:hover { color: var(--fg); }

/* ---------- scroll interpolation ---------- */
.rv { transform: translateY(64px); filter: blur(12px); opacity: 0;
  transition: transform 0.9s var(--spring), filter 0.9s var(--spring), opacity 0.9s var(--spring); transition-delay: var(--d, 0ms); }
.rv.in { transform: none; filter: none; opacity: 1; }

/* ---------- docs layout ---------- */
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
.toc a { font-size: 14px; line-height: 20px; text-decoration: none; color: var(--muted); border: 1px solid var(--line); border-radius: 9999px;
  padding: 4px 12px; transition: color 0.7s var(--spring), border-color 0.7s var(--spring), background-color 0.7s var(--spring); }
.toc a:hover { color: var(--fg); border-color: var(--fg); }
.prose { max-width: 760px; }
.prose h2 { padding-top: 16px; }

/* ---------- terminal UI for commands: always dark, coloured like a real shell (no gradients: dots are box shadows) ----------
   <div class="term" data-title="~"><pre><span class="p">$</span> <span class="c">rh</span> http 3000</pre></div>
   p prompt, c command, f flag, a argument, u URL, o output, ok success, w warning, m comment, k secret placeholder */
.term { position: relative; margin: 16px 0; border-radius: 16px; overflow: hidden; background: #000000; border: 1px solid #313131;
  box-shadow: 0 24px 48px -32px rgba(0, 0, 0, 0.55); }
.term::before { content: attr(data-title); display: block; padding: 12px 16px 12px 80px; font: 500 12px/16px var(--mono); color: #7D8C84;
  background: #181818; border-bottom: 1px solid #272727; }
.term::after { content: ""; position: absolute; top: 14px; left: 16px; width: 12px; height: 12px; border-radius: 9999px; background: #FF5F57;
  box-shadow: 20px 0 0 #FEBC2E, 40px 0 0 #28C840; }
.term pre { margin: 0; background: transparent; color: #D7E2DC; padding: 16px; font: 400 14px/20px var(--mono); border-radius: 0; overflow-x: auto; }
.term pre code { color: inherit; }
.term .p { color: #5CC496; font-weight: 700; user-select: none; }
.term .c { color: #F2F5F3; font-weight: 600; }
.term .f { color: #7FD1E6; }
.term .a { color: #E8C97A; }
.term .u { color: #8FB8FF; text-decoration: underline; text-decoration-color: rgba(143, 184, 255, 0.4); }
.term a.u:hover { text-decoration-color: currentColor; }
.term .o { color: #A8B5AE; }
.term .ok { color: #5CC496; }
.term .w { color: #F0A24E; }
.term .m { color: #6B7A72; }
.term .k { color: #C7A4FF; }
.term-cursor { display: inline-block; width: 8px; height: 16px; vertical-align: -2px; background: #5CC496; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- how a request reaches your machine (static/flow.js) ---------- */
.rhflow { margin: 16px 0 0; }
.rhflow-stage { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 64px; padding: 40px 24px;
  border: 1px solid var(--line); border-radius: 24px; background: var(--surface); }
.rhflow-wires { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.rhflow-wire { stroke: var(--line); stroke-width: 2; }
.rhflow-wire.tunnel { stroke: var(--flow-open); stroke-width: 3; stroke-dasharray: 5 6; transition: stroke 0.5s var(--e2), stroke-width 0.5s var(--e2); }
.tunnel-open .rhflow-wire.tunnel { stroke: var(--accent); stroke-width: 6; stroke-dasharray: none; stroke-opacity: 0.35; }
.rhflow-dot.req, .rhflow-halo.req { fill: var(--accent); }
.rhflow-dot.res, .rhflow-halo.res { fill: var(--flow-res); }
.rhflow-dot.open, .rhflow-halo.open { fill: var(--flow-open); }
.rhflow-node { position: relative; z-index: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px;
  transition: border-color 0.5s var(--e2), box-shadow 0.5s var(--e2); min-width: 0; }
.rhflow-node.on { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.rhflow-node .k { font-size: 12px; line-height: 16px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.rhflow-node .t { font-weight: 600; margin: 2px 0; }
.rhflow-node .s { font: 400 12px/16px var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.rhflow-chip { display: inline-block; margin-top: 8px; font-size: 12px; line-height: 16px; font-weight: 600; padding: 2px 8px; border-radius: 9999px;
  border: 1px solid var(--line); color: var(--muted); transition: color 0.5s var(--e2), border-color 0.5s var(--e2); }
.gate-check .rhflow-chip.gate, .tunnel-open .rhflow-chip.tunnel { color: var(--accent); border-color: var(--accent); }
.rhflow-chip.tunnel .when-open, .tunnel-open .rhflow-chip.tunnel .when-closed { display: none; }
.tunnel-open .rhflow-chip.tunnel .when-open { display: inline; }
.rhflow-label { position: absolute; z-index: 2; transform: translate(-50%, -150%); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-radius: 9999px; padding: 0 8px; }
.rhflow-label.stacked { transform: translate(8px, -50%); }
.rhflow-label.tunnel { color: var(--accent); }
.rhflow-steps { list-style: none; counter-reset: s; margin: 16px 0 0; padding: 0; display: grid; gap: 4px 16px;
  grid-template-columns: repeat(auto-fit, minmax(256px, 1fr)); }
.rhflow-steps li { counter-increment: s; position: relative; padding: 4px 8px 4px 40px; margin: 0; border-radius: 8px; color: var(--muted);
  font-size: 14px; line-height: 20px; transition: background-color 0.5s var(--e2), color 0.5s var(--e2); }
.rhflow-steps li::before { content: counter(s); position: absolute; left: 8px; top: 4px; width: 20px; height: 20px; border-radius: 9999px;
  display: grid; place-items: center; font-size: 12px; line-height: 16px; font-weight: 700; border: 1px solid var(--line); }
.rhflow-steps li.on { background: var(--raised); color: var(--fg); }
.rhflow-steps li.on::before { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.rhflow-steps li.done::before { border-color: var(--accent); color: var(--accent); }
@media (max-width: 736px) { .rhflow-stage { grid-template-columns: minmax(0, 1fr); gap: 40px; padding: 24px 16px; } .rhflow-node { margin-right: 96px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .rv { transform: none !important; filter: none !important; opacity: 1 !important; }
}

/* docs: a readable measure for text; terminals, tables and the flow keep the full width */
main[data-page="docs"] > .wrap > :is(p, ul, ol, h2, h3, h1, .lede) { max-width: 760px; }
