/* ==========================================================================
   irc.splaq.us
   Brand: homelab inc. — graphite + one amber, IBM Plex Mono / Plex Sans.
   Direction: an IRC session and a manpage sharing a page. Mono does the
   structure, sans does the reading. Hairlines, no shadows, no second colour.
   ========================================================================== */

:root {
  /* surfaces */
  --bg: #0C0E10;
  --raised: #131619;
  --inset: #191D21;

  /* text */
  --fg: #E9E7E2;
  --fg-2: #A2A6AB;
  --fg-3: #7A8086;

  /* the only accent */
  --amber: #E8A33D;
  --amber-2: #F2BC6B;

  /* structure */
  --line: #22272C;
  --line-2: #394046;

  /* type */
  --mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: "IBM Plex Sans", "Fira Sans", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;

  --body: 1.0625rem;              /* 17px */
  --small: 1rem;                  /* 16px — supporting prose never drops below body */
  --label: 0.6875rem;             /* 11px */
  --caption: 0.8125rem;           /* 13px */

  --h1: clamp(2.125rem, 1.25rem + 3.7vw, 3.75rem);
  --h2: clamp(1.5rem, 1.25rem + 1vw, 2.125rem);
  --h3: 1.0625rem;

  --gutter: clamp(1.25rem, 4vw, 4rem);
  --wrap: 1180px;
  --section: clamp(3.5rem, 2.5rem + 4.5vw, 7rem);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 120ms;
  --base: 240ms;
}

/* ------------------------------------------------------------------ reset */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: var(--body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1.15;
  text-wrap: balance;
}

p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
button { font: inherit; color: inherit; }

code {
  font-family: var(--mono);
  font-size: 0.92em;
  color: var(--fg);
  background: var(--inset);
  border-radius: 2px;
  padding: 0.06em 0.32em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

strong { font-weight: 600; color: var(--fg); }
em { font-style: italic; color: var(--fg); }

a { color: var(--fg); text-decoration: none; }

::selection { background: var(--amber); color: #0C0E10; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--amber);
  color: #0C0E10;
  font-family: var(--mono);
  font-size: var(--caption);
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---------------------------------------------------------- top strip */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 56px;
  padding: 0 var(--gutter);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.top-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  color: var(--fg);
}

.brand-net::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.6rem;
  background: var(--amber);
  vertical-align: 0.12em;
}

.top-nav {
  display: flex;
  gap: 1.25rem;
  margin-left: auto;
}

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--mono);
  font-size: var(--caption);
  color: var(--fg-3);
  transition: color var(--fast) var(--ease);
}
.top-nav a:hover { color: var(--amber); }

.top-state {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: var(--caption);
  color: var(--fg-3);
  white-space: nowrap;
}

.tick {
  width: 5px;
  height: 5px;
  margin-right: 0.5rem;
  background: var(--amber);
}

/* ---------------------------------------------------------------- wrap */

.hero,
.sec,
.foot {
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

/* ---------------------------------------------------------------- hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  padding-top: clamp(3rem, 2rem + 6vw, 6.5rem);
  padding-bottom: var(--section);
}

.kicker {
  font-family: var(--mono);
  font-size: var(--label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: var(--h1);
  line-height: 1.02;
  letter-spacing: -0.032em;
  margin-bottom: 1.5rem;
}

.lede {
  max-width: 46ch;
  color: var(--fg-2);
  font-size: 1.125rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 1.25rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.875rem;
  letter-spacing: -0.005em;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}

.btn-fill {
  background: var(--amber);
  border-color: var(--amber);
  color: #0C0E10;
}
.btn-fill:hover { background: var(--amber-2); border-color: var(--amber-2); }

.btn-line {
  border-color: var(--line-2);
  color: var(--fg);
}
.btn-line:hover { border-color: var(--fg-3); }

/* the log block — asymmetric, dropped, hairline framed */

.log {
  margin: 0;
  padding: 1.1rem 1.15rem 0.9rem;
  border: 1px solid var(--line);
  background: var(--raised);
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.95;
  color: var(--fg-2);
  white-space: pre-wrap;
  overflow-wrap: normal;
  transform: translateY(clamp(0rem, 2.4vw, 2.75rem));
}

.log .l {
  display: block;
  padding-left: 1.6ch;
  text-indent: -1.6ch;
  opacity: 0;
  animation: rise 320ms var(--ease) forwards;
}
.log .l:nth-child(1) { animation-delay: 80ms; }
.log .l:nth-child(2) { animation-delay: 160ms; }
.log .l:nth-child(3) { animation-delay: 240ms; }
.log .l:nth-child(4) { animation-delay: 320ms; }
.log .l:nth-child(5) { animation-delay: 400ms; }
.log .l:nth-child(6) { animation-delay: 480ms; }
.log .l:nth-child(7) { animation-delay: 560ms; }
.log .l:nth-child(8) { animation-delay: 640ms; }

.log i {
  font-style: normal;
  color: var(--amber);
  margin-right: 0.25rem;
}

.log .dim { color: var(--fg-3); }
.log .dim i { color: var(--fg-3); }

.log .caret { line-height: 1; margin-top: 0.35rem; }
.log .caret b {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  background: var(--amber);
  vertical-align: -0.15em;
  animation: blink 1.15s steps(1, end) infinite;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@keyframes blink {
  0%, 49%   { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* ------------------------------------------------------------- section */

.sec {
  padding-bottom: var(--section);
  scroll-margin-top: 64px;
}

.sec-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-bottom: 0.85rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.sec-num {
  font-family: var(--mono);
  font-size: var(--caption);
  color: var(--amber);
  letter-spacing: 0.06em;
  min-width: 1.75rem;
}

.sec-head h2 {
  font-size: var(--h2);
  letter-spacing: -0.028em;
}

.sec-meta {
  margin-left: auto;
  font-family: var(--mono);
  font-size: var(--caption);
  color: var(--fg-3);
  white-space: nowrap;
}

/* ------------------------------------------------------- connect fields */

.fields {
  display: grid;
  grid-template-columns: 1.6fr 0.7fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.field {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0.5rem;
  min-height: 104px;
  padding: 0.9rem 1rem 0.85rem;
  background: var(--raised);
  border: 0;
  text-align: left;
  cursor: pointer;
  transition: background var(--fast) var(--ease);
}

button.field:hover { background: var(--inset); }
button.field:hover .field-h { color: var(--amber); }
button.field:active { background: #0F1214; }

.field-k {
  font-family: var(--mono);
  font-size: var(--label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.field-v {
  font-family: var(--mono);
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  color: var(--fg);
  align-self: center;
  overflow-wrap: anywhere;
}

.field-v.v-sm { font-size: var(--body); color: var(--fg-2); }

.field-h {
  font-family: var(--mono);
  font-size: var(--label);
  letter-spacing: 0.08em;
  color: var(--fg-3);
  align-self: end;
  transition: color var(--fast) var(--ease);
}

.field.is-copied .field-h { color: var(--amber); }

.is-static { cursor: default; }
.is-static .field-h { color: var(--fg-3); }

.connect-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-top: 1rem;
}

.note {
  font-size: var(--small);
  color: var(--fg-2);
  max-width: 62ch;
}

.dim { color: var(--fg-3); }

.inline-link {
  position: relative;
  color: var(--fg);
  border-bottom: 1px solid var(--line-2);
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

/* hit area without disturbing the underline or the line box */
.inline-link::after {
  content: "";
  position: absolute;
  inset: -0.7rem -0.25rem;
}
.inline-link:hover { color: var(--amber); border-color: var(--amber); }

/* --------------------------------------------------------- steps */

.steps {
  display: grid;
  gap: 2.5rem;
}

.step {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 0.25rem 0.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--line);
}
.step:first-child { padding-top: 0; border-top: 0; }

.step-num {
  font-family: var(--mono);
  font-size: 1.75rem;
  line-height: 1;
  color: var(--amber);
  letter-spacing: -0.03em;
}

.step-body { max-width: 66ch; }
.step-body h3 { font-size: 1.1875rem; margin-bottom: 0.6rem; }
.step-body p { color: var(--fg-2); }
.step-body p + p { margin-top: 0.7rem; }
.step-body .code { margin: 1rem 0; }

.aside {
  font-size: var(--small);
  color: var(--fg-3);
  margin-top: 0.9rem;
}
.aside a { color: var(--fg-2); }

/* code blocks */

.code {
  display: flex;
  align-items: stretch;
  max-width: 46rem;
  border: 1px solid var(--line);
  background: var(--inset);
}

.code pre {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--fg);
  scrollbar-width: thin;
}

.code pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  white-space: pre;
}

.code-block { margin-top: 0.9rem; }

.copy {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.85rem;
  align-self: stretch;
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  font-family: var(--mono);
  font-size: var(--label);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-2);
  cursor: pointer;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.copy:hover { color: var(--amber); background: var(--raised); }
.copy.is-copied { color: var(--amber); }

/* arg list */

.args {
  display: grid;
  gap: 1px;
  margin: 1rem 0;
  background: var(--line);
  border: 1px solid var(--line);
}

.arg {
  display: grid;
  grid-template-columns: 8.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.7rem 1rem;
  background: var(--raised);
}

.arg dt {
  font-family: var(--mono);
  font-size: var(--caption);
  color: var(--amber);
}

.arg dd {
  font-size: var(--small);
  color: var(--fg-2);
}

/* -------------------------------------------------------------- tabs */

.tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--line-2);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-height: 56px;
  padding: 0.6rem 1.1rem 0.55rem;
  margin-bottom: -1px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font-family: var(--mono);
  font-size: 0.875rem;
  color: var(--fg-3);
  cursor: pointer;
  transition: color var(--fast) var(--ease), border-color var(--fast) var(--ease);
}

.tab:hover { color: var(--fg); }

.tab[aria-selected="true"] {
  color: var(--fg);
  border-bottom-color: var(--amber);
}

.tab-os {
  font-size: var(--label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.panel {
  padding-top: 1.75rem;
  animation: fade 240ms var(--ease);
}
.panel[hidden] { display: none; }

@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.spec {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  max-width: 66ch;
}

.spec-row {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.7rem 1rem;
  background: var(--raised);
}

.spec-row dt {
  font-family: var(--mono);
  font-size: var(--label);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-3);
  padding-top: 0.2rem;
}

.spec-row dd {
  font-size: var(--small);
  color: var(--fg);
}

/* ----------------------------------------------------------- reasons */

.reasons {
  display: grid;
  gap: 0;
}

.reason {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  gap: 0 0.5rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line);
}
.reason:first-child { border-top: 0; padding-top: 0; }
.reason:last-child { padding-bottom: 0; }

.reason-num {
  font-family: var(--mono);
  font-size: var(--caption);
  color: var(--amber);
  padding-top: 0.35rem;
}

.reason h3 { font-size: 1.1875rem; margin-bottom: 0.55rem; }
.reason p { color: var(--fg-2); max-width: 64ch; }

/* --------------------------------------------------------------- faq */

.faq {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.qa {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 2rem;
  padding: 1.5rem 1.25rem;
  background: var(--raised);
}

.qa dt {
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: -0.015em;
  color: var(--fg);
}

.qa dd {
  font-size: var(--small);
  color: var(--fg-2);
  max-width: 56ch;
}

/* ------------------------------------------------------------ footer */

.foot {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--line-2);
  margin-top: 1rem;
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem 3rem;
}

.foot-col h3 {
  font-size: var(--label);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 0.65rem;
}

.foot-col p {
  font-size: var(--small);
  line-height: 1.7;
  color: var(--fg-2);
}

.foot-col .cmd {
  display: block;
  margin: 0.35rem 0 0;
  padding: 0.5rem 0.6rem;
  font-size: 0.9375rem;
  color: var(--fg);
  overflow-wrap: anywhere;
}

.foot-col .foot-sp { margin-top: 1rem; }

.foot-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.mark {
  display: block;
  width: 150px;
  height: auto;
  opacity: 0.85;
}

.foot-state {
  font-family: var(--mono);
  font-size: var(--label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.eof {
  margin-top: 2.5rem;
  font-family: var(--mono);
  font-size: var(--label);
  letter-spacing: 0.14em;
  color: var(--line-2);
  text-align: center;
}

/* --------------------------------------------------------- responsive */

@media (max-width: 1040px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  .log { transform: none; max-width: 40rem; }
  .qa { grid-template-columns: 1fr; gap: 0.75rem; }
  .qa dd { max-width: 70ch; }
}

@media (max-width: 860px) {
  .fields { grid-template-columns: 1fr 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .top-nav { gap: 1rem; }
}

@media (max-width: 700px) {
  .top-nav { display: none; }
  .top-state { margin-left: auto; }
  .sec-head { flex-wrap: wrap; }
  .sec-meta { margin-left: 0; width: 100%; }
  .spec-row { grid-template-columns: 9rem minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .fields { grid-template-columns: 1fr; }
  .field { min-height: 88px; padding: 0.85rem 0.9rem; }
  .field-v { font-size: 1.25rem; }
  .step, .reason { grid-template-columns: 2.25rem minmax(0, 1fr); }
  .step-num { font-size: 1.375rem; }
  .arg { grid-template-columns: 1fr; gap: 0.25rem; }
  .spec-row { grid-template-columns: 1fr; gap: 0.25rem; }
  .spec-row dt { padding-top: 0; }
  .foot-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1 1 100%; }
  .log { font-size: 0.9375rem; padding: 0.9rem 0.85rem 0.7rem; }
  .code pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
  .code pre { overflow-x: visible; }
  /* 2x2 grid: a bottom-border tab indicator would detach when the row wraps */
  .tablist {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--line);
  }
  .tab {
    margin: 0;
    min-height: 60px;
    padding: 0.55rem 0.8rem;
    border: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .tab:nth-child(2n) { border-right: 0; }
  .tab:nth-child(n+3) { border-bottom: 0; }
  .tab[aria-selected="true"] {
    background: var(--raised);
    color: var(--amber);
    border-bottom-color: var(--line);
  }
  .tab:nth-child(n+3)[aria-selected="true"] { border-bottom-color: transparent; }
  .tab-os { display: none; }
  .foot-base { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .log .l { opacity: 1; }
}
