/* ============================================================
   loadtest.com.au — RPM Solutions Pty Ltd
   Dark technical theme
   ============================================================ */

:root {
  --bg: #0b1220;
  --bg-alt: #0f1830;
  --surface: #141f3a;
  --surface-2: #1a2747;
  --border: #243358;
  --text: #d7e1f5;
  --text-dim: #8fa3c8;
  --heading: #f2f6ff;
  --accent: #3b9eff;
  --accent-2: #22d3ee;
  --accent-dim: rgba(59, 158, 255, 0.12);
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --maxw: 1180px;
  --radius: 8px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--heading); line-height: 1.25; margin: 1.6em 0 0.6em; }
h1 { font-size: 2.1rem; margin-top: 0.4em; }
h2 { font-size: 1.45rem; border-bottom: 1px solid var(--border); padding-bottom: 0.35em; }
h3 { font-size: 1.15rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; }

p { margin: 0.8em 0; }

code, pre {
  font-family: var(--mono);
  font-size: 0.875em;
}

code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  color: var(--accent-2);
}

pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  line-height: 1.5;
}

pre code { background: none; border: none; padding: 0; color: var(--text); }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 0.6em 0.8em;
  border: 1px solid var(--border);
}

th { background: var(--surface); color: var(--heading); font-weight: 600; }
tr:nth-child(even) td { background: rgba(20, 31, 58, 0.45); }

blockquote {
  margin: 1.2em 0;
  padding: 0.8em 1.2em;
  border-left: 3px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text);
}

hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

/* ---------- Header / top nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 18, 32, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 62px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--heading);
  white-space: nowrap;
}

.brand:hover { text-decoration: none; }

.brand .logo-mark {
  width: 30px;
  height: 30px;
  flex: none;
}

.brand .tld { color: var(--accent); }

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

.top-nav a {
  color: var(--text-dim);
  padding: 0.45em 0.8em;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
}

.top-nav a:hover { color: var(--heading); background: var(--surface); text-decoration: none; }
.top-nav a.active { color: var(--accent); background: var(--accent-dim); }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.4em 0.7em;
  font-size: 1rem;
  cursor: pointer;
}

/* ---------- Layout ---------- */

.page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 2.5rem;
}

.page.full { grid-template-columns: minmax(0, 1fr); }

/* ---------- Sidebar tree ---------- */

.sidebar {
  font-size: 0.92rem;
  align-self: start;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 0.5rem;
}

.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar > ul > li { margin-bottom: 0.35rem; }

.sidebar .tree-section > .tree-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  color: var(--heading);
  font: inherit;
  font-weight: 600;
  padding: 0.4em 0.6em;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}

.sidebar .tree-section > .tree-label:hover { background: var(--surface); }
.sidebar .tree-section > .tree-label .caret { transition: transform 0.15s; font-size: 0.7em; color: var(--text-dim); }
.sidebar .tree-section.open > .tree-label .caret { transform: rotate(90deg); }

.sidebar .tree-children { display: none; margin-left: 0.5rem; border-left: 1px solid var(--border); padding-left: 0.6rem; }
.sidebar .tree-section.open > .tree-children { display: block; }

.sidebar a {
  display: block;
  color: var(--text-dim);
  padding: 0.32em 0.6em;
  border-radius: 6px;
}

.sidebar a:hover { color: var(--heading); background: var(--surface); text-decoration: none; }
.sidebar a.active { color: var(--accent); background: var(--accent-dim); font-weight: 600; }

/* ---------- Content ---------- */

.content { min-width: 0; }

.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.8rem;
  font-family: var(--mono);
}

.breadcrumbs a { color: var(--text-dim); }
.breadcrumbs a:hover { color: var(--accent); }

.lead { font-size: 1.12rem; color: var(--text-dim); }

.kicker {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 0.4rem;
}

/* ---------- Hero (homepage) ---------- */

.hero {
  background:
    radial-gradient(ellipse 70% 60% at 70% 0%, rgba(59, 158, 255, 0.13), transparent),
    linear-gradient(transparent 0, transparent),
    var(--bg);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(36, 51, 88, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 51, 88, 0.35) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent 80%);
  pointer-events: none;
}

.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4.5rem 1.25rem 4rem;
  position: relative;
}

.hero h1 {
  font-size: 2.7rem;
  max-width: 720px;
  margin: 0.5rem 0 1rem;
}

.hero .lead { max-width: 640px; font-size: 1.18rem; }

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

.btn {
  display: inline-block;
  padding: 0.7em 1.5em;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.98rem;
  border: 1px solid transparent;
}

.btn-primary { background: var(--accent); color: #061224; }
.btn-primary:hover { background: var(--accent-2); color: #061224; text-decoration: none; }
.btn-ghost { border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.hero-stats {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  max-width: 760px;
}

.stat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(20, 31, 58, 0.6);
  padding: 0.9rem 1.1rem;
}

.stat .num { font-family: var(--mono); font-size: 1.5rem; color: var(--accent-2); font-weight: 700; }
.stat .label { font-size: 0.82rem; color: var(--text-dim); margin-top: 0.15rem; }

/* ---------- Cards ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  margin: 1.5rem 0;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, transform 0.15s;
}

.card:hover { border-color: var(--accent); transform: translateY(-2px); }

.card h3 { margin: 0 0 0.5rem; font-size: 1.08rem; }
.card p { color: var(--text-dim); font-size: 0.93rem; margin: 0 0 1rem; flex: 1; }
.card .card-link { font-size: 0.9rem; font-weight: 600; font-family: var(--mono); }

/* ---------- Callouts ---------- */

.callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem 1.3rem;
  margin: 1.5em 0;
  font-size: 0.95rem;
}

.callout.warn { border-left-color: var(--warn); }
.callout.ok { border-left-color: var(--ok); }
.callout strong:first-child { color: var(--heading); }

/* ---------- Forms ---------- */

.form-grid { display: grid; gap: 1.1rem; max-width: 640px; }

label { font-weight: 600; color: var(--heading); font-size: 0.92rem; display: block; margin-bottom: 0.3rem; }

input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.65em 0.85em;
  font: inherit;
  font-size: 0.95rem;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

textarea { resize: vertical; min-height: 140px; }

.form-status { font-size: 0.93rem; padding: 0.8em 1em; border-radius: 6px; display: none; }
.form-status.ok { display: block; background: rgba(52, 211, 153, 0.12); border: 1px solid var(--ok); color: var(--ok); }
.form-status.err { display: block; background: rgba(248, 113, 113, 0.12); border: 1px solid var(--danger); color: var(--danger); }

.recaptcha-note { font-size: 0.78rem; color: var(--text-dim); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  margin-top: 2rem;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  font-size: 0.9rem;
}

.footer-inner h4 { margin: 0 0 0.7rem; font-size: 0.95rem; }
.footer-inner ul { list-style: none; margin: 0; padding: 0; }
.footer-inner li { margin-bottom: 0.4rem; }
.footer-inner a { color: var(--text-dim); }
.footer-inner a:hover { color: var(--accent); }

.footer-bottom {
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dim);
  padding: 1.2rem;
  font-family: var(--mono);
}

/* ---------- Misc ---------- */

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15em 0.7em;
  color: var(--accent-2);
  margin-right: 0.4rem;
}

.toc {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem 1.4rem;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}

.toc strong { color: var(--heading); }
.toc ul { margin: 0.5rem 0 0; padding-left: 1.2rem; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .page { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static;
    max-height: none;
    order: 2;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
  }
  .hero h1 { font-size: 2.1rem; }
  .nav-toggle { display: block; }
  .top-nav {
    display: none;
    position: absolute;
    top: 62px;
    left: 0;
    right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 0.75rem 1.25rem;
  }
  .top-nav.open { display: flex; }
}
