/*
  The one stylesheet for the three pages (index, privacy, support).

  The look is the app's: white paper, blue-black ink, a serif for reading,
  and one red, the wax seal. The colours are the ones in
  ios/PS/Theme/Paper.swift. Nothing is loaded from anywhere else: no web
  fonts, no scripts, no cookies. The handwriting is picture files that sit
  beside this one (name.svg, lead.svg and lead-still.svg).

  For a Java person: the names under :root are constants (`static final`),
  read further down with var(--name). Change a colour here and every page
  follows.
*/

:root {
  --paper: #FFFFFF;
  --ink: #23263A;
  --muted: #6B665F;
  --rule: #E9E3D9;
  --seal: #C8322B;

  /* The fonts are ones the reader's device already has. The browser takes
     the first name in the list that it finds. */
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;

  /* Tells the browser these pages are light only, so it does not darken them itself. */
  color-scheme: light;
}

/* Widths include padding and border. Without this, padding makes a box wider than its stated width. */
* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.15rem;      /* rem = a multiple of the reader's own text size, so it respects their setting */
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;   /* stops iPhone Safari enlarging text when the phone is turned sideways */
}

/* The column of text. max-width keeps lines a comfortable length on a wide
   screen; `margin: 0 auto` centres it; the padding is the page margin on a phone. */
main {
  max-width: 34rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

/* The name at the top of every page, written in the hand (name.svg). It is a
   link home. The font-size is only for the moment before the picture
   arrives, and for the word shown in its place if it never does. */
.name {
  display: block;
  font-size: 2.2rem;
  font-style: italic;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  margin: 0 0 1.5rem;
}

/* A picture of handwriting is sized by its height or its width, and the
   other follows (`auto`), so it is never stretched. max-width stops it
   being wider than a narrow phone. */
.name img { height: 4.75rem; width: auto; vertical-align: middle; }

h1 {
  font-size: 1.7rem;
  font-weight: 400;
  line-height: 1.3;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1.15rem;
  font-weight: 400;
  font-style: italic;
  margin: 2.5rem 0 0.5rem;
}

p, ul { margin: 0 0 1.1rem; }
ul { padding-left: 1.2rem; }
li { margin: 0 0 0.4rem; }

a { color: var(--ink); text-underline-offset: 0.15em; }
a:hover { color: var(--seal); }

/* A visible outline for people who move through the page with a keyboard. */
a:focus-visible { outline: 2px solid var(--seal); outline-offset: 3px; }

/* The quiet line under a heading: a date, a hint. */
.quiet { color: var(--muted); font-size: 1rem; }

/* The home page only: everything centred, the envelope in the middle. */
.home { text-align: center; }
.home .lead { font-size: 1.35rem; font-style: italic; line-height: 1.5; }
.home .lead img { display: block; width: 23rem; max-width: 100%; height: auto; margin: 0 auto; }
.home svg { display: block; width: 11rem; height: auto; margin: 2.5rem auto; }

/* The links at the bottom of every page, above a hairline. */
footer {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  border-top: 1px solid var(--rule);
  text-align: center;
  font-size: 1rem;
  color: var(--muted);
}
footer a { color: var(--muted); margin: 0 0.6rem; }
