/* Tooncesoft
   Layout: the page is the peg board. Peg-lettered titles carry the personality;
   one readable text face carries everything else. Category colors come from the pegs. */
:root {
  --board: #120d10;      /* the logo's board */
  --board-lift: #1b1418; /* slightly raised areas */
  --hole: #060407;       /* empty peg holes */
  --hole-rim: #2e2430;
  --text: #f2e4cf;       /* warm cream */
  --muted: #b9a596;
  --candle: #ffdea0;     /* updates, links */
  --orange: #ff8a1e;     /* games */
  --pink: #ff69a0;       /* translations */
  --yellow: #ffd438;     /* vr mods */
  --red: #ff3a28;
  --font: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --step--1: 0.875rem;
  --step-0: 1.125rem;
  --step-1: 1.375rem;
  --step-2: 1.75rem;
  --measure: 66ch;
  /* one peg size shared by the homepage logo and the peg-lettered page titles, so their letters match */
  --peg: 5.6px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--board);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
}
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--candle); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--candle); outline-offset: 3px; border-radius: 2px; }

.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;
}
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 12px; background: var(--board-lift); padding: 8px 12px; z-index: 10; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ── header ─────────────────────────────────────────── */
.site-header .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px 32px; padding-block: 20px 12px;
}
.brand { display: block; line-height: 0; }
.brand img { width: 280px; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.nav a {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px;
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 1rem;
}
.nav a:hover { color: var(--candle); }
/* contact: the one bordered button in the header */
.nav a.contact-btn {
  padding: 0 16px; border: 1.5px solid var(--candle); border-radius: 999px; color: var(--candle);
  min-height: 40px; margin-block: 2px;
}
.nav a.contact-btn:hover { background: var(--candle); color: var(--board); }
/* each nav item has a peg: lit on the current page, unlit otherwise */
.peg {
  width: 12px; height: 12px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 50% 50%, #3a2c33 0 45%, #241a20 70%);
  box-shadow: inset 0 0 0 1px var(--hole-rim);
}
/* nav pegs keep their color but glow dimly until their page is open */
.nav a .peg {
  background: radial-gradient(circle at 42% 38%, color-mix(in srgb, var(--c) 55%, #120d10) 0 30%, color-mix(in srgb, var(--c) 40%, #120d10) 60%, color-mix(in srgb, var(--c) 26%, #120d10) 100%);
  box-shadow: 0 0 6px 0 color-mix(in srgb, var(--c) 22%, transparent);
}
.nav a:hover .peg { background: radial-gradient(circle at 42% 38%, color-mix(in srgb, var(--c) 75%, #120d10) 0 30%, color-mix(in srgb, var(--c) 58%, #120d10) 100%); }
.nav a[aria-current="page"] .peg, .peg.lit {
  background: radial-gradient(circle at 42% 38%, #fff8 0 18%, var(--c) 46%, color-mix(in srgb, var(--c) 72%, black) 100%);
  box-shadow: 0 0 10px 1px color-mix(in srgb, var(--c) 70%, transparent);
}
.c-updates { --c: var(--candle); }
.c-games { --c: var(--orange); }
.c-translations { --c: var(--pink); }
.c-vr { --c: var(--yellow); }
.c-decomps { --c: var(--red); }

/* a row of empty holes: the board's own divider */
.holes {
  height: 14px; margin: 0;
  border: 0;
  background-image: radial-gradient(circle, var(--hole) 0 3.2px, var(--hole-rim) 3.6px 4.2px, transparent 4.6px);
  background-size: 15px 14px;
  background-position: left center;
  opacity: 0.9;
}

/* ── home hero ──────────────────────────────────────── */
.hero { padding-block: 8px 12px; }
.hero .board {
  max-width: min(100%, calc(var(--peg) * 77.86)); /* logo video: 1713px board at 22px per peg */
  margin: 0 auto;
  aspect-ratio: 1280 / 780;
}
.hero .board video, .hero .board img { width: 100%; height: 100%; object-fit: contain; }
.hero .board img { display: none; }

/* ── page titles in pegs ────────────────────────────── */
.page-title { margin: 0; line-height: 0; }
.page-title img { height: auto; }
.page-head { padding-block: 28px 8px; }
.page-head .lede { max-width: var(--measure); color: var(--muted); margin: 14px 0 0; }

/* ── home layout ────────────────────────────────────── */
.home {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px;
  padding-block: 16px 64px;
}
@media (min-width: 960px) {
  .home { grid-template-columns: minmax(0, 1fr) 300px; gap: 64px; }
}

/* ── posts ──────────────────────────────────────────── */
.feed { max-width: var(--measure); }
.post { padding-block: 28px; scroll-margin-top: 16px; }
.post + .holes { margin-block: 4px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--muted); font-size: var(--step--1); }
.post h2 { font-size: var(--step-2); line-height: 1.2; margin: 6px 0 14px; text-wrap: balance; }
.post h2 a { color: var(--text); text-decoration: none; }
.post h2 a:hover { color: var(--candle); }
.post .figure { margin: 0 0 18px; }
.post .figure img { border-radius: 6px; }
.post figcaption { color: var(--muted); font-size: var(--step--1); margin-top: 8px; }
.post p { margin: 0 0 1em; }
.post ul { padding-left: 1.2em; }
.post li { margin-bottom: 0.4em; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; padding: 0; margin: 0; }
.tags a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; }
.tags a:hover { color: var(--text); }
.tags .peg { width: 9px; height: 9px; }

/* ── projects sidebar on home ───────────────────────── */
.sidebar h2 { font-size: var(--step-1); margin: 0 0 12px; }
.sidebar section + section { margin-top: 28px; }
.sidebar h3 { display: flex; align-items: center; gap: 9px; font-size: 1rem; margin: 0 0 8px; }
.sidebar h3 a { color: var(--text); text-decoration: none; }
.sidebar h3 a:hover { color: var(--candle); }
.sidebar ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.sidebar li a { display: grid; gap: 2px; color: var(--text); text-decoration: none; padding-block: 5px; }
.sidebar li a .status { font-size: 0.8125rem; }
.sidebar li a:hover .name { color: var(--candle); }

/* ── status: four pegs that light up as a project moves along ── */
.status { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: var(--step--1); white-space: nowrap; }
.meter { display: inline-flex; gap: 4px; }
.meter .peg { width: 10px; height: 10px; }

/* ── project pages ──────────────────────────────────── */
.projects { padding-block: 8px 64px; }
.project {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 48px;
  padding-block: 32px; scroll-margin-top: 16px;
}
@media (min-width: 860px) {
  .project { grid-template-columns: 300px minmax(0, 1fr); }
}
.project h2 { font-size: var(--step-2); line-height: 1.15; margin: 0 0 10px; text-wrap: balance; }
.project .facts { display: grid; gap: 8px; margin: 0; }
.project .facts div { display: grid; gap: 0; }
.project dt { color: var(--muted); font-size: var(--step--1); }
.project dd { margin: 0; }
.project .tagline { font-size: var(--step-1); line-height: 1.35; margin: 0 0 12px; max-width: var(--measure); }
.project .body p { margin: 0 0 1em; max-width: var(--measure); }
.project ul.points { list-style: none; padding: 0; margin: 0 0 1em; display: grid; gap: 6px; max-width: var(--measure); }
.project ul.points li { display: flex; gap: 12px; align-items: baseline; }
.project ul.points .peg { position: relative; top: 1px; }
.project .latest { color: var(--muted); font-size: var(--step--1); margin: 0; }
.note { max-width: var(--measure); color: var(--muted); font-size: var(--step--1); margin: 12px 0 0; }

/* ── empty sections ─────────────────────────────────── */
.soon { color: var(--muted); font-size: var(--step--1); margin: 0; }
.page-head .soon-lede { color: var(--text); font-size: var(--step-1); }

/* ── release details ────────────────────────────────── */
.project h3.sub { font-size: 1rem; margin: 22px 0 8px; }
.project .needs { color: var(--muted); max-width: var(--measure); margin: 0; }
.feature {
  max-width: var(--measure); margin: 4px 0 20px; padding: 16px 20px 4px;
  border: 1.5px solid color-mix(in srgb, var(--c) 70%, transparent); border-radius: 10px;
  background: color-mix(in srgb, var(--c) 7%, var(--board));
}
.feature h3 { display: flex; align-items: center; gap: 10px; font-size: var(--step-1); line-height: 1.3; margin: 0 0 8px; }
.feature p { margin: 0 0 12px; }
.downloads { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 10px; }
.download {
  display: inline-flex; flex-direction: column; gap: 0; padding: 10px 16px; min-height: 44px;
  border-radius: 8px; text-decoration: none; color: var(--board);
  background: var(--c);
  box-shadow: 0 0 16px color-mix(in srgb, var(--c) 45%, transparent);
}
.download:hover { filter: brightness(1.08); }
.download .dl-label { font-weight: 700; line-height: 1.25; }
.download .dl-size { font-size: 0.8125rem; line-height: 1.3; opacity: 0.8; }

/* ── footer ─────────────────────────────────────────── */
.site-footer { color: var(--muted); font-size: var(--step--1); padding-block: 24px 40px; }
.site-footer .wrap { display: grid; gap: 14px; }
.site-footer p { margin: 0; }

@media (max-width: 560px) {
  :root { --peg: min(5.6px, calc(100vw / 77.86)); }
  .hero .wrap { padding-left: 0; padding-right: 0; }
  .brand img { width: 220px; }
  .page-title img { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .hero .board video { display: none; }
  .hero .board img { display: block; }
}
