/* PvP Mod — site styles.
 *
 * Deliberately built out of the game's own assets so the site and the app read
 * as one thing: the real extracted Minecraft dirt/stone tiles, the real
 * nine-slice `widget/button` sprite, and Monocraft (the pixel font the game's
 * UI uses). Owner's call, 2026-07-26 — see the note in web/README.md about what
 * that means for a public page.
 *
 * Two Minecraft rendering rules this file reproduces rather than approximates:
 *   1. Text shadow is the text colour at 25% brightness, offset by one "pixel"
 *      (Minecraft's Font renderer). Not a soft blur — a hard offset copy.
 *   2. Widget sprites are nine-slice with a 3px border (button.png.mcmeta),
 *      scaled by an integer factor. CSS border-image does this natively; the
 *      3px slice becomes 9px at our 3x scale.
 */

@font-face {
  font-family: "Monocraft";
  src: url("/assets/Monocraft.ttf") format("truetype");
  font-display: swap;
}

:root {
  --scale: 3;
  --text: #ffffff;
  --text-dim: #a8a8a8;
  --text-shadow: #3f3f3f;      /* #ffffff * 0.25, Minecraft's own shadow rule */
  --gold: #ffaa00;             /* Minecraft §6 */
  --green: #55ff55;            /* Minecraft §a */
  --red: #aa4444;
  --panel: rgba(16, 16, 16, 0.82);
  --bevel-light: #6d6d6d;
  --bevel-dark: #191919;
  --measure: 62ch;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Monocraft", ui-monospace, "Courier New", monospace;
  font-size: clamp(15px, 1.1vw + 11px, 18px);
  line-height: 1.7;
  color: var(--text);
  text-shadow: 2px 2px 0 var(--text-shadow);

  /* Minecraft's own menu background: tiled dirt, darkened. */
  background-color: #1a1a1a;
  background-image: url("/assets/dirt.png");
  background-repeat: repeat;
  background-size: 48px 48px;   /* 16px source at 3x — integer, so it stays crisp */
  background-attachment: fixed;
}

/* The darkening pass over the dirt. A separate fixed layer rather than a
   gradient on <body>, so the tile scale stays independent of page height. */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  pointer-events: none;
  z-index: -1;
}

img {
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;   /* never smooth a 16px texture */
}

a { color: var(--gold); }
a:hover, a:focus-visible { color: #ffd257; }

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

/* ---------------------------------------------------------------- layout -- */

header, main, footer {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero {
  text-align: center;
  padding-top: 64px;
  padding-bottom: 40px;
}

.logo {
  font-size: clamp(48px, 9vw, 104px);
  line-height: 1.05;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
  color: var(--text);
  /* A chunkier shadow for the wordmark — same rule, scaled with the type. */
  text-shadow: 6px 6px 0 var(--text-shadow);
}

.tagline {
  font-size: clamp(16px, 2vw, 22px);
  color: var(--gold);
  text-shadow: 2px 2px 0 #3f2a00;   /* the gold at 25%, per the same rule */
  margin: 0 0 36px;
}

.pitch {
  max-width: var(--measure);
  margin: 32px auto;
  color: var(--text-dim);
  text-shadow: 2px 2px 0 #2a2a2a;
}

.fineprint {
  font-size: 0.82em;
  color: var(--text-dim);
  text-shadow: 2px 2px 0 #2a2a2a;
  margin-top: 16px;
}

main { padding-bottom: 40px; }

/* ---------------------------------------------------------------- panels -- */

/* Minecraft's container bevel: a light top/left edge and a dark bottom/right
   one over a tiled stone field. */
.panel {
  position: relative;
  margin: 40px 0;
  padding: 28px 32px;
  /* Tiled stone under a flat dark wash. The wash is a gradient layer rather
     than a blended background-color: `background-blend-mode: multiply` against
     a near-black colour would crush the texture to solid black, which is
     exactly the detail worth keeping. */
  background-color: #101010;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.78)),
    url("/assets/stone.png");
  background-size: auto, 48px 48px;
  border-top: 3px solid var(--bevel-light);
  border-left: 3px solid var(--bevel-light);
  border-bottom: 3px solid var(--bevel-dark);
  border-right: 3px solid var(--bevel-dark);
}

.panel h2 {
  margin: 0 0 20px;
  font-size: clamp(22px, 3vw, 30px);
  color: var(--gold);
  text-shadow: 3px 3px 0 #3f2a00;
}

.panel p, .panel li { max-width: var(--measure); }
.panel p:last-child { margin-bottom: 0; }

.panel ul { padding-left: 1.4em; }
.panel li { margin-bottom: 10px; }

.bugs strong { color: var(--red); }

/* -------------------------------------------------------------- features -- */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(272px, 1fr));
  gap: 20px;
  margin: 40px 0;
}

.feature {
  padding: 22px 24px;
  background: var(--panel);
  border-top: 3px solid var(--bevel-light);
  border-left: 3px solid var(--bevel-light);
  border-bottom: 3px solid var(--bevel-dark);
  border-right: 3px solid var(--bevel-dark);
}

.feature h3 {
  margin: 0 0 10px;
  font-size: 1.05em;
  color: var(--green);
  text-shadow: 2px 2px 0 #153f15;
}

.feature p {
  margin: 0;
  font-size: 0.92em;
  color: var(--text-dim);
  text-shadow: 2px 2px 0 #2a2a2a;
}

/* ----------------------------------------------------------- screenshots -- */

/* Screenshots carry their own bevel frame so a dark in-game shot doesn't just
   dissolve into the dark page. */
.shot-frame {
  margin: 0;
  border-top: 3px solid var(--bevel-light);
  border-left: 3px solid var(--bevel-light);
  border-bottom: 3px solid var(--bevel-dark);
  border-right: 3px solid var(--bevel-dark);
  background: #000;
  line-height: 0;              /* kill the inline-image descender gap */
}

.shot-frame img { display: block; width: 100%; }

.hero-shot { margin: 8px 0 4px; }

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.shot-frame figcaption {
  padding: 10px 14px;
  font-size: 0.82em;
  line-height: 1.5;
  color: var(--text-dim);
  text-shadow: 2px 2px 0 #2a2a2a;
  background: rgba(0, 0, 0, 0.6);
}

/* ------------------------------------------------------------- buttons ---- */

/* The real `widget/button` sprite, nine-sliced exactly as its .mcmeta declares
   (200x20 source, 3px border) and scaled 3x. `repeat` matches Minecraft's own
   nine-slice, which tiles the edges rather than stretching them. */
.mc-button {
  display: inline-block;
  min-width: 300px;
  padding: 16px 32px;
  margin: 8px 0;

  font-family: inherit;
  font-size: 1.06em;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  text-shadow: 2px 2px 0 var(--text-shadow);

  border: 9px solid transparent;         /* 3px slice * 3x scale */
  border-image-source: url("/assets/button.png");
  border-image-slice: 3 fill;
  border-image-width: 9px;
  border-image-repeat: repeat;
  image-rendering: pixelated;

  cursor: pointer;
}

.mc-button:hover,
.mc-button:focus-visible {
  border-image-source: url("/assets/button_highlighted.png");
  color: var(--text);
}

/* Minecraft's own disabled-button treatment: the `button_disabled` sprite with
   greyed label text. Used for "Sign in to download" until the ownership gate
   exists — the button has to read as a real thing that isn't ready yet, not as
   a live link that 404s. */
.mc-button.disabled {
  border-image-source: url("/assets/button_disabled.png");
  color: #a0a0a0;
  text-shadow: 2px 2px 0 #282828;
  cursor: not-allowed;
}

.mc-button.primary {
  min-width: 380px;
  font-size: 1.2em;
  padding: 20px 32px;
}

@media (max-width: 420px) {
  .mc-button, .mc-button.primary { min-width: 0; width: 100%; }
}

/* -------------------------------------------------------------- footer ---- */

footer {
  padding-top: 32px;
  padding-bottom: 56px;
  text-align: center;
  border-top: 3px solid var(--bevel-dark);
  margin-top: 40px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  margin-bottom: 24px;
}

.disclaimer {
  max-width: 66ch;
  margin: 12px auto;
  font-size: 0.74em;
  line-height: 1.6;
  color: #7a7a7a;
  text-shadow: 2px 2px 0 #1e1e1e;
}
