/* Orbit public pages. Colours come from the app itself:
   apps/frontend/src/app/orbit/orbit.scss (--orbit-* tokens, dark and .light)
   and apps/frontend/src/app/(app)/auth/orbit-auth.scss (#030506 sign-in black).
   No web fonts, no scripts, nothing loaded from other sites (the CSP in _headers
   allows only this stylesheet and same-site images). No inline style attributes
   anywhere: the CSP would block them. */

:root {
  color-scheme: dark light;
  --bg: #07090a;
  --bg-deep: #030506;
  --surface: #101315;
  --surface-2: #161a1d;
  --border: #232b31;
  --fg: #f2f5f4;
  --muted: #9aa4a1;
  --link: #79f96a;        /* 14.8:1 on --bg */
  --mark: #79f96a;
  --letters: #ffffff;
  --focus: #79f96a;
  --accent-edge: #79f96a;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f7f6;
    --bg-deep: #eef1f0;
    --surface: #ffffff;
    --surface-2: #eef1f0;
    --border: #d9dfdc;
    --fg: #0a0d0c;
    --muted: #58615d;     /* 5.95:1 on --bg */
    --link: #1a6e10;      /* 5.95:1 on --bg; the app's #279e1a is 3.3:1, too light for text */
    --mark: #279e1a;
    --letters: #0a0d0c;
    --focus: #1a6e10;
    --accent-edge: #279e1a;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  background: var(--surface);
  color: var(--fg);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

header.site, main, footer.site {
  width: 100%;
  max-width: 46rem;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding-top: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.brand { display: inline-flex; line-height: 0; border-radius: 6px; }
.wordmark { height: 28px; width: auto; display: block; }
.wm-mark { fill: var(--mark); }
.wm-letters { fill: var(--letters); }

nav { display: flex; flex-wrap: wrap; gap: 4px 6px; }
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  padding: 6px 10px;
  border-radius: 999px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
}
nav a:hover { color: var(--fg); background: var(--surface); }
nav a[aria-current="page"] { color: var(--fg); background: var(--surface-2); }

main { padding-top: 32px; padding-bottom: 40px; }

h1 {
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}
h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 40px 0 10px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
h3 { font-size: 1.0625rem; margin: 28px 0 8px; }

p, ul, ol, dl { margin: 0 0 14px; }
ul, ol { padding-left: 1.25rem; }
li { margin: 0 0 8px; }
li::marker { color: var(--muted); }

.meta { color: var(--muted); font-size: 0.9375rem; margin-bottom: 20px; }
.lead { font-size: 1.1875rem; line-height: 1.5; }

a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, nav a:focus-visible, .brand:focus-visible, .cards a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.email { overflow-wrap: anywhere; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 5px;
  overflow-wrap: anywhere;
}

.summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-edge);
  border-radius: 12px;
  padding: 4px 18px 6px;
  margin: 24px 0 8px;
}
.summary h2 { border-top: 0; padding-top: 0; margin: 14px 0 8px; font-size: 1.0625rem; }

.perms { margin: 0 0 14px; }
.perms dt { margin: 14px 0 4px; font-weight: 600; }
.perms dd { margin: 0; color: var(--fg); padding-left: 0; }
@media (min-width: 720px) {
  .perms {
    display: grid;
    grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
    gap: 12px 20px;
  }
  .perms dt, .perms dd { margin: 0; }
}

.steps { padding-left: 1.5rem; }

.cards { list-style: none; padding: 0; display: grid; gap: 12px; margin: 24px 0; }
.cards li { margin: 0; }
.cards a {
  display: block;
  text-decoration: none;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}
.cards a:hover { border-color: var(--accent-edge); }
.cards strong { display: block; color: var(--link); font-size: 1.0625rem; }
.cards span { display: block; color: var(--muted); font-size: 0.9375rem; margin-top: 2px; }

footer.site {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  padding-bottom: 40px;
  color: var(--muted);
  font-size: 0.9375rem;
}
footer.site p { margin: 0 0 8px; }

@media (max-width: 480px) {
  body { font-size: 1rem; }
  h1 { font-size: 1.625rem; }
  .lead { font-size: 1.0625rem; }
  header.site { padding-top: 16px; }
  main { padding-top: 24px; }
}

@media print {
  nav, .skip { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; }
}
