/* Concern: the ground, tokens and element defaults every portal page shares | Non-concern: any page's own layout | IO: none */
:root {
  --paper: #111110;
  --stage: #191918;
  --paper-sunk: #222221;
  --lift: #2a2a28;
  --rule: #3b3a37;
  --rule-strong: #62605b;
  --ink-soft: #b5b3ad;
  --ink: #eeeeec;
  --mark: #d98878;
  --pass: #79b58c;
  --focus: var(--mark);

  --ground: radial-gradient(125% 90% at 50% 34%, var(--lift), var(--paper) 68%);

  --step: 4px;
  --bar: 48px;
  --cell: clamp(14rem, 44vh, 26rem);
  --meta: 13px;
  --measure: 46rem;

  --sans: ui-sans-serif, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.45 var(--sans);
  -webkit-text-size-adjust: 100%;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  padding: calc(var(--step) * 1.5) calc(var(--step) * 3);
  min-height: 36px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--rule);
}

button:disabled {
  color: var(--rule-strong);
  border-color: var(--rule);
  cursor: default;
}

input,
select,
textarea {
  font: inherit;
  color: inherit;
  background: var(--paper-sunk);
  border: 1px solid var(--rule-strong);
  border-radius: 0;
  padding: var(--step) calc(var(--step) * 1.5);
  min-height: 36px;
}

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

a {
  color: var(--ink);
}

::placeholder {
  color: var(--ink-soft);
  opacity: 1;
}

@media (max-width: 34rem) {
  :root {
    /* A phone's keyboard resizes the page it comes up over, so the cell is measured against a width no keyboard can take. */
    --cell: clamp(11rem, 64vw, 18rem);
  }
}

/* A touched screen gets thumb-sized controls and a floor under the smallest type. */
@media (max-width: 48rem) {
  :root {
    --bar: 56px;
    --meta: 14px;
  }

  button {
    min-height: 44px;
    min-width: 44px;
  }

  input,
  select,
  textarea {
    min-height: 44px;
  }
}
