/* SPDX-License-Identifier: Apache-2.0 */
/* Copyright 2026 Epic Digital Interactive Media LLC */

/* SAGA Standard — spec site styles */

:root {
  --bg: #fafafa;
  --bg-code: #f4f4f5;
  --text: #18181b;
  --text-muted: #71717a;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --border: #e4e4e7;
  --sidebar-w: 280px;
  --header-h: 64px;
  --max-content: 860px;
  --mono: 'SF Mono', 'Fira Code', 'Fira Mono', Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --bg-code: #18181b;
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --accent: #3b82f6;
    --accent-hover: #60a5fa;
    --border: #27272a;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  z-index: 100;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
}

.site-header .logo {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-header .logo span {
  color: var(--accent);
}

.site-header nav {
  margin-left: auto;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.site-header nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}

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

.site-header nav a.gh-link {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

/* Layout */
.page-wrapper {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* Sidebar (spec page only) */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  font-size: 0.8125rem;
  background: var(--bg);
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.sidebar ul {
  list-style: none;
}

.sidebar > ul > li {
  margin-bottom: 0.25rem;
}

.sidebar a {
  display: block;
  padding: 0.25rem 0.5rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.15s;
  line-height: 1.4;
}

.sidebar a:hover {
  color: var(--text);
  background: var(--bg-code);
}

.sidebar .section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0.75rem 0.5rem 0.25rem;
}

/* Main content */
.content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2.5rem 3rem 4rem;
  max-width: calc(var(--max-content) + var(--sidebar-w) + 6rem);
}

.content-full {
  margin-left: 0;
  max-width: var(--max-content);
  margin-inline: auto;
  padding: 2.5rem 2rem 4rem;
}

/* Typography */
h1,
h2,
h3,
h4,
h5 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}
h2 {
  font-size: 1.5rem;
  margin: 2.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
h3 {
  font-size: 1.125rem;
  margin: 1.5rem 0 0.75rem;
}
h4 {
  font-size: 1rem;
  margin: 1.25rem 0 0.5rem;
}

.content h2:first-of-type {
  border-top: none;
  padding-top: 0;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

strong {
  font-weight: 600;
}

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-code);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
}

pre {
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.8125rem;
  line-height: 1.6;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1rem 0 1.5rem;
  color: var(--text-muted);
}

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

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

th,
td {
  text-align: left;
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Lists */
ul,
ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}
li {
  margin-bottom: 0.25rem;
}
li > ul,
li > ol {
  margin-bottom: 0;
  margin-top: 0.25rem;
}

/* Hero */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.75rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.hero .tagline {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.5;
}

.hero .badges {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.hero .badges img {
  height: 22px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.5rem;
  border-radius: 6px;
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
}

.btn-secondary {
  background: var(--bg-code);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--text-muted);
  text-decoration: none;
}

/* Feature grid */
.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 2rem 0 3rem;
}

.feature {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.feature h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.feature p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.site-footer a {
  color: var(--text-muted);
}
.site-footer a:hover {
  color: var(--text);
}

/* Mobile */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .content {
    margin-left: 0;
    padding: 1.5rem 1rem 3rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero .tagline {
    font-size: 1rem;
  }
  .features {
    grid-template-columns: 1fr;
  }
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
}
