/* MINE's site (docs/index.html, docs/it/index.html): a page like an open-source project's home,
   grass on dirt for the opening, plain sections after. Every colour is a token, light and dark. */
:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --text: #1f1d1a;
  --muted: #5d574e;
  --line: #ddd7ca;
  --bar: #24331f;
  --bar-text: #f2f2ec;
  --grass: #5f9f35;
  --grass-dark: #3f7322;
  --dirt: #7a5537;
  --accent: #2e6fd8;
  --gold: #f0c040;
  --shadow: rgba(31, 29, 26, .14);
  --display: "Press Start 2P", ui-monospace, monospace;
  --body: "Atkinson Hyperlegible", "Noto Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "DejaVu Sans Mono", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141517;
    --surface: #1e2023;
    --text: #ecebe6;
    --muted: #a7a399;
    --line: #34363a;
    --bar: #101a0d;
    --bar-text: #ecebe6;
    --grass: #74b947;
    --grass-dark: #4f8a2d;
    --dirt: #5e432d;
    --accent: #7aa8f5;
    --gold: #f0c040;
    --shadow: rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141517;
  --surface: #1e2023;
  --text: #ecebe6;
  --muted: #a7a399;
  --line: #34363a;
  --bar: #101a0d;
  --bar-text: #ecebe6;
  --grass: #74b947;
  --grass-dark: #4f8a2d;
  --dirt: #5e432d;
  --accent: #7aa8f5;
  --gold: #f0c040;
  --shadow: rgba(0, 0, 0, .5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--body); }
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1080px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: .02em; text-wrap: balance; }
h2 { font-size: clamp(1.05rem, 2.6vw, 1.45rem); margin: 0 0 18px; line-height: 1.5; }
h3 { margin: 0 0 10px; font-size: 1.2rem; }
h4 { margin: 0 0 4px; font-size: 1.02rem; }
p { margin: 0 0 12px; }
code { font-family: var(--mono); font-size: .9em; background: var(--line); padding: 0 .3em; border-radius: 4px; }

/* The bar on top: name, sections, languages. */
.top { position: sticky; top: 0; z-index: 10; background: var(--bar); color: var(--bar-text); border-bottom: 3px solid #000; }
.top .wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand img { width: 32px; height: 32px; image-rendering: pixelated; }
.brand strong { font-family: var(--display); font-size: 1rem; letter-spacing: .08em; }
.brand small { opacity: .7; font-size: .8rem; }
.top nav { display: flex; gap: 4px 16px; flex-wrap: wrap; flex: 1; }
.top nav a { color: inherit; text-decoration: none; font-weight: 700; font-size: .95rem; opacity: .9; }
.top nav a:hover, .top nav a:focus-visible { opacity: 1; text-decoration: underline; }
.langs { display: flex; gap: 8px; font-size: .9rem; }
.langs a { color: inherit; opacity: .75; }
.langs [aria-current] { opacity: 1; font-weight: 700; text-decoration: none; }

/* The opening: grass on dirt, as a Minecraft block. */
.hero {
  background:
    linear-gradient(var(--grass) 0 0) top / 100% 20px no-repeat,
    repeating-linear-gradient(90deg, var(--grass-dark) 0 20px, transparent 20px 40px) 0 20px / 100% 10px no-repeat,
    var(--dirt);
  color: #fff;
  border-bottom: 4px solid #000;
}
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 36px; align-items: center; padding-block: 64px 56px; }
.hero h1 { font-size: clamp(2.2rem, 7vw, 3.6rem); margin: 0 0 6px; text-shadow: 4px 4px 0 #000; }
.hero .subtitle { font-family: var(--display); font-size: .78rem; opacity: .85; margin-bottom: 18px; }
.hero .tagline { font-size: 1.25rem; font-weight: 700; margin-bottom: 22px; }
.hero figure { margin: 0; border: 4px solid #000; box-shadow: 8px 8px 0 rgba(0, 0, 0, .45); background: #000; }
.news { margin-top: 18px; font-size: .95rem; background: rgba(0, 0, 0, .3); border-left: 4px solid var(--gold); padding: 8px 12px; }
.news a { color: #ffe08a; }
@media (max-width: 820px) { .hero .wrap { grid-template-columns: 1fr; } }

.btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-block; padding: 11px 18px; font-weight: 700; text-decoration: none; color: #1f1d1a; background: #e9e5da; border: 3px solid #000; box-shadow: 4px 4px 0 #000; }
.btn.primary { background: var(--gold); }
.btn:hover, .btn:focus-visible { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 #000; }

/* Sections. */
section { padding-block: 56px; }
section.alt { background: var(--surface); border-block: 1px solid var(--line); }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 60ch; margin-bottom: 26px; }

/* Features: three audiences, as Luanti's players and creators. */
.audiences { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.audience h3 { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 3px solid var(--grass); }
.audience ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.audience p { margin: 0; color: var(--muted); font-size: .97rem; }
@media (max-width: 900px) { .audiences { grid-template-columns: 1fr; } }

/* Gallery. */
.gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.gallery figure { margin: 0; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 18px var(--shadow); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top left; border-bottom: 1px solid var(--line); }
.gallery figure.wide img { aspect-ratio: auto; object-fit: contain; }
.gallery figcaption { padding: 10px 14px; font-size: .95rem; }
@media (max-width: 720px) { .gallery { grid-template-columns: 1fr; } }

/* Lessons. */
.lessons { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.lessons li { background: var(--surface); border: 1px solid var(--line); padding: 14px 16px; display: grid; gap: 4px; align-content: start; }
.lessons .n { font-family: var(--display); font-size: .75rem; color: var(--grass-dark); }
.lessons a { font-weight: 700; text-decoration: none; }
.lessons a:hover { text-decoration: underline; }
.lessons span { color: var(--muted); font-size: .92rem; }
.lessons .py { justify-self: start; font-size: .75rem; font-weight: 700; background: #ffd43b; color: #1f1d1a; padding: 0 6px; }
@media (max-width: 900px) { .lessons { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .lessons { grid-template-columns: 1fr; } }

/* Download. */
.downloads { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 3px solid #000; box-shadow: 6px 6px 0 var(--shadow); padding: 20px; display: grid; gap: 8px; align-content: start; }
.card .btn { justify-self: start; margin-top: 6px; }
.card ol, .card ul { margin: 0; padding-left: 1.2em; }
@media (max-width: 900px) { .downloads { grid-template-columns: 1fr; } }

/* Why, and what it isn't. */
.why { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.why ul { margin: 0; padding-left: 1.2em; }
@media (max-width: 720px) { .why { grid-template-columns: 1fr; } }

/* Take part. */
.roles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.roles .card { border-width: 2px; box-shadow: none; }
@media (max-width: 900px) { .roles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .roles { grid-template-columns: 1fr; } }

/* Footer: columns of links, as Luanti's. */
footer { background: var(--bar); color: var(--bar-text); padding-block: 40px 28px; font-size: .92rem; }
footer .cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-bottom: 26px; }
footer h4 { font-size: .95rem; margin-bottom: 8px; }
footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
footer a { color: #b9d7ff; }
footer .legal { opacity: .7; border-top: 1px solid rgba(255, 255, 255, .15); padding-top: 16px; }
@media (max-width: 720px) { footer .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
