/* One stylesheet for every page on fengshui.app. No build step, no web fonts, no scripts. */

:root {
  --bg: #faf8f4;
  --surface: #ffffff;
  --text: #1d2320;
  --muted: #55605a;
  --line: #dcd8cf;
  --accent: #2f5d50;
  --accent-soft: #e7efe9;
  --todo-bg: #fff1b8;
  --todo-text: #4a3b00;
  --focus: #1b6ef3;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161a18;
    --surface: #1e2321;
    --text: #e8ebe8;
    --muted: #a8b2ac;
    --line: #36403b;
    --accent: #8fc7b3;
    --accent-soft: #23302b;
    --todo-bg: #5a4a00;
    --todo-text: #fff3c4;
    --focus: #7fb0ff;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

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

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  padding: 0.5rem 0.75rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  z-index: 10;
}

.skip-link:focus {
  top: 0.75rem;
}

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header and navigation */

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

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

.brand {
  font-weight: 650;
  font-size: 1.125rem;
  color: var(--text);
  text-decoration: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.site-nav li + li,
.site-footer li + li {
  margin-top: 0;
}

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

.site-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

/* Content */

main {
  padding: 2rem 0 3rem;
}

h1 {
  font-size: 1.875rem;
  line-height: 1.25;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}

h2 {
  font-size: 1.3125rem;
  line-height: 1.3;
  margin: 2.5rem 0 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

h3 {
  font-size: 1.0625rem;
  margin: 1.75rem 0 0.5rem;
}

p,
ul,
ol {
  margin: 0 0 1rem;
}

li + li {
  margin-top: 0.35rem;
}

.meta {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
}

.lead {
  font-size: 1.125rem;
}

.summary {
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.summary h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  font-size: 1.125rem;
}

.summary ul {
  margin-bottom: 0;
}

.callout {
  border-left: 4px solid var(--accent);
  background: var(--surface);
  padding: 0.75rem 1rem;
  margin: 1.25rem 0;
  border-radius: 0 8px 8px 0;
}

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

.toc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
}

.toc h2 {
  margin: 0.25rem 0 0.5rem;
  padding-top: 0;
  border-top: 0;
  font-size: 1rem;
}

.toc ol {
  margin-bottom: 0.25rem;
  padding-left: 1.25rem;
}

.toc li + li {
  margin-top: 0.15rem;
}

/* Tables scroll sideways on narrow screens instead of squeezing the text. */

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 0.9375rem;
  line-height: 1.5;
}

caption {
  text-align: left;
  padding: 0.75rem 0.875rem 0.25rem;
  font-weight: 600;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.625rem 0.875rem;
  border-top: 1px solid var(--line);
}

thead th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.875rem;
  border-top: 0;
}

tbody th {
  font-weight: 600;
}

table.wide {
  min-width: 50rem;
}

/* FAQ: plain headed sections, so links to an answer always land on visible text. */

.faq h3 {
  margin-top: 1.5rem;
}

/* Facts the founder still has to fill in. Grep for class="todo" before launch. */

mark.todo {
  background: var(--todo-bg);
  color: var(--todo-text);
  padding: 0 0.25em;
  border-radius: 3px;
  outline: 1px dashed currentColor;
  outline-offset: -1px;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9375rem;
  padding: 1.5rem 0 2.5rem;
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
}

.site-footer p {
  margin: 0;
}

@media (min-width: 40rem) {
  h1 {
    font-size: 2.25rem;
  }

  main {
    padding-top: 3rem;
  }
}
