/* CoreBlock Studios — shared styles
   The home page is a cross-section of a Minecraft world: sky, grass, dirt,
   stone, night forest, bedrock. Reading pages sit on a light andesite page. */

:root {
  --sky:          #a9cce8;
  --sky-deep:     #8db8db;
  --grass:        #5e9234;
  --grass-dark:   #44702a;
  --dirt:         #5b3e2a;
  --dirt-raised:  #4a3222;
  --dirt-line:    #7b5a3f;
  --stone:        #a5a5a0;
  --stone-raised: #b6b6b1;
  --stone-line:   #8b8b86;
  --night:        #101c17;
  --night-raised: #18271f;
  --bedrock:      #1a1a1c;

  --paper:        #e8e9e5;
  --paper-raised: #f4f5f2;
  --paper-line:   #c8c9c3;

  --ink:          #1d1b18;
  --ink-soft:     #4a4842;
  --chalk:        #f5f1e8;
  --chalk-soft:   #d8cfc1;

  --amber:        #e4a53d;
  --amber-shade:  #9c6a1e;
  --amber-ink:    #85500e;

  --font-head: 'Archivo', 'Arial Narrow', system-ui, sans-serif;
  --font-body: 'Atkinson Hyperlegible Next', 'Atkinson Hyperlegible', system-ui, sans-serif;
  --font-pixel: 'Press Start 2P', monospace;
  --font-code: 'JetBrains Mono', ui-monospace, monospace;

  --measure: 66ch;
  --wrap: 1160px;
  --edge: 16px; /* height of one block step */
}

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

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

body {
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-stretch: 110%;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5.4vw, 4.2rem); line-height: 1.02; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); }
h3 { font-size: 1.55rem; }
h4 { font-size: 1.2rem; }
p  { text-wrap: pretty; }

a { color: inherit; }

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 560px) { .wrap { padding: 0 16px; } }

.skip-link {
  position: absolute;
  left: 16px; top: -60px;
  background: var(--amber);
  color: var(--ink);
  padding: 10px 16px;
  font-weight: 700;
  z-index: 200;
}
.skip-link:focus { top: 12px; }

/* ---------- Site header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bedrock);
  color: var(--chalk);
  border-bottom: 3px solid #000;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--chalk);
  flex-shrink: 0;
}
.brand img {
  width: 36px; height: 36px;
  background: #fff;
  border: 2px solid #fff;
  image-rendering: pixelated;
}
.brand span {
  font-family: var(--font-pixel);
  font-size: 0.72rem;
  line-height: 1.5;
}
.site-nav ul {
  display: flex;
  gap: 4px;
  list-style: none;
}
.site-nav a {
  display: block;
  padding: 8px 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--chalk-soft);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: var(--chalk); border-bottom-color: var(--stone-line); }
.site-nav a[aria-current="page"] { color: var(--chalk); border-bottom-color: var(--amber); }

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--stone-line);
  color: var(--chalk);
  font: 700 1rem var(--font-body);
  padding: 6px 12px;
  cursor: pointer;
}
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bedrock);
    border-bottom: 3px solid #000;
    padding: 8px 16px 16px;
  }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 12px 8px; border-bottom: 1px solid #2c2c30; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font: 700 1.05rem/1 var(--font-body);
  padding: 15px 22px 13px;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  position: relative;
  transition: transform 80ms ease;
}
.btn:active { transform: translateY(2px); }
.btn-primary {
  background: var(--amber);
  color: #1f1407;
  box-shadow: inset 0 -4px 0 var(--amber-shade), inset 0 2px 0 #f4c877;
}
.btn-primary:hover { background: #ecb354; }
.btn-plain {
  background: transparent;
  color: currentColor;
  box-shadow: inset 0 0 0 2px currentColor;
}
.btn-plain:hover { background: rgba(0,0,0,0.08); }

/* ---------- World layers (home page) ---------- */
.layer {
  position: relative;
  padding: 88px 0 96px;
}
/* Blocky stepped edge on top of a layer, in the layer's own colour */
.layer.stepped::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: calc(var(--edge) * -1 + 1px);
  height: var(--edge);
  background: var(--layer-top, var(--layer-bg));
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='16'%3E%3Cpath d='M0 16V8h16V0h16v8h32V0h16v8h16V0h16v8h16v8z'/%3E%3C/svg%3E") repeat-x left bottom / 128px 16px;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='128' height='16'%3E%3Cpath d='M0 16V8h16V0h16v8h32V0h16v8h16V0h16v8h16v8z'/%3E%3C/svg%3E") repeat-x left bottom / 128px 16px;
  z-index: 1;
}
.layer > .wrap { position: relative; z-index: 2; }

.layer-sky     { --layer-bg: var(--sky);   background: var(--sky);   color: var(--ink); }
.layer-dirt    { --layer-bg: var(--dirt);  --layer-top: var(--grass);
                 background: var(--dirt); color: var(--chalk);
                 box-shadow: inset 0 14px 0 var(--grass), inset 0 20px 0 var(--grass-dark); }
.layer-stone   { --layer-bg: var(--stone); background: var(--stone); color: var(--ink); }
.layer-night   { --layer-bg: var(--night); background: var(--night); color: var(--chalk); }
.layer-bedrock { --layer-bg: var(--bedrock); background: var(--bedrock); color: var(--chalk-soft); }

.layer-dirt a:not(.btn), .layer-night a:not(.btn) { color: var(--amber); }

.lead {
  font-size: 1.25rem;
  max-width: 58ch;
}

/* ---------- Reading pages ---------- */
.page-head {
  --layer-bg: var(--sky);
  background: var(--sky);
  padding: 56px 0 72px;
  position: relative;
  box-shadow: inset 0 -14px 0 var(--grass), inset 0 -20px 0 var(--grass-dark);
}
.page-head .crumb {
  display: inline-block;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 20px;
  text-decoration: none;
}
.page-head .crumb:hover { color: var(--ink); text-decoration: underline; }
.page-head h1 { max-width: 20ch; margin-bottom: 16px; }
.page-head p { max-width: 60ch; font-size: 1.2rem; color: #26333d; }
.page-head .updated { margin-top: 12px; font-size: 1rem; color: #3a4955; }

.page-body { padding: 64px 0 96px; }
.page-body a { color: var(--amber-ink); font-weight: 700; }

code {
  font-family: var(--font-code);
  font-size: 0.88em;
  background: rgba(0,0,0,0.07);
  padding: 1px 6px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bedrock);
  color: var(--chalk-soft);
  padding: 48px 0 40px;
  font-size: 1rem;
}
.site-footer .wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px 48px;
  align-items: start;
}
.site-footer ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.site-footer a { color: var(--chalk); text-decoration: none; font-weight: 700; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .legal {
  grid-column: 1 / -1;
  border-top: 1px solid #333338;
  padding-top: 24px;
  font-size: 0.9rem;
  color: #a9a49b;
  max-width: 80ch;
}
.site-footer .legal p + p { margin-top: 6px; }
@media (max-width: 700px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* ---------- Privacy page ---------- */
.policy { max-width: var(--measure); }
.policy .callout {
  background: var(--paper-raised);
  border-left: 6px solid var(--grass);
  padding: 20px 24px;
  margin-bottom: 48px;
}
.policy .callout.gold { border-left-color: var(--amber); margin: 20px 0 0; }
.policy .callout.inline { margin: 16px 0 0; }
.policy-block { margin-bottom: 48px; }
.policy-block h2 {
  font-size: 1.6rem;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--paper-line);
}
.policy-block p { margin-bottom: 14px; }
.policy-block p:last-child { margin-bottom: 0; }
.policy-list {
  list-style: square;
  margin: 16px 0 16px 1.2em;
}
.policy-list li { padding-left: 4px; margin-bottom: 10px; }
.policy-list li::marker { color: var(--grass-dark); }
.contact-block {
  background: var(--paper-raised);
  border: 2px solid var(--paper-line);
  padding: 24px;
  margin-top: 16px;
}

/* ---------- Motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
