/* Luna Nine — revamped home page.
   Tokens are the established Luna Nine light palette (see the repo design
   skill, section 10). No new hex values for styling decisions. */

:root {
  --page: #e9edf1;
  --ink: #ffffff;
  --surface: #f5f7f9;
  --bubble: #eef1f4;
  --bubble-user: #d7f0e2;
  --line: #dde3e8;
  --fg: #10161c;
  --muted: #5b6b76;
  --accent: #1f7a5a;
  --accent-soft: #e4f4ec;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-bubble: 18px;

  --shadow-sm: 0 1px 2px rgba(16, 22, 28, 0.06);
  --shadow: 0 1px 2px rgba(16, 22, 28, 0.06), 0 8px 24px -16px rgba(16, 22, 28, 0.28);
  --shadow-lg: 0 2px 4px rgba(16, 22, 28, 0.05), 0 24px 48px -28px rgba(16, 22, 28, 0.32);

  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.wrap {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 50;
  background: var(--ink);
  padding: 0.6rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 150ms ease, background 150ms ease;
}

.site-header.scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--page) 94%, transparent);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  color: var(--accent);
}

.brand:hover {
  color: var(--accent);
}

.brand-mark {
  width: 28px;
  height: 28px;
  display: block;
}

.brand-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--fg);
}

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

.site-nav a {
  font-size: 0.875rem;
  color: var(--muted);
}

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

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.link-quiet {
  font-size: 0.875rem;
  color: var(--muted);
}

.link-quiet:hover {
  color: var(--fg);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 0.5rem;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--fg);
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 14px;
  height: 1.5px;
  background: var(--fg);
  content: "";
}

.nav-toggle-bars {
  position: relative;
}

.nav-toggle-bars::before {
  position: absolute;
  top: -5px;
}

.nav-toggle-bars::after {
  position: absolute;
  top: 5px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 120ms ease, background 150ms ease, border-color 150ms ease,
    box-shadow 150ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--accent);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  color: var(--ink);
  background: #1a6a4f;
}

.btn-ghost {
  background: var(--ink);
  border-color: var(--line);
  color: var(--fg);
}

.btn-ghost:hover {
  color: var(--fg);
  border-color: var(--accent);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.8125rem;
}

.btn-block {
  width: 100%;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 3.5rem 0 3rem;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -30% 40% 40% -20%;
  background: radial-gradient(closest-side, var(--accent-soft), transparent);
  opacity: 0.9;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  display: grid;
  gap: 3rem;
  align-items: start;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--ink);
  border: 1px solid var(--line);
  font-size: 0.8125rem;
  color: var(--muted);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  margin-top: 1.25rem;
  font-size: clamp(2.125rem, 5.4vw, 3.25rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  max-width: 20ch;
}

.lede {
  margin-top: 1.25rem;
  max-width: 34rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--fg);
}

.lede-soft {
  margin-top: 0.5rem;
  color: var(--muted);
}

.cta-row {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.facts {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.facts li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.facts li::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

/* ---------- Thread ---------- */

.thread-card {
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.thread-card--wide {
  max-width: 40rem;
  margin: 2rem auto 0;
}

.thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.thread-title {
  font-size: 0.8125rem;
  font-weight: 600;
}

.thread-status {
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.thread {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 30rem;
  overflow-y: auto;
}

.msg {
  max-width: 86%;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-bubble);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.msg time {
  display: block;
  margin-top: 0.25rem;
  text-align: right;
  font-size: 0.6875rem;
  line-height: 1;
  color: var(--muted);
}

.msg-luna {
  align-self: flex-start;
  background: var(--bubble);
  border-bottom-left-radius: var(--radius-sm);
}

.msg-user {
  align-self: flex-end;
  background: var(--bubble-user);
  border-bottom-right-radius: var(--radius-sm);
}

.thread-mark {
  display: flex;
  justify-content: center;
  padding: 0.5rem 0;
}

.thread-mark span {
  background: var(--bubble);
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.thread-mark--call span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.75rem;
}

.call-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Sections ---------- */

.section {
  padding: 3.5rem 0;
}

.section--alt {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-label {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-lede {
  margin-top: 1rem;
  max-width: 34rem;
  font-size: 1.0625rem;
  color: var(--fg);
}

.grid-3,
.grid-2 {
  display: grid;
  gap: 1rem;
  margin-top: 1.75rem;
}

.card {
  background: var(--ink);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.card h3 {
  font-size: 1.0625rem;
}

.card p {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

.card-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 0.75rem;
}

.steps {
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 1.5rem;
}

.steps li {
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
}

.steps h3 {
  margin-top: 0.75rem;
  font-size: 1.0625rem;
}

.steps p {
  margin-top: 0.4rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--muted);
  max-width: 30rem;
}

/* ---------- Pricing ---------- */

.cycle {
  margin-top: 1.25rem;
  display: inline-flex;
  padding: 3px;
  gap: 3px;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.cycle-btn {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--muted);
  cursor: pointer;
}

.cycle-btn.is-on {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.plan--featured {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.plan-badge {
  position: absolute;
  top: -0.7rem;
  left: 1.5rem;
  background: var(--accent);
  color: var(--ink);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.plan h3 {
  font-size: 1.125rem;
}

.plan-note {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.plan-price {
  margin-top: 1.25rem;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.price {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.per {
  font-size: 0.875rem;
  color: var(--muted);
}

.plan-swap {
  margin-top: 0.15rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.plan-list {
  margin: 1.25rem 0 1.5rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
  font-size: 0.9375rem;
}

.plan-list li {
  display: flex;
  gap: 0.55rem;
}

.plan-list li::before {
  content: "";
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 0.25rem;
  border-radius: 4px;
  background: var(--accent-soft) center / 9px 9px no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.4l2.2 2.2 4.8-5' fill='none' stroke='%231f7a5a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.plan .btn {
  margin-top: auto;
}

.fineprint {
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- FAQ ---------- */

.faq {
  margin-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
  font-size: 1.0625rem;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "";
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 150ms ease;
}

.faq details[open] summary::after {
  transform: rotate(225deg) translateY(-2px);
}

.faq details p {
  margin: 0 0 1.25rem;
  max-width: 36rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--muted);
}

.faq details p a {
  color: var(--accent);
}

/* ---------- Closer ---------- */

.closer {
  padding: 1rem 0 4rem;
}

.closer-card {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.closer-copy h2 {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
}

.closer-copy p {
  margin-top: 0.75rem;
  max-width: 32rem;
  font-size: 0.9375rem;
  color: var(--fg);
}

.closer-copy a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.closer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--ink);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  padding: 2.5rem 1.25rem 3rem;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.footer-brand .brand-mark {
  color: var(--accent);
  flex-shrink: 0;
}

.footer-line {
  font-size: 0.9375rem;
  font-weight: 500;
}

.footer-sub {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.875rem;
}

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

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

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.token {
  font-size: 0.75rem;
  color: var(--muted);
}

.token a,
.mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.token a:hover {
  color: var(--accent);
}

.legal {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
}

.legal a {
  color: var(--muted);
}

.copyright {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: auto;
}

/* ---------- Reveal ---------- */

.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.js .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 899px) {
  .site-nav,
  .header-actions {
    display: none;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-open .site-nav {
    display: flex;
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: calc(100% + 0.5rem);
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
  }

  .nav-open .site-nav a {
    width: 100%;
    padding: 0.5rem 0;
    font-size: 1rem;
    color: var(--fg);
  }

  .closer-card {
    padding: 1.5rem;
  }

  .copyright {
    margin-left: 0;
  }
}

@media (min-width: 640px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 900px) {
  .hero {
    padding: 4.5rem 0 4rem;
  }

  .hero-grid {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 3.5rem;
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  .closer-card {
    grid-template-columns: 1.4fr 1fr;
    padding: 2.5rem;
  }

  .closer-actions {
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .btn {
    transition: none;
  }
}
