/*
 * Uncensored AI Hub public pages (/, /bot, /privacy, /terms). Served as a static file by nginx (location /).
 * No web fonts, no imports, no external resources: the pages must work under a no-script,
 * same-origin-only CSP. Colours follow the admin SPA tokens (admin/src/style.css).
 */

:root {
  color-scheme: light dark;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --fg: #0f172a;
  --muted: #475569;
  --border: #d5dce6;
  --primary: #1f5fe0;
  --primary-hover: #1a4fc4;
  --primary-fg: #ffffff;
  --secondary: #4f46e5;
  --note-bg: #eef3fe;
  --note-border: #b8cdf7;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --surface: #111827;
    --surface-2: #182235;
    --fg: #f8fafc;
    --muted: #94a3b8;
    --border: #263247;
    --primary: #4f8cff;
    --primary-hover: #6fa1ff;
    --primary-fg: #0b1020;
    --secondary: #818cf8;
    --note-bg: #14203a;
    --note-border: #2c4370;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 var(--font);
}

a {
  color: var(--primary);
  text-underline-offset: 2px;
}

a:hover {
  color: var(--primary-hover);
}

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 10;
}

.skip-link:focus {
  left: 8px;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

.container.narrow {
  max-width: 760px;
}

/* Header */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

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

.mark {
  flex: none;
  width: 32px;
  height: 32px;
}

.mark-frame {
  stroke: var(--secondary);
}

.mark-bar-low {
  fill: var(--secondary);
}

.mark-bar {
  fill: var(--primary);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--fg);
  text-decoration: underline;
}

/* Content */

main {
  padding: 32px 0 48px;
}

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.4rem);
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.35rem;
  margin-top: 40px;
}

h3 {
  font-size: 1.08rem;
  margin-top: 24px;
}

p,
ul,
ol,
dl {
  margin: 0 0 14px;
}

ul,
ol {
  padding-left: 22px;
}

li {
  margin-bottom: 6px;
}

li > ul {
  margin-top: 6px;
}

.lead {
  font-size: 1.15rem;
  color: var(--muted);
}

.meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.muted {
  color: var(--muted);
}

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

code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  overflow-wrap: anywhere;
}

pre {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  overflow-x: auto;
  white-space: pre;
}

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

pre.wrap {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.note {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--note-border);
  border-radius: 10px;
  background: var(--note-bg);
}

.note > :last-child {
  margin-bottom: 0;
}

.disclosure {
  font-weight: 600;
}

/* Home */

.hero {
  padding: 16px 0 8px;
}

.hero .lead {
  max-width: 44rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}

.button {
  display: inline-block;
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--primary-fg);
  font-weight: 600;
  text-decoration: none;
}

.button:hover {
  background: var(--primary-hover);
  color: var(--primary-fg);
}

.button.secondary {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--border);
}

.button.secondary:hover {
  background: var(--surface-2);
  color: var(--primary);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 16px 0 8px;
}

.card {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.card h3 {
  margin-top: 0;
}

.card ul {
  margin-bottom: 0;
}

.steps {
  counter-reset: step;
  padding-left: 0;
  list-style: none;
}

.steps li {
  position: relative;
  padding-left: 40px;
  margin-bottom: 12px;
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
}

/* Tables */

.table-wrap {
  margin: 0 0 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

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

tr:last-child th,
tr:last-child td {
  border-bottom: 0;
}

thead th {
  background: var(--surface-2);
  font-weight: 600;
}

dt {
  font-weight: 600;
}

dd {
  margin: 0 0 12px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px 0 32px;
  font-size: 0.92rem;
  color: var(--muted);
}

.site-footer p {
  margin-bottom: 8px;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .container {
    padding: 0 16px;
  }

  main {
    padding-top: 24px;
  }

  .button {
    width: 100%;
    text-align: center;
  }
}

@media print {
  .site-nav,
  .skip-link,
  .actions {
    display: none;
  }

  body {
    background: #ffffff;
    color: #000000;
  }
}
