/* ipfence site. The principles and tokens are in DESIGN.md. */

@font-face { font-family: "Atkinson"; font-weight: 400; font-display: swap; src: url(fonts/atkinson-hyperlegible-next-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson"; font-weight: 400; font-display: swap; src: url(fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson"; font-weight: 700; font-display: swap; src: url(fonts/atkinson-hyperlegible-next-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson"; font-weight: 700; font-display: swap; src: url(fonts/atkinson-hyperlegible-next-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+1E00-1E9F, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson"; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/atkinson-hyperlegible-next-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Atkinson"; font-weight: 700; font-style: italic; font-display: swap; src: url(fonts/atkinson-hyperlegible-next-latin-700-italic.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Mono"; font-weight: 400; font-display: swap; src: url(fonts/atkinson-hyperlegible-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Mono"; font-weight: 700; font-display: swap; src: url(fonts/atkinson-hyperlegible-mono-latin-700-normal.woff2) format("woff2"); }

:root {
  --paper: #f5f7f9;
  --box: #ffffff;
  --tint: #ecf0f3;
  --line: #c9d2da;
  --ink: #1f2328;
  --soft: #545d66;
  --code: #f0f2f4;
  --inline: #faf3d2;
  --link: #0a579e;
  --visited: #5c2b83;
  --bar: #2f3033;
  --bar-text: #c6cacf;
  --brick: #a5391f;
  --focus-on-dark: #ffd447;
  --mark: #fbe7a1;
  --pad: clamp(0.75rem, 2.4vw, 2.25rem);
  --text: "Atkinson", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Atkinson Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 0.9375rem/1.6 var(--text); }
img, svg { max-width: 100%; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:visited { color: var(--visited); }
a:active { background: var(--mark); }
a, button, summary, input { touch-action: manipulation; }
button, summary { -webkit-user-select: none; user-select: none; }
summary { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brick); outline-offset: 2px; }
main:focus { outline: none; }
main:focus-visible { outline: 2px dashed var(--brick); outline-offset: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 0.75rem; top: -6rem; z-index: 10; padding: 0.6rem 1rem; border: 2px solid var(--ink); background: var(--box); font-weight: 700; }
.skip:focus { top: 0.75rem; }

/* ---------- top bar and footer ---------- */

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 2rem; padding: 0.4rem max(var(--pad), env(safe-area-inset-right)) 0.4rem max(var(--pad), env(safe-area-inset-left)); border-bottom: 4px solid var(--brick); background: var(--bar); color: var(--bar-text); }
.brand { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 0.9rem; margin: 0; }
.wordmark { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 48px; line-height: 0; }
.wordmark svg:not(.mascot) { width: 134px; height: auto; }
.tagline { padding-bottom: 0.55rem; color: #b4babf; font-size: 0.8rem; line-height: 1.3; }
.top ul { display: flex; flex-wrap: wrap; gap: 0 1.6rem; margin: 0; padding: 0; list-style: none; }
.top nav a { display: inline-flex; align-items: center; min-height: 44px; border-block: 3px solid transparent; color: var(--bar-text); font-weight: 700; text-decoration: none; }
.top nav a:visited { color: var(--bar-text); }
.top nav a[aria-current="page"] { border-bottom-color: var(--brick); color: #fff; }
.top a:active { background: transparent; color: #fff; }
.top :focus-visible { outline-color: var(--focus-on-dark); }

.foot { position: relative; padding: 0.9rem var(--pad) calc(1.75rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--soft); font-size: 0.8rem; text-align: center; }
.foot p { margin: 0.2rem 0; }

/* ---------- the mascot ---------- */

.mascot { flex: none; max-width: none; }
.wordmark .mascot { width: 40px; height: auto; }
/* Looking over the footer's top edge. The page leaves room above it. */
.foot .mascot { position: absolute; right: calc(var(--pad) + 0.5rem); bottom: 100%; width: 66px; height: auto; }
.intro-face { line-height: 0; }
.lost { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2.5rem; }
.lost > .doc { flex: 1 1 18rem; }
.search-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.search-head h1 { min-width: 0; margin-bottom: 0 !important; }
.search-head .mascot { width: 92px; height: auto; }

/* ---------- layout: the whole width of the window ---------- */

.layout { display: grid; align-items: start; gap: 1.25rem; padding: 1.25rem max(var(--pad), env(safe-area-inset-right)) 3.25rem max(var(--pad), env(safe-area-inset-left)); }
.layout > * { min-width: 0; }
.layout.with-side { grid-template-columns: minmax(0, 1fr) 20rem; }
.layout.manual { grid-template-columns: 16rem minmax(0, 1fr); }
.layout.plain { grid-template-columns: minmax(0, 1fr); }
.manual > main, .plain > main { padding: 1.1rem clamp(0.9rem, 2vw, 2rem) 2rem; border: 1px solid var(--line); background: var(--box); }
.with-side > main { container-type: inline-size; }

/* ---------- text ---------- */

:is(.prose, .home) :is(p, ul, ol, blockquote) { margin: 0 0 0.85em; }
:is(.prose, .home) :is(p, li) { text-wrap: pretty; }
:is(.prose, .home) :is(ul, ol) { padding-left: 1.4em; }
:is(.prose, .home) ul { list-style: square; }
:is(.prose, .home) li { margin: 0.25em 0; }
:is(.prose, .home) h1 { margin: 0 0 0.8rem; font-size: 1.75rem; line-height: 1.2; text-wrap: balance; overflow-wrap: break-word; }
.prose h2 { margin: 2rem 0 0.75rem; padding-bottom: 0.25rem; border-bottom: 1px solid var(--line); font-size: 1.3rem; line-height: 1.3; text-wrap: balance; }
.prose h3 { margin: 1.5rem 0 0.5rem; font-size: 1.08rem; line-height: 1.35; text-wrap: balance; }
.prose h4 { margin: 1.2rem 0 0.4rem; font-size: 0.95rem; }
:is(h1, h2, h3)[id], #about { scroll-margin-top: 0.75rem; }
.anchor { margin-left: 0.5rem; color: var(--soft); font-weight: 400; text-decoration: none; }
.anchor:visited { color: var(--soft); }
:is(.prose, .home) blockquote { padding: 0.6rem 0.9rem 0.01rem; border: 1px solid var(--line); border-left: 4px solid var(--brick); background: var(--tint); }
:is(.prose, .home) hr { margin: 2rem 0; border: 0; border-top: 1px solid var(--line); }
:not(pre) > code { padding: 0.05em 0.28em; background: var(--inline); font: 400 0.92em/1.4 var(--mono); overflow-wrap: anywhere; }
li.task { position: relative; list-style: none; }
li.task input { position: absolute; left: -1.4em; top: 0.4em; width: 1.05em; height: 1.05em; margin: 0; }

/* ---------- tables ---------- */

.table-scroll, .code pre, .diagram-art, .diagram pre { overscroll-behavior-x: contain; }
.table-scroll { max-width: 100%; margin: 0.9rem 0 1.2rem; overflow-x: auto; }
.table-scroll table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; line-height: 1.5; }
.table-scroll :is(th, td) { min-width: 5.5em; padding: 0.35rem 0.65rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-scroll th { background: var(--tint); }
.table-scroll tbody tr:nth-child(even) td { background: var(--paper); }
td code { overflow-wrap: normal !important; }
code.whole { white-space: nowrap; overflow-wrap: normal; }

/* ---------- code ---------- */

.code { margin: 0.8rem 0 1.1rem; border: 1px dashed #a9b3bc; background: var(--code); }
.code-label { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 2.1rem; margin: 0 !important; padding: 0.3rem 0.45rem 0 0.85rem; color: var(--soft); font-size: 0.78rem; line-height: 1.3; }
.code pre, .licence { margin: 0; padding: 0.35rem 0.85rem 0.7rem; overflow-x: auto; color: var(--ink); font: 400 0.84rem/1.55 var(--mono); tab-size: 4; }
.code pre { background: transparent !important; }
.code pre code { font: inherit; }
.code pre:focus-visible, .licence:focus-visible { outline-offset: -3px; }
.licence { padding-top: 0.75rem; border: 1px dashed #a9b3bc; background: var(--code); white-space: pre-wrap; }

button { border: 1px solid #7d868f; border-radius: 2px; background: var(--box); color: var(--ink); font: 400 0.9rem/1.3 var(--text); cursor: pointer; }
.copy { flex: none; min-height: 1.7rem; margin-left: auto; padding: 0.1rem 0.55rem; font-size: 0.78rem; }
.copy[data-state="done"] { background: var(--mark); }

/* ---------- diagrams ---------- */

.diagram { max-width: 100%; margin: 1.2rem 0; border: 1px solid var(--line); background: var(--box); }
.diagram-art { overflow-x: auto; padding: 1rem 0.8rem; text-align: center; line-height: normal; }
.diagram-art:focus-visible { outline-offset: -3px; }
.diagram-art svg { display: inline-block; vertical-align: top; }
.diagram-art.fit svg { min-width: 0 !important; }
.diagram-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.75rem; margin: 0 !important; padding: 0.3rem 0.5rem 0.3rem 0.85rem; border-top: 1px solid var(--line); background: var(--tint); font-size: 0.82rem; }
.diagram-bar[hidden] { display: none; }
.diagram-missing { margin: 0; padding: 0.7rem 0.85rem; background: var(--tint); }
.diagram details { border-top: 1px solid var(--line); }
.diagram summary { padding: 0.45rem 0.85rem; color: var(--soft); font-size: 0.82rem; }
.diagram pre { margin: 0; padding: 0.7rem 0.85rem; overflow-x: auto; font: 400 0.8rem/1.5 var(--mono); }

/* ---------- home: main column ---------- */

.intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title title" "text face" "more face"; grid-template-rows: auto 1fr auto; column-gap: 2rem; margin-bottom: 1.5rem; padding: 0.7rem 1.1rem 0.15rem; border: 1px solid var(--line); background: var(--tint); }
.intro > h1 { grid-area: title; }
.intro-text { grid-area: text; }
.intro-face { grid-area: face; align-self: end; padding-bottom: 0.85rem; }
.intro-face .mascot { width: 144px; height: auto; }
.intro > .more { grid-area: more; }
.home .intro h1 { margin-bottom: 0.65rem; padding-bottom: 0.35rem; border-bottom: 1px solid #98a3ad; font-size: clamp(1.45rem, 2.6vw, 1.75rem); }
.intro-text { font-size: 1.02rem; }
.home .more { text-align: right; }
.home .next { display: inline-block; padding: 0.15rem 0; font-weight: 700; }
.home section + section { margin-top: 1.5rem; }
/* A label on a coloured tab introduces each part of the page. */
.home h2.tab { position: relative; display: inline-block; margin: 0 0 0.9rem; padding: 0.3rem 0.8rem; background: var(--brick); color: #fff; font-size: 1rem; line-height: 1.4; }
.home h2.tab::after { content: ""; position: absolute; left: 1.1rem; top: 100%; border: 6px solid transparent; border-top-color: var(--brick); }

.transcript { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 1.25rem; }
.step { display: flex; flex-direction: column; min-width: 0; }
.home .step p { margin-bottom: 0.3rem; }
.step .code { flex: 1; margin: 0 0 1rem; }
.step .code pre { padding-block: 0.6rem; }
.small { color: var(--soft); font-size: 0.82rem; }
/* Quoted lines wrap here, with the continuation indented. */
.home pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.home pre .line { display: inline-block; width: 100%; padding-left: 2ch; text-indent: -2ch; vertical-align: top; }

.entries { columns: 26rem auto; column-gap: 1.25rem; }
.home .table-scroll table { background: var(--box); }
.entry { margin: 0 0 1.25rem; padding: 0 0.9rem 0.05rem; border: 1px solid var(--line); background: var(--box); break-inside: avoid; }
.home .entry h3 { margin: 0 -0.9rem 0.75rem; padding: 0.45rem 0.9rem; border-bottom: 1px solid var(--line); background: var(--tint); font-size: 1rem; line-height: 1.4; }

@container (min-width: 60rem) {
  .transcript { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Room for all four side by side: a grid uses the whole width. */
@container (min-width: 105rem) {
  .entries { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: 1.25rem; align-items: start; }
}
@container (min-width: 112rem) {
  .transcript { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- home: sidebar ---------- */

.side { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 1rem; font-size: 0.875rem; }
.search-box { padding: 0.6rem 0.75rem 0.75rem; background: var(--brick); color: #fff; }
.search-box label { display: block; margin-bottom: 0.35rem; font-weight: 700; }
.search-box .search { margin: 0; }
.search-box :focus-visible { outline-color: var(--focus-on-dark); }
.box { border: 1px solid var(--line); background: var(--box); }
.box h2 { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.25rem 0.75rem; margin: 0; padding: 0.4rem 0.7rem; border-bottom: 1px solid var(--line); background: var(--tint); font-size: 0.95rem; line-height: 1.4; }
.box h2 a { font-size: 0.8rem; font-weight: 400; }
.box ul { margin: 0; padding: 0.3rem 0.7rem 0.5rem; list-style: none; }
.box li { padding: 0.14rem 0; }
.box li a { text-decoration: none; }
.box table { width: 100%; border-collapse: collapse; }
.box :is(th, td) { padding: 0.28rem 0.7rem; border-bottom: 1px solid var(--tint); text-align: left; vertical-align: top; }
.box th { width: 7.5em; }
.box > p { margin: 0; padding: 0.5rem 0.7rem 0.65rem; color: var(--soft); font-size: 0.82rem; }
.commits li { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; padding: 0.3rem 0; border-bottom: 1px dotted var(--line); }
.commits li:last-child { border-bottom: 0; }
.commits a { min-width: 0; overflow-wrap: anywhere; }
.commits time { flex: none; color: var(--soft); font-size: 0.76rem; }

/* ---------- manual ---------- */

.manual-menu { border: 1px solid var(--line); background: var(--box); font-size: 0.88rem; line-height: 1.4; }
.manual-menu > summary { padding: 0.45rem 0.7rem; background: var(--tint); font-weight: 700; }
.manual-menu[open] > summary { border-bottom: 1px solid var(--line); }
.manual-menu nav { padding: 0 0.7rem 0.4rem; }
.manual-menu ul { margin: 0; padding: 0; list-style: none; }
.manual-menu > nav > ul { padding: 0.25rem 0; }
.manual-menu a { position: relative; display: block; padding: 0.22rem 0 0.22rem 0.9rem; text-decoration: none; }
.manual-menu a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.manual-menu a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: calc(0.22rem + 0.45em); width: 0.45rem; height: 0.45rem; background: var(--brick); }
.group { border-top: 1px solid var(--line); }
.group summary { margin-left: 1.1em; padding: 0.45rem 0; font-weight: 700; list-style-position: outside; }
.group ul { padding-bottom: 0.45rem !important; }

.search-box .search div, .manual-menu .search { display: flex; gap: 0.4rem; }
.manual-menu .search { margin: 0.6rem 0.7rem 0.35rem; }
input[type="search"] { width: 100%; min-width: 0; min-height: 2.35rem; padding: 0.3rem 0.5rem; border: 1px solid #7d868f; border-radius: 2px; background: var(--box); color: var(--ink); font: 400 1rem/1.3 var(--text); }
.search button, .search-form button { flex: none; min-height: 2.35rem; padding: 0.2rem 0.7rem; }

.breadcrumbs ol { display: flex; flex-wrap: wrap; margin: 0 0 1rem; padding: 0; list-style: none; color: var(--soft); font-size: 0.82rem; }
.breadcrumbs li + li::before { content: "/"; margin: 0 0.5rem; }
.breadcrumbs li[aria-current] { color: var(--ink); }

.doc, .doc > article { display: grid; grid-template-columns: minmax(0, 1fr); }
.doc > *, .doc > article > * { min-width: 0; }
.doc-body > h2:first-child { margin-top: 1rem; }
.toc { margin: 0 0 1.2rem; border: 1px solid var(--line); background: var(--paper); font-size: 0.84rem; line-height: 1.4; }
.toc summary { padding: 0.35rem 0.7rem; background: var(--tint); font-weight: 700; }
.toc ul { margin: 0; padding: 0.35rem 0.7rem; list-style: none; }
.toc ul ul { padding: 0 0 0 0.8rem; }
.toc li { margin: 0.28rem 0; overflow-wrap: anywhere; }
.toc a { text-decoration: none; }

.steps-between { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; margin-top: 2.5rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.steps-between a { display: inline-block; padding: 0.35rem 0; }
.steps-between .later { margin-left: auto; text-align: right; }
.source { margin: 0.5rem 0 0; color: var(--soft); font-size: 0.8rem; overflow-wrap: anywhere; }

@media (min-width: 1180px) {
  .has-toc > article { grid-template-columns: minmax(0, 1fr) 14rem; grid-template-rows: auto 1fr; column-gap: 2rem; }
  .doc-title { grid-column: 1; grid-row: 1; }
  .doc-body { grid-column: 1; grid-row: 2; }
  .toc { grid-column: 2; grid-row: 1 / span 2; align-self: start; position: sticky; top: 0.75rem; max-height: calc(100vh - 1.5rem); margin: 0; overflow-y: auto; }
  .doc.has-toc > .doc-end { max-width: calc(100% - 16rem); }
}

/* ---------- search ---------- */

.search-form label { display: block; margin-bottom: 0.35rem; font-weight: 700; }
.search-form div { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.search-form input { flex: 1 1 14rem; width: auto !important; }
#search-status { font-weight: 700; }
#search-status:empty { margin: 0; }
.results { padding: 0 !important; list-style: none !important; }
.results li { margin: 0 !important; padding: 0.7rem 0; border-top: 1px solid var(--line); }
.results a { font-weight: 700; }
.results .where { margin-left: 0.6rem; color: var(--soft); font-size: 0.8rem; }
.results p { margin: 0.15rem 0 0 !important; overflow-wrap: anywhere; }
mark { padding: 0 1px; background: var(--mark); color: var(--ink); }
.note { padding: 0.6rem 0.9rem; border-left: 4px solid var(--brick); background: var(--tint); }

/* ---------- pointers that can hover ---------- */

@media (hover: hover) and (pointer: fine) {
  a:hover { text-decoration-thickness: 2px; }
  .top nav a:hover { color: #fff; text-decoration: underline; text-underline-offset: 0.3em; }
  .manual-menu a:hover, .toc a:hover, .box li a:hover { text-decoration-line: underline; }
  button:hover { background: var(--mark); }
  summary:hover { color: var(--brick); }
  .anchor { opacity: 0; }
  :is(h2, h3):hover .anchor { opacity: 1; }
}

/* ---------- touch ---------- */

@media (pointer: coarse) {
  .copy { min-height: 40px; padding-inline: 0.9rem; }
  .code-label { min-height: 48px; }
  button, input[type="search"] { min-height: 44px; }
  .manual-menu a { padding-block: 0.65rem; }
  .manual-menu a[aria-current="page"]::before { top: calc(0.65rem + 0.45em); }
  .manual-menu summary, .toc summary, .diagram summary { min-height: 44px; padding-block: 0.7rem; }
  .box li a { display: block; padding-block: 0.6rem; }
  .steps-between a, .foot a { padding-block: 0.6rem; }
  .home .next { padding-block: 0.6rem; }
}

/* ---------- narrower screens ---------- */

@media (max-width: 999px) {
  .layout.with-side { grid-template-columns: minmax(0, 1fr); }
  .side { grid-template-columns: repeat(auto-fit, minmax(min(17rem, 100%), 1fr)); align-items: start; }
}

@media (max-width: 899px) {
  .layout.manual { grid-template-columns: minmax(0, 1fr); gap: 0.75rem; }
}

@media (max-width: 520px) {
  .tagline { flex-basis: 100%; padding-bottom: 0.2rem; }
  .top ul { gap: 0 1.1rem; }
  .layout { gap: 1rem; padding-top: 0.75rem; }
  :is(.prose, .home) h1 { font-size: 1.5rem; }
  /* The mascot moves up beside the headline. */
  .intro { grid-template-areas: "title face" "text text" "more more"; grid-template-rows: none; column-gap: 0.75rem; }
  .intro-face { align-self: center; padding-bottom: 0.65rem; }
  .intro-face .mascot { width: 76px; }
  .lost .mascot { width: 128px; height: auto; }
  .search-head .mascot { width: 72px; }
}

/* On a phone a command scrolls sideways; a wrapped one looks like two. */
@media (max-width: 620px) {
  .home .code[data-language="sh"] pre { white-space: pre; overflow-wrap: normal; }
  .home .code[data-language="sh"] pre .line { display: inline; padding: 0; text-indent: 0; }
}

@media print {
  .top nav, .manual-menu, .side, .toc, .copy, .steps-between, .skip, .mascot { display: none !important; }
  .layout { display: block; }
}
