/* Lucky Astronomy - main stylesheet (clean dark theme) */

:root {
  --bg: #0a0f1e;
  --surface: #111a2f;
  --surface-2: #16203a;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #e8ecf5;
  --text-muted: #9ba6bf;
  --accent: #f2b84b;
  --accent-hover: #ffc865;
  --accent-ink: #1a1203;
  --link: #8cc8ff;
  --free: #7fe0a8;
  --paid: #8cc8ff;
  --wip: #f2b84b;
  --radius: 12px;
  --radius-sm: 8px;
  --wrap: 1100px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #b8ddff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.75rem); font-weight: 650; }
h3 { font-size: 1.12rem; font-weight: 650; }
p { margin: 0 0 1em; }
.small { font-size: 0.88rem; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
@media (max-width: 480px) { .wrap { padding: 0 16px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: var(--radius-sm); z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.08rem; }
.brand:hover { color: var(--text); }

.site-nav { display: flex; gap: 2px; }
.site-nav a { color: var(--text-muted); text-decoration: none; padding: 8px 14px; border-radius: var(--radius-sm); font-size: 0.95rem; }
.site-nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.site-nav a[aria-current="page"] { color: var(--text); background: rgba(255, 255, 255, 0.08); }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav { position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; padding: 8px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--border); display: none; }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 14px; }
}

/* ---------- Layout ---------- */
main { flex: 1; }
.section { padding: 64px 0; }
.section-tight { padding: 32px 0; }
.section-head { max-width: 680px; margin-bottom: 28px; }
.eyebrow { display: inline-block; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 650; margin-bottom: 10px; }
.lead { font-size: 1.12rem; color: var(--text-muted); }
.muted { color: var(--text-muted); }

.hero { padding: 80px 0 40px; }
.hero .lead { max-width: 580px; }
.page-hero { padding: 56px 0 24px; }
.page-hero .lead { max-width: 680px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.97rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: inherit; transition: background .15s, border-color .15s, color .15s; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { color: var(--text); border-color: var(--link); }
.btn[aria-disabled="true"] { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); cursor: not-allowed; pointer-events: none; }
.btn-block { width: 100%; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
@media (max-width: 400px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.card p:last-child { margin-bottom: 0; }
.card h3 { margin-top: 0; }

.feature-icon, .product-icon {
  width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 14px;
  background: rgba(140, 200, 255, 0.1); color: var(--link);
}
.feature-icon svg, .product-icon svg { width: 22px; height: 22px; }
.product-icon { width: 52px; height: 52px; background: rgba(242, 184, 75, 0.12); color: var(--accent); }
.product-icon svg { width: 26px; height: 26px; }
.product-icon-lg { width: 72px; height: 72px; border-radius: 16px; flex-shrink: 0; margin: 0; }
.product-icon-lg svg { width: 36px; height: 36px; }

.info-row > div h3 { margin-top: 0; }

/* Product cards */
.product-card { position: relative; display: flex; flex-direction: column; transition: border-color .15s, background .15s; }
.product-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.product-card h3 { margin: 0 0 8px; font-size: 1.3rem; }
.product-card h3 a { color: var(--text); text-decoration: none; }
.product-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.product-card .badges { margin-bottom: 14px; }
.product-meta { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 0.86rem; color: var(--text-muted); }
.card-link { margin-top: 14px; font-weight: 600; color: var(--link); font-size: 0.95rem; }
.product-card:hover .card-link { color: #b8ddff; }

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-block; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 9px; border-radius: 6px; border: 1px solid currentColor; }
.badge-free { color: var(--free); background: rgba(127, 224, 168, 0.08); }
.badge-paid { color: var(--paid); background: rgba(140, 200, 255, 0.08); }
.badge-soon { color: var(--wip); background: rgba(242, 184, 75, 0.08); }
.badge-available { color: var(--free); background: rgba(127, 224, 168, 0.08); }
.badge-beta { color: var(--paid); background: rgba(140, 200, 255, 0.08); }

/* ---------- Product page ---------- */
.breadcrumb { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 22px; }
.breadcrumb a { color: var(--text-muted); }
.product-header { display: flex; gap: 24px; align-items: flex-start; }
.product-header h1 { margin-bottom: 10px; }
.product-header .badges { margin-bottom: 16px; }
@media (max-width: 560px) { .product-header { flex-direction: column; gap: 16px; } }

.facts { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 6px 0 0; padding: 0; list-style: none; color: var(--text-muted); font-size: 0.93rem; }
.facts strong { color: var(--text); font-weight: 600; margin-right: 4px; }

.two-col { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.side { display: grid; gap: 16px; }
.side-card .btn { margin-top: 4px; }

.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { position: relative; padding-left: 26px; margin-bottom: 8px; }
.check-list li::before { content: ""; position: absolute; left: 3px; top: 0.5em; width: 11px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

/* Pricing */
.pricing { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); max-width: 760px; }
.price-card { display: flex; flex-direction: column; position: relative; }
.price-card.highlight { border-color: rgba(242, 184, 75, 0.55); }
.ribbon { position: absolute; top: -11px; right: 18px; background: var(--accent); color: var(--accent-ink); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 10px; border-radius: 6px; }
.price { font-size: 1.9rem; font-weight: 700; margin: 4px 0 2px; }
.price-tbd { font-size: 1.15rem; color: var(--text-muted); font-weight: 600; padding: 10px 0 4px; }
.price-term { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 18px; }
.price-card .check-list { margin-bottom: 22px; }
.price-card .btn { margin-top: auto; }
.upgrade-note { margin: 22px auto 0; max-width: 760px; display: flex; gap: 10px; align-items: flex-start; justify-content: center; text-align: center; color: var(--text); font-size: 0.98rem; }
.upgrade-note svg { flex: none; width: 20px; height: 20px; color: var(--accent); margin-top: 2px; }
.price-note { margin-top: 18px; font-size: 0.92rem; color: var(--text-muted); }

/* ---------- Prose, tables, FAQ ---------- */
.prose { max-width: 740px; }
.prose h2 { margin-top: 0; }
.prose h2 + p { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }
.prose > h2:not(:first-child) { margin-top: 1.8em; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 520px; }
th, td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-muted); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }

details { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 10px; }
summary { cursor: pointer; padding: 15px 20px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-weight: 700; font-size: 1.2rem; line-height: 1; }
details[open] summary::after { content: "\2212"; }
details > div { padding: 0 20px 14px; color: var(--text-muted); }

.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { counter-increment: step; position: relative; }
.steps li.card { padding-top: 62px; }
.steps li::before { content: counter(step); position: absolute; top: 22px; left: 24px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(242, 184, 75, 0.14); color: var(--accent); font-weight: 700; font-size: 0.88rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg); margin-top: 48px; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 20px 40px; padding-top: 32px; padding-bottom: 28px; align-items: center; }
.footer-brand { display: flex; gap: 12px; align-items: center; }
.footer-brand p { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.93rem; }
.footer-links a:hover { color: var(--text); }
.copyright { grid-column: 1 / -1; margin: 0; color: var(--text-muted); font-size: 0.85rem; border-top: 1px solid var(--border); padding-top: 18px; }
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr; } }

/* ---------- Upgrade page ---------- */
.upgrade-form { display: grid; gap: 10px; margin: 16px 0 12px; }
.upgrade-form label { font-weight: 600; font-size: 0.95rem; }
.upgrade-form input { font: inherit; font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.03em; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); width: 100%; }
.upgrade-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.upgrade-form .btn { justify-self: start; }
.upgrade-result { margin: 8px 0 14px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface-2); }
.upgrade-result.ok { border-color: var(--accent); }
.upgrade-result.error { border-color: #e06c6c; }
.upgrade-result p { margin: 0 0 10px; }
.upgrade-result p:last-child { margin-bottom: 0; }
.upgrade-note span a { white-space: nowrap; margin-left: 4px; }

/* ---------- Work in progress ---------- */
.wip-banner { background: var(--accent); color: var(--accent-ink); border-bottom: 1px solid rgba(0, 0, 0, 0.25); }
.wip-inner { display: flex; align-items: center; gap: 14px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.wip-inner > div { flex: 1 1 260px; }
.wip-banner strong { display: block; font-size: 1.15rem; letter-spacing: 0.02em; text-transform: uppercase; }
.wip-banner p { margin: 2px 0 0; font-size: 0.97rem; }
.wip-icon { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-ink); color: var(--accent); font-weight: 800; font-size: 1.2rem; }
.wip-test { background: var(--accent-ink); color: var(--accent); border-radius: 6px; padding: 4px 10px; font-size: 0.85rem; font-weight: 650; }
.btn.is-wip { background: var(--surface-2); color: var(--text-muted); border-color: var(--border-strong); cursor: not-allowed; pointer-events: auto; }
.btn.is-wip:hover { color: var(--text-muted); border-color: var(--border-strong); }
.wip-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; width: min(520px, calc(100% - 32px)); background: var(--surface-2); color: var(--text); border: 1px solid var(--accent); border-radius: var(--radius-sm); padding: 14px 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); font-size: 0.95rem; }
.wip-toast[hidden] { display: none; }

/* 404 */
.not-found { text-align: center; padding: 110px 0; }
.not-found .big { font-size: clamp(4rem, 14vw, 7rem); font-weight: 800; line-height: 1; color: var(--accent); }
