/* Duodecimal root site — shared stylesheet (m48).
   Tokens mirror the app's design system (dashboard/frontend/src/index.css
   @theme block). Keep the two in sync by hand — this site has no build step. */

:root {
  --surface: #0a0a0a;
  --card: #141414;
  --card-hover: #1a1a1a;
  --border: #262626;
  --border-emphasis: #333333;
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --text-muted: #737373;
  --accent: #0693e3;
  --accent-hover: #0574b8;
  --positive: #22c55e;
  --negative: #ef4444;
  /* Deterministic stacks (mirrored in the app's index.css @theme):
     concrete faces first, generic keyword unreachable on any normally-
     equipped system. ui-sans-serif / ui-monospace / system-ui are banned
     — they resolve to whatever fontconfig prefers locally, un-pinning
     the design. Mono is the product's second voice: data, labels,
     dates. Never for body prose. */
  --font-sans: "Noto Sans", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Liberation Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Noto Color Emoji";
  --font-mono: "IBM Plex Mono", "SF Mono", SFMono-Regular, Menlo, Consolas,
    "DejaVu Sans Mono", "Liberation Mono", "Noto Sans Mono", monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.container { max-width: 72rem; margin: 0 auto; padding: 0 1.25rem; }
.narrow { max-width: 46rem; }

/* ---- header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}
.site-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 3.5rem;
}
.site-header .left { display: flex; align-items: center; gap: 1.5rem; }
.site-header .logo img { height: 2rem; display: block; }
.site-header .left nav { display: flex; gap: 0.25rem; }
.site-header .left nav a {
  padding: 0.375rem 0.75rem; border-radius: 0.375rem;
  font-size: 0.875rem; font-weight: 500;
  color: var(--text-muted); transition: color .15s, background .15s;
}
.site-header .left nav a:hover { color: var(--text-primary); background: var(--card-hover); }
.site-header .right { display: flex; align-items: center; gap: 0.5rem; }

/* ---- mobile disclosure menu (m48d) — CSS-only <details>, shown <640px ---- */
.mobile-nav { display: none; position: relative; }
.mobile-nav summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border-radius: 0.5rem;
  color: var(--text-secondary); transition: color .15s, background .15s;
}
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary:hover,
.mobile-nav[open] summary { color: var(--text-primary); background: var(--card-hover); }
.mobile-nav summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mobile-nav summary svg { width: 1.375rem; height: 1.375rem; display: block; }
.mobile-nav nav {
  position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 60;
  min-width: 12.5rem; padding: 0.375rem;
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border); border-radius: 0.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}
.mobile-nav nav a {
  display: block; padding: 0.625rem 0.875rem; border-radius: 0.375rem;
  font-size: 0.9375rem; font-weight: 500;
  color: var(--text-secondary); transition: color .15s, background .15s;
}
.mobile-nav nav a:hover { color: var(--text-primary); background: var(--card-hover); }
.btn {
  display: inline-block;
  padding: 0.45rem 1rem; border-radius: 0.5rem;
  font-size: 0.875rem; font-weight: 600;
  background: var(--accent); color: #fff;
  transition: background .15s;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border-emphasis);
}
.btn-ghost:hover { background: var(--card-hover); color: var(--text-primary); }

/* ---- home underlay (index.html only) ----
   Static data-mesh image behind the first fold. Sits above the body
   surface but below all content (negative z-index child); a scrim keeps
   hero text contrast and a mask dissolves it into --surface so the
   lower sections stay quiet. No animation, no fixed attachment. */
.home-underlay {
  position: absolute; top: 0; left: 0; right: 0; height: 130vh;
  z-index: -1; pointer-events: none;
  background:
    linear-gradient(rgba(10, 10, 10, 0.35), rgba(10, 10, 10, 0.35)),
    url(/assets/home-bg.webp) center top / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 55%, transparent 100%);
}

/* ---- hero ---- */
.hero { padding: 6rem 0 4.5rem; }
.hero h1 {
  margin: 0 0 1rem; max-width: 46rem;
  font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1.12;
  font-weight: 700; letter-spacing: -0.02em; text-wrap: balance;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.hero .sub {
  max-width: 40rem; margin: 0 0 2rem;
  color: var(--text-secondary); font-size: 1.0625rem;
}
.cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }


/* ---- sections ---- */
section { padding: 3.5rem 0; }
section + section { border-top: 1px solid var(--border); }
h2.section-title {
  margin: 0 0 0.5rem; font-size: 1.5rem; font-weight: 700;
  letter-spacing: -0.01em;
}
.section-sub { margin: 0 0 2rem; color: var(--text-secondary); max-width: 40rem; }

.grid { display: grid; gap: 1rem; }
@media (min-width: 720px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.25rem;
}
.card h3 { margin: 0 0 0.375rem; font-size: 1rem; font-weight: 600; }
.card p { margin: 0; font-size: 0.875rem; color: var(--text-secondary); }
.card .tag {
  display: inline-block; margin-bottom: 0.625rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted);
}
.card .tag.free { color: var(--positive); }
.card-link { display: inline-block; margin-top: 0.75rem; font-size: 0.8125rem; font-weight: 500; }

/* ---- prose pages (terms / privacy) ---- */
.prose { padding: 3rem 0 4rem; }
.prose h2 { font-size: 1.75rem; margin: 0 0 1.5rem; letter-spacing: -0.01em; }
.prose h3, .prose h4, .prose h5 {
  margin: 2rem 0 0.5rem; font-size: 1.0625rem; font-weight: 600;
}
.prose p, .prose li { color: var(--text-secondary); font-size: 0.9375rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin: 0.25rem 0; }

/* ---- footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  font-size: 0.8125rem; color: var(--text-muted);
}
.site-footer .rows {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.site-footer nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--text-primary); }

@media (max-width: 640px) {
  .site-header .left nav { display: none; }
  .mobile-nav { display: block; }
  .hero { padding: 4rem 0 3rem; }
}
