/* RLS Log Help Center — single-file theme.
   Design notes:
   - System font stack (SF on iOS visitors, native fallback elsewhere).
   - Light/dark mode driven entirely by prefers-color-scheme.
   - Indigo accent that matches the app's default tint.
   - Single content column at 760px max-width — long-form reading.
   - No JS dependencies; FAQ collapse uses native <details>. */

:root {
  --bg:            #ffffff;
  --bg-elevated:   #f5f5f9;
  --text:          #15151c;
  --text-secondary:#5d5d6e;
  --text-tertiary: #94949f;
  --accent:        #5e2bce;
  --accent-light:  #8a5cf0;
  --accent-soft:   rgba(94, 43, 206, 0.10);
  --border:        #e5e5ec;
  --shadow:        0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.05);
  --radius:        14px;
  --max-width:     760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #0d0d12;
    --bg-elevated:   #1a1a23;
    --text:          #f3f3f7;
    --text-secondary:#b6b6c4;
    --text-tertiary: #74748a;
    --accent:        #b8a4ff;
    --accent-light:  #d4c4ff;
    --accent-soft:   rgba(184, 164, 255, 0.13);
    --border:        #2a2a36;
    --shadow:        0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ----- Header ----- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  position: sticky;
  top: 0;
  z-index: 10;
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
}

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

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  align-self: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  object-fit: cover;
}

.brand-text { font-weight: 700; }

.brand-sub {
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: 15px;
}

.site-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  background: var(--bg-elevated);
  color: var(--text);
}

.site-nav a.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* ----- Main / prose ----- */

.content {
  padding: 56px 0 96px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 38px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.page-header .subtitle {
  font-size: 19px;
  color: var(--text-secondary);
  margin: 0;
  max-width: 60ch;
}

.prose h2 {
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 48px 0 14px;
  scroll-margin-top: 80px;
}

.prose h3 {
  font-size: 19px;
  line-height: 1.3;
  font-weight: 600;
  margin: 32px 0 8px;
  scroll-margin-top: 80px;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 16px;
}

.prose ul,
.prose ol { padding-left: 24px; }

.prose li { margin-bottom: 8px; }

.prose strong { font-weight: 700; }

.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-thickness 0.15s ease;
}

.prose a:hover {
  text-decoration-thickness: 2px;
}

.prose code {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
}

.prose pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.5;
}

.prose blockquote {
  border-left: 3px solid var(--accent);
  margin: 24px 0;
  padding: 8px 18px;
  color: var(--text-secondary);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
}

.prose hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: 56px 0;
}

/* ----- Card grid (landing page) ----- */

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin: 32px 0;
}

@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
}

.prose a.card,
.prose a.card:hover,
.prose a.card:focus,
.prose a.card:visited,
.prose a.card:active,
.prose a.card .card-title,
.prose a.card .card-desc {
  text-decoration: none;
}

.card {
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.card-title {
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* ----- FAQ collapse ----- */

.prose details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 12px 0;
  background: var(--bg-elevated);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.prose details[open] {
  border-color: var(--accent);
}

.prose details summary {
  cursor: pointer;
  padding: 14px 48px 14px 18px;
  font-weight: 600;
  list-style: none;
  position: relative;
  user-select: none;
}

.prose details summary::-webkit-details-marker { display: none; }

.prose details summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-weight: 600;
  font-size: 22px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.prose details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

.prose details[open] summary {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

.prose details > *:not(summary) {
  margin: 14px 18px;
}

.prose details > *:not(summary):first-of-type {
  margin-top: 14px;
}

.prose details > *:not(summary):last-child {
  margin-bottom: 16px;
}

.prose details ul,
.prose details ol {
  padding-left: 24px;
}

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

.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 24px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-credit { margin: 0; }

.footer-heart {
  color: #e0245e;
  font-weight: 700;
}

.site-footer nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-footer a:hover { color: var(--text); }

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

@media (max-width: 600px) {
  body { font-size: 16px; }
  .page-header h1 { font-size: 30px; }
  .page-header .subtitle { font-size: 17px; }
  .content { padding: 32px 0 64px; }
  .site-header .container {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .brand-sub { display: none; }
  .site-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    margin: 0 -24px;
    padding: 0 24px;
  }
  .site-nav a { padding: 6px 10px; font-size: 14px; flex: 0 0 auto; }
  .site-footer .container { flex-direction: column; align-items: flex-start; }
}
