/* ============================================================================
   LifeCore SMP — design system
   ----------------------------------------------------------------------------
   The brief asks for "Minecraft + modern gaming website", and explicitly not a
   2013 fan page. The way that is resolved here: Minecraft supplies the STRUCTURE
   (slots, panels, bevels, a hotbar) while modern web supplies the SPACING, TYPE
   and MOTION. Pixel styling is confined to borders and interactive chrome. Body
   text is a normal readable sans, never a pixel font - a pixel font at paragraph
   size is the single thing that makes a Minecraft site look amateur.

   Colour comes from the game's own materials rather than the purple/blue gradient
   the brief rules out: grass green, deep stone, emerald, redstone, amethyst,
   netherite. All greens are checked to hold contrast on the dark stone base.
   ============================================================================ */

:root {
  /* -- surfaces: quarried from stone, deepest first -- */
  --void:        #05070a;
  --bedrock:     #0a0d12;
  --deepslate:   #11151c;
  --stone:       #191f28;
  --stone-lit:   #222a35;
  --cobble:      #2c3542;
  --iron:        #3d4757;

  /* -- accents: real Minecraft material colours -- */
  --grass:       #6cc24a;
  --grass-lit:   #8fe063;
  --grass-deep:  #3e8e28;
  --emerald:     #17dd62;
  --diamond:     #4aedd9;
  --gold:        #ffb930;
  --redstone:    #ff4d4d;
  --amethyst:    #b56ef0;
  --netherite:   #6b5b5b;
  --xp:          #7fe82a;

  /* -- text -- */
  --text:        #e8edf3;
  --text-soft:   #9fb0c3;
  --text-dim:    #6b7c90;

  /* -- type -- */
  --font-ui:     'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-pixel:  'Silkscreen', 'Press Start 2P', monospace;
  --font-mono:   'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace;

  /* -- rhythm -- */
  --gap-xs: 6px;  --gap-sm: 12px; --gap-md: 20px;
  --gap-lg: 36px; --gap-xl: 64px; --gap-2xl: 104px;

  --shell: min(1240px, 92vw);
  --ease:  cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --slot-size: 64px;
}

/* ---------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }

/* The [hidden] attribute only sets display:none at the UA level, so ANY explicit
   display rule beats it - and every flex/grid component in this file is such a
   rule. Without this, `el.hidden = true` silently does nothing and elements that
   are supposed to be out of the way keep taking up layout. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bedrock);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  margin: 0 0 var(--gap-sm);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 800;
}
h1 { font-size: clamp(2.6rem, 7vw, 5.2rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.55rem); }
p  { margin: 0 0 var(--gap-sm); color: var(--text-soft); }

::selection { background: var(--grass); color: var(--void); }

/* ---------------------------------------------------------------- scrollbar */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bedrock); }
::-webkit-scrollbar-thumb {
  background: var(--cobble);
  border: 3px solid var(--bedrock);
}
::-webkit-scrollbar-thumb:hover { background: var(--grass-deep); }

/* ============================================================================
   MINECRAFT PRIMITIVES
   The bevel is the whole trick: a light top-left edge and a dark bottom-right
   edge, with no border-radius anywhere. That reads unmistakably as a Minecraft
   GUI while still being flat and modern.
   ============================================================================ */

.mc-panel {
  position: relative;
  background: var(--stone);
  border: 2px solid var(--iron);
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.07),
    inset -2px -2px 0 rgba(0, 0, 0, 0.45),
    0 18px 40px -24px rgba(0, 0, 0, 0.9);
}

.mc-panel--lit { background: var(--stone-lit); }

/* A slot: the inventory cell everything item-like sits in. */
.mc-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--slot-size);
  height: var(--slot-size);
  background: #0f1319;
  border: 2px solid #0a0d12;
  box-shadow:
    inset 2px 2px 0 rgba(0, 0, 0, 0.55),
    inset -2px -2px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease);
}
.mc-slot:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 2px 2px 0 rgba(0, 0, 0, 0.55),
    inset -2px -2px 0 rgba(255, 255, 255, 0.06),
    0 0 0 2px var(--grass), 0 12px 24px -12px var(--grass);
}
.mc-slot__count {
  position: absolute; right: 3px; bottom: 1px;
  font-family: var(--font-pixel); font-size: 11px;
  color: #fff; text-shadow: 2px 2px 0 #3f3f3f;
}

/* Buttons modelled on the in-game button, but sized for the web. */
.mc-btn {
  --btn-bg: var(--cobble);
  --btn-edge: #4d5a6d;
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px;
  background: var(--btn-bg);
  border: 2px solid var(--void);
  box-shadow:
    inset 2px 2px 0 rgba(255, 255, 255, 0.16),
    inset -2px -2px 0 rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-weight: 700; font-size: 0.94rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  transition: transform 0.12s var(--ease), filter 0.12s var(--ease);
}
.mc-btn:hover { filter: brightness(1.22); transform: translateY(-2px); }
.mc-btn:active { transform: translateY(1px); filter: brightness(0.92); }
.mc-btn:focus-visible { outline: 3px solid var(--diamond); outline-offset: 3px; }

.mc-btn--primary { --btn-bg: var(--grass-deep); }
.mc-btn--gold    { --btn-bg: #a97016; }
.mc-btn--ghost   { --btn-bg: transparent; box-shadow: none; border-color: var(--iron); }

/* Pixel-corner accent used sparingly on feature panels. */
.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));
}

/* ---------------------------------------------------------------- layout */
.shell { width: var(--shell); margin-inline: auto; }

.section { padding-block: var(--gap-2xl); position: relative; }
.section__eyebrow {
  font-family: var(--font-pixel);
  font-size: 0.7rem; letter-spacing: 0.22em;
  color: var(--grass); text-transform: uppercase;
  margin-bottom: var(--gap-sm); display: block;
}
.section__lead { max-width: 62ch; font-size: 1.06rem; }

.grid { display: grid; gap: var(--gap-md); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* ---------------------------------------------------------------- textures */
/* Subtle, procedural, and zero network cost - a real dirt/stone image tiled at
   full strength is what makes these sites look cheap. */
.tex-stone {
  background-image:
    radial-gradient(rgba(255,255,255,0.020) 1px, transparent 1px),
    radial-gradient(rgba(0,0,0,0.30) 1px, transparent 1px);
  background-size: 8px 8px, 12px 12px;
  background-position: 0 0, 4px 6px;
}

.scanline::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom, transparent 0 3px, rgba(0,0,0,0.16) 3px 4px);
  mix-blend-mode: multiply; opacity: 0.5;
}

/* ---------------------------------------------------------------- utility */
.u-pixel { font-family: var(--font-pixel); letter-spacing: 0.04em; }
.u-mono  { font-family: var(--font-mono); }
.u-grass { color: var(--grass); }
.u-gold  { color: var(--gold); }
.u-dim   { color: var(--text-dim); }
.u-center { text-align: center; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- motion */
/* Every animated element declares its resting state here so that disabling
   motion never leaves something stuck invisible - the usual way a
   reduced-motion site ends up with blank sections. */
/* Scoped to .js-reveal, which js/motion.js puts on <html> at startup.
   Hiding content in CSS and relying on script to reveal it means any failure of
   that script - a throttled observer, a thrown error, an old browser - leaves
   the page permanently blank. Gating on a class the script itself sets makes the
   failure mode "no animation" instead of "no content". */
html.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
html.js-reveal [data-reveal].is-visible { opacity: 1; transform: none; }

/* The system "reduce motion" setting is honoured by default - but it can be
   overridden per visitor with the Motion control in the footer, which sets
   data-motion="full" on <html>. Without that escape hatch, a visitor whose OS
   has the setting on (which is easy to enable by accident, and is on far more
   machines than people expect) sees a completely static site and has no way to
   discover that it was ever meant to move. */
@media (prefers-reduced-motion: reduce) {
  html:not([data-motion="full"]) { scroll-behavior: auto; }
  html:not([data-motion="full"]) *,
  html:not([data-motion="full"]) *::before,
  html:not([data-motion="full"]) *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html:not([data-motion="full"]) [data-reveal] { opacity: 1 !important; transform: none !important; }
}


/* The hotbar is fixed to the bottom of the viewport, so the last block of any
   page needs room to scroll clear of it rather than ending underneath. */
main { padding-bottom: 108px; }
