/* Safe Haven QOL - the mod's website.
   Round 3 (Torvian, Oct 12 2026): "its a bit hard to focus on reading things with the font and colors, maybe use
   comfortaa font?" - so: Comfortaa throughout (self-hosted, SIL OFL), brighter and calmer text colors, white headings,
   orange kept for links, buttons and small accents, soft rounded surfaces instead of hard pixel boxes, and line
   lengths capped for reading. The pixel art stays where it is art: the logo and the ember divider. */

@font-face {
  font-family: "Comfortaa";
  src: url("fonts/Comfortaa-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #151618;
  --bg-2: #18191c;
  --surface: #1d1f22;
  --surface-2: #23252a;
  --border: #2c2e33;
  --border-2: #3a3d43;
  --text: #eef0f2;        /* headings, names */
  --text-2: #cfd2d7;      /* reading text */
  --text-3: #9da1a8;      /* meta, hints */
  --accent: #ff7a1a;      /* the logo's orange */
  --accent-2: #ffa04d;
  --accent-ink: #1b0e04;
  --accent-soft: rgba(255, 122, 26, .12);
  --green: #9fd36b;
  --blue: #86bdf5;
  --radius: 10px;
  --radius-sm: 7px;
  --font: "Comfortaa", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: Consolas, "Cascadia Mono", "SFMono-Regular", Menlo, monospace;
  --header-h: 64px;
  --read: 72ch;           /* the longest comfortable line */
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-2);
  font: 500 16px/1.75 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent-2); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { color: var(--text); font-weight: 700; line-height: 1.3; margin: 0 0 .6em; letter-spacing: -.01em; }
p { margin: 0 0 1.1em; }
strong { color: var(--text); font-weight: 700; }
code {
  font-family: var(--mono); font-size: .86em; font-weight: 400;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--text);
  overflow-wrap: anywhere;
}
pre { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px;
  overflow-x: auto; margin: 0 0 1.1em; }
pre code { background: none; border: 0; padding: 0; }
kbd {
  font-family: var(--mono); font-size: .8em; font-weight: 700; white-space: nowrap;
  display: inline-block; padding: 0 7px; color: var(--text); line-height: 1.6;
  background: #2a2c31; border: 1px solid var(--border-2); border-bottom-width: 3px; border-radius: 6px;
}
.muted { color: var(--text-3); }
.accent { color: var(--accent); }
.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;
}
.skip-link { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--accent); color: var(--accent-ink);
  padding: 8px 14px; font-weight: 700; border-radius: var(--radius-sm); }
.skip-link:focus { top: 12px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.wrap.narrow { max-width: 800px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 1rem/1 var(--font); text-decoration: none;
  color: var(--accent-ink); background: var(--accent); border: 0; border-radius: var(--radius-sm); cursor: pointer;
  padding: 14px 22px; box-shadow: 0 6px 18px rgba(255, 122, 26, .22);
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { background: var(--accent-2); color: var(--accent-ink); transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(255, 122, 26, .3); }
.btn:active { transform: translateY(1px); box-shadow: 0 3px 10px rgba(255, 122, 26, .2); }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--border-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn-ghost:active { box-shadow: inset 0 0 0 1.5px var(--accent); }
.btn-small { font-size: .88rem; padding: 10px 14px; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(21, 22, 24, .92); border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.header-inner { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); flex: none; }
.brand > span { font: 700 1.12rem/1 var(--font); letter-spacing: -.01em; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.site-nav a:not(.btn) {
  color: var(--text-3); text-decoration: none; font-weight: 700; font-size: .92rem;
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.site-nav a:not(.btn):hover { color: var(--text); background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-cta { margin-left: 10px; }
.nav-toggle {
  margin-left: auto; width: 44px; height: 40px; background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); color: var(--text); cursor: pointer; display: none; align-items: center;
  justify-content: center;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); position: relative; content: "";
}
.nav-toggle-bars::before { position: absolute; top: -6px; }
.nav-toggle-bars::after { position: absolute; top: 6px; }

/* ---------------------------------------------------------------- embers (the logo frame, as a divider) */
.embers {
  height: 10px; background: url("img/embers.png") repeat-x left center / auto 10px;
  image-rendering: pixelated; image-rendering: crisp-edges; opacity: .9;
}

/* ---------------------------------------------------------------- hero */
.hero {
  background:
    radial-gradient(ellipse 55% 65% at 78% 45%, rgba(255, 122, 26, .10), transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  overflow: hidden;
}
.hero-inner { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 40px;
  padding-top: 64px; padding-bottom: 56px; }
.eyebrow { font-weight: 700; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent);
  margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4rem); line-height: 1.1; margin-bottom: 20px; letter-spacing: -.02em; }
.lead { font-size: 1.15rem; color: var(--text-2); max-width: 40em; line-height: 1.7; }
.hero .lead { margin-bottom: 30px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }
.hero-meta { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-meta li { background: var(--surface); border-radius: 999px; padding: 5px 14px; font-size: .86rem; color: var(--text-3); }
.hero-meta strong { color: var(--text); }
.hero-art { display: flex; justify-content: center; }
.hero-art img { width: 100%; max-width: 420px; image-rendering: pixelated; image-rendering: crisp-edges;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .5)); animation: bob 6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---------------------------------------------------------------- sections */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { font-size: clamp(1.5rem, 3vw, 1.9rem); display: flex; align-items: center; gap: 12px; margin-top: 0; }
.section-title::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); flex: none; }
.prose .section-title { margin-top: 2.4em; }
.prose .section-title:first-of-type { margin-top: 0; }
.section-lead { color: var(--text-3); margin-bottom: 28px; max-width: var(--read); }
.more-link { margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 24px; }
.more-link a { font-weight: 700; text-decoration: none; }
.more-link a:hover { text-decoration: underline; }
.page-head { padding: 48px 0 34px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--bg-2), var(--bg)); }
.page-head h1 { font-size: clamp(2rem, 5vw, 2.7rem); }
.page-head .lead { margin-bottom: 0; }

/* ---------------------------------------------------------------- cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.card {
  position: relative; display: block; text-decoration: none; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 22px 20px;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.card:hover { border-color: var(--border-2); transform: translateY(-2px); background: var(--surface-2); color: var(--text-2); }
.card h3 { font-size: 1.05rem; margin-bottom: 8px; padding-right: 36px; }
.card p { color: var(--text-2); font-size: .95rem; margin: 0; line-height: 1.7; }
.card::after { content: "\2192"; position: absolute; right: 20px; top: 20px; color: var(--accent); font-weight: 700;
  transition: transform .15s ease; }
.card:hover::after { transform: translateX(3px); }
.tag-new { display: inline-block; font-weight: 700; font-size: .72rem; letter-spacing: .04em; background: var(--accent);
  color: var(--accent-ink); padding: 3px 9px; border-radius: 999px; margin-bottom: 10px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.step-n { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center;
  font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: 50%; margin-bottom: 14px; }
.step h3 { font-size: 1.05rem; }
.step p { margin: 0; font-size: .95rem; }

/* ---------------------------------------------------------------- badges */
.b {
  display: inline-block; font: 700 .72rem/1 var(--font); letter-spacing: .02em;
  padding: 5px 10px; border-radius: 999px; white-space: nowrap;
}
.b-on { color: var(--green); background: rgba(159, 211, 107, .1); }
.b-off { color: var(--text-3); background: rgba(157, 161, 168, .1); }
.b-server { color: var(--accent-2); background: var(--accent-soft); }
.b-player { color: var(--blue); background: rgba(134, 189, 245, .1); }
.b-new { color: var(--accent-ink); background: var(--accent); }
.legend { list-style: none; padding: 0; margin: 24px 0 0; display: flex; flex-wrap: wrap; gap: 10px 24px;
  color: var(--text-3); font-size: .9rem; }
.legend .b { margin-right: 6px; }

/* ---------------------------------------------------------------- features page */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 40px; padding-top: 32px; padding-bottom: 72px; }
.docs-side { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; }
.side-title { font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
  margin-bottom: 10px; padding-left: 12px; }
.docs-side ul { list-style: none; margin: 0; padding: 0; }
.docs-side a {
  display: flex; justify-content: space-between; gap: 10px; padding: 7px 12px; border-radius: var(--radius-sm);
  color: var(--text-3); text-decoration: none; font-weight: 700; font-size: .92rem;
}
.docs-side a:hover { color: var(--text); background: var(--surface); }
.docs-side a.zero { opacity: .4; }
.docs-side a.active { color: var(--text); background: var(--surface-2); }
.docs-side .n, .cat-head .n { font: 400 .8rem/1.75 var(--mono); color: var(--text-3); }
.toolbar {
  position: sticky; top: var(--header-h); z-index: 20; background: var(--bg);
  padding: 14px 0 12px; margin-bottom: 6px; border-bottom: 1px solid var(--border);
}
.search-box { position: relative; }
.search-box input {
  width: 100%; font: 500 1rem var(--font); color: var(--text); background: var(--surface);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 13px 46px 13px 16px; outline: none;
}
.search-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box input::placeholder { color: var(--text-3); }
.search-hint { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; margin-top: 12px; font-size: .92rem; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.filters select { font: 500 .92rem var(--font); color: var(--text); background: var(--surface);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 7px 10px; }
.count { margin: 10px 0 0; color: var(--text-3); font-size: .86rem; }
.cat { padding-top: 30px; }
.cat-head { margin-bottom: 16px; }
.cat-head h2 { font-size: 1.5rem; display: flex; align-items: baseline; gap: 12px; }
.cat-head h2::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--cat, var(--accent));
  align-self: center; }
.cat-blurb { color: var(--text-3); margin: 0; max-width: var(--read); }
.feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.feat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px 16px; }
.feat:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.feat-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  margin-bottom: 8px; }
.feat h3 { font-size: 1.04rem; margin: 0; }
.feat-link { color: var(--text); text-decoration: none; }
.feat-link:hover { color: var(--accent-2); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.feat-desc { color: var(--text-2); margin: 0 0 10px; font-size: .97rem; line-height: 1.75; max-width: var(--read); }
.feat-key { margin: 0; font-size: .8rem; color: var(--text-3); }
.feat-key span { margin-right: 4px; }
.feat-key code { font-size: .8rem; color: var(--text-3); background: transparent; }
.empty { text-align: center; padding: 50px 20px; color: var(--text-3); border: 1px dashed var(--border-2);
  border-radius: var(--radius); margin-top: 24px; }
.cat-building { --cat: #ff7a1a; }
.cat-settlements { --cat: #9fd36b; }
.cat-settlers { --cat: #f2cf8e; }
.cat-combat { --cat: #ef6b56; }
.cat-crafting { --cat: #ffb04d; }
.cat-stacks { --cat: #86bdf5; }
.cat-hud { --cat: #bf98f3; }
.cat-world { --cat: #5fcdbb; }
.cat-misc { --cat: #9da1a8; }
html:not(.js) .toolbar { display: none; }

/* ---------------------------------------------------------------- reading pages */
.prose p, .prose li { color: var(--text-2); max-width: var(--read); }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.toc a { font-size: .88rem; font-weight: 700; text-decoration: none; color: var(--text-2); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; }
.toc a:hover { color: var(--text); border-color: var(--border-2); background: var(--surface-2); }
.pixel-list { list-style: none; padding: 0; margin: 0 0 1.3em; }
.pixel-list li { position: relative; padding-left: 22px; margin-bottom: .6em; color: var(--text-2); }
.pixel-list li::before { content: ""; position: absolute; left: 3px; top: .72em; width: 7px; height: 7px;
  border-radius: 50%; background: var(--accent); }
.pixel-list.columns { columns: 2 260px; column-gap: 36px; }
.pixel-list.columns li { break-inside: avoid; }
.steps-list { padding-left: 0; list-style: none; counter-reset: s; margin: 0 0 1.3em; }
.steps-list li { counter-increment: s; position: relative; padding: 2px 0 0 46px; margin-bottom: 18px; color: var(--text-2);
  min-height: 32px; }
.steps-list li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; color: var(--accent-ink);
  background: var(--accent); border-radius: 50%; }
.note { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px 8px;
  margin: 28px 0; }
.note h3 { font-size: 1.02rem; display: flex; align-items: center; gap: 10px; }
.note h3::before { content: "!"; display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent-2); font-size: .8rem; flex: none; }
.note p { color: var(--text-2); }
.table-wrap { overflow-x: auto; margin: 0 0 1.3em; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-weight: 700; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); background: var(--bg-2); padding: 12px 16px; border-bottom: 1px solid var(--border); }
.table td { padding: 11px 16px; border-top: 1px solid var(--border); color: var(--text-2); vertical-align: top; }
.table tr:first-child td { border-top: 0; }
.table td:first-child { white-space: nowrap; }
.table td code { white-space: nowrap; overflow-wrap: normal; } /* a setting name never splits - the table scrolls */
.table.keys td:first-child { width: 1%; }

/* ---------------------------------------------------------------- What's new */
.release { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 30px 14px; margin-bottom: 32px; }
.release h2 { color: var(--accent); font-size: 1.7rem; margin-bottom: 16px; }
.release h3 { font-size: 1.12rem; margin: 26px 0 10px; }
.release h3:first-of-type { margin-top: 4px; }

/* ---------------------------------------------------------------- FAQ */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 10px; }
.faq details[open] { border-color: var(--border-2); }
.faq summary { cursor: pointer; padding: 16px 52px 16px 20px; font-weight: 700; color: var(--text); position: relative;
  list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  font-weight: 700; font-size: 1.3rem; color: var(--accent); }
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { color: var(--accent-2); }
.faq details p { padding: 0 20px 6px; color: var(--text-2); max-width: var(--read); }

/* ---------------------------------------------------------------- footer */
.site-footer { background: #111214; margin-top: 24px; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.3fr; gap: 32px; padding-top: 38px;
  padding-bottom: 42px; font-size: .9rem; color: var(--text-3); }
.footer-brand { display: flex; gap: 14px; align-items: flex-start; }
.footer-brand p { margin: 0 0 .45em; }
.footer-name { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.footer-head { font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3);
  margin-bottom: 12px; }
.footer-links a { color: var(--text-2); }
.footer-links > a { display: block; text-decoration: none; padding: 3px 0; }
.footer-links > a:hover { color: var(--accent-2); }
.footer-links > a[aria-current="page"] { color: var(--text); }
.footer-links p { margin: 0 0 .55em; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1060px) {
  .site-nav a:not(.btn) { padding: 8px 8px; font-size: .88rem; }
}
@media (max-width: 920px) {
  .js .nav-toggle { display: inline-flex; }
  .js .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: var(--header-h); flex-direction: column;
    align-items: stretch; gap: 2px; background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 10px 20px 18px;
  }
  .js .site-nav.open { display: flex; }
  .js .site-nav a:not(.btn) { padding: 12px 12px; font-size: 1rem; }
  .js .nav-cta { margin: 12px 0 0; }
  html:not(.js) .site-header { height: auto; position: static; }
  html:not(.js) .header-inner { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  html:not(.js) .site-nav { flex-wrap: wrap; margin-left: 0; }
  /* minmax(0, 1fr), never 1fr: a grid item will not shrink below its content's min width, and the swipeable
     category row's min width is ALL its chips - so 1fr made the whole page wider than a phone */
  .hero-inner { grid-template-columns: minmax(0, 1fr); padding-top: 40px; gap: 24px; }
  .hero-art { order: -1; }
  .hero-art img { max-width: 250px; }
  .steps { grid-template-columns: 1fr; }
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; padding-top: 18px; }
  .docs-side, .docs-main { min-width: 0; }
  .docs-side { position: static; margin-bottom: 8px; }
  .docs-side ul { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
  .docs-side li { flex: none; }
  .docs-side a { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; }
  .docs-side a.active { border-color: var(--accent); }
  .side-title { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .brand > span { font-size: 1rem; }
  .section { padding: 44px 0; }
  .hero-actions .btn { flex: 1 1 100%; }
  .release { padding: 22px 18px 10px; }
  .feat { padding: 16px 16px 14px; }
  .footer-inner { grid-template-columns: 1fr; }
  .table td:first-child { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
