/* mods.hardibardi.com (MODS01). Layout after Modrinth's project pages: a
   header band with the mod's icon, summary, tags and one big download button,
   then the description beside a sidebar of facts (compatibility, install,
   file). Dark and warm, like a workshop at night; amber is the drone's lamp.
   No web fonts and no scripts: the CSP allows only this file and images. */

:root {
  color-scheme: dark;
  --bg: #0f0d0b;
  --surface: #181512;
  --surface-2: #211d19;
  --line: #322c25;
  --line-strong: #4a4137;
  --ink: #eee8df;
  --muted: #a69c8f;
  --accent: #f0a429;
  --accent-hi: #ffbf55;
  --accent-ink: #1c1405;
  --rust: #c4561d;
  --radius: 10px;
  --radius-sm: 6px;
  --font: "Segoe UI Variable Text", "Segoe UI", "Inter", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Bahnschrift", "DIN Alternate", "DIN Condensed", "Arial Narrow", "Roboto Condensed", var(--font);
  --font-mono: "Cascadia Code", "JetBrains Mono", "SF Mono", Consolas, monospace;
  --wrap: 1180px;
  --shadow: 0 10px 30px rgb(0 0 0 / 35%);
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hi); }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(15 13 11 / 78%);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid rgb(255 255 255 / 6%);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.15rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(140deg, var(--accent), var(--rust));
  color: var(--accent-ink); font-size: 22px;
}
.brand-mark svg { stroke-width: 1.9; }
.topnav { display: flex; align-items: center; gap: 6px; }
.topnav a { color: var(--muted); padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; }
.topnav a:hover { color: var(--ink); background: rgb(255 255 255 / 6%); }
.topnav .lang { border: 1px solid var(--line-strong); color: var(--ink); }

/* Hero: the owner's own screenshot, dimmed and softened behind the text */
.hero { position: relative; isolation: isolate; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before {
  content: "";
  position: absolute; inset: -12px; z-index: -2;
  background: url("/assets/hero.jpg") 70% 30% / cover no-repeat;
  filter: blur(1.5px) saturate(0.95);
  transform: scale(1.03);
}
.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 90% at 85% 0%, rgb(240 164 41 / 16%), transparent 55%),
    linear-gradient(90deg, rgb(15 13 11 / 94%) 0%, rgb(15 13 11 / 78%) 40%, rgb(15 13 11 / 30%) 100%),
    linear-gradient(0deg, var(--bg) 0%, transparent 45%);
}
.hero-in { padding-top: 72px; padding-bottom: 64px; }
.hero-catalog .hero-in { padding-top: 104px; padding-bottom: 96px; }

.eyebrow {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 0.9rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent);
}
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); font-weight: 700; letter-spacing: 0.01em; text-transform: uppercase; }
.lede { margin: 18px 0 0; max-width: 62ch; font-size: 1.13rem; color: #d9d1c5; }

.chips, .tags { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  padding: 6px 12px; border-radius: 999px;
  background: rgb(255 255 255 / 7%); border: 1px solid rgb(255 255 255 / 12%);
  font-size: 0.9rem; font-weight: 600; color: var(--ink);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.tags { margin-top: 14px; gap: 6px; }
.tags li {
  padding: 2px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 0.8rem; font-weight: 600; color: var(--muted);
}
.tags .tag-kind { color: var(--accent); border-color: rgb(240 164 41 / 40%); background: rgb(240 164 41 / 9%); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 16px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.95rem; border: 1px solid transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn svg { font-size: 1.2em; stroke-width: 2.2; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 18px rgb(240 164 41 / 22%); }
.btn-primary:hover { background: var(--accent-hi); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--ink); }
.btn-lg { min-height: 52px; padding: 12px 26px; font-size: 1.08rem; border-radius: var(--radius); }

/* Catalog */
main, .mod-body { flex: 1; }
.catalog { padding-top: 48px; padding-bottom: 72px; }
.section-title { font-size: 1.5rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.count { font-family: var(--font); font-size: 0.85rem; font-weight: 700; color: var(--accent-ink); background: var(--accent); border-radius: 999px; padding: 1px 9px; letter-spacing: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }
.card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 20px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { border-color: rgb(240 164 41 / 55%); transform: translateY(-2px); box-shadow: var(--shadow); }
.card-head { display: flex; gap: 14px; align-items: center; }
.card h3 { font-size: 1.35rem; text-transform: uppercase; letter-spacing: 0.02em; }
.card-link { color: var(--ink); }
.card-link:hover { color: var(--ink); }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.meta { margin: 4px 0 0; color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.card-summary { margin: 14px 0 0; color: #d4ccbf; flex: 1; }
.card-actions { position: relative; z-index: 1; display: flex; gap: 8px; margin-top: 18px; }
.card-actions .btn-primary { flex: 1; }

.icon {
  flex: none;
  display: inline-grid; place-items: center;
  width: 56px; height: 56px; border-radius: 12px;
  background: radial-gradient(120% 120% at 20% 10%, #3a2d1a, #1c1712);
  border: 1px solid rgb(240 164 41 / 35%);
  color: var(--accent); font-size: 32px;
}
.icon-lg { width: 104px; height: 104px; border-radius: 20px; font-size: 60px; box-shadow: var(--shadow); }
.icon-lg svg { stroke-width: 1.3; }

/* Mod page header */
.mod-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; align-items: center; }
.mod-title h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); }
.mod-title .lede { margin-top: 12px; font-size: 1.08rem; }
.crumbs { margin: 0 0 8px; font-size: 0.9rem; font-weight: 600; }
.crumbs a { color: var(--muted); }
.crumbs a::before { content: "← "; }
.crumbs a:hover { color: var(--ink); }
.mod-cta { display: grid; gap: 8px; justify-items: center; text-align: center; }

/* Mod page body */
.mod-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; padding-top: 40px; padding-bottom: 72px; align-items: start; }

.prose { min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose h2 {
  font-size: 1.7rem; text-transform: uppercase; letter-spacing: 0.04em;
  margin: 48px 0 16px; padding-top: 20px; border-top: 1px solid var(--line);
}
.prose h2:first-child { border-top: 0; padding-top: 0; }
.prose h3 { font-size: 1.25rem; margin: 28px 0 10px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; max-width: 72ch; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--accent); }
.prose strong { color: #fff6ea; }
.prose blockquote {
  margin: 18px 0; padding: 14px 18px;
  background: rgb(240 164 41 / 8%);
  border: 1px solid rgb(240 164 41 / 25%); border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #e8dcc8;
}
.prose blockquote p { margin: 0; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); }

.table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgb(255 255 255 / 2.5%); }
td:first-child { font-weight: 600; }

.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; margin: 0 0 18px; }
.feature {
  display: grid; gap: 4px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
a.feature:hover { border-color: var(--accent); background: var(--surface-2); color: var(--ink); }
.feature b { font-family: var(--font-display); font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--accent); }
.feature span { color: var(--muted); font-size: 0.92rem; line-height: 1.45; }

.ranks { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.ranks div { padding: 10px 2px; text-align: center; border-right: 1px solid rgb(0 0 0 / 30%); }
.ranks div:last-child { border-right: 0; }
.ranks b { display: block; font-family: var(--font-display); font-size: 1.25rem; }
.ranks small { display: block; font-size: 0.7rem; opacity: 0.8; font-variant-numeric: tabular-nums; }
.ranks div:nth-child(1) { background: #241f19; }
.ranks div:nth-child(2) { background: #2e2519; }
.ranks div:nth-child(3) { background: #3a2c19; }
.ranks div:nth-child(4) { background: #48331a; }
.ranks div:nth-child(5) { background: #5a3d1b; }
.ranks div:nth-child(6) { background: #6f491c; }
.ranks div:nth-child(7) { background: #87561d; color: #fff3df; }
.ranks div:nth-child(8) { background: #a5661f; color: #fff3df; }
.ranks div:nth-child(9) { background: #c97d22; color: var(--accent-ink); }
.ranks div:nth-child(10) { background: linear-gradient(140deg, var(--accent-hi), var(--accent)); color: var(--accent-ink); }

/* Sidebar */
.sidebar { display: grid; gap: 12px; }
.panel { padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel h2 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 10px; }
.panel p { margin: 0 0 6px; }
.panel ul, .panel ol { margin: 0; padding-left: 1.2em; }
.panel li { margin: 4px 0; font-size: 0.93rem; }
.panel li::marker { color: var(--accent); }
.panel dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 0.93rem; }
.panel dt { color: var(--muted); }
.panel dd { margin: 0; font-weight: 600; text-align: right; }
.steps li { padding-left: 2px; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); font-size: 0.85rem; word-break: break-all; }
.hash { display: grid; gap: 4px; margin-top: 8px !important; }
.hash span { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.hash code { font-size: 0.72rem; word-break: break-all; line-height: 1.45; padding: 6px 8px; }
.toc ul { list-style: none; padding: 0; }
.toc a { color: var(--muted); font-size: 0.93rem; }
.toc a:hover { color: var(--accent); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0 36px; color: var(--muted); font-size: 0.85rem; }
.footer p { margin: 0 0 4px; max-width: 80ch; }

@media (max-width: 920px) {
  .mod-body { grid-template-columns: minmax(0, 1fr); }
  .sidebar { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
  .mod-head { grid-template-columns: auto minmax(0, 1fr); }
  .mod-cta { grid-column: 1 / -1; justify-items: start; text-align: left; }
}

@media (max-width: 600px) {
  .hero-in { padding-top: 44px; padding-bottom: 40px; }
  .hero-catalog .hero-in { padding-top: 64px; padding-bottom: 56px; }
  .mod-head { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .icon-lg { width: 72px; height: 72px; font-size: 42px; border-radius: 16px; }
  .ranks { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .ranks div:nth-child(5) { border-right: 0; }
  .ranks div:nth-child(-n+5) { border-bottom: 1px solid rgb(0 0 0 / 30%); }
  .card-actions { flex-direction: column; }
  .topnav a:not(.lang) { display: none; }
}

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