/* Concept: a cross-section. The page is the ground seen from the side: the public
   internet on top, your machine at the bottom, and one dashed shaft down the left
   edge joining them. Each section is a station on the shaft. */
:root {
  --paper: #f1f3ef; --surface: #ffffff; --ink: #121815; --muted: #57625c; --line: #d5dad3;
  --shaft: #d98a12; --link: #1c3df0; --link-ink: #ffffff;
  --soil: #17120e; --soil-ink: #efe6da; --soil-muted: #a3958a; --soil-line: #3a2f27;
  --ok: #17794a;
  --display: "Bricolage Grotesque", "Arial Narrow", system-ui, sans-serif;
  --body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --gutter: clamp(1rem, 4vw, 3rem);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #131715; --surface: #1b211e; --ink: #e9eeea; --muted: #9aa69f; --line: #2c3530;
    --shaft: #f0a93a; --link: #8ea2ff; --link-ink: #0d1330;
    --soil: #0c0906; --soil-ink: #efe6da; --soil-muted: #a3958a; --soil-line: #33291f;
    --ok: #5fd39a;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { animation: none !important; transition: none !important; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1.0625rem/1.6 var(--body); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: .18em; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 2px; }
code, pre, .mono { font-family: var(--mono); font-size: .9em; }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; text-wrap: balance; letter-spacing: -.02em; }
h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.75rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 500; letter-spacing: -.01em; line-height: 1.25; }
p { margin: 0; max-width: 62ch; }
.wrap { max-width: 74rem; margin: 0 auto; padding-inline: var(--gutter); }

/* Top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.25rem; flex-wrap: wrap; }
.brand { font: 700 1.35rem var(--display); letter-spacing: -.03em; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: .5rem; }
.top nav { display: flex; gap: 1.4rem; flex-wrap: wrap; font-size: .95rem; }
.top nav a { color: var(--ink); text-decoration: none; }
.top nav a:hover { text-decoration: underline; }
.soon { font: 500 .78rem var(--mono); border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem; color: var(--muted); }

/* The shaft: a dashed line down the left of the content, with a marker per station. */
.shaft { border-left: 2px dashed var(--shaft); margin-left: .45rem; padding-left: clamp(1.25rem, 4vw, 3.5rem); }
.station { position: relative; padding-block: clamp(3rem, 7vw, 5.5rem); display: flex; flex-direction: column; gap: 1.75rem; }
.station::before { content: ""; position: absolute; left: calc(-1 * clamp(1.25rem, 4vw, 3.5rem) - .5rem - 1px); top: calc(clamp(3rem, 7vw, 5.5rem) + .55rem); width: 1rem; height: 1rem; border-radius: 50%; background: var(--paper); border: 2px solid var(--shaft); }
.depth { font: 500 .78rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .09em; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; padding-top: clamp(2rem, 5vw, 3.5rem); }
.hero > div { display: flex; flex-direction: column; gap: 1.5rem; min-width: 0; }
.hero p.lede { font-size: 1.2rem; color: var(--muted); max-width: 46ch; }
.cta { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.btn { font: 600 1rem var(--body); text-decoration: none; padding: .75rem 1.2rem; border-radius: 4px; border: 2px solid var(--ink); color: var(--ink); background: transparent; }
.btn.primary { background: var(--link); border-color: var(--link); color: var(--link-ink); }
.btn:hover { transform: translateY(-1px); }
.btn { transition: transform .12s ease; }

/* The transcript: what the agent session looks like. */
.session { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; font-size: .92rem; overflow: hidden; }
.session header { display: flex; justify-content: space-between; padding: .55rem .9rem; border-bottom: 1px solid var(--line); font: 500 .75rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.session ol { list-style: none; margin: 0; padding: .9rem; display: flex; flex-direction: column; gap: .8rem; }
.session .who { font: 500 .72rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; display: block; margin-bottom: .15rem; }
.call { font-family: var(--mono); font-size: .82rem; background: var(--paper); border-left: 3px solid var(--shaft); padding: .55rem .7rem; border-radius: 0 4px 4px 0; overflow-x: auto; white-space: nowrap; }
.call b { font-weight: 500; }
.call .ret { color: var(--muted); display: block; margin-top: .25rem; }
.call .ok { color: var(--ok); }

/* How it works: three stops on a horizontal line */
.route { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.route > div { padding: 1.4rem; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: .5rem; min-width: 0; }
.route > div:first-child { border-left: 0; }
.route .where { font: 500 .78rem var(--mono); color: var(--muted); }
.route .addr { font: 500 .85rem var(--mono); overflow-wrap: anywhere; }
.route p { font-size: .97rem; color: var(--muted); }
.facts { display: flex; flex-wrap: wrap; gap: .5rem 2rem; font-weight: 500; padding: 0; margin: 0; list-style: none; }
.facts li::before { content: "— "; color: var(--shaft); }

/* Tools */
.tools { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 0 2rem; border-top: 1px solid var(--line); margin: 0; }
.tools dt, .tools dd { padding-block: 1rem; border-bottom: 1px solid var(--line); margin: 0; min-width: 0; }
.tools dt { font: 500 .95rem var(--mono); overflow-wrap: anywhere; }
.tools dd { color: var(--muted); }
.tools dd b { color: var(--ink); font-weight: 600; }

/* Details: uneven two-column list, no cards */
.details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem clamp(2rem, 5vw, 4.5rem); }
.details > div { display: flex; flex-direction: column; gap: .45rem; }
.details p { color: var(--muted); font-size: 1rem; }

/* Install */
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.tabs button { font: 500 .92rem var(--body); padding: .5rem .95rem; border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; background: transparent; color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--soil); color: var(--soil-ink); border-color: var(--soil); }
.panel { background: var(--soil); color: var(--soil-ink); border-radius: 0 6px 6px 6px; padding: 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .8rem; }
.panel pre { margin: 0; overflow-x: auto; font-size: .88rem; line-height: 1.55; }
.panel p { color: var(--soil-muted); font-size: .93rem; }
.panel code { color: var(--soil-ink); }
.installbox { display: flex; flex-direction: column; }
.after { color: var(--muted); }

/* Free plan */
.plan { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.plan > div { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
table { border-collapse: collapse; width: 100%; font-size: 1rem; }
th, td { text-align: left; padding: .7rem 0; border-bottom: 1px solid var(--line); font-weight: 400; vertical-align: top; }
td:last-child { font: 500 .95rem var(--mono); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr:first-child th, tr:first-child td { border-top: 1px solid var(--line); }
.price { font: 700 clamp(3rem, 7vw, 4.5rem)/1 var(--display); letter-spacing: -.04em; }
.price small { font: 500 1rem var(--body); letter-spacing: 0; color: var(--muted); }

/* FAQ */
.faq { display: flex; flex-direction: column; border-top: 1px solid var(--line); max-width: 52rem; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 1rem 0; font: 500 1.1rem var(--display); list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); color: var(--shaft); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding-bottom: 1.1rem; color: var(--muted); }

/* Underground: where the shaft ends */
.ground { background: var(--soil); color: var(--soil-ink); margin-top: 0; }
.ground .shaft { border-left-color: var(--shaft); }
.ground .station::before { background: var(--shaft); }
.ground .station { padding-bottom: 3rem; }
.ground h2 { font-family: var(--mono); font-weight: 500; font-size: clamp(1.4rem, 3.4vw, 2.2rem); letter-spacing: -.02em; }
.ground p { color: var(--soil-muted); }
.ground a { color: var(--soil-ink); }
.foot { display: flex; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; border-top: 1px solid var(--soil-line); padding-block: 1.5rem 2.5rem; font-size: .9rem; color: var(--soil-muted); }
.foot nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }

@media (max-width: 52rem) {
  .hero, .plan { grid-template-columns: minmax(0, 1fr); }
  .route { grid-template-columns: minmax(0, 1fr); }
  .route > div { border-left: 0; border-top: 1px solid var(--line); }
  .route > div:first-child { border-top: 0; }
  .details { grid-template-columns: minmax(0, 1fr); }
  .tools { grid-template-columns: minmax(0, 1fr); }
  .tools dt { border-bottom: 0; padding-bottom: 0; }
  .tools dd { padding-top: .3rem; }
}

/* Inner pages: docs, legal, abuse, 404 */
.page-head { display: flex; flex-direction: column; gap: 1rem; padding-block: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 4vw, 2.5rem); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.page-head p { color: var(--muted); font-size: 1.15rem; max-width: 56ch; }
.doc { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: clamp(2rem, 5vw, 4.5rem); padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5.5rem); align-items: start; }
.doc.single { grid-template-columns: minmax(0, 1fr); }
.toc { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; border-left: 2px dashed var(--shaft); padding-left: 1rem; font-size: .93rem; }
.toc strong { font: 500 .75rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .09em; display: block; margin-bottom: .6rem; }
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.prose { min-width: 0; max-width: 46rem; display: flex; flex-direction: column; gap: 1.1rem; }
.prose section { display: flex; flex-direction: column; gap: 1.1rem; padding-top: 2.5rem; scroll-margin-top: 1rem; }
.prose section:first-child { padding-top: 0; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
.prose h3 { margin-top: .6rem; }
.prose p, .prose li { max-width: 68ch; }
.prose ul, .prose ol { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: .45rem; }
.prose pre { margin: 0; background: var(--soil); color: var(--soil-ink); border-radius: 6px; padding: 1rem 1.15rem; overflow-x: auto; font-size: .86rem; line-height: 1.55; }
.prose :not(pre) > code { background: var(--surface); border: 1px solid var(--line); border-radius: 3px; padding: .05em .3em; overflow-wrap: anywhere; }
.prose .scroll { overflow-x: auto; }
.prose table { min-width: 28rem; }
.prose th, .prose td { padding: .65rem .9rem .65rem 0; }
.prose thead th { font: 500 .75rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.prose td:last-child { font: inherit; text-align: left; white-space: normal; }
.prose td:first-child code { white-space: nowrap; }
.prose dl { margin: 0; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.prose dl > div { padding-block: .9rem; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: .35rem; }
.prose dt { font: 500 .9rem var(--mono); overflow-wrap: anywhere; }
.prose dd { margin: 0; color: var(--muted); }
.note { border-left: 3px solid var(--shaft); background: var(--surface); padding: .8rem 1rem; border-radius: 0 4px 4px 0; }
.draft { border: 2px dashed var(--shaft); border-radius: 6px; padding: .9rem 1.1rem; font-weight: 500; background: var(--surface); }
.todo { background: var(--shaft); color: #17120e; padding: 0 .3em; border-radius: 3px; font-weight: 500; }
.contact { font: 500 clamp(1.2rem, 3.6vw, 1.7rem) var(--mono); user-select: all; overflow-wrap: anywhere; }
.ground.slim .foot { border-top: 0; padding-block: 2rem 2.5rem; }
.lost { padding-block: clamp(4rem, 12vw, 9rem); display: flex; flex-direction: column; gap: 1.5rem; }
.lost .code { font: 500 1rem var(--mono); color: var(--muted); }
@media (max-width: 52rem) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; max-height: none; }
  .toc ol { flex-direction: row; flex-wrap: wrap; gap: .35rem 1rem; }
}

/* Logo in the header: follows the text colour, the dot stays amber. */
.brand .logo { height: 1.9rem; width: auto; display: block; }

/* Brand page */
.plates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-block: 1.25rem; }
.plate { margin: 0; border-radius: 6px; padding: 2.25rem 1.5rem 1rem; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; min-width: 0; }
.plate img { width: min(100%, 20rem); height: auto; }
.plate.tall img { height: 9rem; width: auto; max-width: 100%; }
.plate figcaption { font-size: .82rem; align-self: stretch; }
/* The plates show the logo on its own two grounds, whatever the page theme is. */
.on-paper { background: #f1f3ef; color: #57625c; border: 1px solid var(--line); }
.on-ink { background: #121815; color: #9aa69f; border: 1px solid #121815; }
.swatches { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .5rem; margin-block: 1.25rem; }
.swatch { border-radius: 6px; padding: 3.5rem .9rem .8rem; display: flex; flex-direction: column; border: 1px solid var(--line); font: .82rem var(--mono); }
.swatch b { font: 600 1rem var(--body); margin-bottom: .2rem; }
.faces { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1.5rem; margin-block: 1.25rem; }
.faces > div { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.face-display { font: 700 1.9rem/1.1 var(--display); letter-spacing: -.02em; }
.face-body { font: 500 1.6rem/1.2 var(--body); }
.face-mono { font: 500 1.35rem/1.3 var(--mono); }
.icons { display: flex; flex-wrap: wrap; gap: 1.75rem; align-items: flex-end; margin-block: 1.25rem; }
.icons figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .5rem; font-size: .8rem; color: var(--muted); }
@media (max-width: 40rem) { .plates { grid-template-columns: minmax(0, 1fr); } }

/* An element marked hidden stays hidden even where a rule gives it a display
   of its own, as .panel does. Without this the install tabs all show at once. */
[hidden] { display: none !important; }

.panel pre + p + pre { margin-top: -.2rem; }
h3.sub { margin-top: 1.5rem; font-size: 1.35rem; }
.steps { margin: 0; padding-left: 1.4rem; display: flex; flex-direction: column; gap: .6rem; max-width: 62ch; }
.steps li::marker { color: var(--shaft); font-weight: 600; font-family: var(--mono); }

/* Copy button on code blocks (copy.js adds the wrapper and the button). */
.copywrap { position: relative; min-width: 0; }
.copy { position: absolute; top: .4rem; right: .4rem; font: 500 .72rem var(--mono); padding: .25rem .55rem; border: 1px solid var(--soil-line); border-radius: 4px; background: var(--soil); color: var(--soil-muted); cursor: pointer; }
.copy:hover, .copy:focus-visible { color: var(--soil-ink); border-color: var(--soil-muted); }
.panel .copy { top: -.15rem; right: 0; }

/* A command inside a sentence: marked like a code block, with its own copy button. */
code.cmd, .prose :not(pre) > code.cmd { background: var(--soil); color: var(--soil-ink); border: 0; border-radius: 4px; padding: .2em .55em; white-space: nowrap; }
code.cmd[role] { position: relative; cursor: pointer; }
code.cmd[role]:hover { outline: 1px solid var(--shaft); }
code.cmd[data-note]::after { content: attr(data-note); position: absolute; left: 50%; bottom: calc(100% + .35rem); transform: translateX(-50%); background: var(--shaft); color: #17120e; font: 600 .72rem var(--body); padding: .15rem .5rem; border-radius: 4px; white-space: nowrap; }

/* Phones. Kept last so it wins over the rules above. */
@media (max-width: 40rem) {
  /* Logo and badge share the first row; the links get one row of their own. */
  .top { row-gap: .6rem; }
  .top nav { order: 3; width: 100%; flex-wrap: nowrap; justify-content: space-between; gap: .75rem; font-size: .9rem; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }

  /* The copy button gets a row of its own above the code, so it covers nothing. */
  .copywrap pre { padding-top: 2.5rem; }
  .panel .copy { top: 0; }

  .call { white-space: normal; overflow-wrap: anywhere; }
  .price small { display: block; margin-top: .5rem; line-height: 1.4; }

  /* Tables in the docs: each row becomes a small block, read top to bottom. */
  .prose table { min-width: 0; }
  .prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .prose tr { display: block; padding-block: .7rem; border-bottom: 1px solid var(--line); }
  .prose tbody tr:first-child { border-top: 1px solid var(--line); }
  .prose td { display: block; padding: .1rem 0; border: 0; }
  .prose tr:first-child td { border-top: 0; }
  .prose td:first-child { font-weight: 600; }
  .prose td:nth-child(2):not(:last-child) { color: var(--muted); font-size: .92rem; }
}

/* Phones and tablets: one row of tabs that scrolls sideways, not ragged rows. */
@media (max-width: 64rem) {
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs button { flex: none; white-space: nowrap; }
}

/* Two overlapping sheets at the end of a clickable command: the usual sign for "copy". */
code.cmd[role] { padding-right: 1.9em; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23a3958a' stroke-width='1.5'%3E%3Crect x='5.5' y='5.5' width='8' height='8' rx='1.5'/%3E%3Cpath d='M10.5 3.5v-1a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h1'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .5em center; background-size: .95em; }

/* The rights line: a row of its own under the footer links. */
.foot .rights { flex-basis: 100%; max-width: none; font-size: .85rem; }
.foot .rights span { display: block; }

/* About: who is behind portmole, as label and name pairs. */
.credits { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: 0 2rem; border-top: 1px solid var(--line); margin: 0; }
.credits dt, .credits dd { padding-block: 1rem; border-bottom: 1px solid var(--line); margin: 0; min-width: 0; }
.credits dt { font: 500 .78rem var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .09em; padding-top: 1.2rem; }
.credits dd { display: flex; flex-direction: column; gap: .25rem; }
.credits dd b { font: 500 1.2rem var(--display); }
.credits dd span { color: var(--muted); font-size: .97rem; }
@media (max-width: 40rem) {
  .credits { grid-template-columns: minmax(0, 1fr); }
  .credits dt { border-bottom: 0; padding-bottom: 0; }
  .credits dd { padding-top: .3rem; }
}
