/* cometpost.app — hand-written stylesheet, no framework, no runtime CDN. */

:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --bg-alt: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f2f4fa;
  --text: #10121a;
  --text-muted: #545a70;
  --border: #e2e6f0;
  --border-strong: #cdd3e4;
  --accent: #4f46e5;
  --accent-hover: #4038cc;
  --accent-ink: #ffffff;
  --accent-soft: #eef0ff;
  --accent-2: #0e7490;
  --focus: #4f46e5;
  --shadow: 0 1px 2px rgba(16, 18, 26, .04), 0 8px 24px rgba(16, 18, 26, .06);

  --maxw: 68rem;
  --maxw-prose: 46rem;
  --radius: 12px;
  --radius-lg: 18px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d14;
    --bg-alt: #0f121b;
    --surface: #12151f;
    --surface-2: #171b28;
    --text: #e9ebf2;
    --text-muted: #a2a9c0;
    --border: #232838;
    --border-strong: #323950;
    --accent: #9b9cff;
    --accent-hover: #b3b4ff;
    --accent-ink: #0b0d14;
    --accent-soft: #1a1d33;
    --accent-2: #67e8f9;
    --focus: #9b9cff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  font-weight: 650;
}

h1 { font-size: clamp(2rem, 5.5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.125rem); }
h3 { font-size: clamp(1.125rem, 2.2vw, 1.3125rem); }
h4 { font-size: 1.0625rem; }

p, ul, ol, dl, table { margin: 0 0 1rem; }
ul, ol { padding-left: 1.25rem; }
li { margin-bottom: .35rem; }

a {
  color: var(--accent);
  text-underline-offset: .18em;
  text-decoration-thickness: from-font;
}
a:hover { color: var(--accent-hover); }

:where(a, button, input, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

code, kbd, pre { font-family: var(--font-mono); font-size: .9em; }
code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: .1em .35em;
}

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ---------- layout ---------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: .65rem 1rem;
  z-index: 100;
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus {
  left: 0;
  color: var(--accent-ink);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  flex-wrap: wrap;
  padding-block: .6rem;
}

/* On small screens the nav wraps to two rows; a sticky header would then eat a
   sixth of the viewport, so let it scroll away instead. */
@media (max-width: 40rem) {
  .site-header { position: static; }
  html { scroll-padding-top: 1rem; }
  section, .toc { scroll-margin-top: 1rem; }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 680;
  font-size: 1.0625rem;
  letter-spacing: -.02em;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}
.brand:hover { color: var(--text); }
.brand svg { display: block; }

.nav {
  display: flex;
  align-items: center;
  gap: .35rem 1.15rem;
  flex-wrap: wrap;
  font-size: .9375rem;
}
.nav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: .25rem 0;
}
.nav a:hover { color: var(--text); text-decoration: underline; }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  padding: .7rem 1.15rem;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }

/* ---------- badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .01em;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.badge .dot {
  width: .45rem;
  height: .45rem;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* ---------- sections ---------- */

section { scroll-margin-top: 5rem; }

.section {
  padding-block: clamp(3rem, 7vw, 5.25rem);
  border-top: 1px solid var(--border);
}
.section-alt { background: var(--bg-alt); }
.section > .wrap > :last-child { margin-bottom: 0; }

.section-head { max-width: var(--maxw-prose); margin-bottom: 2.5rem; }
.section-head p { color: var(--text-muted); font-size: 1.0625rem; margin-bottom: 0; }
.eyebrow {
  display: block;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .5rem;
}

/* ---------- hero ---------- */

.hero {
  padding-block: clamp(3rem, 9vw, 6rem);
  background:
    radial-gradient(60rem 30rem at 78% -12%, var(--accent-soft), transparent 65%);
}
.hero .lede {
  font-size: clamp(1.0625rem, 2.1vw, 1.25rem);
  color: var(--text-muted);
  max-width: 40rem;
}
.hero-inner { max-width: 46rem; }
.hero h1 { margin-top: 1rem; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.5rem;
}

/* ---------- grids ---------- */

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .4rem; }
.card p:last-child { margin-bottom: 0; }
.card p { color: var(--text-muted); }

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: .9rem;
}

/* ---------- steps ---------- */

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  counter-reset: step;
}
.steps > li {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 0;
  box-shadow: var(--shadow);
}
.steps > li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: .9375rem;
  margin-bottom: .9rem;
}
.steps h3 { font-size: 1.0625rem; }
.steps p { color: var(--text-muted); margin-bottom: 0; }

/* ---------- platform list ---------- */

.platforms {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}
.platforms li {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 0;
}
.platforms .p-name { font-weight: 640; display: block; }
.platforms .p-note { color: var(--text-muted); font-size: .875rem; }
.platforms svg { flex: none; margin-top: .15rem; color: var(--text-muted); }

/* ---------- checklist ---------- */

.checklist { list-style: none; padding: 0; margin: 0 0 1rem; }
.checklist li {
  position: relative;
  padding-left: 1.7rem;
  margin-bottom: .55rem;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .5em;
  width: .75rem;
  height: .4rem;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}
.checklist.no li::before {
  transform: none;
  top: .62em;
  width: .8rem;
  height: 0;
  border-left: 0;
  border-bottom: 2px solid var(--text-muted);
}

.form-note { font-size: .875rem; color: var(--text-muted); max-width: 32rem; }

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

.faq { max-width: var(--maxw-prose); }
.faq details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0 1.1rem;
  margin-bottom: .6rem;
}
.faq summary {
  cursor: pointer;
  font-weight: 620;
  padding: .95rem 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-weight: 400;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--text-muted);
  flex: none;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details > *:not(summary) { margin-bottom: 1rem; color: var(--text-muted); }

/* ---------- legal / prose pages ---------- */

.doc { padding-block: clamp(2.5rem, 6vw, 4rem); }
.doc-head { max-width: var(--maxw-prose); margin-bottom: 2rem; }
.doc-meta {
  color: var(--text-muted);
  font-size: .9375rem;
  margin-bottom: 0;
}

.doc-layout {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr;
  align-items: start;
}
@media (min-width: 60rem) {
  .doc-layout { grid-template-columns: 16rem minmax(0, 1fr); gap: 3rem; }
  .toc { position: sticky; top: 5.5rem; }
}

.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.35rem;
  font-size: .9375rem;
}
.toc h2 {
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: .75rem;
}
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { margin-bottom: .4rem; counter-increment: toc; }
.toc li::before {
  content: counter(toc) ".";
  color: var(--text-muted);
  margin-right: .4rem;
  font-variant-numeric: tabular-nums;
}
.toc a { color: var(--text-muted); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

.prose { max-width: var(--maxw-prose); }
.prose h2 {
  font-size: 1.375rem;
  margin-top: 2.75rem;
  padding-top: .5rem;
}
.prose > h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.0625rem; margin-top: 1.75rem; }
.prose li { margin-bottom: .5rem; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9375rem;
}
.prose th, .prose td {
  text-align: left;
  vertical-align: top;
  padding: .6rem .75rem;
  border: 1px solid var(--border);
}
.prose th { background: var(--surface-2); font-weight: 640; }
.table-scroll { overflow-x: auto; margin-bottom: 1rem; }

.callout {
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1.5rem 0;
}
.callout > :last-child { margin-bottom: 0; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding-block: 2.75rem 2rem;
  font-size: .9375rem;
}
.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  margin-bottom: 2rem;
}
.site-footer h2 {
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin-bottom: .75rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .45rem; }
.site-footer a { color: var(--text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  color: var(--text-muted);
}
.footer-bottom p { margin-bottom: .35rem; }
.footer-bottom p:last-child { margin-bottom: 0; }
