/* The desktop app's palette (apps/dartmole/lib/common/theme.dart): dark
   first, like the app and its icon, and light when the visitor asks for it. */
:root {
  --background: #0b0b0d;
  --surface: #131418;
  --border: #272a31;
  --text-primary: #e6e7ea;
  --text-secondary: #9096a0;
  --text-faint: #636872;
  --accent: #ff5a5a;
  --accent-text: #0b0b0d;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --inline-code: #1a1c21;
  /* Code blocks stay dark in both themes: a dark block on a light page
     reads as code at a glance. */
  --code-bg: #131418;
  --code-bar: #1a1c21;
  --code-border: #272a31;
  --code-text: #e6e7ea;
  --code-label: #9096a0;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --background: #f5f6f8;
    --surface: #ffffff;
    --border: #e1e4ea;
    --text-primary: #14171c;
    --text-secondary: #5b626c;
    --text-faint: #878f9a;
    --accent: #e0393e;
    --accent-text: #ffffff;
    --inline-code: #e9ebef;
    color-scheme: light;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

a {
  color: inherit;
}

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

/* Top bar */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  text-decoration: none;
}

.links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.links a:not(.button) {
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
}

.links a:not(.button):hover {
  color: var(--text-primary);
}

/* Buttons */

.button {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: none;
  transition: filter 120ms ease;
}

.button:hover {
  filter: brightness(1.08);
}

.button.small {
  padding: 6px 14px;
  font-size: 0.9rem;
}

/* Hero */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 56px 0 72px;
  text-align: center;
}

.hero h1 {
  max-width: 14em;
  margin: 24px 0 16px;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.lead {
  max-width: 36em;
  margin: 0 0 32px;
  color: var(--text-secondary);
  font-size: 1.15rem;
}

.meta {
  margin: 14px 0 0;
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* Features */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  padding-bottom: 72px;
}

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

.feature h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.feature p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Get started */

.start {
  max-width: 640px;
  margin: 0 auto;
  padding-bottom: 72px;
}

.start h2 {
  margin: 0 0 24px;
  font-size: 1.75rem;
  text-align: center;
}

.start ol {
  margin: 0;
  padding-left: 1.4em;
}

.start li {
  margin-bottom: 28px;
}

.start li::marker {
  color: var(--accent);
  font-weight: 600;
}

.start h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.start p {
  margin: 8px 0 0;
  color: var(--text-secondary);
}



.start .more {
  margin-top: 8px;
}

.start .more a,
.doc a {
  color: var(--accent);
  text-decoration: none;
}

.start .more a:hover,
.doc a:hover {
  text-decoration: underline;
}

/* Docs: Markdown from content/docs/, rendered by lib/docs.dart */

.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 0 72px;
}

.doc h1 {
  margin: 16px 0 12px;
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.doc h2 {
  margin: 48px 0 12px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 1.4rem;
}

.doc h3 {
  margin: 28px 0 8px;
  font-size: 1.1rem;
}

.doc h2,
.doc h3 {
  /* Room above a heading reached through an #anchor. */
  scroll-margin-top: 16px;
}

.doc p,
.doc li {
  color: var(--text-secondary);
}

.doc strong {
  color: var(--text-primary);
}

.doc ul,
.doc ol {
  padding-left: 1.4em;
}

.doc li {
  margin: 6px 0;
}


/* Code: blocks are .code (a label bar above a <pre>), from lib/docs.dart for
   the docs and lib/home.dart for the front page. */

.code {
  overflow: hidden;
  margin: 14px 0;
  border: 1px solid var(--code-border);
  border-radius: 10px;
  background: var(--code-bg);
}

.code-label {
  padding: 7px 16px;
  border-bottom: 1px solid var(--code-border);
  background: var(--code-bar);
  color: var(--code-label);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}

.code pre {
  overflow-x: auto;
  margin: 0;
  padding: 14px 16px;
  color: var(--code-text);
  font-size: 0.85rem;
  line-height: 1.6;
}

.code pre code {
  /* Not the inline-code pill below: a block can sit in a list item, as on
     the front page, where `li code` would reach it. */
  padding: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

/* Inline code in running text. */
p code,
li code {
  padding: 0.12em 0.4em;
  border-radius: 5px;
  background: var(--inline-code);
  color: var(--text-primary);
  font-size: 0.85em;
}

/* Footer */

.footer {
  padding: 24px 16px 40px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.85rem;
  text-align: center;
}

.footer p {
  margin: 0;
}
