/*
  The public pages' styles and the colors the console shares (design/server/console.md#console): dark by default,
  light on request, five accents. The console's MudBlazor theme uses the same values (ConsoleTheme), and its loading
  shell paints from these variables, so both look the same before and after the application starts. Every text and
  accent pair meets WCAG 2.2 AA contrast (4.5:1 for text). System fonts only: nothing is loaded from elsewhere.
*/
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1117;
  --surface: #171a23;
  --surface-2: #1e2230;
  --border: #2a2f3d;
  --text: #e8eaf0;
  --muted: #a3a9b8;
  --accent: #a5b4fc;
  --on-accent: #111827;
  --accent-soft: rgba(165, 180, 252, 0.14);
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"][data-accent="teal"] { --accent: #5eead4; --accent-soft: rgba(94, 234, 212, 0.14); }
[data-theme="dark"][data-accent="amber"] { --accent: #fcd34d; --accent-soft: rgba(252, 211, 77, 0.14); }
[data-theme="dark"][data-accent="rose"] { --accent: #fda4af; --accent-soft: rgba(253, 164, 175, 0.14); }
[data-theme="dark"][data-accent="slate"] { --accent: #cbd5e1; --accent-soft: rgba(203, 213, 225, 0.14); }

[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f1f3f7;
  --border: #d9dde5;
  --text: #111827;
  --muted: #4b5563;
  --accent: #4f46e5;
  --on-accent: #ffffff;
  --accent-soft: rgba(79, 70, 229, 0.1);
  --success: #15803d;
  --warning: #b45309;
  --danger: #b91c1c;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.06), 0 8px 24px rgba(17, 24, 39, 0.06);
}

[data-theme="light"][data-accent="teal"] { --accent: #0f766e; --accent-soft: rgba(15, 118, 110, 0.1); }
[data-theme="light"][data-accent="amber"] { --accent: #b45309; --accent-soft: rgba(180, 83, 9, 0.1); }
[data-theme="light"][data-accent="rose"] { --accent: #be123c; --accent-soft: rgba(190, 18, 60, 0.1); }
[data-theme="light"][data-accent="slate"] { --accent: #334155; --accent-soft: rgba(51, 65, 85, 0.1); }

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

main { flex: 1; outline: none; }

a { color: var(--accent); text-underline-offset: 2px; }

a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; }

h1 { font-size: clamp(1.8rem, 3vw + 1rem, 2.6rem); letter-spacing: -0.02em; }

h2 { font-size: 1.5rem; }

h3 { font-size: 1.1rem; }

code, pre { font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; }

.wrap { width: min(1180px, 100% - 2rem); margin-inline: auto; }

.narrow { width: min(560px, 100% - 2rem); padding-block: 3rem; }

.muted { color: var(--muted); }

.small { font-size: 0.875rem; }

.center { text-align: center; }

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

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; padding: 0.5rem 1rem; background: var(--accent); color: var(--on-accent); border-radius: 6px; }

.skip:focus { top: 1rem; }

/* Header and footer */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }

.header-row { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--text); font-weight: 650; text-decoration: none; }

.brand-mark { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }

.site-nav { display: flex; gap: 1.25rem; }

.site-nav a { color: var(--muted); text-decoration: none; font-weight: 500; }

.site-nav a:hover, .site-nav a.active { color: var(--text); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }

.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding-block: 1.5rem; }

.footer-row nav { display: flex; gap: 1rem; }

.footer-row a { color: var(--muted); }

/* Buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }

.button.large { padding: 0.75rem 1.4rem; font-size: 1.05rem; }

.button.primary { background: var(--accent); color: var(--on-accent); }

.button.primary:hover { filter: brightness(1.08); }

.button.ghost { color: var(--text); border-color: var(--border); background: transparent; }

.button.ghost:hover { background: var(--surface-2); }

.icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text); cursor: pointer; }

.icon-button svg { width: 20px; height: 20px; }

/* Cards and grids */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.5rem; box-shadow: var(--shadow); }

.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.notice { padding: 0.75rem 1rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); }

.notice.warning { border-color: color-mix(in srgb, var(--warning) 45%, transparent); }

ul.plain { list-style: none; margin: 0; padding: 0; }

ul.plain li + li { margin-top: 0.35rem; }

/* Welcome */
.hero { padding-block: clamp(3rem, 8vw, 6rem); background: radial-gradient(1200px 400px at 70% -10%, var(--accent-soft), transparent); }

.hero-row { display: grid; gap: 3rem; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; }

.eyebrow { color: var(--accent); font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; margin: 0 0 0.75rem; }

.lead { font-size: 1.15rem; color: var(--muted); max-width: 62ch; }

.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }

.center .cta { justify-content: center; }

.orbit { position: relative; aspect-ratio: 1; max-width: 360px; margin-inline: auto; border-radius: 50%; border: 1px dashed var(--border); }

.orbit .core, .orbit .node { position: absolute; display: grid; place-items: center; border-radius: 999px; font-weight: 600; font-size: 0.9rem; }

.orbit .core { inset: 32%; background: var(--accent); color: var(--on-accent); box-shadow: 0 0 60px var(--accent-soft); }

.orbit .node { padding: 0.4rem 0.8rem; background: var(--surface); border: 1px solid var(--border); }

.orbit .n1 { top: 4%; left: 12%; }

.orbit .n2 { top: 10%; right: -4%; }

.orbit .n3 { bottom: 8%; left: 2%; }

.orbit .n4 { bottom: 4%; right: 14%; }

.features, .steps { padding-block: 2.5rem; }

.feature h3 { color: var(--text); }

.feature p, .step p { color: var(--muted); margin: 0; }

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

.step { display: flex; gap: 1rem; align-items: flex-start; }

.step-number { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; }

/* Sign-in and status */
.signin h1 { margin-bottom: 0.25rem; }

.providers { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 0.75rem; }

.button.provider { width: 100%; justify-content: flex-start; background: var(--surface-2); border-color: var(--border); color: var(--text); }

.button.provider:hover { border-color: var(--accent); }

.provider-kind { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; font-weight: 700; }

.break-glass { font-size: 0.9rem; }

.status-line { display: flex; align-items: center; gap: 0.6rem; font-size: 1.2rem; }

.status-line .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--muted); }

.status-line.operational .dot { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 25%, transparent); }

.status-line.degraded .dot, .status-line.setup .dot { background: var(--warning); }

.status-line.unavailable .dot { background: var(--danger); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.5rem; margin: 1.25rem 0; }

.facts dt { color: var(--muted); }

.facts dd { margin: 0; font-weight: 600; }

.big-code { font-size: 4rem; font-weight: 800; color: var(--accent); margin: 0; line-height: 1; }

/* Help */
.help { display: grid; grid-template-columns: 260px minmax(0, 1fr) 200px; gap: 2rem; padding-block: 2rem; align-items: start; }

.help-nav, .help-toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; font-size: 0.93rem; }

.help-nav .filter { width: 100%; padding: 0.5rem 0.75rem; margin-bottom: 1rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }

.help-nav summary { cursor: pointer; font-weight: 600; padding: 0.35rem 0; }

.help-nav ul, .help-toc ul { list-style: none; margin: 0 0 0.75rem; padding: 0 0 0 0.75rem; border-left: 1px solid var(--border); }

.help-nav li a, .help-toc li a { display: block; padding: 0.2rem 0.5rem; color: var(--muted); text-decoration: none; border-radius: 6px; }

.help-nav li a:hover, .help-toc li a:hover { color: var(--text); background: var(--surface-2); }

.help-nav li a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.toc-title { font-weight: 600; margin: 0 0 0.5rem; }

.prose { max-width: 78ch; }

.prose h2 { margin-top: 2rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }

.prose pre { padding: 1rem; overflow: auto; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }

.prose :not(pre) > code { padding: 0.1rem 0.35rem; background: var(--surface-2); border-radius: 4px; }

.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.94rem; }

.prose th, .prose td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }

.prose blockquote { margin: 1rem 0; padding: 0.75rem 1rem; border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; }

.prose blockquote p { margin: 0; }

.prose img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); }

@media (max-width: 1080px) {
  .help { grid-template-columns: 240px minmax(0, 1fr); }
  .help-toc { display: none; }
}

@media (max-width: 760px) {
  .hero-row { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .help { grid-template-columns: 1fr; }
  .help-nav { position: static; max-height: none; }
  .site-nav { display: none; }
  .header-actions .ghost { display: none; }
}

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

/* Forms (the break-glass sign-in) */
.field { display: grid; gap: 0.35rem; margin-bottom: 1rem; }

.field label { font-weight: 600; }

.field input { font: inherit; padding: 0.65rem 0.8rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); }

.field input:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.field .hint { font-size: 0.85rem; color: var(--muted); }

.notice.error { border-color: color-mix(in srgb, var(--danger) 55%, transparent); color: var(--text); }

.button.block { width: 100%; }
