:root {
  --bs: 14px;              /* block size, set by landing.js */
  --grass-tex: none;       /* data URLs injected by landing.js */
  --dirt-tex: none;
  --orange: #ff9000;
  --mc-face: #8b8b8b;
  --mc-light: #c6c6c6;
  --mc-dark: #373737;
  --pixel-font: "Minecraft", "Press Start 2P", "Lucida Console", "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: #79a6ff;
  color: #fff;
  font-family: var(--pixel-font);
  overflow-x: hidden;
  position: relative;
}

/* ---------- Sky ---------- */
.sky {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #4d84e6 0%, #79a6ff 45%, #b3d5ff 100%);
  z-index: 0;
  overflow: hidden;
}

.sun {
  position: absolute;
  top: 8%;
  right: 12%;
  width: 90px;
  height: 90px;
  background: #fdfbc4;
  box-shadow: 0 0 0 10px rgba(253, 251, 196, 0.35),
              0 0 60px 20px rgba(253, 251, 196, 0.45);
  image-rendering: pixelated;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 40px 0 0 0 rgba(255,255,255,0.92),
              80px 0 0 0 rgba(255,255,255,0.92),
              40px -24px 0 0 rgba(255,255,255,0.92);
  width: 48px;
  height: 24px;
  animation: drift linear infinite;
}
.cloud-1 { top: 14%; left: -200px; animation-duration: 70s; }
.cloud-2 { top: 26%; left: -300px; animation-duration: 95s; animation-delay: -30s; transform: scale(1.4); }
.cloud-3 { top: 40%; left: -260px; animation-duration: 120s; animation-delay: -60s; transform: scale(0.9); }

@keyframes drift {
  from { transform: translateX(0) scale(var(--s, 1)); }
  to   { transform: translateX(calc(100vw + 400px)) scale(var(--s, 1)); }
}

/* ---------- Landing content ---------- */
.landing {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 40px 16px calc(120px + 6vh);
  text-align: center;
}

/* ---------- Block title ---------- */
.block-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bs);
  /* shadow follows the letterforms, not each block, because the gaps
     between blocks are transparent */
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
}

.title-line {
  display: grid;
  justify-content: center;
}

.blk {
  background-image: var(--tex);
  background-size: 100% 100%;
  image-rendering: pixelated;
  animation: drop 420ms cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

.blk-glass {
  box-shadow: 0 0 6px rgba(180, 232, 255, 0.45);
}

@keyframes drop {
  from { transform: translateY(-38px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ---------- Minecraft buttons ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  animation: fadeUp 600ms 1000ms both;
}

.mc-btn {
  display: inline-block;
  padding: 14px 26px;
  font-family: var(--pixel-font);
  font-size: clamp(11px, 2vw, 15px);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
  background: var(--mc-face);
  border: 3px solid;
  border-color: var(--mc-light) var(--mc-dark) var(--mc-dark) var(--mc-light);
  image-rendering: pixelated;
  cursor: pointer;
  transition: background 90ms linear;
}
.mc-btn:hover { background: #a3a3a3; }
.mc-btn:active {
  border-color: var(--mc-dark) var(--mc-light) var(--mc-light) var(--mc-dark);
  transform: translateY(1px);
}

.mc-btn-primary {
  background: var(--orange);
  border-color: #ffc266 #a35c00 #a35c00 #ffc266;
}
.mc-btn-primary:hover { background: #ffa42e; }
.mc-btn-primary:active {
  border-color: #a35c00 #ffc266 #ffc266 #a35c00;
}

@keyframes fadeUp {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* ---------- House ---------- */
.house {
  position: fixed;
  right: 4%;
  /* sits on the grass, foundation sunk one block into it */
  bottom: calc(var(--bs) * 4 - var(--hbs));
  z-index: 1;
  display: grid;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.3));
}

/* ---------- Ground ---------- */
.ground {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--bs) * 4);
  z-index: 1;
  background-image: var(--grass-tex), var(--dirt-tex);
  background-repeat: repeat-x, repeat;
  background-position: top left, top left;
  background-size: var(--bs) var(--bs), var(--bs) var(--bs);
  image-rendering: pixelated;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.25);
}

/* ---------- Music toggle ---------- */
.music-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 5;
  padding: 10px 14px;
  font-family: var(--pixel-font);
  font-size: 12px;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
  background: var(--mc-face);
  border: 3px solid;
  border-color: var(--mc-light) var(--mc-dark) var(--mc-dark) var(--mc-light);
  cursor: pointer;
  image-rendering: pixelated;
}
.music-toggle:hover { background: #a3a3a3; }
.music-toggle:active {
  border-color: var(--mc-dark) var(--mc-light) var(--mc-light) var(--mc-dark);
}
.music-toggle.is-off { opacity: 0.75; }
.music-toggle .note { color: #ffe58a; }

/* ---------- Sound hint ---------- */
.sound-hint {
  position: fixed;
  bottom: calc(var(--bs) * 4 + 18px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 9px 16px;
  font-size: 11px;
  color: #fff;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.25);
  animation: pulse 1.8s ease-in-out infinite;
}
.sound-hint[hidden] { display: none; }

@keyframes pulse {
  0%, 100% { opacity: 0.65; }
  50%      { opacity: 1; }
}

/* Hide the house where it would crowd the centred content */
@media (max-width: 780px) {
  .house { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .blk, .actions { animation: none !important; }
  .cloud { animation: none; }
  .sound-hint { animation: none; }
}
