/*
 * One stylesheet for the whole site.
 *
 * The tokens are octocash's design system, ported: black ground, three foreground steps, Geist and
 * Geist Mono, tight tracking. The discipline is octocash's too. The page itself is monochrome, and
 * the app screenshots are the only colour in it. Do not add an accent to a heading, a rule or a
 * link to make something stand out; make it larger, or give it more room.
 */

@font-face {
  font-family: "Geist";
  src: url("/fonts/geist.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/geist-mono.woff2") format("woff2-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* --- Surfaces --- */
  --ground: #000000;
  --sheet: #0c0c0e;
  --control: #141416;
  --hairline: #1e1e22;

  /* --- Foreground --- */
  --fg: #f2f2f3;
  --fg-2: #8b8b90;
  --fg-3: #55555b;

  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;

  --track-tight: -0.03em;
  --track-snug: -0.02em;
  --track-slight: -0.01em;
  --track-wide: 0.08em;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 28px;
  --space-7: 44px;
  --space-8: 56px;

  --radius-control: 12px;
  --radius-button: 14px;

  --page-gutter: var(--space-5);
  --measure: 720px;

  color-scheme: dark;
}

@media (min-width: 600px) {
  :root {
    --page-gutter: 32px;
  }
}

@media (min-width: 900px) {
  :root {
    --page-gutter: 48px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--ground);
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--fg-2);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

a {
  color: var(--fg);
  text-decoration: none;
}

/* One focus treatment for the whole site, taken from the apps: a ring is a change of shape, not
   only of colour. */
:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
  border-radius: var(--space-1);
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--space-4);
  top: var(--space-4);
  z-index: 2;
  padding: var(--space-2) var(--space-3);
  background: var(--control);
  border-radius: var(--radius-control);
  color: var(--fg);
}

/* ---- structure ---------------------------------------------------------- */

.site-head,
main,
.site-foot {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--page-gutter);
}

.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-6) 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--fg);
}

.brand-name {
  font-size: 1rem;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-snug);
}

.mark {
  width: 22px;
  height: 22px;
  flex: none;
}

.lang {
  color: var(--fg-3);
  font-size: 0.8125rem;
  font-weight: var(--weight-medium);
  transition: color 140ms ease;
}

.lang:hover {
  color: var(--fg);
}

main {
  padding-block: var(--space-8) var(--space-8);
}

main > section + section {
  margin-block-start: var(--space-8);
}

/* ---- type --------------------------------------------------------------- */

h1 {
  margin: 0 0 var(--space-5);
  color: var(--fg);
  font-size: clamp(2.25rem, 9vw, 2.5rem);
  line-height: 1.1;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-tight);
}

/* Section headings are an eyebrow, not a title: the section's content is what should be read. */
h2 {
  margin: 0 0 var(--space-5);
  color: var(--fg-3);
  font-size: 0.75rem;
  line-height: 1.333;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
}

p {
  margin: 0 0 var(--space-4);
  max-width: 62ch;
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

.lede {
  color: var(--fg);
  font-size: 1.25rem;
  line-height: 1.35;
  letter-spacing: var(--track-snug);
  max-width: 30ch;
  margin-bottom: var(--space-6);
}

.closing {
  margin-top: var(--space-5);
  color: var(--fg-3);
}

/* ---- the apps ----------------------------------------------------------- */

.apps ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-8);
}

.app {
  display: grid;
  gap: var(--space-5);
}

/* The one place a screenshot is allowed to be: a phone-shaped frame on the sheet colour, so the
   app's own light interface has an edge to sit against instead of bleeding into the ground. */
.shot {
  display: grid;
  place-items: center;
  aspect-ratio: 430 / 880;
  max-width: 240px;
  overflow: hidden;
  background: var(--sheet);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-button);
}

.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* An app whose shot does not exist yet. Dashed rather than solid, so the frame reads as waiting
   for something rather than as a black panel somebody meant to put there. */
.shot:has(.shot-empty) {
  background: none;
  border-style: dashed;
}

.shot-empty {
  padding: var(--space-4);
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: var(--track-slight);
  text-align: center;
}

.app h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.2;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-snug);
}

/* The arrow is the affordance, so it is always there; the hover only moves it. */
.app h3 a::after {
  content: "\2197";
  display: inline-block;
  margin-inline-start: 0.3em;
  color: var(--fg-3);
  font-weight: var(--weight-regular);
  transition:
    color 160ms ease,
    transform 160ms ease;
}

.app h3 a:hover::after,
.app h3 a:focus-visible::after {
  color: var(--fg);
  transform: translate(1px, -1px);
}

.tagline {
  margin: var(--space-2) 0 0;
  color: var(--fg-2);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: var(--track-slight);
}

.app-body {
  margin: var(--space-4) 0 0;
}

/* From the breakpoint up the frame stands beside the words instead of above them; below it, a
   phone-shaped image next to a paragraph would leave both too narrow to read. */
@media (min-width: 600px) {
  .app {
    grid-template-columns: 240px 1fr;
    gap: var(--space-7);
    align-items: start;
  }
}

/* ---- legal pages -------------------------------------------------------- */

.prose h1 {
  font-size: clamp(1.75rem, 7vw, 2rem);
  margin-bottom: var(--space-2);
}

.prose .updated {
  margin-bottom: var(--space-8);
  color: var(--fg-3);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}

.prose section {
  margin-block-end: var(--space-7);
}

.prose section:last-child {
  margin-block-end: 0;
}

.prose h2 {
  margin-bottom: var(--space-3);
  color: var(--fg);
  font-size: 1rem;
  line-height: 1.25;
  font-weight: var(--weight-semibold);
  letter-spacing: var(--track-snug);
  text-transform: none;
}

.prose a {
  text-decoration: underline;
  text-decoration-color: var(--fg-3);
  text-underline-offset: 0.2em;
}

.prose a:hover {
  text-decoration-color: var(--fg);
}

.prose address {
  margin-block: var(--space-5) 0;
  padding: var(--space-4) var(--space-5);
  background: var(--sheet);
  border-radius: var(--radius-control);
  color: var(--fg);
  font-style: normal;
}

/* ---- footer ------------------------------------------------------------- */

.site-foot {
  padding-block: var(--space-6) var(--space-8);
  color: var(--fg-3);
  font-size: 0.8125rem;
}

.site-foot::before {
  content: "";
  display: block;
  height: 1px;
  background: var(--hairline);
  margin-bottom: var(--space-6);
}

.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin-bottom: var(--space-3);
}

.site-foot a {
  color: var(--fg-2);
  transition: color 140ms ease;
}

.site-foot a:hover {
  color: var(--fg);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
