/* Zarra wiki theme: dark, rainy greys, white accents */

:root {
  --bg: #0b0c0e;
  --bg-raised: #131518;
  --bg-code: #0f1113;
  --border: #23262b;
  --border-strong: #33373d;
  --text: #d6d9de;
  --text-dim: #8b9099;
  --heading: #f4f5f7;
  --accent: #e8ebef;
  --link: #b9c7d6;
  --link-hover: #ffffff;
  --mark: #7f8ea0;
  --radius: 8px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

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

/* Header */

.site-header {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}

.header-bg {
  position: absolute;
  inset: -40px;
  background-size: cover;
  background-position: center 30%;
  filter: blur(18px) grayscale(1) brightness(0.45);
  transform: scale(1.1);
}

.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 12, 14, 0.35) 0%, rgba(11, 12, 14, 0.9) 100%);
}

.header-inner {
  position: relative;
  z-index: 1;
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: inherit;
}

.brand img {
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: 0.01em;
}

.brand-sub { font-size: 0.9rem; color: var(--text-dim); }

.home-link {
  font-size: 0.9rem;
  color: var(--text);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(19, 21, 24, 0.7);
  transition: border-color 0.15s, color 0.15s;
}

.home-link:hover { border-color: var(--accent); color: var(--link-hover); }

/* Content */

.content {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading);
  font-weight: 600;
  line-height: 1.3;
  margin: 2em 0 0.6em;
  scroll-margin-top: 16px;
}

h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-top: 0;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--border);
}

h2 {
  font-size: 1.5rem;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--border);
}

h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; color: var(--text); }

p, ul, ol, table, pre, blockquote { margin: 0 0 1.1em; }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: rgba(185, 199, 214, 0.35);
  text-underline-offset: 3px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

a:hover { color: var(--link-hover); text-decoration-color: var(--link-hover); }

strong { color: var(--heading); font-weight: 600; }

ul, ol { padding-left: 1.4em; }
li { margin: 0.25em 0; }
li::marker { color: var(--mark); }

hr { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; }

blockquote {
  margin-left: 0;
  padding: 0.6em 1em;
  border-left: 3px solid var(--border-strong);
  background: var(--bg-raised);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-dim);
}

blockquote > :last-child { margin-bottom: 0; }

img { max-width: 100%; }

/* Back button: the tagged "Back to ..." line, moved above the page title */
.content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.content > p.back { order: -1; margin: 0 0 20px; }

p.back a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 12px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

p.back a::before {
  content: "\2190";
  font-size: 1.05em;
  transition: transform 0.15s;
}

p.back a:hover { color: var(--link-hover); border-color: var(--accent); background: #181a1e; }
p.back a:hover::before { transform: translateX(-3px); }

/* Home page */
.hero {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 8px 0 36px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.hero img {
  flex: none;
  border-radius: 18px;
  border: 1px solid var(--border-strong);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.hero h1 { margin: 0 0 6px; padding: 0; border: 0; font-size: 2.4rem; letter-spacing: -0.01em; }
.hero p { margin: 0; color: var(--text-dim); font-size: 1.05rem; }

.section-label {
  margin: 36px 0 14px;
  padding: 0;
  border: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.mod-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 22px 20px;
  background: linear-gradient(180deg, #15171b 0%, #111316 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.mod-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}

.mod-card:hover {
  color: var(--text);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.mod-card:hover::before { opacity: 1; }

.mod-name { font-size: 1.15rem; font-weight: 700; color: var(--heading); }
.mod-desc { font-size: 0.92rem; line-height: 1.55; color: var(--text-dim); flex: 1; }

.mod-go {
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--link);
}

.mod-go::after { content: " \2192"; display: inline-block; transition: transform 0.2s; }
.mod-card:hover .mod-go { color: var(--link-hover); }
.mod-card:hover .mod-go::after { transform: translateX(4px); }

.mod-card.soon { opacity: 0.6; }
.mod-card.soon:hover { opacity: 0.85; }

/* Code */

code, pre, kbd { font-family: var(--mono); font-size: 0.88em; }

:not(pre) > code {
  padding: 0.15em 0.4em;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: #e3e6ea;
  white-space: nowrap;
}

td :not(pre) > code { white-space: normal; }

pre, div.highlight pre {
  padding: 16px 18px;
  overflow-x: auto;
  background: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.55;
}

div.highlighter-rouge, figure.highlight { margin: 0 0 1.1em; }
div.highlight, figure.highlight pre { margin: 0; }
pre code { background: none; border: 0; padding: 0; white-space: pre; }

/* Tables */

table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.93rem;
}

th, td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--bg-raised);
  color: var(--heading);
  font-weight: 600;
  white-space: nowrap;
}

tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.015); }
tbody tr:hover td { background: rgba(255, 255, 255, 0.035); }

/* Footer */

.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.site-footer img { border-radius: 6px; opacity: 0.85; }
.site-footer a { color: var(--text-dim); }
.site-footer .dot { opacity: 0.5; }

::selection { background: #3a414b; color: #fff; }

/* Scrollbars */
* { scrollbar-color: #2a2e34 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2e34; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* Syntax highlighting (rouge), muted dark */
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs { color: #6b7280; font-style: italic; }
.highlight .k, .highlight .kd, .highlight .kn, .highlight .kr, .highlight .kt, .highlight .kc { color: #c4a7e7; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb, .highlight .sc, .highlight .se { color: #a8d5a2; }
.highlight .nt, .highlight .na { color: #9ccfd8; }
.highlight .m, .highlight .mi, .highlight .mf, .highlight .mh, .highlight .il { color: #f6c177; }
.highlight .nf, .highlight .fm { color: #ebbcba; }
.highlight .nc, .highlight .nn { color: #f6c177; }
.highlight .o, .highlight .p { color: #8b9099; }
.highlight .nb, .highlight .bp { color: #9ccfd8; }
.highlight .err { color: #eb6f92; background: none; }

@media (max-width: 640px) {
  body { font-size: 15px; }
  .header-inner { padding: 20px 16px; }
  .brand img { width: 44px; height: 44px; }
  .brand-title { font-size: 1.1rem; }
  .brand-sub { display: none; }
  .content { padding: 28px 16px 48px; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.3rem; }
  .site-footer { padding: 20px 16px; }
  .hero { gap: 18px; padding-bottom: 28px; }
  .hero img { width: 64px; height: 64px; border-radius: 14px; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 0.95rem; }
}
