/*
 * Shell styling for the portal landing page and every page rendered from
 * content/*.md by build/render-content.mjs.
 *
 * Deliberately separate from app/sso-planner/styles.css. The planner is a
 * self-contained app that build/build.mjs also inlines into a single-file Claude
 * artifact; sharing a stylesheet across the two would either break that bundling
 * or drag the whole portal shell into the artifact. The design tokens below are
 * kept in step with the planner's by hand — there are few of them, and they change
 * rarely.
 */

:root {
  --bg: #f2f5f7;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --ink: #243139;
  --muted: #5b6b75;
  --faint: #8a98a2;
  --line: #dbe3e8;
  --line-strong: #c2d0d8;
  --accent: #0082c1;
  --accent-ink: #005487;
  --accent-wash: #e4f1f9;
  --shadow: 0 1px 2px rgba(0, 72, 120, .07), 0 6px 20px rgba(0, 72, 120, .07);
  --radius: 12px;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, Menlo, monospace;
  --sans: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1319;
    --surface: #111d25;
    --surface-2: #0e1820;
    --ink: #e5edf2;
    --muted: #94a6b1;
    --faint: #63757f;
    --line: #22333d;
    --line-strong: #33454f;
    --accent: #49a8e2;
    --accent-ink: #bfe0f4;
    --accent-wash: #0f2a3b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 var(--sans);
  -webkit-text-size-adjust: 100%;
}

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

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 8px;
  top: 8px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

/* ---------------------------------------------------------------- chrome */

.portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.portal-brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
}
.portal-brand span {
  font-weight: 400;
  color: var(--muted);
}

.portal-nav nav {
  display: flex;
  gap: 18px;
}
.portal-nav nav a {
  text-decoration: none;
  color: var(--muted);
}
.portal-nav nav a:hover {
  color: var(--accent);
}

.portal-footer {
  padding: 32px 24px;
  color: var(--faint);
  font-size: 14px;
  border-top: 1px solid var(--line);
  margin-top: 48px;
}

/* ---------------------------------------------------------------- landing */

.home {
  max-width: 940px;
  margin: 0 auto;
  padding: 56px 24px 0;
}

.home .eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.home h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.2;
}

.home .lede {
  margin: 0 0 40px;
  max-width: 62ch;
  font-size: 18px;
  color: var(--muted);
}

.cards {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  padding: 0;
  margin: 0;
  list-style: none;
}

.card {
  display: block;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}
.card:hover {
  border-color: var(--accent);
}

.card h2 {
  margin: 0 0 6px;
  font-size: 18px;
  color: var(--accent-ink);
}
.card p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.card[aria-disabled="true"] {
  opacity: .62;
  box-shadow: none;
}
.card[aria-disabled="true"]:hover {
  border-color: var(--line);
}

.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--faint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: 2px;
}

/* ---------------------------------------------------------------- rendered docs */

.doc {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 0;
}

.doc h1 { font-size: clamp(26px, 3.4vw, 34px); line-height: 1.22; margin: 0 0 18px; }
.doc h2 { font-size: 23px; margin: 44px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.doc h3 { font-size: 18px; margin: 30px 0 8px; }
.doc h4 { font-size: 16px; margin: 24px 0 6px; color: var(--muted); }

.doc p, .doc li { max-width: 72ch; }

.doc code {
  font: 13.5px/1.5 var(--mono);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

.doc pre {
  overflow-x: auto;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.doc pre code {
  background: none;
  border: 0;
  padding: 0;
}

.doc blockquote {
  margin: 20px 0;
  padding: 2px 18px;
  border-left: 3px solid var(--accent);
  background: var(--accent-wash);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Wide tables scroll inside their own wrapper rather than widening the page. */
.doc table {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 15px;
}
.doc th, .doc td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.doc th {
  background: var(--surface-2);
  white-space: nowrap;
}

.doc hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 36px 0;
}

.doc img { max-width: 100%; }
