/* Valar Scopes shared stylesheet, used by every page.
   Scope pages add their own styles in public/<scope>/<scope>.css. */

:root {
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-2: #eceee9;
  --text: #15191a;
  --muted: #545c60;
  --border: #d9ddd7;
  --accent: #0d6e38;
  --accent-hover: #0a5a2d;
  --on-accent: #ffffff;
  --link: #0d6e38;
  --badge-live-bg: #dcf3e4;
  --badge-live-text: #0a5a2d;
  --badge-dev-bg: #f3ead2;
  --badge-dev-text: #6b4e00;
  --focus: #1d5fd1;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 4px 16px rgb(0 0 0 / 0.05);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  --max: 1080px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0e0d;
    --surface: #131816;
    --surface-2: #1a201d;
    --text: #e7ece9;
    --muted: #a0aaa5;
    --border: #28312d;
    --accent: #4ade80;
    --accent-hover: #6ee79a;
    --on-accent: #062012;
    --link: #6ee79a;
    --badge-live-bg: #123321;
    --badge-live-text: #8cf0b1;
    --badge-dev-bg: #362b0e;
    --badge-dev-text: #f2d27a;
    --focus: #8ab4ff;
    --shadow: none;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

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

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

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 3vw, 3.25rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem);
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

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

@media (min-width: 720px) {
  :root {
    --gutter: 24px;
  }
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 10;
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.skip-link:focus {
  top: 8px;
}

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

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  min-height: 60px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

.brand__mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  padding: 6px 0;
}

.site-nav a:hover {
  color: var(--link);
  text-decoration: underline;
}

/* Main */
main {
  display: block;
}

.section {
  padding: 48px 0;
}

.section--tight {
  padding: 32px 0;
}

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

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

.lead {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  color: var(--muted);
  max-width: 40em;
}

.prose {
  max-width: 42em;
}

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

.small {
  font-size: 0.9rem;
}

/* Buttons */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

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

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

.btn--secondary {
  background: transparent;
  color: var(--link);
}

.btn--secondary:hover {
  background: var(--surface-2);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
}

.badge--live {
  background: var(--badge-live-bg);
  color: var(--badge-live-text);
}

.badge--dev {
  background: var(--badge-dev-bg);
  color: var(--badge-dev-text);
}

/* Cards */
.card-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  min-width: 0;
}

.card h2,
.card h3 {
  margin-top: 12px;
}

.card .btn-row {
  margin-top: auto;
  padding-top: 16px;
}

/* Round scope illustrations, used on cards */
.scope-art {
  display: block;
  width: 112px;
  height: 112px;
}

/* Footer */
.site-footer {
  margin-top: 48px;
  padding: 32px 0 40px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 16px;
}

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

.site-footer__credits,
.site-footer__copy {
  margin: 0 0 6px;
}

/* 404 */
.not-found {
  padding: 72px 0 24px;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
