/* Bureau, the real thing: the landing page behind the handheld.
   Same desk, same pixels for the accents, but plain readable type for
   everything you have to read. */

@font-face { font-family: 'OfficePixel'; src: url('/assets/office-font.ttf?v=4595b327') format('truetype'); }

:root {
  color-scheme: dark;
  --bg: #1c1b22;
  --bg-hi: #24222c;
  --panel: #262430;
  --panel-hi: #2f2d3a;
  --line: #3d3a4a;
  --fg: #ecebf2;
  --muted: #a8a5b8;
  --lcd0: #0f380f; --lcd1: #306230; --lcd2: #8bac0f; --lcd3: #9bbc0f;
  --accent: #d4913f;
  --accent-hi: #e7a654;
  --pixel: 'Pixelify Sans', 'OfficePixel', monospace;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --max: 68rem;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f3f1ea; --bg-hi: #ebe8de; --panel: #ffffff; --panel-hi: #f7f5ef;
    --line: #d9d5c8; --fg: #1d1c22; --muted: #5d5a68;
    --accent: #b8742a; --accent-hi: #a3641f;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
/* a faint LCD grid over the whole desk */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, var(--bg-hi), transparent 70%),
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.018) 3px 4px),
    repeating-linear-gradient(90deg, transparent 0 3px, rgba(255,255,255,.018) 3px 4px);
}
a { color: inherit; }
img, canvas { display: block; max-width: 100%; }
canvas { image-rendering: pixelated; }
h1, h2, h3 { font-family: var(--pixel); font-weight: 600; line-height: 1.15; letter-spacing: .01em; margin: 0 0 .5em; }
p { margin: 0 0 1em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--lcd3); outline-offset: 3px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px max(16px, calc((100vw - var(--max)) / 2));
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.top a { text-decoration: none; color: var(--muted); }
.top a:hover { color: var(--fg); }
.top-brand { display: inline-flex; align-items: center; gap: 8px; font-family: 'OfficePixel', monospace; font-size: 18px; color: var(--fg) !important; letter-spacing: .08em; }
.mini-star { width: 19px; height: 19px; }

/* ---------- layout ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
section { padding: clamp(56px, 9vw, 112px) 0; }
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--muted); max-width: 40em; }

/* ---------- hero ---------- */
.hero { text-align: center; padding-top: clamp(48px, 8vw, 96px); }
.kicker {
  display: inline-block; margin-bottom: 20px; padding: 4px 12px;
  font-family: 'OfficePixel', monospace; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--lcd3); border: 2px solid var(--lcd1); background: color-mix(in srgb, var(--lcd0) 60%, transparent);
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .kicker { color: var(--lcd0); background: color-mix(in srgb, var(--lcd3) 35%, transparent); } }
.hero h1 { font-size: clamp(38px, 7vw, 76px); margin-bottom: .35em; text-wrap: balance; }
.hero .lead { margin: 0 auto 1.6em; text-wrap: pretty; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: clamp(40px, 6vw, 64px); }
.caption { margin-top: 14px; font-size: 14px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border: 2px solid var(--line); background: var(--panel);
  font: 600 16px/1 var(--sans); color: var(--fg); text-decoration: none; cursor: pointer;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--line) 80%, #000);
  transition: transform .08s, box-shadow .08s, background .15s;
}
.btn:hover { background: var(--panel-hi); }
.btn:active { transform: translateY(4px); box-shadow: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #1b1305; box-shadow: 0 4px 0 #6e4414; }
.btn-primary:hover { background: var(--accent-hi); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- screenshots ---------- */
.shot {
  margin: 0; position: relative; overflow: hidden;
  border: 2px solid var(--line); border-radius: 10px; background: var(--panel);
  box-shadow: 8px 8px 0 color-mix(in srgb, var(--lcd1) 70%, transparent), 0 24px 60px rgba(0,0,0,.35);
}
.shot img { width: 100%; height: auto; }
.shot-bar {
  display: flex; align-items: center; gap: 6px; padding: 9px 12px;
  border-bottom: 1px solid var(--line); background: var(--panel-hi);
  font: 12px/1 var(--mono); color: var(--muted);
}
.shot-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.shot-bar span { margin-left: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shot-hero { max-width: 60rem; margin: 0 auto; }
.shot-narrow { max-width: 22rem; justify-self: center; width: 100%; }
.shot-wide { margin-top: 36px; border-color: var(--lcd1); }
.shot-code pre { margin: 0; padding: 22px 22px 24px; overflow-x: auto; font: 14px/1.7 var(--mono); color: var(--fg); }
.shot-code .k { color: var(--accent-hi); }
.shot-code .t { color: var(--lcd3); }
.shot-code .c { color: var(--muted); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .shot-code .t { color: var(--lcd1); } }

/* ---------- features ---------- */
.feature { display: grid; grid-template-columns: 1fr; gap: 36px; align-items: center; border-top: 1px solid var(--line); }
@media (min-width: 880px) {
  .feature { grid-template-columns: 5fr 7fr; gap: 64px; }
  .feature-flip .feature-text { order: 2; }
}
.feature h2 { font-size: clamp(28px, 4vw, 42px); }
.feature p { color: var(--muted); max-width: 32em; }
.feature p:first-of-type { color: var(--fg); }

/* the little LCD tile with an agent turning on the spot */
.sprite-tile {
  width: 72px; height: 72px; margin-bottom: 18px;
  background: var(--lcd3); border: 3px solid var(--lcd0);
  box-shadow: 4px 4px 0 var(--lcd1);
  display: grid; place-items: center;
}
.sprite-tile canvas { width: 64px; height: 64px; }

/* ---------- office ---------- */
.office { text-align: center; border-top: 1px solid var(--line); }
.office .sprite-tile { margin: 0 auto 18px; }
.office h2 { font-size: clamp(28px, 4vw, 42px); }
.office .lead { margin: 0 auto; }

/* ---------- facts ---------- */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 2px;
  padding: 0; margin: 0 0 clamp(24px, 4vw, 40px);
  background: var(--line); border: 2px solid var(--line);
}
.facts div { display: flex; flex-direction: column; gap: 4px; padding: 22px; background: var(--bg); }
.facts b { font-family: var(--pixel); font-size: 20px; }
.facts span { color: var(--muted); font-size: 15px; }

/* ---------- the trio ---------- */
.join { border-top: 1px solid var(--line); }
.join h2 { text-align: center; font-size: clamp(30px, 5vw, 52px); margin-bottom: 1em; }
.trio { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 960px) { .trio { grid-template-columns: 1.25fr 1fr 1fr; } }
.card {
  display: flex; flex-direction: column; padding: 26px;
  background: var(--panel); border: 2px solid var(--line);
  box-shadow: 6px 6px 0 color-mix(in srgb, var(--lcd1) 55%, transparent);
}
.card h3 { font-size: 26px; }
.card > p { color: var(--muted); }

/* waitlist */
#join-form { display: flex; flex-direction: column; gap: 14px; }
.field input {
  width: 100%; padding: 12px 14px; font: 16px var(--sans); color: var(--fg);
  background: var(--bg); border: 2px solid var(--line);
}
.field input:focus { border-color: var(--lcd2); outline: none; }
fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
legend { float: left; width: 100%; margin-bottom: 6px; padding: 0; font: 13px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
fieldset button {
  padding: 7px 12px; font: 600 14px/1 var(--sans); color: var(--fg); cursor: pointer;
  background: var(--bg); border: 2px solid var(--line);
}
fieldset button:hover { border-color: var(--muted); }
fieldset button[aria-pressed="true"] { background: var(--lcd2); border-color: var(--lcd1); color: var(--lcd0); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--lcd1); flex: none; }
.hp { position: absolute; left: -9999px; }
.msg { min-height: 1.4em; margin: 0; font-size: 14px; color: var(--muted); }
.msg.ok { color: var(--lcd3); font-family: var(--pixel); font-size: 18px; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .msg.ok { color: var(--lcd1); } }

/* star */
.card-star { align-items: center; text-align: center; }
.star-btn {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin: 8px 0 16px; padding: 12px; background: none; border: 0; cursor: pointer; color: var(--fg);
}
.star-btn canvas { width: 114px; height: 114px; animation: bob 1.2s steps(4) infinite; filter: drop-shadow(0 10px 10px rgba(0,0,0,.35)); }
.star-btn:hover canvas { animation-duration: .6s; }
.star-btn.collected canvas { animation: collect .5s steps(5); }
.star-count { font-family: 'OfficePixel', monospace; font-size: 28px; }
.note { font-size: 14px; color: var(--muted); margin: auto 0 0; }
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes collect { 40% { transform: translateY(-24px) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .star-btn canvas, .star-btn.collected canvas { animation: none; } }

/* code */
.card-code pre {
  margin: 0 0 18px; padding: 16px; overflow-x: auto;
  font: 13.5px/1.7 var(--mono); background: var(--bg); border: 2px solid var(--line);
}
.gh-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-top: auto;
  padding: 10px 16px; border-radius: 6px; text-decoration: none;
  font: 600 15px/1 var(--sans); color: #f0f6fc; background: #212830; border: 1px solid #3d444d;
}
.gh-button:hover { background: #262c36; border-color: #656c76; }

/* ---------- footer (the mathieu.dev footer, as on allmiibo) ---------- */
.siteFooter { border-top: 2px solid var(--line); margin-top: 2.5rem; }
.fInner { max-width: 60rem; margin: 0 auto; padding: 1.25rem 1.25rem 1.5rem;
          display: flex; flex-direction: column; gap: .75rem;
          font-size: .85rem; color: var(--muted); font-family: var(--sans); line-height: 1.5; }
.siteFooter .fRow { display: flex; flex-direction: column; align-items: center;
        justify-content: space-between; gap: .75rem; }
@media (min-width: 560px) { .siteFooter .fRow { flex-direction: row; } }
.siteFooter a { color: inherit; text-decoration: none; transition: color .15s; }
.siteFooter a:hover { color: var(--fg); }
.fAuthor { display: inline-flex; align-items: center; gap: .6rem; }
.fAuthor strong { font-weight: 600; color: var(--fg); }
.fGithub { display: inline-flex; align-items: center; gap: .4rem; }
.fMark { width: 1.25rem; height: 1.05rem; }
.fIcon { width: 1rem; height: 1rem; }
.fAttrib { margin: 0; font-size: .72rem; text-align: center; }
@media (min-width: 560px) { .fAttrib { text-align: left; } }
.fAttrib a { text-decoration: underline; }
