/* ============================================================
   minecraftcalculators.com — shared styles
   Blocky, pixel-edged design system. No rounded corners, hard
   shadows, chunky borders. Original palette (not Mojang's UI).
   ============================================================ */

:root {
  --bg: #e9e6da;
  --card: #f7f5ec;
  --ink: #23262a;
  --ink-soft: #5c6066;
  --line: #23262a;
  --grass: #57a63c;
  --grass-dark: #3e7e2b;
  --dirt: #7a4e2b;
  --gold: #e0a62e;
  --portal: #9c5bd1;
  --redstone: #d34b3a;
  --lapis: #3a5bd9;
  --diamond: #3bbdc4;
  --accent: var(--grass);
  --shadow: rgba(35, 38, 42, 0.18);
  --px: 4px; /* base pixel unit */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  /* faint block grid, like looking at chunk borders */
  background-image:
    linear-gradient(rgba(35,38,42,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(35,38,42,0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  color: var(--ink);
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

/* ---------- header ---------- */
.site-header {
  background: var(--ink);
  color: #f2efe4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: var(--px) solid var(--grass);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "Silkscreen", monospace;
  font-size: 15px;
  letter-spacing: 0.5px;
  color: #f2efe4;
  text-decoration: none;
}

.logo b { color: var(--grass); font-weight: 400; }

.logo svg { display: block; }

.header-link {
  font-family: "Silkscreen", monospace;
  font-size: 11px;
  color: #f2efe4;
  text-decoration: none;
  background: transparent;
  border: 2px solid #f2efe4;
  padding: 7px 12px 5px;
  box-shadow: 3px 3px 0 rgba(0,0,0,0.4);
}

.header-link:hover { background: var(--grass); border-color: var(--grass); color: var(--ink); }
.header-link:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(0,0,0,0.4); }

/* ---------- layout ---------- */
.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 20px 72px;
}

.page-narrow { max-width: 760px; }

/* ---------- type ---------- */
h1 {
  font-family: "Silkscreen", monospace;
  font-weight: 400;
  font-size: clamp(22px, 4.4vw, 34px);
  line-height: 1.25;
  margin: 0 0 10px;
}

h1 .hl { color: var(--accent); }

.lede {
  color: var(--ink-soft);
  font-size: 18px;
  max-width: 58ch;
  margin: 0 0 36px;
}

h2 {
  font-family: "Silkscreen", monospace;
  font-weight: 400;
  font-size: 16px;
  margin: 40px 0 14px;
}

a { color: var(--grass-dark); }

/* ---------- signature: grass-top cards ---------- */
.card {
  background: var(--card);
  border: 3px solid var(--line);
  box-shadow: 6px 6px 0 var(--shadow);
  position: relative;
}

.card-top {
  height: 12px;
  background: var(--accent);
  position: relative;
}

/* jagged pixel edge hanging off the strip, like grass over dirt */
.card-top::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 6px;
  background-image: linear-gradient(90deg, var(--accent) 50%, transparent 50%);
  background-size: 12px 6px;
}

.card-body { padding: 26px 24px 24px; }

/* ---------- home grid ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 26px;
}

a.tool-card {
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: transform 0.06s ease-out, box-shadow 0.06s ease-out;
}

a.tool-card:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--shadow); }
a.tool-card:active { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--shadow); }
a.tool-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.tool-card h3 {
  font-family: "Silkscreen", monospace;
  font-weight: 400;
  font-size: 13px;
  margin: 0 0 8px;
}

.tool-card p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.5; }

/* ---------- forms ---------- */
.calc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
  align-items: start;
}

@media (max-width: 720px) { .calc { grid-template-columns: 1fr; } }

label {
  display: block;
  font-family: "Silkscreen", monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0 0 6px;
  color: var(--ink-soft);
}

input[type="number"], input[type="text"], select {
  width: 100%;
  font-family: "IBM Plex Mono", monospace;
  font-size: 17px;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--line);
  padding: 10px 12px;
  border-radius: 0;
  appearance: none;
}

input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.field { margin-bottom: 16px; }

.field-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.field-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

fieldset {
  border: 3px solid var(--line);
  padding: 16px;
  margin: 0 0 18px;
  background: rgba(255,255,255,0.4);
}

legend {
  font-family: "Silkscreen", monospace;
  font-size: 11px;
  padding: 0 8px;
}

/* buttons */
.btn {
  font-family: "Silkscreen", monospace;
  font-size: 12px;
  color: var(--ink);
  background: var(--accent);
  border: 3px solid var(--line);
  padding: 11px 18px 9px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--shadow);
  border-radius: 0;
}

.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--shadow); }

.btn-quiet {
  background: transparent;
  box-shadow: none;
  border-width: 2px;
  padding: 8px 12px 6px;
  font-size: 10px;
}

/* toggle row (radio-as-buttons) */
.seg { display: flex; gap: 0; margin-bottom: 18px; flex-wrap: wrap; }
.seg input { position: absolute; opacity: 0; }
.seg label {
  font-size: 10px;
  margin: 0;
  color: var(--ink);
  border: 3px solid var(--line);
  padding: 9px 14px 7px;
  cursor: pointer;
  background: #fff;
  margin-right: -3px;
}
.seg input:checked + label { background: var(--accent); }
.seg input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- results ---------- */
.result {
  font-family: "IBM Plex Mono", monospace;
}

.result-big {
  font-size: clamp(22px, 3.6vw, 30px);
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.result-label {
  font-family: "Silkscreen", monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--ink-soft);
  margin: 18px 0 4px;
}

.result-label:first-child { margin-top: 0; }

.result-sub { color: var(--ink-soft); font-size: 14px; }

.stat-list { margin: 0; padding: 0; list-style: none; }
.stat-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 2px dashed rgba(35,38,42,0.2);
  font-size: 15px;
}
.stat-list li:last-child { border-bottom: 0; }
.stat-list .v { font-family: "IBM Plex Mono", monospace; font-weight: 600; text-align: right; }

/* ---------- notes / how it works ---------- */
.note {
  margin-top: 34px;
  padding: 18px 20px;
  background: rgba(255,255,255,0.5);
  border-left: 6px solid var(--accent);
  font-size: 15px;
  color: var(--ink-soft);
}

.note b { color: var(--ink); }

code {
  font-family: "IBM Plex Mono", monospace;
  background: rgba(35,38,42,0.08);
  padding: 1px 5px;
  font-size: 0.92em;
}

/* ---------- canvas (circle generator) ---------- */
.canvas-wrap {
  border: 3px solid var(--line);
  background: #fff;
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 10px;
  display: grid;
  place-items: center;
}

canvas { image-rendering: pixelated; max-width: 100%; height: auto; }

/* ---------- breadcrumb ---------- */
.crumb {
  font-family: "Silkscreen", monospace;
  font-size: 10px;
  margin-bottom: 22px;
}
.crumb a { color: var(--ink-soft); text-decoration: none; }
.crumb a:hover { color: var(--grass-dark); }

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink);
  color: #b9bcc0;
  font-size: 13px;
  padding: 26px 24px 60px;
  text-align: center;
  border-top: var(--px) solid var(--dirt);
  position: relative;
}

/* bedrock-ish pixel noise strip at the very bottom */
.site-footer::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 18px;
  background-image:
    linear-gradient(90deg, #17191c 25%, transparent 25%),
    linear-gradient(90deg, transparent 50%, #2d3136 50%, #2d3136 75%, transparent 75%);
  background-size: 24px 18px, 48px 18px;
  background-color: #202329;
}

.site-footer a { color: #dfe2d8; }
.site-footer p { margin: 4px 0; }

/* per-page accents */
main[data-accent="grass"]    { --accent: var(--grass); }
main[data-accent="portal"]   { --accent: var(--portal); }
main[data-accent="redstone"] { --accent: var(--redstone); }
main[data-accent="lapis"]    { --accent: var(--lapis); }
main[data-accent="gold"]     { --accent: var(--gold); }
main[data-accent="diamond"]  { --accent: var(--diamond); }
main[data-accent="dirt"]     { --accent: var(--dirt); }

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  a.tool-card, .btn, .header-link { transition: none; }
}
