/* ==========================================================================
   #rshelp @ SwiftIRC
   Dark-committed. No framework, no CDN, no webfonts.

   Palette note: the transcript colours are not invented. Reinze renders its
   output with mIRC colour 14 (grey) and 04 (red) -- see reinze-lib-common,
   Source::l/c1/c2. Both are lifted here, nudged brighter/softer so they stay
   legible on a dark background instead of vibrating.
   ========================================================================== */

:root {
  /* Surfaces: warm-black, not neutral -- RuneScape's UI has always been brown. */
  --bg:            #100e0a;
  --bg-sunk:       #0b0906;
  --surface:       #1a1610;
  --line:          #2a2418;
  --line-bright:   #3d3423;

  /* Text. --dim is the floor: anything dimmer than this stops being readable
     on --surface, so borders use --line/--line-bright and text never does. */
  --text:          #ece6d8;
  --muted:         #9c9382;
  --dim:           #8a8170;
  --gold-shadow:   #75684a;

  /* Accent */
  --gold:          #c9a227;
  --gold-bright:   #e6c257;
  --gold-wash:     rgba(201, 162, 39, 0.12);

  /* Diegetic: only ever used inside the transcript. */
  --irc-grey:      #9d9d9d;
  --irc-red:       #e2564d;
  --nick-1:        #6fb3d2;
  --nick-2:        #c58fd4;
  --nick-3:        #8fce7a;

  /* Type: monospace is the display face. IRC is a text protocol; its own
     voice is fixed-width. The body face stays out of the way. */
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", "JetBrains Mono",
          "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, sans-serif;

  --measure: 64ch;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
}

/* --- reset (minimal) ---------------------------------------------------- */

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

body, h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--gold);
  text-decoration-color: rgba(201, 162, 39, 0.4);
  text-underline-offset: 0.2em;
}
a:hover { color: var(--gold-bright); text-decoration-color: currentColor; }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- layout ------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.wrap-wide { max-width: 78ch; }

.section { padding-block: clamp(2.75rem, 7vw, 4.5rem); }
.section + .section { border-top: 1px solid var(--line); }

.section-head { margin-bottom: 1.75rem; }

.section-head::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  background: var(--gold);
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--sans);
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.section-note {
  color: var(--muted);
  margin-top: 0.6rem;
  max-width: 58ch;
}

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

.hero {
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(201, 162, 39, 0.07), transparent 62%),
    var(--bg-sunk);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(3rem, 9vw, 5.5rem);
}

.hero-name {
  font-family: var(--mono);
  font-size: clamp(2.75rem, 1.6rem + 5.4vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--gold);
}

.hero-name .hash { color: var(--gold-shadow); }

.hero-sub {
  margin-top: 1.1rem;
  font-size: clamp(1.05rem, 1rem + 0.4vw, 1.3rem);
  color: var(--text);
  max-width: 46ch;
  text-wrap: balance;
}

.hero-where {
  margin-top: 0.55rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- transcript: the signature element ---------------------------------- */

.transcript {
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.transcript-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.9rem;
  background: rgba(0, 0, 0, 0.28);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.transcript-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--nick-3);
  box-shadow: 0 0 0 3px rgba(143, 206, 122, 0.14);
  flex: none;
}

.transcript-log {
  padding: 0.9rem 0.4rem 1.1rem;
  font-family: var(--mono);
  font-size: clamp(0.75rem, 0.66rem + 0.42vw, 0.875rem);
  line-height: 1.9;
  overflow-x: auto;
}

.line {
  display: grid;
  grid-template-columns: auto 11ch 1fr;
  gap: 0 0.85rem;
  padding-inline: 0.75rem;
  min-width: 44ch;
}
.line:hover { background: rgba(255, 255, 255, 0.022); }

.time { color: var(--dim); font-variant-numeric: tabular-nums; }

.nick { text-align: right; white-space: nowrap; }
.nick-1 { color: var(--nick-1); }
.nick-2 { color: var(--nick-2); }
.nick-3 { color: var(--nick-3); }

/* Channel status prefixes. These carry real meaning: @ is an operator,
   + is voiced. Reinze is voiced, which is why it wears one. */
.sigil { color: var(--gold); }

.said { color: var(--text); }
.said .cmd { color: var(--gold-bright); }

/* Reinze's reply, in Reinze's own colours. */
.bot-label { color: var(--irc-grey); }
.bot-label b { color: var(--irc-red); font-weight: 400; }
.bot-c1 { color: var(--irc-grey); }
.bot-c2 { color: var(--irc-red); }

.transcript-foot {
  padding: 0.7rem 1.15rem 0.9rem;
  border-top: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--muted);
}

/* --- buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--gold);
  color: #14110a;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--gold-bright); color: #14110a; transform: translateY(-1px); }
.btn:active { transform: none; }

.btn-quiet {
  background: transparent;
  border-color: var(--line-bright);
  color: var(--text);
  font-weight: 500;
}
.btn-quiet:hover { background: var(--gold-wash); border-color: var(--gold); color: var(--text); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* --- connection block --------------------------------------------------- */

.conn {
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.conn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.75rem;
  padding: 1rem 1.15rem;
  font-family: var(--mono);
  font-size: 0.875rem;
}

.conn-field { display: flex; flex-direction: column; gap: 0.1rem; }

.conn-key {
  font-size: 0.6875rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.conn-val { color: var(--text); }
.conn-val strong { color: var(--gold); font-weight: 600; }

.conn-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.15rem;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.22);
}

.conn-cmd {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  overflow-x: auto;
  white-space: nowrap;
}
.conn-cmd b { color: var(--text); font-weight: 400; }

.copy-btn {
  flex: none;
  padding: 0.35rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  background: transparent;
  border: 1px solid var(--line-bright);
  border-radius: 3px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.copy-btn:hover { color: var(--gold); border-color: var(--gold); }
.copy-btn[data-copied="true"] { color: var(--nick-3); border-color: var(--nick-3); }

/* --- clients ------------------------------------------------------------ */

.clients {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem 2rem;
  margin-top: 1.5rem;
}

.client-os {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.55rem;
}

.client-list { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.client-list li { font-size: 0.9375rem; }

.subhead {
  margin-top: 2.25rem;
  font-size: 1.0625rem;
  font-weight: 650;
}

.tag {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.dead {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

.client-foot { margin-top: 1.5rem; font-size: 0.9375rem; color: var(--muted); }

/* --- bots --------------------------------------------------------------- */

.trigger {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem 1.1rem;
  align-items: baseline;
  margin-top: 1.5rem;
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  border-left: 2px solid var(--gold);
  border-radius: 0 5px 5px 0;
}

.trigger-key {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
}

.trigger-val { font-size: 0.9375rem; }

.cmd-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem 2rem;
  margin-top: 2rem;
}

.cmd-group-name {
  font-family: var(--mono);
  font-size: 0.6875rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.7rem;
}

.cmd-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.cmd-list li {
  font-family: var(--mono);
  font-size: 0.8125rem;
  padding: 0.15rem 0.5rem;
  background: var(--gold-wash);
  border-radius: 3px;
  color: var(--gold-bright);
}

.retired {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--muted);
}

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

.faq { border-top: 1px solid var(--line); }

.faq-item { border-bottom: 1px solid var(--line); }

.faq-q {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 1.05rem 0.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  transition: color 0.15s ease;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q:hover { color: var(--gold); }

.faq-q::after {
  content: "+";
  margin-left: auto;
  font-family: var(--mono);
  font-size: 1.15rem;
  color: var(--gold);
  transition: transform 0.2s ease;
}
.faq-item[open] > .faq-q::after { transform: rotate(45deg); }

.faq-a {
  padding: 0 0.25rem 1.2rem;
  color: var(--muted);
  max-width: 58ch;
}

code {
  font-family: var(--mono);
  font-size: 0.875em;
  color: var(--gold-bright);
  background: var(--gold-wash);
  padding: 0.1em 0.4em;
  border-radius: 3px;
}

/* --- rules -------------------------------------------------------------- */

.rules { counter-reset: rule; margin-top: 0.5rem; }

.rules li {
  counter-increment: rule;
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0.75rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}
.rules li:last-child { border-bottom: 0; }

.rules li::before {
  content: counter(rule) ".";
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--gold);
  padding-top: 0.22em;
}

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

.foot {
  border-top: 1px solid var(--line);
  background: var(--bg-sunk);
  padding-block: 2.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  justify-content: space-between;
  align-items: center;
}

.foot-name { font-family: var(--mono); color: var(--text); }

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

@media (max-width: 34rem) {
  .line { grid-template-columns: 9ch 1fr; }
  .time { display: none; }
  .transcript-log { padding-inline: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .btn:hover { transform: none; }
}
