/*
 * The stylesheet of the static pages (the landing page and the tử vi articles, built by scripts/build-static-pages.mjs).
 * The app's styles (Astryx, Tailwind) are not here: these pages load no script and nothing from another site, and their font
 * is the visitor's own system font (the Content-Security-Policy allows no other). The colours follow the visitor's light or
 * dark setting.
 */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f5f5fa;
  --text: #1c1b29;
  --muted: #5b5a70;
  --line: #e0e0ec;
  --accent: #4f46e5;
  --accent-text: #ffffff;
  --link: #4338ca;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14131f;
    --surface: #1d1c2c;
    --text: #ececf6;
    --muted: #a5a4bd;
    --line: #2f2e45;
    --accent: #6d66f0;
    --accent-text: #ffffff;
    --link: #a5a0ff;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-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.7;
}

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

.site-header,
.site-footer,
main {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

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

.site-header nav a:not(.button):hover {
  text-decoration: underline;
}

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

.button {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border-radius: 0.6rem;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  line-height: 1.4;
  text-decoration: none;
}

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

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

main {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

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

h1 {
  margin: 0.25rem 0 1rem;
  font-size: 2rem;
}

h2 {
  margin: 2.25rem 0 0.75rem;
  font-size: 1.45rem;
}

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

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

li {
  margin-bottom: 0.35rem;
}

blockquote {
  margin: 1.25rem 0;
  padding: 0.25rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--surface);
}

table {
  width: 100%;
  margin: 0 0 1.25rem;
  border-collapse: collapse;
  font-size: 0.98rem;
}

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

th {
  background: var(--surface);
}

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

.hero {
  padding: 1.5rem 0 1rem;
}

.hero h1 {
  font-size: 2.4rem;
}

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

.hero .button {
  margin-top: 0.5rem;
  padding: 0.8rem 1.6rem;
  font-size: 1.1rem;
}

.note {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.cta {
  margin: 2.5rem 0 0;
  padding: 1.5rem;
  border-radius: 0.9rem;
  background: var(--surface);
  text-align: center;
}

.cta p {
  margin-bottom: 0.9rem;
}

.more {
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.more h2 {
  margin-top: 0.5rem;
}

.articles {
  padding: 0;
  list-style: none;
}

.articles li {
  margin-bottom: 1.25rem;
}

.articles a {
  font-size: 1.15rem;
  font-weight: 600;
}

.articles p {
  margin: 0.1rem 0 0;
  color: var(--muted);
}

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

.site-footer p {
  margin-bottom: 0.5rem;
}

@media (max-width: 30rem) {
  h1,
  .hero h1 {
    font-size: 1.75rem;
  }

  .site-header nav {
    gap: 0.9rem;
  }
}
