/* ──────────────────────────────────────────────────────────────────────────
   getmonii.com — shared stylesheet for generated content pages.

   The three hand-written pages (index, privacy, support) inline their CSS
   because they predate this and each is a one-off. Content pages are the
   opposite case: there will be a lot of them and they are all the same shape,
   so one cached stylesheet beats inlining the same 8 KB on every page.

   Tokens are the same ones in packages/shared/src/tokens.ts and the rest of
   the site. Keep them in sync by hand — there is no build step wiring them
   together, and inventing one for a static site is not worth it.
   ────────────────────────────────────────────────────────────────────────── */

:root {
  --bg: #08080a;
  --panel: #0E0E10;
  --panel-raised: #121214;
  --hairline: rgba(255, 255, 255, 0.07);
  --hairline-strong: rgba(255, 255, 255, 0.12);
  --text: #EDEDED;
  --dim: #8B8B8B;
  --faint: #5A5A5A;
  --green: #4ADE80;
  --teal: #00C7B7;
  --amber: #FFB020;
  --red: #FF453A;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: Inter, -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  /* Anchor links land under the sticky nav rather than behind it. */
  scroll-padding-top: 84px;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

body {
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(74, 222, 128, 0.05), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--green); color: #000; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 560px) { .wrap { padding: 0 20px; } }

/* ── Nav ─────────────────────────────────────────────────────────────── */

nav {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(8, 8, 10, 0.86);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; }
.mark { width: 20px; height: 20px; position: relative; flex-shrink: 0; }
.mark::before { content: ''; position: absolute; inset: 0; border: 1.5px solid var(--text); }
.mark::after { content: ''; position: absolute; inset: 6px; background: var(--green); }
.wordmark {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  font-weight: 500;
}
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-link {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--dim);
  text-transform: uppercase;
}
.nav-link:hover { color: var(--text); }
.nav-cta {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  color: #000;
  padding: 9px 15px;
}
.nav-cta:hover { background: var(--text); }
@media (max-width: 640px) { .nav-links .nav-link { display: none; } }

/* ── Breadcrumbs ─────────────────────────────────────────────────────── */

.crumbs {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 26px 0 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.crumbs a { color: var(--dim); }
.crumbs a:hover { color: var(--text); }

/* ── Article header ──────────────────────────────────────────────────── */

.doc-head { padding: 26px 0 34px; max-width: 46rem; }
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.eyebrow::before {
  content: '';
  width: 7px; height: 7px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
}
h1 {
  font-family: var(--sans);
  font-size: clamp(32px, 5vw, 46px);
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.06;
  margin-bottom: 18px;
}
.lead {
  font-size: 18px;
  color: var(--dim);
  line-height: 1.62;
  max-width: 62ch;
}
.byline {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 22px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.byline span:not(:last-child)::after { content: ' ·'; color: var(--hairline-strong); }

/* ── Layout: article + sidebar ───────────────────────────────────────── */

.doc-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 56px;
  align-items: start;
  padding-bottom: 80px;
}
@media (max-width: 940px) {
  .doc-body { grid-template-columns: 1fr; gap: 40px; }
  .sidebar { order: -1; position: static !important; }
}

article { max-width: 46rem; min-width: 0; }

/* ── Article typography ──────────────────────────────────────────────── */

article h2 {
  font-family: var(--sans);
  font-size: 27px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 52px 0 16px;
  padding-top: 22px;
  border-top: 1px solid var(--hairline);
  scroll-margin-top: 84px;
}
article h2:first-child { margin-top: 0; border-top: none; padding-top: 0; }
article h3 {
  font-family: var(--sans);
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.012em;
  margin: 32px 0 10px;
  scroll-margin-top: 84px;
}
article h4 {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 26px 0 8px;
}
article p { font-size: 16.5px; line-height: 1.72; margin-bottom: 18px; }
article ul, article ol { margin: 0 0 18px; padding-left: 24px; }
article li { font-size: 16.5px; line-height: 1.72; margin: 8px 0; }
article li::marker { color: var(--faint); }
article ul li::marker { color: var(--green); }
article strong { font-weight: 650; color: #fff; }
article em { color: var(--dim); font-style: italic; }
article hr { border: none; border-top: 1px solid var(--hairline); margin: 44px 0; }

article a:not(.btn) {
  color: var(--green);
  border-bottom: 1px solid rgba(74, 222, 128, 0.35);
}
article a:not(.btn):hover { border-bottom-color: var(--green); }

article blockquote {
  border-left: 2px solid var(--green);
  padding: 4px 0 4px 22px;
  margin: 26px 0;
  color: var(--dim);
  font-size: 16.5px;
}
article blockquote p:last-child { margin-bottom: 0; }

article code {
  font-family: var(--mono);
  font-size: 0.87em;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  color: #d6d6d6;
  overflow-wrap: break-word;
}
article pre {
  background: var(--panel);
  border: 1px solid var(--hairline);
  padding: 18px 20px;
  margin: 22px 0;
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.65;
}
article pre code { background: none; padding: 0; font-size: inherit; color: #cfcfcf; }

/* Tables scroll inside their own box rather than pushing the page sideways. */
.table-scroll { overflow-x: auto; margin: 22px 0 28px; }
article table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 30rem; }
article th, article td {
  text-align: left;
  padding: 12px 14px;
  border-top: 1px solid var(--hairline);
  vertical-align: top;
}
article th {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 500;
  border-top: none;
  border-bottom: 1px solid var(--hairline-strong);
  white-space: nowrap;
}

article img { max-width: 100%; height: auto; display: block; margin: 26px 0; }

/* Heading anchor links — visible on hover, invisible to the reading eye. */
.anchor {
  color: var(--faint) !important;
  border: none !important;
  margin-left: 8px;
  opacity: 0;
  font-weight: 400;
  transition: opacity 120ms;
}
h2:hover .anchor, h3:hover .anchor { opacity: 1; }

/* ── Callouts ────────────────────────────────────────────────────────── */

.callout {
  border: 1px solid var(--hairline-strong);
  border-left-width: 2px;
  background: var(--panel);
  padding: 18px 20px;
  margin: 26px 0;
}
.callout-label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.callout p:last-child { margin-bottom: 0; }
.callout.note { border-left-color: var(--green); }
.callout.note .callout-label { color: var(--green); }
.callout.warn { border-left-color: var(--amber); }
.callout.warn .callout-label { color: var(--amber); }
.callout.danger { border-left-color: var(--red); }
.callout.danger .callout-label { color: var(--red); }

/* ── Key-facts box (the answer, above the fold) ──────────────────────── */

.answer-box {
  border: 1px solid rgba(74, 222, 128, 0.22);
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.06), rgba(74, 222, 128, 0.01));
  padding: 22px 24px;
  margin: 0 0 40px;
}
.answer-box .callout-label { color: var(--green); }
.answer-box p:last-child, .answer-box ul:last-child { margin-bottom: 0; }

/* ── Sidebar ─────────────────────────────────────────────────────────── */

.sidebar { position: sticky; top: 84px; font-size: 13.5px; }
.side-block { margin-bottom: 34px; }
.side-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--hairline);
}
.toc a {
  display: block;
  color: var(--dim);
  padding: 5px 0;
  line-height: 1.45;
  border-left: 1px solid var(--hairline);
  padding-left: 13px;
  margin-left: -1px;
}
.toc a:hover { color: var(--text); border-left-color: var(--green); }
.toc a.lvl-3 { padding-left: 26px; font-size: 12.5px; }

.side-card {
  border: 1px solid var(--hairline-strong);
  background: var(--panel);
  padding: 18px;
}
.side-card-title { font-weight: 650; margin-bottom: 8px; letter-spacing: -0.01em; }
.side-card p { color: var(--dim); font-size: 13px; line-height: 1.55; margin-bottom: 14px; }
.btn {
  display: block;
  text-align: center;
  background: #fff;
  color: #000;
  font-weight: 600;
  font-size: 13.5px;
  padding: 11px 14px;
}
.btn:hover { background: var(--text); }
.btn.ghost {
  background: none;
  color: var(--text);
  border: 1px solid var(--hairline-strong);
  margin-top: 8px;
}
.btn.ghost:hover { background: var(--panel-raised); border-color: var(--dim); }

.related a {
  display: block;
  color: var(--dim);
  padding: 8px 0;
  line-height: 1.45;
  border-bottom: 1px solid var(--hairline);
}
.related a:last-child { border-bottom: none; }
.related a:hover { color: var(--text); }

/* ── End-of-article CTA ──────────────────────────────────────────────── */

.end-cta {
  border: 1px solid var(--hairline-strong);
  background: linear-gradient(180deg, var(--panel-raised), var(--panel));
  padding: 30px 32px;
  margin: 56px 0 0;
}
.end-cta h2 {
  border: none !important;
  padding-top: 0 !important;
  margin: 0 0 10px !important;
  font-size: 23px;
}
.end-cta p { color: var(--dim); margin-bottom: 20px; max-width: 46ch; }
.end-cta .btn { display: inline-block; padding: 12px 22px; }

/* ── FAQ ─────────────────────────────────────────────────────────────── */

.faq-item { border-top: 1px solid var(--hairline); padding: 22px 0; }
.faq-item h3 { margin: 0 0 10px; font-size: 17px; }
.faq-item p:last-child { margin-bottom: 0; }

/* ── Index / hub pages ───────────────────────────────────────────────── */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin: 24px 0 48px;
}
.card {
  border: 1px solid var(--hairline);
  background: var(--panel);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 160ms, background 160ms;
}
.card:hover { border-color: var(--hairline-strong); background: var(--panel-raised); }
.card-kicker {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--green);
}
.card-title { font-weight: 650; font-size: 16px; letter-spacing: -0.012em; line-height: 1.3; }
.card-desc { color: var(--dim); font-size: 14px; line-height: 1.55; }

/* ── Footer ──────────────────────────────────────────────────────────── */

footer {
  border-top: 1px solid var(--hairline);
  padding: 40px 0 64px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.04em;
}
footer .links { display: flex; gap: 22px; flex-wrap: wrap; }
footer a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ── Calculators and interactive tools ───────────────────────────────── */

.calc {
  border: 1px solid var(--hairline-strong);
  background: var(--panel);
  padding: 22px;
  margin: 28px 0;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.calc label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}
.calc input {
  background: var(--bg);
  border: 1px solid var(--hairline-strong);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  padding: 10px 12px;
  width: 100%;
  border-radius: 0;
}
.calc input:focus { outline: none; border-color: var(--green); }
.calc-out {
  border-top: 1px solid var(--hairline);
  padding-top: 20px;
  margin-top: 6px;
}
.calc-headline {
  font-family: var(--sans);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.calc-headline.ok { color: var(--green); }
.calc-headline.warn { color: var(--amber); }
.calc-headline.bad { color: var(--red); }
.calc-sub {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
  letter-spacing: 0.06em;
  margin-top: 6px;
}
.calc-verdict {
  font-size: 15.5px !important;
  color: var(--text);
  margin: 16px 0 20px !important;
  max-width: 52ch;
}
.calc-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}
.calc-list {
  list-style: none;
  padding: 0 !important;
  margin: 0 !important;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}
.calc-list li {
  font-family: var(--mono);
  font-size: 13.5px;
  color: var(--text);
  border: 1px solid var(--hairline);
  padding: 10px 12px;
  margin: 0 !important;
}
.calc-list li::marker { content: none; }
