/* DNA Mods – single stylesheet. No external fonts, no frameworks. */
:root {
  --bg-0: #0d0818;
  --bg-1: #1a1028;
  --panel: #1f1432;
  --panel-2: #271a3d;
  --line: #3a2858;
  --accent: #e88bff;      /* crying-obsidian glow */
  --accent-2: #7a3fbf;    /* deep crying-obsidian purple */
  --text: #d8c8f0;        /* lavender */
  --text-dim: #b3a2cf;
  --white: #fbf6ff;
  --ok: #8be3a6;
  --warn: #ffd27a;
  --radius: 10px;
  --maxw: 1160px;
  --font-head: "Impact", "Haettenschweiler", "Arial Narrow Bold", "Arial Black", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 16px/1.6 var(--font-body);
  background: linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%) fixed;
  background-color: var(--bg-0);
}

img { max-width: 100%; height: auto; display: block; }
.pixel, .pixel img { image-rendering: pixelated; image-rendering: crisp-edges; }
.pixel img { image-rendering: pixelated; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--white); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 400;
  letter-spacing: .02em;
  line-height: 1.15;
  color: var(--white);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 5vw, 3.4rem); text-shadow: 0 0 24px rgba(232, 139, 255, .35), 3px 3px 0 #000; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.2rem); text-shadow: 2px 2px 0 #000; }
h3 { font-size: 1.35rem; text-shadow: 2px 2px 0 #000; }
h2 .accent, h1 .accent { color: var(--accent); }
p { margin: 0 0 1em; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #000; padding: .6em 1em; z-index: 100; font-weight: 700; }
.skip-link:focus { left: 1rem; top: 1rem; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 3.5rem 0; }
.section + .section { border-top: 1px solid rgba(122, 63, 191, .25); }
.lead { font-size: 1.15rem; color: var(--text); max-width: 60ch; }
.muted { color: var(--text-dim); }
.small { font-size: .9rem; }
.center { text-align: center; }

/* ---------- Header / nav ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(13, 8, 24, .92); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--white); margin-right: auto; }
.brand img { width: 36px; height: 36px; image-rendering: pixelated; }
.brand-name { font-family: var(--font-head); font-size: 1.6rem; letter-spacing: .03em; text-shadow: 2px 2px 0 #000; }
.brand-by { font-size: .8rem; color: var(--text-dim); display: block; line-height: 1; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: .4rem .7rem; font: inherit; cursor: pointer; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; flex-wrap: wrap; }
.site-nav a { display: block; padding: .5rem .8rem; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 600; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--panel-2); color: var(--white); }
@media (max-width: 720px) {
  .js .nav-toggle { display: inline-block; }
  .js .site-nav { display: none; width: 100%; padding-bottom: .75rem; }
  .js .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
}

/* ---------- Hero ---------- */
.hero { padding: 3.5rem 0 2.5rem; text-align: center; background: radial-gradient(ellipse at 50% 0%, rgba(122, 63, 191, .45), transparent 65%); }
.hero p.lead { margin: 0 auto 1.5rem; }
.hero-logos { display: flex; justify-content: center; gap: .75rem; flex-wrap: wrap; margin: 1.75rem 0 0; }
.hero-logos img { width: 72px; height: 72px; border-radius: 10px; border: 2px solid var(--line); image-rendering: pixelated; }
.btn-row { display: flex; gap: .75rem; flex-wrap: wrap; justify-content: center; }
.btn-row.left { justify-content: flex-start; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .7rem 1.2rem; min-height: 44px; border-radius: 8px; font-weight: 700; text-decoration: none; border: 2px solid transparent; cursor: pointer; font-size: 1rem; line-height: 1.2; transition: transform .08s ease, background .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #a35ee6, var(--accent-2)); color: var(--white); border-color: #b77bf0; box-shadow: 0 3px 0 #3d1d66, 0 0 18px rgba(232, 139, 255, .25); }
.btn-primary:hover { background: linear-gradient(180deg, #b874f5, #8a4bd1); color: var(--white); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--white); }
.btn[aria-disabled="true"], .btn:disabled { background: #2b2140; color: #a99bc2; border-color: #3a2f50; box-shadow: none; cursor: not-allowed; }
.btn-kofi { background: #ff5e5b; color: #fff; border-color: #ff8a87; }
.btn-kofi:hover { background: #ff7774; color: #fff; }
.btn-patreon { background: #f1465a; color: #fff; border-color: #f77b8a; }
.btn-patreon:hover { background: #ff5c6f; color: #fff; }
.download-row { margin: 1.25rem 0; }

/* ---------- Badges ---------- */
.badges { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; padding: 0; margin: .5rem 0 0; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; border: 1px solid var(--line); background: #150d24; color: var(--text); white-space: nowrap; }
.badge-neoforge { border-color: #c56a2f; color: #ffc49b; }
.badge-forge { border-color: #6a8bd6; color: #b9cdfb; }
.badge-fabric { border-color: #c9b98a; color: #f1e6c3; }
.badge-soon { border-color: var(--warn); color: var(--warn); }
.badge-new { background: var(--accent-2); border-color: var(--accent); color: var(--white); }
.badge-addon { border-color: var(--accent); color: var(--accent); }

/* ---------- Mod cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.25rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.card { background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s ease, box-shadow .15s ease; }
.card:hover { border-color: var(--accent-2); box-shadow: 0 0 24px rgba(122, 63, 191, .35); }
.card-logo { aspect-ratio: 1 / 1; background: #0b0614; }
.card-logo img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin-bottom: .25rem; }
.card h3 a { color: var(--white); text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.card p { color: var(--text-dim); font-size: .95rem; margin: .4rem 0 0; }
.card .btn-row { margin-top: auto; padding-top: 1rem; justify-content: flex-start; }
.card .btn { padding: .55rem .9rem; font-size: .95rem; }

/* ---------- Panels, lists, updates ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; }
.updates { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .8rem; }
.updates li { background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent-2); border-radius: 8px; padding: .8rem 1rem; }
.updates time { display: block; font-size: .8rem; color: var(--text-dim); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.feature-list { padding-left: 1.2rem; margin: 0; }
.feature-list li { margin: .35rem 0; }
.feature-list li::marker { color: var(--accent); }
.two-col { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1fr 1fr; } }

/* ---------- Mod page ---------- */
.breadcrumb { font-size: .9rem; color: var(--text-dim); padding-top: 1.25rem; }
.breadcrumb a { color: var(--text-dim); }
.mod-head { display: grid; grid-template-columns: 1fr; gap: 1.5rem; align-items: center; padding: 1.5rem 0 2rem; }
.mod-head .mod-logo { width: 220px; max-width: 60vw; border-radius: 12px; border: 2px solid var(--line); box-shadow: 0 0 40px rgba(232, 139, 255, .2); image-rendering: pixelated; }
@media (min-width: 760px) { .mod-head { grid-template-columns: 260px 1fr; } .mod-head .mod-logo { width: 260px; } }
.mod-head .lead { margin-bottom: .5rem; }
.notice { border: 1px solid var(--warn); background: rgba(255, 210, 122, .08); color: #ffe7b8; border-radius: 8px; padding: .7rem 1rem; margin: 1rem 0; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.gallery figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery a { display: block; }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #0b0614; transition: transform .2s ease; }
.gallery a:hover img { transform: scale(1.03); }
.gallery figcaption { padding: .55rem .8rem; font-size: .88rem; color: var(--text-dim); }
.sheets { display: grid; gap: 1.25rem; margin-top: 1rem; }
.sheets figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; }
.sheets img { width: 100%; border-radius: 6px; }
.sheets figcaption { padding: .5rem .2rem 0; font-size: .88rem; color: var(--text-dim); }

table.versions { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .95rem; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.versions th, .versions td { padding: .6rem .8rem; text-align: center; border-bottom: 1px solid var(--line); }
.versions th:first-child, .versions td:first-child { text-align: left; }
.versions thead th { background: var(--panel-2); color: var(--white); font-weight: 700; }
.versions .yes { color: var(--ok); font-weight: 700; }
.versions .no { color: #8d7fa6; }
.table-scroll { overflow-x: auto; }

/* CSS crafting grid for simple recipes */
.recipes-inline { display: flex; flex-wrap: wrap; gap: 1.5rem; margin-top: 1rem; }
.recipe { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.recipe h3 { font-size: 1.1rem; }
.recipe-body { display: flex; align-items: center; gap: .8rem; }
.craft-grid { display: grid; grid-template-columns: repeat(3, 76px); grid-template-rows: repeat(3, 56px); gap: 4px; background: #8b8b8b; padding: 6px; border: 3px solid #373737; border-radius: 4px; }
.craft-grid span { background: #c6c6c6; color: #1b1b1b; font-size: .72rem; font-weight: 700; line-height: 1.1; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2px; border: 2px solid; border-color: #373737 #fff #fff #373737; }
.craft-grid span:empty { background: #8b8b8b; border-color: #5a5a5a #a8a8a8 #a8a8a8 #5a5a5a; }
.craft-arrow { font-size: 2rem; color: var(--text-dim); }
.craft-out { background: #c6c6c6; color: #1b1b1b; font-weight: 700; font-size: .8rem; width: 92px; min-height: 64px; display: flex; align-items: center; justify-content: center; text-align: center; border: 3px solid #373737; border-radius: 4px; padding: 4px; }
@media (max-width: 480px) { .craft-grid { grid-template-columns: repeat(3, 62px); } .recipe-body { flex-wrap: wrap; } }

/* ---------- Ad slots (hidden until AdSense is configured in site.js) ---------- */
.ad-slot { margin: 2.5rem auto; max-width: 970px; min-height: 280px; padding: .4rem; border: 1px dashed rgba(122, 63, 191, .35); border-radius: 8px; text-align: center; contain: layout; }
.ad-slot::before { content: "Advertisement"; display: block; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #8d7fa6; margin-bottom: .3rem; }
.ad-slot.ad-footer { min-height: 120px; }
.ad-slot[hidden], .ads-off .ad-slot { display: none !important; }
@media (max-width: 600px) { .ad-slot { min-height: 300px; } .ad-slot.ad-footer { min-height: 120px; } }

/* ---------- Donate ---------- */
.donate { text-align: center; background: radial-gradient(ellipse at 50% 100%, rgba(122, 63, 191, .35), transparent 70%); }
.donate .btn-row { margin-top: 1rem; }
[data-donate-link][hidden] { display: none !important; }

/* ---------- Prose pages ---------- */
.prose { max-width: 78ch; }
.prose h2 { margin-top: 2rem; font-size: 1.6rem; }
.prose h3 { margin-top: 1.4rem; font-size: 1.2rem; }
.prose ul { padding-left: 1.25rem; }
.prose li { margin: .3rem 0; }
.template-note { border-left: 4px solid var(--warn); background: rgba(255, 210, 122, .07); padding: .7rem 1rem; border-radius: 6px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: #0a0613; padding: 2rem 0 2.5rem; margin-top: 2rem; font-size: .92rem; color: var(--text-dim); }
.footer-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.site-footer h2 { font-size: 1.15rem; margin-bottom: .4rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: .25rem 0; }
.site-footer a { color: var(--text); }
.site-footer a:hover { color: var(--accent); }
.fineprint { margin-top: 1.5rem; font-size: .8rem; color: #9c8db8; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(5, 2, 10, .92); display: flex; align-items: center; justify-content: center; padding: 3.5rem 1rem 1rem; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: min(1600px, 96vw); text-align: center; }
.lightbox img { max-width: 100%; max-height: 82vh; width: auto; margin: 0 auto; border-radius: 6px; box-shadow: 0 0 40px rgba(122, 63, 191, .5); }
.lightbox figcaption { color: var(--text); margin-top: .6rem; }
.lightbox button { position: absolute; background: var(--panel-2); color: var(--white); border: 1px solid var(--line); border-radius: 8px; font-size: 1.4rem; width: 48px; height: 48px; cursor: pointer; }
.lightbox button:hover { border-color: var(--accent); }
.lb-close { top: .75rem; right: .75rem; }
.lb-prev { left: .75rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: .75rem; top: 50%; transform: translateY(-50%); }
body.lb-open { overflow: hidden; }

/* 404 */
.not-found { text-align: center; padding: 5rem 0; }
.not-found .big { font-family: var(--font-head); font-size: clamp(5rem, 18vw, 9rem); color: var(--accent); text-shadow: 4px 4px 0 #000, 0 0 40px rgba(232, 139, 255, .4); line-height: 1; }

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

/* Compact cards on phones: small logo beside the text instead of a full-width square */
@media (max-width: 560px) {
  .card { display: grid; grid-template-columns: 96px 1fr; align-items: start; }
  .card-logo { margin: 1rem 0 0 1rem; width: 80px; height: 80px; border-radius: 8px; overflow: hidden; }
  .card-body { padding: 1rem; }
  .card .btn-row { grid-column: 1 / -1; }
  .hero-logos img { width: 56px; height: 56px; }
}
