/*
 * Shared look for Lathra's pages: the "Veil" palette (indigo and mint; see
 * src/brand/mark.ts). Every colour is a token here, with a dark version.
 */

:root {
  color-scheme: light dark;
  --brand: #2b2a6b;
  --brand-mint: #3cc6a0;
  --bg: #ffffff;
  --surface: #f6f5fc;
  --surface-2: #edebf8;
  --border: #e1dff0;
  --text: #1b1a3a;
  --muted: #5a5980;
  --accent: #3b39a4;
  --on-accent: #ffffff;
  --switch-on: #239677;
  --track-off: #bdbcd3;
  --badge-bg: #edebf8;
  --badge-text: #44437a;
  --info-bg: #e9e8fb;
  --info-text: #34328c;
  --good-bg: #e1f6ef;
  --good-text: #146a53;
  --warn-bg: #fff2dd;
  --warn-text: #7a4a00;
  --danger-text: #b42318;
  --radius: 12px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121220;
    --surface: #1b1b2e;
    --surface-2: #25253b;
    --border: #30304a;
    --text: #edecf8;
    --muted: #a6a5c4;
    --accent: #7ddcc1;
    --on-accent: #0f1f1a;
    --switch-on: #3cc6a0;
    --track-off: #4a4a66;
    --badge-bg: #25253b;
    --badge-text: #cfcde6;
    --info-bg: #26254d;
    --info-text: #c6c4ff;
    --good-bg: #133a30;
    --good-text: #9ff0d6;
    --warn-bg: #3a2a10;
    --warn-text: #ffd18a;
    --danger-text: #ff9a8f;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  line-height: 1.25;
}

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

.wordmark {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* The mark beside the name, in page headers. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
}

.brand svg {
  flex: none;
  border-radius: 7px;
}

a {
  color: var(--accent);
}

.badge.good {
  background: var(--good-bg);
  color: var(--good-text);
}

/* On/off switch: a styled checkbox, so keyboards and screen readers get it for free. */
.switch {
  appearance: none;
  flex: none;
  position: relative;
  width: 38px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  background: var(--track-off);
  cursor: pointer;
  transition: background 0.15s;
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  transition: transform 0.15s;
}

.switch:checked {
  background: var(--switch-on);
}

.switch:checked::after {
  transform: translateX(16px);
}

.switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

@media (prefers-reduced-motion: reduce) {
  .switch,
  .switch::after {
    transition: none;
  }
}

.button {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.button:hover:not(:disabled) {
  background: var(--surface-2);
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.button.primary:hover:not(:disabled) {
  background: var(--accent);
  filter: brightness(1.08);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.badge {
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--badge-bg);
  color: var(--badge-text);
  font-size: 11.5px;
}

.badge.info {
  background: var(--info-bg);
  color: var(--info-text);
}

.badge.warn {
  background: var(--warn-bg);
  color: var(--warn-text);
}

/* Long-form pages (How Lathra works, privacy policy, welcome): comfortable reading. */

.doc {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 18px 72px;
}

.doc-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 28px;
}

.doc-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-left: auto;
  font-size: 14px;
}

.doc h1 {
  font-size: 30px;
  margin: 0 0 12px;
}

.doc h2 {
  font-size: 20px;
  margin: 32px 0 10px;
}

.doc h3 {
  font-size: 16px;
  margin: 20px 0 6px;
}

.doc p,
.doc li {
  font-size: 15.5px;
  line-height: 1.6;
}

.doc p {
  margin: 0 0 12px;
}

.doc ul {
  margin: 0 0 12px;
  padding-left: 22px;
}

.doc li + li {
  margin-top: 6px;
}

.doc .lead {
  color: var(--muted);
  font-size: 17px;
}

/* "What each feature does" */

.doc .section-lead {
  color: var(--muted);
}

.doc .feature {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  scroll-margin-top: 16px;
}

.doc .feature h3 {
  margin: 0 0 4px;
}

.doc .feature:target {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.doc .feature .facts {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13.5px;
}

.doc .feature p:last-child {
  margin-bottom: 0;
}

.guide-contents {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 8px 0 4px;
  font-weight: 600;
}

/* The public website (on top of src/ui/base.css and doc.css). */

.doc {
  max-width: 900px;
}

.hero {
  padding: 24px 0 8px;
  text-align: center;
}

.hero svg {
  border-radius: 24px;
}

.hero h1 {
  margin: 16px 0 10px;
  font-size: 42px;
  letter-spacing: -0.01em;
}

.hero .lead {
  max-width: 620px;
  margin: 0 auto 18px;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.button {
  display: inline-block;
  text-decoration: none;
}

.button.soon {
  color: var(--muted);
  cursor: default;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin: 32px 0;
}

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

.pillar h3 {
  margin-top: 0;
}

.pillar p {
  color: var(--muted);
  font-size: 14.5px !important;
}

.pillar ul {
  margin: 0;
}

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

.site-footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.all-features {
  margin: 8px 0 28px;
  font-weight: 600;
  text-align: center;
}
