/* 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;
}

/* The starfield is dimmed, as it was on the old site: a black sheet at three
   tenths over the canvas. Without it the stars are the brightest thing on the
   page and the wordmark has to compete with them - which is why this looked
   harsher than the original even with the same stars moving the same way. */
#starfield-dim {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #000;
  opacity: 0.3;
  pointer-events: none;
}

.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. */
/* The same wordmark the panel and the e-mails use: MomentumX is the thing
   being said, Fund is the qualifier. It was set in small uppercase with wide
   letter-spacing, which is the old site's treatment and reads as a different
   company beside everything else we send out. */
.wordmark {
  margin: 0 0 18px;
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.wordmark strong {
  font-weight: 600;
}

.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 {
  /* Further down. It sat close enough to the button to read as part of it. */
  margin-top: 62px;
  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 34px;
}

.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: 20px;
}

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

.field {
  margin-bottom: 10px;
  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: 92px;
  resize: vertical;
}

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

/* Three of these appear at once on a form nobody filled in, and each one
   pushes the address block below the bottom edge of the panel. Small and
   tight, so the card still fits when everything is wrong. */
.field-error {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
  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: 14px 0 0;
  padding: 9px 12px;
  font-size: 13px;
  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 ------------------------------------------------- */

/* Three columns while three columns fit, and fewer when they do not.
   The panel is at most 460px wide whatever the window is doing, so a fixed
   three-way split leaves each column about 130px - and the web address is
   wider than that. It was being cut off mid-word. auto-fit drops to two
   columns, then one, at the point where the text stops fitting, and the
   values break rather than run past the edge. */
.details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 14px 16px;
  margin-top: 24px;
  font-size: 14px;
}

.details p,
.details a {
  overflow-wrap: anywhere;
}

.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;
  /* Measured at 65px and asked to lose a seventh of that. The height is the
     button plus the padding around it, and the button is the part nobody wants
     smaller, so the padding gives up the ten pixels. */
  padding: 9px 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; }
}


/* --- corrections ---------------------------------------------------------- */

/* The block sits a little above the middle. Dead-centre puts the logo lower
   than the eye expects on a page whose whole content is one column. */
.intro {
  padding-bottom: 110px;
}

/* The button was as wide as a paragraph and sat right under the text. Smaller,
   and with room above it. */
.button-row {
  margin-top: 30px;
}

.button {
  padding: 12px 22px;
  font-size: 11px;
}

/* The cookie notice was black on black and disappeared into the page. */
.cookies {
  background: #ffffff;
  color: #333333;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.35);
}

.cookies button {
  background: #333333;
  color: #ffffff;
  border: 1px solid #333333;
}

.cookies button:hover {
  background: #ffffff;
  color: #333333;
}

/* Closing the contact panel. Opening something with no way back is the kind of
   thing that only looks fine to whoever built it. */
.contact-close {
  position: absolute;
  top: 14px;
  right: 18px;
  z-index: 2;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 26px;
  line-height: 1;
  color: #333333;
  background: transparent;
  border: 0;
  cursor: pointer;
  opacity: 0.55;
}

.contact-close:hover {
  opacity: 1;
}

/* The links, and the button that shows them where the bar is too narrow. */
.bar-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.menu-button {
  display: none;
}

@media (max-width: 720px) {
  .menu-button {
    display: block;
  }

  .bar-links {
    position: absolute;
    top: var(--bar);
    right: 18px;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: none;
  }

  .bar-links.is-open {
    display: flex;
  }
}
