/* Lunarly - lunarly.cc
 * Cosmic dark theme, vanilla CSS, mobile-first.
 * Palette inspired by lib/app/theme/colors.dart.
 *   --lunar-midnight  #0F0F23  background
 *   --lunar-purple    #6B46C1  accent / links
 *   --stardust        #E8C547  headings
 *   --body            #E8E8F0  text
 */

:root {
  --lunar-midnight: #0F0F23;
  --lunar-midnight-2: #15152E;
  --lunar-purple: #6B46C1;
  --lunar-purple-soft: #8B6BE0;
  --stardust: #E8C547;
  --body: #E8E8F0;
  --muted: #A0A0BC;
  --border: #2A2A4A;
  --code-bg: #1A1A38;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  background: var(--lunar-midnight);
  color: var(--body);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle starfield gradient backdrop */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(107, 70, 193, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(232, 197, 71, 0.06) 0%, transparent 55%);
  pointer-events: none;
  z-index: -1;
}

.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

@media (min-width: 720px) {
  .page {
    padding: 56px 32px 72px;
  }
}

/* Header / nav */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, var(--stardust) 0%, var(--lunar-purple-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
}

.locale-switch {
  display: flex;
  gap: 12px;
  font-size: 14px;
}

.locale-switch a {
  color: var(--muted);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.locale-switch a:hover {
  color: var(--body);
  border-color: var(--lunar-purple);
  background: rgba(107, 70, 193, 0.1);
}

.locale-switch a.active {
  color: var(--stardust);
  border-color: var(--stardust);
}

/* Headings */
h1, h2, h3, h4 {
  color: var(--stardust);
  line-height: 1.25;
  margin-top: 1.8em;
  margin-bottom: 0.5em;
  font-weight: 700;
}

h1 {
  font-size: clamp(28px, 5vw, 38px);
  margin-top: 0;
  background: linear-gradient(120deg, var(--stardust) 0%, var(--lunar-purple-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.01em;
}

h2 {
  font-size: clamp(20px, 3.5vw, 24px);
  padding-top: 0.4em;
  border-top: 1px solid var(--border);
}

article h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

h3 {
  font-size: 18px;
  color: var(--lunar-purple-soft);
}

/* Paragraphs and inline */
p {
  margin: 0 0 1em;
}

strong {
  color: var(--stardust);
  font-weight: 600;
}

em {
  color: var(--body);
}

a {
  color: var(--lunar-purple-soft);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover, a:focus {
  color: var(--stardust);
  text-decoration: underline;
}

/* Lists */
ul, ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}

li {
  margin-bottom: 0.4em;
}

li::marker {
  color: var(--lunar-purple-soft);
}

/* Code */
code {
  font-family: "SF Mono", Menlo, Consolas, "Courier New", monospace;
  font-size: 0.9em;
  background: var(--code-bg);
  color: var(--stardust);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.9em;
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.5em;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 520px;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  background: var(--lunar-midnight-2);
  color: var(--stardust);
  font-weight: 600;
}

tr:last-child td {
  border-bottom: none;
}

/* Blockquote */
blockquote {
  margin: 1.2em 0;
  padding: 12px 18px;
  border-left: 3px solid var(--lunar-purple);
  background: rgba(107, 70, 193, 0.08);
  border-radius: 0 6px 6px 0;
  color: var(--body);
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Horizontal rule */
hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 2em 0;
}

/* Document meta (effective date etc.) */
.doc-meta {
  color: var(--muted);
  font-size: 14px;
  margin-top: -0.5em;
  margin-bottom: 1.5em;
}

.doc-meta strong {
  color: var(--body);
}

/* Landing-specific */
.landing main {
  text-align: center;
  padding-top: 24px;
}

.landing h1 {
  font-size: clamp(40px, 8vw, 64px);
  margin-bottom: 0.2em;
}

.landing .tagline {
  color: var(--muted);
  font-size: clamp(16px, 2.5vw, 18px);
  margin-bottom: 2.5em;
}

.landing section {
  text-align: left;
  margin: 0 auto 2em;
  max-width: 540px;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 2em 0 1.5em;
}

.legal-links a {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--body);
  text-decoration: none;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.legal-links a:hover {
  border-color: var(--lunar-purple);
  background: rgba(107, 70, 193, 0.12);
  color: var(--stardust);
  text-decoration: none;
}

.store-link {
  color: var(--muted);
  font-size: 14px;
  margin-top: 1.5em;
}

/* Footer */
.site-footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.site-footer nav {
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.site-footer nav a {
  color: var(--muted);
}

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

/* Focus styles for keyboard nav */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--lunar-purple-soft);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Selection */
::selection {
  background: rgba(107, 70, 193, 0.4);
  color: var(--stardust);
}
