/* Palette and typography follow ssi.inc. */
:root {
  --bg: #111213;
  --fg: #d6d6d6;
  --accent: #39ff14;
  --muted: #8a8a8a;
  --field-bg: #191a1b;
  --border: #3a3c3e;
  --error: #ff6b6b;

  /* dark scrollbars, dropdowns and file pickers */
  color-scheme: dark;
}

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

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

body {
  padding: 0 1.15rem;
  margin: 50px auto;
  max-width: 650px;
  background-color: var(--bg);
  color: var(--fg);
  font-family:
    "SF Mono", "SFMono-Regular", ui-monospace,
    Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

h1 {
  font-size: 1.15rem;
  font-weight: bold;
  margin: 0 0 1.25rem;
}

h2 {
  font-size: 0.95rem;
  font-weight: bold;
  margin: 2rem 0 0.85rem;
}

ul {
  padding-left: 1.5rem;
}

.e8 {
  margin: 2.5rem 0 1rem;
  text-align: center;
}

.e8 canvas {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

.e8 figcaption {
  max-width: 34rem;
  margin: 0.85rem auto 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

/* Halmos tombstone closing the page, as at the end of a proof. */
.qed {
  margin: 2rem 0 0;
  text-align: right;
  font-size: 1.1rem;
}

.back {
  margin: 0 0 1.5rem;
}

.apply-form p {
  margin: 0 0 1.1rem;
}

.apply-form label {
  display: block;
  font-weight: bold;
}

.apply-form .optional {
  font-weight: normal;
  color: var(--muted);
}

.apply-form .hint {
  display: block;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0.2rem 0 0.4rem;
  max-width: 34rem;
}

.apply-form input,
.apply-form select,
.apply-form textarea {
  display: block;
  width: 100%;
  max-width: 34rem;
  margin-top: 0.3rem;
  padding: 0.4rem 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--fg);
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: 2px;
}

.apply-form textarea {
  resize: vertical;
}

/* The bordered box the text fields get looks wrong wrapped around a file
   picker, which draws its own button. */
.apply-form input[type="file"] {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  font-size: 0.8rem;
}

.apply-form input:focus,
.apply-form select:focus,
.apply-form textarea:focus {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.apply-form .field-error {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--error);
}

.apply-form button {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 1.2rem;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 2px;
  cursor: pointer;
}

.apply-form button:hover,
.apply-form button:focus {
  background: transparent;
  color: var(--accent);
}

.apply-form .submit {
  margin-top: 1.75rem;
}

.apply-form button[disabled] {
  opacity: 0.5;
  cursor: default;
}

.form-status {
  margin-left: 0.85rem;
  color: var(--muted);
}

.form-status.error {
  color: var(--error);
}

/* Honeypot: positioned off-screen rather than display:none, which some bots
   know to skip. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------------------------------------------------------------- phones */

@media (max-width: 30rem) {
  body {
    /* 50px of dead space above the fold is a lot on a short screen */
    margin: 1.75rem auto;
    font-size: 0.85rem;
    /* monospace wraps into short ragged lines here, so open the leading up */
    line-height: 1.6;
  }

  h1 {
    font-size: 1.05rem;
    margin-bottom: 1rem;
  }

  h2 {
    font-size: 0.9rem;
    margin: 1.6rem 0 0.7rem;
  }

  p {
    margin: 0 0 1rem;
  }

  ul {
    /* claw back width for the text itself */
    padding-left: 1.1rem;
  }

  li {
    margin-bottom: 0.45rem;
  }

  .e8 {
    margin: 1.5rem 0 0.5rem;
  }

  .e8 figcaption {
    font-size: 0.75rem;
    text-align: left;
  }

  .apply-form .hint {
    font-size: 0.78rem;
  }

  /* iOS zooms the whole page when a focused field is under 16px. Anything
     smaller here costs the user a pinch-to-zoom on every single question. */
  .apply-form input,
  .apply-form select,
  .apply-form textarea {
    font-size: 16px;
  }

  .apply-form button {
    width: 100%;
    padding: 0.7rem 1rem;
  }

  /* Beside a full-width button there is no room left for it to sit inline. */
  .form-status {
    display: block;
    margin: 0.7rem 0 0;
  }
}
