@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap');

:root{
  --bg: #201d1a;
  --bg-deep: #171513;
  --panel: #2a2521;
  --panel-2: #322c26;
  --line: #443c33;
  --text: #ece6da;
  --muted: #a89e8c;
  --grass: #6cb83e;
  --grass-dark: #4a8e28;
  --gold: #e8c547;
  --redstone: #c93a2a;
  --lapis: #3f6fc9;
  --radius: 3px;
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(108,184,62,0.08), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(232,197,71,0.06), transparent 55%),
    var(--bg);
  color:var(--text);
  font-family:'Inter', sans-serif;
  line-height:1.55;
  min-height:100vh;
}
a{color:inherit;text-decoration:none;}
button{font-family:inherit;}
::selection{background:var(--grass-dark); color:#fff;}

.pixel{font-family:'Press Start 2P', monospace;}

/* ---------- Layout shell ---------- */
.shell{
  display:grid;
  grid-template-columns: 240px 1fr;
  min-height:100vh;
}
@media (max-width: 860px){
  .shell{grid-template-columns: 1fr;}
  .sidebar{position:static; height:auto; border-right:none; border-bottom:1px solid var(--line);}
}

/* ---------- Sidebar ---------- */
.sidebar{
  position:sticky; top:0; height:100vh; overflow-y:auto;
  background:var(--bg-deep);
  border-right:1px solid var(--line);
  padding:20px 14px 40px;
}
.brand{
  display:flex; align-items:center; gap:10px;
  padding:6px 4px 22px;
  cursor:pointer;
}
.brand-mark{
  width:30px;height:30px;flex:none;position:relative;
  background:linear-gradient(160deg, var(--grass) 0 45%, var(--gold) 45% 100%);
  box-shadow: inset -4px -4px 0 rgba(0,0,0,0.28), inset 3px 3px 0 rgba(255,255,255,0.18);
  image-rendering:pixelated;
}
.brand-text{font-size:12px; line-height:1.4;}
.brand-text b{display:block; font-size:13px; letter-spacing:0.5px;}
.brand-text span{color:var(--muted); font-size:10px;}

.side-search{
  display:flex; align-items:center; gap:8px;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:9px 10px;
  margin-bottom:22px;
}
.side-search input{
  background:none; border:none; outline:none; color:var(--text);
  font-size:13px; width:100%; font-family:inherit;
}
.side-search input::placeholder{color:var(--muted);}
.side-search svg{flex:none; opacity:0.6;}

.nav-label{
  font-size:10px; letter-spacing:1.5px; color:var(--muted);
  margin:0 0 8px 4px; text-transform:uppercase;
}
.nav-list{list-style:none; margin:0 0 26px; padding:0; display:flex; flex-direction:column; gap:2px;}
.nav-item{
  display:flex; align-items:center; gap:10px;
  padding:8px 10px; border-radius:var(--radius);
  font-size:13.5px; color:var(--muted);
  cursor:pointer; border:1px solid transparent;
}
.nav-item:hover{background:var(--panel); color:var(--text);}
.nav-item.active{background:var(--panel-2); color:var(--text); border-color:var(--line);}
.nav-swatch{width:12px;height:12px;flex:none; box-shadow: inset -2px -2px 0 rgba(0,0,0,0.3), inset 2px 2px 0 rgba(255,255,255,0.15);}
.nav-count{margin-left:auto; font-size:10px; color:var(--muted); font-family:'JetBrains Mono',monospace;}

.side-footer{font-size:10.5px; color:var(--muted); padding:0 4px; border-top:1px solid var(--line); padding-top:14px;}

/* ---------- Main ---------- */
.main{padding: 34px 40px 80px; max-width: 1120px;}
@media (max-width:640px){ .main{padding:22px 16px 60px;} }

.crumbs{font-size:12px; color:var(--muted); margin-bottom:18px;}
.crumbs a:hover{color:var(--gold);}
.crumbs .sep{margin:0 6px; opacity:0.5;}

/* Home hero */
.hero{
  border:1px solid var(--line);
  background:linear-gradient(135deg, var(--panel) 0%, var(--panel-2) 100%);
  border-radius:4px;
  padding:40px 36px;
  margin-bottom:30px;
  position:relative;
  overflow:hidden;
}
.hero::after{
  content:"";
  position:absolute; right:-40px; top:-40px; width:220px; height:220px;
  background:
    repeating-linear-gradient(45deg, rgba(232,197,71,0.06) 0 10px, transparent 10px 20px);
  border-radius:50%;
  pointer-events:none;
}
.hero-eyebrow{font-size:10px; letter-spacing:2px; color:var(--grass); text-transform:uppercase; margin-bottom:14px;}
.hero h1{font-size:22px; margin:0 0 14px; line-height:1.5; max-width:640px;}
.hero p.sub{color:var(--muted); max-width:560px; margin:0 0 22px; font-size:14.5px;}
.hero-stats{display:flex; gap:26px; flex-wrap:wrap;}
.hero-stat b{display:block; font-size:20px; font-family:'JetBrains Mono',monospace; color:var(--gold);}
.hero-stat span{font-size:11px; color:var(--muted); letter-spacing:0.5px;}

.btn-random{
  margin-top:24px;
  display:inline-flex; align-items:center; gap:8px;
  background:var(--grass-dark); color:#fff; border:none;
  padding:10px 16px; border-radius:var(--radius); font-size:13px; font-weight:600;
  cursor:pointer;
  box-shadow: inset -3px -3px 0 rgba(0,0,0,0.2), inset 3px 3px 0 rgba(255,255,255,0.15);
}
.btn-random:hover{filter:brightness(1.08);}

.section-title{
  font-size:11px; letter-spacing:1.5px; text-transform:uppercase; color:var(--muted);
  margin: 32px 0 14px; display:flex; align-items:center; gap:10px;
}
.section-title::after{content:""; flex:1; height:1px; background:var(--line);}

/* Card grid (crafting-slot style) */
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(200px,1fr));
  gap:12px;
}
.card{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px;
  cursor:pointer;
  display:flex; gap:12px; align-items:flex-start;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.card:hover{border-color:var(--gold); background:var(--panel-2); transform:translateY(-2px);}
.card-title{font-size:13.5px; font-weight:600; margin:0 0 4px;}
.card-tag{font-size:10px; color:var(--muted); text-transform:uppercase; letter-spacing:0.5px;}
.card-tagline{font-size:12px; color:var(--muted); margin-top:6px; line-height:1.4;}

/* block icon (pixel cube) */
.icon{
  width:38px; height:38px; flex:none; position:relative; image-rendering:pixelated;
  box-shadow: inset -5px -5px 0 rgba(0,0,0,0.32), inset 4px 4px 0 rgba(255,255,255,0.16);
  border-radius:2px;
}
.icon.lg{width:84px; height:84px; border-radius:3px;}

/* Article */
.article-head{display:flex; gap:22px; align-items:flex-start; margin-bottom:8px; flex-wrap:wrap;}
.article-title h1{font-size:26px; margin:0 0 6px;}
.article-title .tag{
  display:inline-block; font-size:10px; letter-spacing:1px; text-transform:uppercase;
  color:var(--bg-deep); background:var(--gold); padding:3px 8px; border-radius:2px; font-weight:700; margin-bottom:10px;
}
.article-tagline{color:var(--muted); font-size:14.5px; max-width:600px;}

.article-layout{display:grid; grid-template-columns: 1fr 280px; gap:32px; margin-top:26px;}
@media (max-width:760px){ .article-layout{grid-template-columns:1fr;} }

.article-body h2{font-size:15px; margin:26px 0 10px; padding-bottom:8px; border-bottom:1px solid var(--line);}
.article-body h2:first-child{margin-top:0;}
.article-body p{font-size:14.5px; color:#d9d2c4; margin:0 0 14px;}

.infobox{
  background:var(--panel); border:1px solid var(--line); border-radius:4px;
  padding:16px; height:fit-content;
}
.infobox-header{display:flex; flex-direction:column; align-items:center; text-align:center; gap:10px; padding-bottom:14px; margin-bottom:12px; border-bottom:1px solid var(--line);}
.infobox-header b{font-size:14px;}
.infobox table{width:100%; border-collapse:collapse; font-size:12px;}
.infobox tr{border-bottom:1px solid var(--line);}
.infobox tr:last-child{border-bottom:none;}
.infobox td{padding:8px 2px; vertical-align:top;}
.infobox td:first-child{color:var(--muted); width:46%;}
.infobox td:last-child{text-align:right; font-family:'JetBrains Mono', monospace; font-size:11px;}

.related{margin-top:30px;}
.related-list{display:flex; flex-wrap:wrap; gap:8px;}
.chip{
  border:1px solid var(--line); background:var(--panel);
  padding:7px 12px; border-radius:20px; font-size:12.5px; cursor:pointer; display:flex; align-items:center; gap:7px;
}
.chip:hover{border-color:var(--grass); color:var(--grass);}
.chip .dot{width:8px;height:8px;border-radius:50%;}

/* search results page */
.result-count{color:var(--muted); font-size:13px; margin-bottom:16px;}
.empty{color:var(--muted); font-size:13.5px; padding:30px 0; text-align:center;}

/* Scrollbar */
.sidebar::-webkit-scrollbar{width:8px;}
.sidebar::-webkit-scrollbar-thumb{background:var(--line); border-radius:4px;}

.mobile-topbar{display:none;}
@media (max-width:860px){
  .mobile-topbar{
    display:flex; align-items:center; justify-content:space-between;
    padding:14px 16px; border-bottom:1px solid var(--line); background:var(--bg-deep);
  }
}
