/* The public page.
 *
 * It is one screen: a dark field of stars, the mark, the sentence that says
 * what the fund is, and a way to get in touch. The contact form slides in over
 * half of it rather than living on a page of its own, because there is nothing
 * else to navigate to and a second page would be a second page of nothing.
 *
 * Written against no framework. The page it replaces loaded Bootstrap, jQuery
 * and eleven plugins to draw a logo, a paragraph and a form - about 400 KB of
 * library for a screen that needs none of it.
 */

/* Source Sans 3 is a variable font: one file covers 300 through 700, so the
   whole family is two requests rather than eight. The same face the panel and
   the e-mails use, so all three read as one thing. */
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/source-sans-3-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/source-sans-3-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #333;
  --paper: rgba(255, 255, 255, 0.94);
  --line: rgba(255, 255, 255, 0.55);
  --bar: 64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  position: relative;
  overflow-x: hidden;
  background: #000;
  color: #fff;
  font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, 'Helvetica Neue', Arial, sans-serif;
  /* 13px with a line height of 1.8, which is what the page had. It reads small
     next to a modern default and that is the size the design was drawn at. */
  font-size: 13px;
  font-weight: 400;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* The stars are drawn onto this, behind everything, and never intercept a
   click. A fixed canvas rather than a scrolling one: the page does not scroll,
   and a starfield that slid with it would look like a moving photograph of
   stars rather than stars. */
#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: block;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100%;
}

/* --- the bar ------------------------------------------------------------- */

.bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: var(--bar);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 26px;
  padding: 0 26px;
}

.bar a {
  color: #fff;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  opacity: 0.85;
  border-bottom: 1px solid transparent;
  transition: opacity 0.2s, border-color 0.2s;
}

.bar a:hover {
  opacity: 1;
  border-bottom-color: var(--line);
}

/* Three lines that become a cross. The same button opens and closes the panel,
   so it has to say which it will do, and rotating the lines is how it says so
   without a word. */
.menu-button {
  position: relative;
  width: 26px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
}

.menu-button span {
  position: absolute;
  left: 0;
  display: block;
  width: 100%;
  height: 1px;
  background: #fff;
  transition: transform 0.3s, opacity 0.2s;
}

.menu-button span:nth-child(1) { top: 0; }
.menu-button span:nth-child(2) { top: 9px; }
.menu-button span:nth-child(3) { top: 18px; }

.contact-open .menu-button span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.contact-open .menu-button span:nth-child(2) { opacity: 0; }
.contact-open .menu-button span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* On a narrow screen the panel covers the whole width, so the links behind it
   would show through the words. The button stays - it is the way out. */
@media (max-width: 991px) {
  .contact-open .bar a { opacity: 0; pointer-events: none; }
}

/* --- the middle ---------------------------------------------------------- */

.intro {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--bar) + 24px) 24px 40px;
  transition: width 0.9s ease, padding 0.9s ease;
  width: 100%;
}

/* The half the panel does not cover. Both move together, which is what makes
   it read as one thing folding rather than two things appearing. */
@media (min-width: 992px) {
  .contact-open .intro { width: 50%; }
}

.intro img {
  width: 190px;
  height: 191px;
  margin-bottom: 15px;
}

/* The mark, at the size and the spacing the page has always had it: 28px, set
   in capitals, letter-spaced a long way apart and drawn in the lightest weight
   there is. The only thing that changed is the typeface - Montserrat gave way
   to the one the panel and the e-mails use, so all three read as one house. */
.wordmark {
  margin: 0 0 15px;
  font-size: 28px;
  font-weight: 200;
  line-height: 1.5;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.intro p {
  max-width: 640px;
  margin: 0 auto;
  color: #fff;
}

.button-row {
  margin: 15px 0 0;
}

.button {
  display: inline-block;
  padding: 14px 26px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
  transition: background-color 0.25s, color 0.25s;
}

.button:hover {
  background: #fff;
  color: var(--ink);
}

.copyright {
  margin-top: 40px;
  font-size: 13px;
  color: #fff;
}

.copyright strong { font-weight: 600; }

/* --- the panel ----------------------------------------------------------- */

.contact {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  width: 50%;
  height: 100%;
  padding: calc(var(--bar) + 20px) 8px 30px;
  overflow-y: auto;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
  transform: translateX(100%);
  transition: transform 0.9s ease;
}

.contact-open .contact { transform: translateX(0); }

@media (max-width: 991px) {
  .contact { width: 100%; }
}

.contact-inner {
  max-width: 460px;
  margin: 0 auto;
  padding: 0 16px;
}

/* A heading with a short rule under it, set apart from the words rather than
   underlining them. */
.ruled {
  position: relative;
  margin: 10px 0 50px;
}

.ruled h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.ruled::after {
  content: '';
  position: absolute;
  bottom: -26px;
  left: 50%;
  width: 40px;
  height: 1px;
  margin-left: -20px;
  background: rgba(51, 51, 51, 0.6);
}

.contact-lead {
  color: #6b6b6b;
  margin-bottom: 26px;
}

/* --- the form ------------------------------------------------------------ */

.field {
  margin-bottom: 14px;
  text-align: left;
}

.field label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: transparent;
  border: 1px solid rgba(51, 51, 51, 0.35);
  border-radius: 0;
  transition: border-color 0.2s;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ink);
}

.field textarea {
  min-height: 110px;
  resize: vertical;
}

.field--bad input,
.field--bad textarea { border-color: #b3261e; }

.field-error {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  color: #b3261e;
}

/* Anything that fills this in is not a person. It is left in the page rather
   than hidden with display:none, which some bots check for. */
.trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.button--solid {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.button--solid:hover {
  background: #fff;
  color: var(--ink);
}

.button[disabled] {
  opacity: 0.55;
  cursor: default;
}

.answer {
  margin: 18px 0 0;
  padding: 12px 14px;
  font-size: 14px;
  text-align: left;
  border: 1px solid;
}

.answer--ok {
  color: #17603a;
  border-color: rgba(23, 96, 58, 0.4);
  background: rgba(23, 96, 58, 0.06);
}

.answer--bad {
  color: #b3261e;
  border-color: rgba(179, 38, 30, 0.4);
  background: rgba(179, 38, 30, 0.06);
}

/* --- what is on the card ------------------------------------------------- */

.details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 54px;
  font-size: 14px;
}

@media (max-width: 600px) {
  .details { grid-template-columns: 1fr; gap: 26px; }
}

.details h3 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.details p {
  margin: 0;
  color: #6b6b6b;
  line-height: 1.6;
}

.details a {
  color: #6b6b6b;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.details a:hover {
  color: var(--ink);
  border-bottom-color: rgba(51, 51, 51, 0.5);
}

/* --- cookies ------------------------------------------------------------- */

.cookies {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 14px 22px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.88);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.cookies[data-show='1'] { display: flex; }

.cookies button {
  padding: 8px 18px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #000;
  background: #fff;
  border: 0;
  cursor: pointer;
}

/* Somebody who would rather not see it move. The stars stop; nothing else
   about the page depends on the animation. */
@media (prefers-reduced-motion: reduce) {
  .intro, .contact, .menu-button span { transition: none; }
}
