/*
 * Reset and base typography shared by every frame. Dark theme only (spec 7.1):
 * ebony page, ivory text, brass focus ring.
 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--ebony);
  color: var(--ivory);
  font-family: var(--font-text);
  font-weight: var(--weight-body);
  font-size: var(--type-body-size);
  line-height: var(--type-body-leading);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Jost is installed at 300, 400 and 500 only: a heavier weight shows the
     nearest real one instead of a smeared imitation. Slanting stays allowed,
     as Jost has no italic. */
  font-synthesis: style;
}

/* Browsers make these bold, a weight neither family has: 500 is the
   strongest the text face goes. */
b,
strong,
th,
h4,
h5,
h6 {
  font-weight: var(--weight-label);
}

/* Elements with display rules of their own (flex, grid) would otherwise
   override the hidden attribute. */
[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul[class],
ol[class] {
  margin: 0;
  padding: 0;
  list-style: none;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

table {
  border-collapse: collapse;
}

::selection {
  background: var(--brass);
  color: var(--ebony);
}

/* Type scale (handoff section 6). Display 600 only below 32px, where 500 looks thin. */
.display {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: var(--type-display-size);
  line-height: var(--type-display-leading);
}

h1,
.h1 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: var(--type-h1-size);
  line-height: var(--type-h1-leading);
}

h2,
.h2 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: var(--type-h2-size);
  line-height: var(--type-h2-leading);
}

h3,
.h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-display-small);
  font-size: var(--type-h3-size);
  line-height: var(--type-h3-leading);
}

h1,
h2,
h3 {
  text-wrap: balance;
}

.lead {
  font-size: var(--type-lead-size);
  line-height: var(--type-lead-leading);
  font-weight: var(--weight-lead);
}

small,
.small {
  font-size: var(--type-small-size);
  line-height: var(--type-small-leading);
}

/* Tracked capitals belong to navigation, buttons and the logo only. */
.label {
  font-size: var(--type-label-size);
  line-height: var(--type-label-leading);
  letter-spacing: var(--type-label-tracking);
  font-weight: var(--weight-label);
  text-transform: uppercase;
}

/* Text columns stay under about 75 characters. */
.measure {
  max-width: 68ch;
}

/* Links in running text keep an underline so they never rely on colour alone;
   classed links (buttons, navigation) style themselves. */
a {
  color: var(--ivory);
  text-decoration: none;
}

a:not([class]) {
  text-decoration-line: underline;
  text-decoration-color: var(--stone);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-decoration-color var(--motion-fast) var(--ease-standard);
}

a:not([class]):hover {
  text-decoration-color: var(--brass);
}

.console a:not([class]) {
  color: var(--brass);
  text-decoration-color: currentColor;
}

.console a:not([class]):hover {
  color: var(--brass-light);
}

/* Focus: a 2px brass ring on keyboard focus everywhere. */
:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  z-index: 1000;
  padding: var(--space-3) var(--space-4);
  background: var(--brass);
  color: var(--ebony);
  font-weight: var(--weight-label);
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: none;
}

/* Motion only answers an action; people who ask for less get none. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
