/* =========================================================
   Lucky Draw Bot · website
   Calm, professional SaaS aesthetic.
   Tight spacing, restrained type scale, cool palette.
   ========================================================= */

:root {
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --bg-soft: #f7f8fa;
  --bg-tint: #f1f3f7;
  --text: #0f1419;
  --text-2: #4b5563;
  --text-muted: #6b7280;
  --border: #e6e8ec;
  --border-strong: #d8dbe0;
  --brand: #3958f5;
  --brand-hover: #2845e8;
  --brand-tint: #eef1ff;
  --accent: #0ea5e9;
  --success: #10b981;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(15,20,25,.04);
  --shadow-md: 0 1px 3px rgba(15,20,25,.06), 0 4px 10px rgba(15,20,25,.04);
  --shadow-lg: 0 8px 24px rgba(15,20,25,.08);
  --max-w: 1120px;
  --max-w-narrow: 760px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d10;
    --bg-elev: #11151a;
    --bg-soft: #14181e;
    --bg-tint: #1a1f26;
    --text: #f2f4f7;
    --text-2: #c1c7d0;
    --text-muted: #8b94a3;
    --border: #1f242b;
    --border-strong: #2a303a;
    --brand: #6b86ff;
    --brand-hover: #8298ff;
    --brand-tint: rgba(107,134,255,.10);
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow-md: 0 1px 3px rgba(0,0,0,.4), 0 4px 10px rgba(0,0,0,.3);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: var(--max-w-narrow); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 6px;
}
.skip-link:focus { left: 12px; top: 12px; z-index: 999; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; gap: 24px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 15px; letter-spacing: -.01em;
  color: var(--text);
}
.brand img { border-radius: 6px; }
.nav-links {
  display: flex; align-items: center; gap: 4px;
}
.nav-links > a {
  color: var(--text-2); font-weight: 500; font-size: 14px;
  padding: 6px 12px; border-radius: 6px;
}
.nav-links > a:hover { color: var(--text); background: var(--bg-soft); }
.nav-links .btn { margin-left: 8px; font-size: 14px; }

@media (max-width: 720px) {
  .nav-links > a:not(.btn) { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 6px; font-weight: 500; font-size: 14px;
  border: 1px solid transparent; transition: all .15s ease;
  white-space: nowrap; line-height: 1.4;
}
.btn-primary {
  background: var(--brand); color: #fff;
  box-shadow: 0 1px 2px rgba(57,88,245,.25);
}
.btn-primary:hover { background: var(--brand-hover); color: #fff; transform: translateY(-1px); }
.btn-ghost {
  background: var(--bg); color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-soft); }
.btn-lg { padding: 11px 20px; font-size: 15px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(60% 80% at 50% 0%, var(--brand-tint), transparent 70%),
    var(--bg);
}
.hero-inner { text-align: center; max-width: 720px; margin: 0 auto; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; color: var(--text-2);
  background: var(--bg-soft); border: 1px solid var(--border);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

.hero h1 {
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.1; letter-spacing: -.025em; font-weight: 700;
  margin: 18px 0 14px;
  color: var(--text);
}
.hero .lede {
  font-size: 17px; color: var(--text-2);
  max-width: 56ch; margin: 0 auto 28px;
}
.hero-ctas { display: inline-flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.hero-meta {
  margin-top: 32px; display: inline-flex; flex-wrap: wrap; gap: 20px 28px;
  color: var(--text-muted); font-size: 13px; justify-content: center;
}
.hero-meta b { color: var(--text); font-weight: 600; }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.section-head { text-align: center; max-width: 620px; margin: 0 auto 40px; }
.section-head .kicker {
  text-transform: uppercase; letter-spacing: .08em; font-size: 12px;
  color: var(--brand); font-weight: 600;
}
.section-head h2 {
  font-size: clamp(24px, 2.6vw, 32px); letter-spacing: -.02em;
  margin: 8px 0 10px; font-weight: 700;
}
.section-head p { color: var(--text-2); font-size: 15px; margin: 0; }

/* ---------- Feature grid ---------- */
.grid { display: grid; gap: 14px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.card .icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center; font-size: 18px;
  background: var(--brand-tint);
  color: var(--brand);
  margin-bottom: 14px;
}
.card h3 {
  margin: 0 0 6px; font-size: 15px; font-weight: 600;
  letter-spacing: -.01em; color: var(--text);
}
.card p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.55; }

/* ---------- Stats strip ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-soft); overflow: hidden;
}
@media (max-width: 700px) { .stats { grid-template-columns: 1fr 1fr; } }
.stat {
  text-align: center; padding: 22px 16px;
  border-right: 1px solid var(--border);
}
.stat:last-child { border-right: 0; }
@media (max-width: 700px) {
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
.stat b {
  display: block; font-size: 24px; letter-spacing: -.02em;
  font-weight: 700; color: var(--text); line-height: 1.1;
}
.stat span {
  color: var(--text-muted); font-size: 12px;
  text-transform: uppercase; letter-spacing: .06em;
  margin-top: 6px; display: block;
}

/* ---------- Steps (How it works) ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: step; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.step {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
}
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--brand); letter-spacing: .04em; display: block;
  margin-bottom: 12px;
}
.step h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.step p { margin: 0; color: var(--text-2); font-size: 14px; }

/* ---------- CTA strip ---------- */
.cta-strip {
  padding: 48px 36px; border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(80% 120% at 0% 0%, var(--brand-tint), transparent 60%),
    var(--bg-elev);
  text-align: center;
}
.cta-strip h2 { margin: 0 0 8px; font-size: 24px; letter-spacing: -.02em; }
.cta-strip p { margin: 0 0 18px; color: var(--text-2); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
  margin-top: 32px;
  background: var(--bg);
  font-size: 14px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; } }
.footer-grid h4 {
  margin: 0 0 10px; font-size: 12px;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); font-weight: 600;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-grid a { color: var(--text-2); }
.footer-grid a:hover { color: var(--brand); }
.footer-grid .brand { font-size: 14px; }
.foot-line {
  margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: 12px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.muted { color: var(--text-muted); }

/* ---------- Prose (Markdown content) ---------- */
.prose { max-width: var(--max-w-narrow); margin: 0 auto; font-size: 16px; color: var(--text); }
.prose h2 { margin: 36px 0 12px; font-size: 22px; letter-spacing: -.015em; font-weight: 700; }
.prose h3 { margin: 28px 0 10px; font-size: 17px; letter-spacing: -.01em; font-weight: 600; }
.prose p, .prose ul, .prose ol { margin: 12px 0; color: var(--text); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose code {
  font-family: var(--mono); font-size: .9em;
  background: var(--bg-tint); padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--border);
}
.prose pre {
  background: var(--bg-tint); border: 1px solid var(--border);
  padding: 14px 16px; border-radius: 8px; overflow-x: auto; font-size: 13px;
}
.prose pre code { background: transparent; border: 0; padding: 0; }
.prose blockquote {
  margin: 18px 0; padding: 10px 16px;
  border-left: 3px solid var(--brand);
  background: var(--bg-soft); border-radius: 0 8px 8px 0;
  color: var(--text-2);
}
.prose blockquote p { color: var(--text-2); margin: 6px 0; }
.prose a { color: var(--brand); text-decoration: none; border-bottom: 1px solid color-mix(in oklab, var(--brand) 30%, transparent); }
.prose a:hover { border-bottom-color: var(--brand); }
.prose img { border-radius: 8px; border: 1px solid var(--border); margin: 14px auto; }

/* ---------- Legal pages ---------- */
.legal { padding: 56px 0 64px; }
.legal .container { max-width: 760px; }
.legal h1 { font-size: 32px; letter-spacing: -.02em; font-weight: 700; margin: 0 0 6px; }
.legal .updated {
  color: var(--text-muted); margin: 0 0 28px; font-size: 13px;
  padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.legal h2 { margin-top: 28px; font-size: 17px; font-weight: 600; }
.legal p, .legal li { color: var(--text); font-size: 15px; }

/* ---------- Posts list ---------- */
.posts-hero { padding: 56px 0 16px; text-align: center; border-bottom: 1px solid var(--border); }
.posts-hero h1 { font-size: clamp(28px, 3.5vw, 40px); letter-spacing: -.02em; margin: 0 0 8px; font-weight: 700; }
.posts-hero p { color: var(--text-2); margin: 0 auto; max-width: 56ch; }

.posts-list { padding: 32px 0 64px; }
.post-card {
  display: block; padding: 22px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-elev); margin: 0 0 12px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.post-card:hover {
  border-color: var(--border-strong); transform: translateY(-1px);
  box-shadow: var(--shadow-md); color: inherit;
}
.post-card h2 { margin: 0 0 6px; font-size: 18px; letter-spacing: -.01em; font-weight: 600; color: var(--text); }
.post-card .post-meta {
  color: var(--text-muted); font-size: 12px; margin: 0 0 8px;
  text-transform: uppercase; letter-spacing: .05em;
}
.post-card p { margin: 0; color: var(--text-2); font-size: 14px; }

/* ---------- Single post ---------- */
.post { padding: 48px 0 32px; }
.post .post-header { text-align: center; max-width: 720px; margin: 0 auto 32px; }
.post .eyebrow-back { color: var(--text-muted); font-size: 13px; }
.post .eyebrow-back a:hover { color: var(--brand); }
.post h1 { font-size: clamp(28px, 3.5vw, 40px); letter-spacing: -.02em; margin: 14px 0 10px; font-weight: 700; }
.post .post-meta { color: var(--text-muted); font-size: 13px; }
.post .lede { color: var(--text-2); font-size: 17px; max-width: 56ch; margin: 14px auto 0; }
.post-footer {
  max-width: var(--max-w-narrow); margin: 48px auto 0; padding-top: 20px;
  border-top: 1px solid var(--border); color: var(--text-muted); font-size: 14px;
}

/* ---------- Donate / Contact ---------- */
.simple-hero { padding: 72px 0 24px; text-align: center; border-bottom: 1px solid var(--border); }
.simple-hero h1 { font-size: clamp(28px, 3.5vw, 40px); letter-spacing: -.02em; margin: 0 0 10px; font-weight: 700; }
.simple-hero p { color: var(--text-2); max-width: 56ch; margin: 0 auto; font-size: 16px; }

.donate-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  max-width: 820px; margin: 40px auto 64px; padding: 0 24px;
}
@media (max-width: 700px) { .donate-grid { grid-template-columns: 1fr; } }

.contact-card {
  max-width: 540px; margin: 40px auto 64px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px; text-align: center;
  box-shadow: var(--shadow-md);
}
.contact-card .label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin: 0;
}
.contact-card .email {
  display: inline-block; margin: 6px 0 14px; font-family: var(--mono);
  font-size: 20px; color: var(--brand); font-weight: 500;
}
.contact-card .email:hover { text-decoration: underline; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.section-tight { padding: 40px 0; }
