/* ---------- fonts (self-hosted, latin subset) ---------- */

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("static/fonts/outfit.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("static/fonts/source-sans-3.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Source Code Pro";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("static/fonts/source-code-pro.woff2") format("woff2");
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212,
    U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f8fafc;
  --ink: #042f2e;
  --ink-soft: #64748b;
  --accent: #0f766e;
  --accent-bright: #14b8a6;
  --code-bg: #1f2430;
  --code-ink: #cbccc6;
  --border: #cbd5e1;
  --button-primary-bg: #042f2e;
  --button-primary-ink: #f0fdfa;
  --inline-code-bg: #e2e8f0;
  --shadow: rgb(4 47 46 / 18%);
  --max-width: 1060px;
  --font-display: "Outfit", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Source Code Pro", ui-monospace, monospace;
  --font-sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, sans-serif;
}

:root[data-theme="dark"] {
  --bg: #011412;
  --ink: #f0fdfa;
  --ink-soft: #94a3b8;
  --accent: #2dd4bf;
  --code-bg: #1f2430;
  --border: #134e4a;
  --button-primary-bg: #14b8a6;
  --button-primary-ink: #042f2e;
  --inline-code-bg: #134e4a;
  --shadow: rgb(0 0 0 / 45%);
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

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

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

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

/* Structural/control links carry their own affordance, so no underline. */
.nav-brand,
.nav-links a,
.button {
  text-decoration: none;
}

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

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--button-primary-bg);
  color: var(--button-primary-ink);
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0.75rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- nav ---------- */

.nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-brand {
  display: flex;
  align-items: center;
}

.nav-brand img {
  display: block;
  height: 24px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  color: var(--ink-soft);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover {
  color: var(--ink);
}

.theme-toggle {
  display: flex;
  align-items: center;
  padding: 0.35rem;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
}

.theme-toggle:hover {
  color: var(--ink);
  background: var(--inline-code-bg);
}

:root[data-theme="dark"] .icon-moon,
:root:not([data-theme="dark"]) .icon-sun {
  display: none;
}

.nav-toggle {
  display: none;
  align-items: center;
  padding: 0.35rem;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
}

.nav-toggle:hover {
  color: var(--ink);
  background: var(--inline-code-bg);
}

.nav-toggle .icon-close {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-menu {
  display: none;
}

.nav-toggle[aria-expanded="true"] .icon-close {
  display: block;
}

@media (max-width: 640px) {
  body {
    overflow-x: hidden;
  }

  .nav-toggle {
    display: flex;
    position: relative;
    z-index: 21;
  }

  .nav-links {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    background: var(--bg);
    transform: translateX(100%);
    visibility: hidden;
    transition:
      transform 0.3s ease,
      visibility 0.3s ease;
  }

  .nav[data-open="true"] .nav-links {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-links a {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--ink);
  }
}

/* ---------- hero ---------- */

.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5.5rem 1.5rem 4rem;
  text-align: center;
}

.badge {
  display: inline-block;
  margin-bottom: 1.75rem;
  padding: 0.55rem 1.25rem;
  border-radius: 999px;
  background: var(--accent-bright);
  color: #042f2e;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(3.25rem, 9vw, 5.75rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.08;
  color: var(--ink);
}

.hero-trio {
  margin-top: 1.5rem;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hero-sub {
  max-width: 38rem;
  margin: 1.25rem auto 0;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

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

.button {
  display: inline-block;
  padding: 0.75rem 1.6rem;
  border: 1.5px solid var(--ink-soft);
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--shadow);
}

.button.primary {
  background: var(--button-primary-bg);
  border-color: var(--button-primary-bg);
  color: var(--button-primary-ink);
}

/* ---------- error (404) ---------- */

.error {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 6rem 1.5rem 5rem;
  text-align: center;
}

.error-code {
  font-family: var(--font-mono);
  font-size: clamp(3rem, 12vw, 6rem);
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
}

.error h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  margin-top: 1rem;
  color: var(--ink);
}

.error-sub {
  max-width: 34rem;
  margin: 1.25rem auto 0;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

/* ---------- code windows ---------- */

.showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
}

.window {
  background: var(--code-bg);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 50px var(--shadow);
  text-align: left;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1rem;
  background: rgb(240 253 250 / 7%);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.dot.red {
  background: #ff5f57;
}

.dot.yellow {
  background: #febc2e;
}

.dot.green {
  background: #28c840;
}

.window-title {
  margin-left: 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: rgb(240 253 250 / 55%);
}

.window pre {
  padding: 1.25rem 1.4rem;
  overflow-x: auto;
}

.window code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--code-ink);
}

/* Code colors follow the Ayu Mirage palette. */

.kw {
  color: #ffa759;
}

.ty {
  color: #73d0ff;
}

.fn {
  color: #ffd580;
}

.st {
  color: #bae67e;
}

.nm {
  color: #d4bfff;
}

.prompt {
  color: #ffcc66;
  font-weight: 500;
}

.dim {
  color: rgb(203 204 198 / 70%);
}

/* ---------- install ---------- */

.install {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
  text-align: center;
}

.install .window {
  max-width: 820px;
  margin: 0 auto;
}

.install h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.install-lead {
  max-width: 34rem;
  margin: 0 auto 1.75rem;
  color: var(--ink-soft);
  font-size: 1rem;
}

.install-note {
  max-width: 34rem;
  margin: 1.5rem auto 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.install-note code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--ink);
  background: var(--inline-code-bg);
  padding: 0.1em 0.35em;
  border-radius: 5px;
  white-space: nowrap;
}

/* ---------- community ---------- */

.community {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
}

.community-card {
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--inline-code-bg);
  text-align: center;
}

.community h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.community-lead {
  max-width: 34rem;
  margin: 0 auto 1.75rem;
  color: var(--ink);
  font-size: 1rem;
}

.button.discord {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

/* ---------- extensions ---------- */

.extensions {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
  text-align: center;
}

.extensions h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 0.75rem;
}

.extensions-lead {
  max-width: 36rem;
  margin: 0 auto 2.25rem;
  color: var(--ink-soft);
  font-size: 1rem;
}

.extensions-lead code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--ink);
  background: var(--inline-code-bg);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

.ext-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.ext-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--inline-code-bg);
  color: var(--ink);
  text-align: left;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease;
}

.ext-card:hover,
.ext-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow);
}

.ext-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 1rem;
  color: var(--accent);
}

.ext-icons {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.ext-icons .ext-icon {
  margin-bottom: 0;
}

.ext-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
}

.ext-card p {
  margin-top: 0.5rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.ext-card code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--ink);
  background: var(--bg);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

.ext-link {
  margin-top: auto;
  padding-top: 1.25rem;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Stretch the link over the whole card so the entire card is clickable while
   staying a single, properly labelled, focusable link. */
.ext-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

:root[data-theme="dark"] .extensions-lead,
:root[data-theme="dark"] .ext-card p {
  color: var(--ink);
}

:root[data-theme="dark"] .ext-card code {
  background: rgb(240 253 250 / 10%);
}

/* ---------- docs ---------- */

.docs {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 3.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem;
}

.docs-sidebar {
  font-size: 0.9rem;
}

.docs-toc {
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.docs-toc-title {
  font-family: var(--font-display);
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--ink);
}

.docs-toc ol {
  list-style: none;
}

.docs-toc a {
  display: block;
  padding: 0.22rem 0.75rem;
  border-left: 2px solid var(--border);
  color: var(--ink-soft);
  text-decoration: none;
}

.docs-toc a:hover {
  color: var(--ink);
}

.docs-toc a[aria-current="true"] {
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.docs-toc .toc-h3 a {
  padding-left: 1.75rem;
}

.docs-toc-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--inline-code-bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.docs-toc-toggle svg {
  margin-left: auto;
  transition: transform 0.15s ease;
}

.docs-toc-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

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

.docs-header {
  margin-bottom: 2.5rem;
}

.docs-header h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.docs-meta {
  margin-top: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.docs-content h2 {
  margin: 3rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.docs-content h3 {
  margin: 2.25rem 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
}

.docs-content h4 {
  margin: 1.75rem 0 0.6rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}

.docs-content h2:hover .anchor-link,
.docs-content h3:hover .anchor-link,
.docs-content h4:hover .anchor-link,
.docs-content .anchor-link:focus-visible {
  opacity: 1;
}

.anchor-link {
  margin-left: 0.35rem;
  opacity: 0;
  color: var(--ink-soft);
  font-weight: 400;
  text-decoration: none;
  transition: opacity 0.12s ease;
}

.docs-content p,
.docs-content ul,
.docs-content ol {
  margin-bottom: 1rem;
}

.docs-content ul,
.docs-content ol {
  padding-left: 1.4rem;
}

.docs-content li + li {
  margin-top: 0.3rem;
}

.docs-content hr {
  display: none;
}

.docs-content table {
  width: 100%;
  margin: 1.25rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}

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

.docs-content th {
  background: var(--inline-code-bg);
  font-weight: 600;
}

.docs-content :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--ink);
  background: var(--inline-code-bg);
  padding: 0.1em 0.35em;
  border-radius: 5px;
}

.docs-content div.highlighter-rouge {
  margin: 1.25rem 0;
  border-radius: 12px;
  background: var(--code-bg);
  overflow: hidden;
}

.docs-content div.highlighter-rouge pre {
  padding: 1.1rem 1.3rem;
  overflow-x: auto;
}

.docs-content div.highlighter-rouge code {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--code-ink);
}

@media (max-width: 820px) {
  .docs {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-top: 1rem;
  }

  .docs-toc-toggle {
    display: flex;
  }

  .docs-toc {
    display: none;
    position: static;
    max-height: none;
    margin-top: 0.75rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 10px;
  }

  .docs-sidebar[data-open="true"] .docs-toc {
    display: block;
  }

  .docs-toc-title {
    display: none;
  }
}

/* ---------- rouge syntax highlighting ---------- */

/* Highlight colors follow the Ayu Mirage palette, matching the
   hand-tagged homepage showcase (.kw, .ty, .fn, .st, .nm). Code
   blocks stay dark in both themes. */

.highlight .c,
.highlight .c1,
.highlight .cm {
  color: rgb(203 204 198 / 70%);
  font-style: italic;
}

.highlight .k,
.highlight .kn,
.highlight .kd,
.highlight .kr,
.highlight .ow {
  color: #ffa759;
}

.highlight .kc,
.highlight .bp {
  color: #ffa759;
  font-style: italic;
}

.highlight .nc,
.highlight .nn,
.highlight .kt {
  color: #73d0ff;
}

.highlight .nf,
.highlight .nd,
.highlight .nt {
  color: #ffd580;
}

.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb,
.highlight .sh,
.highlight .sx {
  color: #bae67e;
}

.highlight .se {
  color: #95e6cb;
}

.highlight .si {
  color: #f29e74;
}

.highlight .m,
.highlight .mi,
.highlight .mf,
.highlight .mh,
.highlight .mb {
  color: #d4bfff;
}

.highlight .o {
  color: #f29e74;
}

.highlight .nb,
.highlight .nv,
.highlight .vg {
  color: #73d0ff;
}

.highlight .gp {
  color: #ffcc66;
  font-weight: 500;
}

/* ---------- footer ---------- */

footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem 3rem;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

footer p + p {
  margin-top: 0.5rem;
}

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .showcase {
    grid-template-columns: 1fr;
  }

  .ext-grid {
    grid-template-columns: 1fr;
  }

  .get-started {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero {
    padding-top: 3.5rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .nav-links,
  .button,
  .skip-link {
    transition: none;
  }

  .button:hover {
    transform: none;
  }
}
