/* Solo Website System (SWS) static sites stylesheet.
 * Pure semantic CSS, zero external requests, WCAG 2.2 Level AA/AAA contrast.
 */

:root {
  --bg: #FAF8F5;
  --surface: #FFFFFF;
  --surface-alt: #F2EDE4;
  --ink: #1C1917;
  --ink-muted: #524B45;
  --accent: #9A3412;
  --accent-hover: #7C2D12;
  --accent-soft: #FEF3C7;
  --badge-ok-bg: #ECFDF5;
  --badge-ok-ink: #166534;
  --border: #D6CFC4;
  --border-strong: #6E655D;
  --code-bg: #1C1917;
  --code-ink: #F5F5F4;
  --inline-code-bg: #EDE7DD;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --radius: 0.5rem;
  --max-width: 72rem;
  --measure: 68ch;
}

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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 100%;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
}

/* Accessible skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0.75rem;
  z-index: 1000;
  padding: 0.65rem 1rem;
  background: var(--ink);
  color: #FFFFFF;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.skip-link:focus {
  top: 0.75rem;
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

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

main:focus {
  outline: none;
}

a {
  color: var(--accent);
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1.5px;
}

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

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 3.8vw, 3rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.15rem;
  margin-top: 1.65rem;
  margin-bottom: 0.5rem;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

ul, ol {
  margin-top: 0;
  margin-bottom: 1rem;
  padding-left: 1.4rem;
}

li {
  margin-bottom: 0.35rem;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--inline-code-bg);
  color: var(--ink);
  padding: 0.12rem 0.35rem;
  border-radius: 0.25rem;
}

pre {
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.5;
  margin: 1rem 0 1.25rem;
  border: 1px solid #35302C;
}

pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 0.88rem;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 0.85rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  min-height: 44px;
}

.brand:hover {
  color: var(--accent);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.primary-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  background: var(--surface-alt);
  color: var(--accent);
}

/* Buttons & badges */
.eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  margin-bottom: 1rem;
}

.badge-ok {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--badge-ok-bg);
  color: var(--badge-ok-ink);
}

.badge-note {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #FFFFFF;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  background: var(--surface-alt);
  color: var(--accent-hover);
  border-color: var(--accent);
}

/* Landing sections */
.hero {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}

.hero-lead {
  font-size: 1.15rem;
  color: var(--ink-muted);
  max-width: var(--measure);
}

.section {
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--border);
}

.section-alt {
  background: var(--surface-alt);
}

.section > .container > h2:first-child {
  margin-top: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.section-intro {
  color: var(--ink-muted);
  max-width: var(--measure);
  margin-bottom: 1.5rem;
}

.section-footer-link {
  margin-top: 1.5rem;
  margin-bottom: 0;
}

.grid {
  display: grid;
  gap: 1.25rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
}

.card h3 {
  margin-top: 0;
}

.card h3 a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

.metric-title {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 0.35rem;
  color: var(--ink);
}

.metric-desc {
  font-size: 0.92rem;
  color: var(--ink-muted);
  margin-bottom: 0;
}

/* Callouts */
.callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-title {
  font-weight: 800;
  margin-bottom: 0.35rem;
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

th, td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

thead th {
  background: var(--surface-alt);
  font-weight: 700;
  color: var(--ink);
}

tbody tr:last-child td {
  border-bottom: none;
}

.download-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.25rem 0.75rem;
  border-radius: 0.375rem;
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
}

.download-link:hover {
  background: var(--accent-hover);
  color: #FFFFFF;
}

/* Docs layout */
.docs-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2rem 0 3rem;
  flex: 1;
}

@media (min-width: 56rem) {
  .docs-layout {
    grid-template-columns: 16.5rem minmax(0, 1fr);
    align-items: start;
  }
}

.docs-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.docs-sidebar-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 0 0 0.6rem 0.65rem;
}

.docs-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-nav-list li {
  margin-bottom: 0.2rem;
}

.docs-nav-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 0.65rem;
  border-radius: 0.375rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.docs-nav-list a:hover {
  background: var(--surface-alt);
  color: var(--accent);
}

.docs-nav-list a[aria-current="page"] {
  background: var(--accent);
  color: #FFFFFF;
  font-weight: 700;
}

.docs-content {
  min-width: 0;
  max-width: 52rem;
}

.docs-lead {
  font-size: 1.1rem;
  color: var(--ink-muted);
  margin-bottom: 1.5rem;
}

.doc-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.doc-pager a {
  display: inline-flex;
  flex-direction: column;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
}

.doc-pager a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.doc-pager-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-muted);
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  font-size: 0.92rem;
  color: var(--ink-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem 2rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--ink);
  font-weight: 600;
}

.footer-links a:hover {
  color: var(--accent);
}

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

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