/* focus127.co
   Set like a letter rather than a landing page: one column, a book face,
   and one thing that moves (fig. 1). Palatino on a Mac, Georgia on most other things.
   No webfonts: the page should be on screen before you've finished blinking. */

:root {
  --paper: #f5f1e8;
  --ink: #1f1d1a;
  --pencil: #6f6a60;      /* secondary text */
  --rule: #d9d2c3;
  --blue: #1c49c9;        /* the app's blue, as fountain-pen ink */
  --card: #fbf9f4;

  --face: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Warm, not black. Reading at night shouldn't feel like a terminal. */
    --paper: #1b1a17;
    --ink: #e9e4d8;
    --pencil: #9d978a;
    --rule: #3a3731;
    --blue: #9db5f5;
    --card: #23221e;
  }
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  font: 1.1875rem/1.6 var(--face);   /* 19px: big enough to read on a phone at arm's length */
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  hanging-punctuation: first;
}

body {
  margin: 0 auto;
  padding: 3.5rem 1.25rem 3rem;
  max-width: 35rem;                  /* about 65 characters a line */
}

::selection { background: color-mix(in srgb, var(--blue) 22%, transparent); }

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 2px; }

p { margin: 0 0 1em; }

/* --- top --- */

.masthead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: .9rem;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  color: inherit;
  text-decoration: none;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
/* Old-style figures, so the 127 sits in the line like it was always part of the word. */
.wordmark span { font-variant-numeric: oldstyle-nums; color: var(--blue); }

.place {
  color: var(--pencil);
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* --- words --- */

.lede {
  font-size: 1.6rem;
  line-height: 1.3;
  letter-spacing: -.01em;
  margin-bottom: 1.2em;
  text-wrap: balance;
}

section { margin-top: 2.75rem; }

h2 {
  font-size: .8rem;
  font-weight: normal;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--pencil);
  margin: 0 0 .9rem;
}

strong { font-weight: 600; }

.rules { padding-left: 1.4em; margin: 0 0 1em; }
.rules li { margin-bottom: .5em; padding-left: .2em; }
.rules li::marker { color: var(--pencil); font-variant-numeric: oldstyle-nums; }

/* --- fig. 1 ---
   The field (field.js). Wider than the text, like a plate in a book. The
   characters are plain text in whatever monospace you have, so it comes out
   a little different on every machine. That's fine. */

.plate {
  --w: min(100vw - 2.5rem, 52rem);
  width: var(--w);
  margin: -1rem 0 2.75rem calc(50% - var(--w) / 2);
}

.field {
  margin: 0;
  height: 17.6em;                   /* 16 lines at 1.1 */
  overflow: hidden;
  font: 11px/1.1 var(--mono);
  color: color-mix(in srgb, var(--ink) 78%, var(--paper));
  user-select: text;
  touch-action: manipulation;
  cursor: crosshair;
  -webkit-tap-highlight-color: transparent;
}

.plate figcaption {
  margin-top: .6rem;
  font: italic .8rem/1.4 var(--face);
  color: var(--pencil);
}

/* --- work --- */

.work { margin: 0 0 1.25em; }
.work dt { font-weight: 600; }
.work dd { margin: .2em 0 1em; }
.work .when {
  font: .72rem var(--mono);
  color: var(--pencil);
  white-space: nowrap;
  margin-left: .35em;
}

time { font-variant-numeric: oldstyle-nums; }

footer {
  margin-top: 4rem;
  padding-top: .9rem;
  border-top: 1px solid var(--rule);
  color: var(--pencil);
  font-size: .8rem;
}
footer p { margin: 0; }

@media (max-width: 30rem) {
  html { font-size: 1.0625rem; }
  body { padding-top: 2rem; }
  .masthead { margin-bottom: 2.25rem; }
  .lede { font-size: 1.4rem; }
  .field { font-size: 9px; }
}

@media print {
  html { background: none; color: #000; }
  a { color: inherit; }
}
