:root {
  /* Rooted color system - Dark theme enforced */
  --rooted-fg: #e0e0e0; /* Slightly dimmer white */
  --rooted-bg: #0a0a0a; /* Slightly darker black */
  --rooted-accent: #887adc; /* Slightly desaturated accent */
  --rooted-accent-rgb: 136, 122, 220; /* Adjusted RGB for accent */
  --rooted-accent-dark: #6b5eb3; /* Adjusted dark accent */
  --rooted-accent-light: #b1a7ff; /* Adjusted light accent */
  --rooted-accent-subtle: #1f1c33; /* Adjusted subtle accent */
  --rooted-gray-50: #111111;
  --rooted-gray-100: #1c1c1c; /* Darker code/pre background */
  --rooted-gray-200: #2a2a2a; /* Darker borders */
  --rooted-gray-300: #3f3f3f;
  --rooted-gray-400: #5e5e5e;
  --rooted-gray-500: #8a8a8a;
  --rooted-gray-600: #ababab;
  --rooted-gray-700: #cccccc; /* Lighter secondary text */
  --rooted-gray-800: #e0e0e0;
  --rooted-gray-900: #f5f5f5;
  --rooted-success: #22c55e;
  --rooted-error: #ef4444;
  --rooted-warning: #f59e0b;
  
  /* Component-specific variables */
  --header-height: 60px;
  --content-width: 960px;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --transition-duration: 0.2s;
  /* Minimal shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.15), 0 1px 2px -2px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 5px 8px -3px rgba(0, 0, 0, 0.15), 0 2px 4px -4px rgba(0, 0, 0, 0.15);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Roboto Mono", Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace;
}

/* Base styles */
html, body {
  font-family: var(--font-mono); /* Changed from --font-sans */
  background-color: var(--rooted-bg);
  color: var(--rooted-fg);
  font-size: 15px; /* Slightly smaller base font size */
  line-height: 1.7; /* Slightly increased line height */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  margin: 0;
  padding: 0;
  transition: background-color var(--transition-duration) ease, color var(--transition-duration) ease;
}

/* Preview Banner */
.preview-banner {
  background-color: #ef4444;
  color: white;
  text-align: center;
  padding: 0.5rem;
  font-weight: 600;
  font-family: var(--font-sans);
  font-size: 1rem;
  letter-spacing: 0.01em;
}

::selection {
  background-color: var(--rooted-accent);
  color: var(--rooted-bg); /* Use bg color for selected text */
}

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

.wrapper {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin: 1.5rem 0 0.75rem; /* Adjusted heading margins */
  font-weight: 500; /* Slightly lighter headings */
  line-height: 1.3;
  letter-spacing: -0.01em; /* Less aggressive letter spacing */
  color: var(--rooted-fg);
  font-family: var(--font-sans); /* Keep headings sans-serif for contrast? Or change to mono? Let's try sans first. */
}

h1 {
  font-size: 2.2rem; /* Adjusted size */
  font-weight: 600; /* Keep H1 slightly bolder */
}

h2 {
  font-size: 1.8rem; /* Adjusted size */
  font-weight: 600; /* Keep H2 slightly bolder */
}

h3 {
  font-size: 1.4rem; /* Adjusted size */
}

h4 {
  font-size: 1.15rem; /* Adjusted size */
}

p {
  margin: 0 0 1.25rem; /* Adjusted paragraph margin */
  color: var(--rooted-gray-700); /* Use the updated lighter gray */
}

a {
  color: var(--rooted-accent);
  text-decoration: none; /* Keep no underline by default */
  transition: color var(--transition-duration) ease, opacity var(--transition-duration) ease;
}

a:hover {
  color: var(--rooted-accent-light); /* Use lighter accent on hover */
  text-decoration: none; /* No underline on hover either, like rooted.host */
  opacity: 0.85;
}

code, pre {
  font-family: var(--font-mono);
  background: var(--rooted-gray-100);
  padding: 0.2em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  border: 1px solid var(--rooted-gray-200); /* Add subtle border */
  color: var(--rooted-gray-700); /* Lighter text color for code */
}

pre {
  padding: 1rem;
  overflow-x: auto;
  line-height: 1.45;
  border-radius: var(--radius);
}

/* Header */
.site-header {
  height: var(--header-height);
  border-bottom: 1px solid var(--rooted-gray-200);
  display: flex;
  align-items: center;
  /* Use the actual RGB values for the background transparency */
  background-color: rgba(10, 10, 10, 0.8); /* Directly use --rooted-bg value */
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: border-color var(--transition-duration) ease, background-color var(--transition-duration) ease;
  backdrop-filter: saturate(180%) blur(8px); /* Slightly stronger blur */
}

.site-header .wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.site-title {
  display: flex;
  align-items: center;
  font-size: 1.1rem; /* Smaller site title */
  font-weight: 500;
  color: var(--rooted-fg);
  text-decoration: none;
  transition: color var(--transition-duration) ease;
  letter-spacing: normal; /* Reset letter spacing */
  font-family: var(--font-mono); /* Use mono for title like rooted.host */
}

.site-title:hover {
  color: var(--rooted-accent-light); /* Lighter accent on hover */
  text-decoration: none;
}

.site-nav {
  display: flex;
  align-items: center;
  height: 100%;
}

.trigger {
  display: flex;
  height: 100%;
}

.page-link {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 0.8rem; /* Slightly less padding */
  color: var(--rooted-gray-600); /* Dimmer nav links */
  font-size: 0.9rem; /* Slightly smaller nav links */
  position: relative;
  transition: color var(--transition-duration) ease;
  font-family: var(--font-mono); /* Use mono for nav */
}

.page-link:hover {
  color: var(--rooted-fg); /* Brighter on hover */
}

.page-link.active {
  color: var(--rooted-fg);
}

.page-link.active::after {
  /* Remove the underline indicator for active link */
  content: none;
}

/* Footer */
.site-footer {
  margin-top: 5rem; /* More space before footer */
  padding: 2.5rem 0;
  border-top: 1px solid var(--rooted-gray-200);
  font-size: 0.85rem; /* Smaller footer text */
  color: var(--rooted-gray-500); /* Dimmer footer text */
}

.site-footer p {
  margin: 0.5rem 0;
}

/* Footer onion address with label */
.onion-address-container {
  font-family: var(--font-mono);
  background: var(--rooted-gray-100);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm); /* Smaller radius */
  margin: 1rem 0;
  border: 1px solid var(--rooted-gray-200);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.onion-address-label {
  margin-right: 0.5rem;
  user-select: none; /* Prevent selection of the label */
}

.onion-address {
  font-weight: 500;
  word-break: break-all;
  user-select: all; /* Make only the address selectable */
}

/* Page content */
.page-content {
  padding: 4rem 0; /* More vertical padding */
  min-height: calc(100vh - var(--header-height) - 150px); /* Adjusted min-height */
}

/* Cards and sections */
.section, .service-item {
  background-color: transparent; /* Remove card background */
  border-radius: 0; /* Remove radius */
  padding: 0; /* Remove padding */
  margin-bottom: 2rem; /* Adjust spacing */
  border: none; /* Remove border */
  transition: none; /* Remove transition */
  box-shadow: none; /* Remove shadow */
}

.section:hover, .service-item:hover {
  box-shadow: none; /* Remove hover shadow */
  border-color: transparent; /* Remove hover border */
  transform: none; /* Remove hover transform */
}

/* Buttons */
.btn, .filter-btn, .key-download-btn, .view-all-btn, .download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem; /* Smaller buttons */
  padding: 0 1rem;
  border-radius: var(--radius-sm); /* Less rounded */
  font-size: 0.85rem;
  font-weight: 500;
  background-color: var(--rooted-gray-100); /* Use subtle gray */
  color: var(--rooted-gray-700); /* Dimmer text */
  border: 1px solid var(--rooted-gray-200);
  cursor: pointer;
  transition: all var(--transition-duration) ease;
  text-decoration: none;
  user-select: none;
  font-family: var(--font-mono); /* Mono font for buttons */
}

.btn:hover, .filter-btn:hover, .key-download-btn:hover, .view-all-btn:hover, .download-btn:hover {
  background-color: var(--rooted-gray-200); /* Slightly darker gray on hover */
  color: var(--rooted-gray-800); /* Lighter text on hover */
  transform: none; /* No transform */
  box-shadow: none; /* No shadow */
  border-color: var(--rooted-gray-300);
}

.btn-primary, .view-all-btn, .key-download-btn, .download-btn {
  background-color: var(--rooted-accent-subtle); /* Use subtle accent */
  color: var(--rooted-accent-light); /* Lighter accent text */
  border-color: var(--rooted-accent); /* Accent border */
}

.btn-primary:hover, .view-all-btn:hover, .key-download-btn:hover, .download-btn:hover {
  opacity: 1; /* No opacity change */
  color: var(--rooted-accent-light);
  background-color: var(--rooted-gray-100); /* Subtle background on hover */
  border-color: var(--rooted-accent-light);
}

/* Button icons styling */
.btn svg, .key-download-btn svg, .view-all-btn svg, .download-btn svg, .filter-btn svg {
  display: none; /* Remove icons from buttons, as we avoid SVG */
}

/* Public key page styles */
.key-fingerprint {
  font-family: var(--font-mono);
  background-color: var(--rooted-gray-100);
  padding: 0.5rem;
  display: inline-block;
  margin: 0.5rem 0;
  border-radius: var(--radius-sm); /* Smaller radius */
  border: 1px solid var(--rooted-gray-200); /* Add border */
}

.pgp-key {
  background-color: var(--rooted-gray-100);
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  white-space: pre;
  line-height: 1.4;
  border-radius: var(--radius-sm); /* Smaller radius */
  border: 1px solid var(--rooted-gray-200); /* Add border */
}

.command-example {
  background-color: var(--rooted-gray-100);
  padding: 0.5rem 1rem;
  font-family: var(--font-mono);
  border-radius: var(--radius-sm); /* Smaller radius */
  margin: 1rem 0; /* Increased margin */
  border: 1px solid var(--rooted-gray-200); /* Add border */
}

/* Status indicators */
/* Let's simplify status indicators to just text */
.status {
  display: inline-block; /* Simpler display */
  padding: 0;
  border-radius: 0;
  font-size: 0.8rem; /* Smaller text */
  font-weight: 400;
  margin-right: 0.75rem;
  user-select: none;
  background-color: transparent;
  border: none;
  text-transform: uppercase; /* Uppercase like rooted.host */
  letter-spacing: 0.05em;
}

.status.online {
  color: var(--rooted-success); /* Green text */
}

.status.online::before {
 content: none; /* Remove dot */
}

.status.offline {
 color: var(--rooted-error); /* Red text */
}

.status.offline::before {
 content: none; /* Remove dot */
}

/* Tag styling */
/* Simplify tags */
.tag {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem; /* Smaller tags */
  font-weight: 500;
  margin-right: 0.5rem;
  margin-bottom: 0.25rem; /* Allow wrapping */
  user-select: none;
  background-color: var(--rooted-gray-100); /* Subtle background */
  color: var(--rooted-gray-600); /* Dimmer text */
  border: 1px solid var(--rooted-gray-200);
  text-transform: uppercase; /* Uppercase */
  letter-spacing: 0.05em;
}

/* Link icon */
.service-meta {
  display: flex;
  align-items: center;
  margin-top: 0.5rem; /* Reduced margin */
  flex-wrap: wrap;
  gap: 0.75rem; /* Adjusted gap */
}

.copy-link {
  /* Remove copy link button as it usually needs JS */
 display: none;
}

/* Directory page specific */
.directory-page {
  max-width: 1200px;
  margin: 0 auto;
}

.directory-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

/* Search Form */
.directory-search {
  display: flex;
  width: 100%;
  margin: 0 auto;
  position: relative;
}

.directory-search-input {
  flex: 1;
  padding: 0.8rem 1rem;
  background-color: var(--rooted-gray-100);
  border: 1px solid var(--rooted-gray-300);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--rooted-fg);
}

.directory-search-input:focus {
  outline: none;
  border-color: var(--rooted-accent);
  box-shadow: 0 0 0 2px var(--rooted-accent-subtle);
}

/* Tag Filters */
.directory-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
  justify-content: center;
  padding: 1rem;
  background-color: var(--rooted-gray-100);
  border-radius: var(--radius-sm);
  border: 1px solid var(--rooted-gray-200);
}

.tag-filter {
  display: none; /* Hide the actual radio button */
}

.tag-filter + label {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--rooted-gray-50);
  border: 1px solid var(--rooted-gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  color: var(--rooted-gray-700);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  min-width: 80px;
  text-align: center;
}

.tag-filter + label:hover {
  border-color: var(--rooted-accent);
  color: var(--rooted-accent);
  background-color: var(--rooted-gray-100);
}

.tag-filter:checked + label {
  background-color: var(--rooted-accent-subtle);
  color: var(--rooted-accent-light);
  border-color: var(--rooted-accent);
}

/* Service Cards */
.services-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  background-color: var(--rooted-gray-100);
  border: 1px solid var(--rooted-gray-200);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  transition: all 0.25s ease;
  height: 100%;
  min-height: 300px; /* Ensure minimum height for consistency */
}

.service-card:hover {
  border-color: var(--rooted-accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--rooted-accent-light), var(--rooted-accent));
  opacity: 0.8;
  transition: opacity 0.25s ease, width 0.25s ease;
}

.service-card:hover::before {
  opacity: 1;
  width: 6px;
}

.service-card-header {
  padding: 1.25rem 1.25rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
}

.service-title-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.service-logo {
  width: 32px;
  height: 32px;
  background-color: var(--rooted-gray-50);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rooted-fg);
  font-weight: bold;
  font-size: 1.1rem;
  flex-shrink: 0;
  border: 1px solid var(--rooted-gray-200);
  overflow: hidden; /* Ensures images stay within bounds */
}

.service-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures images scale properly */
  display: block;
}

.service-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--rooted-fg);
  font-family: var(--font-mono);
  margin: 0;
}

.service-status {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  background-color: var(--rooted-gray-50);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--rooted-gray-200);
}

.service-status.online {
  color: var(--rooted-success);
}

.service-status.offline {
  color: var(--rooted-error);
}

.service-card-body {
  padding: 0.5rem 1.25rem 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  /* Add this to ensure consistent height */
  min-height: 200px;
}

.service-description {
  color: var(--rooted-gray-700);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: auto;
}

.service-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background-color: var(--rooted-gray-200);
  color: var(--rooted-gray-800);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.service-card-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--rooted-gray-200);
  background-color: var(--rooted-gray-50);
  margin-top: auto;
  transition: background-color 0.25s ease;
  display: flex;
  flex-direction: column;
}

.service-card:hover .service-card-footer {
  background-color: var(--rooted-gray-100);
}

/* COMPLETELY REVISED MIRROR SYSTEM */

/* Hide all onion addresses by default */
.service-onion-address {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--rooted-gray-700);
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: normal;
  word-break: break-all;
  padding: 0.4rem;
  margin-top: 0.25rem;
  border-radius: var(--radius-sm);
  background-color: var(--rooted-gray-100);
  user-select: all; /* Makes the address selectable */
  cursor: pointer;
  border: 1px solid transparent;
}

/* Hide the actual radio buttons */
.mirror-radio {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Style the mirror tabs container */
.mirror-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Style the tabs (labels) */
.mirror-tab {
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--rooted-gray-200);
  color: var(--rooted-gray-600);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.mirror-tab:hover {
  background-color: var(--rooted-accent-subtle);
  color: var(--rooted-accent-light);
  border-color: var(--rooted-accent);
}

/* IMPORTANT: Show mirror-1 by default */
.service-onion-address[data-mirror="1"] {
  display: block;
}

/* Style for the active tab */
.mirror-radio:checked + label {
  background-color: var(--rooted-accent-subtle);
  color: var(--rooted-accent-light);
  border-color: var(--rooted-accent);
}

/* Generic selector for all mirror tabs */
[id$="-mirror1"]:checked ~ .mirror-tabs label[for$="-mirror1"],
[id$="-mirror2"]:checked ~ .mirror-tabs label[for$="-mirror2"],
[id$="-mirror3"]:checked ~ .mirror-tabs label[for$="-mirror3"],
[id$="-mirror4"]:checked ~ .mirror-tabs label[for$="-mirror4"] {
  background-color: var(--rooted-accent-subtle);
  color: var(--rooted-accent-light);
  border-color: var(--rooted-accent);
}

/* Generic selectors for showing/hiding mirror addresses */
[id$="-mirror1"]:checked ~ .mirror-addresses .service-onion-address:not([data-mirror="1"]),
[id$="-mirror2"]:checked ~ .mirror-addresses .service-onion-address:not([data-mirror="2"]),
[id$="-mirror3"]:checked ~ .mirror-addresses .service-onion-address:not([data-mirror="3"]),
[id$="-mirror4"]:checked ~ .mirror-addresses .service-onion-address:not([data-mirror="4"]) {
  display: none !important;
}

[id$="-mirror1"]:checked ~ .mirror-addresses .service-onion-address[data-mirror="1"],
[id$="-mirror2"]:checked ~ .mirror-addresses .service-onion-address[data-mirror="2"],
[id$="-mirror3"]:checked ~ .mirror-addresses .service-onion-address[data-mirror="3"],
[id$="-mirror4"]:checked ~ .mirror-addresses .service-onion-address[data-mirror="4"] {
  display: block !important;
}

/* Style for onion address on hover */
.service-card:hover .service-onion-address {
  color: var(--rooted-accent);
  background-color: var(--rooted-gray-50);
  border-color: var(--rooted-accent-subtle);
}

/* Improved hero section styling, like the donate page */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
  position: relative;
  background: linear-gradient(to bottom, var(--rooted-gray-100), var(--rooted-bg));
  border-radius: var(--radius);
  border: 1px solid var(--rooted-gray-200);
  margin-bottom: 3rem;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(to right, #ff3b30, var(--rooted-accent));
  opacity: 0.8;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #ff3b30, var(--rooted-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero h2 {
  font-size: 1.5rem;
  color: var(--rooted-gray-800);
  margin-top: 0;
  margin-bottom: 1rem;
  font-weight: 500;
  font-family: var(--font-sans);
}

.hero p {
  font-size: 1.1rem;
  color: var(--rooted-gray-600);
  max-width: 600px;
  margin: 0 auto;
  font-family: var(--font-sans);
}

/* Warning box for the directory section */
.warning-box {
  background-color: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--rooted-error);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 1.5rem 0;
  color: var(--rooted-error);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* CSS-only filtering mechanism */
[data-service-type] {
  display: block; /* Show all items by default */
}

/* Display all when "all" filter is checked */
#filter-all:checked ~ .services-container [data-service-type] {
  display: block;
}

/* Handle services with multiple types using attribute selectors */
/* Filter for single service types */
#filter-crypto:checked ~ .services-container [data-service-type]:not([data-service-type*="crypto"]),
#filter-domains:checked ~ .services-container [data-service-type]:not([data-service-type*="domains"]),
#filter-email:checked ~ .services-container [data-service-type]:not([data-service-type*="email"]),
#filter-exchange:checked ~ .services-container [data-service-type]:not([data-service-type*="exchange"]),
#filter-forum:checked ~ .services-container [data-service-type]:not([data-service-type*="forum"]),
#filter-hosting:checked ~ .services-container [data-service-type]:not([data-service-type*="hosting"]),
#filter-market:checked ~ .services-container [data-service-type]:not([data-service-type*="market"]),
#filter-tools:checked ~ .services-container [data-service-type]:not([data-service-type*="tools"]),
#filter-vpn:checked ~ .services-container [data-service-type]:not([data-service-type*="vpn"]) {
  display: none;
}

/* Style the filter labels based on checked state */
#filter-all:checked ~ .directory-filters label[for="filter-all"],
#filter-crypto:checked ~ .directory-filters label[for="filter-crypto"],
#filter-domains:checked ~ .directory-filters label[for="filter-domains"],
#filter-email:checked ~ .directory-filters label[for="filter-email"],
#filter-exchange:checked ~ .directory-filters label[for="filter-exchange"],
#filter-forum:checked ~ .directory-filters label[for="filter-forum"],
#filter-hosting:checked ~ .directory-filters label[for="filter-hosting"],
#filter-market:checked ~ .directory-filters label[for="filter-market"],
#filter-tools:checked ~ .directory-filters label[for="filter-tools"],
#filter-vpn:checked ~ .directory-filters label[for="filter-vpn"] {
  background-color: var(--rooted-accent-subtle);
  color: var(--rooted-accent-light);
  border-color: var(--rooted-accent);
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .services-container {
    grid-template-columns: 1fr;
  }
  
  .directory-search {
    flex-direction: column;
  }
  
  .directory-filters {
    justify-content: center;
    margin-top: 1.5rem;
  }
}

/* Mobile responsive styles */
@media (max-width: 640px) {
  .wrapper {
    padding: 0 1rem;
  }
  
  .site-title {
    font-size: 1.1rem;
  }
  
  .site-logo {
    width: 28px;
    height: 28px;
  }
  
  .site-header {
    height: auto;
    min-height: var(--header-height);
    flex-direction: column;
  }
  
  .site-header .wrapper {
    flex-direction: column;
    width: 100%;
    padding: 0;
  }
  
  .site-title {
    width: 100%;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid var(--rooted-gray-200);
    justify-content: center;
  }
  
  .site-nav {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    -ms-overflow-style: none;
    scrollbar-width: none;
    justify-content: center;
    height: 50px;
  }
  
  .site-nav::-webkit-scrollbar {
    display: none;
  }
  
  .trigger {
    display: flex;
    width: 100%;
    overflow-x: auto;
  }
  
  .page-link {
    padding: 0 0.75rem;
    font-size: 0.875rem;
    white-space: nowrap;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.75rem;
  }
}

/* JavaScript warning banner */
.js-warning-banner {
  background-color: var(--rooted-warning);
  color: var(--rooted-gray-900); /* Dark text on warning bg */
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  display: none; /* Hidden by default */
  position: sticky;
  top: 0; /* Stick below header if header is sticky */
  z-index: 999; /* Below header */
  border-bottom: 1px solid rgba(0,0,0,0.1);
  font-family: var(--font-sans); /* Sans-serif might be more readable here */
}

.js-warning-banner.visible {
  display: block; /* Ensure it's visible when needed */
}

/* Adjust site header position if warning is visible */
.js-warning-banner.visible + .site-header {
 top: 40px; /* Approximate height of the banner + padding */
 /* Note: This assumes the banner height is roughly fixed. Needs testing. */
}

/* No-JS warning message for users without JavaScript */
.no-js-message {
  /* This class should be applied directly to the <noscript> tag content if possible */
  /* Or wrap the <noscript> content in a div with this class */
  background-color: var(--rooted-warning);
  color: var(--rooted-gray-900);
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  font-family: var(--font-sans);
  /* Position it at the top */
  /* If using <noscript>, it often appears where placed in HTML */
  /* We might not need sticky positioning if it's early in body */
}

/* Remove potentially complex SVG logo styles */
.site-logo {
 display: none;
}

/* Guide & FAQ Page Specific Styles */
.guide-item, .faq-item {
  margin-bottom: 2.5rem; /* More spacing between items */
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rooted-gray-200);
}

.guide-item:last-child, .faq-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.guide-item h2, .faq-item h2 {
  font-size: 1.6rem; /* Slightly larger item titles */
  color: var(--rooted-accent-light);
  margin-bottom: 1rem;
}

.guide-item h3 {
  font-size: 1.2rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--rooted-gray-700);
  text-transform: none; /* Keep guide subheadings normal case */
  letter-spacing: normal;
}

.ascii-diagram {
  background-color: var(--rooted-gray-100);
  border: 1px solid var(--rooted-gray-200);
  padding: 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  line-height: 1.5;
  color: var(--rooted-gray-600);
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  white-space: pre;
  overflow-x: auto;
}

/* Support Page Specific Styles */
.support-intro {
  margin-bottom: 2rem;
  text-align: center;
}

.open-project-list {
  max-width: 800px;
  margin: 0 auto 2rem;
  text-align: left;
  list-style-type: none;
  padding: 0;
}

.open-project-list li {
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
  position: relative;
}

.open-project-list li:before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--rooted-accent-light);
}

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

.donation-card {
  background-color: var(--rooted-gray-100);
  border: 1px solid var(--rooted-gray-200);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.1s ease;
}

.donation-card:hover {
  transform: translateY(-3px);
  border-color: var(--rooted-accent);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.donation-card h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: var(--rooted-fg);
  font-family: var(--font-mono); /* Mono for crypto names */
}

.donation-address {
  font-family: var(--font-mono);
  background-color: var(--rooted-gray-50);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  margin-top: 1rem;
  word-wrap: break-word;
  word-break: break-all;
  user-select: all; /* Allow easy copying */
  border: 1px solid var(--rooted-gray-200);
  color: var(--rooted-gray-700);
  flex-grow: 1; /* Make address area expand */
  line-height: 1.5;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.donation-card:hover .donation-address {
  background-color: var(--rooted-gray-50);
  color: var(--rooted-fg);
  border-color: var(--rooted-accent-subtle);
}

.donation-card p {
  font-size: 0.9rem;
  color: var(--rooted-gray-600);
  margin-bottom: 0.5rem;
}

/* Expense Table Styles */
.expenses-section {
  margin-top: 3rem;
  margin-bottom: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rooted-gray-200);
}

.expenses-section h2 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--rooted-accent-light);
}

.expenses-table-container {
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.expenses-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.expenses-table th {
  background-color: var(--rooted-gray-100);
  color: var(--rooted-accent-light);
  font-weight: 500;
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 2px solid var(--rooted-gray-200);
}

.expenses-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--rooted-gray-200);
  color: var(--rooted-gray-700);
}

.expenses-table tr:hover td {
  background-color: var(--rooted-gray-100);
  color: var(--rooted-fg);
}

.expenses-table .total-row {
  background-color: var(--rooted-gray-100);
}

.expenses-table .total-row td {
  color: var(--rooted-fg);
  border-top: 2px solid var(--rooted-gray-300);
}

.expenses-note {
  font-size: 0.9rem;
  color: var(--rooted-gray-600);
  text-align: center;
  margin-top: 1rem;
  font-style: italic;
}

/* Guide Index Styles - For New Guide Directory */
.guide-index {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.guide-card {
  display: block;
  padding: 1.5rem;
  background-color: var(--rooted-gray-100);
  border: 1px solid var(--rooted-gray-200);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  position: relative;
}

.guide-card:hover {
  transform: translateY(-2px);
  border-color: var(--rooted-accent);
  background-color: var(--rooted-gray-50);
}

.guide-card h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--rooted-accent-light);
  font-size: 1.25rem;
  letter-spacing: normal;
  text-transform: none;
  transition: color 0.2s ease;
}

.guide-card:hover h3 {
  color: var(--rooted-accent);
}

.guide-card p {
  color: var(--rooted-gray-700);
  margin-bottom: 0;
  line-height: 1.5;
}

.guide-card::after {
  content: "→";
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-family: var(--font-mono);
  color: var(--rooted-gray-400);
  transition: transform 0.2s ease, color 0.2s ease;
}

.guide-card:hover::after {
  transform: translateX(3px);
  color: var(--rooted-accent);
}

@media (min-width: 768px) {
  .guide-index {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* Search Form - Zero JavaScript */
.search-form {
  margin: 2rem 0;
  text-align: center;
}

.search-input-container {
  position: relative;
  display: inline-block;
  max-width: 500px;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  padding-right: 3rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  background-color: var(--rooted-gray-100);
  border: 1px solid var(--rooted-gray-300);
  border-radius: var(--radius);
  color: var(--rooted-fg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--rooted-accent);
  box-shadow: 0 0 0 2px var(--rooted-accent-subtle);
}

.search-button {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  background-color: var(--rooted-gray-200);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0 1rem;
  color: var(--rooted-gray-700);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.search-button:hover {
  background-color: var(--rooted-accent-subtle);
  color: var(--rooted-accent-light);
}

/* Centered Footer Donate Link */
.footer-donate-link {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rooted-gray-200);
}

.footer-donate-link a {
  color: var(--rooted-accent-light);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-donate-link a:hover {
  color: var(--rooted-fg);
  opacity: 1;
}

/* Comparison Table Styles */
.comparison-table-container {
  overflow-x: auto;
  margin: 1.5rem 0;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.comparison-table th {
  background-color: var(--rooted-gray-100);
  color: var(--rooted-accent-light);
  font-weight: 500;
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 2px solid var(--rooted-gray-200);
}

.comparison-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--rooted-gray-200);
  color: var(--rooted-gray-700);
}

.comparison-table tr:hover td {
  background-color: var(--rooted-gray-100);
  color: var(--rooted-fg);
}

.service-recommendations {
  background-color: var(--rooted-gray-100);
  border: 1px solid var(--rooted-gray-200);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.service-recommendations ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.service-note {
  font-size: 0.9rem;
  color: var(--rooted-gray-600);
  margin-top: 1rem;
  font-style: italic;
  margin-bottom: 0;
}

.disclaimer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rooted-gray-200);
  font-size: 0.9rem;
  color: var(--rooted-gray-600);
}

.guide-resources {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rooted-gray-200);
}

.guide-resources h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--rooted-fg);
}

.guide-resources ul {
  padding-left: 1.5rem;
}

.guide-resources a {
  word-break: break-word;
}

.warning-box {
  background-color: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--rooted-warning);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 1.5rem 0;
  color: var(--rooted-warning);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Homepage Specific Styles */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
  position: relative;
}

.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, var(--rooted-accent-light), var(--rooted-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  display: inline-block;
}

.hero h2 {
  font-size: 1.5rem;
  color: var(--rooted-gray-800);
  margin-top: 0;
  margin-bottom: 1rem;
  font-weight: 400;
}

.hero p {
  font-size: 1.1rem;
  color: var(--rooted-gray-600);
  max-width: 600px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rooted-gray-200);
}

.section-header h2 {
  font-size: 1.75rem;
  margin: 0;
  color: var(--rooted-fg);
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: var(--rooted-accent-subtle);
  color: var(--rooted-accent-light);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border: 1px solid var(--rooted-accent-subtle);
}

.btn:hover {
  background-color: var(--rooted-accent);
  color: var(--rooted-fg);
  border-color: var(--rooted-accent);
}

.about-section {
  margin: 4rem 0;
  padding: 2rem;
  background-color: var(--rooted-gray-100);
  border-radius: var(--radius);
  border: 1px solid var(--rooted-gray-200);
}

.about-section h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--rooted-accent-light);
}

.about-content {
  max-width: 800px;
}

.about-content p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

.about-content a {
  color: var(--rooted-accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.about-content a:hover {
  color: var(--rooted-accent-light);
  text-decoration: underline;
}

.guides-preview {
  margin: 4rem 0;
}

.security-tips {
  margin: 4rem 0;
  padding: 2rem;
  background-color: var(--rooted-gray-100);
  border-radius: var(--radius);
  border: 1px solid var(--rooted-gray-200);
}

.security-tips h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  color: var(--rooted-accent-light);
}

.security-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.security-list li {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  line-height: 1.5;
}

.security-icon {
  margin-right: 0.75rem;
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Responsiveness for homepage */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .hero h2 {
    font-size: 1.25rem;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .about-section, .security-tips {
    padding: 1.5rem;
  }
}

/* Mirror selector functionality */
/* Hide mirror-2, mirror-3, etc. by default */
.service-onion-address.mirror-2,
.service-onion-address.mirror-3,
.service-onion-address.mirror-4,
.service-onion-address.mirror-5 {
  display: none;
}

/* Make mirror-1 visible by default */
.service-onion-address.mirror-1 {
  display: block;
}

/* When mirror tab is hovered, show corresponding address */
.mirror-tab[data-mirror="1"]:hover ~ .mirror-addresses .service-onion-address.mirror-1,
.mirror-tab[data-mirror="2"]:hover ~ .mirror-addresses .service-onion-address.mirror-2,
.mirror-tab[data-mirror="3"]:hover ~ .mirror-addresses .service-onion-address.mirror-3,
.mirror-tab[data-mirror="4"]:hover ~ .mirror-addresses .service-onion-address.mirror-4,
.mirror-tab[data-mirror="5"]:hover ~ .mirror-addresses .service-onion-address.mirror-5 {
  display: block;
}

/* Hide all other mirrors when hovering over a mirror tab */
.mirror-tab[data-mirror="1"]:hover ~ .mirror-addresses .service-onion-address:not(.mirror-1),
.mirror-tab[data-mirror="2"]:hover ~ .mirror-addresses .service-onion-address:not(.mirror-2),
.mirror-tab[data-mirror="3"]:hover ~ .mirror-addresses .service-onion-address:not(.mirror-3),
.mirror-tab[data-mirror="4"]:hover ~ .mirror-addresses .service-onion-address:not(.mirror-4),
.mirror-tab[data-mirror="5"]:hover ~ .mirror-addresses .service-onion-address:not(.mirror-5) {
  display: none;
} 