/* librairc.org — Swiss / International Typographic Style */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/geist-latin.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: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/geist-mono-latin.woff2") format("woff2"); }

:root {
  --bg: #ffffff; --ink: #111111; --mid: #6b6b6b; --rule: #111111; --hair: #d9d9d9; --red: #e30613; --red-ink: #ffffff; --red-inv: #ff4d57; --tint: #f3f3f1;
  --ok: #00a650; --bad: #e30613; --unk: #b5b5b5;
  --font: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif; --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}
:root.dark { --bg: #0b0b0b; --ink: #f2f2f0; --mid: #9a9a96; --rule: #f2f2f0; --hair: #2b2b2b; --red: #ff2a35; --red-ink: #0b0b0b; --red-inv: #c4000d; --tint: #161616; color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
code { font-family: var(--mono); font-size: .9em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--red); color: var(--red-ink); padding: 10px 16px; font-weight: 700; }
.skip:focus { top: 12px; }
.icon { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 12-column grid */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 20px; max-width: 1320px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 760px) { .grid { padding: 0 40px; column-gap: 24px; } }
.grid > * { grid-column: 1 / -1; min-width: 0; }

/* header */
.top { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 2px solid var(--rule); }
.top-in { align-items: center; height: 64px; }
.brand { grid-column: 1 / 7; display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: -.03em; text-decoration: none; width: max-content; }
.mark { width: 28px; height: 28px; }
.mark-bg { fill: var(--ink); } .mark-f { fill: var(--bg); } .mark-r { fill: var(--red); }
.nav { display: none; }
.top-r { grid-column: 7 / -1; justify-self: end; display: flex; align-items: center; gap: 8px; }
.live { display: none; align-items: center; gap: 8px; font-size: .8rem; color: var(--mid); margin-right: 8px; white-space: nowrap; }
.tbtn { display: inline-grid; place-items: center; width: 40px; height: 40px; background: none; border: 2px solid var(--rule); color: var(--ink); cursor: pointer; border-radius: 0; }
.tbtn:hover { background: var(--ink); color: var(--bg); }
.tbtn .icon { width: 18px; height: 18px; }
.i-light, :root.dark .i-dark { display: none; } :root.dark .i-light { display: block; }
.menu-toggle .i-close, .menu-toggle[aria-expanded="true"] .i-open { display: none; } .menu-toggle[aria-expanded="true"] .i-close { display: block; }
.nav.open { display: grid; position: absolute; left: 0; right: 0; top: 64px; background: var(--bg); border-bottom: 2px solid var(--rule); padding: 8px 16px 16px; }
.nav a { display: flex; gap: 10px; align-items: baseline; text-decoration: none; font-weight: 700; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.nav .n, .d-toc .n, .d-sec h2 .n { font-family: var(--mono); font-size: .72rem; color: var(--red); font-weight: 600; }
@media (min-width: 960px) {
  .brand { grid-column: 1 / 4; }
  .nav, .nav.open { display: flex; grid-column: 4 / 10; gap: 28px; position: static; padding: 0; border: 0; }
  .nav a { border: 0; padding: 0; font-size: .95rem; }
  .nav a:hover { color: var(--red); }
  .top-r { grid-column: 10 / -1; }
  .menu-toggle { display: none; }
  .live { display: inline-flex; }
}

.sdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--unk); flex: none; vertical-align: middle; }
.sdot.ok { background: var(--ok); } .sdot.down { background: var(--bad); }

/* hero */
.hero { border-bottom: 2px solid var(--rule); overflow: hidden; }
.hero-in { position: relative; padding-top: 40px; padding-bottom: 48px; row-gap: 28px; }
.hero-k { grid-column: 1 / -1; position: relative; z-index: 1; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; color: var(--mid); }
.hero-h { grid-column: 1 / -1; font-weight: 900; letter-spacing: -.075em; line-height: .82; font-size: clamp(4.4rem, 21vw, 15.5rem); display: flex; flex-direction: column; position: relative; z-index: 1; }
.hero-h span:last-child { padding-left: .55em; }
.dot-red { color: var(--red); font-style: normal; }
.hero-c { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; position: relative; z-index: 1; }
.hero-l { font-size: 1.15rem; max-width: 30em; }
.hero-red { position: absolute; z-index: 0; width: 34vw; max-width: 420px; aspect-ratio: 1; background: var(--red); right: -6vw; top: 30px; border-radius: 50%; }
@media (max-width: 759px) { .hero-red { width: 40vw; right: -14vw; top: 12px; opacity: .95; } .hero-k { max-width: 60%; } }
@media (min-width: 960px) {
  .hero-in { padding-top: 64px; padding-bottom: 72px; }
  .hero-k { grid-column: 1 / 6; grid-row: 1; }
  .hero-h { grid-column: 1 / 8; grid-row: 2; }
  .hero-c { grid-column: 8 / -1; grid-row: 2; align-self: end; margin-bottom: .6rem; }
  .hero-red { right: 6%; top: 24px; width: 18vw; max-width: 250px; }
}
.start { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; max-width: 520px; width: 100%; }
.start label { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.start-row { display: flex; border: 2px solid var(--rule); background: var(--bg); }
.start input { flex: 1; min-width: 0; width: 100%; font: inherit; font-size: 1.1rem; padding: .85em 1em; border: 0; background: transparent; color: var(--ink); border-radius: 0; }
.start input:focus { outline: none; }
.start-row:focus-within { box-shadow: 0 0 0 3px var(--red); }
.btn { display: inline-flex; align-items: center; gap: 10px; font: inherit; font-weight: 800; font-size: 1rem; background: var(--red); color: var(--red-ink); border: 0; padding: 0 22px; cursor: pointer; border-radius: 0; }
.btn:hover { background: var(--ink); color: var(--bg); }
.form-msg { min-height: 1.3em; font-size: .9rem; color: var(--red); font-weight: 600; }
.form-msg:empty { min-height: 0; }

/* section heads */
.sec { padding: 56px 0; border-bottom: 2px solid var(--rule); }
@media (min-width: 960px) { .sec { padding: 88px 0; } }
.sh { display: grid; grid-template-columns: auto 1fr; column-gap: 18px; align-items: baseline; margin-bottom: 36px; padding-bottom: 14px; border-bottom: 1px solid var(--hair); }
.sh-n { font-family: var(--mono); font-weight: 600; color: var(--red); font-size: .9rem; }
.sh-t { font-size: clamp(2.6rem, 7vw, 5.4rem); font-weight: 900; letter-spacing: -.06em; line-height: .9; }
.sh-p { grid-column: 2; color: var(--mid); margin-top: 10px; max-width: 36em; }
@media (min-width: 960px) { .sh { grid-template-columns: 1fr 6fr 5fr; } .sh-p { grid-column: 3; margin: 0; align-self: end; text-align: right; justify-self: end; } }

/* network */
.map-wrap { margin: 0; border: 2px solid var(--rule); background: var(--tint); }
.map { display: block; width: 100%; height: auto; }
.dots circle { fill: var(--hair); }
:root.dark .dots circle { fill: #303030; }
.link { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 6 6; fill: none; }
.node-ring { fill: none; stroke: var(--unk); stroke-width: 2; }
.node-core { fill: var(--unk); }
.node-code { font-family: var(--font); font-weight: 900; font-size: 30px; fill: var(--ink); letter-spacing: -1px; }
.node-label { font-family: var(--mono); font-size: 13px; fill: var(--mid); }
.node.up .node-core { fill: var(--ok); } .node.up .node-ring { stroke: var(--ok); animation: pulse 2.4s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.node.down .node-core { fill: var(--bad); } .node.down .node-ring { stroke: var(--bad); stroke-dasharray: 4 4; }
@keyframes pulse { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
.net-side { display: grid; gap: 28px; margin-top: 28px; align-content: start; }
@media (min-width: 960px) { .map-wrap { grid-column: 1 / 8; } .net-side { grid-column: 8 / -1; margin-top: 0; } }
.srv { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--rule); }
.srv li { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 14px 0; border-bottom: 1px solid var(--hair); }
.srv-n { font-weight: 800; font-size: 1.25rem; letter-spacing: -.02em; }
.srv-l { grid-row: 2; color: var(--mid); font-size: .9rem; }
.srv-s { grid-row: 1 / 3; grid-column: 2; align-self: center; font-family: var(--mono); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; padding: 4px 10px; border: 2px solid var(--hair); color: var(--mid); }
.srv-s.up { border-color: var(--ok); color: var(--ok); } .srv-s.down { border-color: var(--bad); color: var(--bad); }
.conn { width: 100%; border-collapse: collapse; }
.conn caption { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; padding-bottom: 10px; }
.conn th, .conn td { text-align: left; padding: 10px 0; border-top: 1px solid var(--hair); vertical-align: top; }
.conn th { width: 34%; font-weight: 700; padding-right: 12px; }
.conn tr:first-child th, .conn tr:first-child td { border-top: 2px solid var(--rule); }
.net-more { margin-top: -8px; }

/* links */
.lnk { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; border-bottom: 2px solid currentColor; padding-bottom: 1px; white-space: nowrap; }
.lnk .icon { width: .85em; height: .85em; }
.lnk:hover { color: var(--red); }
.lnk-red { color: var(--red); }
.lnk-red:hover { color: var(--ink); }

/* rooms */
.sec-rooms { background: var(--ink); color: var(--bg); border-bottom-color: var(--ink); }
.sec-rooms .sh { border-bottom-color: color-mix(in srgb, var(--bg) 25%, transparent); }
.sec-rooms .sh-p { color: color-mix(in srgb, var(--bg) 65%, transparent); }
.sec-rooms .lnk-red, .sec-rooms .room-i, .sec-rooms .sh-n { color: var(--red-inv); }
.sec-rooms .lnk:hover { color: var(--red); } .sec-rooms .lnk-red:hover { color: var(--bg); }
.rooms { list-style: none; margin: 0; padding: 0; }
.room { display: grid; grid-template-columns: 40px 1fr; gap: 6px 14px; padding: 22px 0; border-top: 1px solid color-mix(in srgb, var(--bg) 25%, transparent); align-items: baseline; }
.room-i { font-family: var(--mono); font-size: .8rem; color: var(--red); }
.room-n { font-size: clamp(2rem, 6vw, 4rem); font-weight: 900; letter-spacing: -.05em; line-height: 1; overflow-wrap: anywhere; }
.room-d { grid-column: 2; color: color-mix(in srgb, var(--bg) 72%, transparent); max-width: 32em; }
.room-d b { color: var(--bg); }
.room-a { grid-column: 2; display: flex; gap: 18px; margin-top: 6px; }
@media (min-width: 960px) {
  .room { grid-template-columns: 1fr 5fr 4fr 2fr; }
  .room-d, .room-a { grid-column: auto; }
  .room-a { justify-self: end; margin: 0; }
}

/* clients */
.cls { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--rule); }
.cl { display: grid; grid-template-columns: 40px 1fr; gap: 10px 14px; padding: 18px 0; border-bottom: 1px solid var(--hair); align-items: start; }
.cl-i { font-family: var(--mono); font-size: .8rem; color: var(--red); padding-top: 4px; }
.cl-img { grid-column: 2; width: 100%; max-width: 280px; aspect-ratio: 16 / 10; object-fit: cover; border: 1px solid var(--rule); filter: grayscale(1) contrast(1.05); transition: filter .25s; }
.cl:hover .cl-img, .cl:focus-within .cl-img { filter: none; }
.cl-b { grid-column: 2; }
.cl-b h3 { font-size: 1.6rem; font-weight: 900; letter-spacing: -.04em; display: flex; align-items: center; gap: 10px; }
.cl-t { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--red); margin-top: 2px; }
.cl-d { color: var(--mid); margin-top: 6px; max-width: 34em; font-size: .95rem; }
.cl-a { grid-column: 2; display: flex; gap: 18px; }
@media (min-width: 760px) {
  .cl { grid-template-columns: 48px 200px 1fr auto; column-gap: 24px; align-items: center; }
  .cl-img, .cl-b, .cl-a { grid-column: auto; }
  .cl-a { justify-self: end; }
}

/* principles */
.sec-last { border-bottom: 0; }
.pr-l { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: p; }
@media (min-width: 760px) { .pr-l { grid-template-columns: repeat(2, 1fr); column-gap: 40px; } }
@media (min-width: 1100px) { .pr-l { grid-template-columns: repeat(4, 1fr); } }
.pr-l li { counter-increment: p; padding: 18px 0 24px; border-top: 2px solid var(--rule); font-size: 1.05rem; }
.pr-l li::before { content: counter(p, decimal-leading-zero); display: block; font-family: var(--mono); color: var(--red); font-size: .8rem; margin-bottom: 8px; }
.pr-l b { display: block; font-size: 1.6rem; font-weight: 900; letter-spacing: -.04em; margin-bottom: 6px; }

/* footer */
.foot { background: var(--red); color: var(--red-ink); }
.foot-in { padding-top: 48px; padding-bottom: 40px; row-gap: 28px; }
.foot-big { font-size: clamp(2.6rem, 8vw, 5rem); font-weight: 900; letter-spacing: -.06em; line-height: .9; }
.foot h2 { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 10px; }
.foot-in > div { display: flex; flex-direction: column; gap: 6px; }
.foot-in a { text-decoration: none; font-weight: 600; }
.foot-in a:hover { text-decoration: underline; }
.foot-st { display: flex; align-items: center; gap: 8px; }
.foot .sdot.ok { background: #fff; box-shadow: 0 0 0 2px var(--red-ink); }
:root.dark .foot .sdot.ok { background: #0b0b0b; }
.foot-c { font-size: .85rem; margin-top: 8px; }
@media (min-width: 760px) { .foot-big { grid-column: 1 / 6; } .foot-in > div:nth-of-type(1) { grid-column: 6 / 8; } .foot-in > div:nth-of-type(2) { grid-column: 8 / 10; } .foot-in > div:nth-of-type(3) { grid-column: 10 / -1; } }

/* doc pages */
.d-hero { border-bottom: 2px solid var(--rule); padding: 48px 0 40px; }
.d-hero .grid { row-gap: 10px; }
.d-hero h1 { font-size: clamp(3.4rem, 12vw, 9rem); font-weight: 900; letter-spacing: -.07em; line-height: .85; }
.d-intro { color: var(--mid); font-size: 1.15rem; max-width: 34em; }
.d-wrap { padding-top: 40px; padding-bottom: 72px; }
.d-toc { display: none; }
@media (min-width: 960px) {
  .d-toc { display: flex; flex-direction: column; grid-column: 1 / 4; position: sticky; top: 96px; align-self: start; border-top: 2px solid var(--rule); }
  .d-toc a { display: flex; gap: 10px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--hair); text-decoration: none; font-weight: 600; }
  .d-toc a:hover { color: var(--red); }
  .d-body { grid-column: 5 / -1; }
}
.d-sec { padding: 0 0 36px; margin-bottom: 36px; border-bottom: 1px solid var(--hair); }
.d-sec:last-child { border-bottom: 0; }
.d-sec h2 { display: flex; gap: 14px; align-items: baseline; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 900; letter-spacing: -.05em; margin-bottom: 16px; }
.d-b { max-width: 44em; }
.d-b p, .d-b ul, .d-b ol { margin: 0 0 14px; }
.d-b ul, .d-b ol { padding-left: 1.2em; }
.d-b li { margin-bottom: 8px; }
.d-b li::marker { color: var(--red); font-weight: 700; }
.d-b a { color: var(--red); font-weight: 600; }
.d-b code { background: var(--tint); padding: .1em .35em; }

/* 404 */
.nf { padding: 72px 0 96px; }
.nf-c { font-size: clamp(7rem, 30vw, 20rem); font-weight: 900; letter-spacing: -.08em; line-height: .8; color: var(--red); }
.nf-h { font-size: clamp(2rem, 6vw, 4rem); font-weight: 900; letter-spacing: -.05em; margin-top: 16px; }
.nf-p { margin-top: 16px; font-size: 1.15rem; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }

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