/* eidovelle.com
 *
 * The whole site is five static HTML files, one stylesheet, two self-hosted fonts, and no
 * JavaScript at all. That is not minimalism for its own sake. The product's argument is that it
 * is more careful than its category, and the two claims this site makes about itself, that
 * nothing here flashes and that nothing here watches you, are both claims a reader can only
 * verify by looking at what the page loads. A page with no script and no third-party request can
 * be checked in about ten seconds. A page with either cannot be checked at all.
 *
 * _headers carries the machine-readable half of the same promise: default-src 'none' means the
 * browser refuses a script even if one were added to a page by accident.
 *
 * Palette and faces come from ios/Eidovelle/UI/Theme.swift, so the site and the app are the same
 * object rather than two things that resemble each other. The semantics from that file hold here
 * too: the dark is the field, brass is the instrument, teal is what you sail toward. Nothing
 * structural is teal and no world is brass.
 */

/* The fonts are subset copies of the exact variable TTFs the app bundles. Rebuild with
 * web/tools/build-fonts.py. swap rather than block because the safety copy is the reason
 * somebody is on this page, and it should be readable in a local serif before it is beautiful. */
@font-face {
  font-family: "Cormorant Garamond";
  src: url("/fonts/cormorant-garamond.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/fonts/source-sans-3.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --void: #04050c;
  --deep: #080a14;
  --panel: #0d1120;
  --panel-hi: #141a2c;

  --brass: #c9a961;
  --brass-hi: #e8cc7a;
  --brass-dim: #8a7444;
  --brass-deep: #5c4b2c;

  --teal-hi: #7fe0d4;

  /* Body text is the app's cream held slightly back from full, because a full-strength cream on
   * this black is a harder read at 17px on a phone than it is at 15pt on a device held at arm's
   * length. Contrast against --deep is about 15:1 for --text and about 9:1 for --text-dim, both
   * comfortably past WCAG AA at body size. --brass-dim is a rule colour and is never used for
   * text: at about 4.2:1 it would pass only at large sizes and would then invite being reused at
   * small ones. */
  --text: #e4dcca;
  --text-dim: #c4b99e;

  --display: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --ui: "Source Sans 3", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --measure: 34rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);

  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--ui);
  font-size: 1.0625rem;
  line-height: 1.7;
  font-variant-numeric: lining-nums;
  text-rendering: optimizeLegibility;
}

/* Nothing on this site moves. There is no animation and no transition to disable, so this block
 * exists to state that rather than to do anything, and it is a test: if a future change adds
 * motion, this rule is where somebody has to argue with the decision. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Skip link ---------------------------------------------------------- */

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10;
  background: var(--panel-hi);
  color: var(--text);
  padding: 0.6rem 1rem;
  border: 1px solid var(--brass);
}
.skip:focus { left: 0; }

/* ---- Layout ------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: calc(var(--measure) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Tables and the limits grid need more room than a line of prose does. */
.wrap--wide { max-width: calc(52rem + var(--gutter) * 2); }

main { display: block; padding-top: 2.5rem; }

section { margin: 0 0 2.75rem; }

/* ---- Header ------------------------------------------------------------- */

.site-head {
  border-bottom: 1px solid var(--brass-deep);
  background: var(--deep);
}
.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.wordmark {
  font-family: var(--display);
  font-weight: 300;
  font-size: 1.35rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  margin-right: auto;
}
.wordmark:hover, .wordmark:focus-visible { color: var(--brass-hi); }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; }
.site-nav a {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--brass);
  text-decoration: none;
}
.site-nav a:hover, .site-nav a:focus-visible { color: var(--brass-hi); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--text); }

/* ---- Type --------------------------------------------------------------- */

h1, h2, h3, h4 { color: var(--text); font-weight: 300; margin: 0 0 0.6rem; }

h1 {
  font-family: var(--display);
  font-size: clamp(2.1rem, 6.5vw, 3.1rem);
  line-height: 1.12;
  margin-bottom: 1rem;
}

h2 {
  font-family: var(--display);
  font-size: clamp(1.55rem, 4vw, 2.05rem);
  line-height: 1.2;
  margin-top: 2.75rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--brass-deep);
}

/* The first heading after a page intro should not carry a rule, because the rule under the site
 * header is already doing that job two inches above it. */
h2.flush { border-top: 0; padding-top: 0; margin-top: 2rem; }

h3 {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 1.06rem;
  line-height: 1.4;
  margin-top: 2rem;
  color: var(--text);
}

h4 {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 0.98rem;
  margin-top: 1.5rem;
  color: var(--text-dim);
}

p { margin: 0 0 1.1rem; }

/* The app's signature treatment: small, wide-tracked, upper case, struck into brass. It is what
 * makes a four-word label look stamped rather than typed. */
.struck {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 0.7rem;
}

.lede {
  font-size: 1.18rem;
  line-height: 1.6;
  color: var(--text);
}

.dim { color: var(--text-dim); }

.small { font-size: 0.92rem; line-height: 1.6; color: var(--text-dim); }

strong, b { font-weight: 600; color: var(--text); }

a {
  color: var(--brass);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { color: var(--brass-hi); }

:focus-visible {
  outline: 2px solid var(--brass-hi);
  outline-offset: 2px;
}

ul, ol { margin: 0 0 1.1rem; padding-left: 1.25rem; }
li { margin-bottom: 0.55rem; }
li::marker { color: var(--brass-dim); }

hr {
  border: 0;
  border-top: 1px solid var(--brass-deep);
  margin: 2.5rem 0;
}

/* ---- Panels ------------------------------------------------------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--brass-deep);
  padding: 1.35rem var(--gutter);
  margin: 0 0 1.6rem;
}
.panel > :last-child { margin-bottom: 0; }
.panel h2, .panel h3 { margin-top: 0; border-top: 0; padding-top: 0; }

/* The one thing on the site that has to be findable by somebody who is not reading. */
.stop {
  background: var(--panel-hi);
  border: 1px solid var(--brass);
  border-left-width: 3px;
  padding: 1.35rem var(--gutter);
  margin: 0 0 1.6rem;
}
.stop > :last-child { margin-bottom: 0; }

/* The abort instruction. A closed string: "Cover one eye with your palm. Turn the phone face
 * down." is one recording in the app, played three times, never paraphrased, and the web copy
 * uses the same words. It gets its own class rather than living under .stop, because on the
 * support page it appears outside a panel and must look identical in both places. */
.instruction {
  font-family: var(--display);
  font-size: clamp(1.35rem, 4.4vw, 1.8rem);
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 0.8rem;
}

.note {
  border-left: 2px solid var(--brass-dim);
  padding: 0.1rem 0 0.1rem 1.1rem;
  margin: 0 0 1.6rem;
}
.note > :last-child { margin-bottom: 0; }

/* ---- Contact addresses -------------------------------------------------- */

.address {
  display: inline-block;
  font-size: 1.12rem;
  font-weight: 600;
  word-break: break-word;
}

.address--safety {
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  color: var(--brass-hi);
}

/* ---- Checklist ---------------------------------------------------------- */

/* Drawn boxes rather than real checkboxes. A checkbox with no script behind it is a control that
 * appears to record something and records nothing, sitting next to a paragraph that says ticking
 * a box is not the screening. */
.checklist { list-style: none; padding-left: 0; }
.checklist li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.9rem;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.85rem;
  height: 0.85rem;
  border: 1px solid var(--brass);
}

/* ---- Worlds ------------------------------------------------------------- */

.worlds { list-style: none; padding-left: 0; }
.worlds li { margin-bottom: 1.1rem; }
.worlds .name {
  display: block;
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--teal-hi);
}
.worlds .what { display: block; color: var(--text-dim); font-size: 0.98rem; line-height: 1.55; }

/* ---- Tables ------------------------------------------------------------- */

.scroller {
  overflow-x: auto;
  margin: 0 0 1.6rem;
  border: 1px solid var(--brass-deep);
  -webkit-overflow-scrolling: touch;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: 0.94rem;
  line-height: 1.55;
}
caption {
  text-align: left;
  padding: 0.9rem 1rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--brass-deep);
}
th, td {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(92, 75, 44, 0.55);
}
thead th {
  color: var(--brass);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: var(--panel);
}
tbody tr:last-child td { border-bottom: 0; }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ---- Contents ----------------------------------------------------------- */

.contents { list-style: none; padding-left: 0; columns: 2; column-gap: 2rem; }
.contents li { margin-bottom: 0.4rem; break-inside: avoid; font-size: 0.95rem; }
@media (max-width: 34rem) { .contents { columns: 1; } }

/* ---- Footer ------------------------------------------------------------- */

.site-foot {
  border-top: 1px solid var(--brass-deep);
  background: var(--deep);
  margin-top: 4rem;
  padding: 2.5rem 0 3.5rem;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-dim);
}
.site-foot .wrap > * { margin-bottom: 1.1rem; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; padding-left: 0; list-style: none; }
.foot-nav li { margin-bottom: 0; }
.foot-nav a {
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  text-decoration: none;
}
.foot-nav a:hover, .foot-nav a:focus-visible { text-decoration: underline; }
.site-foot .rule { border: 0; border-top: 1px solid var(--brass-deep); margin: 0 0 1.4rem; }

/* ---- Print -------------------------------------------------------------- */

/* Somebody is going to print the safety page and take it to a doctor. That is a good use of it
 * and it should not come out as white on black. */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-head, .site-nav, .foot-nav, .skip { display: none; }
  a { color: #000; }
  a[href^="/"]::after { content: " (eidovelle.com" attr(href) ")"; font-size: 9pt; }
  .panel, .stop, .scroller { border: 1px solid #666; background: #fff; }
  h1, h2, h3, h4, .struck, .address, .address--safety { color: #000; }
  h2 { border-top: 1px solid #666; }
  .dim, .small, .site-foot { color: #333; }
}
