/* peabyte.com. The lab's front page, not a game: quiet paper, one serif voice, one muted pea green.
   The page is a register. Each kind of thing the lab makes is one entry with a state (live, in development,
   not started), and a new kind is one more entry. The only colour is the pea: the mark, the "live" state, a few underlines.
   games.peabyte.com keeps its own playful look; nothing here is shared with it.

   Fonts (both SIL OFL 1.1, licences in fonts/):
   - Newsreader, by Production Type. fonts/newsreader-display-latin-400-normal.woff2 is a static instance of the
     Fontsource variable font (@fontsource-variable/newsreader 5.3.0) at opsz 72, wght 400, made with fontTools.
     The licence names no Reserved Font Name, so the instance may keep the name.
   - Hanken Grotesk, by Alfredo Marco Pradil (@fontsource/hanken-grotesk 5.3.0), 400 and 600. */
@font-face { font-family: "Newsreader Display"; src: url(fonts/newsreader-display-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url(fonts/hanken-grotesk-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url(fonts/hanken-grotesk-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --paper: #f2f3ef;     /* cool, faintly green grey; not cream */
  --band: #e8ebe4;      /* the one tinted section */
  --ink: #1a1f1b;       /* 15:1 on paper */
  --ink-soft: #545b55;  /* 6.3:1 on paper, 5.8:1 on band */
  --rule: #c9cec6;
  --pea: #4f6b2c;       /* text-safe accent: 5.4:1 on paper */
  --pea-mark: #6a8c3a;  /* the mark and the live dot only (graphics, over 3:1) */
  --serif: "Newsreader Display", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 16px;
  --space: clamp(56px, 9vw, 112px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1.0625rem/1.55 var(--sans); overflow-x: hidden; font-kerning: normal; }
h1, h2, h3, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-color: var(--pea); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 2px; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.wrap { width: 100%; max-width: 76rem; margin: 0 auto; padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
.quiet { color: var(--ink-soft); }

.skip { position: absolute; left: 12px; top: -60px; z-index: 5; background: var(--ink); color: var(--paper); padding: 10px 14px; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
main:focus { outline: none; }

/* ---- top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 400 1.5rem/1 var(--serif); letter-spacing: -.01em; text-decoration: none; min-height: 44px; }
.brand-mark { width: 20px; height: 20px; flex: none; fill: var(--pea-mark); }
.langs { display: flex; flex: none; gap: 2px; }
.lang { background: none; border: 0; padding: 0 10px; min-height: 44px; min-width: 44px; font: 400 .9375rem var(--sans); color: var(--ink-soft); cursor: pointer; text-underline-offset: .35em; }
.lang:hover { color: var(--ink); }
.lang[aria-pressed="true"] { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--pea); }
.lang-short { display: none; }
@media (max-width: 400px) { .lang-full { display: none; } .lang-short { display: inline; } }

/* ---- the statement */
.intro { position: relative; padding-top: clamp(36px, 7vw, 96px); padding-bottom: clamp(40px, 5vw, 64px); }
.intro h1 { font: 400 clamp(2.375rem, 6.6vw, 5.25rem)/1.02 var(--serif); letter-spacing: -.022em; max-width: 15ch; text-wrap: balance; }
.lead { margin-top: clamp(24px, 3.5vw, 40px); font-size: clamp(1.125rem, 1.9vw, 1.3125rem); line-height: 1.5; max-width: 34rem; }
.intro-rule { position: absolute; left: max(var(--gutter), env(safe-area-inset-left)); right: max(var(--gutter), env(safe-area-inset-right)); bottom: 0; height: 1px; background: var(--ink); transform-origin: left center; }

/* The one moving moment: the rule under the statement is drawn once, left to right. */
@media (prefers-reduced-motion: no-preference) {
  .ready .intro-rule { animation: draw .9s cubic-bezier(.6, 0, .2, 1) .15s both; }
}
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---- parts: a heading in the margin, the content beside it */
.part { padding-top: var(--space); padding-bottom: var(--space); }
.part + .part { border-top: 1px solid var(--rule); }
#index { padding-top: clamp(40px, 6vw, 72px); }
.part-title { font: 600 1rem/1.4 var(--sans); }
.part-body { margin-top: 20px; }

/* ---- the register of what we make */
.cat { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; padding: 28px 0; border-top: 1px solid var(--rule); }
.cat:first-child { border-top: 0; padding-top: 16px; }
.cat-name { font: 400 clamp(2rem, 6vw, 2.75rem)/1.05 var(--serif); letter-spacing: -.015em; }
.cat-state { display: flex; align-items: center; gap: 8px; align-self: center; font-size: .9375rem; color: var(--ink-soft); white-space: nowrap; }
.cat-state.is-live { color: var(--pea); font-weight: 600; }
.sig { width: 10px; height: 10px; border-radius: 50%; flex: none; border: 1.5px solid currentColor; }
.is-live .sig { background: var(--pea-mark); border-color: var(--pea-mark); }
.is-open .sig { border-style: dashed; }
.cat-body, .cat > .picks, .cat > .cat-go { grid-column: 1 / -1; }
.cat-body { margin-top: 14px; }
.cat-text { max-width: 36rem; }
.cat-text + .cat-text { margin-top: 8px; }
.is-next .cat-name { color: var(--ink-soft); }

.picks { margin-top: 22px; border-top: 1px solid var(--rule); }
.picks li { border-bottom: 1px solid var(--rule); }
.picks a { display: grid; gap: 2px; padding: 12px 0; text-decoration: none; min-height: 44px; }
.pick-name { font-weight: 600; }
.pick-line { color: var(--ink-soft); font-size: 1rem; line-height: 1.45; }
.picks a:hover .pick-name { text-decoration: underline; text-decoration-color: var(--pea); text-decoration-thickness: 2px; text-underline-offset: .2em; }
.picks a:focus-visible { outline-offset: 2px; }
.cat-go { margin-top: 18px; }
.go { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration: underline; text-decoration-color: var(--pea); text-decoration-thickness: 2px; text-underline-offset: .25em; }
.go:hover { text-decoration-color: var(--ink); }

/* ---- how we work: the one tinted band */
.part-how { background: var(--band); }
.part-how + .part { border-top: 0; }
.promises { display: grid; gap: 22px; }
.promises li { max-width: 30rem; }
.promises strong { display: block; font: 400 1.625rem/1.15 var(--serif); letter-spacing: -.01em; margin-bottom: 6px; }
.promises span { color: var(--ink); }
.how-note { margin-top: 32px; max-width: 44rem; padding-top: 20px; border-top: 1px solid var(--rule); color: var(--ink-soft); }
.how-note a { color: var(--ink); font-weight: 600; text-decoration-color: var(--pea); }

/* ---- contact */
.mail { display: inline-block; margin-top: 10px; padding: 4px 0; font: 400 clamp(1.75rem, 7.6vw, 3.25rem)/1.15 var(--serif); letter-spacing: -.015em; overflow-wrap: anywhere; text-decoration-color: var(--pea); text-decoration-thickness: 2px; text-underline-offset: .18em; }
.mail:hover { text-decoration-color: var(--ink); }

/* ---- footer */
.foot { position: relative; display: grid; gap: 6px; padding-top: 24px; padding-bottom: calc(28px + env(safe-area-inset-bottom)); font-size: .9375rem; }
.foot::before { content: ""; position: absolute; top: 0; left: max(var(--gutter), env(safe-area-inset-left)); right: max(var(--gutter), env(safe-area-inset-right)); height: 1px; background: var(--ink); }
.foot-brand { display: flex; align-items: center; gap: 10px; }
.foot-brand .brand-mark { width: 14px; height: 14px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 22px; }
.foot-links a { display: inline-block; min-height: 44px; line-height: 44px; }

/* ---- wider screens: the margin column appears */
@media (min-width: 720px) {
  :root { --gutter: 32px; }
  .promises { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .picks { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .foot { grid-template-columns: 1fr auto; align-items: center; }
}
@media (min-width: 960px) {
  :root { --gutter: 48px; }
  .intro { display: grid; grid-template-columns: 3fr 9fr; column-gap: 32px; }
  .intro h1 { grid-column: 1 / -1; }
  .lead { grid-column: 2; }
  .part, .part-grid { display: grid; grid-template-columns: 3fr 9fr; column-gap: 32px; align-items: start; }
  .part-how { display: block; }
  .part-body { margin-top: 0; }
  .part-title { padding-top: 6px; }
  .cat { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) minmax(0, 7fr); column-gap: 32px; padding: 32px 0; }
  .cat:first-child { padding-top: 0; border-top: 0; }
  .cat-state { align-self: start; padding-top: .9em; }
  .cat-body { grid-column: 3; margin-top: 0; padding-top: .45em; }
  /* The game index lines up with the register: names under the category names, lines under the descriptions. */
  .cat > .picks { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; margin-top: 28px; }
  .picks li { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; }
  .picks a { grid-column: 1 / -1; grid-template-columns: subgrid; align-items: baseline; padding: 13px 0; }
  .cat > .picks, .picks li, .picks a { column-gap: 32px; row-gap: 0; }
  .pick-name { grid-column: 1 / 3; }
  .pick-line { grid-column: 3; }
  .cat > .cat-go { grid-column: 3; }
}
@media (min-width: 1400px) {
  .wrap { max-width: 88rem; }
}

/* ---- privacy page */
.page { padding-top: clamp(32px, 6vw, 72px); padding-bottom: 72px; line-height: 1.6; }
.page article { max-width: 42rem; }
@media (min-width: 960px) { .page { display: grid; grid-template-columns: 3fr 9fr; column-gap: 32px; } .page article { grid-column: 2; } }
.page h1 { font: 400 clamp(2.5rem, 8vw, 3.75rem)/1.05 var(--serif); letter-spacing: -.02em; }
.page h2 { font: 400 1.625rem/1.2 var(--serif); margin-top: 40px; }
.page p { margin-top: 10px; }
.page .lead { font-size: 1.1875rem; line-height: 1.45; margin-top: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--ink); }
.page .dated { color: var(--ink-soft); margin-top: 8px; }
.page a { font-weight: 600; text-decoration-color: var(--pea); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
