/* piepgras.info — one stylesheet, no framework, no web fonts.
   Colours are defined once as tokens on :root and only re-pointed for dark
   mode, so a colour can never exist in one theme and not the other. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --bg-alt: #f5f6f8;
  --bg-sunken: #eceef2;
  --fg: #1c1f24;
  --fg-muted: #5b6470;
  --border: #d9dde3;
  --accent: #1f5fa9;
  --accent-fg: #ffffff;
  --accent-soft: #e8f0fa;
  --radius: 10px;
  --wrap: 68rem;
  --prose: 42rem;

  /* Status tags. Green -> yellow -> orange -> red reads as a progress scale, so
     the four are never distinguished by hue alone: each keeps its own wording
     as well, for anyone who cannot separate them by colour. */
  --tag-published-bg: #dff3e5;
  --tag-published-fg: #14683a;
  --tag-testing-bg: #fbf0cf;
  --tag-testing-fg: #74560a;
  --tag-development-bg: #fce7d7;
  --tag-development-fg: #8a4413;
  --tag-conception-bg: #fbe1e1;
  --tag-conception-fg: #97262c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171b;
    --bg-alt: #1b1f25;
    --bg-sunken: #23282f;
    --fg: #e7e9ec;
    --fg-muted: #a2abb6;
    --border: #333a43;
    --accent: #78aeef;
    --accent-fg: #10141a;
    --accent-soft: #1e2a38;

    --tag-published-bg: #15301f;
    --tag-published-fg: #7ed6a2;
    --tag-testing-bg: #322b13;
    --tag-testing-fg: #e4c76b;
    --tag-development-bg: #35240f;
    --tag-development-fg: #f0a86c;
    --tag-conception-bg: #351a1c;
    --tag-conception-fg: #f19494;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.6 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); margin: 0 0 .5rem; }
h2 { font-size: 1.4rem; margin: 2.5rem 0 .75rem; }
h3 { font-size: 1.1rem; margin: 1.75rem 0 .5rem; }

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

code {
  background: var(--bg-sunken);
  padding: .1em .35em;
  border-radius: 4px;
  font-size: .9em;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.25rem; }
.prose { max-width: var(--prose); }
.prose p, .prose li { color: var(--fg); }
.lede { font-size: 1.15rem; color: var(--fg-muted); max-width: var(--prose); }
.note { color: var(--fg-muted); font-size: .925rem; }
.hint { color: var(--fg-muted); font-weight: normal; }

.skip {
  position: absolute; left: -9999px;
  background: var(--accent); color: var(--accent-fg); padding: .75rem 1rem;
}
.skip:focus { left: 1rem; top: 1rem; z-index: 10; }

/* header / footer */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
  position: sticky; top: 0; z-index: 5;
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 3.75rem; flex-wrap: wrap;
}
.site-header__brand {
  font-weight: 700; font-size: 1.05rem; color: var(--fg); text-decoration: none;
}
.site-header__right {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: nowrap;
}
.site-nav {
  display: flex; gap: 1.25rem;
  overflow-x: auto; min-width: 0;
}
.site-nav > span { display: flex; gap: 1.25rem; }
.site-nav a { color: var(--fg-muted); text-decoration: none; white-space: nowrap; }
.site-nav a:hover { color: var(--accent); text-decoration: underline; }

main { padding: 2.5rem 0 4rem; }

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 2rem 0 1.5rem;
  font-size: .925rem;
}
.site-footer__inner {
  display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap;
}
.site-footer__name { font-weight: 600; margin: 0 0 .25rem; }
.site-footer nav { display: flex; flex-direction: column; gap: .35rem; }
.site-footer__legal { color: var(--fg-muted); margin-top: 1.5rem; }
.site-footer p { margin: .25rem 0; }

/* home */

.hero {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  margin: -2.5rem 0 2.5rem;
  padding: 3rem 0;
}
.hero h1 { margin-bottom: .75rem; }

.cols { display: flex; gap: 2.5rem; flex-wrap: wrap; align-items: flex-start; }
.col { flex: 1 1 16rem; min-width: 0; }
.col--wide { flex: 3 1 26rem; }

/* The link columns on the home page carry no section heading, so they supply
   the vertical rhythm an h2 would otherwise have given them. */
.home-links { margin-top: 2.5rem; }
.home-links h3 { margin-top: 0; }

/* app cards */

/* The one-line description of each app, under the Apps page lede. */
.app-lines { list-style: none; padding: 0; margin: 1.25rem 0 0; max-width: var(--prose); }
.app-lines li { margin: .45rem 0; color: var(--fg-muted); }
.app-lines strong { color: var(--fg); }

.app-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  margin: 1.5rem 0;
}
.app-card {
  display: flex; gap: 1rem; align-items: flex-start;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; background: var(--bg);
}
/* The status tag sits in the card's own bottom-right corner rather than
   wherever the text above it happens to end, so a column of cards has its tags
   in a line. Scoped to .app-grid: the same .badge markup appears in the app
   hero, the At a glance box and the Help us list, and must not move there. */
.app-grid .app-card { position: relative; padding-bottom: 3.25rem; }
.app-grid .app-card .badge { position: absolute; right: 1rem; bottom: 1rem; }
.app-card h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
.app-card h3 a { text-decoration: none; }
.app-card__icon { border-radius: 16px; flex: 0 0 auto; }
.app-card__icon--none {
  width: 72px; height: 72px; border-radius: 16px; background: var(--bg-sunken);
}
.app-card__tagline { margin: 0 0 .5rem; color: var(--fg-muted); font-size: .95rem; }

.badge {
  display: inline-block; margin: 0;
  background: var(--accent-soft); color: var(--accent);
  border-radius: 999px; padding: .15rem .65rem;
  font-size: .8rem; font-weight: 600;
}

/* An app's status tag. The plain .badge above stays the neutral accent colour;
   only these four carry a meaning worth a colour. */
.badge--published { background: var(--tag-published-bg); color: var(--tag-published-fg); }
.badge--testing { background: var(--tag-testing-bg); color: var(--tag-testing-fg); }
.badge--development { background: var(--tag-development-bg); color: var(--tag-development-fg); }
.badge--conception { background: var(--tag-conception-bg); color: var(--tag-conception-fg); }

/* The line under a conception-phase app's link lists: it borrows the tag's
   own colour, so the badge above and the sentence below read as one statement. */
.note--concept {
  border-left: 3px solid var(--tag-conception-fg);
  padding-left: .6rem;
  margin-top: .4rem;
}

/* The line under a pre-release app's legal links, and the page those links
   open. Two statuses share it, so it borrows neither badge's colour. */
.note--prerelease {
  border-left: 3px solid var(--border);
  padding-left: .6rem;
  margin-top: .4rem;
}
.doc-placeholder .note--prerelease {
  border-left-width: 4px;
  margin: 0 0 1.25rem;
  font-size: 1rem;
}

/* app page */

.app-hero {
  background: var(--bg-alt); border-bottom: 1px solid var(--border);
  margin: -2.5rem 0 2.5rem; padding: 2.5rem 0;
}
.app-hero__actions { margin-top: 1.25rem; }

.button {
  display: inline-block;
  background: var(--accent); color: var(--accent-fg);
  padding: .6rem 1.1rem; border-radius: var(--radius);
  text-decoration: none; font-weight: 600; border: 0; cursor: pointer;
  font-size: 1rem; font-family: inherit;
}
.button:hover { filter: brightness(1.08); }

.features { padding-left: 1.15rem; }
.features li { margin: .4rem 0; }

.facts {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
.facts h2 { margin-top: 0; font-size: 1.05rem; }
.facts h3 { font-size: .95rem; }
.facts dl { margin: 0 0 1rem; }
.facts dt { font-weight: 600; font-size: .85rem; color: var(--fg-muted); margin-top: .6rem; }
.facts dd { margin: 0; }
.facts ul { padding-left: 1.1rem; margin: .5rem 0; }

.doclist { list-style: none; padding: 0; margin: .5rem 0; }
.doclist li { margin: .35rem 0; }
/* The effective date sits at the end of the row rather than after the title:
   in a list of four documents the dates line up, which is what makes one of
   them being months older than its neighbours visible at a glance. */
.doclist li:has(.doc-date) { display: flex; gap: .75rem; align-items: baseline; }
.doc-date {
  margin-left: auto; color: var(--fg-muted); font-size: .8rem;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* Available to a screen reader, gone for everyone else. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.gallery {
  display: grid; gap: 1rem; max-width: var(--wrap);
  margin: 2.5rem auto; padding: 0 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
}
.gallery figure { margin: 0; }
.gallery img {
  width: 100%; height: auto; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg-alt);
}
.gallery figcaption { color: var(--fg-muted); font-size: .875rem; margin-top: .4rem; }
.gallery a.shot { display: block; cursor: zoom-in; }

/* Lightbox: the gallery thumbnails are unreadable at column width, so a click
   opens the file at full size. Everything here is inert until base.html's
   script builds the dialog. */
.lightbox {
  border: 0; padding: 0; max-width: 96vw; max-height: 94vh;
  background: transparent; color: var(--fg); overflow: visible;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .82); }
.lightbox__img {
  display: block; max-width: 96vw; max-height: 84vh; width: auto; height: auto;
  margin: 0 auto; border-radius: var(--radius); background: var(--bg-alt);
}
.lightbox__caption {
  color: #f2f4f7; text-align: center; margin: .75rem auto 0;
  max-width: var(--prose); font-size: .95rem;
}
.lightbox__close, .lightbox__nav {
  position: fixed; border: 0; cursor: pointer;
  background: rgba(20, 23, 27, .72); color: #fff;
  font-size: 1.75rem; line-height: 1; padding: .35rem .7rem;
  border-radius: 999px;
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(20, 23, 27, .95); }
.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); font-size: 2.25rem; }
.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }

/* A wide graphic introducing an app, sat between the hero and the body. */
.app-preview { margin: 2rem auto 0; }
.app-preview img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--border); border-radius: var(--radius);
}

/* legal */

.legal-index { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.legal-app {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem;
  background: var(--bg-alt);
}
.legal-app h2 { margin-top: 0; font-size: 1.1rem; }

.crumbs { color: var(--fg-muted); font-size: .9rem; margin-bottom: 1rem; }
.doc-meta { color: var(--fg-muted); font-size: .875rem; }

.document blockquote {
  margin: 1.5rem 0; padding: .75rem 1.15rem;
  border-left: 4px solid var(--accent); background: var(--bg-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.document blockquote p { margin: 0; }
.document h2 { border-bottom: 1px solid var(--border); padding-bottom: .3rem; }
.document ul, .document ol { padding-left: 1.25rem; }
.document li { margin: .35rem 0; }
.document hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; margin: 1rem 0; font-size: .95rem; }
th, td { border: 1px solid var(--border); padding: .5rem .65rem; text-align: left; vertical-align: top; }
th { background: var(--bg-sunken); }

/* forms */

.crypto-address {
  display: inline-block;
  word-break: break-all;
  font-size: .85rem;
  padding: .5rem .75rem;
  background: var(--bg-sunken);
  border-radius: var(--radius);
  max-width: 100%;
}

.report-form { max-width: var(--prose); margin: 1.5rem 0; }
.report-form p { margin: 0 0 1rem; }
.report-form label { display: block; font-weight: 600; margin-bottom: .3rem; }
.report-form input, .report-form select, .report-form textarea {
  width: 100%; padding: .55rem .7rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg); color: var(--fg);
  font: inherit;
}
.report-form textarea { resize: vertical; }
.report-form__actions { margin-top: 1.25rem; }

/* Language toggle (EN/DE) — global, in the site header. */
.lang-toggle {
  display: flex; gap: .25rem;
}
.lang-toggle__btn {
  border: 1px solid var(--border); background: var(--bg);
  color: var(--fg-muted); font: inherit; font-size: .8rem; font-weight: 600;
  padding: .2rem .5rem; border-radius: var(--radius); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.lang-toggle__btn:hover { border-color: var(--accent); color: var(--accent); }
.lang-toggle__btn[aria-pressed="true"] {
  background: var(--accent); color: var(--accent-fg); border-color: var(--accent);
}

@media (max-width: 40rem) {
  .site-header .wrap { padding-left: .5rem; padding-right: .5rem; }
  .site-header__inner { min-height: 0; padding-top: .75rem; padding-bottom: .75rem; flex-wrap: wrap; }
  .site-header__right { gap: .5rem; flex-wrap: nowrap; }
  .site-nav { gap: .5rem; }
  .site-nav > span { gap: .5rem; }
  .site-nav a { font-size: .9rem; }
  .lang-toggle { gap: .15rem; }
  .lang-toggle__btn { font-size: .7rem; padding: .15rem .4rem; }
  .hero, .app-hero { padding: 2rem 0; }
  .cols { gap: 1.75rem; }
}

/* Russian Grammar Nutsie's recognition marks, inline in prose.
   Shape, size and colour are emitted by build.py onto the element itself, so a
   mark renders correctly with this stylesheet missing, stale or disabled — it
   used to depend on rules here, and a cached copy of this file turned every
   mark into a 300x150px blob. What is left here is spacing only. */
.mark { vertical-align: -0.14em; margin: 0 .1em; }
.mark svg { display: inline-block; vertical-align: baseline; }

/* Example videos on an app page. The element already carries its own sizing
   (see clip_figure in build.py); this only matches it to the gallery. */
.videos figure { margin: 0; }
.videos video {
  width: 100%; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg-alt);
}
.videos figcaption { color: var(--fg-muted); font-size: .875rem; margin-top: .4rem; }
