/* Grounded - the mod's site (D-112). The look of the mod's machines (D-049): dark steel panels,
   teal data light, amber indicators; recipe slots as the game's own inventory draws them. */

:root {
  --bg: #121418;
  --panel: #1b1f26;
  --panel-2: #222731;
  --line: #2e3542;
  --text: #e6e9ee;
  --muted: #9aa3b2;
  --teal: #27cccc;
  --teal-dim: #1a8f8f;
  --amber: #f0a73a;
  --danger: #e2574c;
  --slot: #8b8b8b;
  --slot-dark: #373737;
  --slot-light: #ffffff;
  --gui: #c6c6c6;
  --radius: 10px;
  --wrap: 1120px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef0f3;
    --panel: #ffffff;
    --panel-2: #f5f6f8;
    --line: #d6dae1;
    --text: #1a1d23;
    --muted: #5b6474;
    --teal: #0e8a8a;
    --teal-dim: #0e8a8a;
    --amber: #b36b00;
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--teal); text-underline-offset: 3px; }
a:hover { color: var(--amber); }
code, .mono { font-family: var(--mono); font-size: 0.86em; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h2 { font-size: clamp(26px, 4vw, 34px); }
h3 { font-size: 20px; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* --- top bar --- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); text-decoration: none; font-size: 19px; }
.brand img { width: 28px; height: 28px; image-rendering: pixelated; }
.nav { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; white-space: nowrap; }
.nav a:hover { color: var(--text); }
.lang { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.lang a, .lang span { padding: 4px 10px; font: 600 13px var(--mono); text-decoration: none; color: var(--muted); }
.lang span { background: var(--panel-2); color: var(--text); }

/* --- hero --- */
.hero { padding: 56px 0 40px; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(40px, 7vw, 68px); letter-spacing: -0.02em; margin-bottom: 0.2em; }
.hero .tagline { font-size: clamp(20px, 2.6vw, 26px); color: var(--teal); margin-bottom: 0.8em; font-weight: 600; }
.hero .lead { color: var(--muted); font-size: 18px; }
.hero figure { margin: 0; text-align: center; }
.hero figure img { width: min(100%, 440px); image-rendering: auto; filter: drop-shadow(0 18px 30px rgb(0 0 0 / 0.45)); }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px; border-radius: 10px; font-weight: 600; text-decoration: none;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
}
.btn.primary { background: var(--teal); border-color: var(--teal); color: #061b1b; }
.btn.primary:hover { background: var(--amber); border-color: var(--amber); color: #1d1300; }
.btn:hover { border-color: var(--amber); color: var(--text); }
.btn small { font: 500 12px var(--mono); opacity: 0.8; }
.reqs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.reqs li { font: 500 13px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; }

/* --- sections --- */
section { padding: 56px 0; border-top: 1px solid var(--line); }
.kicker { font: 600 13px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); margin-bottom: 8px; }
.intro { color: var(--muted); max-width: 760px; font-size: 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin-top: 24px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; min-width: 0;
}
.card h3 { display: flex; align-items: center; gap: 10px; }
.card p:last-child { margin-bottom: 0; }
.card .pillar { font-size: 30px; line-height: 1; }
.muted { color: var(--muted); }
.note {
  border-left: 3px solid var(--amber); background: var(--panel-2);
  padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 16px 0; color: var(--text);
}
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; margin-top: 24px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 40px; margin-bottom: 12px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--panel-2); border: 1px solid var(--line); font: 600 13px var(--mono); color: var(--teal);
}
kbd { font: 600 0.85em var(--mono); background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; }

/* --- items --- */
.chip { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; }
.chip img { width: 22px; height: 22px; object-fit: contain; image-rendering: pixelated; vertical-align: -5px; }
code.was { color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; white-space: nowrap; }

/* --- recipes: the game's crafting grid --- */
.recipe {
  display: grid; grid-template-columns: auto auto auto; align-items: center; gap: 10px 14px;
  justify-content: start; margin: 14px 0; padding: 12px; width: fit-content; max-width: 100%;
  background: var(--gui); border-radius: 6px;
  box-shadow: inset 3px 3px 0 #fff, inset -3px -3px 0 #555;
}
.recipe .grid { display: grid; grid-template-columns: repeat(3, var(--s, 50px)); }
.slot {
  width: var(--s, 50px); height: var(--s, 50px); position: relative; display: grid; place-items: center;
  background: var(--slot);
  box-shadow: inset 2px 2px 0 var(--slot-dark), inset -2px -2px 0 var(--slot-light);
}
.slot img { width: 80%; height: 80%; object-fit: contain; image-rendering: pixelated; grid-area: 1 / 1; }
.slot.out { --s: 62px; }
.slot .count {
  position: absolute; right: 4px; bottom: 1px; font: 700 16px var(--mono); color: #fff;
  text-shadow: 2px 2px 0 #3f3f3f; grid-area: auto;
}
.slot.cycle img { animation: cycle calc(var(--n) * 1.6s) steps(1) infinite; opacity: 0; }
.slot.cycle img:nth-child(1) { animation-delay: 0s; }
.slot.cycle img:nth-child(2) { animation-delay: 1.6s; }
.slot.cycle img:nth-child(3) { animation-delay: 3.2s; }
@keyframes cycle { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 0; } }
.arrow { width: 30px; height: 22px; background: #8b8b8b; clip-path: polygon(0 35%, 60% 35%, 60% 0, 100% 50%, 60% 100%, 60% 65%, 0 65%); }
.recipe figcaption { grid-column: 1 / -1; color: #3f3f3f; font-weight: 700; font-size: 15px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.shapeless { font: 500 12px var(--mono); color: #5a5a5a; }
@media (prefers-reduced-motion: reduce) {
  .slot.cycle img { animation: none; }
  .slot.cycle img:first-child { opacity: 1; }
}

/* --- scenes --- */
.scene { display: block; width: auto; max-height: 260px; margin: 8px auto; image-rendering: auto; filter: drop-shadow(0 12px 18px rgb(0 0 0 / 0.35)); }
figure.shot { margin: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 14px 12px; text-align: center; }
figure.shot figcaption { color: var(--muted); font-size: 14px; margin-top: 8px; }
.builds { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 20px; }
.builds .scene { max-height: 180px; }

/* --- mobs --- */
.group { margin-top: 36px; }
.group > p { color: var(--muted); max-width: 760px; }
.mobs { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.mob {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 10px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
}
.mob img { width: 110px; height: 110px; object-fit: contain; image-rendering: auto; }
.mob-name { font-weight: 600; font-size: 15px; line-height: 1.25; }
.mob code.was { font-size: 11px; }

/* --- footer --- */
footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }

@media (max-width: 820px) {
  .hero .wrap, .two { grid-template-columns: 1fr; }
  .hero { padding-top: 32px; }
  .hero figure { order: -1; }
  .hero figure img { width: min(100%, 320px); }
  /* the sections move to a second row that scrolls sideways */
  .top .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; gap: 6px 16px; justify-content: space-between; }
  .nav { order: 3; flex-basis: 100%; padding-bottom: 10px; }
  html { scroll-padding-top: 104px; }
}
@media (max-width: 420px) {
  body { font-size: 16px; }
  .recipe { --s: 40px; gap: 8px 10px; padding: 10px; }
  .slot.out { --s: 50px; }
  .mobs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
