/* SpaceMoon website. System fonts only, no external resources. */

:root {
  color-scheme: dark;
  --bg: #0b0d1f;
  --bg-2: #111433;
  --surface: #171a3a;
  --surface-2: #1d2147;
  --line: #2b2f5c;
  --text: #ecebf7;
  --muted: #aeadcc;
  --accent: #c3bdff;
  --accent-2: #9d96f5;
  --moon: #f5e6a8;
  --warn-line: #e8cf7a;
  --radius: 16px;
  --wrap: 68rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

:lang(ko) { --font: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", Roboto, sans-serif; word-break: keep-all; overflow-wrap: anywhere; }
:lang(ja) { --font: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo UI", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", system-ui, Roboto, sans-serif; line-break: strict; }
:lang(vi) { --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif; }

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(60rem 30rem at 85% -10%, #222657 0%, rgba(34, 38, 87, 0) 70%);
  background-repeat: no-repeat;
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: #fff; }
a:focus-visible, summary:focus-visible, .button:focus-visible {
  outline: 2px solid var(--moon);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.6em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.9rem, 6vw, 3rem); }
h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1em; }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 0.92em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 6px; }
strong { color: #fff; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 40rem) { .wrap { padding: 0 24px; } }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--moon); color: #111; padding: 0.5rem 1rem; border-radius: 8px;
}
.skip:focus { top: 1rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 0.75rem 1.25rem; min-height: 4rem; flex-wrap: wrap; padding-top: 0.5rem; padding-bottom: 0.5rem; }
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.15rem; margin-right: auto; }
.brand:hover { color: #fff; }
.brand .mark { width: 1.9rem; height: 1.9rem; }
.nav { display: flex; gap: 1rem; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.nav a:hover { color: var(--text); }

/* Language switcher: <details>, works without JavaScript */
.lang { position: relative; }
.lang summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.4rem;
  color: var(--muted); font-weight: 600; padding: 0.35rem 0.7rem; border: 1px solid var(--line); border-radius: 999px;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary:hover, .lang[open] summary { color: var(--text); border-color: var(--accent-2); }
.lang summary .ico { width: 1.1rem; height: 1.1rem; }
.lang ul {
  position: absolute; right: 0; top: calc(100% + 0.4rem); z-index: 5; margin: 0; padding: 0.4rem; list-style: none;
  min-width: 10rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.lang li a { display: block; padding: 0.45rem 0.75rem; border-radius: 8px; color: var(--text); text-decoration: none; }
.lang li a:hover { background: var(--surface); }
.lang li a[aria-current] { color: var(--moon); font-weight: 700; }

/* Hero */
.hero { padding: 3.5rem 0 2.5rem; text-align: center; }
.hero-small { padding: 4rem 0; }
.hero-inner { display: flex; flex-direction: column; align-items: center; }
.hero-mark {
  width: 7.5rem; height: 7.5rem; border-radius: 50%; display: grid; place-items: center; margin-bottom: 1.5rem;
  background: radial-gradient(circle at 50% 50%, #2a2e66 0%, #1b1e3c 60%, rgba(27, 30, 60, 0) 72%);
}
.hero-mark .mark { width: 5rem; height: 5rem; }
.hero h1 { max-width: 18em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 36em; }
.hero .lead { margin-left: auto; margin-right: auto; }
.small { font-size: 0.9rem; color: var(--muted); }

.promises { list-style: none; padding: 0; margin: 0.5rem 0 1.75rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.promises li {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.85rem 0.35rem 0.6rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); font-weight: 600; font-size: 0.95rem;
}
.promises .ico { width: 1.05rem; height: 1.05rem; color: var(--moon); }

.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.button {
  display: inline-block; padding: 0.8rem 1.4rem; border-radius: 999px; font-weight: 700; text-decoration: none;
  background: var(--accent); color: #14163a; border: 1px solid var(--accent);
}
.button:hover { background: #fff; border-color: #fff; color: #14163a; }
.button-ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.button-ghost:hover { background: var(--surface); color: #fff; border-color: var(--accent-2); }

/* Sections */
.section { padding: 2.5rem 0; }
.section h2 { text-align: center; }
.section-lead { text-align: center; color: var(--muted); max-width: 36em; margin: 0 auto 1.5rem; }

.cards { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-top: 1.5rem; }
@media (min-width: 40rem) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.35rem 1.35rem 0.5rem;
}
.card p { color: var(--muted); }
.card-icon {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; margin-bottom: 0.9rem;
  background: var(--surface-2); color: var(--accent);
}
.card-icon .ico { width: 1.6rem; height: 1.6rem; flex: none; }
@media (min-width: 40rem) { .card-wide { grid-column: span 2; } }
@media (min-width: 64rem) { .card-wide { grid-column: span 1; grid-row: span 2; } }
.app-icons { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.app-icons span { width: 3.25rem; height: 3.25rem; border-radius: 28%; overflow: hidden; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35); }
.app-icons .app-icon { width: 100%; height: 100%; }

/* Plans */
.plans { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 48rem) { .plans { grid-template-columns: 1fr 1.4fr; } }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.plan-pro { border-color: var(--accent-2); background: linear-gradient(180deg, #1f2350 0%, var(--surface) 100%); }
.price { font-size: 2rem; font-weight: 800; margin-bottom: 0.5rem; }
.prices { margin: 1rem 0 0; display: grid; gap: 0.5rem; }
.prices div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: 0.7rem 0.9rem; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.prices dt { font-weight: 600; }
.prices dd { margin: 0; font-weight: 800; font-size: 1.15rem; color: var(--moon); white-space: nowrap; }
.tag { display: inline-block; font-size: 0.78rem; font-weight: 700; color: #14163a; background: var(--moon); border-radius: 999px; padding: 0.05rem 0.55rem; margin-left: 0.25rem; vertical-align: 0.1em; }
.section .small { text-align: center; margin-top: 1rem; }

/* Lists */
.list { padding-left: 1.3rem; margin: 0 0 1.2rem; }
.list li { margin-bottom: 0.45rem; }
.list li::marker { color: var(--accent-2); }
.plan .list { padding-left: 1.2rem; }

/* Callouts */
.callout {
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent-2);
  border-radius: 12px; padding: 1.1rem 1.25rem 0.2rem; margin: 1.5rem 0;
}
.callout-warn { border-color: #4a4428; border-left-color: var(--warn-line); background: linear-gradient(180deg, #24233a 0%, var(--surface) 100%); }
.callout h2, .callout h3 { color: var(--moon); text-align: left; }
.section .callout { max-width: 46rem; margin-left: auto; margin-right: auto; }

/* Long-form pages */
.doc { padding-top: 2.5rem; padding-bottom: 3rem; max-width: 48rem; }
.doc h2 { margin-top: 2.2rem; padding-top: 0.5rem; }
.doc h3 { margin-top: 1.6rem; }
.doc .callout h2 { margin-top: 0; padding-top: 0; }
.doc .callout h3 { margin-top: 0; }
.meta { color: var(--muted); }
.toc { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1.25rem 0.4rem; margin: 1.5rem 0; }
.toc ol { margin: 0 0 0.6rem; padding-left: 1.3rem; }
.toc li { margin-bottom: 0.25rem; }
.defs dt { font-weight: 700; color: #fff; margin-top: 0.9rem; }
.defs dd { margin: 0.2rem 0 0; color: var(--muted); }

.table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; min-width: 30rem; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.65rem 0.85rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--surface-2); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
td:nth-child(2), td:nth-child(3) { white-space: nowrap; }

/* FAQ */
.faq { margin: 1.5rem 0 2rem; display: grid; gap: 0.75rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.faq summary {
  cursor: pointer; padding: 1rem 2.6rem 1rem 1.15rem; font-weight: 700; position: relative; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 1.2rem; top: 50%; width: 0.55rem; height: 0.55rem; margin-top: -0.4rem;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg);
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -0.1rem; }
.faq details > :not(summary) { margin-left: 1.15rem; margin-right: 1.15rem; }
.faq details > :last-child { margin-bottom: 1.1rem; }
.faq details[open] { border-color: var(--accent-2); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 2rem; padding: 2rem 0 2.5rem; color: var(--muted); font-size: 0.92rem; }
.footer-brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--text); font-size: 1.05rem; margin-bottom: 0.4rem; }
.footer-brand .mark { width: 1.5rem; height: 1.5rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 1rem 0; }
.footer-links a { color: var(--text); }
.footer-note, .footer-copy { margin-bottom: 0.3rem; }

@media (prefers-reduced-motion: no-preference) {
  .button, .nav a, .lang summary { transition: background-color 0.15s, color 0.15s, border-color 0.15s; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .toc, .skip { display: none; }
  a, strong, .defs dt { color: #000; }
}
