/* ============================================================
   MOSWAY — 02. BASE (reset, typography, utilities, a11y)
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 18px);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--ink);
  background:
    var(--tex-grid),
    radial-gradient(1200px 600px at 85% -5%, rgba(68, 189, 50, .12), transparent 60%),
    radial-gradient(900px 500px at 5% 20%, rgba(75, 207, 250, .08), transparent 60%),
    var(--bg-0);
  background-size: 42px 42px, auto, auto, auto;
  overflow-x: hidden;
  min-width: 200px;
  transition: background-color var(--speed-2) var(--ease-smooth), color var(--speed-2);
}

[data-realm="nether"] body, body[data-realm="nether"] { background-size: 42px 42px, auto, auto, auto; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul, ol { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Crosshair cursor on precise pointers only */
@media (pointer: fine) {
  body { cursor: crosshair; }
  a, button, .mob, .card-tilt, summary { cursor: pointer; }
  input, textarea, select { cursor: text; }
}

/* ---- Selection & scrollbar ---- */
::selection { background: var(--accent); color: #06130a; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--mc-grass-hi), var(--mc-grass) 40%, var(--mc-dirt));
  border: 2px solid var(--bg-1);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---- Type ---- */
h1, h2, h3, h4 { line-height: 1.25; text-wrap: balance; }
.font-pixel { font-family: var(--font-pixel); letter-spacing: .02em; }
.font-display { font-family: var(--font-display); }

.section-kicker {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-pixel);
  font-size: clamp(.62rem, .58rem + .35vw, .8rem);
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--accent-2);
  background: rgba(0, 0, 0, .4);
  border: 2px solid var(--line);
  border-top-color: rgba(255, 255, 255, .22);
  padding: .5rem .9rem;
  border-radius: 4px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .5);
}
.section-kicker .dot { width: .6em; height: .6em; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: blink 1.6s steps(2) infinite; }

.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  margin: 1rem 0 .7rem;
  text-shadow: 3px 3px 0 #000;
}
.section-title .hl { color: var(--accent); }
.section-title .hl-gold { color: var(--accent-2); }
.section-title .hl-dia { color: var(--accent-3); }
.section-sub { color: var(--ink-dim); max-width: 62ch; }
.section-head { margin-bottom: clamp(1.6rem, 1.2rem + 2.4vw, 3rem); }
.section-head.center { text-align: center; }
.section-head.center .section-sub { margin-inline: auto; }

.lead { font-size: clamp(1rem, .94rem + .4vw, 1.2rem); color: var(--ink-dim); }
.muted { color: var(--ink-mute); }
.tiny { font-size: var(--fs-small); }

/* ---- Layout helpers ---- */
.wrap { width: var(--wrap); margin-inline: auto; }
.section { padding-block: var(--section-pad); position: relative; }
.grid { display: grid; gap: clamp(1rem, .8rem + 1.4vw, 1.8rem); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.flex { display: flex; } .flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; } .justify-between { justify-content: space-between; }
.gap-1 { gap: .6rem; } .gap-2 { gap: 1.1rem; } .gap-3 { gap: 1.8rem; }
.mt-1 { margin-top: .6rem; } .mt-2 { margin-top: 1.2rem; } .mt-3 { margin-top: 2rem; }
.center { text-align: center; }

/* ---- Minecraft panel ---- */
.mc-panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: var(--border-w) solid #000;
  outline: 2px solid var(--line);
  outline-offset: -5px;
  border-radius: 6px;
  box-shadow: var(--card-shadow), inset 0 2px 0 rgba(255, 255, 255, .09);
  position: relative;
}
.mc-panel--dirt {
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 3px, transparent 3px 9px),
    linear-gradient(180deg, #4a3420, #2b1f12);
}

/* Pixel corners */
.pixel-corners { clip-path: polygon(0 8px, 8px 8px, 8px 0, calc(100% - 8px) 0, calc(100% - 8px) 8px, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 8px calc(100% - 8px), 0 calc(100% - 8px)); }

/* ---- Accessibility ---- */
.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 9999;
  background: var(--accent); color: #06130a; font-weight: 800;
  padding: .6rem 1rem; border-radius: 6px; transition: top .2s;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 3px; border-radius: 4px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
