/* Sprauncy theme */
:root {
  --bg: #1e0a38;
  --bg-elevated: #2d0a4e;
  --fg: #00ced1;
  --fg-muted: #bb88ff;
  --accent: #ff1493;
  --accent-hover: #ff0;
  --code-bg: #2d0a4e;
  --border: #ff1493;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Dark theme */
:root[data-theme="dark"],
:root:has(#theme-dark:checked) {
  --bg: #0d0d0d;
  --bg-elevated: #1a1a1a;
  --fg: #9acada;
  --fg-muted: #808080;
  --accent: #6ba353;
  --accent-hover: #b8923d;
  --code-bg: #252525;
  --border: #333;
}

/* Light theme */
:root[data-theme="light"],
:root:has(#theme-light:checked) {
  --bg: #e8e8e8;
  --bg-elevated: #f1f1f1;
  --fg: #4a7b8a;
  --fg-muted: #808080;
  --accent: #6ba353;
  --accent-hover: #8a6a28;
  --code-bg: #d0d0d0;
  --border: #bbb;
}

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

html {
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

main {
  margin: 0 auto;
  max-width: 45rem;
  padding: 2rem 1.5rem;
}

h1, h2 {
  color: var(--accent);
  font-weight: 600;
}

h1 {
  font-size: 3rem;
  letter-spacing: 0.1em;
  margin: 0;
  text-transform: uppercase;
}

.tagline {
  color: var(--fg-muted);
  font-size: 1.125rem;
  margin: 0.5rem 0 0;
}

h2 {
  border-bottom: 1px solid var(--border);
  font-size: 1.25rem;
  margin: 3rem 0 1rem;
  padding-bottom: 0.5rem;
}

p {
  margin: 1rem 0;
}

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

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

ul {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

li {
  margin: 0.5rem 0;
}

dl {
  display: grid;
  gap: 0.5rem 1rem;
  grid-template-columns: auto 1fr;
  margin: 1rem 0;
}

dt {
  color: var(--accent);
  font-weight: 600;
}

dd {
  color: var(--fg-muted);
  margin: 0;
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow-x: auto;
  padding: 1rem;
}

code {
  background: var(--code-bg);
  border-radius: 2px;
  font-size: 0.9em;
  padding: 0.125em 0.375em;
}

pre code {
  background: none;
  padding: 0;
}

kbd {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.9em;
  padding: 0.125em 0.5em;
}

video,
img {
  border: 1px solid var(--border);
  border-radius: 4px;
  display: block;
  height: auto;
  max-width: 100%;
}

video {
  width: 100%;
}

#demo {
  margin: 2rem 0;
}

header,
.error-page {
  text-align: center;
}

footer {
  color: var(--fg-muted);
  font-size: 0.875rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  text-align: center;
}

body, main, pre, code, kbd, video, img, footer, h2 {
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

#source-link {
  display: flex;
  position: fixed;
  right: calc(1rem + 5rem + 1rem);
  top: 1rem;
}

#source-link:hover,
#source-link:focus {
  opacity: 0.7;
}

#theme-indicator {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--fg-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  min-width: 5rem;
  padding: 0.25rem 0.5rem;
  position: fixed;
  right: 1rem;
  text-align: center;
  top: 1rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

#theme-indicator.preview-sprauncy {
  background: #2d0a4e;
  border-color: #ff1493;
  color: #00ced1;
}

#theme-indicator.preview-dark {
  background: #1a1a1a;
  border-color: var(--fg);
  color: #9acada;
}

#theme-indicator.preview-light {
  background: #f1f1f1;
  border-color: var(--fg);
  color: #4a7b8a;
}

@media (max-width: 600px) {
  html {
    font-size: 14px;
  }

  h1 {
    font-size: 2rem;
  }

  dl {
    grid-template-columns: 1fr;
  }

  dt {
    margin-top: 0.5rem;
  }

  dd {
    margin-left: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: white;
    color: black;
  }

  a {
    color: black;
    text-decoration: underline;
  }

  video,
  #demo {
    display: none;
  }

  pre,
  code,
  kbd {
    background: #f0f0f0;
    border-color: #ccc;
  }
}
