/* www.torpor.cc — the one stylesheet.
   Colours, spacing and type sizes are custom properties on :root.
   Light is the default; dark follows the visitor's system setting. */

:root {
  color-scheme: light dark;

  /* Colour */
  --paper: #fbfaf7;
  --ink: #1a1a1a;
  --muted: #595959;
  --rule: #d6d3cc;
  /* Rust. The one accent: links, the wordmark and the focus ring. */
  --accent: #a8431f;
  --todo-paper: #fff3bf;
  --todo-ink: #3d2800;
  --todo-rule: #8a5a00;

  /* Type */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --size-small: 0.875rem;
  --size-body: 1.0625rem;
  --size-h2: 1.375rem;
  --size-h1: clamp(2rem, 1.5rem + 2.5vw, 3rem);
  --leading: 1.6;

  /* Space */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 3rem;
  --space-5: 5rem;
  --gutter: 1.25rem;
  --column: 38rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151515;
    --ink: #ececec;
    --muted: #a8a8a8;
    --rule: #3a3a3a;
    --accent: #f0956e;
    --todo-paper: #3a2e00;
    --todo-ink: #ffe9a0;
    --todo-rule: #ffd43b;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--size-body);
  line-height: var(--leading);
  overflow-wrap: break-word;
}

/* The reading column: header, main and footer share one width. */
.site-header,
main,
.site-footer {
  width: 100%;
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main {
  flex: 1;
  padding-block: var(--space-4) var(--space-5);
}

h1,
h2 {
  line-height: 1.2;
  text-wrap: balance;
}

h1 {
  margin: 0 0 var(--space-3);
  font-size: var(--size-h1);
  letter-spacing: -0.02em;
}

h2 {
  margin: var(--space-4) 0 var(--space-2);
  font-size: var(--size-h2);
}

p,
ul {
  margin: 0 0 var(--space-3);
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 0.12em;
}

:focus-visible {
  outline: 0.1875rem solid var(--accent);
  outline-offset: 0.1875rem;
  border-radius: 0.125rem;
}

img {
  max-width: 100%;
  height: auto;
}

/* Screenshots. Phone-sized, so two sit side by side where there is room. */
.shots {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-block: var(--space-3);
}

figure {
  flex: 1 1 14rem;
  max-width: 24.375rem;
  margin: 0;
}

figure.wide {
  flex-basis: 100%;
  max-width: none;
}

figure img {
  display: block;
  border: 0.0625rem solid var(--rule);
  border-radius: 0.375rem;
}

figcaption {
  margin-top: var(--space-1);
  color: var(--muted);
  font-size: var(--size-small);
}

ul:not(.work-list) {
  padding-inline-start: 1.25rem;
}

ul:not(.work-list) li {
  margin-bottom: var(--space-1);
}

/* Header */
.site-header {
  padding-block: var(--space-3);
}

.wordmark {
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.wordmark:hover {
  text-decoration: underline;
}

/* Footer */
.site-footer {
  padding-block: var(--space-3);
  border-top: 0.0625rem solid var(--rule);
  color: var(--muted);
  font-size: var(--size-small);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: inherit;
}

/* Work list: one entry per project. */
.work-list {
  padding: 0;
  list-style: none;
}

.work-list li {
  padding-block: var(--space-2);
  border-top: 0.0625rem solid var(--rule);
}

.work-list li:last-child {
  border-bottom: 0.0625rem solid var(--rule);
}

.work-list a {
  font-weight: 600;
}

.work-list .about {
  display: block;
  color: var(--muted);
}

/* The label beside a project that is not finished. */
.work-list .state {
  margin-inline-start: var(--space-1);
  color: var(--muted);
  font-size: var(--size-small);
}

/* Placeholders: copy that is waiting on Gary. Meant to be impossible to miss. */
[data-todo] {
  padding: var(--space-2);
  border: 0.125rem dashed var(--todo-rule);
  background: var(--todo-paper);
  color: var(--todo-ink);
  font-family: var(--font-mono);
  font-size: var(--size-small);
}
