:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f2f3f5;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --border: #e5e7eb;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 17, 21, 0.04), 0 1px 3px rgba(15, 17, 21, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 17, 21, 0.08);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #1a1d23;
    --surface-2: #20242c;
    --text: #e8e9ec;
    --text-muted: #9aa0ab;
    --accent: #60a5fa;
    --accent-hover: #8ec1fb;
    --accent-soft: rgba(96, 165, 250, 0.14);
    --border: #2a2e37;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.4);
  }
}

/* Manual theme override (wins over system preference once the user picks one) */
html[data-theme="light"] {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f2f3f5;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --border: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(15, 17, 21, 0.04), 0 1px 3px rgba(15, 17, 21, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 17, 21, 0.08);
}

html[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #1a1d23;
  --surface-2: #20242c;
  --text: #e8e9ec;
  --text-muted: #9aa0ab;
  --accent: #60a5fa;
  --accent-hover: #8ec1fb;
  --accent-soft: rgba(96, 165, 250, 0.14);
  --border: #2a2e37;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 17px;
  line-height: 1.65;
  scroll-behavior: smooth;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
}

body {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 20px 32px;
  font-family: 'Roboto', 'Questrial', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  transition: background-color 0.2s ease, color 0.2s ease;
}

h1 {
  font-size: clamp(30px, 5vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}

h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 36px;
  margin-bottom: 12px;
}

.guide h5 {
  margin: 28px 0 10px;
  font-size: 1.05em;
}

p {
  color: var(--text);
}

a:link,
a:visited {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0% 1px;
  transition: background-size 0.2s ease, color 0.2s ease;
}

a:hover,
a:focus-visible {
  color: var(--accent-hover);
  background-size: 100% 1px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

small {
  color: var(--text-muted);
}

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

#footer {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

#footer a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
}

#footer a:hover {
  color: var(--accent);
}

.intro {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 24px 0;
}

.intro img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.intro p {
  margin: 0;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  word-wrap: break-word;
  margin: 20px 0;
  font-size: 15px;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

th,
td {
  padding: 10px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background-color: var(--bg);
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

tr:last-child td {
  border-bottom: none;
}

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

td a:hover {
  text-decoration: underline;
}

/* Contact list */
.contact-list {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
}

.icon-inline {
  vertical-align: middle;
}

/* Navbar */
.navbar {
  padding: 10px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.navbar a:link,
.navbar a:visited,
.navbar button {
  display: inline-block;
  line-height: normal;
  text-decoration: none;
  background-image: none;
  background-color: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  font-size: 15px;
  font-family: 'Roboto', sans-serif;
}

.navbar a:hover,
.navbar button:hover {
  color: var(--text);
  background-color: var(--bg);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.navbar a:active,
.navbar button:active {
  transform: translateY(0);
}

.theme-toggle {
  margin-left: auto;
  width: 38px;
  height: 38px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
}

/* Long-form guides (github.html) */
.guide h2 {
  margin-top: 32px;
}

.guide img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 16px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.guide blockquote {
  margin: 20px 0;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}

.guide blockquote p {
  margin: 0;
}

.guide code {
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--surface-2);
  border-radius: 6px;
}

.guide pre {
  padding: 12px 16px;
  overflow-x: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.guide pre code {
  padding: 0;
  background: none;
}

/* Site logo and title, links back to the home page */
.home-link:link,
.home-link:visited {
  color: var(--text);
  background-image: none;
}

.home-link:hover,
.home-link:focus-visible {
  color: var(--accent-hover);
}

/* Small "On this page" index for guide sections */
.toc {
  display: inline-block;
  margin: 4px 0 8px;
  padding: 10px 16px;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.toc b {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.toc ul {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.toc ul ul {
  margin: 2px 0 2px 4px;
  padding-left: 12px;
  font-size: 13px;
  border-left: 1px solid var(--border);
}

.toc li {
  padding: 2px 0;
}

/* Window-style image collage, click an image to enlarge (collage.js) */
.window {
  margin: 20px 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.collage {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 150px;
  grid-auto-flow: dense;
  gap: 8px;
  padding: 8px;
}

.collage-item:link,
.collage-item:visited {
  position: relative;
  display: block;
  overflow: hidden;
  background-image: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.collage-item.wide {
  grid-column: span 2;
}

.collage-item.tall {
  grid-row: span 2;
}

.guide .collage-item img {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  object-fit: cover;
  object-position: top left;
  border: none;
  border-radius: 0;
  transition: transform 0.25s ease;
}

.collage-item:hover img,
.collage-item:focus-visible img {
  transform: scale(1.04);
}

.collage-caption {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  padding: 3px 9px;
  font-size: 12px;
  color: #fff;
  background: rgba(15, 17, 21, 0.75);
  border-radius: 999px;
}

.lightbox {
  max-width: min(1100px, 94vw);
  padding: 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.75);
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
  border-radius: var(--radius-sm);
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.lightbox-caption {
  margin: 0;
  font-size: 14px;
  text-align: center;
}

.lightbox button {
  font: inherit;
  cursor: pointer;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
}

.lightbox-close {
  display: block;
  margin: 0 0 10px auto;
}

@media (max-width: 600px) {
  .collage {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 120px;
  }
}

/* Collapsible guide subsections (sections.js) */
.section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease;
}

.section-toggle:hover {
  border-color: var(--accent);
}

.section-toggle::after {
  content: "›";
  font-size: 1.3em;
  line-height: 1;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.section-toggle[aria-expanded="true"]::after {
  transform: rotate(90deg);
}

.guide h4:has(.section-toggle) {
  margin: 12px 0;
}

.section-body {
  padding: 0 4px 8px;
}

/* Slim link boxes that only take the width they need (bobwallet.html Discord links) */
.contact-list.compact {
  align-items: flex-start;
  gap: 6px;
}

/* Small icons inside guides are not screenshots: no frame or spacing */
.guide img.icon-inline {
  display: inline;
  margin: 0;
  border: none;
  border-radius: 0;
}

.contact-list.compact li {
  gap: 8px;
  padding: 4px 12px;
  font-size: 14px;
}

/* Faucet request form (faucet.js) */
.faucet-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 520px;
  margin: 20px 0;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.faucet-form label {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 700;
}

.faucet-form input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.faucet-form input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.faucet-form input[type="text"]:user-invalid {
  border-color: #dc2626;
}

.faucet-form .field-hint {
  font-size: 12px;
}

.faucet-trap {
  display: none;
}

.faucet-form button {
  align-self: flex-start;
  margin-top: 14px;
  padding: 9px 20px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: #16a34a;
  border: none;
  border-radius: 999px;
}

.faucet-form button:hover {
  background: #15803d;
}

.faucet-form button.empty,
.faucet-form button.empty:hover,
.faucet-form button.empty:disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  background: var(--surface-2);
  border: 1px solid var(--border);
  opacity: 1;
}

.faucet-counter {
  display: inline-block;
  margin: 4px 0 0;
  padding: 6px 14px;
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.faucet-counter[hidden] {
  display: none;
}

.faucet-form button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.faucet-status {
  min-height: 1.4em;
  margin: 4px 0 0;
  font-size: 14px;
}

.faucet-status.ok {
  color: #16a34a;
}

.faucet-status.error {
  color: #dc2626;
}

/* Extra space between long bullet points in guides */
.guide ul.spaced li + li {
  margin-top: 12px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  body {
    width: 100%;
    padding: 32px 16px 24px;
  }

  h1 {
    line-height: 1.15;
  }

  h2 {
    font-size: 20px;
  }

  .intro {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .intro img {
    width: 96px;
    height: 96px;
  }

  .navbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .navbar a:link,
  .navbar a:visited,
  .navbar button {
    font-size: 14px;
    padding: 8px 14px;
    width: auto;
  }

  table {
    font-size: 14px;
  }

  th,
  td {
    padding: 8px 12px;
  }
}
