/* Timberborn Mods catalog. No build step, no external requests. */

:root {
  color-scheme: light;
  --bg: #f6f0e1;
  --bg-deep: #efe6cf;
  --card: #fffdf7;
  --line: #e0d5b8;
  --line-strong: #c9bb94;
  --ink: #22332a;
  --muted: #58675c;
  --link: #8a4b0a;
  --accent: #efaa3f;
  --accent-hover: #f5bb5c;
  --accent-edge: #c98a2a;
  --accent-ink: #2a1c05;
  --focus: #1c6b6b;
  --ok: #1f7a3d;
  --warn-bg: #fff1d6;
  --warn-ink: #7a4300;
  --code-bg: rgba(34, 51, 42, .07);
  --shadow: 0 1px 2px rgba(60, 45, 15, .06), 0 10px 28px rgba(60, 45, 15, .08);
  --shadow-hover: 0 2px 4px rgba(60, 45, 15, .08), 0 16px 36px rgba(60, 45, 15, .14);
  --hero-glow: rgba(239, 170, 63, .22);
  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, "Liberation Mono", monospace;
  --radius: 16px;
  --wrap: 1140px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1813;
    --bg-deep: #0b120e;
    --card: #172620;
    --line: #2a4034;
    --line-strong: #40604d;
    --ink: #f3ecd6;
    --muted: #b6c4b5;
    --link: #f0c877;
    --accent-edge: #f3c168;
    --focus: #7cd0d0;
    --ok: #7fd49a;
    --warn-bg: #2b2313;
    --warn-ink: #f2c987;
    --code-bg: rgba(243, 236, 214, .09);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .3);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 36px rgba(0, 0, 0, .45);
    --hero-glow: rgba(239, 170, 63, .13);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1813;
  --bg-deep: #0b120e;
  --card: #172620;
  --line: #2a4034;
  --line-strong: #40604d;
  --ink: #f3ecd6;
  --muted: #b6c4b5;
  --link: #f0c877;
  --accent-edge: #f3c168;
  --focus: #7cd0d0;
  --ok: #7fd49a;
  --warn-bg: #2b2313;
  --warn-ink: #f2c987;
  --code-bg: rgba(243, 236, 214, .09);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .3);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 36px rgba(0, 0, 0, .45);
  --hero-glow: rgba(239, 170, 63, .13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
code { font: .88em var(--mono); background: var(--code-bg); padding: .1em .38em; border-radius: 5px; overflow-wrap: anywhere; }
em { font-style: normal; font-weight: 600; }
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

.wrap { width: min(var(--wrap), calc(100% - 48px)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 20; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.logo { width: 34px; height: 34px; flex: none; }
.brand-text { display: grid; line-height: 1.15; }
.brand-text strong { font: 700 17px/1.15 var(--serif); letter-spacing: -.01em; }
.brand-text small { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
nav { display: flex; align-items: center; gap: 4px; }
nav a { color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 8px; }
nav a:hover { background: var(--code-bg); }
.theme-toggle {
  appearance: none; border: 1px solid var(--line-strong); background: transparent; color: var(--ink);
  width: 38px; height: 38px; border-radius: 10px; margin-left: 6px; cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.theme-toggle:hover { background: var(--code-bg); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 68px 0 44px;
  background:
    radial-gradient(60% 120% at 88% -10%, var(--hero-glow), transparent 62%),
    linear-gradient(180deg, var(--bg-deep), var(--bg));
  border-bottom: 1px solid var(--line);
}
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
h1 { font: 400 clamp(40px, 6vw, 68px)/1.02 var(--serif); letter-spacing: -.03em; margin-bottom: 20px; }
.lead { max-width: 640px; font-size: clamp(17px, 2vw, 19px); color: var(--muted); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-facts li { font-size: 13.5px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px; background: color-mix(in srgb, var(--card) 70%, transparent); }
.hero-facts strong { color: var(--ink); }

/* ---------- Catalog ---------- */
.catalog { padding: 48px 0 24px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 26px; }

.card {
  --c: #e0812f;
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: color-mix(in srgb, var(--c) 55%, var(--line)); }

.banner {
  position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden;
  background:
    radial-gradient(90% 90% at 50% 0%, color-mix(in srgb, var(--c) 34%, #101a14), #0d1510 78%);
  border-bottom: 4px solid var(--c);
}
.banner svg, .banner img { width: 100%; height: 100%; }
.banner img { object-fit: cover; }
.banner-render { background: #6b6a63; }
.banner-render img { object-position: 50% 30%; }

.body { display: flex; flex: 1; flex-direction: column; padding: 20px 22px 22px; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.pill {
  font-size: 11.5px; font-weight: 700; letter-spacing: .02em; line-height: 1;
  padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--ink); white-space: nowrap;
}
.pill.tag { background: color-mix(in srgb, var(--c) 16%, transparent); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); }
.pill.status { margin-left: auto; }
.pill.status[data-kind="stable"] { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.pill.status[data-kind="preview"] { color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn-ink) 35%, var(--line)); background: var(--warn-bg); }

h3 { font: 700 23px/1.2 var(--serif); letter-spacing: -.015em; }
h3 a { color: var(--ink); text-decoration: none; }
h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--c); text-underline-offset: 5px; }
.tagline { font-weight: 650; margin-top: 6px; }
.blurb { color: var(--muted); font-size: 15px; margin-top: 8px; }
.blurb a { color: inherit; }
.facts { margin-top: 14px; display: grid; gap: 6px; font-size: 14px; }
.facts li { position: relative; padding-left: 20px; }
.facts li::before { content: ""; position: absolute; left: 2px; top: .58em; width: 8px; height: 8px; border-radius: 3px; background: var(--c); transform: rotate(45deg); }

.caution {
  display: flex; gap: 8px; align-items: flex-start; margin-top: 14px;
  background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 9px 12px;
  font-size: 13px; font-weight: 600; line-height: 1.4;
}
.caution svg { flex: none; width: 16px; height: 16px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.req { margin-top: 14px; font-size: 13px; color: var(--muted); }
.req span { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 11px; margin-right: 6px; color: var(--ink); }

.dl { margin-top: auto; padding-top: 18px; }
.btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--accent); color: var(--accent-ink);
  border: 1px solid var(--accent-edge); border-bottom-width: 3px;
  border-radius: 11px; padding: 11px 16px 9px;
  font: 800 15.5px/1.2 var(--sans); text-decoration: none;
  transition: background .15s ease, transform .1s ease;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); border-bottom-width: 2px; padding-bottom: 10px; }
.btn svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn-label { flex: 1; }
.btn-size { font-weight: 700; font-size: 13px; opacity: .72; }
.dl-note { min-height: 1.5em; margin-top: 8px; font-size: 12.5px; color: var(--muted); text-align: center; }
.dl-note a { font-weight: 600; }
.dl[data-state="loading"] .dl-note { opacity: .55; }

.links { display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.links a { font-weight: 600; }
.links .primary-link { font-weight: 800; }

/* ---------- Install ---------- */
.install { margin-top: 40px; padding: 64px 0 72px; background: var(--bg-deep); border-top: 1px solid var(--line); }
h2 { font: 400 clamp(30px, 4vw, 42px)/1.1 var(--serif); letter-spacing: -.025em; }
.section-lead { color: var(--muted); margin-top: 10px; max-width: 620px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; margin-top: 36px; }
.steps li { position: relative; padding-top: 4px; }
.step-n { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 19px var(--serif); margin-bottom: 14px; }
.steps h3, .notes h3 { font: 700 18px/1.25 var(--sans); letter-spacing: 0; }
.steps p, .notes p { color: var(--muted); font-size: 15px; margin-top: 6px; }
.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 44px; }
.notes > div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }

/* ---------- Footer ---------- */
.site-footer { padding: 32px 0 44px; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--line); }
.site-footer p { max-width: 760px; }
.site-footer .fine { margin-top: 10px; font-size: 12.5px; }
.site-footer a { color: inherit; }

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  .wrap { width: calc(100% - 32px); }
  .bar { min-height: 58px; gap: 8px; }
  .brand-text small { display: none; }
  nav a { padding: 8px 8px; font-size: 13.5px; }
  nav a:nth-child(3) { display: none; }
  .hero { padding: 44px 0 30px; }
  .catalog { padding-top: 32px; }
  .grid { gap: 20px; }
  .install { padding: 48px 0 56px; }
}
@media (max-width: 380px) {
  nav a:nth-child(2) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .btn { transition: none; }
  .card:hover { transform: none; }
}
