/* Mendwell: I/O, the public site (mendwell.dev). The game's "Old Stone" look: slate and bronze, gold
   text, the pixel font for headings. One deliberate dark theme. No third-party requests (fonts are ours). */

@font-face {
  font-family: "Poncho Pixel";
  src: url("pixel.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #0b0f0f;
  --ground: #141b1b;
  --band: #1d2423;
  --title-bg: #2a261e;
  --slot: #3a362c;
  --panel: #4a463a;
  --text: #ffe8a8;
  --title: #ffd24a;
  --muted: #c0b088;
  --dim: #8e8268;
  --accent: #ffb020;
  --good: #8fd06b;
  --link: #7fc8ff;
  --bronze: #8a6a3a;
  --gutter: max(20px, 4vw);
  --pixel: "Poncho Pixel", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
a { color: var(--title); }
a:hover { color: var(--text); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: max(var(--gutter), env(safe-area-inset-left, 0px)); padding-right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--accent); color: #1b1608; padding: 10px 14px; }

/* The pixel font has no space glyph: word-spacing stands in for it. */
h1, h2 { font-family: var(--pixel); font-weight: 400; color: var(--title); text-wrap: balance; margin: 0; word-spacing: 0.4em; }
h1 { font-size: clamp(30px, 4.4vw, 48px); line-height: 1.25; }
h2 { font-size: clamp(24px, 3vw, 32px); line-height: 1.35; }
h3 { margin: 0; font-size: 21px; color: var(--title); }
p { margin: 0; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--good); }
.lede { font-size: 19px; line-height: 1.6; max-width: 34em; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Buttons: the game's chunky ones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px;
  padding: 12px 22px; font-size: 17px; font-weight: 600; text-decoration: none;
  border: 2px solid var(--ink); cursor: pointer;
}
.btn-main { background: var(--accent); color: #1b1608; box-shadow: 0 4px 0 var(--ink); }
.btn-main:hover { background: #ffc24d; color: #1b1608; }
.btn-main:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ink); }
.btn-plain { background: var(--slot); color: var(--text); border-color: var(--dim); font-weight: 500; }
.btn-plain:hover { background: var(--panel); color: var(--text); }
.btn-small { min-height: 42px; padding: 8px 16px; font-size: 15px; }
.buttons { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* Header */
.top { background: var(--title-bg); border-bottom: 3px solid var(--ink); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--title); }
.brand img { width: 40px; height: 40px; }
.brand span { font-family: var(--pixel); font-size: 21px; letter-spacing: 0.06em; word-spacing: 0.4em; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
.nav > a { color: var(--text); text-decoration: none; font-size: 16px; padding: 8px 0; }
.nav > a:hover { color: var(--title); }
.nav .buttons { gap: 10px; }

/* Hero */
.hero {
  position: relative; display: flex; align-items: center; min-height: min(680px, 86vh);
  background: #3c6a2a url("farm.png") center / cover no-repeat; image-rendering: pixelated;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(14,18,14,0.95) 0%, rgba(14,18,14,0.88) 46%, rgba(14,18,14,0.1) 80%);
}
.hero .wrap { position: relative; width: 100%; padding-top: 72px; padding-bottom: 72px; }
.hero-copy { max-width: 610px; display: flex; flex-direction: column; gap: 22px; image-rendering: auto; }

/* Sections */
.section { padding-top: 96px; padding-bottom: 96px; }
.band { background: var(--band); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }
.band-title { background: var(--title-bg); border-top: 3px solid var(--ink); }
.split { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; }
.split > * { min-width: 0; }
.split .text { flex: 1 1 400px; display: flex; flex-direction: column; gap: 18px; }
.split .media { flex: 1 1 520px; margin: 0; }
.frame { display: block; border: 3px solid var(--ink); box-shadow: 0 0 0 3px var(--bronze), 0 18px 40px rgba(0,0,0,0.5); }
.frame img { display: block; width: 100%; height: auto; }
.reverse { flex-wrap: wrap-reverse; }

/* The code panel, styled like the in-game editor */
.code { background: var(--title-bg); border: 3px solid var(--ink); box-shadow: inset 0 0 0 2px var(--panel); }
.code-bar { display: flex; justify-content: space-between; gap: 12px; padding: 10px 16px; background: var(--slot); border-bottom: 2px solid var(--ink); font-size: 14px; color: var(--muted); }
.code pre { margin: 0; padding: 18px 20px; font: 16px/1.75 var(--mono); color: var(--text); overflow-x: auto; }
.code .ln { color: var(--dim); user-select: none; }
.code .kw { color: #ff9a7a; }
.code .val { color: var(--good); }
.code .dir { color: var(--link); }
.points { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--muted); }

/* Feature cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 24px; }
.card { background: var(--panel); border: 3px solid var(--ink); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.card .icons { display: flex; gap: 8px; }
.card .icons img { width: 48px; height: 48px; }

/* Chapters */
.chapters-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 24px; margin-bottom: 28px; }
.chapters { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.chapters li { background: var(--slot); border: 2px solid var(--ink); padding: 14px 16px; display: flex; gap: 12px; align-items: baseline; }
.chapters .n { font-family: var(--mono); color: var(--dim); }

/* Closing call */
.closer { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 24px; }
.closer .ponchos { display: flex; gap: 14px; align-items: end; }
.closer .ponchos img { width: 88px; height: 88px; }
.closer .ponchos img.big { width: 120px; height: 120px; }
.closer .buttons { justify-content: center; }

/* Plain pages (account, 404) */
.page { padding-top: 80px; padding-bottom: 96px; }
.page-inner { max-width: 760px; display: flex; flex-direction: column; gap: 22px; }
.panel { background: var(--panel); border: 3px solid var(--ink); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.note { border-left: 0; background: var(--slot); border: 2px solid var(--ink); padding: 16px 18px; color: var(--muted); }

/* Footer */
.foot { background: var(--ink); color: var(--dim); font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 24px; padding-top: 30px; padding-bottom: 30px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 18px; }
.foot a { color: var(--muted); }

@media (max-width: 960px) {
  .hero::before { background: linear-gradient(180deg, rgba(14,18,14,0.88), rgba(14,18,14,0.8)); }
}

@media (max-width: 720px) {
  body { font-size: 16px; }
  .hero { min-height: 0; background-position: 30% center; }
  .section { padding-top: 64px; padding-bottom: 64px; }
  .nav { width: 100%; justify-content: space-between; }
  .nav .buttons { margin-left: auto; }
  .closer .ponchos img { width: 64px; height: 64px; }
  .closer .ponchos img.big { width: 88px; height: 88px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn-main:active { transform: none; }
}
